GSoC 2025: Styles support for MDA Universes #879
Replies: 5 comments 17 replies
-
|
Hi Brady, thinking about this a little further, here is another approach that could potentially work and has several benefits: With this, the |
Beta Was this translation helpful? Give feedback.
-
|
After thinking about this again in a lot more detail, I have a fundamental question: Are we expecting users to interact with the Geometry Node tree that is managed by the API / GUI? It seems like the answer is yes. If so, this to me seems to be the root of the problem. External tools like We here however, could be significantly limiting ourselves if we don't pick the right approach. I think the warning signs of that are already showing in our own self imposed restrictions. For example, it is true that the switch styles support can be achieved through other ways - the same argument can be extended to visibility and even at a meta level, why even have style branches because we get the equivalent of it with individual objects and their single styles etc - the way It is practically infeasible to manage a tree that users can mess with. I can see several ways this can just go wrong - having thought through how this would impact the GUI etc from different scenarios. Do we really want to go down this path? There just doesn't seem to be two ways about this. I will wait to hear more thoughts from all of you folks and the approach we pick and guidance on how to move forward, because at this time it isn't quite clear to me and I really need help. |
Beta Was this translation helpful? Give feedback.
-
|
If all of the above discussion is too disruptive at the moment - and in the interest of unblocking myself and actually making some progress, I can make the following changes:
Please let me know if I can go ahead with the above. Thanks |
Beta Was this translation helpful? Give feedback.
-
|
I don’t have much experience tinkering with the Geometry Nodes, so I may not have a lot to contribute here, but I do agree with @BradyAJohnston that while the Unified Style approach is appealing for its simplicity and being less error prone, it might lack the flexibility needed for more advanced use cases involving modifying the node tree. I’m thinking in terms of different types of users:
So from my perspective, as long as you can implement the desired features (e.g., dynamic style switching) with the current node tree structure, it makes sense to stick with it. It would also help a lot on the long run to implement the functions you mentioned to reset and/or fix a broken node tree for users. |
Beta Was this translation helpful? Give feedback.
-
|
Closing this as PR #888 is merged. We could revisit some of the discussions here at a later point. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi @BradyAJohnston and @yuxuanzhuang ,
I want to get started on the styles support for MDA universes next. I want to add both the API as well as the GUI at the same time to keep them in sync. Here is the GUI from the prototype that shows various options which will be supported in the API as well:
You might remember from the video in the proposal that all of these are dynamic in nature - style visibility, style type, selection string, uniform vs default colors and all of the style specific properties
Based on what I've learnt from the prototype, here is some relevant information:
Blender will crash if there are any structural changes to the node tree during the render process. This means any of the animated (keyframed) properties cannot make structural changes to the node tree like deleting/adding links/nodes, even muting nodes. Changes to the node inputs and other datapath values are absolutely fine. So, for example if there is a property to control visibility of the style and in the setter of it we are changing some links or muting a node, this will lead to a crash if this property is animated.
The only way I was able to get this working in the prototype was to have a stable node tree that only changed during style creation/deletion/switching (either from the API or GUI). All of the dynamic property changes (like visibility, uniform color, selection string etc) wouldn't change the node tree and hence they were animatable.
I looked through the recent style API changes #779 (API for adding & controlling multiple styles) and #851 (Add Configurable Styles Classes) as well as the code base and tried them out too. I will be able to reuse some of that work here, but there are still some challenges that need to be addressed.
Here are a few things I noted about the current implementation so far: Once a style is added using the
add_stylesAPI, only the style node properties can be customized using theGeometryNodeInterface. (mol.styles[0].some_style_property =). We cannot change the color stuff, selection string or the style type and for this the interface needs to be at a level above the style node than what it is currently. Theadd_style_branchmethod only adds the required nodes based on the passed params. To have support for dynamic changes of all the above and not run into crashes later (as described above), we need all the nodes present, with node properties controlling their behavior.The
add_style_branchmethod will have to change as this is not part of a class that can be extended. We could simplify some of the node setup by adding some of these directly to the nodes themselves or creating new nodes (as part of MN data) - for example, a visibility boolean for each of the style nodes, a boolean to switch between a uniform color or a passed in color in theSet Colornode (or a new node with this behavior). If this is not an option, the node setup in theadd_style_branchwill be a bit more involved that what exists today. Do you guys have any suggestions on which approach to take?Beta Was this translation helpful? Give feedback.
All reactions