any thoughts on shader publishing? Actually, yes. Me and a few Pipeline TDs here and on GitHub have been working on exactly this for the past month; i.e. ensuring quality before sharing work, including shaders.
You are welcome to join; odds are we’d be able to create something better together than on our own. Have a look here: https://github.com/abstractfactory/pyblish GitHub is performing maintenance on their Wiki backend at the moment so links from the sidebar isn’t working as they should. Once they are finished, you can find more info here: https://github.com/abstractfactory/pyblish/wiki In a nutshell, the workflow is: 1. Artist created content 2. Artist publishes content using Pyblish 3. Pyblish passes content through validations, which is a plugin-system of classes that either accepts or declines the content, written by either you or someone else. 4. If validation passes, content is exported 5. If not, artist is given a friendly message on what to do about it. The end result is, nothing leaves Maya unless it follows your naming and namespace conventions, or whatever else you are looking to validate. Feel free to add me on Hangouts and I’ll get you up and running with it, some of us are already using with it in production. - [email protected] Best, Marcus On 4 September 2014 10:57, Stefan Andersson <[email protected]> wrote: > Hey Marcus! > Thanks for the code, all code helps so I appreciate you sharing that. I'm > trying to trap what other artists are doing... sometimes they have stolen > shaders from other scenes or just duplicated networks, there are 1000's of > ways they are doing it. But I would like to do a bit of cleanup before they > submit the shader asset, and I also want to do it in a way that doesn't > obstruct their workflow. > > I could go fascist and block "illegal workflows", but I suspect they would > be blocked and the quality of the images would eventually go down :) > > I'm actually looking into parsing the exported ma file instead, I had a > thought that it might be a bad thing to temper with the work file that the > artist is working on. > > any thoughts on shader publishing? > > regards > stefan andersson > > > > > On Thu, Sep 4, 2014 at 9:10 AM, Marcus Ottosson <[email protected]> > wrote: > >> As a shot in the dark, if the origin of your namespaces is from importing >> a scene, you have the option of merging names as opposed to storing it all >> within a namespace. Namespaces are originally for dealing with name clashes. >> >> From the docs: >> >> Namespaces are primarily used to resolve name-clash issues in Maya, where >> a new object has the same name as an existing object (from importing a >> file, for example). - Docs >> <http://help.autodesk.com/cloudhelp/2015/ENU/Maya-Tech-Docs/CommandsPython/namespace.html> >> >> >> >> >> On 4 September 2014 09:07, Marcus Ottosson <[email protected]> >> wrote: >> >>> Hello Marcus! >>> Well, that only renames the node. So child nodes will still have the >>> namespace intact. >>> >>> Yes it does. A namespace in Maya is actually nothing more than some >>> additional character in its name. The cmds.namespace() is really just a >>> fancy cmds.rename if all you’re using it for is renaming nodes. One of >>> its benefits lie in the creation or removal of namespace objects, those you >>> can see under Window -> General Editors -> Namespace Editor. But even >>> those are mere conveniences for ultimately renaming nodes, as the “root” >>> namespace really just means “no colons (:) in the name” >>> >>> With this in mind, the following snippet would look at your selection, >>> and remove namespaces from all children below. >>> >>> def remove_namespaces(node): >>> >>> >>> >>> try: >>> # Note rsplit instead of split >>> >>> namespace, name = node.rsplit(":", 1) >>> except: >>> namespace, name = None, node >>> >>> if namespace: >>> try: >>> cmds.rename(node, name) >>> except RuntimeError: >>> # Can't remove namespaces from read-only nodes >>> # E.g. namespaces embedded in references >>> pass >>> def remove_namespaces_from_selection(): >>> for node in cmds.ls(sl=1): >>> # Remove namespaces of all children first >>> for descendent in cmds.listRelatives(node, allDescendents=True): >>> remove_namespaces(descendent) >>> >>> # Finally, remove namespace from current selection >>> remove_namespaces(node) >>> >>> >>> remove_namespaces_from_selection() >>> >>> It wouldn’t look at shaders though, for that I’d recommend also listing >>> connection to each node capable of having a shader. >>> >>> Does that help at all? >>> >>> >>> >>> On 3 September 2014 20:49, Stefan Andersson <[email protected]> wrote: >>> >>>> Hello Marcus! >>>> Well, that only renames the node. So child nodes will still have the >>>> namespace intact. >>>> >>>> So right now I have this which moves the namespace eventually into the >>>> root >>>> >>>> >>>> oSel = cmds.ls(sl=True)[0].split(":") >>>> if len(oSel) >1: >>>> for i in range(len(oSel)-1): >>>> cmds.namespace(mv=(oSel[i], ":"), f=True) >>>> >>>> Still trying to find a clever way of removing a selected object/shader >>>> (and their child nodes) into the root. >>>> >>>> regards >>>> stefan >>>> >>>> >>>> >>>> On Wed, Sep 3, 2014 at 6:12 PM, Marcus Ottosson <[email protected] >>>> > wrote: >>>> >>>>> Hi Stefan, >>>>> >>>>> The namespace is in the name, so renaming a node to a name without >>>>> namespace will effectively remove its namespace. >>>>> >>>>> cmds.rename('namespace:my_node', 'my_node') >>>>> >>>>> So if you’ve got many shaders you’d like to remove namespaces from, >>>>> simply rename them all. >>>>> >>>>> for shader in cmds.ls(type='shadingDependNode'): >>>>> try: >>>>> # Note rsplit instead of split >>>>> namespace, name = shader.rsplit(":", 1) >>>>> except: >>>>> namespace, name = None, shader >>>>> >>>>> if namespace: >>>>> try: >>>>> cmds.rename(shader, name) >>>>> except RuntimeError: >>>>> # Can't rename some shaders, like lambert1 >>>>> pass >>>>> >>>>> Best, >>>>> Marcus >>>>> >>>>> >>>>> >>>>> On 3 September 2014 17:53, Stefan Andersson <[email protected]> >>>>> wrote: >>>>> >>>>>> Hi All, >>>>>> >>>>>> I'm having a brain lock down... I'm trying to removed namespaces >>>>>> (both nested and not nested) from shaders. But can't for the world in me >>>>>> figure out how to check the namespace of the selected object, or query a >>>>>> node to return the namespaces.... >>>>>> >>>>>> I need to get a string back of all the namespaces that a object or a >>>>>> shader has. >>>>>> >>>>>> any help would be appreciated. or a RTFM to a specific page :) >>>>>> >>>>>> regards >>>>>> stefan >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> -- -- - [ *not morse code* ] -- - - -- -- - -- - -- -- - - - --- - >>>>>> -- - - - --- - >>>>>> *stefan andersson | vfx superviso*r >>>>>> Important Looking Pirates | http://www.ilpvfx.com >>>>>> >>>>>> -- >>>>>> 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/CAKW24e1X8N1As7CCePs_ijzMHj641rP7gCM_C3yNZ96QMqsdKA%40mail.gmail.com >>>>>> <https://groups.google.com/d/msgid/python_inside_maya/CAKW24e1X8N1As7CCePs_ijzMHj641rP7gCM_C3yNZ96QMqsdKA%40mail.gmail.com?utm_medium=email&utm_source=footer> >>>>>> . >>>>>> For more options, visit https://groups.google.com/d/optout. >>>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> *Marcus Ottosson* >>>>> [email protected] >>>>> >>>>> -- >>>>> 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/CAFRtmOCYhOyigQ4Evvb4S%3D4EPOA3os-%3D06myX6d-zcKsfMRxFQ%40mail.gmail.com >>>>> <https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOCYhOyigQ4Evvb4S%3D4EPOA3os-%3D06myX6d-zcKsfMRxFQ%40mail.gmail.com?utm_medium=email&utm_source=footer> >>>>> . >>>>> >>>>> For more options, visit https://groups.google.com/d/optout. >>>>> >>>> >>>> >>>> >>>> -- >>>> -- -- - [ *not morse code* ] -- - - -- -- - -- - -- -- - - - --- - -- >>>> - - - --- - >>>> *stefan andersson | vfx superviso*r >>>> Important Looking Pirates | http://www.ilpvfx.com >>>> >>>> -- >>>> 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/CAKW24e0G6igN1y3BJ2m3DxL8tkYUYavysvTpmD9-Fm4zbN2xAg%40mail.gmail.com >>>> <https://groups.google.com/d/msgid/python_inside_maya/CAKW24e0G6igN1y3BJ2m3DxL8tkYUYavysvTpmD9-Fm4zbN2xAg%40mail.gmail.com?utm_medium=email&utm_source=footer> >>>> . >>>> >>>> For more options, visit https://groups.google.com/d/optout. >>>> >>> >>> >>> >>> -- >>> *Marcus Ottosson* >>> [email protected] >>> >> >> >> >> -- >> *Marcus Ottosson* >> [email protected] >> >> -- >> 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/CAFRtmOAZCNyj_KbOpuNd9uRASvXUxEunPMJHZTJ08Me1igB40Q%40mail.gmail.com >> <https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOAZCNyj_KbOpuNd9uRASvXUxEunPMJHZTJ08Me1igB40Q%40mail.gmail.com?utm_medium=email&utm_source=footer> >> . >> >> For more options, visit https://groups.google.com/d/optout. >> > > > > -- > -- -- - [ *not morse code* ] -- - - -- -- - -- - -- -- - - - --- - -- - - > - --- - > *stefan andersson | vfx superviso*r > Important Looking Pirates | http://www.ilpvfx.com > cell: +46736268850 > > -- > 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/CAKW24e2DnRK%3DVGPLZRc1Uy24iwbA%3DFNRDXkAMkgAJahhJaPeRQ%40mail.gmail.com > <https://groups.google.com/d/msgid/python_inside_maya/CAKW24e2DnRK%3DVGPLZRc1Uy24iwbA%3DFNRDXkAMkgAJahhJaPeRQ%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/d/optout. > -- *Marcus Ottosson* [email protected] -- 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/CAFRtmOB%2BcoUPSRd3m25V23id8TmxcrBU%2BZXf-kNRySk3xAYbKQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
