From 4f834e6ea6b9632d34edaef19128b88bba5c311c Mon Sep 17 00:00:00 2001 From: pudingus <39903631+pudingus@users.noreply.github.com> Date: Thu, 5 Aug 2021 19:33:14 +0200 Subject: [PATCH] Fix error when opening material --- scripts/max4ds/init.ms | 2 +- scripts/max4ds/material.ms | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/scripts/max4ds/init.ms b/scripts/max4ds/init.ms index bcc425b..e8d6ab2 100644 --- a/scripts/max4ds/init.ms +++ b/scripts/max4ds/init.ms @@ -2,7 +2,7 @@ local set_heapsize = 64 * 1024 * 1024 --64 MiB if heapsize < set_heapsize then heapsize = set_heapsize - global Max4ds_version = "v0.8.0" + global Max4ds_version = "v0.8.1" --global Max4ds_scriptsPath = getFilenamePath (getThisScriptFilename()) fn DisableScript file = ( diff --git a/scripts/max4ds/material.ms b/scripts/max4ds/material.ms index 7655e8a..32714fd 100644 --- a/scripts/max4ds/material.ms +++ b/scripts/max4ds/material.ms @@ -417,11 +417,15 @@ remap:#( grpDiffuse.width = rltParams.width - 16 grpEnv.width = rltParams.width - 16 grpAlpha.width = rltParams.width - 16 - grpAnim.width = rltParams.width - 16 - btnDiffuseMap.width = rltParams.width - btnDiffuseMap.pos.x - 16 - btnEnvMap.width = rltParams.width - btnEnvMap.pos.x - 16 - btnAlphaMap.width = rltParams.width - btnAlphaMap.pos.x - 16 - ddlEnvType.width = rltParams.width - ddlEnvType.pos.x - 16 + grpAnim.width = rltParams.width - 16 + + local maxver = (maxVersion())[1] + if maxVer >= 21000 do ( + btnDiffuseMap.width = rltParams.width - btnDiffuseMap.pos.x - 16 + btnEnvMap.width = rltParams.width - btnEnvMap.pos.x - 16 + btnAlphaMap.width = rltParams.width - btnAlphaMap.pos.x - 16 + ddlEnvType.width = rltParams.width - ddlEnvType.pos.x - 16 + ) ::mat4ds_disable_set = undefined --format "on open\n"