Notifications
Clear all
[Closed] c++ SDK: Bitmap name in Displace Modifier
Jun 18, 2015 12:02 am
Hello guys, struggling with Displace Modifier (object space) – trying to get Bitmap name, used for displacement. Any suggestions?
Thanks,
S.
4 Replies
Jun 18, 2015 12:02 am
Check out dispmod.cpp in the samples.
It depends if you mean the ‘bitmap’ field or the ‘map’ field.
The ‘map’ is stored as reference #2. You can easily get it using GetReference(2).
The bitmap filename is more tricky, it’s stored in a field and persisted using chunks like I guess they used to do in 1995. However, it’s registered in asset tracking so you should be able to get to it using Animatable::EnumAuxFiles.
Jun 18, 2015 12:02 am
it’s a hack but something like this should do it
class HackMod : public MappingMod
{
public:
IParamBlock *pblock;
Bitmap *thebm;
BitmapInfo bi;
Texmap *tmap;
static IParamMap *pmapParam;
static MoveModBoxCMode *moveMode;
static RotateModBoxCMode *rotMode;
static UScaleModBoxCMode *uscaleMode;
static NUScaleModBoxCMode *nuscaleMode;
static SquashModBoxCMode *squashMode;
static FaceAlignMode *faceAlignMode;
static RegionFitMode *regionFitMode;
static PickAcquire pickAcquire;
static DispMod *editMod;
};
static void GetBMName(BitmapInfo& bi, TSTR &fname)
{
if (bi.GetAsset().GetId()==kInvalidId)
fname = bi.Device();
else
fname = bi.GetAsset().GetFileName();
}
// get the modifier
if(mod && mod->ClassID() == Class_ID(DISPLACEOSM_CLASS_ID,0))
{
HackMod* hmod = (HackMod*)mod;
if(hmod)
{
GetBMName(hmod->bi, bitmapfname);
.....
1 Reply