[Bf-committers] Re: [Bf-blender-cvs] CVS commit:
blender/source/blender/include butspace.h
blender/source/blender/src buttons_object.c
blender/source/blender/python/api2_2x Constraint.c Constraint.h
Blender.c Object.c Pose.c
blender/source/blender/python/api2_2x/doc Constraint.py
API_intro.py ...
Ton Roosendaal
ton at blender.org
Tue May 9 10:24:55 CEST 2006
Hi Malefico,
There's a couple of reasons for constraints to be on Object level, and
not on "Object data" level.
- it allows re-use of an Armature with different constraints set
- constraints themselves allow inter-object relations too
Further it fits with how Blender data was designed in other parts.
Inside of a Mesh you also cannot create relationships with other
objects... for example a Hook (as is for any deformation) is on Object
level too.
The Pose is really just an extension of an Object, providing a mapping
from an Object to its associated data. I know it's a bit confusing when
you don't know the code, that's why I wrote this page on 'how armatures
work'. It's really important for you guys to read that, and just
contact me if there's anything unclear in it.
http://www.blender.org/cms/How_Armatures_work.634.0.html
-Ton-
On 9 May, 2006, at 3:06, malefico andauer wrote:
> Hi Ken,
>
> We are playing with Constraint module, but the fact
> that is an attribute of poses instead of bones,
> confuses us a little...
>
> We tried the example script in the docs and got error.
>
> Sorry my ignorance, but shouldn't this be more logical
> if we just iterate around the bones in an armature and
> get the constraints each bone has ? Don't really get
> what the poses mean and why this is the way to access
> to constraints...
>
> Can you check the example you posted in the docs and
> explain it or provide some other example ?
>
> The code in the docs is:
>
> ---------
> from Blender import *
>
> ob = Object.Get('Armature')
> for bonename in pose.bones.keys():
> bone = pose.bones[bonename]
> for const in bone.constraints:
> print bone.name,'=>'const.type
> ----------
>
> We changed it to:
>
> ------------
> from Blender import *
>
> pose = Armature.Get('Armature')
> for bonename in pose.bones.keys():
> bone = pose.bones[bonename]
> for const in bone.constraints:
> print bone.name,'=>',const.type
> -------
>
> ...to get rid of some error messages, but we're stuck
> on "
>
> Traceback (most recent call last):
> File "test_constraint.py", line 6, in ?
> for const in bone.constraints:
> AttributeError: 'Bone' object has no attribute
> 'constraints'
>
>
>
> Thanks for any help !
>
> malefico
>
> --- Ken Hughes <khughes at pacific.edu> escribió:
>
>> khughes (Ken Hughes) 2006/05/07 16:57:58 CEST
>>
>> Modified files:
>> blender/source/blender/include butspace.h
>> blender/source/blender/src buttons_object.c
>> blender/source/blender/python/api2_2x Blender.c
>> Object.c
>> Pose.c
>> blender/source/blender/python/api2_2x/doc
>> API_intro.py
>>
>> Object.py Pose.py
>> Added files:
>> blender/source/blender/python/api2_2x
>> Constraint.c
>>
>> Constraint.h
>> blender/source/blender/python/api2_2x/doc
>> Constraint.py
>>
>> Log:
>> ===Python API===
>> New Constraint API. Constraints are accessible
>> through a "constraints"
>> attribute in poses and objects. Would be REALLY
>> NICE for armature users to
>> pound on this code.
>>
>> Revision Changes Path
>> 1.79 +8 -1
>> blender/source/blender/include/butspace.h
>>
>>
> <http://projects.blender.org/viewcvs/viewcvs.cgi/blender/source/
> blender/include/butspace.h.diff?r1=1.78&r2=1.79&cvsroot=bf-blender>
>> 1.156 +25 -10
>> blender/source/blender/src/buttons_object.c
>>
>>
> <http://projects.blender.org/viewcvs/viewcvs.cgi/blender/source/
> blender/src/buttons_object.c.diff?r1=1.155&r2=1.156&cvsroot=bf-
> blender>
>> 1.82 +3 -1
>> blender/source/blender/python/api2_2x/Blender.c
>>
>>
> <http://projects.blender.org/viewcvs/viewcvs.cgi/blender/source/
> blender/python/api2_2x/Blender.c.diff?r1=1.81&r2=1.82&cvsroot=bf-
> blender>
>> 1.187 +5 -2
>> blender/source/blender/python/api2_2x/Object.c
>>
>>
> <http://projects.blender.org/viewcvs/viewcvs.cgi/blender/source/
> blender/python/api2_2x/Object.c.diff?r1=1.186&r2=1.187&cvsroot=bf-
> blender>
>> 1.11 +9 -26
>> blender/source/blender/python/api2_2x/Pose.c
>>
>>
> <http://projects.blender.org/viewcvs/viewcvs.cgi/blender/source/
> blender/python/api2_2x/Pose.c.diff?r1=1.10&r2=1.11&cvsroot=bf-blender>
>> 1.33 +1 -0
>>
> blender/source/blender/python/api2_2x/doc/API_intro.py
>>
>>
> <http://projects.blender.org/viewcvs/viewcvs.cgi/blender/source/
> blender/python/api2_2x/doc/API_intro.py.diff?
> r1=1.32&r2=1.33&cvsroot=bf-blender>
>> 1.70 +3 -1
>> blender/source/blender/python/api2_2x/doc/Object.py
>>
>>
> <http://projects.blender.org/viewcvs/viewcvs.cgi/blender/source/
> blender/python/api2_2x/doc/Object.py.diff?r1=1.69&r2=1.70&cvsroot=bf-
> blender>
>> 1.4 +3 -0
>> blender/source/blender/python/api2_2x/doc/Pose.py
>>
>>
> <http://projects.blender.org/viewcvs/viewcvs.cgi/blender/source/
> blender/python/api2_2x/doc/Pose.py.diff?r1=1.3&r2=1.4&cvsroot=bf-
> blender>
>> _______________________________________________
>> Bf-blender-cvs mailing list
>> Bf-blender-cvs at projects.blender.org
>>
> http://projects.blender.org/mailman/listinfo/bf-blender-cvs
>>
>
>
>
>
>
>
> ___________________________________________________________
> 1GB gratis, Antivirus y Antispam
> Correo Yahoo!, el mejor correo web del mundo
> http://correo.yahoo.com.ar
>
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at projects.blender.org
> http://projects.blender.org/mailman/listinfo/bf-committers
>
>
>
------------------------------------------------------------------------
--
Ton Roosendaal Blender Foundation ton at blender.org
http://www.blender.org
More information about the Bf-committers
mailing list