• (Blender) Applying the current pose as rest pose on a model with shapekeys?
    9 replies, posted
I posed a ported model, which has flexes, as close as I could to a TF2 character, but the issue now is I can't set its rest/reference post to be this current pose. Trying to Apply Pose as Rest Pose fails as the mesh doesn't update to the new pose. https://files.facepunch.com/forum/upload/111014/5457fb06-1af2-4046-9e4f-859dce787677/image.png Trying to apply the Armature modifier in an attempt to fix the above issue also fails due to this error: https://files.facepunch.com/forum/upload/111014/91ec5e21-aae5-4589-aabc-070c177378e6/image.png Is there any workaround I can do (such as a plugin)? I must keep the shapekeys, so deleting them is not an option. Seperating the head is also not an option as I have adjusted the head/spine bones.
Ehh. No, won't work right now. You can't transform shapekey vertex locations with bones yet. I mean it's not that hard. Just gotta transform the bone first and then figure out the relative morph location, but that's just me thinking... it's probably harder to code for the devs. Chill. Wait for it.
Bump, I still really need a workaround for this since I don't want to learn 3DSmax solely for this
[code] # ------------------------------------------------------------------------------ # The MIT License (MIT) # # Copyright (c) 2015 Przemysław Bągard # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. # ------------------------------------------------------------------------------ # Date: 01 February 2015 # Blender script # Description: Apply modifier and remove from the stack for object with shape keys # (Pushing 'Apply' button in 'Object modifiers' tab result in an error 'Modifier cannot be applied to a mesh with shape keys'). bl_info = {     "name":         "Apply modifier for object with shape keys",     "author":       "Przemysław Bągard",     "blender":      (2,6,6),     "version":      (0,1,0),     "location":     "Context menu",     "description":  "Apply modifier and remove from the stack for object with shape keys (Pushing 'Apply' button in 'Object modifiers' tab result in an error 'Modifier cannot be applied to a mesh with shape keys').",     "category":     "Object Tools > Multi Shape Keys" } import bpy, math from bpy.props import * # Algorithm: # - Duplicate active object as many times as the number of shape keys # - For each copy remove all shape keys except one # - Removing last shape does not change geometry data of object # - Apply modifier for each copy # - Join objects as shapes and restore shape keys names # - Delete all duplicated object except one # - Delete old object # - Restore name of object and object data def applyModifierForObjectWithShapeKeys(context, modifierName):     list_names = []     list = []     list_shapes = []     if context.object.data.shape_keys:         list_shapes = [o for o in context.object.data.shape_keys.key_blocks]          if(list_shapes == []):         bpy.ops.object.modifier_apply(apply_as='DATA', modifier=modifierName)         return context.scene.objects.active          list.append(context.scene.objects.active)     for i in range(1, len(list_shapes)):         bpy.ops.object.duplicate_move(OBJECT_OT_duplicate={"linked":False, "mode":'TRANSLATION'}, TRANSFORM_OT_translate={"value":(0, 0, 0), "constraint_axis":(False, False, False), "constraint_orientation":'GLOBAL', "mirror":False, "proportional":'DISABLED', "proportional_edit_falloff":'SMOOTH', "proportional_size":1, "snap":False, "snap_target":'CLOSEST', "snap_point":(0, 0, 0), "snap_align":False, "snap_normal":(0, 0, 0), "texture_space":False, "release_confirm":False})         list.append(context.scene.objects.active)     for i, o in enumerate(list):         context.scene.objects.active = o         list_names.append(o.data.shape_keys.key_blocks[i].name)         for j in range(i+1, len(list))[::-1]:             context.object.active_shape_key_index = j             bpy.ops.object.shape_key_remove()         for j in range(0, i):             context.object.active_shape_key_index = 0             bpy.ops.object.shape_key_remove()         # last deleted shape doesn't change object shape         context.object.active_shape_key_index = 0         bpy.ops.object.shape_key_remove()         # time to apply modifiers         bpy.ops.object.modifier_apply(apply_as='DATA', modifier=modifierName)          bpy.ops.object.select_all(action='DESELECT')     context.scene.objects.active = list[0]     list[0].select = True     bpy.ops.object.shape_key_add(from_mix=False)     context.scene.objects.active.data.shape_keys.key_blocks[0].name = list_names[0]     for i in range(1, len(list)):         list[i].select = True         bpy.ops.object.join_shapes()         list[i].select = False         context.scene.objects.active.data.shape_keys.key_blocks[i].name = list_names[i]          bpy.ops.object.select_all(action='DESELECT')     for o in list[1:]:         o.select = True     bpy.ops.object.delete(use_global=False)     context.scene.objects.active = list[0]     context.scene.objects.active.select = True     return context.scene.objects.active class ApplyModifierForObjectWithShapeKeysOperator(bpy.types.Operator):     bl_idname = "object.apply_modifier_for_object_with_shape_keys"     bl_label = "Apply modifier for object with shape keys"       def item_list(self, context):         return [(modifier.name, modifier.name, modifier.name) for modifier in bpy.context.scene.objects.active.modifiers]       my_enum = EnumProperty(name="Modifier name",         items = item_list)       def execute(self, context):              ob = context.scene.objects.active         bpy.ops.object.select_all(action='DESELECT')         context.scene.objects.active = ob         context.scene.objects.active.select = True         applyModifierForObjectWithShapeKeys(context, self.my_enum)                  return {'FINISHED'}       def invoke(self, context, event):         return context.window_manager.invoke_props_dialog(self)          bpy.utils.register_class(ApplyModifierForObjectWithShapeKeysOperator) class DialogPanel(bpy.types.Panel):     bl_label = "Multi Shape Keys"     bl_space_type = "VIEW_3D"     bl_region_type = "TOOLS"       def draw(self, context):         self.layout.operator("object.apply_modifier_for_object_with_shape_keys")     def menu_func(self, context):     self.layout.operator("object.apply_modifier_for_object_with_shape_keys",         text="Apply modifier for object with shape keys")   def register():    bpy.utils.register_module(__name__)   def unregister():     bpy.utils.unregister_module(__name__)   if __name__ == "__main__":     register() [/code]
you are a saint Note to any person seeing this in the future: This plugin only works on a Blender version of 2.6x (plugin was designed for 2.66 but 2.63 worked fine in my case), 2.7x and later just crashes instantly I tested this even with moving, rotating and scaling the head bone with flexes really weirdly, and the plugin still transferred shapekeys perfectly.
Thats strange, it still works fine for me on 2.79, just tested it again You can also apply your pose as a shape key, its a button on the armature modifier, then use the Blend from Shape function to blend the new shape into the Basis shape, it should apply the new vertice positions across every shape key without breaking anything
Weird, whenever I try install it on 2.78 it just screams something about an invalid operation and closes
I just installed on 2.9 and activated..But where is the button? I haven't been able to find it...
Should be under the Misc tab on the left side toolbar in the 3d viewport
Thanks Found it...It had attached at the end of my PSK-PSA import tabs!
Sorry, you need to Log In to post a reply to this thread.