[Bf-python] Initialization of data and python vars.
Campbell Barton
cbarton at metavr.com
Wed Aug 11 06:46:02 CEST 2004
I like the first option better since oops data is very simple. oopsloc /
oopssel (.sel)
there is also no need for a getOops() as far as I can see.
This is available for all datatypes that are viewed in the oops window -
Scene, Material
- Cam
Willian Padovani Germano wrote:
> Campbell Barton wrote:
>
>> Hi, While writing the class vars for the oops objects I discovered
>> that the oops data was not initialized until the oops window was viewed.
>
>
> Hi Campbell,
>
> Yes, it can be done the way you propose, even made general (a general
> Blender.Window.InitSpace or something that accepts a
> Blender.Window.Types parameter), since other spaces can potentially
> need this, too, like the 3d view.
>
> Another and probably better way to do it depends on how the oops vars
> will be added. You're adding them to objects, right? If it's done
> like bones are added to Armature or radio and render are added to
> Scene, as a subtype, initialization can be done automatically:
>
> oops = object.getOops() # or another name, this also inits the oops
> win if needed
> print oops.var1 #, etc...
>
> Compare with object.getData, scene.getRenderingContext, for example,
> that's the same idea: you force a single way to access the "oops"
> object and can control initialization, no need for script writers to
> do it.
>
--
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-python
mailing list