MotionBuilder Forum
Welcome to Autodesk’s MotionBuilder Forums. Share your knowledge, ask questions, and explore popular MotionBuilder topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

[Solved] KeyFrame UV

2 REPLIES 2
Reply
Message 1 of 3
Anonymous
276 Views, 2 Replies

[Solved] KeyFrame UV

Hello everyone,

I am new to MOBU.. very new and have what I believe will be an easy question.

So I have a texture that I would like to animate base on U and V.

Things I don't know how to do are, set Keyframes, change the translation of U and V, and how to navigate to the translate node.

What I have so far


##Navigate to texture Files##
Texts = FBSystem().Scene.Textures
for Text in Texts:
if Text.Name == "AnimateTexture":
print Text.Name


Thats pretty simple.. I know. So where is this translate node located its not "Text.Translation" because that crashes MOBU.

Okay thats all for now.

Thanks

****EDIT****

I have figured out how to move the UV coord and how to set a Key


Texts = FBSystem().Scene.Textures
for Text in Texts:
if Text.Name == "AnimateTexture":
Text.Translation = FBVector2d(0,5) #set number for U and V
Text.Translation.Key()#then key


But how do I have the code move to a certain point in time(frame)? Lets say I need a key on frame 1 and 20.
2 REPLIES 2
Message 2 of 3
joel.pennington
in reply to: Anonymous

"""
You can step the transport control forward in time and set a key
"""


from pyfbsdk import *

player = FBPlayerControl()

Texts = FBSystem().Scene.Textures
for Text in Texts:
if Text.Name == "AnimateTexture":
for frame in :
player.Goto( FBTime(0,0,0,frame) )
Text.Translation = FBVector3d(frame,5,0) #set number for U and V ## I had to use a 3D vector, not sure why
Text.Translation.Key()#then key



"""
Or you can access the FBFCurve object of the texture and set keys at arbitrary time without
stepping the transport control forward. You can set keys on a specific curve, saving more space.
"""


from pyfbsdk import *

Texts = FBSystem().Scene.Textures
for Text in Texts:
if Text.Name == "AnimateTexture":
Text.Translation.SetAnimated(True)#make translation animatable so it has an animation node
tAnimNode = Text.Translation.GetAnimationNode() # this is the translation animation node
tuAnimNode = # this is the U coord, which is called x...

tuAnimNode.FCurve.EditBegin() # the docs say to use this to allow key addition to a curve
for frame in :
tuAnimNode.KeyAdd(FBTime(0,0,0,frame),frame) # the time and the value
tuAnimNode.FCurve.EditEnd()


Product Designer for Virtual Production
Autodesk
Message 3 of 3
Anonymous
in reply to: Anonymous

Thanks! That worked like a charm. This mobu Python is slowly starting to make sense.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report