[Bf-committers] Re: [Bf-blender-cvs] CVS commit:blender/source/blender/include BIF_editmesh.hblender/source/blender/python/api2_2xmeshPrimitive.c meshPrimitive.h Mesh.c blender/source/blender/srceditmesh_add.cblender/source/blender/python/api2_2x/doc

Campbell Barton cbarton at metavr.com
Thu May 25 23:56:00 CEST 2006


Agree 100%, most of the time you have the data when making a new object. 
Also, if a name isnt provided, it could use the data name so that the 
object name would be more usefull.

The object module is sloppy about what relates to the corrent scene and 
what dosent.
IMHO we need to seperate object and scene functionality more so that its 
less of a pain for people to work with scene.

Object.Get() - gets all objects
Object.GetSelected() - gets all objects that are visible in the 3d view 
(localview too), that the mouse last hovered over.
Scene.GetCurrent().getChildren() - not a very descriptive name (hints to 
parent/child relationships which are odd because an object may be in 
many scenes)

Id like to have a scene.objects iterator could do (including gilberts 
suggestion)..

scn= Scene.GetCurrent()
scn.objects.append( Object.New(me) )

If Object.New() added to the current Scene then it would need to be 
optional.
Object.New(me, current_scene=True) # (seems a bit messy?)

- Cam

Gilbert, Joseph T. wrote:
> Would be nice if you could do:
>
> from Blender import *
>   
> me = Mesh.Primitives.UVsphere(10,20,3) # 10 segments, 20 rings, diameter
> 3
> ob = Object.New(me)
> Scene.GetCurrent().link(ob)
>
> It seems to me that Object.New should be able to take a datablock
> object, test the datatype and link it if appropriate rather than forcing
> the object class to create a new datablock everytime which is then
> released later.
>
>
> -----Original Message-----
> From: bf-committers-bounces at projects.blender.org
> [mailto:bf-committers-bounces at projects.blender.org] On Behalf Of
> Alexander Ewering
> Sent: Thursday, May 25, 2006 1:57 PM
> To: bf-blender developers
> Subject: Re: [Bf-committers] Re: [Bf-blender-cvs] CVS
> commit:blender/source/blender/include
> BIF_editmesh.hblender/source/blender/python/api2_2xmeshPrimitive.c
> meshPrimitive.h Mesh.c
> blender/source/blender/srceditmesh_add.cblender/source/blender/python/ap
> i2_2x/doc 
>
>
> On Thu, 25 May 2006, Ken Hughes wrote:
>
>   
>> No, it's been brought up before as a project (too bad nobody jumped on
>>     
> it for 
>   
>> SoC, but oh well).  There needs to be a "simple" interface on top of
>>     
> the 
>   
>> Python API to do common things like this.  It's not hard to write a
>>     
> Python 
>   
>> script that does this for you, which could then be included as "from 
>> Blender.Simple import *" or something.   But someone has to take the
>>     
> time to 
>   
>> sit down and either code it or at least code what that API needs so
>>     
> somebody 
>   
>> else can code it.  Believe it or not, I don't write lots of scripts in
>>     
> python 
>   
>> -- certainly not as many as others so -- so I'm not the best person to
>>     
> figure 
>   
>> out what should go into the API.
>>     
>
> Yes, as I said, my comment was not at all related to what you actually
> committed.
>
> I think this topic has been brought up before, and such a wrapper would
> definitely be a great addition.
>
> The biggest issue here is not coding it (because that is pretty simple),
> the
> biggest issue is design - go into the brain of a user and think from
> there:
> A user expects a scripting API to work just like the UI - because that's
> the
> only thing they'll know and are comfortable with.
>
> Anyway, probably the wrong list for it. I was just shocked at the code
> and
> had to say something. ;)
>
> | alexander ewering              instinctive mediaworks
> | ae[@]instinctive[.]de   http://www[.]instinctive[.]de
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at projects.blender.org
> http://projects.blender.org/mailman/listinfo/bf-committers
> _______________________________________________
> 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