Thank you so much, this was very helpful to learn.
All the best.
M
Latest posts made by Matthew_H
-
RE: SetPortValue for Texture node ColorSpace
-
SetPortValue for Texture node ColorSpace
I checked the forum, and there are few posts that asked the same question yet I still can't get it to work.
Here is my code:# Add a Texture node to the graph idTextureNode: maxon.Id = maxon.Id("com.redshift3d.redshift4c4d.nodes.core.texturesampler") textureNode: maxon.GraphNode = graph.AddChild(maxon.Id(), idTextureNode) # Ensure the Texture node was created successfully if textureNode.IsNullValue(): print("Error: Texture node creation failed.") return # Set the Color Space port value to RAW colorSpacePort: maxon.GraphNode = textureNode.GetInputs().FindChild( "com.redshift3d.redshift4c4d.nodes.core.texturesampler.colorspace") if colorSpacePort: try: colorSpacePort.SetPortValue("RS_INPUT_COLORSPACE_RAW ") except Exception as e: print(f"Failed to set color space value: {e}") # Commit the transaction transaction.Commit()
I get this:
Failed to set color space value: no target to copy for '<net.maxon.graph.interface.graphmodel>'
All I'm trying to do is set the color space to RAW for incoming normal bitmaps later.
I'm new to coding, so I am sure I'm doing something wrong here. Help is much appreciated.Thank you.