Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk® MotionBuilder® / Python / how to set the 'in point' property for an audio clip?
  RSS 2.0 ATOM  

how to set the 'in point' property for an audio clip?
Rate this thread
 
23108
 
Permlink of this thread  
avatar
  • Location: Los Angeles CA
  • Total Posts: 99
  • Joined: 16 May 2008 02:40 AM

Hi,

I’m just trying to set the in point property for a .wav file

from pyfbsdk import *

SceneAudio FBSystem().AudioClips
#loop thru Audio list to find .wav file then change settings
for aAudio in SceneAudio:
    if 
aAudio.Name.find('c070_BA_AA_03_rcS.wav') != -1:
        
aAudio.Selected True #this line just tests to see if file is found
        
aAudio.PropertyList.Find('In Point').Data 86444

This script can find the file and select it, but it won’t change the in point setting in the last line. Any ideas?

thx,
Brian



MotionBuilder 7.5 thru ...
3dsMax 2.5 thru ...

Replies: 0
avatar

Hi Brian,

The property names don’t always correspond to the UI, unfortunately and that makes it challenging to discover what the property name is, in this case try “InPoint”, I tried this and it worked, however I believe you are trying to set it as a float and I don’t believe it is.

Tip: One trick that is very helpful is when you can’t find the property based on the UI name is to set the property in the UI, save the scene as ASCII, then using a text editor search the ASCII fbx file for the value or name you think it might be.  So for example for int or float properties, you can set the attribute value to something crazy like 33 and then in the ascii file just search for 33, then you have your name. However in some cases it is a bit harder if it is a Boolean variable, in this case likely just start keyword searching the ASCII file to things you think it should be called, then usually you will stumble upon the property name.

Hope this helps,

~Kristine



KRISTINE MIDDLEMISS | SENIOR DEVELOPER CONSULTANT
AUTODESK DEVELOPER NETWORK Media & Entertainment
http://www.autodesk.com/joinadn

Replies: 0
avatar

Hey Kristine, thanks for the ascii file tip. Lots of good stuff in there.

So I found the “inpoint” setting, but I’m confused by the variable type. In my file I set it to “86400 (00)”, but when I view it in the ascii file it is “162969033862800” not sure what to make of it.

thx,
Brian



MotionBuilder 7.5 thru ...
3dsMax 2.5 thru ...

Replies: 0
avatar

Hi Brian,

I just notice the property InPoint is directly exposed off the class FBAudioClip, so you don’t need to use the property list:(however the way you are doing it is fine too):

FBTime InPoint
Read Write Property: When not used in the Story, this specify when the clips begin to play.

So you need to set it as FBTime,

Kristine



KRISTINE MIDDLEMISS | SENIOR DEVELOPER CONSULTANT
AUTODESK DEVELOPER NETWORK Media & Entertainment
http://www.autodesk.com/joinadn

Replies: 0
avatar

hey, thx but i didn’t see “InPoint” property for either FBAudioClip or FBtime in the help reference. Are you using MB 2009? I’m using MB 7.5 ext2.

Also, when i look at that property in the fbx ascii file it reads:

Property: “InPoint”, “KTime”, “”,162969033862800

What kind of variable is “KTime”?

thx,
Brian



MotionBuilder 7.5 thru ...
3dsMax 2.5 thru ...

Replies: 0
avatar

Hi Brian,

I was using 2009, I checked in 7.5 ext 2 it’s not documented sorry!, but it’s there, you can look at the 2009 docs for more information to use it in 7.5

http://images.autodesk.com/adsk/files/motionbuilder_python_scripting_help.zip

KTime is FBTime in Python, so just create an instance of FBTime and set InPoint to that.

Kristine



KRISTINE MIDDLEMISS | SENIOR DEVELOPER CONSULTANT
AUTODESK DEVELOPER NETWORK Media & Entertainment
http://www.autodesk.com/joinadn

Replies: 0
avatar

thanks Kristine. I’m a little closer now, but my problem is I have a frame number ex “86666” for my inpoint setting. Do I have to convert it to a timecode format to set the inpoint?

from pyfbsdk import *

myTime FBTime()
myTime.Set(86666)
print 
myTime

SceneAudio 
FBSystem().AudioClips
#loop thru Audio list to find .wav file then change settings
for aAudio in SceneAudio:
        
aAudio.Selected True
        aAudio
.PropertyList.Find('InPoint').Data myTime

The help doc says: 

Set (long pTime)
Set time value from a long.

I tried to convert 86666 to a long first, but that didn’t work either???

Brian

Nevermind, I got it now. I just used “get” to get a long and “set” to set as a long.

thx,
Brian



MotionBuilder 7.5 thru ...
3dsMax 2.5 thru ...

Replies: 0