Browse files

Merge pull request #68 from dictoon/master

Fixed merge errors + cosmetics
  • Loading branch information...
2 parents 50b2465 + 503f2a9 commit 1f53c04256576ddf529f18dd4d6a65316c69d6b3 @jonathantopf committed Oct 4, 2012
View
1 plugins/ms_appleseed_material.py
@@ -21,7 +21,6 @@
# THE SOFTWARE.
#
-#
import sys
import maya.OpenMaya as OpenMaya
View
45 scripts/AEms_appleseed_materialTemplate.mel
@@ -1,61 +1,32 @@
-// Copyright (c) 2012 Jonathan Topf
+//
+// Copyright (c) 2012 Jonathan Topf
+//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
-
+//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
-
+//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
+//
+
global proc AEms_appleseed_materialTemplate( string $nodeName )
{
-<<<<<<< HEAD:src/scripts/AEms_appleseed_materialTemplate.mel
- //AEswatchDisplay $nodeName;
- editorTemplate -beginScrollLayout;
-
- editorTemplate -beginLayout "Main Attributes" -collapse 0;
- editorTemplate -addControl "render_layer";
- editorTemplate -addControl "BSDF_front_color";
- editorTemplate -addControl "EDF_front_color";
- editorTemplate -addControl "surface_shader_front_color";
- editorTemplate -addControl "normal_map_front_color";
-
- editorTemplate -addControl "duplcated_front_attributes_on_back";
-
- editorTemplate -addControl "BSDF_front_color";
- editorTemplate -addControl "EDF_front_color";
- editorTemplate -addControl "surface_shader_front_color";
- editorTemplate -addControl "normal_map_front_color";
-
- editorTemplate -addControl "alpha_map_color";
-
- editorTemplate -endLayout;
-
-
-// AEhardwareTextureTemplate $nodeName
-// ("hardwareColor diffuse");
-
- // include/call base class/node attributes
- AEdependNodeTemplate $nodeName;
-
- editorTemplate -addExtraControls;
- editorTemplate -endScrollLayout;
-=======
editorTemplate -beginScrollLayout;
editorTemplate -beginLayout "Main Attributes" -collapse 0;
-
editorTemplate -addControl "render_layer";
editorTemplate -addSeparator;
@@ -83,6 +54,4 @@ global proc AEms_appleseed_materialTemplate( string $nodeName )
editorTemplate -addExtraControls;
editorTemplate -endScrollLayout;
->>>>>>> ac1f639b5f3988137112ec105bbe8a20f891a1d4:scripts/AEms_appleseed_materialTemplate.mel
}
-
View
31 scripts/AEms_appleseed_shading_nodeTemplate.mel
@@ -1,39 +1,32 @@
-// Copyright (c) 2012 Jonathan Topf
+//
+// Copyright (c) 2012 Jonathan Topf
+//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
-
+//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
-
+//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
+//
+
global proc AEms_appleseed_shading_nodeTemplate( string $nodeName )
{
- //AEswatchDisplay $nodeName;
- //editorTemplate -beginScrollLayout;
-
- //editorTemplate -beginLayout "Main Attributes" -collapse 0;
- //editorTemplate -endLayout;
-
-
-// AEhardwareTextureTemplate $nodeName
-// ("hardwareColor diffuse");
-
- // include/call base class/node attributes
- AEdependNodeTemplate $nodeName;
-
- editorTemplate -addExtraControls;
- editorTemplate -endScrollLayout;
+ // include/call base class/node attributes
+ AEdependNodeTemplate $nodeName;
+
+ editorTemplate -addExtraControls;
+ editorTemplate -endScrollLayout;
}
-
View
9 scripts/AEms_environmentTemplate.mel
@@ -1,22 +1,25 @@
-// Copyright (c) 2012 Jonathan Topf
+//
+// Copyright (c) 2012 Jonathan Topf
+//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
-
+//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
-
+//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
+//
global proc AEms_environmentTemplate(string $nodeName)
View
1 scripts/AEms_renderSettingsTemplate.mel
@@ -19,6 +19,7 @@
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
+//
//--------------------------------------------------------------------------------------------------
View
2 scripts/ms_export.py
@@ -1614,5 +1614,3 @@ def export(render_settings_node):
cProfile.run(command)
else:
export_container(render_settings_node)
-
-
View
9 scripts/ms_export_obj.py
@@ -1,22 +1,25 @@
-# Copyright (c) 2012 Jonathan Topf
+#
+# Copyright (c) 2012 Jonathan Topf
+#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
-
+#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
-
+#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
+#
import maya.cmds as cmds
View
1 scripts/ms_menu.py
@@ -21,6 +21,7 @@
# THE SOFTWARE.
#
+
import maya.cmds as cmds
import maya.mel
import maya.utils as mu
View
9 tools/render_sequence.py
@@ -1,25 +1,26 @@
#!/usr/bin/python
-# -*- coding: utf-8 -*-
+#
# Copyright (c) 2012 Jonathan Topf
-
+#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
-
+#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
-
+#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
+#
#
# You will need PySide to run this script.
View
219 tools/watch_folder.py
@@ -1,166 +1,163 @@
+
+#
+# Copyright (c) 2012 Jonathan Topf
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+#
+
+
from xml.dom.minidom import parseString
import os
import sys
import time
from datetime import datetime
import shutil
-
CLI_PATH = '/projects/appleseed/sandbox/bin/Release/appleseed.cli'
FLAGS = ''
print '\n\n\n'
-#define helper class for printing colored text
+# Define helper class for printing colored text.
class printc():
- @staticmethod
- def warning(text):
- if os.system == 'darwin':
- print '\033[93m' + text + '\033[0m'
- else:
- print text
-
- @staticmethod
- def error(text):
- if os.system == 'darwin':
- print '\033[91m' + text + '\033[0m'
- else:
- print text
-
- @staticmethod
- def success(text):
- if os.system == 'darwin':
- print '\033[92m' + text + '\033[0m'
- else:
- print text
-
+ @staticmethod
+ def warning(text):
+ if os.system == 'darwin':
+ print '\033[93m' + text + '\033[0m'
+ else:
+ print text
+
+ @staticmethod
+ def error(text):
+ if os.system == 'darwin':
+ print '\033[91m' + text + '\033[0m'
+ else:
+ print text
+
+ @staticmethod
+ def success(text):
+ if os.system == 'darwin':
+ print '\033[92m' + text + '\033[0m'
+ else:
+ print text
def getDepends(xml_file_path):
- depend_list = []
-
- file = open(xml_file_path,'r')
- directory = os.path.split(xml_file_path)[0]
- data = file.read()
- file.close()
-
- dom = parseString(data)
+ depend_list = []
- for entity in dom.getElementsByTagName('parameter'):
- if entity.getAttribute('name') == 'filename':
+ file = open(xml_file_path,'r')
+ directory = os.path.split(xml_file_path)[0]
+ data = file.read()
+ file.close()
- file_name_attr = entity.getAttribute('value')
+ dom = parseString(data)
+ for entity in dom.getElementsByTagName('parameter'):
+ if entity.getAttribute('name') == 'filename':
- if (sys.platform == 'win32') or (sys.platform == 'win64'):
- file_name_attr = file_name_attr.replace('/', '\\')
- else:
- file_name_attr = file_name_attr.replace('\\', '/')
+ file_name_attr = entity.getAttribute('value')
- depend_list.append( os.path.join( directory, file_name_attr) )
+ if (sys.platform == 'win32') or (sys.platform == 'win64'):
+ file_name_attr = file_name_attr.replace('/', '\\')
+ else:
+ file_name_attr = file_name_attr.replace('\\', '/')
+ depend_list.append( os.path.join( directory, file_name_attr) )
-
-
- return depend_list
+ return depend_list
def listAppleseedFiles(directory_path):
- directory_entities = os.listdir(directory_path)
- files = []
- appleseed_files = []
- for entity in directory_entities:
- file_path = os.path.join(directory_path, entity)
- if os.path.isfile(file_path):
- if os.path.splitext(file_path)[1] == '.appleseed':
- appleseed_files.append(file_path)
+ directory_entities = os.listdir(directory_path)
+ files = []
+ appleseed_files = []
+ for entity in directory_entities:
+ file_path = os.path.join(directory_path, entity)
+ if os.path.isfile(file_path):
+ if os.path.splitext(file_path)[1] == '.appleseed':
+ appleseed_files.append(file_path)
-
- return appleseed_files
+ return appleseed_files
def isRenderable(file):
- print '\n'
- depend_name_text = ('Dependencies for ' + os.path.split(file)[1])
- print depend_name_text
- print len(depend_name_text) * '-'
- is_renderable = True
- for depend in getDepends(file):
- if os.path.exists(os.path.join(depend)):
- printc.success('EXISTS ' + depend)
- else:
- printc.error('MISSING ' + depend)
- is_renderable = False
- return is_renderable
-
-
+ print '\n'
+ depend_name_text = ('Dependencies for ' + os.path.split(file)[1])
+ print depend_name_text
+ print len(depend_name_text) * '-'
+ is_renderable = True
+ for depend in getDepends(file):
+ if os.path.exists(os.path.join(depend)):
+ printc.success('EXISTS ' + depend)
+ else:
+ printc.error('MISSING ' + depend)
+ is_renderable = False
+ return is_renderable
def main():
-
working_dir = os.getcwd()
# make folder to put rendered appleseed files into
if not os.path.exists(os.path.join(working_dir, 'done')):
- os.mkdir(os.path.join(working_dir, 'done'))
+ os.mkdir(os.path.join(working_dir, 'done'))
# make folder to put rendered images into
if not os.path.exists(os.path.join(working_dir, 'output')):
- os.mkdir(os.path.join(working_dir, 'output'))
+ os.mkdir(os.path.join(working_dir, 'output'))
while (True):
- appleseed_files = listAppleseedFiles(working_dir)
+ appleseed_files = listAppleseedFiles(working_dir)
- #if any appleseed files have been found
- if len(appleseed_files):
- for appleseed_file in appleseed_files:
- if isRenderable(appleseed_file):
+ #if any appleseed files have been found
+ if len(appleseed_files):
+ for appleseed_file in appleseed_files:
+ if isRenderable(appleseed_file):
+ printc.warning('\n\n:::: RENDERING ' + appleseed_file + ' ::::\n\n')
- printc.warning('\n\n:::: RENDERING ' + appleseed_file + ' ::::\n\n')
+ #create shell command
+ appleseed_file_name = os.path.split(appleseed_file)[1]
+ output_file_name = os.path.splitext(appleseed_file_name)[0] + '.png'
+ output_file_path = os.path.join(working_dir, 'output', output_file_name)
- #create shell command
- appleseed_file_name = os.path.split(appleseed_file)[1]
- output_file_name = os.path.splitext(appleseed_file_name)[0] + '.png'
- output_file_path = os.path.join(working_dir, 'output', output_file_name)
+ command = CLI_PATH + ' -o ' + output_file_path + ' ' + appleseed_file
+
+ #execute command
+ return_value = os.system(command)
- command = CLI_PATH + ' -o ' + output_file_path + ' ' + appleseed_file
-
- #execute command
- return_value = os.system(command)
+ #if the return value isnt 0 then somehtign may have gone wrong
+ if not return_value == 0:
+ printc.warning('File may not have rendered correctly: ' + appleseed_file)
- #if the return value isnt 0 then somehtign may have gone wrong
- if not return_value == 0:
- printc.warning('File may not have rendered correctly: ' + appleseed_file)
+ move_dest = os.path.join(working_dir, 'done', os.path.split(appleseed_file)[1])
+ shutil.move(appleseed_file,move_dest)
- move_dest = os.path.join(working_dir, 'done', os.path.split(appleseed_file)[1])
- shutil.move(appleseed_file,move_dest)
-
- break
- else:
- print '\n', datetime.now(), os.path.split(appleseed_file)[1], ': Missing dependencies'
- else:
- print '\n', datetime.now(), ': Nothing to render'
- time.sleep(3)
+ break
+ else:
+ print '\n', datetime.now(), os.path.split(appleseed_file)[1], ': Missing dependencies'
+ else:
+ print '\n', datetime.now(), ': Nothing to render'
+ time.sleep(3)
if __name__ == '__main__':
main()
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-

0 comments on commit 1f53c04

Please sign in to comment.