Skip to content

Commit

Permalink
Fix 3ds max 2009
Browse files Browse the repository at this point in the history
  • Loading branch information
pudingus committed Oct 29, 2020
1 parent c2ea4c8 commit ce802fa
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
12 changes: 9 additions & 3 deletions scripts/max4ds/4ds_export.ms
Original file line number Diff line number Diff line change
Expand Up @@ -1112,9 +1112,13 @@ rollout MafiaTools_4dsExport "" ( --module

local baseMesh = copy basenode.mesh
local layers = #()


local numChannels =
if WM3_NumberOfChannels == undefined then 100
else WM3_NumberOfChannels mrph

local channelsPerLayer = 10
local maxLayers = ( (WM3_NumberOfChannels mrph) / channelsPerLayer ) as integer
local maxLayers = ( (numChannels) / channelsPerLayer ) as integer

local scl = scaleMatrix [unitscl,unitscl,unitscl]

Expand Down Expand Up @@ -1461,7 +1465,9 @@ rollout MafiaTools_4dsExport "" ( --module
)

fn MorpherHasData mrph = (
local numChannels = WM3_NumberOfChannels mrph
local numChannels =
if WM3_NumberOfChannels == undefined then 100
else WM3_NumberOfChannels mrph

local found = false

Expand Down
10 changes: 5 additions & 5 deletions scripts/max4ds/4ds_import.ms
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,11 @@ rollout MafiaTools_4dsImport "" ( --module

local tmod = Morpher()
addModifier nnode tmod
-- local maxver = (maxversion())[1]
-- if maxver < 22000 then (
-- max modify mode
-- select nnode
-- )
local maxver = (maxversion())[1]
if maxver < 15000 then ( --2013 works without selecting, 2009 doesnt, todo: find which version exactly
max modify mode
select nnode
)

local letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

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 @@ -215,9 +215,9 @@ rollout MafiaTools_4dsParser "" ( --module
WriteShort f m4ds.objects.count
for mobj in m4ds.objects do (
WriteObject f mobj
)
)

WriteByte f (m4ds.allow5ds as integer)
WriteByte f (if m4ds.allow5ds then 1 else 0)
)

-------------------------------------------------
Expand Down

0 comments on commit ce802fa

Please sign in to comment.