Hey Capricorn,capricorn33 wrote:You know I'm having the exact same problem with another script that I am working on right now... Sorry Breinmeester, I don't have any answers to give you but I would ALSO be very, very interested - no, THRILLED - if anyone could share some kind of insight to this enigma (regarding how to get the position of a point affected by bones and layer transformation.... )
All this matrix stuff makes my brain hurt big time and I'm really worried that my head might be about to explode from trying to figure this out...
So if anyone can help out I can also promise to share a very cool arc tracking device when I'm finished with it...
In my very sparse free time I managed to fool around with this a little and Ive found something that might be of use to you. It doesn't really work for what Im doing, but it might suffice your needs.
https://rapidshare.com/files/4250009215 ... racker.zip
Embed the script on the 'locator' layer and the layer translate will follow a point in the vector layer below, even when it's transformed using bones or layer transformations.
Code: Select all
local mesh = moho:LayerAsVector(targetvectorlayer):Mesh()
local pt = mesh:Point(1)
local v = LM.Vector2:new_local()
local dv = LM.Vector2:new_local()
local k = LM.Vector3:new_local()
local m = LM.Matrix:new_local()
v:Set(pt.fAnimPos:GetValue(moho.frame))
dv = pt.fPos - v
-- Do transformations:
targetvectorlayer:GetFullTransform(moho.frame, m, moho.document)
m:Transform(v)
v = v + dv
k.x = v.x
k.y = v.y
-- Set result:
thislayer.fTranslation:SetValue(moho.frame, k)