1
General CG Discussion / Re: Help with Max scripting
« on: 2025-08-26, 09:35:16 »
try this:
also, I don't think you need the edit poly and force selection - so the simplified function:
Code: [Select]
if isProperty uMod #packNoParams then
(
uMod.flattenMapNoParams()
)
else if isProperty uMod.unwrap #packNoParams then
(
uMod.unwrap.flattenMapNoParams()
also, I don't think you need the edit poly and force selection - so the simplified function:
Code: [Select]
fn addUnwrapPackSingle obj mapChannel:2 =
(
local prevSel = selection as array
select obj
-- Add the unwrap modifier
local uMod = Unwrap_UVW()
addModifier obj uMod
uMod.unwrap.setMapChannel mapChannel
-- Set current modifier to Unwrap
modPanel.setCurrentObject uMod
-- Run Pack ► Flatten
if isProperty uMod #packNoParams then
(
uMod.flattenMapNoParams()
)
else if isProperty uMod.unwrap #packNoParams then
(
uMod.unwrap.flattenMapNoParams()
)
-- Restore selection
select prevSel
)