Whitespace fix

This commit is contained in:
Nobody Really 2016-07-09 11:33:08 +02:00
parent ea108bed79
commit 7de55b86c1
3 changed files with 1623 additions and 1714 deletions

View file

@ -36,6 +36,7 @@ import os
from bpy.app.handlers import persistent
from mathutils import Vector, Matrix
class godot_export_manager(bpy.types.Panel):
bl_label = "Godot Export Manager"
bl_space_type = 'PROPERTIES'
@ -62,13 +63,10 @@ class godot_export_manager(bpy.types.Panel):
op = col.operator("scene.godot_delete_objects_from_group",text="Delete selected objects from Group",icon="PASTEDOWN")
row = layout.row()
col = row.column()
col.label(text="Export Groups:")
row = layout.row()
col = row.column()
@ -114,6 +112,7 @@ class godot_export_manager(bpy.types.Panel):
col.prop(group,"anim_optimize_precision")
col.prop(group,"use_metadata")
### Custom template_list look
class UI_List_Godot(bpy.types.UIList):
def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index):
@ -150,7 +149,6 @@ class add_objects_to_group(bpy.types.Operator):
else:
objects_str += ", "+object.name
self.report({'INFO'}, objects_str + " added to group." )
if self.undo:
bpy.ops.ed.undo_push(message="Objects added to group")
@ -178,14 +176,12 @@ class del_objects_from_group(bpy.types.Operator):
if node.name in selected_objects:
scene.godot_export_groups[scene.godot_export_groups_index].nodes.remove(i)
if j == 0:
objects_str += object.name
else:
objects_str += ", "+object.name
j+=1
self.report({'INFO'}, objects_str + " deleted from group." )
bpy.ops.ed.undo_push(message="Objects deleted from group")
else:
@ -209,6 +205,7 @@ class select_group_objects(bpy.types.Operator):
context.scene.objects.active = bpy.data.objects[node.name]
return{'FINISHED'}
class export_groups_autosave(bpy.types.Operator):
bl_idname = "scene.godot_export_groups_autosave"
bl_label = "Export All Groups"
@ -224,6 +221,7 @@ class export_groups_autosave(bpy.types.Operator):
bpy.ops.ed.undo_push(message="Export all Groups")
return{'FINISHED'}
class export_all_groups(bpy.types.Operator):
bl_idname = "scene.godot_export_all_groups"
bl_label = "Export All Groups"
@ -247,7 +245,6 @@ 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):
new_ob = bpy.data.objects[ob.name].copy()
if single_user or ob.type=="ARMATURE":
@ -310,7 +307,6 @@ class export_group(bpy.types.Operator):
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)
else:
@ -363,6 +359,7 @@ class export_group(bpy.types.Operator):
self.report({'INFO'}, "Define Export Name and Export Path." )
return{'FINISHED'}
class add_export_group(bpy.types.Operator):
bl_idname = "scene.godot_add_export_group"
bl_label = "Adds a new export Group"
@ -380,6 +377,7 @@ class add_export_group(bpy.types.Operator):
bpy.ops.ed.undo_push(message="Create New Export Group")
return{'FINISHED'}
class del_export_group(bpy.types.Operator):
bl_idname = "scene.godot_delete_export_group"
bl_label = "Delets the selected export Group"
@ -398,9 +396,11 @@ class del_export_group(bpy.types.Operator):
bpy.ops.ed.undo_push(message="Delete Export Group")
return{'FINISHED'}
class godot_node_list(bpy.types.PropertyGroup):
name = StringProperty()
class godot_export_groups(bpy.types.PropertyGroup):
name = StringProperty(name="Group Name")
export_name = StringProperty(name="scene_name")
@ -431,6 +431,7 @@ class godot_export_groups(bpy.types.PropertyGroup):
use_metadata = BoolProperty(name="Use Metadata",default=True,options={'HIDDEN'})
use_include_particle_duplicates = BoolProperty(name="Include Particle Duplicates",default=True)
def register():
bpy.utils.register_class(godot_export_manager)
bpy.utils.register_class(godot_node_list)
@ -448,6 +449,7 @@ def register():
bpy.types.Scene.godot_export_groups = CollectionProperty(type=godot_export_groups)
bpy.types.Scene.godot_export_groups_index = IntProperty(default=0,min=0)
def unregister():
bpy.utils.unregister_class(godot_export_manager)
bpy.utils.unregister_class(godot_node_list)
@ -462,6 +464,7 @@ def unregister():
bpy.utils.unregister_class(select_group_objects)
bpy.utils.unregister_class(UI_List_Godot)
@persistent
def auto_export(dummy):
bpy.ops.scene.godot_export_groups_autosave()

View file

@ -59,90 +59,88 @@ class ExportDAE(bpy.types.Operator, ExportHelper):
# List of operator properties, the attributes will be assigned
# to the class instance from the operator settings before calling.
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'},
)
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'},
)
use_export_selected = BoolProperty(
name="Selected Objects",
description="Export only selected objects (and visible in active layers if that applies).",
default=False,
)
name="Selected Objects",
description="Export only selected objects (and visible in active layers if that applies).",
default=False,
)
use_mesh_modifiers = BoolProperty(
name="Apply Modifiers",
description="Apply modifiers to mesh objects (on a copy!).",
default=False,
)
name="Apply Modifiers",
description="Apply modifiers to mesh objects (on a copy!).",
default=False,
)
use_tangent_arrays = BoolProperty(
name="Tangent Arrays",
description="Export Tangent and Binormal arrays (for normalmapping).",
default=False,
)
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,
)
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,
)
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,
)
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,
)
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,
)
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,
)
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,
)
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,
)
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'},
)
name="Use Metadata",
default=True,
options={'HIDDEN'},
)
@property
def check_extension(self):
return True#return self.batch_mode == 'OFF'
return True # return self.batch_mode == 'OFF'
def check(self, context):
return True

File diff suppressed because it is too large Load diff