Scene Converter

Scene Converter

The Scene Converter is a command-line tool.

Usage

scene_converter <param 1> <param 2> ...

Example:

scene_converter.exe -c scene_config.xml -lv -a "fbxName=original/%1.fbx" -a "outPath=converted/" -a "imageNormal=default/default_normal.png" -a "imageSpecular=default/default_specular.png"</c>

Description

  • --config or -c, optional, multiple : XML configuration file name
  • --attribute or -a, optional, multiple : Attribute assignment for use in XML file (attribute="{}")
  • --analyze or -z, optional : Scene file name to analyze. Mutually exclusive with --config.
  • --quiet or -q, optional, switch : Suppress information printing
  • --debug or -d, optional, switch : Print debug information
  • --launch_viewer or -lv, optional, switch : Launch scene_viewer after successful conversion

XML configuration file

The configuration file is a standard XML file and should start with:

  • <?xml version="1.0" encoding="utf-8"?>

Valid XML Tags:

  • <SceneConverter> An XML scene converter file is recognized by its <SceneConverter> root element.
    Attributes and child tags:
    • pathName String,
    • <InputPackage> Input package description and properties.
      Attributes and child tags:
      • fileName String,
    • <InputProperties> Input properties description and properties.
      Attributes and child tags:
      • id String,
      • <ImageLocation> ImageLocation.
        Attributes and child tags:
        • pathName String,
      • <Material> Material replacement.
        Attributes and child tags:
        • createWithId String,
        • createWithGraphNodeId String,
        • createWithSlot SInt32,
        • findIdMatchingPattern String,
        • replaceWithGraphNodeId String,
        • replaceWithSlot SInt32,
        • replaceWithMaterialSlot SInt32,
        • replaceWithTextureSlot SInt32,
        • replaceWithParametersSlot SInt32,
        • replaceWithShaderResourceIdPattern String,
        • ignore Bool, default NO
        • ambientColor Color,
        • diffuseColor Color,
        • specularColor Color,
        • emissiveColor Color,
        • shininess Double,
        • bumpScale Real, default 0.0
        • blendMode Murl::IEnums::BlendMode,
        • lightingEnabled Bool, default NO
        • coloringEnabled Bool, default YES
        • canBeMerged Bool, default YES
        • replaceWithVertexShaderResourceIdPattern String,
        • replaceWithFragmentShaderResourceIdPattern String,
        • <Texture> Texture.
          Attributes and child tags:
      • <Texture> Texture.
        Attributes and child tags:
        (see above)
      • <Clip> Clip description and properties.
        Attributes and child tags:
        • createWithId String,
        • findIdMatchingPattern String,
        • replaceWithId String,
        • duration Double,
        • <Skeleton> Skeleton description and properties.
          Attributes and child tags:
          • sourceSkeletonId String,
          • sourceClipId String,
          • sourcePoseId String,
          • destinationPoseId String,
          • <Constraint> Constraint description and properties.
            Attributes and child tags:
            • nodeId String,
            • minX Double,
            • maxX Double,
            • minY Double,
            • maxY Double,
            • minZ Double,
            • maxZ Double,
        • <MorphTarget> MorphTarget description and properties.
          Attributes and child tags:
          • sourceMorphTargetId String,
          • keyFrameFileName String,
          • keyFrameFilePath String,
      • <Node> Node description and properties.
        Attributes and child tags:
        • createWithId String,
        • findIdMatchingPattern String,
        • responseGroups MurlMaskUInt32,
        • flatten Bool, default NO
        • rotateX Angle,
        • rotateY Angle,
        • rotateZ Angle,
        • translateX Double,
        • translateY Double,
        • translateZ Double,
        • indexType Murl::IEnums::IndexType,
      • <Mesh> Mesh description and properties.
        Attributes and child tags:
        • findIdMatchingPattern String,
        • findMaterialIdMatchingPattern String,
        • replaceWithId String,
        • ignore Bool, default NO
        • translateU Double, default 0.0
        • translateV Double, default 0.0
        • scaleU Double, default 1.0
        • scaleV Double, default 1.0
    • <InputImage> Input image description and properties.
      Attributes and child tags:
    • <InputScene> Input scene description and properties.
      Attributes and child tags:
      • id String,
      • fileName String,
      • pathName String,
      • maxVertexCount SInt32,
      • maxIndexCount SInt32,
      • optimizeGraph Bool,
      • splitVertices Bool,
      • maxBoneCount SInt32,
      • maxBoneWeights SInt32,
      • normalSmoothLimit Angle,
      • tangentSmoothLimit Angle,
      • translateX Double,
      • translateY Double,
      • translateZ Double,
      • rotateX Angle,
      • rotateY Angle,
      • rotateZ Angle,
      • colorAction Murl::IEnums::ComponentActionSceneConverter, default DEFAULT
      • normalAction Murl::IEnums::ComponentActionSceneConverter, default DEFAULT
      • tangentAction Murl::IEnums::ComponentActionSceneConverter, default DEFAULT
      • boneWeightAction Murl::IEnums::ComponentActionSceneConverter, default DEFAULT
      • texCoordAction0 Murl::IEnums::ComponentActionSceneConverter, default DEFAULT
      • texCoordModuloX0 Double, default 0.0
      • texCoordModuloY0 Double, default 0.0
      • texCoordAction1 Murl::IEnums::ComponentActionSceneConverter, default DEFAULT
      • texCoordModuloX1 Double, default 0.0
      • texCoordModuloY1 Double, default 0.0
      • texCoordAction2 Murl::IEnums::ComponentActionSceneConverter, default DEFAULT
      • texCoordModuloX2 Double, default 0.0
      • texCoordModuloY2 Double, default 0.0
      • texCoordAction3 Murl::IEnums::ComponentActionSceneConverter, default DEFAULT
      • texCoordModuloX3 Double, default 0.0
      • texCoordModuloY3 Double, default 0.0
      • texCoordAction4 Murl::IEnums::ComponentActionSceneConverter, default DEFAULT
      • texCoordModuloX4 Double, default 0.0
      • texCoordModuloY4 Double, default 0.0
      • texCoordAction5 Murl::IEnums::ComponentActionSceneConverter, default DEFAULT
      • texCoordModuloX5 Double, default 0.0
      • texCoordModuloY5 Double, default 0.0
      • texCoordAction6 Murl::IEnums::ComponentActionSceneConverter, default DEFAULT
      • texCoordModuloX6 Double, default 0.0
      • texCoordModuloY6 Double, default 0.0
      • texCoordAction7 Murl::IEnums::ComponentActionSceneConverter, default DEFAULT
      • texCoordModuloX7 Double, default 0.0
      • texCoordModuloY7 Double, default 0.0
      • scale Double,
      • scaleX Double,
      • scaleY Double,
      • scaleZ Double,
      • <ImageLocation> ImageLocation.
        Attributes and child tags:
        (see above)
      • <Material> Material replacement.
        Attributes and child tags:
        (see above)
        • <Texture> Texture.
          Attributes and child tags:
          (see above)
      • <Texture> Texture.
        Attributes and child tags:
        (see above)
      • <Clip> Clip description and properties.
        Attributes and child tags:
        (see above)
        • <Skeleton> Skeleton description and properties.
          Attributes and child tags:
          (see above)
          • <Constraint> Constraint description and properties.
            Attributes and child tags:
            (see above)
        • <MorphTarget> MorphTarget description and properties.
          Attributes and child tags:
          (see above)
      • <Node> Node description and properties.
        Attributes and child tags:
        (see above)
      • <Mesh> Mesh description and properties.
        Attributes and child tags:
        (see above)
      • <SkeletonSplit> SkeletonSplit description and properties.
        Attributes and child tags:
        • boneId String,
      • <Properties> Properties description and properties.
        Attributes and child tags:
        • sourcePropertiesId String,
    • <InputPose> Input pose description and properties.
      Attributes and child tags:
      • id String,
      • fileName String,
      • pathName String,
      • maxVertexCount SInt32,
      • maxIndexCount SInt32,
      • <Node> Node description and properties.
        Attributes and child tags:
        (see above)
      • <Mesh> Mesh description and properties.
        Attributes and child tags:
        (see above)
      • <Properties> Properties description and properties.
        Attributes and child tags:
        (see above)
    • <InputSkeleton> Input skeleton description and properties.
      Attributes and child tags:
      • id String,
      • fileName String,
      • pathName String,
      • maxVertexCount SInt32,
      • maxIndexCount SInt32,
      • <Node> Node description and properties.
        Attributes and child tags:
        (see above)
      • <Mesh> Mesh description and properties.
        Attributes and child tags:
        (see above)
      • <Properties> Properties description and properties.
        Attributes and child tags:
        (see above)
    • <InputMorphTarget> Input morph target description and properties.
      Attributes and child tags:
      • id String,
      • fileName String,
      • pathName String,
      • maxVertexCount SInt32,
      • maxIndexCount SInt32,
      • colorAction Murl::IEnums::ComponentActionSceneConverter, default DEFAULT
      • normalAction Murl::IEnums::ComponentActionSceneConverter, default DEFAULT
      • tangentAction Murl::IEnums::ComponentActionSceneConverter, default DEFAULT
      • boneWeightAction Murl::IEnums::ComponentActionSceneConverter, default DEFAULT
      • texCoordAction0 Murl::IEnums::ComponentActionSceneConverter, default DEFAULT
      • texCoordAction1 Murl::IEnums::ComponentActionSceneConverter, default DEFAULT
      • texCoordAction2 Murl::IEnums::ComponentActionSceneConverter, default DEFAULT
      • texCoordAction3 Murl::IEnums::ComponentActionSceneConverter, default DEFAULT
      • texCoordAction4 Murl::IEnums::ComponentActionSceneConverter, default DEFAULT
      • texCoordAction5 Murl::IEnums::ComponentActionSceneConverter, default DEFAULT
      • texCoordAction6 Murl::IEnums::ComponentActionSceneConverter, default DEFAULT
      • texCoordAction7 Murl::IEnums::ComponentActionSceneConverter, default DEFAULT
      • <Node> Node description and properties.
        Attributes and child tags:
        (see above)
      • <Mesh> Mesh description and properties.
        Attributes and child tags:
        (see above)
      • <Properties> Properties description and properties.
        Attributes and child tags:
        (see above)
    • <OutputPackage> Output package description and properties.
      Attributes and child tags:
      • fileName String,
      • packageId String,
      • staticInstanceParentId String,
      • createStaticInstance Bool, default YES
      • createFolders Bool, default NO
      • removeUnused Bool, default NO
      • <GraphInstance> Graph Instance description and porperties
        Attributes and child tags:
        • graphId String,
        • filePrefix String,
        • rootNodeId String,
        • generateMeshes Bool, default NO
        • generateColliders Bool, default NO
        • generateShadows Bool, default NO
        • generateTriangleStrips Bool, default NO
        • useCpuSkinning Bool, default NO
        • vertexCacheSize UInt32, default 16
        • maxNumberOfLightStages UInt32, default 1
        • shadowMaterialSlot UInt32, default 0
        • shadowVolumeGenerationMode Murl::IEnums::ShadowVolumeGenerationMode, default DEFAULT
        • shadowFacesToExtrude Murl::IEnums::PolygonFaces, default BACK_ONLY
        • <IncludedNode> IncludedNode description and properties.
          Attributes and child tags:
          • findIdMatchingPattern String,
        • <ExcludedNode> ExcludedNode description and properties.
          Attributes and child tags:
          • findIdMatchingPattern String,

XML Beispiel

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2015 Spraylight GmbH -->

<SceneConverter xmlns="http://murlengine.com" sceneId="Scene" ignoreFiles="no" translateX="0" translateY="0" translateZ="0" rotateX="0d" rotateY="0d" rotateZ="0d" scale="1" outPath="../packages/" packageName="bf110mp">

    <InputPackage fileName="../packages/materials.murlres"/>

    <InputScene id="{sceneId}" fileName="bf110/bf110.obj"
        translateX="{translateX}" translateY="{translateY}" translateZ="{translateZ}"
        rotateX="{rotateX}" rotateY="{rotateY}" rotateZ="{rotateZ}"
        scale="{scale}">

        <ImageLocation pathName="./bf110"/> 
        
        <Material findIdMatchingPattern="*"
            replaceWithGraphNodeId="/myMaterial/mat_color_light_texture"
        />
        <Material findIdMatchingPattern="transparent*"
            replaceWithGraphNodeId="/myMaterial/mat_color_alpha"
        />
        <Material findIdMatchingPattern="transparent*"
            replaceWithGraphNodeId="/myMaterial/mat_color_light_alpha_twopass"
            ambientColor="0.0f,0f,0.5f,1f"
        />

    </InputScene>

    <OutputPackage fileName="{outPath}{packageName}" packageId="{packageName}" createFolders="yes">
        <GraphInstance graphId="GraphInstance" filePrefix="graph_instance" generateMeshes="yes"/>
    </OutputPackage>

</SceneConverter>


Copyright © 2011-2024 Spraylight GmbH.