Hi there.
I'm a one-year LDcad user and now a newbie with LUA and animation. I use LDcad v1.5 on Ubuntu 16.4 LTS. I have reproduced the example in the Roland Merkel Youtube, simplified it and, after some time to struggle, I have an error "Active refline link needed" in the line reading ax1:setOri(ori). I consulted the Message error script console ldcad1.5 topic in the LDraw forum, but this is not the case, and there is no information about LUA in the Internet. I send the animation2.mpd and the .lua files for examination. All seems to be in order, but nothing happens.
Any suggestion? Thanks in advance for your help.
=========== animation2.mpd ===========================
0 FILE main.ldr
0 Author: Conrad G.-Anleo
0 !LDCAD SCRIPT [source=animation2.lua]
1 16 0 0 0 1 0 0 0 1 0 0 0 1 axel1.ldr
0 FILE axel1.ldr
0 Author: Conrad G.-Anleo
1 7 0 0 0 0 1 0 0 0 -1 -1 0 0 32073.dat
1 14 0 0 0 1 0 0 0 1 0 0 0 1 32072.dat
========== animation2.lua =================
--[[
animation2.lua
(c) Conrad G.-Anleo
]]
function register()
local ani=ldc.animation('demo')
ani:setLength(20)
ani:setEvent('frame', 'onFrame')
end
function onFrame()
local ani=ldc.animation('demo')
local mainSf=ldc.subfile()
local ori=ldc.matrix()
local angle=-4*360*ani:getFrameTime()/ani:getLength()
local ax1=mainSf:getRef('axle1')
ori:setRotate(angle, 1, 0, 0)
ax1:setOri(ori)
end
register()
============= END ==============================