KhronosGroup / glTF-Blender-IO

Blender glTF 2.0 importer and exporter
https://docs.blender.org/manual/en/latest/addons/import_export/scene_gltf2.html
Apache License 2.0
1.45k stars 306 forks source link

In gltf2_blender_gather_fcurves_channels/needs_baking - Add the offending node name to warning #2266

Open ronh991 opened 3 weeks ago

ronh991 commented 3 weeks ago

Is your feature request related to a problem? Please describe. users will use a incorrect animation interpolation - there is a warning, however no indication of what the offending node is.

Describe the solution you'd like add a node.name or an identifier the user can use to find the bad object and fix it. Provide name on all warnings like this

Describe alternatives you've considered modded the py file

def __gather_target(obj_uuid: str,
                    channel_group: typing.Tuple[bpy.types.FCurve],
                    bone: typing.Optional[str],
                    export_settings
                    ) -> gltf2_io.AnimationChannelTarget:

other code

    if export_settings['vtree'].nodes[obj_uuid].blender_object.type == "ARMATURE":
        animation_target = get_object_from_datapath(
            export_settings['vtree'].nodes[obj_uuid].blender_object, [
                c for c in channels if c is not None][0].data_path)
        if isinstance(animation_target, bpy.types.PoseBone):
            if len(animation_target.constraints) != 0:
                # Constraints such as IK act on the bone -> can not be represented in glTF atm
                export_settings['log'].warning("Baking animation because of unsupported constraints acting on the bone: ")
                print ("bad animation", obj.name)
                return True

Additional context without name, I get this as a warning

13:14:57 | WARNING: Baking animation because there are keyframes with different interpolation methods in one channel
13:14:58 | WARNING: Baking animation because of unsupported constraints acting on the bone:
13:14:58 | WARNING: Baking animation because of unsupported constraints acting on the bone:
13:14:58 | WARNING: Baking animation because of unsupported constraints acting on the bone:
13:14:58 | WARNING: Baking animation because of unsupported constraints acting on the bone:

with a name

13:14:57 | WARNING: Baking animation because there are keyframes with different interpolation methods in one channel
13:14:58 | WARNING: Baking animation because of unsupported constraints acting on the bone:
bad animation Cabel_top_L
13:14:58 | WARNING: Baking animation because of unsupported constraints acting on the bone:
bad animation Cabel_top_L
13:14:58 | WARNING: Baking animation because of unsupported constraints acting on the bone:
bad animation Cabel_top_R
13:14:58 | WARNING: Baking animation because of unsupported constraints acting on the bone:
bad animation Cabel_top_R