Previous Blog Next Blog
Prev/Next Blog
by date

Plan for Jeff Gran

Plan for Jeff Gran
Name:Jeff Gran
Date Posted:Aug 15, 2005
Rating:4.0 out of 5
Public:YES
Comments:YES
RSS Feed:GarageGames Blog feedor Subscribe with .
Profile Page:View profile page for Jeff Gran

Blog post
I made a Parent Constraint
Yeah, I figured out how to use Blender's Object ScriptLinks to define custom controllers for objects. It's actually extremely powerful. Anything you can express in code you can use to control your objects.

I was annoyed by the fact that (a) there's no parent constraint or position/rotation constraint with offsets, and (b) You currently can't create constraints from script. But now I can have an object be the "parent" of another object, with my own custom and dynamic offset values, all without actually affecting the hierarchy - both objects are still at the scene root. I'm sure it doesn't sound that exciting to most, but I'm jazzed that I figured it out and it opens up a lot of possibilities with my python scripting that I thought were dead ends. So, progress on TorqueSkel Blender continues.

Here's the code for the hell of it - pretty simple really (now that it's here in front of me :))


import Blender
##########################
parent = Blender.Object.Get("Sphere")
###################################


obj = Blender.link

obj.addProperty("offsetX", (obj.LocX - parent.LocX), "FLOAT")
obj.addProperty("offsetY", (obj.LocY - parent.LocY), "FLOAT")
obj.addProperty("offsetZ", (obj.LocZ - parent.LocZ), "FLOAT")

LV=Blender.Mathutils.Vector([obj.getProperty("offsetX").getData(),obj.getProperty("offsetY").getData(),obj.getProperty("offsetZ").getData()])

PM = parent.getMatrix()
PM = PM.rotationPart()

newX = (LV.x * PM[0][0]) + (LV.y * PM[1][0]) + (LV.z * PM[2][0])
newY = (LV.x * PM[0][1]) + (LV.y * PM[1][1]) + (LV.z * PM[2][1])
newZ = (LV.x * PM[0][2]) + (LV.y * PM[1][2]) + (LV.z * PM[2][2])

obj.loc = [parent.LocX + newX, parent.LocY + newY, parent.LocZ + newZ]
obj.rot = parent.rot


Oh, and I also have a super-spiffy addition to TorqueSkel MAX almost finished... but I'll wait 'till it's done and tested to unveil it.

Recent Blog Posts
List:01/01/06 - 3D Language:Spain available for purchase
11/12/05 - Plan for Jeff Gran
11/03/05 - Plan for Jeff Gran
09/04/05 - Plan for Jeff Gran
08/15/05 - Plan for Jeff Gran
07/25/05 - Plan for Jeff Gran
07/17/05 - Plan for Jeff Gran
04/30/05 - Plan for Jeff Gran

Submit ResourceSubmit your own resources!

Matthew Langley   (Aug 15, 2005 at 15:06 GMT)
Quote:

Oh, and I also have a super-spiffy addition to TorqueSkel MAX almost finished... but I'll wait 'till it's done and tested to unveil it.


Damn teasing ! :)

btw awesome news on blender progress, I know a lot of people are looking forward to it.

Joseph Greenawalt   (Aug 15, 2005 at 19:23 GMT)
Cool! One step closer to a useable Blender IK rig :) This is some groundbreaking work you're doing towards unifying the art pipeline(s) for character creation. I've always kinda felt that blender users were the redheaded stepchildren of the torque art world, but if this comes to fruition it has the potential to make blender one of the primary tools for 3d modeling with Torque. Thanks again.

You must be a member and be logged in to either append comments or rate this resource.