Hello @jferdinand,
Apologies for the delay, I examined your example some time ago and I suspect that it does not solve my problem, activating "frame-dependent" causes the update to stop, and it is present in animation again, my intention is to completely remove that delay, both in editor and in animation.
Best posts made by JH23
Latest posts made by JH23
I apologize, the translator does not help much, as I said, I created a spline chain, where the depth of its handles depends on the length of the spline, my problem was that when I did it with only xpresso, it showed errors when rotating, because it took time update.
thinking that the error was either hierarchy, the spline node, or how to order the xpresso I did the same thing but with a python tag, despite this the same problem was present.
import c4d
#Welcome to the world of Python
def main():
spline = op[c4d.ID_USERDATA,2] # spline object
length = c4d.utils.SplineLengthData(spline)
length.Init(spline)
Long = length.GetLength()
op[c4d.ID_USERDATA,1][10004] = Long /3.783
#[10004] = control depth 1 iKsplinetag
op[c4d.ID_USERDATA,1][10014] = Long /3.783
#[10014] = control depth 2 iKsplinetag
length.Free()
c4d.EventAdd()
And speaking of the number "3,783" I used it only for my purpose as it corrected the strength of the depth of the controls
SplineL.c4d
I was trying to include the login data inside the spline handlers but I had updating errors, I thought it was due to hierarchy but I ended up using python tags and still I had the same error, I don't know what's happening.
Hello @ferdinand
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?
Hello @ferdinand,
Thank you! His proposal was the best way to solve my problem.
Greetings,
JH23
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
import c4d
from c4d import gui
def main():
c4d.documents.MergeDocument(doc,'preset://name',c4d.SCENEFILTER_MATERIALS | c4d.SCENEFILTER_OBJECTS))
if __name__=='__main__':
main()
Corrected code
import c4d
from c4d import gui
def main():
doc.StartUndo()
doc.AddUndo(c4d.UNDOTYPE_NEW, c4d.documents.MergeDocument(doc,'preset://name',c4d.SCENEFILTER_MATERIALS | c4d.SCENEFILTER_OBJECTS))
doc.EndUndo()
c4d.EventAdd()
if __name__=='__main__':
main()
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?