Skip to content

Commit

Permalink
Smaller changes here and there
Browse files Browse the repository at this point in the history
  • Loading branch information
ndee85 committed Aug 15, 2019
1 parent 738169f commit 0bb654b
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 7 deletions.
3 changes: 3 additions & 0 deletions Blender/coa_tools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
from . operators import toggle_animation_area
from . operators import view_sprites
from . operators import version_converter
from . operators import change_alpha_mode

from . operators.exporter import export_dragonbones
from . operators.exporter import export_creature
Expand Down Expand Up @@ -220,6 +221,8 @@ def draw(self, context):
toggle_animation_area.COATOOLS_OT_ToggleAnimationArea,
version_converter.COATOOLS_OT_VersionConverter,

change_alpha_mode.COATOOLS_OT_ChangeAlphaMode,

# exporter
export_dragonbones.COATOOLS_OT_DragonBonesExport,
export_dragonbones.COATOOLS_PT_ExportPanel,
Expand Down
1 change: 1 addition & 0 deletions Blender/coa_tools/coa_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ def exit_edit_shapekey(self, context):
if obj != None and obj.mode == "SCULPT":
bpy.ops.object.mode_set(mode="OBJECT")
obj.show_wire = False
obj.show_only_shape_key = False


def hide_base_sprite(self, context):
Expand Down
5 changes: 4 additions & 1 deletion Blender/coa_tools/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,10 @@ def draw_sculpt_ui(self,context,layout):
shapekey_index = int(obj.coa_tools.selected_shapekey)
if shapekey_index > 0:
active_shapekey = obj.data.shape_keys.key_blocks[shapekey_index]
col.prop(active_shapekey,"value")
subrow = col.row(align=True)
subrow.prop(active_shapekey,"value")

subrow.prop(obj,"show_only_shape_key", text="",icon="UNPINNED")

col = layout.column(align=False)
subrow = col.row(align=True)
Expand Down
2 changes: 1 addition & 1 deletion Blender/coa_tools/operators/draw_bone_shape.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def execute(self, context):
else:
shape_name = context.active_pose_bone.name + "_custom_shape"
if shape_name not in bpy.data.objects:
bone_shape = bpy.data.meshes.new_from_object(context.scene,bpy.data.objects[self.bone_shapes],False,"PREVIEW")
bone_shape = bpy.data.meshes.new_from_object(bpy.data.objects[self.bone_shapes],preserve_all_data_layers=False, depsgraph=None)
bone_shape.name = shape_name
bpy.ops.coa_tools.edit_mesh(mode="DRAW_BONE_SHAPE", new_shape_name=self.bone_shapes)
else:
Expand Down
12 changes: 8 additions & 4 deletions Blender/coa_tools/operators/edit_mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -1127,7 +1127,9 @@ def modal(self, context, event):
def exit_edit_mode(self,context,event,error=False):
if not error:
self.finish_edit_object(context)
bpy.types.SpaceView3D.draw_handler_remove(self.draw_handler, "WINDOW")
if self.draw_handler != None:
bpy.types.SpaceView3D.draw_handler_remove(self.draw_handler, "WINDOW")
self.draw_handler = None
# bpy.types.SpaceView3D.draw_handler_remove(self.draw_handler2, "WINDOW")

self.draw_handler_removed = True
Expand All @@ -1136,14 +1138,16 @@ def exit_edit_mode(self,context,event,error=False):
self.sprite_object.coa_tools.edit_mode = "OBJECT"

bpy.context.window.cursor_set("CROSSHAIR")
bpy.ops.object.mode_set(mode="OBJECT")
if context.active_object != None:
bpy.ops.object.mode_set(mode="OBJECT")
self.sprite_object.coa_tools.edit_mesh = False
functions.set_local_view(False)

obj = context.active_object
context.view_layer.objects.active = bpy.data.objects[self.edit_object_name]
context.view_layer.objects.active = bpy.data.objects[self.edit_object_name] if self.edit_object_name in bpy.data.objects else None
context.scene.coa_tools.view = self.prev_coa_view
bpy.ops.object.mode_set(mode="EDIT")
if context.active_object != None:
bpy.ops.object.mode_set(mode="EDIT")
if self.mode == "DRAW_BONE_SHAPE":
self.set_bone_shape_color_and_wireframe(context,self.bone_shape)

Expand Down
4 changes: 3 additions & 1 deletion Blender/coa_tools/operators/edit_weights.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@ def exit_edit_weights(self, context):

def exit_edit_mode(self, context):
### remove draw call
bpy.types.SpaceView3D.draw_handler_remove(self.draw_handler, "WINDOW")
if self.draw_handler != None:
bpy.types.SpaceView3D.draw_handler_remove(self.draw_handler, "WINDOW")
self.draw_handler = None

sprite_object = bpy.data.objects[self.sprite_object_name]

Expand Down

0 comments on commit 0bb654b

Please sign in to comment.