Hi everyone!
I am here trying to do something quite simple but::spin:
Situation:
I am in the scene A and i switch to scene B, but the current frame in B doesn’t get syncronized with the current frame in A.
Posibles solutions not founded:
Has Blender a secret way to maintain the same frame position in the time line betwhen scenes?
-May be there is some way in Python to get the current frame of the any scene that IS NOT the current scene?
This is what you need. :eyebrowlift2: I am not sure how to handle the Scene switching though, so you would have to make a button that you press each time. Would be cool to have it do that automatically somehow.
import Blender
from Blender import Draw, Window
def getCurrentFrame(scene=None):
# get the current frame
if scene == None:
scene = Blender.Scene.GetCurrent()
context = scene.getRenderingContext()
return context.currentFrame()
def setCurrentFrame(frame, scene=None):
# set the current frame
if scene == None:
scene = Blender.Scene.GetCurrent()
context = scene.getRenderingContext()
context.currentFrame(frame)
#usage examples:
sceneA = Blender.Scene.Get('nameOfSceneA')
sceneB = Blender.Scene.Get('nameOfSceneB')
print getCurrentFrame(sceneB)
setCurrentFrame(23,sceneA)
#get a list of available scenes:
sceneList = Blender.Scene.Get()
Man you deserve to be worshiped.
I was just waitng for a sentence of how to access to scene frame and you gave me the whole solution script! And it works in the first copy and paste!
Man seriosuly, you are amazing, and i owe you a good one.
Thanks!!!