On 31/07/2018 at 01:33, xxxxxxxx wrote:
Dear Andrias, thank you for you reply! Certainly I'm going to be more attentive to the rules.
And next time I won't double my questions in different forums.
So, about details. I made a python script (converted it to exe for user's convenience) which makes an animated handwriting affect for several fonts. To do so I dwelled into an intricate spline structure of letters and modified it. Take a look:
https://www.youtube.com/watch?v=uvL-ZqG5aVo
Since I have this library of splines I decided to make a similar effect in 3D for c4d. Actually, a free plugin is on my mind.
Now, the questions.
I'm new to c4d python therefore sometimes it is still difficult for me.
As far as I understand PLA animation would work just fine if I manage to create something like user attribute "time" and change it smoothly.
And here it goes. I think I'm facing a dead end here. My shape shouldn't be created as an explicit function of time: myspline1(t). Instead it should have an attribute t (!). So, I should create my own c4d object with this custom made attribute. And... I don't know how to do it (
What I tried so far was this:
def main() :
ss = c4d.SplineObject(2, c4d.SPLINETYPE_BEZIER)
UD = c4d.GetCustomDataTypeDefault(c4d.DTYPE_REAL);
UD[c4d.DESC_NAME] = 'time';
UD[c4d.DESC_ANIMATE] = c4d.DESC_ANIMATE_ON
UD[c4d.DESC_UNIT] = c4d.DESC_UNIT_REAL
UD[c4d.DESC_CUSTOMGUI] = c4d.CUSTOMGUI_REALSLIDER
UD[c4d.DESC_MINSLIDER] = 0
UD[c4d.DESC_MAXSLIDER] = 10
UD[c4d.DESC_STEP] = 0.1
ss.AddUserData(UD)
time = ss[c4d.ID_USERDATA,1]
ss.SetPoint(0,c4d.Vector(0, 0,0))
ss.SetPoint(1,c4d.Vector(75*(time), 75, 75))
ss.SetTangent(0,c4d.Vector(0,0,0),c4d.Vector(50*time, 0, 50*time))
doc.InsertObject(ss)
c4d.EventAdd()
if __name__=='__main__':
main()
The thing doesn't animate when I move the time slider!
Edit: Added code tags