Thank you so much! This helps me a lot with the understanding of what was going on. I am digging back into my work on this today and will follow up with your advice.
Posts made by Pryme8
-
RE: def Message - What Message is triggered when an Object is created or moved in the hierarchy.
-
RE: def Message - What Message is triggered when an Object is created or moved in the hierarchy.
Yeah most of the message codes are the same (that I have seen so far)
But dope thank you that is prolly what I am looking for!
So basically on that message check what object it is being inserted and then check if its master parent is my container object then run my updates, thank you so much!
UPDATE This got me going the right direction actually but I can't get the message to actually fire anytime I insert an object.
def Message(self, node, type, data): if type == c4d.MSG_DESCRIPTION_COMMAND: if data['id'][0].id == BJS_EXPORT_SCENE_TEMPLATE: self.Export(node) if type == c4d.MSG_DOCUMENTINFO_TYPE_OBJECT_INSERT: print "OBJECT INSERTED" return True
No matter what I insert I never see the message. If I change it to Documentinfo it fires if I save etc the document so at least that is working.
but if I actually print out all the data from every message the only things that pop up on a Object Insert is
{'h': 32, 'bmp': <c4d.bitmaps.BaseBitmap object at 0x00000214FEC3AF50>, 'flags': 0, 'w': 32, 'y': 0, 'x': 0, 'filled': False} {'res': None} {'res': None}
Which does seem like Im doing this correctly then.
-
def Message - What Message is triggered when an Object is created or moved in the hierarchy.
I have a Python plugin that creates a ObjectData node that I use as a container for other objects by making them a child of this Custom object.
Now some of the objects that are children of the Custom node that I made need to have some tags assigned to them automatically if they are parented to this object.
For example if a user creates a Camera and puts it under my Custom Object I want to first check what kind of object it was that they put in, in this case a camera and then check that camera for the required tags. If they don't exist then create them.
Ive gone over and over https://developers.maxon.net/docs/cpp/2023_2/group___m_s_g.html#ga3ef2f9d6ed136cb6fe4f22ed0381c380 Trying to find the correct message flags but am struggling.