From b3d1e761ae99bd655a30a72c9327104ef044980f Mon Sep 17 00:00:00 2001 From: Luis Barrancos Date: Tue, 28 Nov 2017 13:07:26 +0800 Subject: [PATCH] Add presets, templates to .mod, rename aetemplate The module generating script was missing the bundled attr presets and the custom AETemplates required for our custom nodes, without which Maya kind of randomizes the I/Os in the node editor. Added this, plus icons location via XBMLANGPATH, and MAYA_SHELF_PATH for the future custom shelf. --- deploy/appleseed-maya.package.py | 4 ++++ .../NEasColorTransformTemplate.xml | 0 .../{aetemplate => AETemplates}/NEasLuminanceTemplate.xml | 0 .../{aetemplate => AETemplates}/NEasNoise2DTemplate.xml | 0 .../{aetemplate => AETemplates}/NEasNoise3DTemplate.xml | 0 .../NEasStandardSurfaceTemplate.xml | 0 .../{aetemplate => AETemplates}/NEasVoronoi2DTemplate.xml | 0 .../{aetemplate => AETemplates}/NEasVoronoi3DTemplate.xml | 0 .../appleseedMaya/{aetemplate => AETemplates}/__init__.py | 2 +- .../appleseedAlphaMapTemplate.py} | 0 .../appleseedPhysicalSkyLightTemplate.py} | 0 .../appleseedSkyDomeLightTemplate.py} | 0 scripts/appleseedMaya/register.py | 8 ++++---- 13 files changed, 9 insertions(+), 5 deletions(-) rename scripts/appleseedMaya/{aetemplate => AETemplates}/NEasColorTransformTemplate.xml (100%) rename scripts/appleseedMaya/{aetemplate => AETemplates}/NEasLuminanceTemplate.xml (100%) rename scripts/appleseedMaya/{aetemplate => AETemplates}/NEasNoise2DTemplate.xml (100%) rename scripts/appleseedMaya/{aetemplate => AETemplates}/NEasNoise3DTemplate.xml (100%) rename scripts/appleseedMaya/{aetemplate => AETemplates}/NEasStandardSurfaceTemplate.xml (100%) rename scripts/appleseedMaya/{aetemplate => AETemplates}/NEasVoronoi2DTemplate.xml (100%) rename scripts/appleseedMaya/{aetemplate => AETemplates}/NEasVoronoi3DTemplate.xml (100%) rename scripts/appleseedMaya/{aetemplate => AETemplates}/__init__.py (98%) rename scripts/appleseedMaya/{aetemplate/appleseedalphamaptemplate.py => AETemplates/appleseedAlphaMapTemplate.py} (100%) rename scripts/appleseedMaya/{aetemplate/appleseedphysicalskylighttemplate.py => AETemplates/appleseedPhysicalSkyLightTemplate.py} (100%) rename scripts/appleseedMaya/{aetemplate/appleseedskydomelighttemplate.py => AETemplates/appleseedSkyDomeLightTemplate.py} (100%) diff --git a/deploy/appleseed-maya.package.py b/deploy/appleseed-maya.package.py index e4f554c..a7c60bc 100644 --- a/deploy/appleseed-maya.package.py +++ b/deploy/appleseed-maya.package.py @@ -319,6 +319,10 @@ def do_generate_module_file(self, maya_platform_id): f.write("PATH +:= bin\n") f.write("PYTHONPATH +:= scripts\n") f.write("APPLESEED_SEARCHPATH +:= shaders\n") + f.write("MAYA_PRESET_PATH +:= presets\n") + f.write("MAYA_CUSTOM_TEMPLATE_PATH +:= scripts/appleseedMaya/AETemplates\n") + f.write("MAYA_SHELF_PATH +:= prefs/shelves\n") + f.write("XBMLANGPATH +:= icons/%B\n") def copy_binaries(self): bin_dir = os.path.join(self.settings.package_output_path, "bin") diff --git a/scripts/appleseedMaya/aetemplate/NEasColorTransformTemplate.xml b/scripts/appleseedMaya/AETemplates/NEasColorTransformTemplate.xml similarity index 100% rename from scripts/appleseedMaya/aetemplate/NEasColorTransformTemplate.xml rename to scripts/appleseedMaya/AETemplates/NEasColorTransformTemplate.xml diff --git a/scripts/appleseedMaya/aetemplate/NEasLuminanceTemplate.xml b/scripts/appleseedMaya/AETemplates/NEasLuminanceTemplate.xml similarity index 100% rename from scripts/appleseedMaya/aetemplate/NEasLuminanceTemplate.xml rename to scripts/appleseedMaya/AETemplates/NEasLuminanceTemplate.xml diff --git a/scripts/appleseedMaya/aetemplate/NEasNoise2DTemplate.xml b/scripts/appleseedMaya/AETemplates/NEasNoise2DTemplate.xml similarity index 100% rename from scripts/appleseedMaya/aetemplate/NEasNoise2DTemplate.xml rename to scripts/appleseedMaya/AETemplates/NEasNoise2DTemplate.xml diff --git a/scripts/appleseedMaya/aetemplate/NEasNoise3DTemplate.xml b/scripts/appleseedMaya/AETemplates/NEasNoise3DTemplate.xml similarity index 100% rename from scripts/appleseedMaya/aetemplate/NEasNoise3DTemplate.xml rename to scripts/appleseedMaya/AETemplates/NEasNoise3DTemplate.xml diff --git a/scripts/appleseedMaya/aetemplate/NEasStandardSurfaceTemplate.xml b/scripts/appleseedMaya/AETemplates/NEasStandardSurfaceTemplate.xml similarity index 100% rename from scripts/appleseedMaya/aetemplate/NEasStandardSurfaceTemplate.xml rename to scripts/appleseedMaya/AETemplates/NEasStandardSurfaceTemplate.xml diff --git a/scripts/appleseedMaya/aetemplate/NEasVoronoi2DTemplate.xml b/scripts/appleseedMaya/AETemplates/NEasVoronoi2DTemplate.xml similarity index 100% rename from scripts/appleseedMaya/aetemplate/NEasVoronoi2DTemplate.xml rename to scripts/appleseedMaya/AETemplates/NEasVoronoi2DTemplate.xml diff --git a/scripts/appleseedMaya/aetemplate/NEasVoronoi3DTemplate.xml b/scripts/appleseedMaya/AETemplates/NEasVoronoi3DTemplate.xml similarity index 100% rename from scripts/appleseedMaya/aetemplate/NEasVoronoi3DTemplate.xml rename to scripts/appleseedMaya/AETemplates/NEasVoronoi3DTemplate.xml diff --git a/scripts/appleseedMaya/aetemplate/__init__.py b/scripts/appleseedMaya/AETemplates/__init__.py similarity index 98% rename from scripts/appleseedMaya/aetemplate/__init__.py rename to scripts/appleseedMaya/AETemplates/__init__.py index cddc3c2..28f8544 100644 --- a/scripts/appleseedMaya/aetemplate/__init__.py +++ b/scripts/appleseedMaya/AETemplates/__init__.py @@ -57,7 +57,7 @@ def meshAlphaMapCreateNew(node, attr): def __meshAlphaCreateNewPyCmd(self, attr): (nodeName, attrName) = attr.split('.') - thisClass = 'appleseedMaya.aetemplate.AEappleseedNodeTemplate' + thisClass = 'appleseedMaya.AETemplates.AEappleseedNodeTemplate' return "%s.meshAlphaMapCreateNew('%s', '%s')" % (thisClass, nodeName, attrName) def meshAlphaMapNew(self, attr): diff --git a/scripts/appleseedMaya/aetemplate/appleseedalphamaptemplate.py b/scripts/appleseedMaya/AETemplates/appleseedAlphaMapTemplate.py similarity index 100% rename from scripts/appleseedMaya/aetemplate/appleseedalphamaptemplate.py rename to scripts/appleseedMaya/AETemplates/appleseedAlphaMapTemplate.py diff --git a/scripts/appleseedMaya/aetemplate/appleseedphysicalskylighttemplate.py b/scripts/appleseedMaya/AETemplates/appleseedPhysicalSkyLightTemplate.py similarity index 100% rename from scripts/appleseedMaya/aetemplate/appleseedphysicalskylighttemplate.py rename to scripts/appleseedMaya/AETemplates/appleseedPhysicalSkyLightTemplate.py diff --git a/scripts/appleseedMaya/aetemplate/appleseedskydomelighttemplate.py b/scripts/appleseedMaya/AETemplates/appleseedSkyDomeLightTemplate.py similarity index 100% rename from scripts/appleseedMaya/aetemplate/appleseedskydomelighttemplate.py rename to scripts/appleseedMaya/AETemplates/appleseedSkyDomeLightTemplate.py diff --git a/scripts/appleseedMaya/register.py b/scripts/appleseedMaya/register.py index 47c8180..d364cf0 100644 --- a/scripts/appleseedMaya/register.py +++ b/scripts/appleseedMaya/register.py @@ -37,7 +37,7 @@ import maya.OpenMaya as om # appleseedMaya imports. -from aetemplate import appleseedAETemplateCallback +from AETemplates import appleseedAETemplateCallback from hypershadeCallbacks import * from logger import logger from menu import createMenu, deleteMenu @@ -115,14 +115,14 @@ def register(): hook="AETemplateCustomContent", owner="appleseed") - # Manually load templates in aetemplate folder. - templatesDir = os.path.join(thisDir, "aetemplate") + # Manually load templates in AETemplates folder. + templatesDir = os.path.join(thisDir, "AETemplates") logger.debug("Registering AETemplates in %s" % templatesDir) for file in os.listdir(templatesDir): if fnmatch.fnmatch(file, '*template.py'): templateModule = file.replace(".py", "") logger.debug("Registering AE template %s" % templateModule) - mel.eval('python("import appleseedMaya.aetemplate.%s")' % templateModule) + mel.eval('python("import appleseedMaya.AETemplates.%s")' % templateModule) # Hypershade callbacks asHypershadeCallbacks = [