Game Development Community

%player.mountImage( RocketLauncherImage, 0, true, 'blue' );

by Vince Gee · in Torque 3D Professional · 11/16/2010 (5:36 pm) · 1 replies

Ok,

I was digging through the code and found this in the comment.

I then looked it up in the chm, and it says
bool ShapeBase::mountImage  ( ShapeBaseImageData  image,  
  int  slot,  
  bool  loaded = true,  
  string  skinTag = ""   
 )    

Mount a new Image. 

Parameters:
 image  the Image to mount  
 slot  Image slot to mount into (valid range is 0 - 3)  
 loaded  initial loaded state for the Image  
 skinTag  tagged string to reskin the mounted Image

Ok, how do I define "Blue"? or where do I define it?

#1
11/16/2010 (8:53 pm)
You don't define it anywhere. It's the name of the skin to use -- which, by default, doesn't work in T3D (at least for the collada importer if you haven't implmeneted the fix I posted anyway).

In previous versions of Torque, where material names were identical to the diffuse texture names (eg. "MyTexture.png"), you could prefix a model's textures with "base." in order to have them able to be reskinned via script/code. Then, if you specified a new skin tag for the object, the skin tag would replace the "base" in the skin name.

This would mean, for example, that with a texture named "base.MyTexture.png", you could have reskinned it with the skin tag "red" and it would switch the model to using a texture called "red.MyTexture.png".

But... As I said, without modification this functionality does not work in T3D with the collada importer because it no longer names materials after the diffuse texture. Older files, exported to DTS via the various plugins and whatnot, should work fine, but newer ones... Not so much.

I did post a fix for the collada issue (do a search on this forum for "reskin" and it should pop up), but it still hasn't been implemented -- or at least the lack of functionality addressed.