Upliner / CharMorph

Other
305 stars 14 forks source link

Duplicate Drivers are written when exporting from a finalized mesh #27

Open Hopefullyidontgetbanned opened 2 months ago

Hopefullyidontgetbanned commented 2 months ago

Example of Duplication

       {
            "data_path": "key_blocks[\"Exp_Look_Out_Left\"].value",
            "array_index": 0,
            "driver": {
                "expression": "var * 10",
                "type": "SCRIPTED",
                "use_self": false,
                "variables": {
                    "var": {
                        "type": "TRANSFORMS",
                        "targets": [
                            {
                                "context_property": "ACTIVE_SCENE",
                                "bone_target": "eye_common",
                                "data_path": "",
                                "rotation_mode": "AUTO",
                                "transform_space": "LOCAL_SPACE",
                                "transform_type": "LOC_X",
                                "cm_id": "rig"
                            }
                        ]
                    },
                    "var_001": {
                        "type": "TRANSFORMS",
                        "targets": [
                            {
                                "context_property": "ACTIVE_SCENE",
                                "bone_target": "eye_common",
                                "data_path": "",
                                "rotation_mode": "AUTO",
                                "transform_space": "LOCAL_SPACE",
                                "transform_type": "LOC_X",
                                "cm_id": "rig"
                            }
                        ]
                    },
                    "var_002": {
                        "type": "TRANSFORMS",
                        "targets": [
                            {
                                "context_property": "ACTIVE_SCENE",
                                "bone_target": "eye_common",
                                "data_path": "",
                                "rotation_mode": "AUTO",
                                "transform_space": "LOCAL_SPACE",
                                "transform_type": "LOC_X",
                                "cm_id": "rig"
                            }
                        ]
                    },
                    "var_003": {
                        "type": "TRANSFORMS",
                        "targets": [
                            {
                                "context_property": "ACTIVE_SCENE",
                                "bone_target": "eye_common",
                                "data_path": "",
                                "rotation_mode": "AUTO",
                                "transform_space": "LOCAL_SPACE",
                                "transform_type": "LOC_X",
                                "cm_id": "rig"
                            }
                        ]
                    },
                    "var_004": {
                        "type": "TRANSFORMS",
                        "targets": [
                            {
                                "context_property": "ACTIVE_SCENE",
                                "bone_target": "eye_common",
                                "data_path": "",
                                "rotation_mode": "AUTO",
                                "transform_space": "LOCAL_SPACE",
                                "transform_type": "LOC_X",
                                "cm_id": "rig"
                            }
                        ]
                    }
                }
            }
        },

var_001 to var_004 are all duplicates from exporting from a finalized mesh that already contains the driver. Fixing this should include preventing duplication and not parsing duplicate variable, the intention is to make iteration easier without needing to edit JSON files.