Thank you so much for your answer @playBalster!
I will test this as soon as I can
Found 47 posts.
Search results Show results as topic list.
Technical Discussion » Python Viewer State and Hotkeys
- cval
- 161 posts
- Offline
Technical Discussion » scriptMenuStripRadio default value
- cval
- 161 posts
- Offline
Hello everybody,
I am building a menu with radio buttons and in the documentation [www.sidefx.com], I see that scriptMenuStripRadio seems a good way. The problem that I have is that I do not understand how to set the default value for the scriptMenuStripRadio. When I launch houdini and open my menu, all radio buttons are "unchecked". I would like to define the initial value for the strip in my menu definition. Is there a way to do this?
Also, when looking at examples from houdini menus, I see that menuStripRadio is used instead of scriptMenuStripRadio. However, I do not find any documentation about menuStripRadio. If I try using menuStripRadio, then I find that there is an initial radio button that is "checked" when I open my menu. However, I do not know how to read that value in python since there is not global variable associated with it.
Any hints would be very much appreciated.
Thank you
I am building a menu with radio buttons and in the documentation [www.sidefx.com], I see that scriptMenuStripRadio seems a good way. The problem that I have is that I do not understand how to set the default value for the scriptMenuStripRadio. When I launch houdini and open my menu, all radio buttons are "unchecked". I would like to define the initial value for the strip in my menu definition. Is there a way to do this?
Also, when looking at examples from houdini menus, I see that menuStripRadio is used instead of scriptMenuStripRadio. However, I do not find any documentation about menuStripRadio. If I try using menuStripRadio, then I find that there is an initial radio button that is "checked" when I open my menu. However, I do not know how to read that value in python since there is not global variable associated with it.
Any hints would be very much appreciated.
Thank you
Technical Discussion » Setting default hotkeys for a tool distributed in a package
- cval
- 161 posts
- Offline
Hello everybody
I am developing a tool that is being distributed through a package. The tool is adding functionnalities to the animation graph and those new functionnalities are available to the user through a custom menu added to the animation graph (by including a custom AnimationEditorGraphMenu.xml in my package). I would like to add hotkeys to those menu entries, but I am not sure what would be the correct way. By looking in the houdini installation folder, I discovered that hotkeys are set by the Hotkeys file found in houdini\config\Hotkeys folder. I tried to replicate this pattern in my package, but this resulted in a lot of errors when launching houdini (hotkey symbols not being found). So I guess that this way is destructive and not legit...
My second attempt was to use a keymap override instead of a config\Hotkeys folder. So I created a Houdini.keymap.overrides file that I saved at the root of my package. This seems to work, but I wonder if this will only work for the Houdini keymap? What if the user made a custom keymap?
In the documentation, I see that there is a hou.hotkeys python module : https://www.sidefx.com/docs/houdini/hom/hou/hotkeys.html [www.sidefx.com]
Should I use this instead? Is there a way to execute a python file when the package is loaded that would create the needed contexts and hotkey assignments? (like a startup script I suppose...)
To summarize, my question is: what would be the most legit way of distributing a package with hotkeys assignations?
Thanks in advance for any help
I am developing a tool that is being distributed through a package. The tool is adding functionnalities to the animation graph and those new functionnalities are available to the user through a custom menu added to the animation graph (by including a custom AnimationEditorGraphMenu.xml in my package). I would like to add hotkeys to those menu entries, but I am not sure what would be the correct way. By looking in the houdini installation folder, I discovered that hotkeys are set by the Hotkeys file found in houdini\config\Hotkeys folder. I tried to replicate this pattern in my package, but this resulted in a lot of errors when launching houdini (hotkey symbols not being found). So I guess that this way is destructive and not legit...
My second attempt was to use a keymap override instead of a config\Hotkeys folder. So I created a Houdini.keymap.overrides file that I saved at the root of my package. This seems to work, but I wonder if this will only work for the Houdini keymap? What if the user made a custom keymap?
In the documentation, I see that there is a hou.hotkeys python module : https://www.sidefx.com/docs/houdini/hom/hou/hotkeys.html [www.sidefx.com]
Should I use this instead? Is there a way to execute a python file when the package is loaded that would create the needed contexts and hotkey assignments? (like a startup script I suppose...)
To summarize, my question is: what would be the most legit way of distributing a package with hotkeys assignations?
Thanks in advance for any help
Technical Discussion » Programmatically accessing selected keyframes from AnimGraph
- cval
- 161 posts
- Offline
Big thanks to Guillaume from SideFX who could indicate me the problem with my code and how to fix it! I am posting the solution here in case it can help other persons.
The problem was accessing the correct channel_editor (animation_editor). Here is an example that returns selected keyframes from the pane under the cursor:
Just make sure that your mouse is over an animation editor while executing this code
The problem was accessing the correct channel_editor (animation_editor). Here is an example that returns selected keyframes from the pane under the cursor:
def get_selected_keyframes(): pane_tab = hou.ui.paneTabUnderCursor() anim_editor = pane_tab.graph() return anim_editor.selectedKeyframes()
Just make sure that your mouse is over an animation editor while executing this code
Technical Discussion » Programmatically accessing selected keyframes from AnimGraph
- cval
- 161 posts
- Offline
Greetings everybody,
I am trying to access selected keyframes from the Animation Editor using this code from the documentation:
However, the "selectedKeyframes" method always returns empty, no matter how many keyframes I select.
Any idea of what I could be doing wrong? Maybe the "ChannelEditor" is not the same as the "Animation Editor"?
Thanks in advance for any help on this subject
I am trying to access selected keyframes from the Animation Editor using this code from the documentation:
channel_editor = hou.ui.paneTabOfType(hou.paneTabType.ChannelEditor) keyframes = channel_editor.graph().selectedKeyframes() for parm in keyframes.keys(): for key in keyframes[parm]: key.setValue(2 * key.value()) parm.setKeyframe(key)
However, the "selectedKeyframes" method always returns empty, no matter how many keyframes I select.
Any idea of what I could be doing wrong? Maybe the "ChannelEditor" is not the same as the "Animation Editor"?
Thanks in advance for any help on this subject
Technical Discussion » Python Viewer State and Hotkeys
- cval
- 161 posts
- Offline
Technical Discussion » Python Viewer State and Hotkeys
- cval
- 161 posts
- Offline
Greetings everybody
I am wondering if it is possible to disable hotkeys while in a custom python viewer state. Here is my problem, I am trying to use the “t”, “r” and “e” onKeyEvent in my object level python viewer state, but the viewport hotkeys seem to catch them first and it switches to the translation, rotation or scaling tools. I tried with the onKeyTransitEvent and it does catch the “key down” event and I then return True to consume the key transition, but the viewport still switches to the corresponding transformation tool.
Would there be a way to use those keys or do hotkeys have priority over viewer states key events?
Thanks in advance for you help
I am wondering if it is possible to disable hotkeys while in a custom python viewer state. Here is my problem, I am trying to use the “t”, “r” and “e” onKeyEvent in my object level python viewer state, but the viewport hotkeys seem to catch them first and it switches to the translation, rotation or scaling tools. I tried with the onKeyTransitEvent and it does catch the “key down” event and I then return True to consume the key transition, but the viewport still switches to the corresponding transformation tool.
Would there be a way to use those keys or do hotkeys have priority over viewer states key events?
Thanks in advance for you help
Technical Discussion » Python Viewer State GeometryDrawable in OBJ context
- cval
- 161 posts
- Offline
Merci @mabelzile! I tested with latest daily build and it works It does exactly what I need Thank you so much!
Technical Discussion » Python Viewer State GeometryDrawable in OBJ context
- cval
- 161 posts
- Offline
Technical Discussion » Python Viewer State GeometryDrawable in OBJ context
- cval
- 161 posts
- Offline
Hello everybody,
I am starting to learn about python viewer states and I am trying to use the hou.GeometryDrawable in a OBJ context but with no success. Is it possible that it is not supported in that context? I do have success with hou.SimpleDrawable, but I would like to use more advanced possibilities of hou.GeometryDrawable.
Here is the simple example that I am trying (the SimpleDrawable will display, but not the GeometryDrawable):
Any help or info would be greatly appreciated
Thanks in advance!
I am starting to learn about python viewer states and I am trying to use the hou.GeometryDrawable in a OBJ context but with no success. Is it possible that it is not supported in that context? I do have success with hou.SimpleDrawable, but I would like to use more advanced possibilities of hou.GeometryDrawable.
Here is the simple example that I am trying (the SimpleDrawable will display, but not the GeometryDrawable):
import hou import viewerstate.utils as su class State(object): def __init__(self, state_name, scene_viewer): self.state_name = state_name self.scene_viewer = scene_viewer # Drawable for drawing the polygon under the cursor. self.geo_drawable = hou.GeometryDrawable(self.scene_viewer, hou.drawableGeometryType.Face, "geo_drawable", params = { "style": hou.drawableGeometryFaceStyle.Plain, "color1": (0.0,1.0,0.0,1.0) } ) self.simple_drawable = hou.SimpleDrawable(self.scene_viewer, hou.Geometry(), "simple_drawable") def show(self, visible): self.geo_drawable.show(visible) self.simple_drawable.show(visible) def onEnter(self, kwargs): sops = hou.sopNodeTypeCategory() box = sops.nodeVerb("box") box.setParms({"scale": 0.25}) geo = hou.Geometry() temp = hou.Geometry() for x in (-0.5, 0.5): for y in (-0.5, 0.5): for z in (-0.5, 0.5): box.setParms({ "t": hou.Vector3(x, y, z) }) box.execute(temp, []) geo.merge(temp) # update the drawable self.geo_drawable.setGeometry(geo) self.simple_drawable.setGeometry(geo) self.simple_drawable.enable(True) self.show(True) def onResume(self, kwargs): self.show(True) def onInterrupt(self,kwargs): self.show(False) def onDraw( self, kwargs ): """ This callback is used for rendering the drawables """ handle = kwargs["draw_handle"] self.geo_drawable.draw(handle) def createViewerStateTemplate(): """ Mandatory entry point to create and return the viewer state template to register. """ state_typename = "obj_geo_drawable" state_label = "obj_geo_drawable" state_cat = hou.objNodeTypeCategory() template = hou.ViewerStateTemplate(state_typename, state_label, state_cat) template.bindFactory(State) template.bindIcon("MISC_python") return template
Any help or info would be greatly appreciated
Thanks in advance!
Work in Progress » Object Wrangle preview
- cval
- 161 posts
- Offline
This is very very interesting for rigging at the obj level! Awesome! Did you do speed comparison tests with the CHOP Constrain system? Is it faster?
SI Users » Undo for viewport navigation ?
- cval
- 161 posts
- Offline
Houdini Learning Materials » Animation Editor Background Color
- cval
- 161 posts
- Offline
Technical Discussion » Retrieve objects parameters in an ordered way.
- cval
- 161 posts
- Offline
SI Users » Align handles to geometry
- cval
- 161 posts
- Offline
We also have a lot of problems with the “S” tapping/switch mode here. Constantly going to inactive gizmo or no gizmo at all. Haven't been able to log the bug repro steps correctly yet, but I will as soon as I can
SI Users » Undo for viewport navigation ?
- cval
- 161 posts
- Offline
We logged an RFE for this feature a few years ago. It's ID is #73866 if you want to reference it in your RFEs
Technical Discussion » Declaring a VOP Struct Type as an array
- cval
- 161 posts
- Offline
Hello everybody
I have defined a stuct type in a JSON file as specified here : http://www.sidefx.com/docs/houdini/vex/vop_structs.html#json [www.sidefx.com]
For example :
Now I would like to define a new type which would be an array of the first type (similar to what matrixa is to matrix). In this case an array of structtest. My question is, how can I achieve this in the Type Definitions' json file?
Thanks in advance
I have defined a stuct type in a JSON file as specified here : http://www.sidefx.com/docs/houdini/vex/vop_structs.html#json [www.sidefx.com]
For example :
{ "typeDefinitions": [ { "type": "structtest", "typeName": "StructTest", "connectorColor": { "type": "RGB", "data": [0.25, 0.2, 0.9] }, "variables": [ { "typeName": "int", "name": "a" }, { "typeName": "vector", "name": "b", "label": "Label B" } ] } ] }
Now I would like to define a new type which would be an array of the first type (similar to what matrixa is to matrix). In this case an array of structtest. My question is, how can I achieve this in the Type Definitions' json file?
Thanks in advance
Edited by cval - Dec. 7, 2018 16:44:20
Technical Discussion » Objects and chain root world space
- cval
- 161 posts
- Offline
Hi Michael,
Thanks for this post! I keep forgetting that they are on the Node Properties, I always try to find them in the “Invisible Parameters”. I am so happy to find them again!
Out of curiosity, do you know why they are not exposed by default? Is it for performance issues?
Thanks for this post! I keep forgetting that they are on the Node Properties, I always try to find them in the “Invisible Parameters”. I am so happy to find them again!
Out of curiosity, do you know why they are not exposed by default? Is it for performance issues?
Technical Discussion » Objects and chain root world space
- cval
- 161 posts
- Offline
I have a logged an RFE 3 years ago about this. ID : #69987
Please submit one also if you feel it is important.
In my RFE I put the emphasis mostly on being able to drive world kinematics, which is now possible through the CHOP constraints system. However, it would be really nice to have a U.I. to actually view and edit world transform parameters. Keying world transforms would also be very very useful and very powerful in some situations. I guess we can also achieve something similar with the CHOP constraints system, but the manipulation is not as straightforward as just keying them.
Please submit one also if you feel it is important.
In my RFE I put the emphasis mostly on being able to drive world kinematics, which is now possible through the CHOP constraints system. However, it would be really nice to have a U.I. to actually view and edit world transform parameters. Keying world transforms would also be very very useful and very powerful in some situations. I guess we can also achieve something similar with the CHOP constraints system, but the manipulation is not as straightforward as just keying them.
Technical Discussion » VOP structs functions
- cval
- 161 posts
- Offline
Thank you rafal!
By reading your reply I could understand my mistake. I was nesting the “definitionCode” item under the “methods” item in the json file. I thought it was a definitionCode per method, but it is for the whole struct!.
All right! Thank you! This helps me a lot
By reading your reply I could understand my mistake. I was nesting the “definitionCode” item under the “methods” item in the json file. I thought it was a definitionCode per method, but it is for the whole struct!.
All right! Thank you! This helps me a lot
-
- Quick Links