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.
short_cirkuit's picture

thanks so so much mate - much

thanks so so much mate - much appreciated!
However it didnt work - i tried it on coronalgacy and corona physical materials?

obaida's picture

with UI

here is the script with UI

AttachmentSize
crop_bitmaps.ms 1.17 KB
short_cirkuit's picture

thanks so much and sorry for

thanks so much and sorry for the delay, i didnt know you responded - much much appreciated works perfectly.

Is there a easy way to put this into a UI form where you put these inputs in a UI?

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.