Cropping all material texture the same.... how?

Hi all

I have this common issue where lets say i have a diffuse map, reflection and normal map and its a LEAF atlas downloaded from megascans. If i wanted to crop/place so that i extract only 1 leaf, i usually do it manually and adjust the map so that its the same co-ordinates for each texture - is there a simpler way to this via a script? I realise there is the bezier flaot thing that can possibly do this? but i was hoping there is a script out there to help with this?

Cheers

Comments

Comment viewing options

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

Crop Bitmap Function

(
	mapped fn CropMaps map u v w h = (
		map.apply = true ; map.cropPlace = 0
		map.clipu = u ; map.clipv = v ; map.clipw = w ; map.cliph = h
	)
	local mat = selection[1].material
	local BMs_arr = GetClassInstances Bitmaptexture target:mat
	CropMaps BMs_arr 0.5 0.5 0.5 0.5
)

Comment viewing options

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