Thank you very much, I had no idea about that, I did know that Mpoints or Mpolygons existed, but it always related to me with ViewportSelect, this answers my question, I will investigate more about this.
Hello @ferdinand ,
Thanks for the explanation, but in my case I meant this:
I need to make changes to these options, although it is true that they can be done by callcomands, I am interested in knowing if it is possible to avoid their use, I did some research, but didn't find much, I guess it's possible, and I probably didn't understand.
still thank you very much for your contribution
It required to make a change of the mode type of the Viewport, when doing it I wondered if there was any way to do the same function without using callcomands.
Is it possible?
Thank you! His proposal was the best way to solve my problem.
To be honest, I don't even know what happens, the line of code that I put is all the code there is, even so, I admit that I could not explain myself well.
I tried what you proposed and didn't see much of a difference, but trying a few things I solved my problem as follows
Code before correcting
from c4d import gui
c4d.documents.MergeDocument(doc,'preset://name',c4d.SCENEFILTER_MATERIALS | c4d.SCENEFILTER_OBJECTS))
from c4d import gui
doc.AddUndo(c4d.UNDOTYPE_NEW, c4d.documents.MergeDocument(doc,'preset://name',c4d.SCENEFILTER_MATERIALS | c4d.SCENEFILTER_OBJECTS))
Even so, I would like to investigate your proposal and I really appreciate your help.
I have been using commonly what is
c4d.documents.MergeDocument(doc,'preset://direction',c4d.SCENEFILTER_OBJECTS | c4d.SCENEFILTER_MATERIALS)
that does not present errors when reversing its action, but an error that I realized is that if I try to return to when I had the preset (for this the preset had texture) it doesn't load its texture or if it does load I had to go back several times, does anyone know why this happens?
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.