inudo
NURBS may be the cause. POLYGON might work.
That fixed the selectable geometry problem for me.
Thanks!
inudo
NURBS may be the cause. POLYGON might work.
Siavash Tehrani
In general it's not good practice to leave geometry as ngons, especially if the mesh has holes. Aside from giving some renderers trouble it can also cause issues with geometry interchange. For example, certain importers will simply ignore ngons and leave you with missing faces.
If you can, triangulate ngons in Maya. Otherwise fix it in /obj or a SOP Modify in LOPs. One way is to create a group with the Group Expression SOP and the expression @numvtx>4, and then run that group through a Divide SOP (enable Avoid Long Edges). This will leave your quad topology alone and only triangulate the ngons.
GOgraphR
Hi!
What about:gives you your current File.hou.hipFile.path()
os.getenv("HIPFILE")
os.getenv("HIP") are also possible.
SWest
Which I traced back to this line in your code:Line 38: keyframe_dict=parm.keyframes()[i].asJSON(save_keys_in_frames=True)
Any ideas?
Thanks
Jonathan de Bloksyntheticperson
Hi Jonathan de Blok, I managed to get your version working. Thanks.
However, it would be nice if it supported the /stage context as well as /obj
Cleaned it up a little and for fun sort of made it into a one liner If you place it into a shelf tool just clicking it will run on "(/obj)", shift-clicking will run on all contexts ("/") including "/stage"import hou #for debugging, can be omitted when used as shelf tool as that will populate the kwargs dict for us if not "kwargs" in globals().keys(): kwargs={} kwargs["shiftclick"]=False res = hou.ui.readInput("Frames to shift keyframes after current frame", buttons=("OK", "Cancel")) if res[0] == 0 and res[1].replace("-","").isnumeric(): currentFrame=hou.frame() shift= int(res[1]) with hou.undos.group("Shift Keyframes"): list(map(lambda animObj: hou.hscript( "chkeymv -r "+animObj.path()+"/* "+str(currentFrame)+" 20000 "+str(currentFrame+shift)+" "+str(20000+shift) ), list(filter(lambda node: len(list(filter(lambda parm: len(parm.keyframes())>1, node.parms() ))), hou.node("/" if kwargs["shiftclick"] else "/obj").allSubChildren() )))) # this gets all nodes from /obj or / (every context) depending on shiftclick or not: # hou.node("/" if kwargs["shiftclick"] else "/obj").allSubChildren() # This filters the nodes from the above list to those that have parms that have more then 1 keyframe (parms with expression have a keyframe as well, and 1 keyframe parms are not animated since it will yield a contant value thus only focus on those with more then 1 keyframe): # list(filter(lambda node: len(list(filter(lambda parm: len(parm.keyframes())>1, node.parms() ))) # The 'map' function then runs each node from that filtered list through a small lambda function that sets up and executes the hscript command 'chkeymv' with the correct settings: # map(lambda animObj: hou.hscript( "chkeymv -r "+animObj.path()+"/* "+str(currentFrame)+" 20000 "+str(currentFrame+shift)+" "+str(20000+shift) ) # The map function creates an iterator object that doesn't loop over all the items by itself so we force it to yield by converting it into a list. The generated list itself isn't used
Traceback (most recent call last):
File "OffsetKeyFrames", line 47, in <module>
File "OffsetKeyFrames", line 38, in offsetKeyframes
IndexError: tuple index out of range
Line 38: keyframe_dict=parm.keyframes()[i].asJSON(save_keys_in_frames=True)
b = hou.node('/obj/box1') t = hou.parmTuple('/obj/box1/t') tx = t[0] tx_keyFrames = tx.keyframes() tx_keyFrames (<hou.Keyframe t=0 expr='bezier()' lang=exprLanguage.Hscript v=0 s=0 auto_slopes =True a=0.333333 use_accel_ratio=True>, <hou.Keyframe t=1 expr='bezier()' lang=e xprLanguage.Hscript v=2.36562 s=2.00002 auto_slopes=True in a=0.745363 out a=1.4 6588 use_accel_ratio=True>, <hou.Keyframe t=2.96667 expr='bezier()' lang=exprLan guage.Hscript v=5.47767 s=0 auto_slopes=True in a=0.655556 out a=0.333333 use_ac cel_ratio=True>)