Transmogrifier OLE Automation Documentation

This is the documentation for the OLE Automation Interface to Transmogrifier (version 2.1.2 and greater).

Transmogrifier's OLE Automation interface enables it to be used "behind the scenes" by scripts, web servers and other programs like RugOMatic, to create and modify Sims objects. It can also export previews of Sims objects. This OLE Automation interface makes it possible to develop other tools and web services that use Transmogrifier, with scripting languages like JavaScript and Python.

OLE Automation Class Name

The class name of the Transmogrifier OLE Automation object is "Transmogrifier.Application".

ITransmogrifier OLE Automation Interface

Properties:

long MagicCookie;
Your magic cookie, or 0.

BSTR SimsHome;
The Sims home directory.

BSTR TransmogrifierHome;
The Sims Transmogrifier home directory.

BSTR OutputDirectory;
The output directory into which Transmogrifier write new files.

BSTR Site;
A semicolon-separated list of directories to search for IFF files.

long FilterResFiles;
If true, Transmogrifier ignores uninteresting resource files.

long PreviewImageType;
The type of preview image to write. (Obsolete. Now uses file name suffix.)

long PreviewImageQuality;
The JPEG image quality of the preview. (set before previewing)

long PreviewWidth;
The width of the preview. (read after previewing)

long PreviewHeight;
The height of the preview. (read after previewing)

long PreviewOriginX;
The X origin of the preview. (read after previewing)

long PreviewOriginY;
The Y origin of the preview. (read after previewing)

long PreviewBorder;
The border around the edge the preview. (set before previewing)

Methods:

long CloneObject(
    long ObjectFileID,
    long ObjectIndex,
    BSTR OutObjectFileName);
Clone ObjectFileID, including ObjectIndex (or -1 for all objects), and return the new ObjectFileID of the created IFF file.

long ExportObject(
    long ObjectFileID,
    BSTR OutXMLFileName,
    long Mode,
    long JustChangeColors,
    long CompressBitmapFiles,
    long CreateSubDirectories,
    long SmoothSmallZoomColors,
    long SmoothSmallZoomEdges,
    long FarZBuffer,
    long SoftAlphaChannel);
Export from ObjectFileID to OutXMLFileName, with the parameters corresponding to the export dialog controls.

long ImportObject(
    long ObjectFileID,
    BSTR InXMLFileName);
Import into ObjectFileID from InXMLFileName.

Export a resource from ObjectFileID of ResourceType and ResourceID, to OutResourceFileName.
long ExportResource(
    long ObjectFileID,
    BSTR ResourceType,
    long ResourceID,
    BSTR OutResourceFileName);

long ImportResource(
    long ObjectFileID,
    BSTR ResourceType,
    long ResourceID,
    BSTR NewResourceName,
    BSTR InResourceFileName);
Import a resource into ObjectFileID of ResourceType and ResourceID, giving it NewResourceName, from InResourceFileName.

long DeleteResource(
    long ObjectFileID,
    BSTR ResourceType,
    long ResourceID);
Delete a resource from ObjectFileID of ResourceType and ResourceID.

BSTR GetResourceName(
    long ObjectFileID,
    BSTR ResourceType,
    long ResourceID);
Get the name of a resource from ObjectFileID of ResourceType and ResourceID.

long SetResourceName(
    long ObjectFileID,
    BSTR ResourceType,
    long ResourceID,
    BSTR ResourceName);
Set the name of a resource from ObjectFileID of ResourceType and ResourceID to ResourceName.

long CountResources(
    long ObjectFileID,
    BSTR ResourceType);
Count the number of resources from ObjectFileID of ResourceType.

long GetResourceID(
    long ObjectFileID,
    BSTR ResourceType,
    long ResourceIndex);
Get the id of the resource from ObjectFileID of ResourceType of index ResourceIndex.

long CountResourceTypes(
    long ObjectFileID);
Count the number of types from ObjectFileID of ResourceType.

BSTR GetResourceType(
    long ObjectFileID,
    long ResourceTypeIndex);
Get the resource type name from ObjectFileID of ResourceTypeIndex.

long ExportThumbnail(
    long ObjectFileID,
    BSTR OutBMPFileName);
ExportThumbnail not implemented. Needs different API.

long ImportThumbnail(
    long ObjectFileID,
    BSTR InBMPFileName);
ImportThumbnail not implemented. Needs different API.

long ExportImage(
    long ObjectFileID,
    BSTR ResourceType,
    long ResourceID,
    long ImageIndex,
    BSTR OutBMPFileName);
Exports an image resource from ObjectFileID of ResourceType and ResourceID, ignoring ImageIndex, to OutBMPFileName.

long ImportImage(
    long ObjectFileID,
    BSTR ResourceType,
    long ResourceID,
    long ImageIndex,
    BSTR InBMPFileName);
Imports an image resource into ObjectFileID of ResourceType and ResourceID, ignoring ImageIndex, from InBMPFileName.

long ExportObjectPreview(
    long ObjectFileID,
    long ObjectIndex,
    long Zoom,
    long Rotation,
    long StateIndex,
    BSTR BackgroundColor,
    BSTR GridColor,
    long Grid,
    BSTR Details,
    BSTR OutBMPFileName);
Exports an object preview from ObjectFileID of ObjectIndex, at Zoom and Rotation, in graphical state StateIndex, using BackgroundColor and GridColor, with optional Grid, ignoring Details, to OutBMPFileName.

long StartUp();
Starts up Transmogrifier. Call this before doing anything else.

long ShutDown();
Shuts down Transmogrifier. Call this when you're done using it.

long ScanDirectory(
    BSTR DirName);
Scans DirName for Sims object files.

long GetObjectFileIDFromShortName(
    BSTR ShortName);
Returns the ObjectFileID of the Sims object file whose short name (shown in the list, without the directory or '.iff') is ShortName.

long GetObjectFileIDFromIndex(
    long Index);
Returns the ObjectFileID of the Sims object file of Index.

BSTR GetObjectName(
    long ObjectFileID,
    long ObjectIndex,
    long Language);
Returns the catalog name of the object from ObjectFileID of ObjectIndex in Language.

BSTR GetObjectDescription(
    long ObjectFileID,
    long ObjectIndex,
    long Language);
Returns the catalog description of the object from ObjectFileID of ObjectIndex in Language.

long GetObjectPrice(
    long ObjectFileID,
    long ObjectIndex);
Returns the catalog price of the object from ObjectFileID of ObjectIndex.

long SetObjectName(
    long ObjectFileID,
    long ObjectIndex,
    BSTR Name,
    long Language);
Sets the catalog name of the object from ObjectFileID of ObjectIndex in Language to Name.

long SetObjectDescription(
    long ObjectFileID,
    long ObjectIndex,
    BSTR Description,
    long Language);
Sets the catalog description of the object from ObjectFileID of ObjectIndex to Description in Language.

long SetObjectPrice(
    long ObjectFileID,
    long ObjectIndex,
    long Price);
Sets the catalog price of the object from ObjectFileID of ObjectIdnex to Price.

long GetVersion();
Returns the version of Transmogrifier.

BSTR GetStrNum(
    long ObjectFileID,
    long ResourceID,
    long Index,
    long Language);
Returns the numbered string resource from ObjectFileID of ResourceID and Index in Language.

long SetStrNum(
    long ObjectFileID,
    long ResourceID,
    long Index,
    long Language,
    BSTR Value);
Sets the numbered string resource in ObjectFileID of ResourceID and Index in Language to Value.

BSTR GetObjectFileName(
    long ObjectFileID);
Returns the file name of ObjectFileID.

long GetObjectGUID(
    long ObjectFileID,
    long ObjectIndex);
Returns the GUID from ObjectFileID of ObjectIndex.

long SetObjectGUID(
    long ObjectFileID,
    long ObjectIndex,
    long NewGUID);
Sets the GUID of ObjectFileID of ObjectIndex to NewGUID.

long CountObjects(
    long ObjectFileID);
Returns the count of master objects (not including multi tile slaves) in ObjectFileID.

long CountAllObjects(
    long ObjectFileID);
Returns the count of all objects (including multi tile slaves) in ObjectFileID.

long GetAllObjectGUID(
    long ObjectFileID,
    long AllObjectIndex);
Returns the GUID from ObjectFileID of AllObjectIndex.

long SetAllObjectGUID(
    long ObjectFileID,
    long AllObjectIndex,
    long NewGUID);
Sets the GUID of ObjectFileID of AllObjectIndex to NewGUID.

long GetAllObjectMasterIndex(
    long ObjectFileID,
    long AllObjectIndex);
Returns the master object's AllObjectIndex from ObjectFileID of AllObjectIndex.

long CountAllObjectSlaves(
    long ObjectFileID,
    long AllObjectIndex);
Returns the number of slave from ObjectFileID of AllObjectIndex.

long GetAllObjectSlaveIndex(
    long ObjectFileID,
    long AllObjectIndex,
    long Index);
Returns the AllObjectIndex from ObjectFileID of AllObjectIndex's slave number Index.

BSTR GetAllObjectOBJD(
    long ObjectFileID,
    long AllObjectIndex);
Returns the object definition from ObjectFileID of AllObjectIndex.

long SetAllObjectOBJD(
    long ObjectFileID,
    long AllObjectIndex,
    BSTR *OBJD);
Sets the object definition of ObjectFileID of AllObjectIndex to OBJD.

long FindObjectIndexInFileByGUID(
    long ObjectFileID,
    long GUID);
Returns the ObjectIndex from ObjectFileID of the object with GUID.

long FindAllObjectIndexInFileByGUID(
    long ObjectFileID);
Returns the AllObjectIndex from OBjectFileID of the object with GUID, including slave objects.

long FindObjectFileIDWithGUID(
    long GUID,
    long SearchSubObjects);
Returns the ObjectFileID containing an object with GUID, with option SearchSubObjects.

void ClearUsedGUIDs();
Clears the Used GUID List.

void ScanUsedGUIDs();
Scans all loaded object files for used GUIDs, and updates the Used GUID List.

long LoadUsedGUIDs();
Loads the used GUID List.

long LoadGUIDs(BSTR FileName);
Loads used GUIDs from the given file, merging them with the Used GUID List.

long SaveUsedGUIDs();
Saves the Used GUID List.

long IsGUIDUsed(
    long GUID);
Returns true if the GUID is not in the Used GUID List.

void UseGUID(
    long GUID);
Adds the GUID to the Used GUID List.

long ScanSingleFile(
    BSTR IFFFilePath);
Scan in a single IFFFilePath.

long ScanFiles();
Scans all the IFF files found in the Site path list.

long CountObjectFiles();
Returns the number of object files that have been scanned.

long CountObjectStates(
    long ObjectFileID,
    long ObjectIndex);
Returns the number of graphical states from ObjectFileID of ObjectIndex.

long SetObjectState(
    long ObjectFileID,
    long ObjectIndex,
    long TileState);
Sets the current state of all tiles of ObjectFileID of ObjectIndex to TileState, which isn't saved but effects the preview.

long CountObjectTiles(
    long ObjectFileID,
    long ObjectIndex);
Returns the number of tiles from ObjectFileID of ObjectIndex.

long CountObjectTileStates(
    long ObjectFileID,
    long ObjectIndex,
    long TileIndex);
Returns the number of tile states from ObjectFileID of ObjectIndex of TileIndex.

long SetObjectTileState(
    long ObjectFileID,
    long ObjectIndex,
    long TileIndex,
    long TileState);
Sets the current state of ObjectFileID of ObjectIndex of TileIndex to TileState, which isn't saved but effects the preview.

Anyone using this?

Just wondering if anyone has built any tools using this interface? I haven't seen anything but then I haven't done any Sim stuff for a couple of years now.

RugOMatic

This OLE interface is how RugOMatic creates custom rugs, by controlling Transmogrifier thought OLE automation. I've also used Transmogrifier's OLE automation interface on a Windows web server from Python via the win32com module, to dynamically generate Sims objects. Python would draw on the bitmaps and call Transmogrifier to make them into custom Sims objects. -Don

ShowNTell

And of course the ShowNTell ActiveX control uses Transmogrifier's OLE automation interface, to display previews of Sims objects in a web page. Transmogrifier comes with a little "Dynamic HTML Application" .hta file that embeds the ShowNTell ActiveX control, and lets you drag and drop Sims objects into it to look at their graphics. The Transmogrifier API has calls to generate object previews just for this purpose! -Don