3
$\begingroup$

Let's say the user has multiple scenes, and some of them may be named Scene.001, etc.

If I do bpy.ops.scene.new(type='FULL_COPY'), how do I know which one is the new one?

Normally I'd expect the new scene to update the context and this to work:

bpy.ops.scene.new(type='FULL_COPY')
copy = bpy.context.scene

It does work if you type it into the console. However, that doesn't appear to be the case if I put this into an addon script (bpy.context.scene seems to update only after the operator is done, which is not useful).

Any ideas how I can determine which scene is the new one? Is this a bug?

$\endgroup$
1
  • 1
    $\begingroup$ context.scene.name is up-to-date if I print it immediately after the call to scene.new(), please post your code. $\endgroup$ – CodeManX Dec 18 '14 at 23:38

Your Answer

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

Browse other questions tagged or ask your own question.