Thank you for solving my question, and thank you very much also for the advice.
in itself the problem is that when performing the complete action when going back the object is outside the father, since it was first created and later placed inside the father
from c4d import documents, plugins
c4d.documents.MergeDocument(doc,"file location",7) #the preset has already been added
child = doc.GetActiveObjects(c4d.GETACTIVEOBJECTFLAGS_NONE)
for A in child:
A.InsertUnder(father)#the parent would be defined by a link
I did this since when adding the preset it is already selected, use this to place it inside another object
I have been working on a userdata button that places a preset in the environment, I also wanted to put it inside the end of a joint, my problem is that when performing these steps, when going back the preset is outside the joint, the code generates the preset and then place it inside the board, is there a way to do it directly?
Oh I understand, thanks for your answer, it has helped me a lot.
I had a doubt, I wanted to place an established texture on the material created, but I don't know how, since the textures part is not a simple link type data in itself, but if I link directly where the link of the image is born is a bitmap but I don't know how it relates to the material.
mat = c4d.BaseList2D(c4d.Mmaterial)
mat[c4d.MATERIAL_USE_REFLECTION] = False
# Execute main()
@Cairyn Thanks, I'll check it
Hi @m_adam I mean that when creating an Object with BaseObject, when going back it remains in the environment.
I have a question, this is that every time I use this type of script, when I try to return it stays there, and it is somewhat annoying, I do not know how to fix it, I would be very grateful if you could help me
from c4d import gui
cube = c4d.BaseObject(c4d.Ocube)
thank you very much solved my doubts
I tried to make a script where when generating a material, assign the active object that material but I do not know if it should go the way I am doing it or it is wrong, I also saw in the script history c4d.ID_MATERIALASSIGNMENTS
I guess it has something to do with it but I don't understand
from c4d import gui
cubo = doc.GetActiveObject()
c4d.CallCommand(13015, 13015) # Nuevo Material
mat = doc.GetAciveMaterial()
mat[c4d.MATERIAL_PAGE_ASSIGNMENT] = cubo