XPMP2
X-Plane multiplayer library 2 - using instancing
Namespaces | Macros
CSLCopy.cpp File Reference

Copy .obj file just before loading, to replace dataRefs and texture. More...

#include "XPMP2.h"

Namespaces

 XPMP2
 

Macros

#define DEBUG_CPY_STARTING   "Creating model copy '%s' from '%s'|%s|%s"
 
#define INFO_CPY_SUCCEED   "Created model copy '%s' successfully"
 
#define ERR_CPY_FAILED   "Copying to '%s' failed, falling back to '%s'"
 
#define ERR_CPY_OBJ_NOT_FOUND   "Copying %s: CSLObj not found in CSLModel '%s'!"
 
#define ERR_CPY_MDL_NOT_FOUND   "Copying %s: CSLModel '%s' not found!"
 
#define ERR_CPY_THRDNOTRUN   "%s: Status OLS_COPYING but thread's not running??? Reverting to pathOrig"
 

Detailed Description

Copy .obj file just before loading, to replace dataRefs and texture.

These routines make a copy of an .obj file just before it gets loaded by X-Plane. This way we can replace dataRefs and textures.

  1. xsb_aircraft.txt formats vary by now out in the wild. For example, X-CSL/X-IvAp used to defined texture on the OBJ8 line. X-Plane, especially for instancing, cannot replace textures on the fly. The solution is to copy the .obj file, replacing the up to two lines defining the texture to use, and then only have it loaded by X-Plane.
  2. CSL-Models might not use correct dataRefs as supported by XPMP2. For example are the widely used Bluebell models known to have translated only a limited set of dataRefs from their World Traffic origin into the libxplanemp world. XPMP2 now supports a lot more dataRefs. Replacing dataRef names in those models unlocks a number of feature like rotating props/rotors, turning wheels, or reversers.
See also
https://twinfan.github.io/XPMP2/XSBAircraftFormat.html for the xsb_aircraft.txt format definition as supported by XPMP2.
https://twinfan.github.io/XPMP2/CSLdataRefs.html for a list of animation dataRefs supported by XPMP2. And beyond that you can add even more using the XPMPAddModelDataRef() function.
Author
Birger Hoppe

Macro Definition Documentation

◆ DEBUG_CPY_STARTING

#define DEBUG_CPY_STARTING   "Creating model copy '%s' from '%s'|%s|%s"

◆ ERR_CPY_FAILED

#define ERR_CPY_FAILED   "Copying to '%s' failed, falling back to '%s'"

◆ ERR_CPY_MDL_NOT_FOUND

#define ERR_CPY_MDL_NOT_FOUND   "Copying %s: CSLModel '%s' not found!"

◆ ERR_CPY_OBJ_NOT_FOUND

#define ERR_CPY_OBJ_NOT_FOUND   "Copying %s: CSLObj not found in CSLModel '%s'!"

◆ ERR_CPY_THRDNOTRUN

#define ERR_CPY_THRDNOTRUN   "%s: Status OLS_COPYING but thread's not running??? Reverting to pathOrig"

◆ INFO_CPY_SUCCEED

#define INFO_CPY_SUCCEED   "Created model copy '%s' successfully"