Super Mapper

A WaveFront object and texture manipulator

Contents

1) Summary of functionality
2) Expanded description of functionality
3) Menu summary
4) Known problems and limitations
5) Location

1) Summary of functionality

The main purpose of this program is to generate texture templates for WaveFront objects (.obj files, such as can be imported into Poser as props or figures). A template bitmap can either be generated from the texture map already associated with an object, or a new map can be created. The map generator allows different parts of the object to be mapped to different regions of the template (like the templates supplied with the Poser3/4 figures).

In addition, a number of functions are provided to manipulate the object: resizing it, moving it in space and adjusting the direction of faces (that is, overcoming some 'reversed face' problems - see section 2.3)

The program can either display information about a loaded object (how many vertices, faces etc it possesses, how big it is, what are the bounds on its position in all three dimensions etc), or a preview of its texture template.

1.1 Change history

2) Expanded description of functionality

2.1) Basic operation

The basic operations involve loading and saving data. Virtually none of the other function of this program work until a WaveFront object is loaded, using the File>Open command (ie: 'File' menu, 'Open' subcommand). This puts up a standard file selection dialog, allowing the user to select the file to be opened.

When opened, the user can display either data about the object, Display>Object_Data, or a preview of the texture template associated with the object Display>Texture_template. If the later is selected but the object doesn't have any texture data, the object data is displayed with a banner indicating the lack of template data.

The object currently loaded can be saved, using File>Save_As. This never automatically overwrites the loaded file, but always asks the user for a filename and issues a warning if the file already exists. The object is saved in WaveFront (.obj) format.

The File>Save_Template command saves the texture template associated with the object. The user will be asked for the size of file required and its name. The file created is a two colour uncompressed bitmap (.bmp). Any graphics package should be able to read the file an convert it to something Poser can use (like .tif). If the command doesn't do anything (the user isn't asked for the size or name), then the object doesn't have any texture data (look at the object data, Display>Object_Data. "Number of Texture Points" will be zero). Note: the size/aspect ration of the window showing the preview of the texture template has no effect on the size or aspect ration of the bitmap created.

The program is closed by either File>Exit or the closure button on the title bar. If the object data has changed (by any of the action menu commands or Texture_Mapping>Apply_Map_to_Object) then the user will be asked if they want to save the object before closing. If the texture map has changed (by Texture_Mapping>Apply_Map_to_Object) the user will be asked if they want to save the texture template before closing. If the region map has been changed (by Texture_Mapping>Edit_Map) the user will be asked if they want to save the region map before closing.

2.2) Object manipulation

In the object data display (Display>Object_Data), it will be noticed that the user is shown the minimum position, maximum position and size (maximum - minimum) of the object in each of the three dimensions. This is shown as 'min..max ==> size'. Three commands exist to manipulate the object's data, to change these values.

Action>Center_Object: the object is repositioned in space, so that its center is at the origin. Note that this command does not resize the object, so each bound becomes '-size/2..+size/2 ==> size'

Action>Offset_Object: the user is asked for offset values in the three dimensions, X Y and Z. The object is then shifted in space by the indicated amounts. That is each bound becomes 'min-offset..max-offset ==> size'

Action>Scale_Object: this command resize the object. The user is asked for the required size of the largest dimension of the object. The object is then scaled uniformly to achieve the desired size.

The above three commands can be used to make a new figure's object match the size of existing Poser figures.

2.3) Face reversal

When loading an object into Poser (particularly one translated from another format), it will sometimes appear as though the object has holes in it, or has parts missing. When rendered, the holes/missing parts reappear, but with dark lines at the joints or across the object. This happens because Poser is getting confused as to whether it is looking at the front or back of particular faces. The three face reversal commands aim to fix this problem.

Action>Fix_face_normals checks the direction of all faces in the object and attempts to make them consistent. Whilst Action>Fix_face_normals will often solve the problem, it has two limitations (addressed by the other action commands).

Action>Fix_face_normals works by starting at one face, and then making each face adjacent to it face in a consistent direction (and so on recursively). The first problem is that it assumes that the first face it looks at is pointing in the right direction. This may not be the case, and the resulting object may have all faces reversed. Action>Reverse_all_faces corrects this by reversing all the faces in an object.

The Action>Fix_face_normals algorithm can also have a problem if the object consists of a number of unconnected parts (for example, most Poser figures have a single skin, but separate eyeballs, teeth etc). Action>Fix_face_normals will get each part facing in a self-consistent direction, but not necessarily all in the same direction. As these parts are likely to be separate groups or materials, Action>Reverse_all_faces_in_a_group and Action>Reverse_all_faces_in_a_material solves the problem by allowing the user to reverse, say just all the faces in the teeth.

2.4) Defining the texture map

This is the main reason the program exists. I wanted to be able to make texture maps like those that come with Poser, where specific areas (like the lips and pupils) are separated out and can be more detailed than the areas like the body which require a more uniform texture. In the following description, such sections of the template are called 'regions'. In order to achieve this, the user needs to define how the texture map should be constructed (using Texture_Mapping>Edit_Map). Once the requirement map has been defined, the appropriate data is added to the object by Texture_Mapping>Apply_Map_to_Object. The relevant template can then be constructed using File>Save_Template. Once a map has been defined, it can be saved for future use by Texture_Mapping>Save_Map. It is reloaded by Texture_Mapping>Load_Map.

Note that a map cannot be loaded, or edited unless an object is already loaded. This is because the map refers to the groups/materials that are to be mapped to different regions of the template. As this data is part of the object, an object must be loaded to make the map meaningful (the user will get a warning if a map is loaded that doesn't appear to belong to the current object).

The Texture_Mapping>Edit_Map command puts up a fairly complex dialog. Firstly, the user need to decide how the template is to be laid-out. By default, all groups and materials are mapped to the 'Default' region (which usually covers the entire template - but this can be changed). For each additional region (say for lips and pupils), the user need to define other regions on the template.

The 'Add' button in the top left panel allows the user to create a new region. They will be asked for region name (which must be unique and may not contain spaces). The dropdown list by the Add button contains a list of all currently defined regions. When a name is selected, that region becomes the one currently being edited (ie: all the other fields of the dialog change to the values appropriate for that region).

The 'Finish' button completes an edit and closes the dialog. The dialog has essentially three groups of controls: those that define the size, position and layout of the region, those that define the contents of the regions, and the offset controls which affect the way some of the mapping modes work.

The controls on the left basically affect the size, position and layout of the region. The position and size is defined in terms of U (left-right) and V (bottom-top) coordinates. The U/V start positions are how far across or up the map the region starts (as a percentage). The width and height of the region is then defined as the percentage of the remaining space on the map. So for example, the top left quarter of the map is defined as U start = 0 (lefthand edge), Width = 50 (half the remaining width of the map, ie: full width - 0), V start = 50 (starting half way up the map), Height = 100 (all the remaining height of the map, ie: full height - 50).

The dropdown list allows the user to select one of seven mapping modes for the selected groups/materials of the object into this region:

planar: simple projection
side-by-side: front and back halves separated (like supplied Poser templates)
side-by-reversed: like side-by-side, but rear view reversed, so the user is looking at the outside of the object, not the inside
stacked: front and back halves separated and shown one over the other
stacked-reversed: like stacked, but the rear view inverted
cylindrical: the map 'wraps' around the object (like a can label)
spherical: the map wraps around the object like a sphere

The rotate button rotates the map in this region through 90 degrees. For side-by-side etc, which generate two sub-maps in a region, each sub-map is separately rotated. The margin button puts a 5% margin around the template (or sub-map). This can make painting the final texture map easier (less chance of one region running into another). Flip and Mirror reverse the map: either top-to-bottom or left-to-right

The three 'view axis' buttons essentiall select front, side or top views of the object. The righthand listbox show the groups/materials that are to be mapped to this region (groups or materials selected by the radio buttons - a region may contain both). The lefthand listbox shows the groups/materials in the object not mapped to this group. 'Add-->' and '<--Remove' change the groups/materials mapped to this region. Note: because all groups not explicitly mapped anywhere else are automatically mapped to the default region, if the current region is default, '<--Remove' group has no effect.

The final set of controls, the centroid offset, move the apparent position of the center of the object (used by all buthe planar mapping mode). The movement is expresent as a percentage, relative to the geometric center of the object (0 =at the geometric center, -100 = at the back/bottom/left of the object, +100 = = at the front/top/right). For example, if a side-by-side map is map of a figure in its default pose, it may be found that the arms are missing on one half of the map. This is because, without offset, the object is split down the plane through the geometric center. If the center of the arms may well be to the back of the object, and so fall completely in the rear half map. The offset allow the apparent center of the object to be moved, until it is divided through the center of the arms. If all this sounds complicated, experiment - you'll soon get the hang of it (just remember not to overwrite the object your experimenting on!)

3) Menu summary

File
Open Load a WaveFront object
Save As Save the loaded object
Save Template Save the texture template of the loaded object
Exit Exit program
Action
Fix face normals Make all joined faces of an object face in the same direction
Reverse all faces Reverse all faces of the object
Reverse all faces in a group Reverse all faces that belong to a particular group of the object
Reverse all faces in a material Reverse all faces that belong to a particular material of the object
Scale Object Set the maximum dimension of the object
Offset Object Move the object in space
Center Object Center the object around the origin
Texture Mapping
Apply Map to Object Create a new texture map for the object
Edit Map Define how the texture map should be created
Load Map Load a prefined Map
Save Map Save a Map created/modified by Edit
Display
Texture template Preview the texture template
Object Data Show statistical information about the object
Help
About Version data

4) Known problems and limitations

It is possible for the user to get an edge 'overrun' warning after a File>Load or Texture_Mapping>Apply_Map_to_Object has completed. This means that one of the internal data structures is too small to hold all the information needed to draw the texture template correctly. If this occurs, the user needs to open the 'CPMapper.ini' file in their Window's directory with a text editor, increase the value of 'EdgeMax', restart the program and try again.

The object manipulation functions (see 2.2) remove object normal information. The user is warned if this is likely to happen. This shouldn't be a problem as Poser doesn't appear to use this information

In version 1.0 and below, the program could only deal with 3 and 4 sided faces. Some of the Poser models (like bizwomHi) do have more complex faces, that the program could not load. Version 2.0 has removed this limitation - by splitting more 5+ sided faces into triangles.

5) Where to get it and legal bit

Whilst considerable care has gone into writing this program and it has been extensively tested on the author's machine, as with all software, unanticipated combinations of input data and/or hardware/software environment might cause it to go wrong. Be careful not to overwrite the only copy of some object you've spent hours creating. Always take back-ups, and keep them somewhere safe. This software is supplied on an 'as is' basis, with the author not accepting any liability for its behaviour.

Find it at http://www.pygott.demon.co.uk/image/supermap.zip (176K)

Comments please to: Clive Pygott