Change map type?
After selecting a bunch of Bitmap Maps in the Slate Material Editor, I would like to convert them to RGB Multiply maps, keeping the original bitmap in the Color 1 slot.
I enabled the Macro Recorder, but the command it spits out refers to each specific material and bitmap path:
meditMaterials[9].diffuseMap = RGB_Multiply MAP1:( Bitmaptexture fileName:"c:\project\scene\texturefile.tga")
How do I make this more generic?
I'm also looking for a quick way to instance a specific bitmap into the Color 2 slot of every RGB Multiply, if possible.
This is for a custom game engine which requires lightmaps to be provided via RGB Multiply.
Thanks for any help!
Eric
Comments
This is excellent! Thank you
This is excellent! Thank you once again.
Is there an easy way for the first function to delete the named view? I get an error when trying to run it on a 2nd object in the same session.
3D Game Artist - http://ericchadwick.com
Admin for the Polycount wiki - http://wiki.polycount.com
#1 fn
Adding one line will fix that. You can change name of view also.
bga
Aha, sme.DeleteView thank
Aha, sme.DeleteView thank you!
I am curious how to add a bitmap dialog to this script, so I can use a GUI to pick a new lightmap instead of editing the script each time.
I adapted this sample from an Autodesk help tutorial, but it returns an error (-- Type error: copy requires BitMap, got: undefined). And besides I'm not quite sure where to insert it into the existing script.
3D Game Artist - http://ericchadwick.com
Admin for the Polycount wiki - http://wiki.polycount.com
...
Concept that you used returns bitmap. Then you need to create bitmaptexture.
So can be used like this
I prefere to use file name string using another concept
bga
#2fn part3
bga
Thanks barigazy!Now I am
Thanks barigazy!
Now I am trying to set the lightMap2 to use UV map channel 2. Looking through the MXS help file, there's an argument
<textureMap.coordinates>.mapChannel Integer
but I must not be getting the syntax correct, as it seems to always return an error. How should I format this?3D Game Artist - http://ericchadwick.com
Admin for the Polycount wiki - http://wiki.polycount.com
...
lightMap2.coords.mapChannel = 2
bga
Yay! Thanks again!
Yay! Thanks again!
3D Game Artist - http://ericchadwick.com
Admin for the Polycount wiki - http://wiki.polycount.com
#2fn
fn arguments:
smeViewName -- name of newly created sme view
mapSlotName -- map slot name ei. property name
putInMap2 -- if this argument is true them MAP1 will be instanced in MAP2 slot in RGB_Multiply map
Enjoy ;)
bga
This is excellent!
This is excellent! Thanks so much for helping me with this.
The 2nd function isn't quite correct for my situation... I'm trying to add a new bitmap to the material tree, in the Color 2 slot of each RGB Multiply.
I can certainly wire this in by hand, but it's tedious.
This new bitmap gets shared by all the materials on the object (it's a lighting map, baked in Render To Texture).
The existing bitmaps all use UV channel 1, but the new one uses UV channel 2.
I wonder... do I need to invoke a file selection dialog? Or is there a better way to choose this bitmap? Maybe have it already loaded in SME?
If it helps, the file name for the new bitmap always starts with the string "lightmap_" (sans quotes), but there can be two or more of these in the folder (e.g. one for the "wall" model, one for the "floor" model).
Thanks again!
Edit... here's what the end result should look like. The map on the left is the new lighting map that uses UV 2.
3D Game Artist - http://ericchadwick.com
Admin for the Polycount wiki - http://wiki.polycount.com