Code Monkey home page Code Monkey logo

pyblish-maya's Introduction

Build Status

Pyblish integration for Autodesk Maya 2008-2019.




What is included?

A set of common plug-ins and functions shared across other integrations - such as getting the current working file. It also visually integrates Pyblish into the File-menu for easy access.




Installation

pyblish-maya depends on pyblish-base and is available via PyPI.

$ pip install pyblish-maya

You may also want to consider a graphical user interface, such as pyblish-qml or pyblish-lite.




Usage

To get started using pyblish-maya, run setup() at startup of your application.

# 1. Register your favourite GUI
import pyblish.api
pyblish.api.register_gui("pyblish_lite")

# 2. Set-up Pyblish for Maya
import pyblish_maya
pyblish_maya.setup()



Documentation




Under the hood

The setup() command will:

  1. Register maya and mayapy as as a "host" to Pyblish, allowing plug-ins to be filtered accordingly.
  2. Append a new menu item, "Publish" to your File-menu
  3. Register a minimal set of plug-ins that are common across all integrations.

image




No menu-item

Should you not want a menu-item, pass menu=False.

import pyblish_maya
pyblish_maya.setup(menu=False)



Manually show GUI

The menu-button is set to run show(), which you may also manually call yourself, such as from a shelf-button.

import pyblish_maya
pyblish_maya.show()



Teardown pyblish-maya

To get rid of the menu, and completely remove any trace of pyblish-maya from your Maya session, run teardown().

import pyblish_maya
pyblish_maya.teardown()

This will do the opposite of setup() and clean things up for you.




No GUI

In the event that no GUI is registered upon running setup(), the button will provide the user with this information on how they can get up and running on their own.

image

image

image

pyblish-maya's People

Contributors

2-rec avatar bigroy avatar darkvertex avatar hannesdelbeke avatar madoodia avatar mottosso avatar tokejepsen avatar yanshil avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pyblish-maya's Issues

about pyblish port

I can't use pyblish-maya, I see the output of the Maya Listening on 127.0.0.1:9036, in pyblish Terminal, I see port 9002, do not know if this is not the reason I cannot use!

some install error

I installed pyblish_maya use pip. but It shows

"C:\Python27\Lib\site-packages\pyblish_endpoint\vendor\jsonschema\schemas" do not have draft3.json. 

So I have to downloaded from GitHub manually.
It also get some other bug. The error shows below:

# # C:\Python27\Lib\site-packages\pyblish\main.py:4: UserWarning: main.py deprecated; use util.py
warnings.warn("main.py deprecated; use util.py")
# Warning: Menu item pyblishOpeningDivider does not exist, flag -insertAfter ignored. #

The problem is The "File" menu has pyblishOpeningDivider menuItem, I have tryed it some times and do not know what caused this.

Decouple Pyblish Qml

Goal

Enable use of a GUI other than Pyblish QML.

Motivation

At the moment, this project indirectly depends on Pyblish QML via Pyblish Integration. If a user would like to use Pyblish with Maya, but develop their own GUI or use another existing GUI such as pyblish-lite there would still be a Pyblish RPC server lingering in the background.

Implementation

import pyblish.api

def launch_my_gui():
  # do setup
  # show GUI
  # do cleanup

pyblish.api.register_gui("My Gui", launch_my_gui)

import error on pyblish-maya 2.1.7

hey,

I had this ImportError happening for the publish-maya 2.1.7 release
(from the Maya Script Editor)

import pyblish_maya
# Error: ImportError: file /home/enno.schluender/dev/pyblish_test/pyblish-maya/pyblish_maya/lib.py line 15: cannot import name plugins # 

when I replaced publish_maya/vendor/Qt.py
with the Qt.py 1.2.5 version from here
https://github.com/mottosso/Qt.py/blob/1.2.5/Qt.py
it seems to work fine.

I am I doing something wrong ?

Using multiple binding on "QT_PREFERRED_BINDING" errors.

Description

Setting multiple bindings on "QT_PREFERRED_BINDING" errors pyblish-maya/vendor/Qt.py with the following;

pyblish-maya: Could not load integration: Traceback (most recent call last):
  File "C:\Users\admin\Documents\conda-git-deployment\repositories\bumpybox-core\pyblish-maya\pyblish_maya\pythonpath\userSetup.py", line 3, in <module>
    __import__("pyblish_maya")
  File "C:\Users\admin\Documents\conda-git-deployment\repositories\bumpybox-core\pyblish-maya\pyblish_maya\__init__.py", line 3, in <module>
    from .lib import (
  File "C:\Users\admin\Documents\conda-git-deployment\repositories\bumpybox-core\pyblish-maya\pyblish_maya\lib.py", line 16, in <module>
    from .vendor.Qt import QtWidgets, QtGui
  File "C:\Users\admin\Documents\conda-git-deployment\repositories\bumpybox-core\pyblish-maya\pyblish_maya\vendor\Qt.py", line 237, in <module>
    _init()
  File "C:\Users\admin\Documents\conda-git-deployment\repositories\bumpybox-core\pyblish-maya\pyblish_maya\vendor\Qt.py", line 207, in _init
    "not available" % preferred)
ImportError: Preferred Qt binding "PySide;PySide2" not available

Reproducible

Before launching a pyblish-maya enabled Maya, set the following;

os.environ["QT_PREFERRED_BINDING"] = "PySide" + os.pathsep + "PySide2"

_show_no_gui() takes no arguments (1 given)

# Error: TypeError: file /users/peko/.local/lib/python2.7/site-packages/pyblish_maya/lib.py line 67: _show_no_gui() takes no arguments (1 given) #
I've seen this Error ib Solved issue(closed), but It's still comes up

when I do

import pyblish_maya
pyblish_maya.show()

No file menu on startup

When having other tools that adds to the File menu, like Red9, the userSetup line pyblish_maya.lib.add_to_filemenu() error out and nothing gets added to the File menu.

A solution is to encapsulate the line with an evalDeferred;

cmds.evalDeferred('pyblish_maya.lib.add_to_filemenu()')

# ValueError: Could not locate Python executable.

Hi,
I am receiving the following error attempting to execute from Maya 2018.
# ValueError: Could not locate Python executable.

setup..

import sys, pyblish_qml, pyblish, pyblish_maya
sys.path.append(r'G:\_PIPELINE_MANAGEMENT\_externalPythonLibraries\pyblish_maya\pythonpath')
pyblish.api.register_gui("pyblish_qml")
pyblish_maya.setup()
pyblish_maya.show()

error result

pyblish: Deregistered g:/_PIPELINE_MANAGEMENT/_externalPythonLibraries\pyblish_maya\plugins
pyblish: Integration torn down successfully
pyblish: Registered g:/_PIPELINE_MANAGEMENT/_externalPythonLibraries\pyblish_maya\plugins
Pyblish loaded successfully.
Setting up Pyblish QML in Maya
# Traceback (most recent call last):
#   File "g:/_PIPELINE_MANAGEMENT/_externalPythonLibraries\pyblish_qml\host.py", line 132, in show
#     server = ipc.server.Server(service, targets=targets, modal=modal)
#   File "g:/_PIPELINE_MANAGEMENT/_externalPythonLibraries\pyblish_qml\ipc\server.py", line 111, in __init__
#     python = python or find_python()
#   File "g:/_PIPELINE_MANAGEMENT/_externalPythonLibraries\pyblish_qml\ipc\server.py", line 289, in find_python
#     raise ValueError("Could not locate Python executable.")
# ValueError: Could not locate Python executable.

Cannot import lib

When importing pyblish_maya, from within Maya, an error is (sometimes) thrown.

# Error: ImportError: file .../pyblish_maya/__init__.py line 5: cannot import name lib # 

Segfault with Qt 5 bindings on PYTHONPATH

Description

Launching Maya with any Qt 5 binding on your PYTHONPATH results in some of Pyblish's GUIs to cause Maya to segfault.

It's because it default to trying to find the most recent bindings for its GUIs, but Qt 5 isn't supported by Maya and thus causes it to crash.

Solution

Exclude unsupported bindings from the automatic lookup mechanism.

No module named pyblish_qml

Receiving the error "No module named pyblish_qml" when attempting to exec pyblish_maya.show() under maya 2018.

executing:

import pyblish_qml, pyblish, pyblish_maya
from pyblish_qml import api

sys.path.append(r'G:\_PIPELINE_MANAGEMENT\_externalPythonLibraries\pyblish_maya\pythonpath')

pyblish.api.register_gui("pyblish_qml")
api.register_python_executable("C:/Python27/python.exe")
api.register_pyqt5(r'G:\_PIPELINE_MANAGEMENT\_externalPythonLibraries\PyQt5')

pyblish_maya.setup()
pyblish_maya.show()

result:

pyblish: Deregistered g:/_PIPELINE_MANAGEMENT/_externalPythonLibraries\pyblish_maya\plugins
pyblish: Integration torn down successfully
pyblish: Registered g:/_PIPELINE_MANAGEMENT/_externalPythonLibraries\pyblish_maya\plugins
Pyblish loaded successfully.
Setting up Pyblish QML in Maya
Using Python @ 'C:/Python27/python.exe'
Using PyQt5 @ 'G:\_PIPELINE_MANAGEMENT\_externalPythonLibraries\PyQt5'
Targets: default
Success. QML server available as pyblish_qml.api.current_server()
C:\Python27\python.exe: No module named pyblish_qml

More specific class names for default collectors

Not entirely sure whether this could be a problem but the default plug-ins in Pyblish Maya use pretty generic class names SelectCurrentFile and SelectWorkspace (or CollectCurrentFile and CollectWorkspace in #51).

If I'm correct Pyblish uses the class names to identify "duplicate plug-ins" and as such this could quickly conflict with plug-ins that others might develop themselves. In the end we could assume they'd just "not use" the default plug-ins or we can target the default plug-in class names a bit more towards Maya.

For example CollectMayaCurrentFile and CollectMayaWorkspace.

What's the intended workflow regarding default plug-ins in integrations?

Standalone

Goal

Make pyblish-maya capable of being installed and used without pyblish-integration.

PyPI outdated

pyblish-maya is outdated on pip, resulting in a bug in the latest Maya.
// Error: ModuleNotFoundError: file C:\Users/user/Documents/maya/2024/scripts\pyblish_maya\__init__.py line 1: No module named 'version'

This is already fixed however in the latest repo, see line https://github.com/pyblish/pyblish-maya/blob/893dee39aef34aa7daa7c3e5593247abb8282731/pyblish_maya/__init__.py#L1C6-L1C7

Have you considered adding a pip github action to automate updating the PyPI release?
it only takes a few miutes to setup, just copy this in the repo, and add a secret with your PYPI token

Review Extractor

  • exports reviews for shapes and transforms, needs to only transforms

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.