mirror of
https://github.com/godotengine/godot.git
synced 2024-11-27 09:16:35 +08:00
Comma fix
This commit is contained in:
parent
7de55b86c1
commit
52fdc65a5d
@ -55,13 +55,13 @@ class godot_export_manager(bpy.types.Panel):
|
||||
|
||||
row = layout.row()
|
||||
col = row.column()
|
||||
col.prop(scene,"godot_export_on_save",text="Export Groups on save")
|
||||
col.prop(scene, "godot_export_on_save", text="Export Groups on save")
|
||||
|
||||
row = layout.row()
|
||||
col = row.column(align=True)
|
||||
op = col.operator("scene.godot_add_objects_to_group",text="Add selected objects to Group",icon="COPYDOWN")
|
||||
op = col.operator("scene.godot_add_objects_to_group", text="Add selected objects to Group", icon="COPYDOWN")
|
||||
|
||||
op = col.operator("scene.godot_delete_objects_from_group",text="Delete selected objects from Group",icon="PASTEDOWN")
|
||||
op = col.operator("scene.godot_delete_objects_from_group", text="Delete selected objects from Group", icon="PASTEDOWN")
|
||||
|
||||
row = layout.row()
|
||||
col = row.column()
|
||||
@ -70,20 +70,20 @@ class godot_export_manager(bpy.types.Panel):
|
||||
row = layout.row()
|
||||
col = row.column()
|
||||
|
||||
col.template_list("UI_List_Godot","dummy",scene, "godot_export_groups", scene, "godot_export_groups_index",rows=1,maxrows=10,type='DEFAULT')
|
||||
col.template_list("UI_List_Godot", "dummy", scene, "godot_export_groups", scene, "godot_export_groups_index", rows=1, maxrows=10, type='DEFAULT')
|
||||
|
||||
col = row.column(align=True)
|
||||
col.operator("scene.godot_add_export_group",text="",icon="ZOOMIN")
|
||||
col.operator("scene.godot_delete_export_group",text="",icon="ZOOMOUT")
|
||||
col.operator("scene.godot_export_all_groups",text="",icon="EXPORT")
|
||||
col.operator("scene.godot_add_export_group", text="", icon="ZOOMIN")
|
||||
col.operator("scene.godot_delete_export_group", text="", icon="ZOOMOUT")
|
||||
col.operator("scene.godot_export_all_groups", text="", icon="EXPORT")
|
||||
|
||||
if len(scene.godot_export_groups) > 0:
|
||||
row = layout.row()
|
||||
col = row.column()
|
||||
group = scene.godot_export_groups[scene.godot_export_groups_index]
|
||||
col.prop(group,"name",text="Group Name")
|
||||
col.prop(group,"export_name",text="Export Name")
|
||||
col.prop(group,"export_path",text="Export Filepath")
|
||||
col.prop(group, "name", text="Group Name")
|
||||
col.prop(group, "export_name", text="Export Name")
|
||||
col.prop(group, "export_path", text="Export Filepath")
|
||||
|
||||
row = layout.row()
|
||||
col = row.column()
|
||||
@ -92,25 +92,25 @@ class godot_export_manager(bpy.types.Panel):
|
||||
col.label(text="Export Settings:")
|
||||
|
||||
col = col.row(align=True)
|
||||
col.prop(group,"apply_loc",toggle=True,icon="MAN_TRANS")
|
||||
col.prop(group,"apply_rot",toggle=True,icon="MAN_ROT")
|
||||
col.prop(group,"apply_scale",toggle=True,icon="MAN_SCALE")
|
||||
col.prop(group, "apply_loc", toggle=True, icon="MAN_TRANS")
|
||||
col.prop(group, "apply_rot", toggle=True, icon="MAN_ROT")
|
||||
col.prop(group, "apply_scale", toggle=True, icon="MAN_SCALE")
|
||||
|
||||
row = layout.row()
|
||||
col = row.column()
|
||||
|
||||
col.prop(group,"use_include_particle_duplicates")
|
||||
col.prop(group,"use_mesh_modifiers")
|
||||
col.prop(group,"use_tangent_arrays")
|
||||
col.prop(group,"use_triangles")
|
||||
col.prop(group,"use_copy_images")
|
||||
col.prop(group,"use_active_layers")
|
||||
col.prop(group,"use_anim")
|
||||
col.prop(group,"use_anim_action_all")
|
||||
col.prop(group,"use_anim_skip_noexp")
|
||||
col.prop(group,"use_anim_optimize")
|
||||
col.prop(group,"anim_optimize_precision")
|
||||
col.prop(group,"use_metadata")
|
||||
col.prop(group, "use_include_particle_duplicates")
|
||||
col.prop(group, "use_mesh_modifiers")
|
||||
col.prop(group, "use_tangent_arrays")
|
||||
col.prop(group, "use_triangles")
|
||||
col.prop(group, "use_copy_images")
|
||||
col.prop(group, "use_active_layers")
|
||||
col.prop(group, "use_anim")
|
||||
col.prop(group, "use_anim_action_all")
|
||||
col.prop(group, "use_anim_skip_noexp")
|
||||
col.prop(group, "use_anim_optimize")
|
||||
col.prop(group, "anim_optimize_precision")
|
||||
col.prop(group, "use_metadata")
|
||||
|
||||
|
||||
### Custom template_list look
|
||||
@ -120,12 +120,12 @@ class UI_List_Godot(bpy.types.UIList):
|
||||
slot = item
|
||||
col = layout.row(align=True)
|
||||
|
||||
col.label(text=item.name,icon="GROUP")
|
||||
col.prop(item,"active",text="")
|
||||
col.label(text=item.name, icon="GROUP")
|
||||
col.prop(item, "active", text="")
|
||||
|
||||
op = col.operator("scene.godot_select_group_objects",text="",emboss=False,icon="RESTRICT_SELECT_OFF")
|
||||
op = col.operator("scene.godot_select_group_objects", text="", emboss=False, icon="RESTRICT_SELECT_OFF")
|
||||
op.idx = index
|
||||
op = col.operator("scene.godot_export_group",text="",emboss=False,icon="EXPORT")
|
||||
op = col.operator("scene.godot_export_group", text="", emboss=False, icon="EXPORT")
|
||||
op.idx = index
|
||||
|
||||
class add_objects_to_group(bpy.types.Operator):
|
||||
@ -135,12 +135,12 @@ class add_objects_to_group(bpy.types.Operator):
|
||||
|
||||
undo = BoolProperty(default=True)
|
||||
|
||||
def execute(self,context):
|
||||
def execute(self, context):
|
||||
scene = context.scene
|
||||
|
||||
objects_str = ""
|
||||
if len(scene.godot_export_groups) > 0:
|
||||
for i,object in enumerate(context.selected_objects):
|
||||
for i, object in enumerate(context.selected_objects):
|
||||
if object.name not in scene.godot_export_groups[scene.godot_export_groups_index].nodes:
|
||||
node = scene.godot_export_groups[scene.godot_export_groups_index].nodes.add()
|
||||
node.name = object.name
|
||||
@ -161,7 +161,7 @@ class del_objects_from_group(bpy.types.Operator):
|
||||
bl_label = "Delete Objects from Group"
|
||||
bl_description = "Delets the selected Objects from the active group below."
|
||||
|
||||
def execute(self,context):
|
||||
def execute(self, context):
|
||||
scene = context.scene
|
||||
|
||||
if len(scene.godot_export_groups) > 0:
|
||||
@ -172,7 +172,7 @@ class del_objects_from_group(bpy.types.Operator):
|
||||
|
||||
objects_str = ""
|
||||
j = 0
|
||||
for i,node in enumerate(scene.godot_export_groups[scene.godot_export_groups_index].nodes):
|
||||
for i, node in enumerate(scene.godot_export_groups[scene.godot_export_groups_index].nodes):
|
||||
if node.name in selected_objects:
|
||||
scene.godot_export_groups[scene.godot_export_groups_index].nodes.remove(i)
|
||||
|
||||
@ -195,7 +195,7 @@ class select_group_objects(bpy.types.Operator):
|
||||
|
||||
idx = IntProperty()
|
||||
|
||||
def execute(self,context):
|
||||
def execute(self, context):
|
||||
scene = context.scene
|
||||
for object in context.scene.objects:
|
||||
object.select = False
|
||||
@ -211,7 +211,7 @@ class export_groups_autosave(bpy.types.Operator):
|
||||
bl_label = "Export All Groups"
|
||||
bl_description = "Exports all groups to Collada."
|
||||
|
||||
def execute(self,context):
|
||||
def execute(self, context):
|
||||
scene = context.scene
|
||||
if scene.godot_export_on_save:
|
||||
for i in range(len(scene.godot_export_groups)):
|
||||
@ -227,11 +227,11 @@ class export_all_groups(bpy.types.Operator):
|
||||
bl_label = "Export All Groups"
|
||||
bl_description = "Exports all groups to Collada."
|
||||
|
||||
def execute(self,context):
|
||||
def execute(self, context):
|
||||
scene = context.scene
|
||||
|
||||
for i in range(0,len(scene.godot_export_groups)):
|
||||
bpy.ops.scene.godot_export_group(idx=i,export_all=True)
|
||||
for i in range(0, len(scene.godot_export_groups)):
|
||||
bpy.ops.scene.godot_export_group(idx=i, export_all=True)
|
||||
|
||||
self.report({'INFO'}, "All Groups exported." )
|
||||
return{'FINISHED'}
|
||||
@ -245,7 +245,7 @@ class export_group(bpy.types.Operator):
|
||||
idx = IntProperty(default=0)
|
||||
export_all = BoolProperty(default=False)
|
||||
|
||||
def copy_object_recursive(self,ob,parent,single_user = True):
|
||||
def copy_object_recursive(self, ob, parent, single_user = True):
|
||||
new_ob = bpy.data.objects[ob.name].copy()
|
||||
if single_user or ob.type=="ARMATURE":
|
||||
new_mesh_data = new_ob.data.copy()
|
||||
@ -258,22 +258,22 @@ class export_group(bpy.types.Operator):
|
||||
new_ob.parent = None
|
||||
|
||||
for child in ob.children:
|
||||
self.copy_object_recursive(child,new_ob,single_user)
|
||||
self.copy_object_recursive(child, new_ob, single_user)
|
||||
new_ob.select = True
|
||||
return new_ob
|
||||
|
||||
def delete_object(self,ob):
|
||||
def delete_object(self, ob):
|
||||
if ob != None:
|
||||
for child in ob.children:
|
||||
self.delete_object(child)
|
||||
bpy.context.scene.objects.unlink(ob)
|
||||
bpy.data.objects.remove(ob)
|
||||
|
||||
def convert_group_to_node(self,group):
|
||||
def convert_group_to_node(self, group):
|
||||
if group.dupli_group != None:
|
||||
for object in group.dupli_group.objects:
|
||||
if object.parent == None:
|
||||
object = self.copy_object_recursive(object,object,True)
|
||||
object = self.copy_object_recursive(object, object, True)
|
||||
matrix = Matrix(object.matrix_local)
|
||||
object.matrix_local = Matrix()
|
||||
object.matrix_local *= group.matrix_local
|
||||
@ -281,7 +281,7 @@ class export_group(bpy.types.Operator):
|
||||
|
||||
self.delete_object(group)
|
||||
|
||||
def execute(self,context):
|
||||
def execute(self, context):
|
||||
|
||||
scene = context.scene
|
||||
group = context.scene.godot_export_groups
|
||||
@ -289,7 +289,7 @@ class export_group(bpy.types.Operator):
|
||||
if not group[self.idx].active and self.export_all:
|
||||
return{'FINISHED'}
|
||||
|
||||
for i,object in enumerate(group[self.idx].nodes):
|
||||
for i, object in enumerate(group[self.idx].nodes):
|
||||
if object.name in bpy.data.objects:
|
||||
pass
|
||||
else:
|
||||
@ -300,17 +300,17 @@ class export_group(bpy.types.Operator):
|
||||
if (path.find("//")==0 or path.find("\\\\")==0):
|
||||
#if relative, convert to absolute
|
||||
path = bpy.path.abspath(path)
|
||||
path = path.replace("\\","/")
|
||||
path = path.replace("\\", "/")
|
||||
|
||||
### if path exists and group export name is set the group will be exported
|
||||
if os.path.exists(path) and group[self.idx].export_name != "":
|
||||
|
||||
context.scene.layers = [True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True]
|
||||
context.scene.layers = [True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True]
|
||||
|
||||
if group[self.idx].export_name.endswith(".dae"):
|
||||
path = os.path.join(path,group[self.idx].export_name)
|
||||
path = os.path.join(path, group[self.idx].export_name)
|
||||
else:
|
||||
path = os.path.join(path,group[self.idx].export_name+".dae")
|
||||
path = os.path.join(path, group[self.idx].export_name+".dae")
|
||||
|
||||
hide_select = []
|
||||
for object in context.scene.objects:
|
||||
@ -322,7 +322,7 @@ class export_group(bpy.types.Operator):
|
||||
### make particle duplicates, parent and select them
|
||||
nodes_to_be_added = []
|
||||
if group[self.idx].use_include_particle_duplicates:
|
||||
for i,object in enumerate(group[self.idx].nodes):
|
||||
for i, object in enumerate(group[self.idx].nodes):
|
||||
if bpy.data.objects[object.name].type != "EMPTY":
|
||||
context.scene.objects.active = bpy.data.objects[object.name]
|
||||
bpy.data.objects[object.name].select = True
|
||||
@ -339,7 +339,7 @@ class export_group(bpy.types.Operator):
|
||||
object.select = True
|
||||
|
||||
### select all other nodes from the group
|
||||
for i,object in enumerate(group[self.idx].nodes):
|
||||
for i, object in enumerate(group[self.idx].nodes):
|
||||
if bpy.data.objects[object.name].type == "EMPTY":
|
||||
self.convert_group_to_node(bpy.data.objects[object.name])
|
||||
else:
|
||||
@ -365,7 +365,7 @@ class add_export_group(bpy.types.Operator):
|
||||
bl_label = "Adds a new export Group"
|
||||
bl_description = "Creates a new Export Group with the selected Objects assigned to it."
|
||||
|
||||
def execute(self,context):
|
||||
def execute(self, context):
|
||||
scene = context.scene
|
||||
|
||||
item = scene.godot_export_groups.add()
|
||||
@ -385,9 +385,9 @@ class del_export_group(bpy.types.Operator):
|
||||
|
||||
def invoke(self, context, event):
|
||||
wm = context.window_manager
|
||||
return wm.invoke_confirm(self,event)
|
||||
return wm.invoke_confirm(self, event)
|
||||
|
||||
def execute(self,context):
|
||||
def execute(self, context):
|
||||
scene = context.scene
|
||||
|
||||
scene.godot_export_groups.remove(scene.godot_export_groups_index)
|
||||
@ -406,30 +406,30 @@ class godot_export_groups(bpy.types.PropertyGroup):
|
||||
export_name = StringProperty(name="scene_name")
|
||||
nodes = CollectionProperty(type=godot_node_list)
|
||||
export_path = StringProperty(subtype="DIR_PATH")
|
||||
active = BoolProperty(default=True,description="Export Group")
|
||||
active = BoolProperty(default=True, description="Export Group")
|
||||
|
||||
object_types = EnumProperty(name="Object Types",options={'ENUM_FLAG'},items=(('EMPTY', "Empty", ""),('CAMERA', "Camera", ""),('LAMP', "Lamp", ""),('ARMATURE', "Armature", ""),('MESH', "Mesh", ""),('CURVE', "Curve", ""),),default={'EMPTY', 'CAMERA', 'LAMP', 'ARMATURE', 'MESH','CURVE'})
|
||||
object_types = EnumProperty(name="Object Types", options={'ENUM_FLAG'}, items=(('EMPTY', "Empty", ""), ('CAMERA', "Camera", ""), ('LAMP', "Lamp", ""), ('ARMATURE', "Armature", ""), ('MESH', "Mesh", ""), ('CURVE', "Curve", ""), ), default={'EMPTY', 'CAMERA', 'LAMP', 'ARMATURE', 'MESH', 'CURVE'})
|
||||
|
||||
apply_scale = BoolProperty(name="Apply Scale",description="Apply Scale before export.",default=False)
|
||||
apply_rot = BoolProperty(name="Apply Rotation",description="Apply Rotation before export.",default=False)
|
||||
apply_loc = BoolProperty(name="Apply Location",description="Apply Location before export.",default=False)
|
||||
apply_scale = BoolProperty(name="Apply Scale", description="Apply Scale before export.", default=False)
|
||||
apply_rot = BoolProperty(name="Apply Rotation", description="Apply Rotation before export.", default=False)
|
||||
apply_loc = BoolProperty(name="Apply Location", description="Apply Location before export.", default=False)
|
||||
|
||||
use_export_selected = BoolProperty(name="Selected Objects",description="Export only selected objects (and visible in active layers if that applies).",default=True)
|
||||
use_mesh_modifiers = BoolProperty(name="Apply Modifiers",description="Apply modifiers to mesh objects (on a copy!).",default=True)
|
||||
use_tangent_arrays = BoolProperty(name="Tangent Arrays",description="Export Tangent and Binormal arrays (for normalmapping).",default=False)
|
||||
use_triangles = BoolProperty(name="Triangulate",description="Export Triangles instead of Polygons.",default=False)
|
||||
use_export_selected = BoolProperty(name="Selected Objects", description="Export only selected objects (and visible in active layers if that applies).", default=True)
|
||||
use_mesh_modifiers = BoolProperty(name="Apply Modifiers", description="Apply modifiers to mesh objects (on a copy!).", default=True)
|
||||
use_tangent_arrays = BoolProperty(name="Tangent Arrays", description="Export Tangent and Binormal arrays (for normalmapping).", default=False)
|
||||
use_triangles = BoolProperty(name="Triangulate", description="Export Triangles instead of Polygons.", default=False)
|
||||
|
||||
use_copy_images = BoolProperty(name="Copy Images",description="Copy Images (create images/ subfolder)",default=False)
|
||||
use_active_layers = BoolProperty(name="Active Layers",description="Export only objects on the active layers.",default=True)
|
||||
use_anim = BoolProperty(name="Export Animation",description="Export keyframe animation",default=False)
|
||||
use_anim_action_all = BoolProperty(name="All Actions",description=("Export all actions for the first armature found in separate DAE files"),default=False)
|
||||
use_anim_skip_noexp = BoolProperty(name="Skip (-noexp) Actions",description="Skip exporting of actions whose name end in (-noexp). Useful to skip control animations.",default=True)
|
||||
use_anim_optimize = BoolProperty(name="Optimize Keyframes",description="Remove double keyframes",default=True)
|
||||
use_copy_images = BoolProperty(name="Copy Images", description="Copy Images (create images/ subfolder)", default=False)
|
||||
use_active_layers = BoolProperty(name="Active Layers", description="Export only objects on the active layers.", default=True)
|
||||
use_anim = BoolProperty(name="Export Animation", description="Export keyframe animation", default=False)
|
||||
use_anim_action_all = BoolProperty(name="All Actions", description=("Export all actions for the first armature found in separate DAE files"), default=False)
|
||||
use_anim_skip_noexp = BoolProperty(name="Skip (-noexp) Actions", description="Skip exporting of actions whose name end in (-noexp). Useful to skip control animations.", default=True)
|
||||
use_anim_optimize = BoolProperty(name="Optimize Keyframes", description="Remove double keyframes", default=True)
|
||||
|
||||
anim_optimize_precision = FloatProperty(name="Precision",description=("Tolerence for comparing double keyframes (higher for greater accuracy)"),min=1, max=16,soft_min=1, soft_max=16,default=6.0)
|
||||
anim_optimize_precision = FloatProperty(name="Precision", description=("Tolerence for comparing double keyframes (higher for greater accuracy)"), min=1, max=16, soft_min=1, soft_max=16, default=6.0)
|
||||
|
||||
use_metadata = BoolProperty(name="Use Metadata",default=True,options={'HIDDEN'})
|
||||
use_include_particle_duplicates = BoolProperty(name="Include Particle Duplicates",default=True)
|
||||
use_metadata = BoolProperty(name="Use Metadata", default=True, options={'HIDDEN'})
|
||||
use_include_particle_duplicates = BoolProperty(name="Include Particle Duplicates", default=True)
|
||||
|
||||
|
||||
def register():
|
||||
@ -447,7 +447,7 @@ def register():
|
||||
bpy.utils.register_class(UI_List_Godot)
|
||||
|
||||
bpy.types.Scene.godot_export_groups = CollectionProperty(type=godot_export_groups)
|
||||
bpy.types.Scene.godot_export_groups_index = IntProperty(default=0,min=0)
|
||||
bpy.types.Scene.godot_export_groups_index = IntProperty(default=0, min=0)
|
||||
|
||||
|
||||
def unregister():
|
||||
|
@ -69,7 +69,7 @@ class ExportDAE(bpy.types.Operator, ExportHelper):
|
||||
('MESH', "Mesh", ""),
|
||||
('CURVE', "Curve", ""),
|
||||
),
|
||||
default={'EMPTY', 'CAMERA', 'LAMP', 'ARMATURE', 'MESH','CURVE'},
|
||||
default={'EMPTY', 'CAMERA', 'LAMP', 'ARMATURE', 'MESH', 'CURVE'},
|
||||
)
|
||||
|
||||
use_export_selected = BoolProperty(
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user