GetDefaultValue Not Working in C4D 2024
-
The GetDefaultValue of GraphNode doesn't seem to retrieve values from the node in 2024 the same way it did in 2023.
How can I correctly obtain these values in the 2024 version?Thanks in advance!
-
Hi @Easan this function have been modified in C++ and we did not had the time to adapt it in Python. However rest assured this is in our top priority for the next release.
With that said you can still retrieve the value using GetValue("value"). Find bellow and example, but first create a node material and select a port and run the example.
import c4d import maxon def main(): mat = doc.GetActiveMaterial() nodeMaterial = mat.GetNodeMaterialReference() nodespaceId = c4d.GetActiveNodeSpaceId() nimbusRef = mat.GetNimbusRef(nodespaceId) graph = nimbusRef.GetGraph() for port in maxon.GraphModelHelper.GetSelectedNodes(graph, maxon.NODE_KIND.PORT_MASK): print(port.GetValue("value")) if __name__ == "__main__": main()
However this have some limitation since in some case when no value is available None will be returned. This is going to be fixed in the next version.
Cheers,
Maxime. -
@m_adam
I'm looking forward to the next version update.
Thank you for your response.