Jump to content

Massive Simulation -> Houdini


Alexander Bong

Recommended Posts

Hi,

I am looking for a way to import my massive simulation into Houdini so I can add some effects to it.

Massive 4 has the ability to output the agents as an FBX file, However, without the skinned mesh. The ideal solution is to skin the mesh back to these joints on every agent.

So, my naive solution is to read every agent's joint's rotational value and paste it into my own skinned character's joint chain. So I tried picking up the the HOU module. This is where i need help.

This is what i got so far...

# to load in the simulated agents, copy it's joint rotation and position, paste it on a skinned character

for agentNumber in range(20): #change to number of agent
	#load in agent from simulation
	hou.hscript("fbximport /Sim/soldierAgent2.%i.fbx" %agentNumber)           
	importedSoldier = hou.node('/obj/soldierAgent2_%i' %agentNumber) 

	#duplicate master copy of skinned character
	mySoldier = hou.node('/obj/masterSoldier')
	mySoldier = duplicate(mySoldier)#<--------need help with this command. duplicating the master copy so i can copy the agent xform values into it.
	mySoldier.setName('mySoldier_%i' %agentNumber)

	for frameNumber in range(24): #number of frame
		mySoldier = mySoldier.allSubChildren( type == joints ) #<---need help to filter out joints only. recursiveGlob on the root joint perhaps?
		for soldierJoint in mySoldier:# (every joints in soldier node):
				soldierJoint.parmTuple('r').set(#read in value of the same joint from importedSoldier, via node name) not sure if this would work.
		#and do the same for root joint's translation values
		soldierJoint.parmTuple('t').set()

		#next frame
		hou.setFrame(i)

	delete importedSoldier

So I'm hitting a wall at three places there.

-duplicating a node

-listing out all joint chain inside a node

-copying values of joints with the same name from inside a node to another.

This seems like a naive solution, but it's all i got. :|

Thanks in advance!

Edited by Alexander Bong
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...