[Closed] Advice needed for Batch exporting script
Hello all!
I’m trying to make a script that can import .bip files onto a rig and export them into .fbx, and i know the steps i want it to take, but i am a very poor maxScripter and i was wondering if anyone could help me with the ‘import .bip files onto a rig’ part?
thanks!
-ian
First, I’d look up “3ds Max File Loading and Saving” in the help file. This will at lest let you know how to load and save max files.
Next, I’d look up “Biped Load and Save Methods”. This will tell you how to import and export biped motion data
At lastly, I’d look up the “exportFile” function, which will tell you how to export to FBX.
Give it a look and if you have any specific questions, let me know
Shane
thanks. I’ve taken a look at those topics, unfortunately, I’m so new to MaxScripting that I think I’ll need to get to the basics of the language before i can understand the use of those listing functions. I’m trying to hack my way through another script i found online that does most of what i need (thank you Yannick Puech!) but i can’t seem to get the biped.loadBipFile function to work, or at least i don’t know how to get it to work. I think the problem is that i need to call a <biped_ctrl> and i don’t know the control to call, and am so new to max that i don’t know where to find it. i think i’ll dig around a bit more and learn what a biped actually is in max, then i should be able to see where the biped_ctrl that i need to call is. that may do it.
Thanks a bunch for your help!
-ian
lol, how I remember those days…feels just like last week…in fact…
Anyway, off topic…
The <biped_ctrl> is a reference to the biped node object. It is normally the root of the biped (Bip01). In this case you should use $Bip01.
Open up the maxscript listener and (with the scene with the biped open) give it a try. You have renamed it, so replace “Bip01” with the name of the biped you wish to import onto…
Shane
I load bip files using a listbox. See if this little bit will get you headed int eh right direction.
-Chris
fn loadBIPfile =
(
if classOf $ == Biped_Object then
(
animationRange = interval 0 50
max motion mode
myBiped = $
BIPName = OriginalBIPPath + "/" + bipListBox.selected --path and filename of bip
BIPSaveName = bipListBox.selected
BIPBip = myBiped.transform.controller
try
(
biped.loadBipFile BIPBip BIPName #zeroHgt
)
catch(messageBox ("Look at you!
You must still be in Figure Mode.
"))
)
else messageBox "You're a Wizard Harry!
Use your magic to select a Biped first!
"
)
Okay, I’ve found the biped name (Root) and the max function (biped.loadBipFile) but everytime i’ve tried calling the function with the right file name and root name, i get this error:
– Unable to convert: undefined to type: Controller
This is the line i’m trying to run:
biped.loadBipFile $Root “X:\Anims\idle_to_ready.bip”
Where idle_to_ready is the name of the file, and $Root is the name of the biped control object.
My suspicion is that i am missing one of two things:
- the file path for the .bip file is scripted wrong
- a command parameter.
but the error i am getting makes no sense to me, and doesn’t point to what i am missing . Could anyone give me a little help?
thanks!
-ian
Heya!
What it’s telling you here is that for the loadbipfile command to work, you have to load the bip file into the appropriate controller – like trying to paste keyframes to an object but not targeting the position controller properly – it’s the type of thing I do all the time, mainly due to muddling through maxscript myself.
If you have a look at chris code from above he puts in:
BIPBip = myBiped.transform.controller
try
(
biped.loadBipFile BIPBip BIPName #zeroHgt
)
catch(messageBox ("Look at you!
You must still be in Figure Mode.
"))
)
So he’s setting up a shortcut variable called bipbip which is pointing at the bipeds controller, which is myBiped.transform.controller so when he goes on to the loadbipfile command he’s using BipBip as shorthand for myBiped.transform.controller – the line you’re using
biped.loadBipFile $Root "X:\Anims\idle_to_ready.bip
is only targeting the biped and not the bipeds controller – effectively max is getting confused because the object doesn’t have a facility to load a bip file – it’s transform controller on the other hadn does. If you point it correctly using
biped.loadBipFile $Root.transform.controller "X:\Anims\idle_to_ready.bip"
Assuming that your biped is actually called root in your max scene you should have a bit more luck. Another thing that might be happening is I think some paths in max use a double back slash when making path names – might not be the case here since you’re using it as one string.
I constantly make this type of mistake and while it’s frustrating at times it’s nearly always the simple things like paths or spelling mistakes that mess these things up.
Hope this helps!
That helps a little. At the very least i’m getting a different error now:
– Unknown property: “transform” in undefined
Which looks to me like it’s not understanding that $Root is a biped control object. I am also running only this line:
biped.loadBipFile $Root.transform.controller “X:\Anims\idle_to_ready.bip”
So it may also be that a variable needs to be defined that i don’t know of. Either that or the biped is not actually called $Root. However, that should be the name, as that’s the name in this box:
However, having used Max for exactly 15 hours total, it’s a bit difficult for me to know for sure where everything all is. I really appreciate the help given. at this rate i may actually learn Max afterall!
-marvel
I tried a very basic scene and had no issues saving or re-loading the biped…
Do you have a sample “bip” file or scene we check??
Shane
Try it without using the $ (dollar sign) in the Biped name.
-Chris