[Robotics] Python control of armature in the GE

Benoit Bolsee benoit.bolsee at online.be
Fri Sep 11 17:06:18 CEST 2009


Blender 2.5 needs Python 3.1 indeed (at least the GE). 
Regarding Blender module, yes it's gone, you need to switch to the new
RNA and operator API.
You have the documentation (still partial) here :
 http://www.graphicall.org/ftp/ideasman42/html/bpy-module.html

The principle is that you get reference to the data block you want to
manipulate from the context
(http://www.graphicall.org/ftp/ideasman42/html/bpy.types.Context-class.h
tml): you start from the main and dig through it.

Afaik it's not available in the GE yet.
So in the GE you must stick with GE API only, which hasn't changed.
You will noticed that I implemented proxy classes in the GE to bone,
pose channel, and armatures. So you don't need bpy for that.

I hope this news are not too disappointing ;-)

Regards,
Benoit



> -----Original Message-----
> From: robotics-bounces at blender.org 
> [mailto:robotics-bounces at blender.org] On Behalf Of Markus Mehrwald
> Sent: vendredi 11 septembre 2009 16:04
> To: Blender and Robotics
> Subject: Re: [Robotics] Python control of armature in the GE
> 
> 
> Hi Benoit,
> 
> I figured out some other problems now. I got Blender to compile only 
> with Pyhton 3.1 but now I cannot use my scripts anymore with 
> the error:
> 
> Traceback (most recent call last):
>    File "Steuerung.py", line 4, in <module>
> ImportError: No module named Blender
> 
> Do you know what this could be or is there already a 
> documentation for 2.5?
> 
> Thanks,
> Markus
> 
> Benoit Bolsee schrieb:
> > I fixed CMake in the itasc branch. Sorry for the delay.
> > 
> > /benoit
> > 
> >> -----Original Message-----
> >> From: robotics-bounces at blender.org
> >> [mailto:robotics-bounces at blender.org] On Behalf Of Markus Mehrwald
> >> Sent: vendredi 11 septembre 2009 11:21
> >> To: Blender and Robotics
> >> Subject: Re: [Robotics] Python control of armature in the GE
> >>
> >>
> >> Hi,
> >>
> >> I just managed it to compile the branch with the ikplugin. For some
> >> reasons I was not able to compile because of a few errors. I 
> >> think its 
> >> just some little changes in the CMake files. First of all the 
> >> BIK_api.h 
> >> was not found. I did it quick and dirty by copying the full 
> >> path in the 
> >> files where it is needed. The second thing was that obviously 
> >> the libs 
> >> bf_ikplugin and bf_ITASC are not in the list of libs to link 
> >> against. Maybe you did not update the CMakeList or was it a 
> >> problem of my computer?
> >>
> >> Regards,
> >> Markus
> >>
> >>
> >> Benoit Bolsee schrieb:
> >>> Hi,
> >>>  
> >>> I have added support for controlling armatures through
> >> Python in the
> >>> GE.
> >>> This is provided through the new proxy class
> >> BL_ArmatureChannel that
> >>> corresponds to the pose channel structure. Most attributes match
> >>> directly the Blender bPoseChannel structure but I added a 
> >>> 'joint_rotation' attribute that gives direct access to 
> >> joint angles. You
> >>> can use this attribute to set the joint angles from
> >> external data or
> >>> your own calculation and the armature will move according
> >> to it. If the
> >>> armature is controlled by IK, you can read the joint angles
> >> computed by
> >>> the algorithm. Full details is provided in the BPY documentation
> >>> included in the packages below. Download them if you want 
> >> to know more
> >>> about it.
> >>>  
> >>> Other fix in this build is correct matrix operation with 
> MathUtils:
> >>>
> >> http://lists.blender.org/pipermail/bf-blender-cvs/2009-Septemb
> >> er/022245.html
> >>>  
> >>> For those who want to experiment, I made two builds on graphicall:
> >>>  
> >>> Linux:
> >>>
> >> http://graphicall.org/builds/builds/showbuild.>
> > php?action=show&id=1082
> >> <http://graphicall.org/builds/builds/showbuild.php?action=show
> > &id=1082>
> >> Windows:
> >> 
> http://graphicall.org/builds/builds/showbuild.>
php?action=show&id=1080 
> >>
> > 
> <http://graphicall.org/builds/builds/showbuild>
.php?action=show&id=1080
> > >
> >>  
> >> If your system is not in this list, you can check out the itasc 
> >> branch and compile. For those interested in the 
> implementation, look 
> >> at the BL_ArmatureChannel.cpp module in 
> source/gameengine/converter. 
> >> If
> > you
> >> have some ideas to extend the API, you are welcome to make your own
> >> additions and send me the diff, I will review and commit 
> them to SVN.
> >>  
> >> The itasc branch will be merged with 2.5 in the coming 
> days, it would
> >> be
> >> nice to get some feedback before I start the merge.
> >>  
> >> /benoit.
> >>  
> >>
> >>
> >> 
> ---------------------------------------------------------------------
> >> -
> >> --
> >>
> >> _______________________________________________
> >> Robotics mailing list
> >> Robotics at blender.org
> >> http://lists.blender.org/mailman/listinfo/robotics
> > 
> 
> _______________________________________________
> Robotics mailing list
> Robotics at blender.org
> http://lists.blender.org/mailman/listinfo/robotics
> 



More information about the Robotics mailing list