• Welcome to World Machine Community. Please login or sign up.
 
July 15, 2019, 10:03:04 pm

News:

Read the Development Diary for an inside look at World Machine's progress!


WM Automation: Need a "Build Info" XML file...

Started by John Swafford, August 05, 2008, 09:34:59 pm

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

John Swafford

August 05, 2008, 09:34:59 pm Last Edit: October 15, 2008, 10:00:55 am by GreaseMonkey
I've been learning World Machine 2.0 Pro over the past couple of weeks and I'm absolutely blown away by the software.  After assembling my first terrain in 3ds Max using height/diffuse/normal maps, I was eager to use my experience with Maxscript to start automating the process.  In particular, I was looking toward scripted import and welding together of several adjacent map-displaced meshes into one optimized mesh.

Unfortunately, I've scoured the WM 2 Pro manual only to realize that the simple form of automation I needed doesn't exist.  WM2 Pro currently has plenty of "set" and "do" functionality, but no "get" functionality whatsoever.  In other words, there is no way to inquire World Machine (or its output files) for the information needed to find, import, position, displace and texture the exported sections of terrain in 3ds Max (such as Render Extent name, position, size, resolution, single vs. tiled, tile pattern, types of maps exported, map file names...etc.)

This functionality would be best implemented in the form of a unified "Output Info" XML file automatically generated/updated every time a file is exported from a world in WM 2 Pro.  This would allow the legions of scripters in the various 3D communities (Max, Maya, XSI, C4D, etc.) to create user-friendly scripted tools for fast, precise and automated import and handling of even the most complicated output from WM 2 Pro.  In my opinion, the lack of this feature is by far the single largest obstacle you face in expanding World Machine's usage in low-end and mid-range commercial graphics (e.g. training, forensic, educational, marketing, etc.).  Adding a text-based file like this would open up WM 2 Pro's output to automated import into every major 3D app on the market, and I can guarantee that I'd be working on such a tool for 3ds Max as soon as this feature was added.



------- SPECIFICATION -------



Below is some pseudocode depicting a rough structure for the Output Info XML file, and I've included some clearly global settings (such as Altitude Scale and Units) inside each File Output section.  I consider this a more powerful way of storing the information, as it allows 3rd party developers to detect if users have output files with conflicting settings.



<!-- XML header declaration -->
<?xml version="1.0" encoding="UTF-8" standalone="no"?>

<!-- World Machine 2.5 Pro output info version declaration -->
<outputinfo version="WMP25">

<RenderExtent>
   <RenderExtentName="Foreground"/>
   <FileOutput>
      <OutputDevice="Height Output">
         <HeightOutputType="PNG16"/>
      </OutputDevice>
      <OutputFile="D:\Terrain\Project1\MyWorld_Foreground_HeightMap.png"/>
      <OutputType="Single">
         <OutputUnits="Meters"/>
         <OutputAltitudeScale="2625"/>
         <OutputLowerLeftX="-4000"/>
         <OutputLowerLeftY="-4000"/>
         <OutputWidth=="8000"/>
         <OutputHeight=="8000"/>
         <SingleOutputResolution="2048"/>
         <SingleOutputResolutionPlus="1"/>
      </OutputType>
   </FileOutput>
   <FileOutput>
      <OutputDevice="Bitmap Output">
         <BitmapOutputType="BMP8"/>
      </OutputDevice>
      <OutputFile="D:\Terrain\Project1\MyWorld_Foreground_ColorMap.bmp"/>
      <OutputType="Single">
         <OutputUnits="Meters"/>
         <OutputAltitudeScale="2625"/>
         <OutputLowerLeftX="-4000"/>
         <OutputLowerLeftY="-4000"/>
         <OutputWidth=="8000"/>
         <OutputHeight=="8000"/>
         <SingleOutputResolution="2048"/>
         <SingleOutputResolutionPlus="1"/>
      </OutputType>
   </FileOutput>
   <FileOutput>
      <OutputDevice="Bitmap Output">
         <BitmapOutputType="PNG16"/>
      </OutputDevice>
      <OutputFile="D:\Terrain\Project1\MyWorld_Foreground_NormalMap.png"/>
      <OutputType="Single">
         <OutputUnits="Meters"/>
         <OutputAltitudeScale="2625"/>
         <OutputLowerLeftX="-4000"/>
         <OutputLowerLeftY="-4000"/>
         <OutputWidth=="8000"/>
         <OutputHeight=="8000"/>
         <SingleOutputResolution="2048"/>
         <SingleOutputResolutionPlus="1"/>
      </OutputType>
   </FileOutput>
</RenderExtent>

<RenderExtent>
   <RenderExtentName="Background"/>
   <FileOutput>
      <OutputDevice="Height Output">
         <HeightOutputType="PNG16"/>
      </OutputDevice>
      <OutputFile="D:\Terrain\Project1\MyWorld_Background_HeightMap_Tile.png"/>
      <OutputType="Tiled">
         <OutputUnits="Meters"/>
         <OutputAltitudeScale="2625"/>
         <OutputLowerLeftX="-8000"/>
         <OutputLowerLeftY="-8000"/>
         <OutputWidth=="16000"/>
         <OutputHeight=="16000"/>
         <TilesOutputAll="1"/>
         <TilesOutputFromX="0"/>
         <TilesOutputFromY="0"/>
         <TilesOutputToX="3"/>
         <TilesOutputToY="3"/>
         <TilesResolution="512"/>
         <TilesPerSide="4"/>
         <TilesMergedOutput="0"/>
         <TilesShareEdgeVerts="1"/>
         <TilesFlipYAxis="0"/>
         <TilesNamingString="_x%x_y%y"/>
         <TilesPadCoordDigits="1"/>
         <TilesStartNumberingAtX="0"/>
         <TilesStartNumberingAtY="0"/>
      </OutputType>
   </FileOutput>
   <FileOutput>
      <OutputDevice="Bitmap Output">
         <HeightOutputType="BMP8"/>
      </OutputDevice>
      <OutputFile="D:\Terrain\Project1\MyWorld_Background_ColorMap_Tile.bmp"/>
      <OutputType="Tiled">
         <OutputUnits="Meters"/>
         <OutputAltitudeScale="2625"/>
         <OutputLowerLeftX="-8000"/>
         <OutputLowerLeftY="-8000"/>
         <OutputWidth=="16000"/>
         <OutputHeight=="16000"/>
         <TilesOutputAll="1"/>
         <TilesOutputFromX="0"/>
         <TilesOutputFromY="0"/>
         <TilesOutputToX="3"/>
         <TilesOutputToY="3"/>
         <TilesResolution="512"/>
         <TilesPerSide="4"/>
         <TilesMergedOutput="0"/>
         <TilesShareEdgeVerts="1"/>
         <TilesFlipYAxis="0"/>
         <TilesNamingString="_x%x_y%y"/>
         <TilesPadCoordDigits="1"/>
         <TilesStartNumberingAtX="0"/>
         <TilesStartNumberingAtY="0"/>
      </OutputType>
   </FileOutput>
   <FileOutput>
      <OutputDevice="Bitmap Output">
         <HeightOutputType="PNG16"/>
      </OutputDevice>
      <OutputFile="D:\Terrain\Project1\MyWorld_Background_NormalMap_Tile.png"/>
      <OutputType="Tiled">
         <OutputUnits="Meters"/>
         <OutputAltitudeScale="2625"/>
         <OutputLowerLeftX="-8000"/>
         <OutputLowerLeftY="-8000"/>
         <OutputWidth=="16000"/>
         <OutputHeight=="16000"/>
         <TilesOutputAll="1"/>
         <TilesOutputFromX="0"/>
         <TilesOutputFromY="0"/>
         <TilesOutputToX="3"/>
         <TilesOutputToY="3"/>
         <TilesResolution="512"/>
         <TilesPerSide="4"/>
         <TilesMergedOutput="0"/>
         <TilesShareEdgeVerts="1"/>
         <TilesFlipYAxis="0"/>
         <TilesNamingString="_x%x_y%y"/>
         <TilesPadCoordDigits="1"/>
         <TilesStartNumberingAtX="0"/>
         <TilesStartNumberingAtY="0"/>
      </OutputType>
   </FileOutput>
</RenderExtent>

</outputinfo>




NOTE #1: It would be critical that the Output Info file is updated during each output without destroying any existing data for the other File Outputs/Render Extents.  The file would be created/recreated whenever needed and the individual File Output sections would only be added/overwritten as those outputs are completed/repeated.  This behavior would allow a script to either gut or delete the XML file after a complete import is finished, and any new files output from WM would show up in the XML file as ready for import/update.

NOTE #2: The Output Info file would save to the location set by the Project Settings > General Setup > Default Relative File Path section.  Ideally, the file name could be specified and allow the use of a tag/alias for the current world file name.  (This functionality was requested for other areas of the UI at the end of my my previous post.)

marmil


John Swafford

August 14, 2008, 07:46:34 pm #2 Last Edit: October 15, 2008, 10:01:36 am by GreaseMonkey
Stephen,

Is the "Build Info" XML file feature something that you're interested in adding to WM at some point?  You commented on my other post, but I couldn't tell if you were also referring to this post.

I'm asking because if I knew this feature was going to be added, I could do much of the Maxscript work ahead of time.  I'm hoping to incorporate some Maxscript UI elements that I haven't used before: ActiveX (3ds Max 8 and earlier) and dotNet (3ds Max 9+) Listview and Tab controls.  I'd also be using Maxscript to control the Microsoft XML parser, which would be another learning curve.

If you could confirm whether to expect the "Build Info" feature and whether or not it would be an XML file, I'd be able to devote time to the project now.  (Of course, if you ever began work on this feature, please count me in for the alpha & beta testing.)

I'm not sure you realize just how many more artists could justify World Machine if the flow of terrain from WM to 3d apps was paved this smoothly.  Artists could repeatedly arrange, move and resize Render Extents at will in World Machine (where the visual feedback is very fast), making sure that their particular shot/view of the terrain is adequately covered by their Render Extents.  This shot-specific approach is the norm in animation (unlike the tiled/level-of-detail focus in game development), and the need to easily rearrange, rebuild, export and import render extents is essential.

I work in the military training field, and my usage of WM needs to involve both welded, continous terrain (high-res center surrounded by mid-res surrounded by low-res) and non-contiguous blocks of terrain (from high-res foreground to low-res horizon) being exported to maps and setup in 3ds Max.  This obviously turns into an import nightmare.  The idea of going back into WM for another render extent move/rearrange/resize and rebuild quickly becomes prohibitive mainly because of the import process.  The repeated build times are not an issue, especially given World Machine's thread controls...it behaves quite well in the background and file exports are a snap.  Complex imports are the only aspect of WM that make it impractical in a time crunch, and a Build Info file is the only element needed to eliminate the issue.

I don't mean to bug you about this, Stephen, but the extent of my professional use of WM is directly tied to this feature.

Stephen

I think this is a very solid feature request. I'll try to follow up soon with more info.
-- Stephen Schmitt
- Creator of World Machine

Quick Reply

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Note: this post will not display until it's been approved by a moderator.

Name:
Email:
Verification:
Please leave this box empty:
Type the letters shown in the picture
Listen to the letters / Request another image

Type the letters shown in the picture:

Shortcuts: ALT+S save/post or ALT+P preview