Anim8or Community

General Category => ASL Scripts => Topic started by: AlecJames on October 21, 2011, 03:38:41 pm

Title: GetAttributeQuaternion returns the wrong object info?
Post by: AlecJames on October 21, 2011, 03:38:41 pm
This is a scene script.  I have a rotating shaft with 36 spikes sticking out of it (36 instances of a spike object).  The shaft is the parent of the spikes.  As the shaft rotates the spikes rotate with it.  The spike has a morph target.  Im just working with one spike to try to get this working. As the shaft rotates the spikes hit an object at 12 o'clock above the shaft - I want the spikes to bend as they go past it, hence the morph target. The scene is 3s long, the shaft only rotates during the middle second.

I have an ASL script in the spike morph target controller. This script calls GetAttributeQuaternion("ShaftObject","orientation").  From the result I calculate the yaw angle, when it's between 350 and 10 degrees I set the morph target to true.  The problem is that the GetAttributeQuaternion call returns info saying the shaft is rotating when its not, i.e. during seconds 0 and 2.  The rotation information appears to be related to another object that is moving idependantly in another part of the scene (its a rectangular block falling from the top to the bottom of the scene.).

I rebuilt the scene with the minimum number of objects and it works as I expect.  Looks like a bug to me :(   
Has anyone seen something similar and know of a work around?