Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormeta-androcto <meta.androcto1@gmail.com>2019-05-25 13:14:22 +0300
committermeta-androcto <meta.androcto1@gmail.com>2019-05-25 13:14:22 +0300
commit03d5de4e2f3fca81b679415c7ea3414d2a4e7caf (patch)
treedfa582be23fe2a82aa53ff067a49e33e224054b0 /object_skinify.py
parent3335bd9f102c8caf7385e394b626217ad0d1b285 (diff)
object_skinify: initial fix for 2.8
Diffstat (limited to 'object_skinify.py')
-rw-r--r--object_skinify.py21
1 files changed, 11 insertions, 10 deletions
diff --git a/object_skinify.py b/object_skinify.py
index 9b256af0..a292512f 100644
--- a/object_skinify.py
+++ b/object_skinify.py
@@ -20,10 +20,10 @@ bl_info = {
"name": "Skinify Rig",
"author": "Albert Makac (karab44)",
"version": (0, 11, 0),
- "blender": (2, 79, 0),
+ "blender": (2, 80, 0),
"location": "Properties > Bone > Skinify Rig (visible on pose mode only)",
"description": "Creates a mesh object from selected bones",
- "warning": "",
+ "warning": "Work in progress",
"wiki_url": "https://wiki.blender.org/index.php/Extensions:2.6/"
"Py/Scripts/Object/Skinify",
"category": "Object"}
@@ -420,7 +420,7 @@ def generate_mesh(shape_object, size, thickness=0.8, finger_thickness=0.25, sub_
"""
This function adds modifiers for generated edges
"""
- total_bones_num = len(bpy.context.object.pose.bones.keys())
+ total_bones_num = bpy.context.selected_pose_bones_from_active_object
selected_bones_num = len(bones)
bpy.ops.object.mode_set(mode='EDIT')
@@ -581,7 +581,7 @@ def main(context):
oldLocation = None
oldRotation = None
oldScale = None
- armature_object = scn.objects.active
+ armature_object = context.view_layer.objects.active
armature_object.select_set(True)
old_pose_pos = armature_object.data.pose_position
@@ -605,7 +605,7 @@ def main(context):
bpy.ops.object.add(type='MESH', enter_editmode=False, location=origin)
# get the mesh object
- ob = scn.objects.active
+ ob = context.view_layer.objects.active
ob.name = obj_name
me = ob.data
me.name = mesh_name
@@ -628,7 +628,7 @@ def main(context):
bpy.ops.object.select_all(action='DESELECT')
ob.select_set(True)
armature_object.select_set(True)
- scn.objects.active = armature_object
+ bpy.context.view_layer.objects.active = armature_object
bpy.ops.object.parent_set(type='ARMATURE_AUTO')
armature_object.data.pose_position = old_pose_pos
@@ -672,15 +672,16 @@ class BONE_OT_custom_shape(Operator):
class BONE_PT_custom_shape(Panel):
- bl_space_type = 'PROPERTIES'
- bl_region_type = 'WINDOW'
- bl_context = "bone"
+ bl_space_type = "VIEW_3D"
+ bl_region_type = "UI"
+ bl_category = "Object"
+# bl_context = "bone"
bl_label = "Skinify Rig"
@classmethod
def poll(cls, context):
ob = context.object
- return ob and ob.mode == 'POSE' and context.bone
+ return ob and ob.mode == 'POSE' #and context.bone
def draw(self, context):
layout = self.layout