[Bf-python] Blender -b and Scenes

Toni Alatalo antont at kyperjokki.fi
Wed Mar 22 04:51:31 CET 2006


On Wednesday 22 March 2006 04:37, Willian Padovani Germano wrote:
> pointers (good practices, not just for bg mode), but creating a scene
> iff G.scene is NULL AND we're in bg mode may be a good solution in this
> case (others here: opinions?).

i think it can well make sense to always have a scene.. like said there is 
always one when Blender is running with the GUI, and often the objects of 
interest are best accessible via / in a scene too. 

i've never even conceived Blender without a scene before, and although i guess 
there are cases where some background job may in principle be done without a 
scene .. like image format conversions with the sequencer perhaps? (altho 
even then i think the sta/end frame settings, and even the image format 
settings, resolutions etc are part of scene data .. well i guess there is 
some other example), i guess it does not hurt to have (an empty) scene around 
in those cases.

> also suggest, if it gets accepted, that you print a msg to the console,
> informing the user that a scene was created, something like: "No scene
> available, creating an empty one.". Checking that the scene was actually

+1

~Toni

>
> Campbell Barton wrote:
> > Hey Willian,
> >
> > thaught of just adding checks, and while its okay for functions that
> > directly use G.scene, there are functions that python calls that use
> > G.scene
> > Also, if you cover all cases, its adds up to a fair few checks.
> >
> > Just seems a simpler option to add a scene when importing Blender
> > keep in mind this only effects blender when running in background mode.
> >
> > would be somthing like
> > if (!G.scene)
> >  add_scene("Scene");
> >
> > This would save us adding checks to World, Mesh, Scene? and others for
> > this 1 rare case.
> > It also seems logical that when you start blender and run a script in
> > User mode you have a empty scene. so why not have 1 in background mode?
> > - Cam
>
> --
> Willian
> _______________________________________________
> Bf-python mailing list
> Bf-python at projects.blender.org
> http://projects.blender.org/mailman/listinfo/bf-python



More information about the Bf-python mailing list