Happy to hear you got it sorted!

(Btw, how do you write that beautiful formatting code in the email? :) )

It’s via a Chrome extension called “Markdown Here”
​

On 6 June 2018 at 10:58, Miguel González Viñé <[email protected]> wrote:

> Hi Marcus,
>
> thank you for your long answer and sorry for my late reply. I totally
> forgot the forums, sorry.
>
> I've followed all your steps and it works as expected. So I went to my
> scripts to see where's the problem and I've found something that I didn't
> know why it happens.
> I've starting to write a long email explaining you step by step all what I
> do, and now I've just found how to solve it. I was including the pyblish
> module inside my modules instead of treat them as separate module, and
> something didn't like it.
>
> So thank you so much for your time. And the next time I'll go straight to
> the forums.
>
> Best,
> Miguel
>
> (Btw, how do you write that beautiful formatting code in the email? :) )
>
>
> On Mon, Jun 4, 2018 at 7:26 PM Marcus Ottosson <[email protected]>
> wrote:
>
>> Hey Miguel,
>>
>> Happy to answer questions here, just want to point out that we have a
>> dedicated forum for questions surrounding Pyblish here:
>>
>>    - https://forums.pyblish.com/
>>
>> Just so we’re seeing the same thing, here’s what I’ve done to set things
>> up.
>>
>> Microsoft Windows [Version 10.0.17134.48]
>> (c) 2018 Microsoft Corporation. All rights reserved.
>>
>> C:\Users\marcus
>> $ mkdir pyblish
>> $ cd pyblish
>> $ c:\Python27\python.exe -m pip install pyblish-base pyblish-maya --target .
>> Collecting pyblish-base
>> Collecting pyblish-maya
>> ...
>> Successfully installed pyblish-base-1.6.1 pyblish-maya-2.1.4
>> $ set PYTHONPATH=%cd%
>> $ "c:\Program Files\Autodesk\Maya2018\bin\maya.exe"
>>
>> Next I ran the entire script you linked to in Maya’s Script Editor, and
>> here’s what I got.
>>
>> pyblish.util.publish()
>> pyblish: Registered C:\Users\marcus\pyblish\pyblish_maya\plugins
>> Pyblish loaded successfully.# pyblish.ExtractRig : Exporting Bruce to 
>> C:\Users\marcus\maya\scenes\temp\20180604T181853Z\rig\Bruce\Bruce.ma # # 
>> pyblish.IntegrateRig : Computing output directory.. # # pyblish.IntegrateRig 
>> : Copying C:\Users\marcus\maya\scenes\temp\20180604T181853Z\rig\Bruce to 
>> C:\Users\marcus\maya\scenes\public\v003.. # # pyblish.IntegrateRig : Copied 
>> successfully! #
>>
>> Now, to your question, the host attribute is one you can use to filter a
>> series of plug-ins with. For example, if you have plug-ins on your
>> PYBLISHPLUGINPATH for both Maya and Nuke, then putting ["maya"] as a
>> host for your plug-in would cause this plug-in to only run if the host
>> maya has been registered.
>>
>> class ExtractRig(pyblish.api.InstancePlugin):
>>   order = pyblish.api.ExtractorOrder
>>   families = ["rig"]
>>   hosts = ["maya"]
>>
>> At the top of the script, there is a call to pyblish_maya.setup() which
>> leads to here:
>>
>>    - https://github.com/pyblish/pyblish-maya/blob/master/
>>    pyblish_maya/lib.py#L26
>>
>> And that in turn is what registers maya as a host, and is what causes
>> that ExtractRig plug-in to get through the filter.
>>
>> If you replace that call with your registerHosts() function..
>>
>> # Install Pyblish for Autodesk Maya#pyblish_maya.setup()
>> def register_host():
>>     """Register supported hosts"""
>>     print(pyblish.api.registered_hosts())
>>     pyblish.api.register_host("mayabatch")
>>     pyblish.api.register_host("mayapy")
>>     pyblish.api.register_host("maya")
>>     print(pyblish.api.registered_hosts())
>>
>> register_host()
>>
>> ...
>>
>> ..you should be seeing the same output as above.
>>
>> Could you try this and let me know what you get?
>>
>> Best,
>> Marcus
>> ​
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Python Programming for Autodesk Maya" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To view this discussion on the web visit https://groups.google.com/d/
>> msgid/python_inside_maya/CAFRtmOCmzZa91rj3U0s7Qcj%
>> 3DcZqjGz_384Kebq%3DL%2BTqyGe-ovg%40mail.gmail.com
>> <https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOCmzZa91rj3U0s7Qcj%3DcZqjGz_384Kebq%3DL%2BTqyGe-ovg%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Python Programming for Autodesk Maya" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/python_inside_maya/CABbyGYwJ0w1ejSNEJiGn2dzDLXtQ0
> 1f23zqfD4Rj21jXuT970Q%40mail.gmail.com
> <https://groups.google.com/d/msgid/python_inside_maya/CABbyGYwJ0w1ejSNEJiGn2dzDLXtQ01f23zqfD4Rj21jXuT970Q%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOC5Hnv10MkW%3DJ%2B0f6%3DrB5_H95FX2XPk5f14J2ChC46dbQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to