Jump to content

salik

Members
  • Content count

    22
  • Joined

  • Last visited

Community Reputation

0 Neutral

About salik

  • Rank
    Peon

Personal Information

  • Name
    zac
  1. Hi all, I am relatively new to the behind-the-scenes of Houdini. I have created some presets (.idx) - contains "presetA" amd "presetB" that only effects when Mantra node is being created. One question that I have is - I am trying to only allow these presets to be surface if it checks a certain environment variable, in python terms it is derived using `os.getenv('USER')`. FYI, the presets that I have done are currently available across a list of users and I would like to know if it can be limited. For example, if the 'USER' is 'adam', this presets will be loaded when he created the mantra node. If the 'USER' is 'peter', the presets will then not be loaded. Is this possible to be done? Many thanks in advance!
  2. 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?
  3. 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?
  4. Maths Book for Houdini

    The Linear Algebra is a mathematics textbook right?
  5. 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.
  6. 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?
  7. 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..
  8. 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?
  9. 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?
  10. 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..
  11. 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?
  12. 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..
  13. 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..
  14. 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...
×