Page 1 of 1

SetSoundtrack() not working

Posted: Sat Oct 15, 2005 11:17 am
by 7feet
Thanks, LM, for throwing this in, but it's not working correctly. So what I did:

Print the path of the current soundtrack using moho.document:Soundtrack(). That reports correctly. Set a new one with SetSoundtrack, and then print moho.document:Soundtrack() again. Still looks good. However, the new soundtrack isn't actually assigned. The old one still plays and displays in the timeline. Ack!

I have a whole passel of pretty nifty sound stuff about ready to go, but I need this lil' doodad so it's a bit of a bummer. If you could look into it I'd greatly appreciate it. Oh, yeah, this is using 5.2 on Win2k. Thanks again.

Posted: Sat Oct 15, 2005 11:36 am
by Rai López
HI! There is a 5.2.1 version available, althought LM say nothing about a possible solution of this bug in the announcements post... but well, who knows :roll: ...GOOD LUCK!!!

Posted: Sat Oct 15, 2005 12:31 pm
by 7feet
I tried 5.21 right after I posted, still a no-go. I just hadn't installed it yet because it's a pain to track down and reinstall all my scripts.

Posted: Fri Oct 21, 2005 6:55 pm
by Lost Marble
You're right - it isn't working. I'll get it fixed for the next update. I don't remember what script you're working on that needs to do this?

Posted: Fri Oct 21, 2005 10:49 pm
by 7feet
A mixer of sorts. The first one I was trying to use it with was the PadSound script I put over in the swcripting section. Basically, add silence to the begginning of an audio file so that it starts at the currently selected frame, and then assign it as the soundtrack. But once it's working I'm planning on putting together a reasonable audio mixer script (that should make some people happy). I wrote a buncha audio routines in Lua, so I might as well use them. Thanks.

Also, I believe it's been mentioned before, but is there anything in place that will allow me to get the path of the currently opened Moho file? I have a few things that need to produce data files to keep track of things, and it would be a lot simplern to keep track of things to just be able to save them to the same folder as the moho file.

And I have one other question - Is there acces in the scripting interface to the animatable bone dynamics keyframe values yet, and if so, what are the called? Thanks again.

Posted: Mon Oct 24, 2005 6:38 pm
by Lost Marble
7feet wrote:Also, I believe it's been mentioned before, but is there anything in place that will allow me to get the path of the currently opened Moho file?
No, but I think that can be added.
7feet wrote:And I have one other question - Is there acces in the scripting interface to the animatable bone dynamics keyframe values yet, and if so, what are the called? Thanks again.
Yes. If you have a bone object, then it would be:

bone.fBoneDynamics

It's a AnimBool object, so you could do things like

bone.fBoneDynamics:SetValue(144, true)
if (bone.fBoneDynamics.value) then
...
end

Posted: Tue Oct 25, 2005 1:48 am
by 7feet
Gotcha. Thanks. I figured out the dynamics bit a little after I posted it from the "expecting type animbool" error.

And if you throw in those couple of doodads, I'd be quite happy.