Skip to content

Conversation

@josephbburg
Copy link

@josephbburg josephbburg commented Nov 26, 2025

Hello! Wonderful project here! I'm using it for a school project, trying to port my Blender addon to a UI that works in Maya.

In order for my system to work I have to add some custom information to graphs and nodes, and in order to keep it around I have to override the serialize/deserialize code for both nodes and graphs. Unfortunately, the graph's serialize code doesn't use the node's serialize method. I don't know if there is a really good reason for this that I am missing.

Anyhow the purpose of this very small change is to make it easier for devs to modify NodeGraphQt to use their own custom data.

Thanks! And thank you for the project. Without it I would have had to come up with another idea for a project...

@jchanvfx
Copy link
Owner

Hey @josephbburg,

Thanks for checking out the node graph framework when you're storing your additional custom information have you tried the node.create_property(name, value) function?

@josephbburg
Copy link
Author

have you tried the node.create_property(name, value) function?

I have! But it isn't really doing the task that I am requesting this change for. Regardless of whether the user is using create_property , they can't easily override the behavior of node serialization when serializing node graphs, and it isn't clear what BaseNode.serialize() is doing, if anything at all. I think the current behavior is unexpected. I just want to have the ability to override the function. Right now, I have to override NodeGraph._serialize() in order to do what my PR does (to change one line of code). It is bad to have duplicated code, especially when I am duplicating it from another module!

the purpose of this PR isn't to enable users to store custom data, so much as it is to give users the ability to control how the data is serialized. In my case, I already have a JSON format that I want to be able to stick to, and I have information that is stored in the class declarations that I want to include in the JSON that would be redundant to make a property out of (since it is already available to the Qt part of my code). I am sending data out of Qt into a different system.

the property system is really good for what I'm using it for but it isn't directly related to the reason I am requesting this change. I can store the info in the property system - but I still won't be able to override the serialization, and I will have to run an extra conversion step to get things into my JSON format.

Thanks for your reply!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants