Welcome |
---|
Welcome to Caligari Truespace 3D Modeling Forum and Tutorials. Click this link to join our community today. |
tsvetan wrote:At the moment it works for one SI coordinate system, I will support it the next time.
I haven't tried it with a typical Battlezone's model, so feedbacks are most appreciated.
tsvetan wrote:The newest version supports object animation and ambience. Please attach a file, if it causes errors.
tsvetan wrote:Hi Leroy,
I make some tests and it will be helpful if there is a model with skin from the battlezone library.
It should contain the "SI_Envelope" and "SI_AnimationKey" templates.
Thanks
fn SI_AnimationKey_fn o = (
--readDelimitedString in_file "}"
if objectAnimation == true do (
xo = amax #((finditem axisorder[axisorder_id] 1),(finditem axisorder[axisorder_id] 4))
yo = amax #((finditem axisorder[axisorder_id] 2),(finditem axisorder[axisorder_id] 5))
zo = amax #((finditem axisorder[axisorder_id] 3),(finditem axisorder[axisorder_id] 6))
keyType = readValue in_file
numberOfKeys = readValue in_file
local tqp = (quat 0 0 0 1)
for i = 1 to numberOfKeys do (
frame1 = readValue in_file
expr = readValue in_file
expr_arr = #(); expr_arr.count = expr + expr;
for j = 1 to expr do (
expr_arr[j] = readValue in_file;--print expr_arr[j]
expr_arr[j+expr] = -expr_arr[j]
)
case keyType of (
(0):(
temp_quat = quat -expr_arr[1] -expr_arr[3] expr_arr[2] expr_arr[4]
temp_quat = temp_quat + (quat 1 0 0 0)
quatAsEulerAngle = quatToEuler temp_quat
eulerAsAngleAxis = quatAsEulerAngle as angleAxis
rc = o.rotation.controller
addNewKey rc frame1
try (
rc.x_rotation.keys[i].value = quatAsEulerAngle.x; rc.y_rotation.keys[i].value = quatAsEulerAngle.y; rc.z_rotation.keys[i].value = quatAsEulerAngle.z
) catch (
tq = quat (temp_quat.x*(/*-*/1)) temp_quat.y temp_quat.z temp_quat.w
rc.keys[i].value = tqp - (tq)/*- tqp*/
tqp = tq
print tq
print rc.keys[i].value
)
)
(1):(
sc = o.scale.controller
addNewKey sc frame1
sc.keys[i].value.x = expr_arr[3]; sc.keys[i].value.y = expr_arr[1]; sc.keys[i].value.z = expr_arr[2];
)
(2):(
tc = o.position.controller
addNewKey tc frame1
try (
tc.x_position.keys[i].value = expr_arr[xo];
tc.y_position.keys[i].value = expr_arr[yo];
tc.z_position.keys[i].value = expr_arr[zo];
--tc.x_position.keys[i].value = expr_arr[3]; tc.y_position.keys[i].value = expr_arr[1]; tc.z_position.keys[i].value = expr_arr[2]
) catch (
tc.keys[i].value = [expr_arr[xo],expr_arr[yo],expr_arr[zo]]
)
)
(3):(
rc = o.rotation.controller
--euler = eulerAngles expr_arr[3] expr_arr[1] expr_arr[2]
euler = eulerangles expr_arr[xo] expr_arr[yo] expr_arr[zo]
addNewKey rc frame1
try (
rc.x_rotation.keys[i].value = expr_arr[(xo)];
rc.y_rotation.keys[i].value = expr_arr[(yo)];
rc.z_rotation.keys[i].value = expr_arr[(zo)]
--rc.x_rotation.keys[i].value = expr_arr[1]; rc.y_rotation.keys[i].value = expr_arr[3]; rc.z_rotation.keys[i].value = expr_arr[2];
) catch (
rc.keys[i].value = tqp - (euler as quat)
tqp = euler as quat
)
)
)
skipToNextLine in_file
)
)
readDelimitedString in_file "}"
--ha = readline in_file; print "a";print a
)
Return to Blogging GMAX 1.2 a la web
Users browsing this forum: No registered users and 1 guest