Notifications
Clear all

[Closed] Biped Figure Mode

Does anybody know how to activate the Figure Mode on a Biped?
This is what i’ve tried but it doesn’t work.


bool BipedFigureMode(INode* node, bool state) {
 
if (node->IsRootNode()) return false;
 
Control* c = node->GetTMController();
 
if ((c->ClassID() == BIPSLAVE_CONTROL_CLASS_ID) ||
	 (c->ClassID() == BIPBODY_CONTROL_CLASS_ID) ||
	 (c->ClassID() == FOOTPRINT_CLASS_ID)) {
 
	 IBipedExport *iBiped =(IBipedExport *)c->GetInterface(I_BIPINTERFACE);
 
	 if (iBiped) {
 
		 if (state) iBiped->BeginFigureMode(1);
		 else iBiped->EndFigureMode(1);
 
		 Control* iMaster = (Control *) c->GetInterface(I_MASTER);
		 iMaster->NotifyDependents(FOREVER, PART_TM, REFMSG_CHANGE);
 
		 c->ReleaseInterface(I_MASTER,iMaster);
		 c->ReleaseInterface(I_BIPINTERFACE,iBiped);
 
		 return true;
	 }
}
return false;
}

6 Replies

Hope this helps.

-Chris

  -- Creates a Biped and sets it in Figue Mode
   
   (		
   		myBiped = biped.CreateNew 72 -90 [0,0,69] neckLinks:2 spineLinks:5 fingers:5 \
   		fingerLinks:3 toes:5 toeLinks:3 forearmTwistLinks:4
   		newBip = myBiped.transform.controller
   		newBip.figureMode = True --Figure Mode On
   		newBip.bodyType = 3
   		max motion mode
   		select myBiped
   )

A useful little toggle script I wrote:

– figure mode toggle
biped_ctrl=$char.controller – $char is my root bone, any will do

– get curent mode
cmode = biped_ctrl.figureMode

– toggle it
if cmode == true then (biped_ctrl.figureMode= false)
else (biped_ctrl.figureMode= true)

I saved this as figtoggle.ms in my scripts folder, then embedded it into the UI so I can always access it with a quick button press.

1 Reply
(@rustyknight)
Joined: 11 months ago

Posts: 0

Nice little script, may i point out that:

 if cmode == true then  (biped_ctrl.figureMode= false)
   else (biped_ctrl.figureMode= true)

Could have be written as:

biped_ctrl.figureMode = (not cmode)

or if you want to get really anal

biped_ctrl.figureMode = (not biped_ctrl.figureMode)

I know, it’s petty, but it will make the script faster and easier to read from a logical point of view…but you know what they say, if it ain’t broke…

Shane

Hey, not anal, thats a great little toggle idea!

1 Reply
(@rustyknight)
Joined: 11 months ago

Posts: 0

By no means a critism, only an idea – booleans are cool that way…

Shane

Thanks for the info guys, really useful

Cheers
Dan