the object's matrix and it's limited rotation range

hey ya’ll. I have this object with a Locked Track constraint, and I’m capturing it’s matrix and passing it’s rotation on to other objects. It’s all working really cool and all, but the matrix has the limitation that it’s range equals (in eulers) -180 < x < 180. It’s important that I get a range of at least 360 both ways, and yes, I realize the logical problem with this. One really good solution would be to set the rotation with an animatable slider. Can blender’s scripted GUI sliders be animated? ie, have ipo’s? I suppose if it’s not built in, I could write a script that would change it’s value with an ipo. Anyway, even if I did that, it’s not real cool for animation. The Locked Track (in XSI it’s called an Up Vector, which makes a lot more sence) is really nice for animation.

I’m thinking now that I could write a script to track the object’s rotation and output a correct value as the object’s angle approached and exceeded 180 degrees…

It seems to me that such a thing should be possible, but I guess I’m gonna have to sleep on it tonight. I’m really looking forward to your responses, I’ve been obsessed with this script for almost a week now. In case your wondering, this is for a Doc Ock type tentacle rig, and this script deals with the twisting of the tentacle segments.

I forgot to mention, the cvs version of blender seems to have some problems with my script, so if you’re trying to do something like this, I’d recomend using 2.33a for the time being.

I’m going to include some terms so this post will get pulled up when people do a search for this kind of thing.

Locked Track
follow path
squidy, sentinel (in case someone is trying to make one of those flying matrix robosquids :smiley: )

yesyesyes :slight_smile: half a year ago i tried in XSI… i didn’t really succeed. a friend of mine told me the story of the “real” squiddies, that they had like a whole armada of custom scripts and controls and stuff.

about your script, what exactly are you up to? i suspect it’s something i’ve been missing quite long… tell me more pls


i hope you are aware of this:


bjornmose: I read that thing over a few times, and I don’t see how it can help me. I am aware of the various ways to calculate rotations in 3d space, however, this all comes back to the issue created by blender. In blender, the only way to get an object’s rotation when it is effected by a constraint – AFAIK – is through the object’s matrix. And as a result, rotation values greater than 180, and less than -180 are not needed, because 181 is the same as (or looks the same as) -179.

solmax: Yes, I can imagine that the guys who made the squiddies did have an armada of scripts. About my script, perhaps you didn’t read my post in it’s entirety? I did say what my script is for.

aaaahhhh… couldn’t sleep.

So, I think I need to add the delta rotation to a variable every frame, and create a special condition that handles the situation where the old rotation value is possitive, and the new one is negative, or vice versa. Because when that happens, the delta rotation value will be wrong, and will equal almost 360 degrees.

I don’t understand what your posting. Can you explain why you require euler values that exceed 180 degrees?

what I needed was something that functions like the volume nob in my car, turn it to the right and the volume keeps going up and up and up. Turn it to the left and the volume goes down and down and down, past a rotation of 360. But it looks like you no longer need to worry about it, I just finished it. I’ll post a complete description of it, along with the .blend, so you all can see just what it’s doing.

Great :slight_smile:

okay, here she is. It works in 2.33a, so if you have something else, I make no promises :slight_smile:

After you open the file, hit g and you will be able to twist the tentacle. I don’t by any means consider this complete at all, so if you want to see what it develops into, mark my horribly plain web site:

“Now for the main event!”

Check it out in Blender:

btw, those arn’t dupliframes.

Woah! That’s nice :slight_smile:


theeth: thanks.

With the way it is now, it has only one problem: If you jump more than one frame, like perhaps you’re working on an animation, and you have animated it to twist, and you move from frame 20 to frame 1, frame 1 will most likly be calculated wrong. The script recalculates the stored rotation value on a frame by frame basis (if you change the script link from redraw to frame changed). I can fix this by storing a rotation value for each frame and reading from that when the tentacle’s animation is done. The script would need to have two modes; generate mode, and replay mode. In generate mode, you would play the animation forward and the script would calculate and store the rotation for each frame. In replay mode it would read from the created list. If working in real time, you could work in generate mode, and perhaps turn off “store values” if you want to work in different frames.

I will probably add a gui at some point.

Amazing work wavez. Very impressive. :o

Thanks for the generous compliments guys. I found a bug, and now the link below the pics links to the current blend.

Unfortunatly, this file doesn’t work in 2.34 :< :frowning: I think it’s because the object matrix is not putting out. :-? This has happened in cvs before, and now it’s back again. yay!

How hard would it be to create a python constraints module? I could really make use of it if it would allow me to effect the time offset parameter of each segment’s path constraint. I will probably attempt this myself if nobody else does it, but I’m not really a programmer.

I’d also like to refer you to the bottom post here:

I was disapointed to see that addPoint is not in 2.34. I could use it.