BVtkNodes icon indicating copy to clipboard operation
BVtkNodes copied to clipboard

Time Selector for PartFluid.vtk Data

Open ChandlerJH opened this issue 4 years ago • 27 comments

Hello,

When I select the first file of my partfluid in the vtkPolyDataReader node, the time selector node is not reading the time steps. The file names are in the form PartFluid_0100.vtk, PartFluid_0101.vtk etc.

Does anyone know how I can get the node to properly read the file names? Either by changing the names of the files or editing the code for the time selector node?

Thank you

ChandlerJH avatar Jan 26 '21 14:01 ChandlerJH

Hi, did you try to change frame number on Blender Timeline Editor to 100, 101 etc.?

tkeskita avatar Jan 26 '21 16:01 tkeskita

Yes, whenever I change the time step on the time selector node it reverts to the configuration shown in this image. Time

ChandlerJH avatar Jan 26 '21 16:01 ChandlerJH

Don't change time on the Time Selector node, but on the Blender Timeline Editor.

tkeskita avatar Jan 26 '21 16:01 tkeskita

The blender timeline editor shows no changes in my simulation when I change from frame 100 to 101 either.

ChandlerJH avatar Jan 26 '21 16:01 ChandlerJH

Hmm, it works OK for me. Your FileName looks like windows path format, that may be the issue. Did you get that FileName by using the folder icon? Try that. Time Selector should say "No time data on input" upon update.

You could also try to save .blend file to location of your data, so you can set FileName to "//PartFluid_0100.vtk".

Blender 2.83 latest LTS version?

tkeskita avatar Jan 26 '21 18:01 tkeskita

Yes, I'm using the latest version. Would I be able to send you some example files to test out? Sorry for the inconvenience, and I greatly appreciate your active support. Example PartFluid.zip

ChandlerJH avatar Jan 26 '21 22:01 ChandlerJH

Hi, I checked with your data, this seems to be working for me:

Screenshot_2021-01-27_20-37-37

tkeskita avatar Jan 27 '21 18:01 tkeskita

Are you able to play the sequence of files as an animation? Using the exact same node setup I'm still getting different results. Attempt 2

ChandlerJH avatar Jan 27 '21 20:01 ChandlerJH

First, let's rule out the path issue which I mentioned above. Please save .blend file to folder of your data, then set FileName to "//PartFluid_0100.vtk". Does that change anything? Does the number part in the FileName change if you change frame number in Timeline Editor?

I wonder why your Time Selector is showing numbers, since vtkPolyDataReader should not be time aware in VTK 8.1.2. Or are you using VTK 9? I haven't upgraded BVTKNodes to that yet.

tkeskita avatar Jan 28 '21 16:01 tkeskita

I tried saving the .blend file in the same folder as my data, and the following happens. The time selector node initally shows the 'index error' flag, then when changing the timestep in the timeline editor, the time selector node shows 'Time Value: 0.0'.

As for my VTK version, I'm unsure. I'm using the newest version of DualSPHysics to generate these files, which was released after VTK version 9 was, so it's possible I'm on VTK 9.0.

ChandlerJH avatar Jan 28 '21 17:01 ChandlerJH

You can see VTK version in Blender Python Console (by default located in the Scripting workspace) with commands

import vtk
vtk.vtkVersion().GetVTKVersion()

tkeskita avatar Jan 28 '21 18:01 tkeskita

It appears I'm on version 9.0.1, perhaps that's the issue.

ChandlerJH avatar Jan 28 '21 18:01 ChandlerJH

Maybe. Theoretically the code should work, but there might be something in VTK 9 which causes issues. I hope to upgrade VTK in BVTKNodes to version 9 this spring, but I don't know when exactly I will have time. Meanwhile you could maybe downgrade your VTK to 8.1.2, it should work.

tkeskita avatar Jan 28 '21 18:01 tkeskita

Update: I'm on a new machine and switching to VTK version 8.1.2 worked! Thank you.

When rendering an animation, the video produced only shows the first frame. I have auto update on and the frame interval set from 100-110. Do you know how I can render the time sequence as an animation?

ChandlerJH avatar Jan 30 '21 15:01 ChandlerJH

No. Animation update problems between frames can be a mystery (see #31). If I have time I can try to see to this later on.

tkeskita avatar Feb 02 '21 18:02 tkeskita

Hi, I tested this an found out that I'd forgot to add frame update commands for VTK To Blender Mesh. Fixed in latest commit, animation should work now. Thanks for reporting this issue!

tkeskita avatar Feb 06 '21 07:02 tkeskita

Thank you, this is a huge help. With the updated version, rendering an image either crashes blender, or resets the material properties of the mesh to a standard principled BDSF shader.

Is there a way to keep the shader properties for the first time step and apply them to the rest when rendering an animation?

ChandlerJH avatar Feb 06 '21 16:02 ChandlerJH

Yes, should work if you just disable Generate Material setting in the VTK To Blender Mesh node before rendering animation..?

tkeskita avatar Feb 07 '21 10:02 tkeskita

Hello, I have kind of the same problem.

My problem right now is that the scene is not updated when playing the animation. Only a manual update with the update button recreates the scene with the current timeline- timestep. Screenshot from 2021-04-30 20-19-10

Are there any settings in Blender I need to change? I saw that you in the meantime upgraded to vtk 9- so i guess this shouldn't be a vtk-version problem anymore?

dwerner95 avatar Apr 30 '21 19:04 dwerner95

Hello D werner,

If I remember correctly, make sure your .blend file is saved to the same folder as your VTK data. Then change the path in the PolyDataReader node to //drum_0005.vtk

If this doesn't work, I can send you the .blend file that I created, though you may have to make sure you're using the correct version of VTK (I think 8.1.2 unless the author has updated the code).

Chandler

ChandlerJH avatar Apr 30 '21 19:04 ChandlerJH

Hey ChandlerJH,

Thanks for that quick reply! I changed the .blend directory without success. I use vtk version 9 but i can not switch to 8.1.2 as it is not available for python version 3.8 > And i have no idea how i would downgrade the python version in Blender.

Also the Author mentioned in #16 that the BVTKNodes are now upgraded to VTK 9. Best wishes, Dominik

dwerner95 avatar May 01 '21 10:05 dwerner95

Hi @D-werner-bham , yes we're now at VTK 9.0.1. The vtkPolyDataReader in VTK 9 seems to be now time aware, but for some reason it is not detecting different time points correctly. Need to test and dig deeper..

tkeskita avatar May 02 '21 06:05 tkeskita

I couldn't coerce vtkPolyDataReader into reading time steps, maybe it is still not time aware after all? I committed a workaround to code, please remove old version of addon, download and install latest version and try again.

tkeskita avatar May 02 '21 07:05 tkeskita

That works like a charm! Thanks @tkeskita !

dwerner95 avatar May 02 '21 17:05 dwerner95

Hi, I think I have a similar problem with XMLRectilinearGridReader. When I change the frame from Blender Timeline, I need to press Update Node in order for the new time step to be loaded.

image

argapost avatar May 29 '23 14:05 argapost

Hi, that is intended behavior when you use "No Automatic Updates" for the Update Mode (setting located in the Inspect Panel).

tkeskita avatar May 29 '23 14:05 tkeskita

Hi, that is intended behavior when you use "No Automatic Updates" for the Update Mode (setting located in the Inspect Panel).

thanks indeed I had "Update Current Automatically" changed it to "All" and it works now!

argapost avatar May 29 '23 14:05 argapost