[Bf-committers] Python & G.scene

Campbell Barton cbarton at metavr.com
Thu Mar 23 00:24:44 CET 2006


Ello,
An example of thy this is usefull.

Somebody makes a Python script that takes a 3ds and renders it. saving 
the render and quitting.
some python scripts create there own data and dont require loading an 
existing blend file.

they type in..
  blender -P render_3ds.py

...All goes well.

# But this will fail.
  blender -b -P render_3ds.py


If the user wants they can do a "Blender.Scene.New()" in there python 
script. but this could cause multiple scenes when the script isnt used 
in background mode. (depending on how they use it) - so they may need a 
different script in background mode then in GUI mode, which is just silly.

Hos, you added in command line mode, can you comment?
Checkout creator.c:671

- Cam


Ton Roosendaal wrote:
> Hi,
>
> You only have to prevent executing python when no file was read? I 
> don't see a 'heap of exceptions'.
> By definition: without file -> no running blender. The .blend is 
> obligatory on the command line for a -b (background render).
>
> I can imagine its fun to start without anything and then let python 
> fill a database... but that's outside of the specs I trust Blender to 
> run reliably.
>
> BTW: I rather see efforts how to get rid of the G.scene (and G) all 
> over...
>
> -Ton-
>
>
> On 22 Mar, 2006, at 22:37, Campbell Barton wrote:
>
>> Hi,
>> 2 recent bug reports involved Blender running python scripts in 
>> background mode.
>>
>> The segfaults were that Pyton expects G.scene to exist, but at the 
>> moment running blender in background mode dosent make a scene for 
>> blender.
>> are we ok to make a new scene when python runs "import Blender" (when 
>> G.scene is NULL) - it saves adding in a heap of exceptions.
>>
>> - Cam
>>
>>
>> -- Campbell J Barton
>>
>> 133 Hope Street
>> Geelong West, Victoria 3218 Australia
>>
>> URL:    http://www.metavr.com
>> e-mail: cbarton at metavr.com
>> phone: AU (03) 5229 0241
>> _______________________________________________
>> Bf-committers mailing list
>> Bf-committers at projects.blender.org
>> http://projects.blender.org/mailman/listinfo/bf-committers
>>
>>
> -------------------------------------------------------------------------- 
>
> Ton Roosendaal  Blender Foundation ton at blender.org http://www.blender.org
>
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at projects.blender.org
> http://projects.blender.org/mailman/listinfo/bf-committers
>


-- 
Campbell J Barton

133 Hope Street
Geelong West, Victoria 3218 Australia

URL:    http://www.metavr.com
e-mail: cbarton at metavr.com
phone: AU (03) 5229 0241


More information about the Bf-committers mailing list