shteeve3d / blender-wiggle-2

Rewrite of blender-wiggle with new features and physics
GNU General Public License v3.0
681 stars 35 forks source link

Copy Broken in 4.2 #69

Open KaijuKoder opened 2 months ago

KaijuKoder commented 2 months ago

When I hit [Select Enabled] and [Copy Settings to Selected] in 4.2 it doesn't copy and this appears on the console:

Traceback (most recent call last):
  File "C:\Users\guest\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\wiggle_2.py", line 1102, in <lambda>
    update=lambda s, c: update_prop(s, c, 'wiggle_wind_ob')
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\guest\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\wiggle_2.py", line 80, in update_prop
    b[prop] = self[prop]
    ~^^^^^^
TypeError: Cannot assign a 'NoneType' value to the existing 'wiggle_wind_ob' Group IDProperty
File "C:\Users\guest\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\wiggle_2.py", line 1102, in <lambda>
Traceback (most recent call last):
  File "C:\Users\guest\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\wiggle_2.py", line 1198, in <lambda>
    update=lambda s, c: update_prop(s, c, 'wiggle_collider')
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\guest\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\wiggle_2.py", line 80, in update_prop
    b[prop] = self[prop]
    ~^^^^^^
TypeError: Cannot assign a 'NoneType' value to the existing 'wiggle_collider' Group IDProperty
File "C:\Users\guest\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\wiggle_2.py", line 1198, in <lambda>
Traceback (most recent call last):
  File "C:\Users\guest\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\wiggle_2.py", line 1205, in <lambda>
    update=lambda s, c: update_prop(s, c, 'wiggle_collider_collection')
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\guest\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\wiggle_2.py", line 80, in update_prop
    b[prop] = self[prop]
    ~^^^^^^
TypeError: Cannot assign a 'Collection' value to the existing 'wiggle_collider_collection' Group IDProperty
File "C:\Users\guest\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\wiggle_2.py", line 1205, in <lambda>
Traceback (most recent call last):
  File "C:\Users\guest\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\wiggle_2.py", line 1167, in <lambda>
    update=lambda s, c: update_prop(s, c, 'wiggle_wind_ob_head')
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\guest\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\wiggle_2.py", line 80, in update_prop
    b[prop] = self[prop]
    ~^^^^^^
TypeError: Cannot assign a 'NoneType' value to the existing 'wiggle_wind_ob_head' Group IDProperty
File "C:\Users\guest\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\wiggle_2.py", line 1167, in <lambda>
Traceback (most recent call last):
  File "C:\Users\guest\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\wiggle_2.py", line 1258, in <lambda>
    update=lambda s, c: update_prop(s, c, 'wiggle_collider_head')
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\guest\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\wiggle_2.py", line 80, in update_prop
    b[prop] = self[prop]
    ~^^^^^^
TypeError: Cannot assign a 'NoneType' value to the existing 'wiggle_collider_head' Group IDProperty
File "C:\Users\guest\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\wiggle_2.py", line 1258, in <lambda>
Traceback (most recent call last):
  File "C:\Users\guest\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\wiggle_2.py", line 1265, in <lambda>
    update=lambda s, c: update_prop(s, c, 'wiggle_collider_collection_head')
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\guest\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\wiggle_2.py", line 80, in update_prop
    b[prop] = self[prop]
    ~^^^^^^
TypeError: Cannot assign a 'NoneType' value to the existing 'wiggle_collider_collection_head' Group IDProperty
File "C:\Users\guest\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\wiggle_2.py", line 1265, in <lambda>

4.1 works fine, with the very same wiggle_2.py code.

Couldn't fix myself. Your WiggleCopy.copy() code seems to be copying the active bone onto itself, yet in 4.1 it works, so I must be missing someting?

class WiggleCopy(bpy.types.Operator):
    """Copy active wiggle settings to selected bones"""
    bl_idname = "wiggle.copy"
    bl_label = "Copy Settings to Selected"

    @classmethod
    def poll(cls,context):
        return context.mode in ['POSE'] and context.active_pose_bone and (len(context.selected_pose_bones)>1)

    def execute(self,context):
        b = context.active_pose_bone
#        b.wiggle_enable = b.wiggle_enable
        b.wiggle_mute = b.wiggle_mute
        b.wiggle_head = b.wiggle_head
        b.wiggle_tail = b.wiggle_tail
        b.wiggle_head_mute = b.wiggle_head_mute
Ruuubickk commented 2 weeks ago

Pretty annoying, but an easy way to get around this for now is to hold Alt when changing a value/selecting something and that will apply to all selected.