ScriptSpot

Forum topic · General Scripting

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

By short_cirkuit · 2021-12-20

Description

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 (4)

short_cirkuit · 2022-09-06

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

with UI

obaida · 2022-08-22

here is the script with UI

Attachments

short_cirkuit · 2022-06-23

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?

Crop Bitmap Function

obaida · 2022-01-11


(
	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
)