Okay, I’m trying to to write a script that duplicates a scene completely by using the new scene, full copy method and then turns all the materials in only the new scene shadeless.
Here is the code I have so far:
import bpy
class duplicatorOperator(bpy.types.Operator):
"""Duplicator Operator"""
bl_idname = "object.duplicator_operator"
bl_label = "Duplicator Operator"
def execute(self, context):
bpy.ops.scene.new(type='FULL_COPY')
cloneScene1 = bpy.context.scene
cloneScene1.name = 'clone1'
for material in bpy.data.materials:
material.use_shadeless = True
return {'FINISHED'}
def add_object_button(self, context):
self.layout.operator(duplicatorOperator.bl_idname, text=duplicatorOperator.__doc__, icon='PLUGIN')
def register():
bpy.utils.register_class(duplicatorOperator)
bpy.types.VIEW3D_MT_object.append(add_object_button)
if __name__ == "__main__":
register()
So far it turns all the materials in the .blend file shadeless. But I need it to only turn the copied materials in the new scene shadeless. How do I get it to do that?