diff --git a/README.md b/README.md index 00abb85..a9e0cf1 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,10 @@ The current installer provides support for this versions: ## How to install Away Extensions 3dsmax ? -* For each supported 3dsmax version, a sepperate Setup-file is provided. Just run this file, and follow the instructions. +* Open 3dsmax +* Drag and drop the installer (*.mzp) into the 3dsmax-view. +* A dialog should appear, providing further instructions. +* After installation is complete, you should restart 3dsmax. In 3dsmax, you should see following * the MaxAWDExporter-plugin should be listet in the plugin manager. diff --git a/awayextensions3dsmax/AWDCommands/AWDCommands/AWDCommands-AWDToolBarCommands.mcr b/awayextensions3dsmax/AWDCommands/AWDCommands/AWDCommands-AWDToolBarCommands.mcr index 2385605..65596e4 100644 --- a/awayextensions3dsmax/AWDCommands/AWDCommands/AWDCommands-AWDToolBarCommands.mcr +++ b/awayextensions3dsmax/AWDCommands/AWDCommands/AWDCommands-AWDToolBarCommands.mcr @@ -32,13 +32,12 @@ rollout rl_install "About AWDExtensions3dsmax" width:306 height:300 ( bitmap bmp1 "Bitmap" pos:[3,3] width:300 height:300 fileName:"AWDAbout.bmp" - label txt_stats "" pos:[63,260] width:180 height:16 textAlign:#right + label txt_stats versionCompleteLocal pos:[63,260] width:180 height:16 textAlign:#right ) -CreateDialog rl_install 306 300 modal:false -rl_install.txt_stats.text=versionCompleteLocal +CreateDialog rl_install 306 300 modal:true ) macroScript OpenAWDHelpFile category:"AWDCommands" diff --git a/awayextensions3dsmax/AWDCommands/AWDCommands/AWDCommands-AddAWCameraModifier.mcr b/awayextensions3dsmax/AWDCommands/AWDCommands/AWDCommands-AddAWCameraModifier.mcr index 5b1cfc8..0cd122d 100644 --- a/awayextensions3dsmax/AWDCommands/AWDCommands/AWDCommands-AddAWCameraModifier.mcr +++ b/awayextensions3dsmax/AWDCommands/AWDCommands/AWDCommands-AddAWCameraModifier.mcr @@ -5,26 +5,20 @@ macroScript AddAWDCameraModifier if selection.count==0 then ( selected=#() - selectedObj=#() for i in objects do( if superclassof i==camera then( for m in i.modifiers do( if classof m as string=="AWDCamera" then( - appendIfUnique selected m - appendIfUnique selectedObj i + appendIfUnique selected i ) ) ) ) - if selected.count==1 then( - max modify mode - modPanel.setCurrentObject selected[1] - ) - else if selected.count>1 then( + if selected.count>0 then( answer=queryBox ("Nothing is selected.\n\n "+selected.count as string+" AWDCamera modifiers found in the scene.\n\n Select the Objects that are holding the modifiers ?") if answer==true then( - select selectedObj - ) + select selected + ) ) else messageBox ("No Object is selected.\n\n No AWDCamera modifiers found in the scene.\n\n To create a AWDCamera modifier, select one camera.") diff --git a/awayextensions3dsmax/AWDCommands/AWDCommands/AWDCommands-AddAWDAnimationSet.mcr b/awayextensions3dsmax/AWDCommands/AWDCommands/AWDCommands-AddAWDAnimationSet.mcr index 198ebd9..361d001 100644 --- a/awayextensions3dsmax/AWDCommands/AWDCommands/AWDCommands-AddAWDAnimationSet.mcr +++ b/awayextensions3dsmax/AWDCommands/AWDCommands/AWDCommands-AddAWDAnimationSet.mcr @@ -33,31 +33,18 @@ if meshes.count>=1 then ( ) else( selected=#() - selectedObj=#() testCnter=0 for i in objects do( for m in i.modifiers do( if classof m as string=="AWDAnimationSet" then( - appendIfUnique selected m - appendIfUnique selectedObj i + appendIfUnique selected i ) ) ) - if selected.count==1 then( - max modify mode - modPanel.setCurrentObject selected[1] - ) - else if selected.count>1 then( - answer=queryBox ("Nothing is selected.\n\n "+selected.count as string+" AWDAnimationSets modifiers found in the scene.\n\n Select the Objects that are holding the modifiers ?") - if answer==true then( - select selectedObj - ) - - ) - else( - messagebox ("Nothing is selected.\n\n No AWDAnimationSets found in scene") - ) - + answer=queryBox ("Nothing is selected.\n\n Found "+testCnter as string+" AnimationClips in the scene.\n\n Select the "+selected.count as string + " Objects that are holding the AnimationClips ?") + if answer==true then( + select selected + ) ) ) \ No newline at end of file diff --git a/awayextensions3dsmax/AWDCommands/AWDCommands/AWDCommands-AddAWDAnimator.mcr b/awayextensions3dsmax/AWDCommands/AWDCommands/AWDCommands-AddAWDAnimator.mcr index bed4663..3f11ff0 100644 --- a/awayextensions3dsmax/AWDCommands/AWDCommands/AWDCommands-AddAWDAnimator.mcr +++ b/awayextensions3dsmax/AWDCommands/AWDCommands/AWDCommands-AddAWDAnimator.mcr @@ -45,31 +45,32 @@ macroScript AddAWDAnimator else( meshes = $* selected=#() - selectedObj=#() firstmod=undefined if meshes!= undefined then ( for i in meshes do( for oneMod in i.modifiers do( if (classOf oneMod as string)=="AWDAnimator" then ( - appendIfUnique selected m - appendIfUnique selectedObj i + appendIfUnique selected i ) ) ) ) - if selected.count==1 then( - max modify mode - modPanel.setCurrentObject selected[1] - ) - else if selected.count>1 then( - answer=queryBox ("Nothing is selected.\n\n "+selected.count as string+" AWDAnimators modifiers found in the scene.\n\n Select the Objects that are holding the modifiers ?") + if selected.count>1 then( + answer=queryBox ("Nothing is selected.\n\nScene contains "+selected.count as string+" objects that have AWDAnimator-modifier applied.\n\nSelect the Objects ?") if answer==true then( - select selectedObj - ) - ) + select selected + ) + ) + else if selected.count==1 then( + answer=queryBox ("Nothing is selected.\n\n Scene contains "+selected.count as string+" object that has AWDAnimators-modifier applied.\n\nSelect the Object ?") + if answer==true then( + select selected + ) + ) else ( messagebox ("Nothing is selected.\n\n Scene contains no objects that have AWDAnimators-modifier applied.\n\n") + + ) ) - ) ) \ No newline at end of file diff --git a/awayextensions3dsmax/AWDCommands/AWDCommands/AWDCommands-AddAWDEffectModifier.mcr b/awayextensions3dsmax/AWDCommands/AWDCommands/AWDCommands-AddAWDEffectModifier.mcr index 87cec2b..2ee4b15 100644 --- a/awayextensions3dsmax/AWDCommands/AWDCommands/AWDCommands-AddAWDEffectModifier.mcr +++ b/awayextensions3dsmax/AWDCommands/AWDCommands/AWDCommands-AddAWDEffectModifier.mcr @@ -5,24 +5,17 @@ macroScript AddAWDEffectModifier if selection.count==0 then ( selected=#() - selectedObj=#() for i in objects do( for m in i.modifiers do( if classof m as string=="AWDEffectMethod" then( - appendIfUnique selected m - appendIfUnique selectedObj i + appendIfUnique selected i ) ) ) - - if selected.count==1 then( - max modify mode - modPanel.setCurrentObject selected[1] - ) - else if selected.count>1 then( + if selected.count>0 then( answer=queryBox ("Nothing is selected.\n\n "+selected.count as string+" AWDEffectMethod modifiers found in the scene.\n\n Select the Objects that are holding the modifiers ?") if answer==true then( - select selectedObj + select selected ) ) else messageBox ("No Object is selected.\n\n No AWDEffectMethod modifiers found in the scene.\n\n To create a AWDEffectMethod modifier, select one object.") diff --git a/awayextensions3dsmax/AWDCommands/AWDCommands/AWDCommands-AddAWDLightModifier.mcr b/awayextensions3dsmax/AWDCommands/AWDCommands/AWDCommands-AddAWDLightModifier.mcr index 41f1a6b..a161435 100644 --- a/awayextensions3dsmax/AWDCommands/AWDCommands/AWDCommands-AddAWDLightModifier.mcr +++ b/awayextensions3dsmax/AWDCommands/AWDCommands/AWDCommands-AddAWDLightModifier.mcr @@ -5,27 +5,20 @@ macroScript AddAWDLightModifier if selection.count==0 then ( selected=#() - selectedObj=#() for i in objects do( if superclassof i==light then( for m in i.modifiers do( if classof m as string=="AWDShadowMethod" then( - appendIfUnique selected m - appendIfUnique selectedObj i + appendIfUnique selected i ) ) ) ) - - if selected.count==1 then( - max modify mode - modPanel.setCurrentObject selected[1] - ) - else if selected.count>1 then( + if selected.count>0 then( answer=queryBox ("Nothing is selected.\n\n "+selected.count as string+" AWDShadowMethod modifiers found in the scene.\n\n Select the Objects that are holding the modifiers ?") if answer==true then( - select selectedObj - ) + select selected + ) ) else messageBox ("No Object is selected.\n\n No AWDShadowMethod modifiers found in the scene.\n\n To create a AWDShadowMethod modifier, select one light.") diff --git a/awayextensions3dsmax/AWDCommands/AWDCommands/AWDCommands-AddAWDMaterialSettings.mcr b/awayextensions3dsmax/AWDCommands/AWDCommands/AWDCommands-AddAWDMaterialSettings.mcr index e897642..224ba9e 100644 --- a/awayextensions3dsmax/AWDCommands/AWDCommands/AWDCommands-AddAWDMaterialSettings.mcr +++ b/awayextensions3dsmax/AWDCommands/AWDCommands/AWDCommands-AddAWDMaterialSettings.mcr @@ -8,7 +8,7 @@ macroScript addAWDMaterialSettings mtl=undefined --if material mode is "Compact-Mode" if MatEditor.mode ==#basic then ( - mtl = medit.GetCurMtl() + mtl = meditMaterials[activeMeditSlot] ) --if material mode is "Slate-Mode" else if MatEditor.mode ==#advanced then ( diff --git a/awayextensions3dsmax/AWDCommands/AWDCommands/AWDCommands-AddAWDSkeleton.mcr b/awayextensions3dsmax/AWDCommands/AWDCommands/AWDCommands-AddAWDSkeleton.mcr index d85eef4..6ae0951 100644 --- a/awayextensions3dsmax/AWDCommands/AWDCommands/AWDCommands-AddAWDSkeleton.mcr +++ b/awayextensions3dsmax/AWDCommands/AWDCommands/AWDCommands-AddAWDSkeleton.mcr @@ -34,25 +34,19 @@ else if meshes.count>1 then messagebox("AWDSkeleton Modifier can only be attache --if nothing is selected we check if nodes are in the scene else( selected=#() - selectedObj=#() for i in objects do( for m in i.modifiers do( if classof m as string=="AWDSkeleton" or classof m as string=="AWDSkeletonClone" then( - appendIfUnique selected m - appendIfUnique selectedObj m + appendIfUnique selected i ) ) ) - if selected.count==1 then( - max modify mode - modPanel.setCurrentObject selected[1] - ) - else if selected.count>1 then( - answer=queryBox ("Nothing is selected.\n\n "+selected.count as string+" AWD Skeleton modifiers found in the scene.\n\n Select the Objects that are holding the modifiers ?") + if selected.count>0 then( + answer=queryBox ("Nothing is selected.\n\n Found "+selected.count as string+" AWD Skeleton modifiers found in the scene.\n\n Select the Objects that are holding the modifiers ?") if answer==true then( - select selectedObj - ) - ) + select selected + ) + ) else( answer=messageBox ("No Object is selected.\n\n No AWD Skeleton modifiers found in the scene.\n\n To create a AWD skeleton modifier, select the root-bone of your rigg.") ) diff --git a/awayextensions3dsmax/AWDCommands/AWDCommands/AWDCommands-AddAWDTextureSettings.mcr b/awayextensions3dsmax/AWDCommands/AWDCommands/AWDCommands-AddAWDTextureSettings.mcr index 5f5bfae..cf756bc 100644 --- a/awayextensions3dsmax/AWDCommands/AWDCommands/AWDCommands-AddAWDTextureSettings.mcr +++ b/awayextensions3dsmax/AWDCommands/AWDCommands/AWDCommands-AddAWDTextureSettings.mcr @@ -7,7 +7,7 @@ macroScript addAWDTextureSettings thisTexMap=undefined --if material mode is "Compact-Mode" if MatEditor.mode ==#basic then ( - thisTexMap = medit.GetCurMtl() + thisTexMap = meditMaterials[activeMeditSlot] ) --if material mode is "Slate-Mode" else if MatEditor.mode ==#advanced then ( diff --git a/awayextensions3dsmax/AWDCommands/AWDCommands/AWDCommands-AddAWDVertexAnimSource.mcr b/awayextensions3dsmax/AWDCommands/AWDCommands/AWDCommands-AddAWDVertexAnimSource.mcr index 0e61a6d..9d59d9b 100644 --- a/awayextensions3dsmax/AWDCommands/AWDCommands/AWDCommands-AddAWDVertexAnimSource.mcr +++ b/awayextensions3dsmax/AWDCommands/AWDCommands/AWDCommands-AddAWDVertexAnimSource.mcr @@ -37,26 +37,20 @@ macroScript AddAWDVertexAnimSource else( meshes = $* selected=#() - selectedObj=#() if meshes!= undefined then ( for i in meshes do( for m in i.modifiers do( if classof m as string=="AWDVertexAnimSource" or classof m as string=="AWDVertexAnimSourceClone" then( - appendIfUnique selected m - appendIfUnique selectedObj i - ) + appendIfUnique selected i + ) ) ) - if selected.count==1 then( - max modify mode - modPanel.setCurrentObject selected[1] - ) - else if selected.count>1 then( - answer=queryBox ("Nothing is selected.\n\n "+selected.count as string+" AWDVertexAnimSource modifiers found in the scene.\n\n Select the Objects that are holding the modifiers ?") + if selected.count>0 then( + answer=queryBox ("Nothing is selected.\n\n "+selected.count as string+" AWDVertexAnimSource-modifier found in the scene.\n\n Select the Objects that are holding the modifiers ?") if answer==true then( - select selectedObj + select selected + ) ) - ) else( answer=messageBox ("No Object is selected.\n\n No AWDVertexAnimSource modifiers found in the scene.\n\n To create a AWD AWDVertexAnimSource modifier, select the animated mesh.") ) diff --git a/awayextensions3dsmax/AWDExporter/maxawdexporter_2010_32.dle b/awayextensions3dsmax/AWDExporter/maxawdexporter_2010_32.dle new file mode 100644 index 0000000..3903db4 Binary files /dev/null and b/awayextensions3dsmax/AWDExporter/maxawdexporter_2010_32.dle differ diff --git a/awayextensions3dsmax/AWDExporter/maxawdexporter_2011_32.dle b/awayextensions3dsmax/AWDExporter/maxawdexporter_2011_32.dle index 9a12281..b0d7af1 100644 Binary files a/awayextensions3dsmax/AWDExporter/maxawdexporter_2011_32.dle and b/awayextensions3dsmax/AWDExporter/maxawdexporter_2011_32.dle differ diff --git a/awayextensions3dsmax/AWDExporter/maxawdexporter_2011_64.dle b/awayextensions3dsmax/AWDExporter/maxawdexporter_2011_64.dle index b0bd4ef..3792d89 100644 Binary files a/awayextensions3dsmax/AWDExporter/maxawdexporter_2011_64.dle and b/awayextensions3dsmax/AWDExporter/maxawdexporter_2011_64.dle differ diff --git a/awayextensions3dsmax/AWDExporter/maxawdexporter_2012_32.dle b/awayextensions3dsmax/AWDExporter/maxawdexporter_2012_32.dle index 7c8edd9..6fa5d8a 100644 Binary files a/awayextensions3dsmax/AWDExporter/maxawdexporter_2012_32.dle and b/awayextensions3dsmax/AWDExporter/maxawdexporter_2012_32.dle differ diff --git a/awayextensions3dsmax/AWDExporter/maxawdexporter_2012_64.dle b/awayextensions3dsmax/AWDExporter/maxawdexporter_2012_64.dle index 920be0c..2984697 100644 Binary files a/awayextensions3dsmax/AWDExporter/maxawdexporter_2012_64.dle and b/awayextensions3dsmax/AWDExporter/maxawdexporter_2012_64.dle differ diff --git a/awayextensions3dsmax/AWDExporter/maxawdexporter_2013_32.dle b/awayextensions3dsmax/AWDExporter/maxawdexporter_2013_32.dle index c85184b..cfd0183 100644 Binary files a/awayextensions3dsmax/AWDExporter/maxawdexporter_2013_32.dle and b/awayextensions3dsmax/AWDExporter/maxawdexporter_2013_32.dle differ diff --git a/awayextensions3dsmax/AWDExporter/maxawdexporter_2013_64.dle b/awayextensions3dsmax/AWDExporter/maxawdexporter_2013_64.dle index d1a314e..c34c631 100644 Binary files a/awayextensions3dsmax/AWDExporter/maxawdexporter_2013_64.dle and b/awayextensions3dsmax/AWDExporter/maxawdexporter_2013_64.dle differ diff --git a/awayextensions3dsmax/AWDExporter/maxawdexporter_2014_64.dle b/awayextensions3dsmax/AWDExporter/maxawdexporter_2014_64.dle index 8aace40..83d6b2e 100644 Binary files a/awayextensions3dsmax/AWDExporter/maxawdexporter_2014_64.dle and b/awayextensions3dsmax/AWDExporter/maxawdexporter_2014_64.dle differ diff --git a/awayextensions3dsmax/AwayExtensions3dsMax/AwayExtensions3dsMax/3dsmaxversionLocal.xml b/awayextensions3dsmax/AwayExtensions3dsMax/AwayExtensions3dsMax/3dsmaxversionLocal.xml index b0098a8..cf44f93 100644 --- a/awayextensions3dsmax/AwayExtensions3dsMax/AwayExtensions3dsMax/3dsmaxversionLocal.xml +++ b/awayextensions3dsmax/AwayExtensions3dsMax/AwayExtensions3dsMax/3dsmaxversionLocal.xml @@ -1,2 +1,2 @@ - + diff --git a/awayextensions3dsmax/AwayExtensions3dsMax/AwayExtensions3dsMax/AWDCustomSettings/AWDMaterialSettings.ms b/awayextensions3dsmax/AwayExtensions3dsMax/AwayExtensions3dsMax/AWDCustomSettings/AWDMaterialSettings.ms index a69b10e..72a81d1 100644 --- a/awayextensions3dsmax/AwayExtensions3dsMax/AwayExtensions3dsMax/AWDCustomSettings/AWDMaterialSettings.ms +++ b/awayextensions3dsmax/AwayExtensions3dsMax/AwayExtensions3dsMax/AWDCustomSettings/AWDMaterialSettings.ms @@ -239,8 +239,8 @@ fn addAWDMaterialSettings thisMat = ( btn_removeambientenvMap.enabled=true ) on btn_chooseambientenvMap pressed do( - mtl=undefined - if MatEditor.mode ==#basic then mtl = medit.GetCurMtl() + mtl=undefined + if MatEditor.mode ==#basic then mtl = meditMaterials[activeMeditSlot] else if MatEditor.mode ==#advanced then mtl=sme.GetMtlInParamEditor() if mtl!=undefined then( fileIn (getDir #maxRoot + "\\plugins\\AwayExtensions3dsMax\\AWDCustomSettings\\AWDMaterialSettings.ms")--reload this file here, so the function is available after restoring the 3dsmax-scene @@ -332,7 +332,7 @@ fn addAWDMaterialSettings thisMat = ( dropdownlist ddl_lightMapblendMode "BlendMode" items:#("NORMAL", "LAYER", "MULTIPLY", "ADD" , "ALPHA" ) height:6 align:#left animatable:false on ddl_lightMapbase selected selectedIdx do ( mtl=undefined - if MatEditor.mode ==#basic then mtl = medit.GetCurMtl() + if MatEditor.mode ==#basic then mtl = meditMaterials[activeMeditSlot] else if MatEditor.mode ==#advanced then mtl=sme.GetMtlInParamEditor() if mtl!=undefined then( fileIn (getDir #maxRoot + "\\plugins\\AwayExtensions3dsMax\\AWDCustomSettings\\AWDMaterialSettings.ms")--reload this file here, so the function is available after restoring the 3dsmax-scene @@ -356,7 +356,7 @@ fn addAWDMaterialSettings thisMat = ( dropDownList ddl_cellDiffusebase "Base Method" items:#("BasicDiffuse", "GradientDiffuse", "WarpDiffuse") animateable:false on ddl_cellDiffusebase selected selectedIdx do ( mtl=undefined - if MatEditor.mode ==#basic then mtl = medit.GetCurMtl() + if MatEditor.mode ==#basic then mtl = meditMaterials[activeMeditSlot] else if MatEditor.mode ==#advanced then mtl=sme.GetMtlInParamEditor() if mtl!=undefined then( fileIn (getDir #maxRoot + "\\plugins\\AwayExtensions3dsMax\\AWDCustomSettings\\AWDMaterialSettings.ms")--reload this file here, so the function is available after restoring the 3dsmax-scene @@ -420,7 +420,7 @@ fn addAWDMaterialSettings thisMat = ( on ddl_ambient selected selectedIdx do ( mtl=undefined - if MatEditor.mode ==#basic then mtl = medit.GetCurMtl() + if MatEditor.mode ==#basic then mtl = meditMaterials[activeMeditSlot] else if MatEditor.mode ==#advanced then mtl=sme.GetMtlInParamEditor() if mtl!=undefined then( fileIn (getDir #maxRoot + "\\plugins\\AwayExtensions3dsMax\\AWDCustomSettings\\AWDMaterialSettings.ms")--reload this file here, so the function is available after restoring the 3dsmax-scene @@ -429,7 +429,7 @@ fn addAWDMaterialSettings thisMat = ( ) on ddl_diffuse selected selectedIdx do ( mtl=undefined - if MatEditor.mode ==#basic then mtl = medit.GetCurMtl() + if MatEditor.mode ==#basic then mtl = meditMaterials[activeMeditSlot] else if MatEditor.mode ==#advanced then mtl=sme.GetMtlInParamEditor() if mtl!=undefined then( fileIn (getDir #maxRoot + "\\plugins\\AwayExtensions3dsMax\\AWDCustomSettings\\AWDMaterialSettings.ms")--reload this file here, so the function is available after restoring the 3dsmax-scene @@ -438,7 +438,7 @@ fn addAWDMaterialSettings thisMat = ( ) on ddl_spec selected selectedIdx do ( mtl=undefined - if MatEditor.mode ==#basic then mtl = medit.GetCurMtl() + if MatEditor.mode ==#basic then mtl = meditMaterials[activeMeditSlot] else if MatEditor.mode ==#advanced then mtl=sme.GetMtlInParamEditor() if mtl!=undefined then( fileIn (getDir #maxRoot + "\\plugins\\AwayExtensions3dsMax\\AWDCustomSettings\\AWDMaterialSettings.ms")--reload this file here, so the function is available after restoring the 3dsmax-scene @@ -447,7 +447,7 @@ fn addAWDMaterialSettings thisMat = ( ) on ddl_normal selected selectedIdx do ( mtl=undefined - if MatEditor.mode ==#basic then mtl = medit.GetCurMtl() + if MatEditor.mode ==#basic then mtl = meditMaterials[activeMeditSlot] else if MatEditor.mode ==#advanced then mtl=sme.GetMtlInParamEditor() if mtl!=undefined then( fileIn (getDir #maxRoot + "\\plugins\\AwayExtensions3dsMax\\AWDCustomSettings\\AWDMaterialSettings.ms")--reload this file here, so the function is available after restoring the 3dsmax-scene @@ -498,7 +498,7 @@ fn addAWDMaterialSettings thisMat = ( ) on btn_add_effectMethod pressed do ( mtl=undefined - if MatEditor.mode ==#basic then mtl = medit.GetCurMtl() + if MatEditor.mode ==#basic then mtl = meditMaterials[activeMeditSlot] else if MatEditor.mode ==#advanced then mtl=sme.GetMtlInParamEditor() if mtl!=undefined then( fileIn (getDir #maxRoot + "\\plugins\\AwayExtensions3dsMax\\AWDCustomSettings\\AWDMaterialSettings.ms")--reload this file here, so the function is available after restoring the 3dsmax-scene @@ -639,7 +639,7 @@ fn addAWDMaterialSettings thisMat = ( if methodenabled then lbl_fxMethods.enabled=true else lbl_fxMethods.enabled=false mtl=undefined - if MatEditor.mode ==#basic then mtl = medit.GetCurMtl() + if MatEditor.mode ==#basic then mtl = meditMaterials[activeMeditSlot] else if MatEditor.mode ==#advanced then mtl=sme.GetMtlInParamEditor() if mtl!=undefined then( fileIn (getDir #maxRoot + "\\plugins\\AwayExtensions3dsMax\\AWDCustomSettings\\AWDMaterialSettings.ms")--reload this file here, so the function is available after restoring the 3dsmax-scene @@ -649,7 +649,7 @@ fn addAWDMaterialSettings thisMat = ( on btn_chooseshadowMod pressed do( mtl=undefined - if MatEditor.mode ==#basic then mtl = medit.GetCurMtl() + if MatEditor.mode ==#basic then mtl = meditMaterials[activeMeditSlot] else if MatEditor.mode ==#advanced then mtl=sme.GetMtlInParamEditor() if mtl!=undefined then( fileIn (getDir #maxRoot + "\\plugins\\AwayExtensions3dsMax\\AWDCustomSettings\\AWDMaterialSettings.ms")--reload this file here, so the function is available after restoring the 3dsmax-scene @@ -726,7 +726,7 @@ fn addAWDMaterialSettings thisMat = ( lbl_shading.enabled=true mtl=undefined - if MatEditor.mode ==#basic then mtl = medit.GetCurMtl() + if MatEditor.mode ==#basic then mtl = meditMaterials[activeMeditSlot] else if MatEditor.mode ==#advanced then mtl=sme.GetMtlInParamEditor() if mtl!=undefined then( fileIn (getDir #maxRoot + "\\plugins\\AwayExtensions3dsMax\\AWDCustomSettings\\AWDMaterialSettings.ms")--reload this file here, so the function is available after restoring the 3dsmax-scene @@ -774,7 +774,7 @@ fn addAWDMaterialSettings thisMat = ( lbl_shading.enabled=false mtl=undefined - if MatEditor.mode ==#basic then mtl = medit.GetCurMtl() + if MatEditor.mode ==#basic then mtl = meditMaterials[activeMeditSlot] else if MatEditor.mode ==#advanced then mtl=sme.GetMtlInParamEditor() if mtl!=undefined then( fileIn (getDir #maxRoot + "\\plugins\\AwayExtensions3dsMax\\AWDCustomSettings\\AWDMaterialSettings.ms")--reload this file here, so the function is available after restoring the 3dsmax-scene @@ -789,7 +789,7 @@ fn addAWDMaterialSettings thisMat = ( lbl_shading.enabled=false ) mtl=undefined - if MatEditor.mode ==#basic then mtl = medit.GetCurMtl() + if MatEditor.mode ==#basic then mtl = meditMaterials[activeMeditSlot] else if MatEditor.mode ==#advanced then mtl=sme.GetMtlInParamEditor() if mtl!=undefined then( fileIn (getDir #maxRoot + "\\plugins\\AwayExtensions3dsMax\\AWDCustomSettings\\AWDMaterialSettings.ms")--reload this file here, so the function is available after restoring the 3dsmax-scene @@ -913,7 +913,7 @@ fn addAWDMaterialSettings thisMat = ( else lbl_fxMethods.enabled=false mtl=undefined - if MatEditor.mode ==#basic then mtl = medit.GetCurMtl() + if MatEditor.mode ==#basic then mtl = meditMaterials[activeMeditSlot] else if MatEditor.mode ==#advanced then mtl=sme.GetMtlInParamEditor() if mtl!=undefined then( fileIn (getDir #maxRoot + "\\plugins\\AwayExtensions3dsMax\\AWDCustomSettings\\AWDMaterialSettings.ms")--reload this file here, so the function is available after restoring the 3dsmax-scene diff --git a/awayextensions3dsmax/AwayExtensions3dsMax/AwayExtensions3dsMax/AWDCustomSettings/AWDTextureSettings.ms b/awayextensions3dsmax/AwayExtensions3dsMax/AwayExtensions3dsMax/AWDCustomSettings/AWDTextureSettings.ms index c742e58..9b8de69 100644 --- a/awayextensions3dsmax/AwayExtensions3dsMax/AwayExtensions3dsMax/AWDCustomSettings/AWDTextureSettings.ms +++ b/awayextensions3dsmax/AwayExtensions3dsMax/AwayExtensions3dsMax/AWDCustomSettings/AWDTextureSettings.ms @@ -28,8 +28,6 @@ fn addAWDTextureSettings thisTex = ( saveEndFrames type:#intTab tabSize:0 tabSizeVariable:true saveSkipFrames type:#intTab tabSize:0 tabSizeVariable:true saveStitchFinals type:#boolTab tabSize:0 tabSizeVariable:true - saveLoops type:#boolTab tabSize:0 tabSizeVariable:true - saveTransform type:#boolTab tabSize:0 tabSizeVariable:true ) rollout AnimClipsRollout "Animation Clips" category:2 @@ -71,17 +69,14 @@ fn addAWDTextureSettings thisTex = ( append saveAnimSourceIDs (getAWDID() as string) append saveSkipFrames 0 append saveStitchFinals true - append saveLoops true - append saveTransform true valid=true ) catch() if not valid then messageBox("Error - clip was not added") mtl=undefined - if MatEditor.mode ==#basic then mtl = medit.GetCurMtl() + if MatEditor.mode ==#basic then mtl = meditMaterials[activeMeditSlot] else if MatEditor.mode ==#advanced then mtl=sme.GetMtlInParamEditor() if mtl!=undefined then( - global updateUI fileIn (getDir #maxRoot + "\\plugins\\AwayExtensions3dsMax\\AWDCustomSettings\\AWDTextureSettings.ms")--reload this file here, so the function is available after restoring the 3dsmax-scene updateUI mtl targetAnimClipsList.selection targetAnimClipsList.selection=(targetAnimClipsList.items.count) @@ -102,7 +97,7 @@ fn addAWDTextureSettings thisTex = ( if firstframetrue maxawdexporter_2012_32 maxawdexporter_2011_32 - maxawdexporter_2011_32 + maxawdexporter_2010_32 maxawdexporter_2013_32 maxawdexporter_2014_32 maxawd_2013_32 diff --git a/src/maxawdexporter.h b/src/maxawdexporter.h index be264d9..dbf0b41 100644 --- a/src/maxawdexporter.h +++ b/src/maxawdexporter.h @@ -62,6 +62,13 @@ typedef struct CustomCamera_struct { struct CustomCamera_struct *next; } CustomCamera_struct; +typedef struct ValidTexData_struct { + int height; + int width; + char* filePath; + struct ValidTexData_struct *next; +} ValidTexData_struct; + typedef struct CustomTexSettings_struct { bool replace; bool relative; @@ -72,7 +79,6 @@ typedef struct CustomTexSettings_struct { AWD_tex_type texType; struct CustomTexSettings_struct *next; } CustomTexSettings_struct; - class MaxAWDExporter : public SceneExport { private: Interface *maxInterface; @@ -180,6 +186,7 @@ class MaxAWDExporter : public SceneExport { void ExportSkeleton(INode *rootBone); void ExportUserAttributes(Animatable *obj, AWDAttrElement *elem); + void ExportCustomProps(INode *thisNode, AWDAttrElement *elem); void ExportUserAttributesForNode(INode *,Animatable *obj, AWDAttrElement *elem); AWDBlock * ExportCameraAndTextureExporter(INode * node, double *, AWDSceneBlock *, BlockSettings*); @@ -205,6 +212,8 @@ class MaxAWDExporter : public SceneExport { AWDBlock * ExportUVClip(AWDUVAnimation *); void ReadAWDShadowsMethods(Modifier *node_mod, AWDBlock * light); int checkIfUVMapExists(Mesh mesh, int numTris, int mapIdx); + + ValidTexData_struct MakeValidTexture(Bitmap *); CustomAttributes_struct GetCustomAWDObjectSettings(IDerivedObject *, Animatable *); CustomTexSettings_struct GetCustomAWDTextureSettings(BitmapTex *); void GetCustomAWDMaterialSettings(StdMat *, AWDMaterial * ); diff --git a/src/maxawdexporter_anim.cpp b/src/maxawdexporter_anim.cpp index 63f3089..95b7644 100644 --- a/src/maxawdexporter_anim.cpp +++ b/src/maxawdexporter_anim.cpp @@ -930,10 +930,28 @@ int MaxAWDExporter::ExportSkin(INode *node, ISkin *skin, awd_float64 **extWeight int *tmpIndices = (int*)malloc(numBones*sizeof(int)); // Retrieve weight/index for all joints in skin. for (iBone=0; iBoneGetAssignedBone(iVtx, iBone); - INode *bone = skin->GetBone(boneId); - tmpWeights[iBone] = context->GetBoneWeight(iVtx, iBone); - tmpIndices[iBone] = skel->IndexOfBone(bone); + double thisWeight=double(0.0); + int thisIdx=int(0); + // do we need the try/catch ? + // Was included while searching the bug that cashed crash when skin had not "removed zero weights" + // need to test if this is really needed + try{ + int boneId = context->GetAssignedBone(iVtx, iBone); + INode *bone = skin->GetBone(boneId); + thisWeight = double(context->GetBoneWeight(iVtx, iBone)); + thisIdx = int(skel->IndexOfBone(bone)); + } + catch(...){ + thisWeight=double(0.0); + thisIdx=int(0); + } + if (thisWeight==NULL) + thisWeight=double(0.0); + if (thisIdx==NULL) + thisIdx=int(0); + + tmpWeights[iBone] = double(thisWeight); + tmpIndices[iBone] = int(thisIdx); } // Retrieve most significant joint weights from temporary buffers // or after having run out of assigned bones for a vertex, set @@ -960,8 +978,9 @@ int MaxAWDExporter::ExportSkin(INode *node, ISkin *skin, awd_float64 **extWeight weightSum += weights[strIdx]; - // Set to zero to mark as already used. - tmpWeights[maxIBone] = 0.0; + // Set to zero to mark as already used. (only if maxIbone is a valid idx) + if(maxIBone>=0) + tmpWeights[maxIBone] = double(0.0); } else { weights[strIdx] = 0.0; @@ -1153,7 +1172,7 @@ AWDBlock * MaxAWDExporter::ExportAWDSkeletonClip(SkeletonCacheItem * skelCacheIt frameDur = floor(TicksToSec(ticksPerFrame) * 1000.0 + 0.5); // ms int start = skelClip->get_start_frame(); int end = skelClip->get_end_frame(); - int skip = 1 + skelClip->get_skip_frame(); + int skip = skelClip->get_skip_frame(); bool transform=skelClip->get_use_transforms(); skelCacheItem->IterReset(); @@ -1223,7 +1242,7 @@ AWDBlock * MaxAWDExporter::ExportAWDSkeletonClip(SkeletonCacheItem * skelCacheIt for (f=start; f<=end; f++) { skipf=f+skip; thisframeDur=frameDur; - while (f<(end-1)&&(f<=skipf)){ + while (f<(end-1)&&(fGetNumNormals();// for me, this is allways been 0 if (specificNormalCount==0){ specificNormals=NULL; - int numNorms = igame_mesh->GetNumberOfNormals(); - if (numNorms==0){ - useNormals=false; + if(igame_mesh->IsObjectSkinned()){ + igame_mesh->InitializeBinormalData(); + igame_mesh->InitializeData(); + } + // else{ + int numNorms = igame_mesh->GetNumberOfNormals(); + if (numNorms==0){ + useNormals=false; + // } } } } @@ -420,8 +426,8 @@ void MaxAWDExporter::ExportTriGeom(AWDTriGeom *awdGeom, Object *obj, INode *node } // if the object is skinned, we get the global normals if (jpv>0){ - if (normal) - normal=offsMtx*normal; + // if (normal) + // normal=offsMtx*normal; } vd->nx = normal.x; diff --git a/src/maxawdexporter_helper.cpp b/src/maxawdexporter_helper.cpp index 5a31361..791aa90 100644 --- a/src/maxawdexporter_helper.cpp +++ b/src/maxawdexporter_helper.cpp @@ -282,6 +282,7 @@ void MaxAWDExporter::ExportUserAttributesForNode(INode *node, Animatable *obj, A { if (!opts->ExportAttributes()) return; + ExportCustomProps(node, elem); BaseObject* node_bo = node->GetObjectRef(); if((node_bo->SuperClassID() == GEN_DERIVOB_CLASS_ID) || (node_bo->SuperClassID() == WSM_DERIVOB_CLASS_ID) || (node_bo->SuperClassID() == DERIVOB_CLASS_ID )) { @@ -324,6 +325,32 @@ void MaxAWDExporter::ExportUserAttributesForNode(INode *node, Animatable *obj, A } ExportUserAttributes(obj, elem); } +void MaxAWDExporter::ExportCustomProps(INode *thisNode, AWDAttrElement *elem) +{ + MSTR buffer; + thisNode->GetUserPropBuffer(buffer); + AWD_field_type type = AWD_FIELD_STRING; + awd_uint16 len = 0; + AWD_field_ptr ptr; + ptr.v = NULL; + ptr.str = W2A(buffer); + len = strlen(ptr.str); + if (len>0){ + if (ptr.v != NULL) { + if (ns == NULL) { + // Namespace has not yet been created; ns is a class + // variable that will be created only once and then + // reused for all user attributes. + char * ns_ptr=opts->AttributeNamespace();//dont free, as this will get freed in the opts delete + ns = new AWDNamespace(ns_ptr, strlen(ns_ptr)); + awd->add_namespace(ns); + } + char * thisName=W2A(_T("CustomProps")); + elem->set_attr(ns, thisName, strlen(thisName)+1, ptr, len, type); + free(thisName); + } + } +} void MaxAWDExporter::ExportUserAttributes(Animatable *obj, AWDAttrElement *elem) { if (!opts->ExportAttributes()) @@ -422,7 +449,7 @@ void MaxAWDExporter::ExportUserAttributes(Animatable *obj, AWDAttrElement *elem) awd->add_namespace(ns); } char * thisName=W2A(def.int_name); - elem->set_attr(ns, thisName, strlen(thisName), ptr, len, type); + elem->set_attr(ns, thisName, strlen(thisName)+1, ptr, len, type); free(thisName); } } diff --git a/src/maxawdexporter_materials.cpp b/src/maxawdexporter_materials.cpp index 735db49..1670ca8 100644 --- a/src/maxawdexporter_materials.cpp +++ b/src/maxawdexporter_materials.cpp @@ -717,9 +717,9 @@ AWDMaterial *MaxAWDExporter::ExportOneMaterial(StdMat *mtl) } if (hasDifftex || hasAmbTex){ awdMtl->set_type(AWD_MATTYPE_TEXTURE); - if ((hasDifftex)&&(awdDiffTex->get_isValid())){ + if ((hasDifftex)&&(awdDiffTex!=NULL)&&(awdDiffTex->get_isValid())){ awdMtl->set_texture(awdDiffTex);} - if ((hasAmbTex)&&(awdAmbTex->get_isValid())){ + if ((hasAmbTex)&&(awdAmbTex!=NULL)&&(awdAmbTex->get_isValid())){ awdMtl->set_ambientTexture(awdAmbTex);} } else{ @@ -741,9 +741,9 @@ AWDMaterial *MaxAWDExporter::ExportOneMaterial(StdMat *mtl) awdMtl->set_glossStrength(glossLevel); // this can optionally overwrite previous defined material-settings GetCustomAWDMaterialSettings(mtl, awdMtl); - if ((hasSpecTex)&&(awdSpecTex->get_isValid())){ + if ((hasSpecTex)&&(awdSpecTex!=NULL)&&(awdSpecTex->get_isValid())){ awdMtl->set_specTexture(awdSpecTex);} - if ((hasNormalTex)&&(awdNormalTex->get_isValid())){ + if ((hasNormalTex)&&(awdNormalTex!=NULL)&&(awdNormalTex->get_isValid())){ awdMtl->set_normalTexture(awdNormalTex);} awd->add_material(awdMtl); materialCache->Set(mtl, awdMtl); diff --git a/src/maxawdexporter_textures.cpp b/src/maxawdexporter_textures.cpp index f6df3ea..0142a0d 100644 --- a/src/maxawdexporter_textures.cpp +++ b/src/maxawdexporter_textures.cpp @@ -99,7 +99,7 @@ CustomTexSettings_struct MaxAWDExporter::GetCustomAWDTextureSettings(BitmapTex * AWDBitmapTexture * MaxAWDExporter::ExportBitmapTexture(BitmapTex *tex, AWDMaterial * curMat, AWD_tex_type cubeTexType, AWDTexPurpose_type tex_purpose) { - //output_debug_string(" -->ExportBitmapTexture"); + //output_debug_string(" -->ExportBitmapTexture"); AWDBitmapTexture *awdTex; if(tex!=NULL){ char * texname_ptr=W2A(tex->GetName()); @@ -120,9 +120,9 @@ AWDBitmapTexture * MaxAWDExporter::ExportBitmapTexture(BitmapTex *tex, AWDMateri } } /* TODO: - IMPLEMENT UV Tile ? - int tillingFlag=uvGen->GetTextureTiling(); - */ +IMPLEMENT UV Tile ? +int tillingFlag=uvGen->GetTextureTiling(); +*/ StdUVGen * uvGen=tex->GetUVGen(); if ((curMat!=NULL)&&(uvGen!=NULL)){ if((uvGen->GetUAng(0)!=0.0f)||(uvGen->GetVAng(0)!=0.0f)){ @@ -344,7 +344,7 @@ AWDBitmapTexture * MaxAWDExporter::ExportBitmapTexture(BitmapTex *tex, AWDMateri // Split path to retrieve name and concatenate to form base name _splitpath_s(absTexPath_ptr, NULL, 0, NULL, 0, fileName, 240, fileExt, 16); - if (!copyTxt) { + if (!copyTxt) { url = (char*)malloc(strlen(fileName)+strlen(fileExt)+1); strcpy(url, fileName); strcat(url, fileExt); @@ -476,22 +476,22 @@ AWDCubeTexture * MaxAWDExporter::ExportAWDCubeTexure(MultiMtl * awdCubeMat) cubeTex->make_invalide(); } else{ - AWDBitmapTexture * leftTex_ptr=ExportBitmapTexture(leftTex, NULL, cubeTex->get_tex_type(), FORCUBETEXTURE); + AWDBitmapTexture * leftTex_ptr=ExportBitmapTexture(leftTex, NULL, cubeTex->get_tex_type(), FORCUBETEXTURE); if(leftTex_ptr!=NULL) cubeTex->get_texture_blocks()->force_append(leftTex_ptr); - AWDBitmapTexture * rightTex_ptr=ExportBitmapTexture(rightTex, NULL, cubeTex->get_tex_type(), FORCUBETEXTURE); + AWDBitmapTexture * rightTex_ptr=ExportBitmapTexture(rightTex, NULL, cubeTex->get_tex_type(), FORCUBETEXTURE); if(rightTex_ptr!=NULL) cubeTex->get_texture_blocks()->force_append(rightTex_ptr); - AWDBitmapTexture * upTex_ptr=ExportBitmapTexture(upTex, NULL, cubeTex->get_tex_type(), FORCUBETEXTURE); + AWDBitmapTexture * upTex_ptr=ExportBitmapTexture(upTex, NULL, cubeTex->get_tex_type(), FORCUBETEXTURE); if(upTex_ptr!=NULL) cubeTex->get_texture_blocks()->force_append(upTex_ptr); - AWDBitmapTexture * downTex_ptr=ExportBitmapTexture(downTex, NULL, cubeTex->get_tex_type(), FORCUBETEXTURE); + AWDBitmapTexture * downTex_ptr=ExportBitmapTexture(downTex, NULL, cubeTex->get_tex_type(), FORCUBETEXTURE); if(downTex_ptr!=NULL) cubeTex->get_texture_blocks()->force_append(downTex_ptr); - AWDBitmapTexture * frontTex_ptr=ExportBitmapTexture(frontTex, NULL, cubeTex->get_tex_type(), FORCUBETEXTURE); + AWDBitmapTexture * frontTex_ptr=ExportBitmapTexture(frontTex, NULL, cubeTex->get_tex_type(), FORCUBETEXTURE); if(frontTex_ptr!=NULL) cubeTex->get_texture_blocks()->force_append(frontTex_ptr); - AWDBitmapTexture * backTex_ptr=ExportBitmapTexture(backTex, NULL, cubeTex->get_tex_type(), FORCUBETEXTURE); + AWDBitmapTexture * backTex_ptr=ExportBitmapTexture(backTex, NULL, cubeTex->get_tex_type(), FORCUBETEXTURE); if(backTex_ptr!=NULL) cubeTex->get_texture_blocks()->force_append(backTex_ptr); if(cubeTex->get_texture_blocks()->get_num_blocks()!=6){