Hi guys. So here’s more of a design question that I’m trying to solve today.
As it is really a mess exporting 3D animations from Maya to several dae files (The from -> to frame in animations doesn’t seem to work) and we would have to work with one maya file/animation I decided to write my own animation module instead where we define animationname and start/stop for the cursor in a json file. We then have one single animation containing all animationclips and then just set the cursor to the correct place to start and stop.
This could be a matter to change but hey… for now we try this out.
Now to todays nut to crack:
I want to be able to track all animations being played by storing them in an “active” table. To be able to see the progress of the animation I am keying all the animations with the model url. Like this:
{ [msg.url(“themodel url”)] = { animation_table_in_here }}
Now this does not work as msg.urls will not be the same if you create them twice. Here is a small test made with msg.url() and go.get_id()
local gid1 = go.get_id()
local gid2 = go.get_id()
local u1 = msg.url()
local u2 = msg.url()
local tbl = {}
tbl[gid1] = "reachable with gid2"
tbl[u1] = "not reachable with u2"
print( gid1 == gid2 )
print( u1 == u2 )
print(tbl[gid2])
print(tbl[u2])
--[[ CONSOLE RESULTS:
DEBUG:SCRIPT: true
DEBUG:SCRIPT: true
DEBUG:SCRIPT: reachable with gid2
DEBUG:SCRIPT: nil
--]]
Basically. There is obviously a way to use go id’s as keys (as they are pointing to the same adress everytime). Is there a way to do this with specific component?
I want to be able to reach the animation state from anywhere in the code with something simple as: anim_module.get_state(msg.url("/obj#model"))
and no… I really don’t want to key things with strings.