That works find ! Thank you so much
Best posts made by Hugo BATTISTELLA
Latest posts made by Hugo BATTISTELLA
Hello @Cairyn,
thank you a lot for this answer. I try this quikly but now I have a better understanding of the Desclevels concept !
This is what the code looks like now :
import c4d
from c4d import gui
#Création d'une piste pour chaque donnée utilisateur
def AddAnimationTrack(op):
LED = c4d.CTrack(c4d.DescID(c4d.DescLevel(c4d.ID_USERDATA, c4d.DTYPE_SUBCONTAINER),
c4d.DescLevel(c4d.ID_USERDATA,3,c4d.DTYPE_LONG)))
op.InsertTrackSorted(LED)
return True
# Main function
def main():
AddAnimationTrack(op)
# Execute main()
if __name__=='__main__':
main()
@cairyn said in Insert User Data Track in Python:
c4d.DescID(c4d.DescLevel(c4d.ID_USERDATA, c4d.DTYPE_SUBCONTAINER),
c4d.DescLevel(userdata_entry,c4d.DTYPE_LONG))
Hello ! Thank you for replying !
I've put your code but get a error :
"Traceback (most recent call last):
File "scriptmanager", line 19, in <module>
File "scriptmanager", line 15, in main
File "scriptmanager", line 9, in AddAnimationTrack
NameError: global name 'userdata_entry' is not defined"
Maybe I didn't get what I should do with "userdata_entry"
Hello,
I would like to add track (timeline) for each user data I have set on a object .
Here is the code I tried, but I don't know why it's not working
Here is the code I wrote :
import c4d
from c4d import gui
#Création d'une piste pour chaque donnée utilisateur
def AddAnimationTrack(op):
LED = c4d.CTrack(op,c4d.DescID(c4d.DescLevel(c4d.ID_USERDATA,1,c4d.DTYPE_GROUP),c4d.DescLevel(c4d.ID_USERDATA,2,c4d.DTYPE_GROUP),c4d.DescLevel(c4d.ID_USERDATA,3,c4d.DTYPE_REAL)))
op.InsertTrackSorted(LED)
return True
# Main function
def main():
AddAnimationTrack(op)
# Execute main()
if __name__=='__main__':
main()
I work on R21.
You can see the scene here : ADD_TRACK - 1.c4d
Thank you for helping
@Cairyn Thank you for your help ! That's it. I confused it all with the wrong word. Sory... Your answers help me very nicely
@ferdinand I apologize about going out of the guidelines. I understand this and will create new topic for that point
The multilines code works well.
Do you mean that there is no possibility to select clones ID to affect them with the Python Effector ?
@Cairyn thank you for answer
I can now add a line of code but how Can I add multiples lignes of code in the effector. I got some difficulties to manage this.
What I would like is to make a selection by ID of the cloner through the Python Effector.
In fact in this Effector I would like to create an id selection for the operator it will be linked to.
So I can add this code into the effector
Hello,
I want to insert a code (not written yet) into a python effector I created through a Python script. I figured out how to open the Editor but not how to change the code inside.
Can you help please ?
(running on R21)
import c4d
from c4d import gui
from c4d.modules import mograph as mo
def PythonEffector():
PythonEffector = c4d.BaseList2D(1025800)
#PythonEffector(c4d.OEPYTHON_OPENEDITOR) >> CHANGE THAT CODE WITH SOMETHING ELSE
doc.InsertObject(PythonEffector)
c4d.EventAdd()
# Main function
def main():
PythonEffector()
# Execute main()
if __name__=='__main__':
main()