Upliner / CharMorph

Other
305 stars 14 forks source link

Non User Expressed Drivers are exported #28

Open Hopefullyidontgetbanned opened 2 months ago

Hopefullyidontgetbanned commented 2 months ago

Only user-expressed drivers should be exported, however things such as Rigify's own drivers will be exported alongside any user expressed ones such as Shape Key Drivers. This inflates the file size and makes finalization take much longer. Example:

{
            "data_path": "pose.bones[\"MCH-foot_ik.parent.R\"].constraints[\"SWITCH_PARENT\"].targets[1].weight",
            "array_index": 0,
            "driver": {
                "expression": "var == 2",
                "type": "SCRIPTED",
                "use_self": false,
                "variables": {
                    "var": {
                        "type": "SINGLE_PROP",
                        "targets": [
                            {
                                "context_property": "ACTIVE_SCENE",
                                "bone_target": "",
                                "data_path": "pose.bones[\"thigh_parent.R\"][\"IK_parent\"]",
                                "rotation_mode": "AUTO",
                                "transform_space": "WORLD_SPACE",
                                "transform_type": "LOC_X",
                                "cm_id": "rig"
                            }
                        ]
                    }
                }
            }
        },

Expressing these drivers is unnecessary as Rigify will handle them.

Upliner commented 1 month ago

Still not sure how to filter out Rigify drivers...

Hopefullyidontgetbanned commented 1 month ago

Still not sure how to filter out Rigify drivers...

what about using the data path to filter it out.

ex. "data_path": "key_blocks[\"Exp_Eyebrows_InnerBrow_Lower_Left\"].value is one for the shape keys whilst "data_path": "pose.bones[\"thigh_parent.R\"][\"IK_parent\"]" is not, this issue doesn't matter as much #27 since there isn't many drivers Rigify generates by default but when there are 150 or so shape keys with 4 duplicates that creates a problem. Call this low priority, Still exists.