I have made a script to generate a game asset in one click ( http://blenderartists.org/forum/showthread.php?383624-Dark-Blender-(Official-Thread)-optimized-for-sculpting-and-game-asset-creation ). My script save the textures by doing a render and import them with the .0001 number meaning frame 1. If the frame is changed my script is unable to find the texture.0001 so i want to set at the beginning of my Python script the frame to 1.


you can set the current frame like this :

bpy.context.scene.frame_current = 1


| improve this answer | |
  • 4
    $\begingroup$ frame_current should only really be used as a read-only property. See: blender.stackexchange.com/a/6510/241 $\endgroup$ – Ray Mairlot Jun 10 '16 at 23:35
  • $\begingroup$ I'm getting "python script fail" when i try this. DO i need write something else in my script? $\endgroup$ – Ivan Kartofanov Dec 4 '17 at 14:03
  • $\begingroup$ @IvanKartofanov You need to import the bpy module. Just insert the line import bpy as the first line of the script. $\endgroup$ – Leander Feb 21 '18 at 20:10
  • $\begingroup$ in Blender 2.83, this freezes the application, it crashes and shuts down. $\endgroup$ – Mark Jun 27 at 15:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.