animate1978 / MB-Lab

MB-Lab is a character creation tool for Blender 4.0 and above, based off ManuelBastioniLAB
Other
1.85k stars 314 forks source link

Cannot Finalize Character #305

Closed WoniJack closed 3 years ago

WoniJack commented 3 years ago

When clicking on Finalize Character button, get error below and does not finalize. Seems similar to bug #302 and #297. Using latest versions of Blender 2.9.1 and MB-Lab 1.7.8.42 Screenshot 2020-10-22 161751

To Reproduce Steps to reproduce the behavior:

  1. Open Blender New File
  2. Click on 'MB-Lab Tab'
  3. Select 'Caucasian male (M_CA01) (AGPL3)' from pull down
  4. Leave defaults selected
  5. Click 'Create Character' button
  6. Select 'Finalize Tools'
  7. Leave defaults selected
  8. Click 'Finalize with textures and backup' button
  9. Get the following below and does not finalize...

Screenshot 2020-10-22 161751 Expected behavior Expected character to be finalized for use.

Additional context Windows 10, Blender 2.9.1, MB-Lab 1.7.8.42 I have tried reinstalling Blender, reinstalling MB-Lab but still get error.

Logs

Traceback (most recent call last): File "C:\Users\jeffl\AppData\Roaming\Blender Foundation\Blender\2.90\scripts\addons\MB-Lab-master__init.py", line 1703, in execute mblab_humanoid.set_rest_pose() File "C:\Users\jeffl\AppData\Roaming\Blender Foundation\Blender\2.90\scripts\addons\MB-Lab-master\humanoid.py", line 1266, in set_rest_pose self.sk_engine.apply_armature_modifier() File "C:\Users\jeffl\AppData\Roaming\Blender Foundation\Blender\2.90\scripts\addons\MB-Lab-master\skeletonengine.py", line 119, in apply_armature_modifier algorithms.apply_modifier(obj, armature_modifier) File "C:\Users\jeffl\AppData\Roaming\Blender Foundation\Blender\2.90\scripts\addons\MB-Lab-master\algorithms.py", line 1069, in apply_modifier bpy.ops.object.modifier_apply(apply_as='DATA', modifier=modifier_name) File "C:\Program Files\Blender Foundation\Blender 2.90\2.90\scripts\modules\bpy\ops.py", line 201, in call__ ret = op_call(self.idname_py(), None, kw) TypeError: Converting py args to operator properties: : keyword "apply_as" unrecognized location: :-1 location: :-1

BennyBelanger commented 3 years ago

Looks like a duplicate of bug #297 Check the thread for answers

Here is how I fixed it for now in 2.9

The method in question bpy.ops.object.modifier_apply(apply_as='DATA', modifier=modifier_name) No longer exists in Blender 2.9. It is now bpy.ops.object.modifier_apply(modifier=modifier_name) ShapeKey also has it's own method.

You can fix this locally by editing your algorithms.py file to use the new modifier_apply method until it is officially fixed and merged to support 2.9. Your file is located here C:\Users\jeffl\AppData\Roaming\Blender Foundation\Blender\2.90\scripts\addons\MB-Lab-master\algorithms.py. You will need to restart blender after the edit.

The my new method; looks like this.

def apply_modifier(obj, modifier): modifier_name = get_modifier_name(modifier) if modifier_name in obj.modifiers: set_active_object(obj) try: bpy.ops.object.modifier_apply(modifier=modifier_name) except AttributeError: logger.warning("Problems in applying %s. Is the modifier disabled?", modifier_name)

WoniJack commented 3 years ago

Thank you, this seems to work!

From: pupnsuds notifications@github.com Sent: Thursday, October 22, 2020 9:48 PM To: animate1978/MB-Lab MB-Lab@noreply.github.com Cc: WoniJack jeff.l.mckinney@roadrunner.com; Author author@noreply.github.com Subject: Re: [animate1978/MB-Lab] Cannot Finalize Character (#305)

The method in question bpy.ops.object.modifier_apply(apply_as='DATA', modifier=modifier_name) No longer exists in Blender 2.9. It is now bpy.ops.object.modifier_apply(modifier=modifier_name) ShapeKey also has it's own method.

You can fix this locally by editing your algorithms.py file to use the new modifier_apply method until it is officially fixed and merged to support 2.9. Your file is located here C:\Users\jeffl\AppData\Roaming\Blender Foundation\Blender\2.90\scripts\addons\MB-Lab-master\algorithms.py. You will need to restart blender after the edit.

The my new method; looks like this.

def apply_modifier(obj, modifier): modifier_name = get_modifier_name(modifier) if modifier_name in obj.modifiers: set_active_object(obj) try: bpy.ops.object.modifier_apply(modifier=modifier_name) except AttributeError: logger.warning("Problems in applying %s. Is the modifier disabled?", modifier_name)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/animate1978/MB-Lab/issues/305#issuecomment-714855848 , or unsubscribe https://github.com/notifications/unsubscribe-auth/ARPKWXTTHVMBV6EVYRWJMJ3SMDOEJANCNFSM4S3WAOKA .

-- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus

Starkium commented 3 years ago

You're my hero

Little-Wolfie commented 3 years ago

Looks like a duplicate of bug #297 Check the thread for answers

Here is how I fixed it for now in 2.9

The method in question bpy.ops.object.modifier_apply(apply_as='DATA', modifier=modifier_name) No longer exists in Blender 2.9. It is now bpy.ops.object.modifier_apply(modifier=modifier_name) ShapeKey also has it's own method.

You can fix this locally by editing your algorithms.py file to use the new modifier_apply method until it is officially fixed and merged to support 2.9. Your file is located here C:\Users\jeffl\AppData\Roaming\Blender Foundation\Blender\2.90\scripts\addons\MB-Lab-master\algorithms.py. You will need to restart blender after the edit.

The my new method; looks like this.

def apply_modifier(obj, modifier): modifier_name = get_modifier_name(modifier) if modifier_name in obj.modifiers: set_active_object(obj) try: bpy.ops.object.modifier_apply(modifier=modifier_name) except AttributeError: logger.warning("Problems in applying %s. Is the modifier disabled?", modifier_name)

Thanks you so much

animate1978 commented 3 years ago

The recent pull requests to 'master' should resolve this issue