[Bf-python] Depreceing... and other proposed changes

Campbell Barton cbarton at metavr.com
Fri Aug 18 18:06:33 CEST 2006


About Armature.New(),  does the way your mentioning currently work? can 
you gave an example of how it would be used?

I think we should try to keep modules in sync... when all modules that 
deal with object data have a New() function, the one that dosent looks 
to have missing functionalty, and its confusing, unless spesificly 
documented.

- Cam




Gilbert, Joseph T. wrote:
> 1) No problems with 'undeprecating' vector.negate
> 2) Armature.New() is the 'factory' class generation method that I
> thought we were trying to move away from.
> The correct way of creating a class should be with tp_new and tp_init
> where tp_init will take raw data as the initializer for the class. 
>
> example:
>
> myrandomobject = ObjectType(initializer_data)
>
> instead of:
>
> myrandomobject = Module.New()
>
> -----Original Message-----
> From: bf-python-bounces at projects.blender.org
> [mailto:bf-python-bounces at projects.blender.org] On Behalf Of Campbell
> Barton
> Sent: Thursday, August 17, 2006 1:52 AM
> To: Blender Foundation Python list
> Subject: [Bf-python] Depreceing... and other proposed changes
>
> Hi, a few things I'd like to discuss
>
>
> Can we depricate NMesh.PutRaw() -
> Too many scripts use this in a way that could overwrite existing data 
> (if theres a name conflict), and I dont see its that relevent anymore 
> since one can link an object to the scene, set the layers and select it.
> -
> Its also out of line with other objects and keeps scripters  from being 
> 'scene aware'
>
>
> Can we make -vec  return a copy and un-depricate vec.negate(), -vec 
> should not modify wrapped data.
>
> ..other changes....
>
> Add Mesh.Unlink(me) for zero user meshes only. current way meshes work 
> is good but in some cases- BPyMesh.getMeshFromObject() - still needs to 
> link to an object for triangulating which means it will not be
> de-allocated,
>
> Add Armature.New()
>
>
> Change the way Object data linking works by changing Object.New()
>
>     currently..
>
>     ob= Object.New('Mesh')
>     scn.link(ob)
>     data= ob.data
>
>
>     propose we pass the data to the object instead so objects can never
>     exist without data
>
>     data= Mesh.New()
>     ob= Object.New(data)
>     scn.link(ob)
>
>     This way the objects type is dictated by its data type so no need to
>     pass a string. and its also saves an extra ob.link().
>
>
> - Cam
> _______________________________________________
> Bf-python mailing list
> Bf-python at projects.blender.org
> http://projects.blender.org/mailman/listinfo/bf-python
>
>   


-- 
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