[Bf-committers] Python & G.scene

Campbell Barton cbarton at metavr.com
Thu Mar 23 11:45:01 CET 2006


Alexander Ewering wrote:
>
> On Thu, 23 Mar 2006, Campbell Barton wrote:
>
>> 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.
>
> It wouldn't be too difficult just delivering an empty (or almost-empty)
> .blend file with that python script, would it?
>
Its a solution but users shouldnt need to workaround blenders 
inconsistencies.
Python users should not need to distribute a blend just because people 
might want to run the script in background mode.

at the moment creator.c is not creating the scene for background mode.
see below.
This actually makes no difference since pythons -P args are executed 
above anyway.
so it makes sense for python to have G.scene set if running in 
background mode.


    if(G.background) {
        /* actually incorrect, but works for now (ton) */
        exit_usiblender();
    }

    setscreen(G.curscreen);

    if(G.main->scene.first==0) {
        sce= add_scene("1");
        set_scene(sce);
    }

    screenmain();


Hos, didnt you add in teh -p switch?
- 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


More information about the Bf-committers mailing list