Quantcast
Channel: Daz Script Developer Discussion - Daz 3D Forums
Viewing all articles
Browse latest Browse all 1036

Identifying assets in DSON files

$
0
0

I'm trying to import DSON files in my own (Python) software, but I can't figure out how asset IDs work in advanced cases.

I have a scene with two G8M figures using the same Modifier, but although the modifiers' parent is overridden to be assigned to the right NodeInstances (of both the figures), the SkinBinding it contains still references the base Node and Geometry. I'm not sure how to translate that to the NodeInstance and GeometryInstance of the figures they belong to.

To illustrate this, I copied the relevant parts of the DSON file below.

So my example scene has only two G8M figures, labeled "JOHN" and "ROBIN". In the DSON file, both of them are NodeInstances based on the Genesis8Male.dsf#Genesis8Male figure and Genesis8Male.dsf#geometry geometry. No problems there. Both figures them have a SkinBinding modifier based on Genesis8Male.dsf#SkinBinding. The parent values (Genesis8Male.dsf#geometry by default) are overridden to #geometry (for John) and #geometry-1 (for Robin). Thats where my question starts.

In both cases, the inherited skin binding modifier still references the #Genesis8Male node and the #geometry geometry from the Genesis8Male.dsf file. These URLS are not overridden in the example.duf file. So how would I use those Uris to reference the NodeInstance and Geometry of "John" and "Robin"? 

Relevant parts from my example.duf file:

{
    "asset_info": {
        "id": "/C%3A/Example.duf"
    },
    "scene": {
        "nodes": [
            {
                "id": "Genesis8Male",
                "url": "/data/DAZ%203D/Genesis%208/Male/Genesis8Male.dsf#Genesis8Male",
                "name": "Genesis8Male",
                "label": "JOHN",
                "geometries": [
                    {
                        "id": "geometry",
                        "url": "/data/DAZ%203D/Genesis%208/Male/Genesis8Male.dsf#geometry",
                        "name": "Genesis8Male"
                    }
                ]
            },
            {
                "id": "Genesis8Male-1",
                "url": "/data/DAZ%203D/Genesis%208/Male/Genesis8Male.dsf#Genesis8Male",
                "name": "Genesis8Male",
                "label": "ROBIN",
                "geometries": [
                    {
                        "id": "geometry-1",
                        "url": "/data/DAZ%203D/Genesis%208/Male/Genesis8Male.dsf#geometry",
                        "name": "Genesis8Male"
                    }
                ]
            }  
        ],
        "modifiers": [
            {
                "id": "SkinBinding",
                "url": "/data/DAZ%203D/Genesis%208/Male/Genesis8Male.dsf#SkinBinding",
                "parent": "#geometry"    (--> Overrides the parent from the referenced file)
            },
            {
                "id": "SkinBinding-1",
                "url": "/data/DAZ%203D/Genesis%208/Male/Genesis8Male.dsf#SkinBinding",
                "parent": "#geometry-1"  (--> Overrides the parent from the referenced file)
            }
        ]
    }
}

Relevant parts from the Genesis8Male.dsf file:

{
    "asset_info": {
        "id": "/data/DAZ%203D/Genesis%208/Male/Genesis8Male.dsf"
    },
    "geometry_library": [
        {
            "id": "geometry",
            "name": "geometry"
        }
    ],
    "node_library": [
        {
            "id": "Genesis8Male",
            "name": "Genesis8Male",
            "type": "figure",
            "label": "Genesis 8 Male"
        }
    ],
    "modifier_library": [
        {
            "id": "SkinBinding",
            "name": "SkinBinding",
            "parent": "#geometry",  (--> Overriden in the example file, see above)
            "skin": {
                "node": "#Genesis8Male",  (--> NOT overridden. How to interpret this to link to Johns/Robins figure?)
                "geometry": "#geometry",  (--> NOT overridden. How to interpret this to link to Johns/Robins geometry?)
                "joints": [
                    {
                        "id": "lIndex3",
                        "node": "#lIndex3" (--> NOT overridden. How to look in Johns / Robins armature?)
                    },
                ]
            }
        }
    ]
}

 


Viewing all articles
Browse latest Browse all 1036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>