Announcement

Collapse
No announcement yet.

Read asset metadata from different DCC software

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Read asset metadata from different DCC software

    Hi everyone!
    I'm slowly digging into some sort of pipeline tools and I'd like to retrive some metadata from my assets.
    The source FBX files can come from different software (3dsmax, maya or blender): store data inside the fbx is not a problem at all but issues arise when reading them in unreal.
    As documented, metadata from 3dsmax come in a single string containing all custo properties that we can read accessing the tag FBX.UDP3DSMAX.
    The other 2 sw instead have the same behaviour, so they both produce nice and clean FBX.myTag1, FBX.myTag2, ...
    This means that without 3dsmax in the field I could ignore (as wished) the source software and look everytime for the same tags...
    But 3dsmax is there...
    Could any of you advice me with some workaround? It seems quite stupid to me to code two different pipelines...

    Many thanks in advance!
    Berna
    Last edited by berna; 10-23-2018, 10:33 AM.

    #2
    I've set up this rough script
    It works... but not very elegant I suppose

    Code:
    import unreal as ue
    import re
    
    @ue.uclass()
    class EditorUtility(ue.GlobalEditorUtilityBase):
        pass
    
    def GetAssetProperty (asset,tag):
    
        all3dsmaxProperties = ue.EditorAssetLibrary.get_metadata_tag(asset, "FBX.UDP3DSMAX")
        if not all3dsmaxProperties is "":
            splittedProperties = re.split(" = |\\r\\n",all3dsmaxProperties)
            if tag in splittedProperties:
                return splittedProperties[(splittedProperties.index(tag)) + 1]
        else:
            return ue.EditorAssetLibrary.get_metadata_tag(asset, "FBX."+tag)
    
    
    editorUtility = EditorUtility()
    asset = (editorUtility.get_selected_assets())[0]
    
    print GetAssetProperty(asset,"artist")

    Comment

    Working...
    X