Tom Posted July 17, 2012 Share Posted July 17, 2012 (edited) I have imported FBX from Maya, where I have hundreds of objects, I would like to know, how I can place edge cusp automaticly in all geometrys as last node, without manually going in all nodes and placing them by hand. Seems, I need to start learn python faster thanks in advance, Tom Edited July 17, 2012 by Tom Quote Link to comment Share on other sites More sharing options...
Annon Posted July 17, 2012 Share Posted July 17, 2012 Can't you just object merge them all into a new geo network (/obj/fbxnet/*/OUT, something like that) and stick a cusp at the bottom of that. Connectivity and Partition SOPs to seperate everything out into groups if you don't already have them. I don't use FBX, so not sure how it structures it, but that's how I'd do it if you get a node per object (which is what we get with a proprietary file format). Alternatively use Alembic C Quote Link to comment Share on other sites More sharing options...
anim Posted July 17, 2012 Share Posted July 17, 2012 here is quick code for doing that on multiple objects put it to your Python Source Editor window and apply def cuspByAngle(angle = 60): name = "cusp_by_angle" for obj in hou.selectedNodes(): lastSop = obj.displayNode() if lastSop.name() == name: lastSop = lastSop.inputs()[0] obj.displayNode().destroy() facet = lastSop.createOutputNode("facet", name ) facet.parm("cusp").set( 1 ) facet.parm("angle").set( angle ) facet.setDisplayFlag(1) facet.setRenderFlag(1) then select all object nodes you want to cusp edges for and write this to Python Shell hou.session.cuspByAngle() or if you want different cusp angle just put it in brackets, like hou.session.cuspByAngle(40) it will put facet node with cusping by angle enabled at the end of every object sop network if you run it more times on the same objects, it will first check and delete if the previous node named "cusp_by_angle" is present as displayed sop, so they will not accumulate 1 Quote Link to comment Share on other sites More sharing options...
Tom Posted July 17, 2012 Author Share Posted July 17, 2012 (edited) @ ChristianW, I had same idea, but I like to group objects and manipulate them in maya, the thing is, when I import fbx in Houdini, there is subnets in subnets... so I have to manualy ungroup all grouped objects in maya or in houdini. Zing! Oh, maybe its easer to extract all subnets with script? And then I can merge them and apply edge cusp. @anim thanks for script, but I did all as you said and I got this error in py console File "<console>", line 1 hou.session.cuspByAngle(60) ^ IndentationErrorL unexpected indent Edited July 17, 2012 by Tom Quote Link to comment Share on other sites More sharing options...
anim Posted July 17, 2012 Share Posted July 17, 2012 yes, sorry about that, delete first space in that line, so it will be: hou.session.cuspByAngle(60) Quote Link to comment Share on other sites More sharing options...
pencha Posted July 19, 2012 Share Posted July 19, 2012 @ ChristianW, I had same idea, but I like to group objects and manipulate them in maya, the thing is, when I import fbx in Houdini, there is subnets in subnets... so I have to manualy ungroup all grouped objects in maya or in houdini. Lil´trick just in case it can help with manual ungrouping: have in mind that wildcards in an Object merge can do wonders to organize multiple subnets. (object merging obj/yourSubnet*/*/* will automagically bring all of those geos to one node). Quote Link to comment Share on other sites More sharing options...
anim Posted July 19, 2012 Share Posted July 19, 2012 you can uncheck Import Null Nodes as Subnets in FBX import settings to get flat hierarchy of objects instead of nested Subnets Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.