KhronosGroup / glTF-InteractivityGraph-AuthoringTool

A React based DCC for viewing and authoring KHR_interactivity models
17 stars 3 forks source link

Bug: Can't access material data from graph #14

Closed hybridherbst closed 2 months ago

hybridherbst commented 2 months ago

The attached graph should log properties from this file: NumberCube.glb.zip

However, it seems that the current object model implementation doesn't allow that.

I think this should log "true":

{
    "nodes": [
        {
            "type": "pointer/get",
            "values": [
                {
                    "id": "index",
                    "value": [
                        0
                    ],
                    "type": 1
                }
            ],
            "configuration": [
                {
                    "id": "pointer",
                    "value": "/materials/{index}/pbrMetallicRoughness/baseColorTexture/roughnessFactor"
                }
            ],
            "flows": [],
            "metadata": {
                "positionX": "-154.47124486147774",
                "positionY": "-26.220415398461967"
            }
        },
        {
            "type": "event/onStart",
            "values": [],
            "configuration": [],
            "flows": [
                {
                    "id": "out",
                    "node": 2,
                    "socket": "in"
                }
            ],
            "metadata": {
                "positionX": "-94.89628386319015",
                "positionY": "271.5350759522238"
            }
        },
        {
            "type": "ADBE/output_console_node",
            "values": [
                {
                    "id": "message",
                    "value": "test",
                    "type": 7
                },
                {
                    "id": "message",
                    "node": 0,
                    "socket": "isValid"
                }
            ],
            "configuration": [],
            "flows": [],
            "metadata": {
                "positionX": "167.30903414128312",
                "positionY": "87.43284858677544"
            }
        }
    ],
    "variables": [],
    "customEvents": [],
    "types": [
        {
            "signature": "bool"
        },
        {
            "signature": "int"
        },
        {
            "signature": "float"
        },
        {
            "signature": "float2"
        },
        {
            "signature": "float3"
        },
        {
            "signature": "float4"
        },
        {
            "signature": "float4x4"
        },
        {
            "signature": "custom",
            "extensions": {
                "AMZN_interactivity_string": {}
            }
        }
    ]
}
mattmacf98 commented 2 months ago

I have added materials into the KHR_interactivity world references to access the materials properties of the model alongside most of the core materials pointers which I could find Babylon js mappings for. One thing I did notice is that your pointer is also incorrect /materials/{index}/pbrMetallicRoughness/baseColorTexture/roughnessFactor -> /materials/{index}/pbrMetallicRoughness/roughnessFactor

mat_roughness_interactive.glb.zip

https://github.com/user-attachments/assets/aebd0df7-4ca2-4002-b349-f5e8d0544464

hybridherbst commented 2 months ago

Thank you! Would you mind adding KHR_texture_transform as well? That's what I was originally trying (and thus the pointer error here)

mattmacf98 commented 2 months ago

just added them