DETECT MAP TYPE - DIFFUSE, BUMP, REFLECT etc

how to find out map type of a texture

for m in bitmaps do

(

print m.?????????

)

 when I use print bitmaps

I get

name1:Bitmap
name2:Bitmap

But I need

DIFFUSE

BUMP

 

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
artrender.info's picture

THANK YOUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU!

IT's working very well, the only thing is that when I use it I get

Slot name: Map 1
Slot name: Mask
Slot name: Radius
Slot name: Occluded
Slot name: Diffuse map
Slot name: Bump map
Slot name: Refl. gloss.
Slot name: Reflect map
Slot name: Bump map
Slot name: Refl. gloss.
Slot name: Diffuse map
Slot name: Reflect map
Slot name: Bump map
Slot name: Refl. gloss.
Slot name: Bump map

I get Map instead of Diffuse(I have there collor corect then texture in diffuse)
I want DIFFUSE/COLOR CORRECT/
Except this, I want all this info without the word

map

for example - not BUMP MAP but BUMP.

In this case

Slot name: Map 1
Slot name: Mask
Slot name: Radius
Slot name: Occluded
Slot name: Map 2

Map1 and Map2 are located in Diffuse Slot/Fallof then - Map1 and Map2!

I would like to list tem like:

Difuse/Fallof/Map1
Difuse/Fallof/Map2

Thank you in advance!

Swordslayer's picture

( local bitmaps =

(
	local bitmaps = getClassInstances BitmapTexture
 
	fn capitalizeFirst str =
	(
		str[1] = toUpper str[1]
		str
	)
 
	fn getTopMats sub =
		for item in refs.dependents sub
			where isKindOf item Material collect item
 
	fn recurseMats mats map previous:#() =
		for mat in mats do
			for i = 1 to (getNumSubTexmaps mat)
				where getSubTexmap mat i == map do
				(
					local topMats = getTopMats mat
					if topMats.count > 0 then
						recurseMats topMats mat previous:(join #(capitalizeFirst ((classOf mat) as string) + "/" + getSubTexmapSlotName mat i) previous)
					else
					(
						format "\tSlot name: %" (substituteString (getSubTexmapSlotName mat i) " map" "")
						for each in previous do format "/%" each
						format "\n" 
					)
				)
 
	for bmp in bitmaps do
	(
		local mats = getTopMats bmp
		format "\nTexture: %\n" bmp.name
 
		recurseMats mats bmp
	)		
)
Swordslayer's picture

This will work in some

This will work in some cases:

(
	local bitmaps = getClassInstances BitmapTexture
 
	for bmp in bitmaps do
	(
		local mats = for item in refs.dependents bmp where isKindOf item Material collect item
		format "\nTexture: %\n" bmp.name
 
		for mat in mats do
			for i = 1 to (getNumSubTexmaps mat)
				where getSubTexmap mat i == bmp do
					format "\tSlot name: %\n" (getSubTexmapSlotName mat i)
	)		
)

SubTexmap methods work both for materials and maps, yet it is quite likely that some info will be missing - anything that will be missing in getClassInstances/refs.dependents calls.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.