-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vtkAssignAttribute Filter #54
base: master
Are you sure you want to change the base?
Conversation
- Started implmentation of dataset attributes filter - Dynamic properties functioning correctly - Odd bug in init file, commented out for now
- Added new filter for setting attrib with blender - Added custom vtk algorithm - Added folder for storing custom algos - Added custom algos to cache
- Added some functions and fixed for group cache - Cache now uses a random index to look up group objects - Allows proper function on reload
- Although ideally node should auto update when switching nodes, this button avoid the need for modular operator.
Thanks Nick! I'll start to test and go through the code, but few initial questions:
BR, |
Got following error with the examples_data/cubeflow OpenFOAM reader case when running update on Info node:
|
About Some filters require activation of one scalar field and one vector field like |
You know, I was worried there was a filter like this that already existed lol. Wasn't aware of this filter existed, but yes. However this means I can make this a custom node instead of a special node and just piggy back off vtkAssignAttribute. Let me see what I can do.
Believe so since it uses the core class, will recheck after I looking into updating it.
Stable I believe, I found it in this VTK blog from 2014. Apparently its this super class specifically made to help with Python algorithms.
I agree, I used that interface because I found the PropertyGroup seems to be the one way to have dynamic lists of properties that dont give you those blender warnings like the enum operator. However, now that you mention it I think setting it up for multiple attributes can be possible in a dynamic way using these prop groups. I'll just bite the bullet and use dynamic enum lists since they are more compact. The tricky part with this node is when the user changes the input connection, how do you get stuff to update ideally with out some modal operator. I'll restructure things, retest and then rebase this PR. Will update again then. |
It looks really interesting, since it allows to do so much in a node with Python. That may become very useful. Good to know it's stable, so it should be pretty safe and will likely stick around. @thomgrand has some work that uses pyvista, I don't know if there is some overlap.
That's a cool solution. This enum definition issue is everywhere, and it has another level: Predefinition is impossible ahead of time (before data exists). Generally speaking: Would it be good to use string variable to store the value (user has the option of writing it themself even before list exists), but then add besides it a button which would generate the dynamic list and let the user pick one, then transfer that value to the string variable? Some kind of general solution for this is needed at some point...
The update logic and error handling will change in #45. I'm not quite there yet though.. Thanks! |
Going to continue to try to tinker with this, will likely default back to some enum props but finding that general solution for dynamic drop downs would be great. Maybe a combo would work... not sure.
No worries, I'll modify when the merge comes.
Yes, the This got me thinking if all of the special nodes could potentially be routed through custom VTK algos such as the BVTK_Node_MultiBlockLeaf or Time_Selector. The functionality would be the same but it would be more integrated into the standard VTK pipeline than manually editing the vtkobjs attributes. Ideas for the future~ |
- Implementation switch from btkSetAttribute to vtkAssignAttribute - Switched to enum drop downs, bring some head aches...
Migrating to making a custom implementation of the As always with these enumitems there's a few bugs going on that I need to see if I can figure out a way around them. Also clean up and rebasing is still needed from all the old stuff as well. |
A new custom filter for handling setting of active attributes of VTK datasets. VTK filters use the current active attribute to tell it what array to process (e.g. vtk stream tracer will use active vector to produce stream lines). In VTK with python this is done through
vtkobj.setActiveVector('field name')
but isn't easily done in BVTK and in blender. vtkPassArrays does not always work since this only passes the arrays but does not make ones active. This new node allows for such commands through the blender interface.Key features:
This is a fair bit amount of code for a single node. Largely the use of a custom vtk algo required some integration. But I believe this is the right way to implement this and perhaps other bvtk nodes as well. Also if something goes wrong this allows the VTK pipeline to throw its errors, not in our add on.
IMO I also like prefacing special nodes (not in vtk module) with bvtk(FilterName) since this makes it easy to distinguish what is unique to BVTK but maintains formatting.
Let me know your thoughts and if you see any bugs (some quality of life ones exist but are not possible to fix with the blender API).
See the following example creating streamlines (new node colored green):
Additional functions (data set only has point scalar and vector arrays):