Xpresso Motion Graphics Data Can not add global matrix and color ports
-
To whom it may concern,
I am trying to create an Xpresso Motion Graphics Data node and add two ports, a Global Matrix and a Color, with a Python script.
I have this code:import c4d def main(): doc = c4d.documents.GetActiveDocument() null= doc.SearchObject("Null") xtag = c4d.BaseTag(c4d.Texpresso) null.InsertTag(xtag) gv = xtag.GetNodeMaster() motion_data_node = gv.CreateNode(gv.GetRoot(), 1019010) motion_data_node_in_index = motion_data_node.GetInPorts()[0] motion_data_node_in_object = motion_data_node.GetInPorts()[1] motion_data_node_out_global_matrix = motion_data_node.AddPort(c4d.GV_PORT_OUTPUT, c4d.GV_OBJECT_OPERATOR_GLOBAL_OUT) print(motion_data_node_out_global_matrix) motion_data_node_out_color = motion_data_node.AddPort(c4d.GV_PORT_OUTPUT, c4d.ID_BASEOBJECT_COLOR) print(motion_data_node_out_color) c4d.EventAdd() if __name__=='__main__': main()
In the console I get:
None None
And the node:
Also, I am using number 1019010 to create the node as I failed to find the name of the motion graphics data node type in Graph View Node Types.Thank you for your time.
Joel Johera -
Hey @JoelJohera,
you are using the wrong symbols you cannot just use the symbols for the object operator. I am not 100% sure what you are trying to do, but I think the symbols you are looking for are
GV_MG_DATA_OGMATRIX
andGV_MG_DATA_OCOLOR
. See Motion Graphics Data for details.And you are right about the OP list, the Mograph stuff is missing. That is because this list, other than the rest, is not auto generated and we forgot to add them. I have fixed that for a future release. But that does not mean that the symbols do not exist. You are looking for
ID_OPERATOR_MG_DATA
.Cheers,
Ferdinandimport c4d def main(): doc = c4d.documents.GetActiveDocument() null= doc.SearchObject("Null") xtag = c4d.BaseTag(c4d.Texpresso) null.InsertTag(xtag) gv = xtag.GetNodeMaster() motion_data_node = gv.CreateNode(gv.GetRoot(), c4d.ID_OPERATOR_MG_DATA) motion_data_node_in_index = motion_data_node.GetInPorts()[0] motion_data_node_in_object = motion_data_node.GetInPorts()[1] motion_data_node_out_global_matrix = motion_data_node.AddPort(c4d.GV_PORT_OUTPUT, c4d.GV_MG_DATA_OGMATRIX) print(motion_data_node_out_global_matrix) motion_data_node_out_color = motion_data_node.AddPort(c4d.GV_PORT_OUTPUT, c4d.GV_MG_DATA_OCOLOR) print(motion_data_node_out_color) c4d.EventAdd() if __name__=='__main__': main()
-
Thank you so much