Skip to content

Commit

Permalink
Add warning when importing morph lods
Browse files Browse the repository at this point in the history
-Fix billboards
-Better material defaults
-Increase initial height of param editor
  • Loading branch information
pudingus committed Nov 26, 2020
1 parent c874c98 commit 7d1849f
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 11 deletions.
9 changes: 7 additions & 2 deletions scripts/max4ds/4ds_import.ms
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ rollout MafiaTools_4dsImport "" ( --module
local Layers = ::MafiaTools_Layers
local util = ::MafiaTools_Util
-----------

local BAD_TYPES = #()


fn GetMafParams nnode = (
custAttributes.add nnode MafParams_def baseObject:false
Expand Down Expand Up @@ -120,6 +123,10 @@ rollout MafiaTools_4dsImport "" ( --module
fn CreateMorph mmorph mmesh nnode unitscale = (
local baseMesh = mmesh.lods[1].mesh
local meshes = #()

if mmorph.lods.count > 1 then (
BAD_TYPES[4] = "Morph lods"
)

for region in mmorph.lods[1].regions do (
local regionMeshes = #()
Expand Down Expand Up @@ -474,8 +481,6 @@ rollout MafiaTools_4dsImport "" ( --module

mesh mesh:ocl.mesh wirecolor:(color 178 89 255)
)

local BAD_TYPES = #()

fn CreateObjects mobjects filename unitscale materials = (
local buffer = TWorldBuffer()
Expand Down
4 changes: 2 additions & 2 deletions scripts/max4ds/4ds_parser.ms
Original file line number Diff line number Diff line change
Expand Up @@ -1119,8 +1119,8 @@ rollout MafiaTools_4dsParser "" ( --module
)

fn WriteBillboard f mbillboard = (
WriteU8 f (mbillboard.rotAxis - 1)
WriteU32 f (mbillboard.rotMode - 1)
WriteU32 f (mbillboard.rotAxis - 1)
WriteU8 f (mbillboard.rotMode - 1)
)

-------------------------------------------------
Expand Down
10 changes: 5 additions & 5 deletions scripts/max4ds/material.ms
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ remap:#(#(#isAnimatedM,#useMips,#useColoring,#useColorKey,#useAddBlend),#(#anima
colored type:#boolean ui:colored default:false --28
mipMapping type:#boolean ui:mipMapping default:true --24
animatedDiffuse type:#boolean ui:animatedDiffuse default:false --27 --animovaná textura difuze
animFrames type:#integer ui:animFrames default:1
animPeriod type:#integer ui:animPeriod default:1
animFrames type:#integer ui:animFrames default:0
animPeriod type:#integer ui:animPeriod default:50

--20 - Environment Map
envOverlay type:#boolean ui:envOverlay default:true --9
Expand Down Expand Up @@ -214,11 +214,11 @@ remap:#(#(#isAnimatedM,#useMips,#useColoring,#useColorKey,#useAddBlend),#(#anima
checkbox animatedDiffuse "Animated" align:#left

checkbox colored "Colored" across:2
spinner animFrames "Frames" range:[0,1000,1] align:#left fieldwidth:40 type:#integer offset:[3,2]
spinner animFrames "Frames " range:[0,100,0] align:#left fieldwidth:40 type:#integer offset:[3,2] tooltip:"Total number of frames"


checkbox mipMapping "Mip mapping" align:#left across:2
spinner animPeriod "Period " range:[0,3600000,1] align:#left fieldwidth:40 type:#integer offset:[5,0]
spinner animPeriod "Delay (ms)" range:[0,3600000,0] align:#left fieldwidth:40 type:#integer offset:[2,0] tooltip:"Delay between frames in milliseconds"
label afasfa ""
)

Expand Down Expand Up @@ -252,7 +252,7 @@ remap:#(#(#isAnimatedM,#useMips,#useColoring,#useColorKey,#useAddBlend),#(#anima
checkbox chkImageAlpha "Image alpha" align:#left
)
label d ""
groupBox group1 "" pos:[160,144] width:120 height:75
groupBox group1 "" pos:[160,144] width:130 height:75

on genPreview pressed do (
if 'Diffuse Map' != undefined then (
Expand Down
4 changes: 2 additions & 2 deletions scripts/max4ds/ui_param_editor.ms
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ global MafParamEditor
rollout rltBbrd ""
(
radiobuttons rotMode "Rotation mode:" labels:#("All axes", "Single axis:") align:#left columns:1
dropdownlist rotAxis "" items:#("X", "Y", "Z") offset:[20,0] width:50
dropdownlist rotAxis "" items:#("X", "Z", "Y") offset:[20,0] width:50

on rotMode changed val do (
gp.rotMode = val
Expand Down Expand Up @@ -573,7 +573,7 @@ global MafParamEditor
)
)
else (
floater = newRolloutFloater title 190 470
floater = newRolloutFloater title 190 490
)

if floater.open then (
Expand Down

0 comments on commit 7d1849f

Please sign in to comment.