Thanks for porting BlenderRhubarb to work under the new poselib-less system. I was about to do this myself, and lo and behold, you've already done it, and with improved usablity.
However I've found a problem. When the rig is Appended from the Asset Library, it works, but when it is linked-and-overriden (Linked from the Asset Library, then Make Override) it only gets as far as 'Initialize mapping list'. When I hit that button, I get this error message:
Traceback (most recent call last):
File "C:\Users\guest\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\rhubarb_lipsync\blender\mapping_operators.py", line 36, in execute
mprops.build_items(context.active_object)
File "C:\Users\guest\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\rhubarb_lipsync\blender\mapping_properties.py", line 112, in build_items
item: MappingItem = self.items.add()
TypeError: bpy_prop_collection.add(): not supported for this collection
Error: Python: Traceback (most recent call last):
File "C:\Users\guest\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\rhubarb_lipsync\blender\mapping_operators.py", line 36, in execute
mprops.build_items(context.active_object)
File "C:\Users\guest\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\rhubarb_lipsync\blender\mapping_properties.py", line 112, in build_items
item: MappingItem = self.items.add()
TypeError: bpy_prop_collection.add(): not supported for this collection
Here's the mapping_properties.py
code in question, error line marked:
def build_items(self, obj: bpy.types.Object) -> None:
# log.trace("Already buil") # type: ignore
if len(self.items) > 0:
return # Already built (assume)
log.trace("Building mapping list") # type: ignore
t1: NlaTrackRef = self.nla_track1
t2: NlaTrackRef = self.nla_track2
t1.object = obj
t2.object = obj
for msi in MouthShapeInfos.all():
item: MappingItem = self.items.add() # <----- ERROR HERE
item.key = msi.key
I used old-Blender-Rhubarb with linked-overriden rigs since 2.8 without any problems.
If you haven't used linked-overriden rigs before:
- Create a rig 'myrig' in a file mylib.blend
- Create a new .blend file, then File -> Link -> mylib.blend -> Objects -> myrig -> Link Button.
- Select myrig in outliner. Then right-click -> Library Override -> Make -> Selected
- myrig should now work like a normal rig.
Searched around, and the problem seems to be this:
"Library Override: can't add to Collection properties #82118" https://projects.blender.org/blender/blender/issues/82118
This seemed to fix it:
class MappingProperties(PropertyGroup):
"""Mapping of all the mouth shape types to action(s)"""
items: CollectionProperty(type=MappingItem, name="Mapping items",
options={'LIBRARY_EDITABLE'},
override={'LIBRARY_OVERRIDABLE', 'USE_INSERTION'})
...
However found all the other properties in the 'RLPS: Cue Making and Baking' were greyed out.
Found adding this to all the other properties - there are many - fixed it:
,
options={'LIBRARY_EDITABLE'},
override={'LIBRARY_OVERRIDABLE'}
After this, it seems to be working. Couldn't find any documentation on USE_INSERTION (Not alone! https://blender.stackexchange.com/questions/254730/what-is-the-safe-way-to-add-library-overridable-custom-properties ) but I assume it's something collection specific so not needed for the other properties?
Granted, making Addon authors add those lines after every Property seems a silly requirement which will break many addons,
but could you please do that for Rhubarb NG so they at least work with it? I've attached the two files I modded (file extension renamed so Github is happy). Seems to work though you might prefer to make the changes yourself in case I accidentally broke something.
mapping_properties.py.txt
strip_placement_properties.py.txt
Thanks for your effort.