Vred - API - how to set animation frame?

Vred - API - how to set animation frame?

Bob.Bon2000
Collaborator Collaborator
884 Views
9 Replies
Message 1 of 10

Vred - API - how to set animation frame?

Bob.Bon2000
Collaborator
Collaborator

Hey

 

I need to set the animation frame to a specific one, how can this be done in vred python?


Thanks.

0 Likes
885 Views
9 Replies
Replies (9)
Message 2 of 10

Christian_Garimberti
Advisor
Advisor

Hi, what do you mean?

are you playing a clip and want to set the play to a specific frame?

You can use playCAnimation(name, startFrame, endFrame)

Or something other? 

 

Best

Chris

Christian Garimberti
Technical Manager and Visualization Enthusiast
Qs Informatica S.r.l. | Qs Infor S.r.l. | My Website
Facebook | Instagram | Youtube | LinkedIn

EESignature

0 Likes
Message 3 of 10

Bob.Bon2000
Collaborator
Collaborator

Hello

Were building pipeline for vred and we want to ensure that vred always render specific frame for specific shots so that wrong data don't render.

Our project system manages render size/output/frame/etc/etc.

How can we do it via python?

Think of this

frame 0-10 wheels positions

Frame 10-100 accessory positions

Frame 100-500 etc etc

Our artist just say, render me wheel at x/y config, thus frame 4/7. etc

Thus need manual frame config via python. 

Another reason for us to have it is that if artist is configuring shot, he would "preview" config XX and that would run setFrame(XX) + set bunch of other settings in scene so he can work from that. So its needed for both rendering creative work.

0 Likes
Message 4 of 10

Christian_Garimberti
Advisor
Advisor

Hi, with playCAnimation("myclip", 4, 4) (same start and end frame) you can preview a specific frame in the renderwindow

An then you can start the render to render that specific frame.

 

If you need to render more than one frame you can use

vrRenderSettings.setRenderStartFrame(4)

vrRenderSettings.setRenderStopFrame(7)

set the rendernimation with

vrRenderSettings.setRenderAnimation(True)

vrRenderSettings.setRenderAnimationClip("myclip")

setting also all the parameter yo need with the vrRenderSettings module

 

best

Chris

Christian Garimberti
Technical Manager and Visualization Enthusiast
Qs Informatica S.r.l. | Qs Infor S.r.l. | My Website
Facebook | Instagram | Youtube | LinkedIn

EESignature

Message 5 of 10

Bob.Bon2000
Collaborator
Collaborator
Hello
Interesting thank you! Will check it out.
Will this also work under Design version of vred/node/core/etc?
I've seen some "This function only works in Pro" which causes some worries...
Thanks!
0 Likes
Message 6 of 10

Christian_Garimberti
Advisor
Advisor

Hi, palyCAnimation works on all platforms.

all the vrRendersettings too.

What does not works in the Design Version are the api to start the rendering, like startRenderToFile(alwaysOverride), where in fact, in the help, you find "This command is only available in VRED Professional"

Render node is a passive node so you cannot use it directly like the Pro, Design, Core.

 

Best

Chris

 

Christian Garimberti
Technical Manager and Visualization Enthusiast
Qs Informatica S.r.l. | Qs Infor S.r.l. | My Website
Facebook | Instagram | Youtube | LinkedIn

EESignature

0 Likes
Message 7 of 10

Bob.Bon2000
Collaborator
Collaborator

Hey @Christian_Garimberti 

I must be doing something wrong because nothing works that I try.

I'm in vred Pro 2023.2 atm.

Are these functions only limited to vred 2024+?

Running

playCAnimation("c", 40,40)

Does not move my slider anywhere on the frame time range, it's stuck where it is as is. I can't preview animation at specificx frame.

Any hints?

 

 

 

0 Likes
Message 8 of 10

Christian_Garimberti
Advisor
Advisor

hi @Bob.Bon2000 , i tried in Vred 2023.4 and it works.

For what i remember playCAnimation exists from time, so i suppose the 2023.2 should works the same.

Note then the Clip Maker panel and the timeline doesn't update... only the render window.

 

Best

Chris

 

 

Christian Garimberti
Technical Manager and Visualization Enthusiast
Qs Informatica S.r.l. | Qs Infor S.r.l. | My Website
Facebook | Instagram | Youtube | LinkedIn

EESignature

0 Likes
Message 9 of 10

Bob.Bon2000
Collaborator
Collaborator

@Christian_Garimberti Will it change frame here > 

BobBon2000_0-1704313999643.png

 to specified frame in that command? 

Just saw your video... we don't have clip, we have fbx with animation import. 

0 Likes
Message 10 of 10

Christian_Garimberti
Advisor
Advisor

Hi, like written in the help. it should works on Clips and animation blocks.

 

playCAnimation(name, startFrame, endFrame)
Plays an animation block or animation clip from start to end via name. This function returns immediatly.

Parameters:
name (string) - name of the animation object
startFrame (float) - the optional start of the play range
endFrame (float) - the optional end of the pay range

 

Imported Fbx have only curves, so at least you have to create block, but i advice to put them also on a clip.

There is a video that shows how to do that.

https://youtu.be/3KWo1qYZfJw?si=4ItVWtPNhGh944oN

 

Best

Chris

 

Christian Garimberti
Technical Manager and Visualization Enthusiast
Qs Informatica S.r.l. | Qs Infor S.r.l. | My Website
Facebook | Instagram | Youtube | LinkedIn

EESignature

0 Likes