Jump to content


  • Content count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About salik

  • Rank

Personal Information

  • Name
  1. Hi all, I apologize if this is a noob question. Currently I am trying to find out how to change the options in a drop-down menu. Say if there are 3 options, and I am trying to set the option to the second option, I tried doing node.parm('resolution').set(1) I got the following errors: return _hou.Parm_set(*args) TypeError: Cannot set a string parm to a int But if I tried to replace `1` with the string value of the second option, while there are no errors to be seen, the option in the drop down did not get change to the second option at all, it is still stuck at the default option. Any ideas?
  2. Maths Book for Houdini

    That will certainly help me if I decided to do computer science/ maths courses if I am planning to go to university! While I think it may help me, I thought it may be better to get something that will allows me to apply directly for Houdini / any CG usage? It is just in my pov, that book may be a bit too technical, no?
  3. Maths Book for Houdini

    The Linear Algebra is a mathematics textbook right?
  4. Maths Book for Houdini

    Thanks for the info! I will check out the maths on pluralsight. I was thinking about getting a book for read too, and hence my question on the list of books.
  5. Maths Book for Houdini

    Hi all, I am trying to find Maths book for read and use into Houdini. My impression about Houdini is that, you will need to know Mathematics, at least the basics of Linear Algebra, Vectors and Matrix? (Do correct me if I am wrong on that) It seems that you need to know such maths stuff to write/ generate out expression/ code out for complexity? While I can easily find videos to brush up on the software skills, can anyone recommend me any books that I should read? I tried googling online, found a variety of books that teaches mathematics in computer graphics, those that are recommended in forums I have seen, are pretty much outdated, not sure if it is ideal for me, a noob to look into. These are very books that was recommended: Book01 Book02 Book03 What should I check out?
  6. getting children of objNode

    Okay, I may have probably lost you instead Quick question though, if I am continuing to implement back using the `recursiveGlob` command with the wild card, is there anyway that I can simply grab at the /obj level - /obj/my_node, /obj/my_node1 without its children? Currently the results is showing my every nodes including its children such as `/obj/my_node, /obj/my_node/my_node_child, /obj/my_node1, /obj/my_node1/child`... Because I am trying to add in a check logic in my script such that if more than 1 my_node exists, it will prompt user some notice..
  7. getting children of objNode

    I am trying to check whether a node exists in my scene and also to check for its children within. Suppose this is the full path of the node that I am trying to check which is `/obj/my_node` In a simpler term to get the children, this is one of the method I know of: node = hou.node('/obj/my_node') for item in node.children(): print item But as mentioned, I am trying to check whether if a node exists.. this is how I did mine: # Check if my_node exists check_for_node = hou.node('/obj').recursiveGlob('my_node') if check_for_node: """ # This gives me an error... for item in check_for_node.children(): print item # AttributeError: 'tuple' object has no attribute 'children' """ for item in hou.node(check_for_node[0].path()).children(): print item Can someone kindly tell me why is it that I am unable to use the first method (that error code part). So far, the differences I am seeing is that check_for_node[0] is of hou.objNode class while the method I know is of hou.Node class. What are the significant differences between them? Is there any way for me to simplify hou.node(check_for_node[0].path()).children() into shorter form? Also, is the line I wrote for filtering using recursiveGlob a good way to check if the node exists or not?
  8. I have a few custom operator types, something like this /obj/<custom_group>/<custom_ref>/<custom_ref>/<custom_geo> Suppose I select custom_geo and I wanted to get to get its root node, /obj/<custom_group>/<custom_ref>, I had wanted to create a function that iterates.. If it is <custom_ref>, use .parent() and check again until if <custom_group> is 'hit', get the last <custom_ref> that was iterated? The level of hierarchy can be different, the above is a simple example. Any ideas?
  9. Sub menus in a single shelf icon

    But this is giving me an ui in which it is probably something that I would not want..
  10. Is it possible to create a shelf icon with sub menu functionality (like in Maya?) I have 2 similar scripts which works about in the same way but it uses different node types and instead of creating individual shelf icon for these 2 scripts, I am thinking of combining them together (or something) and presents together as 1 single shelf icon with sub menu options. Basically, if you click on this icon, you will be presented with 2 options for example.. If you click on option 1, it will run function/scriptA, if the other option is selection, function/scriptB will be executed instead.. Can this be done?
  11. Selections in viewport

    Ahhh, ok.. Yes I am planning to skip Step 2 if possible. As I am more of a Maya User and just beginning to code for Houdini, I am thinking more in-line with Maya instead.. In that case, I can try out hou.selectedNodes() and see how it goes.. I have a question though, about the missing comma.. Does it really matters? I asked, cause it seems to work whether or not there is a comma..
  12. Selections in viewport

    It does not seems to make any difference.. Added that comma in and I am getting the same result where it prompts me to 'select objects. press enter to accept selections'.. Update: Happened to hit Enter by chance and the error will be raised (selection is still empty) Are there any ways in which I can bypass the prompt that is asking me to select objects..
  13. Selections in viewport

    Hi all, I have written a function that grabs the selection from within the viewport. While it works if I select one or more objects in the viewport, but it does not seems to be working if nothing is selected. I have placed a 'check' to prompt an error should there be no selections, but it does not seems to be working and instead, if there are no selections, as I execute my code, it will prompt me to select some geometries. def selection(): scene_viewer = toolutils.sceneViewer() selected_objects = list(scene_viewer.selectObjects( prompt = toolutils.selectionPrompt(hou.objNodeTypeCategory()), allow_multisel = True, allowed_types = ("geo") ) ) # if nothing was selected. if len(selected_objects) == 0: raise hou.Error("Nothing was selected.") return selected_objects Is it suppose to be like this or am I writing it wrongly somewhere...
  14. Python - Multi selections for selectNode

    Yes, but unfortunately this still only allows and return 1 selection. I managed to get it over by using `selectFromTree` command instead in which I grab the path of all its child nodes of a certain hierarchy level which prompts a window populate. And it is able to present them in a tree view, the same as as in a typical tree view! Just a side question though, is it any way possible to add in additional buttons to these hou.ui window popups? For example, I would like to add a 'HELP' button that points to a web page..