Jump to content


  • Content count

  • Joined

  • Last visited

Everything posted by CinnamonMetal

  1. Loop over prims and delete

    Hi, I would like to know what I'm doing wrong. foreach(@primnum == @Cd.g ){ removeprim(0,@ptnum,1); } I want to loop over all primitives and those primitives which are a color of red, simply remove them ?
  2. Color value for each polygon

    The class hou.polygon doesn't have a color() method. How can get the color for each primitive as a tuple in a mesh (python) ?
  3. Loop over prims and delete

    The slider attribute goes from 0-1 and as you mentioned it only deletes one primitive ? v@slder = chv("rmprimitives"); if(@Cd > @slder){ removeprim(0,@slider,1); } I'm trying to figure a way in Python to which I can select primitives with a range of a hue then export those as an attribute then I can use a ch() or chv() to control how many of those primitives get deleted.
  4. Loop over prims and delete

    @slider is a ch() function which is what I wanted. Although I want to select the purplish / pink primitives; it appears tough as the colors are not typical solid plain colors ?
  5. Loop over prims and delete

    What about vise versa; the purple/pink over the reds ?
  6. Loop over prims and delete

    The color of the primitives are purplish pink so to speak. i@slider = ch("rmprimitives"); if(@Cd.x > 0){ removeprim(0,@slider,1); } When I adjust the @slider which is a ch() only one primitive is deleted ?
  7. Loop over prims and delete

    Thanks Although if there are shades of red, how do you force those shades to be red for VEX; without effecting the shading of the primitives ? I don't know whether that question is dumb but I'll put it out there anyhow
  8. Parent as Selected

    I wanted the hierarchy selection. inputs() retrieves the the parent node, which I thought was the node above, the PythonSOP. The parent node is the first node in the hierarchy. How do I get the node which in this case is the node one up before the PythonSOP ? As well setInput() doesn't accept index number ?
  9. Parent as Selected

    paren = thisNode.parent() if paren == 0: print(paren) else: paren.setSelected(on,clear_all_selected=True) If the current node has a parent, set the parent as the current selected node; it's unfortunately not working ?
  10. Set Parent node as current node

    Same Question. paren = thisNode.parent() if paren == 0: print("complete") else: paren.setSelected(on,clear_all_selected=True) Error 'on' is not defined ? This is for setting the node which is connected to the current node ?
  11. Set Parent node as current node

    if thisNode.parent(): thisNode.setCurrent() How do I set the current node to the parent node; or must I use setSelected ?
  12. Clarisse iFX ?

    Thanks for the info; with that, I'll stay with Fusion
  13. Clarisse iFX ?

    I know Fusion is powerful, although anyone use Clarisse iFX and your thoughts ?
  14. Set Parent node as current node

    I have a variable set to hou.pwd(); I want to set the parent node as the active node rather then the current node ? If the current node has a parent, set it to the parent ?
  15. It would be great to have a solved for threads which are solved. Most importantly to delete posts, there are times you may ask for help when a few hours later, maybe the next day; you solve your problem and now the post is irrelevant.
  16. Find point number ?

    I'm looping over all the points on a mesh, although how can I find a point number's on a mesh (python) ?
  17. Iterate over points to setPosition

  18. Iterate over points to setPosition

    I want to set the position of the points of a object in python. I've looked in the HOM Python cookbook although I don't understand the error; SopNode is not iterable, when I attempt to iterate over them and setPosition() ?
  19. Index of class on empty string

    If I make an infinite loop when the user enters some text instead of the rest of the script executing; the else statement is executed and the variable = nodeName does an infinite loop completely ignoring to execute the script ? I want the infinite loop strictly for the OK button, although not for the CANCEL button.
  20. Index of class on empty string

    I'm hung on a problem, with python. hou.ui.readInput() produces a tuple; I have a while loop but I can't get the index item of the tuple which is the "OK" button of the class not to disappear if the string is empty ? In other words, if the user clicks "OK" the dialog should not disappear.
  21. Index of class on empty string

    I one more question. How do I get the "OK" button to loop repeatedly if strictly the "OK" button is pressed ? I'm hacking away at this and I hope, that I solve this before hopefully your reply.
  22. del

  23. Index of class on empty string

    nodeName = hou.ui.readInput("what do you want",buttons=('OK',"Cancel"),default_choice=0,title="Name the sphere",close_choice=1) if nodeName[0] == 0 and nodeName[1] !="": intro = hou.node("/obj").createNode("geo","geometryA") superGeo = intro.createNode("sphere",nodeName[1]) superGeo.setPosition([2.3,4.5]) superGeo.setParms({"radx":2.3,"radz":4.2,"type":"bezier","rows":54}) fileNode = hou.node("/obj/geometryA/file1") fileNode.destroy() superGeo.setRenderFlag(True) else: while not nodeName[0] == nodeName[0]: hou.ui.displayMessage("You must supply a valid node name") break
  24. Iterate over points to setPosition

    This is helpful.
  25. Invalid node name in while loop ?

    Thank you, that solved it.