Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial commit of pyblish-houdini. Structure was copied from pyblish-… #1

Merged
merged 6 commits into from
May 8, 2015

Conversation

mkolar
Copy link
Member

@mkolar mkolar commented May 7, 2015

Structure was copied from pyblish-maya and tweaked to reflect houdini specifics. Publish is added on the bottom of 'file' menu (this needs to be tweaked of course).

Thought this might be a good start even though GUI currently doesn't load and throws this error:
'This application failed to start because it could not find or load the Qt platform plugin "Windows."
Reinstalling the application may fix this problem'

mkolar and others added 2 commits May 8, 2015 00:50
…maya and tweaked to reflect houdini specifics. Publish is added on the bottom of 'file' menu (this needs to be tweaked of course).

GUI currently doesn't load and throws peculiar :
'This application failed to start because it could not find or load the Qt platform plugin "Windows."
Reinstalling the application may fix this problem'
@mottosso
Copy link
Member

mottosso commented May 8, 2015

Thanks for this.

Some notes.

  1. The plug-ins assume a particular way of working. Pyblish for Maya currently does this, it's from the early days of development and remains present because it is part of the official Pyblish Guide. The proper way of distributing workflow-dependent plug-ins is to bundle it up into an individual repository, like Toke's Bumpybox plug-ins or Pyblish Napoleon.
  2. There's no need for __author__ as the author is visible through Git history. It's also not terribly inviting for others to modify something that has anyone else's name in it.
  3. This application failed to start this is to be expected. It's because PyQt isn't installed on your system, but is only accessible through Pyblish for Windows.

Qt testing

For testing purposes, you can do:

# In Houdini
from pyblish_win import util
util.augment_pythonpath()
util.augment_path()

import pyblish_houdini
pyblish_houdini.setup()
pyblish_houdini.show()

It will append the Pyblish for Windows Python interpreter to the PATH, so that QML can access it.

Houdini host

Another issue I encountered was that Houdini has many executables, such as hescape.exe and houdini.exe. We'll have to find a better way of solving the host identification, currently based on the name of the current executable.

I'm sending a pull-request your way with some changes. Once it works with the above augment_path, I'll be able to add it to Pyblish for Windows as well. I just need to know how the Houdini integration works, can we add houdini_path to an environment variable, like NUKE_PATH?

@mkolar
Copy link
Member Author

mkolar commented May 8, 2015

The proper way of distributing workflow-dependent plug-ins is to bundle it up into an individual repository,

Sure this was just for quick testing

There's no need for author

my bad. Pycharms put's this on top of all new code. Have to get rid of that setting

Another issue I encountered was that Houdini has many executables, such as hescape.exe and houdini.exe.

There's a few of them but not that many. I reckon for now until we find something better, we could just check if executable is in the list of provided ones. [houdini, houdinifx, hescape, hmaster, happrentice]. hescape and hmaster are there just forlegacy reasons. Currently only houdini and houdinifx should be needed.

Some changes, see #1 for details.
@mottosso
Copy link
Member

mottosso commented May 8, 2015

There's a few of them but not that many.

Ah, that's good to hear. The reason I mentioned it was because my apprentice setup had put hescape in my taskbar, which I have been using to launch Houdini.

I do have an idea for a possible solution to this that I might go ahead and implement. It's bound to arise again for other integrations.

Something like this.

From Houdini integration

import pyblish.api
pyblish.api.register_host(name="houdini", regex="(houdini)")

But that's for another issue.

@mottosso
Copy link
Member

mottosso commented May 8, 2015

Could you elaborate a bit on how the installation works? I noticed there was a houdini_path directory, what do we do with it?

@mkolar
Copy link
Member Author

mkolar commented May 8, 2015

Could you elaborate a bit on how the installation works? I noticed there was a houdini_path directory, what do we do with it?

Houdini is looking for a HOUDINI_PATH env var when it's launching. Any files of scripts that it finds will get appended to it's default launching scripts (creating menus, loading nodes etc.)

Folder structure has to be the same as found in the houdini root directory (C:\Program Files\Side Effects Software\Houdini {Version}\houdini). Technically it works like NUKE_PATH however it can override or add to almost anything in houdini at startup. Nodes placed in HOUDINI_PATH/otls will be available, images in HOUDINI_PATH/pic can be loaded by refering to picture name without the rest of the path, anything in /scripts can be called directly as a module.

Now our installer has /scripts with 123.py file. This is equivalent to maya's userSetup.py (it runs when houdini session starts)

second file is MainMenuCommon.xml. This one is similar to Nuke's menu.py. It defines the main menu bar common across all houdini executables. (apprentice, fx, and normal have a few different options in menus, but this file holds everything that is common between them, hence ideal for us to add pyblish menu). It's structure need to follow MainMenuCommon.xml (in houdini root) which defines the deafult Hou menus. There is also ExampleMenu.xml which has guide on how to add custom menus to houdini.

This is the simplest variation that adds pyblish after 'Save as' in file menu

<?xml version="1.0" encoding="UTF-8"?>

<mainMenu>
  <menuBar>
    <addScriptItem id="h.pyblish">
    <parent>file_menu</parent>
    <label>Publish</label>
    <insertAfter>h.save_as</insertAfter>
    <scriptCode><![CDATA[# In Houdini
from pyblish_win import util
util.augment_pythonpath()
util.augment_path()

import pyblish_houdini
pyblish_houdini.setup()
pyblish_houdini.show()]]></scriptCode>
    <scriptArgs></scriptArgs>
    </addScriptItem>
  </menuBar>
</mainMenu>

The only trouble with this approach is that menus in houdini can only be created on startup and cannot be changed during the session. Just something to keep in mind.

@mottosso
Copy link
Member

mottosso commented May 8, 2015

Awesome!

There won't be a need for the pyblish_win portion of the menu, only pyblish_houdini.show(). Pyblish for Windows will handle the addition of paths on it's own, such that the same menu code can be used across multiple platforms.

If you adjust the menu item to only include pyblish_houdini.show(), along with an import if needed, we can get this merged, from there I can start working on adding it to pyblish-win and suite.

@mkolar
Copy link
Member Author

mkolar commented May 8, 2015

Done. I'm leaving for the weekend now so I won't have access to a computer, but should be able to reply here or on gitter if you need something.

mottosso added a commit that referenced this pull request May 8, 2015
Initial commit of pyblish-houdini. Structure was copied from pyblish-…
@mottosso mottosso merged commit 021b246 into pyblish:master May 8, 2015
@mottosso
Copy link
Member

mottosso commented May 8, 2015

Merged! Have a great weekend!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants