Page 1 of 1

XPopMenu for Houdini

Posted: 12 Oct 2016, 10:25
by julca
Hello,
I'm happy to share an XPopMenu script plugin for Houdini :ymparty: !
Originally developped on Softimage by Reinhard Claus (@rray) and after discussed with him about the portability :)] , I've developped a new version for Houdini.

In Bonus, I've added two tools :
- to quickly get a distance
- to quickly measure an angle

Quick demo :


Download on odforce forum at http://forums.odforce.net/topic/27662-x ... r-houdini/

Cheers

Re: XPopMenu for Houdini

Posted: 12 Oct 2016, 10:37
by nodeway
The point of it is to have custom menu to add custom scripts? If so, you can do this right now by creating simple XML file that will add any tool to TAB menu (scripts, shelf tool or node). You can even customize existing tools and add them under completely different name to TAB menu.

The import path is overcomplicated. You can just add your path to houdini.env or create environment variable that will point to multiple places where you store your scripts/packages.

Re: XPopMenu for Houdini

Posted: 12 Oct 2016, 11:08
by rray
Niiiice will be downloading Houdini Apprentice to see it in action (and I'll put a link on the XSI xPop page with the next rray website update)

@nodeway - I prefer having popup menus on different keys as opposed to one big popup for all. One click or keypress less per action justifies it already. But I'm a bit biased ;)

Cheers
-rr

Re: XPopMenu for Houdini

Posted: 12 Oct 2016, 11:10
by julca
Hi nodeway,

The idea is simply to not polute the actual factory tab menu which is already heavy (all houdini operations here).
And offer a more direct way to launch custom tools (without the need to deep into subMenu for some prefered operations).
If you want, you can also activate specifics tools in some context : for example in point selection you can display "fuse" operator on top of menu or a "cap hole" on edge selection.

About the import path, I exactly use a global path located in houdini.env which point to a default project that I have created (sort of Softimage workgroup).
And that's from this path that you access to any script : "workgroupPath/Scripts/myBeautifullScript.py"
But if you have a better way I really open to suggestion as I do not predent that's the one way.

The workflow to create xml file and customize the main menu could also be good to know.
I would be cool if you can detail the procedure :ymhug: .

Thanks.

Re: XPopMenu for Houdini

Posted: 12 Oct 2016, 11:28
by nodeway
1. Than make your own section there, thanks to this you don't have to search far.
2. But you are expanding environment variable yourself, and then doing some other things. Wouldn't it be easier to just create something like this:

Code: Select all

HOUDINI_SCRIPT_PATH = "$GITHUB_PATH/dcc-lib/Houdini/Home/scripts;&"
This takes care about all scripts in any current Houdini directory + your custom directory. And in this directory you just have you own scripts/packages. No need to expand anything.
HOUDINI_SCRIPT_PATH - is one of the default Houdini variables that you can override. If you want to know others launch Houdini CommandLineTools and type:

Code: Select all

hconfig -all
What's the fuss with all those functionNameToCall ?
If you have everything set there right than all you need to import your custom stuff are 3 lines:

Code: Select all

import myStuff
reload(myStuff)

myStuff.RunWhateverYouWant()
3. Wrangle nodes are made by custom XML file. This is the same one node, but under TAB menu you have it under 3 names, Point/Attribute/Primitive Wrangle. It uses XMl file with script that just launches it named and setup properly.

Re: XPopMenu for Houdini

Posted: 12 Oct 2016, 12:12
by julca
@rray,
Thanks ! For me you will always be Mr XPop ;) !


@nodeway,
Sorry, but what do you mean about "fuss with all those functionNameToCall" ?
Here, you just have to tweak "XPopExample.py" file to customize and build layout your script like this :

Code: Select all

myMenu.addItem("Name to display", "scriptFolderPathToMyScript.py")
mySubMenu = myMenu.addSubMenu("Simple")
mySubMenu .addItem("Other Name", "scriptFolderPathToMyScript.py", "functionName")
etc..

Re: XPopMenu for Houdini

Posted: 12 Oct 2016, 12:53
by nodeway
julca wrote: Here, you just have to tweak "XPopExample.py" file to customize and build layout your script like this :

Code: Select all

myMenu.addItem("Name to display", "scriptFolderPathToMyScript.py")
mySubMenu = myMenu.addSubMenu("Simple")
mySubMenu .addItem("Other Name", "scriptFolderPathToMyScript.py", "functionName")
etc..
You should made this part configurable thru XML or JSON and populate menu from this data. Never give users script that they have to modify something inside to work.

EDIT: I will try to modify it today, to show you how you should approach it so you could install it easier.

Re: XPopMenu for Houdini

Posted: 12 Oct 2016, 13:37
by rray
That wouldn't allow context sensitivity which is part of the idea. It limits the circle of users a little, but the API is intentionally simple, and Houdini users are quite techy, so not too much I guess.

Re: XPopMenu for Houdini

Posted: 24 Nov 2016, 22:13
by nodeway
Hey, I remember about you. Didn't had time to post, too many things at once. But I will come back to this.