Jump to content
3D Coat Forums
PolyHertz

3DS Max Applink - Complete Rewrite

Recommended Posts

Over the past few months I've created a completely new applink from scratch for use between 3DSMax and 3D-Coat, but after having posted about it for a while in the old applink thread it's about time to give it its own dedicated one.

3DS Max compatibility: 2012 - 2017
3D-Coat compatibility: v3.7 - v4.5

Automatic Installation:
   1. drag-drop mzp file onto max window, or go to Scripting/Maxscript > Open Script and run the mzp from there.
   2. After install is successfully completed, find the app under Customize > Keyboard/Toolbar tab > Category: GregsScripts.

Manual installation:
   1. Open mzp file like a regular zip file (using 7zip, winrar, etc.) and extract the "3DCapplink" folder
   2. Copy the .BMP files to your max icons directory (search for "Icons" or "IconsDark" in you Max directory depending on your theme).
   3. Create a folder inside your Windows Documents directory called "Applink_Max3DC", and copy all the .MAT, .MS, and .TXT files there.
   4. Run the file "GregsScripts-g_3DCappLink.mcr" the same way you would the mzp during auto-installation.
   5. After install is successfully completed, find the app under Customize > Keyboard/Toolbar tab > Category: GregsScripts.

--------------------
Creating a custom material preset:
    1. Create you're material however you want, as any type you want (except for DirectX materials).
        Multi-Sub materials are fine too, just don't use a multi-sub inside another multi-sub.
    2. Create a series of blank/dummy texture files named as follows:
        color.jpg , opacity.jpg , rough.jpg , gloss.jpg , specular_color.jpg , metalness.jpg , normal.jpg , emissive.jpg , ao.jpg
    3. Add these files to your material where ever you want the corresponding 3D-Coat maps to be plugged into.
        The maps from 3D-Coat do NOT have to be jpgs, but should all be one format (tga, png, etc.)
    4. In Compact Material Editor on the top menu bar go to Material > Get Material. Or if in the Slate Material Editor the "Materials/Map Browser" window will already be visible on the left.
        In the "Material/Maps Browser" click the top left down arrow > New Material Library...
        Save the Material Library file to the Windows documents folder named "Applink_Max3DC". The material file can be named whatever you want, but it must have the ".mat" extension.
        Drag-drop the material from the Material Editor on to the newly created Material Library listed in the "Material/Map Browser"
        Right click on the Material Library (ie. the ".mat" file in the "Material/Map Browser") > the file path > save.
    5. That's it, you're done! Next time the applink is started your preset will be shown in the drop down list be ready to be used.
Material preset Utility:
    -Right click on the material presets drop down menu, a new menu will appear that lets you assign scene settings to each preset.
    -Right click on any arrows to reset that setting to 'ignore' (ie. don't do anything to that scene setting when using the material preset)
    -If you assign a setting to "CURRENT SCENE" it will take affect immediately, but for any other selectable presets you need to press Accept or OK button for them to be saved.
    
Material presets known limitations:
    -Unused maps from preset need to be maually removed (opacity.jpg, emissive.jpg, etc.), so only include the ones you're sure you will be exporting from 3D-Coat when using that preset.
    -Material presets do NOT support materials that use "bitmaps" instead of "bitmapTextures". What's the difference? A bitmapTexture lets you mess with the bitmaps settings (like output curves), Bitmaps however don't (in DirectX materials for example).
    -If a preset fails to load on import (like if it requires vray and you don't have vray installed) the objects will use the Default preset (ie. no preset) instead.
    -Presets should not be multi-sub materials, because then you can end up with multi sub materials inside other multi sub materials, and that hasn't been tested. It -might- work, but I'm really just not sure.
 
-------------------------------------
Release notes v1.9a

Update: 3DS Max Applink v1.9a

Changes:
-Fixes glitch caused by switching languages while in docked mode.
-Resets UI scale when clicking "Dock Mode Toggle" to exit docked mode.
-Dummy textures now included inside applink mzp file for those that want to create their own presets (just open it like a normal zip file).

 

NOTE: v1.9 had many under-the-hood changes, so if you run into any major issues it might be worth trying the previous version 1.8f which can be found here.

  • Like 4

Share this post


Link to post
Share on other sites

This applink is awesome, now. Goes far beyond what I thought was even possible. The ability to export to Max with your materials all setup in Arch & Design and/ or use VRay or Corona mats is something I don't think dDo, Substance Painter...anybody, has right now. Thanks a ton for all the great work on it. :good:

  • Like 1

Share this post


Link to post
Share on other sites

Update: https://dl.dropboxusercontent.com/u/4210886/3ds%20Max%20Applink%20v1.6b.mzp

 

Release notes (1.6b):

-Import features added in 1.6a can now be enabled/disabled individually (right click on "Import" button). All have been set to disabled by default.
-If user right clicks on "Dock Mode Toggle" button it'll dock to the right side. So left click = left side, right click = right side.
-Fixed a bug with material presets which occurred when users imported manually (instead of using "auto import").
-Fixed a bug where if Auto Switch was enabled but Auto Import wasn't, Max would repeatedly minimize/maximize until applink was closed or auto import was enabled.
-Version history and basic readme.txt explaining features now included in mzp file.
-Right clicking on "To 3D-Coat" button will now export mesh without auto-importing it into 3D-Coat;
    --Useful if want to use Applinks extended features (No Prompt / Auto Load app / Auto Switch app) without dealing with 3DC UI undocking bug.
    --exported obj will appear in specified temporary files / Exchange folder as input.obj
    --Can use "Export to" just like always to return to Max, but the "Export to Original App" option wont be shown in the 3DC file menu.

Edited by PolyHertz

Share this post


Link to post
Share on other sites

Update: https://dl.dropboxusercontent.com/u/4210886/3ds%20Max%20Applink%20v1.6b.mzp

 

Release notes (1.6b):

-Import features added in 1.6a can now be enabled/disabled individually (right click on "Import" button). All have been set to disabled by default.

-If user right clicks on "Dock Mode Toggle" button it'll dock to the right side. So left click = left side, right click = right side.

-Fixed a bug with material presets which occurred when users imported manually (instead of using "auto import").

-Fixed a bug where if Auto Switch was enabled but Auto Import wasn't, Max would repeatedly minimize/maximize until applink was closed or auto import was enabled.

-Version history and basic readme.txt explaining features now included in mzp file.

-Right clicking on "To 3D-Coat" button will now export mesh without auto-importing it into 3D-Coat;

    --Useful if want to use Applinks extended features (No Prompt / Auto Load app / Auto Switch app) without dealing with 3DC UI undocking bug.

    --exported obj will appear in specified temporary files / Exchange folder as input.obj

    --Can use "Export to" just like always to return to Max, but the "Export to Original App" option wont be shown in the 3DC file menu.

Thanks for the update.  :good:

This is definitely the most bestest Applink, by far. :)

Share this post


Link to post
Share on other sites

Hello! Cool script, but I can`t get it worked :( my 3ds Max (2016 with SP2) just stucks forever on import... Only "Default (no preset used)" works. I`m doing all like in this youtube.com/watch?v=Pwde7LiJA38 video

Share this post


Link to post
Share on other sites

Hey MikeMS, think you could post an example file this is happening with? Also, which version of the script are you using (1.6b or earlier?), and are you importing manually or via Auto-Import?

Share this post


Link to post
Share on other sites

Yes, 1.6b.

Installed your script and set up all parameters in it (like in video). Also choosed Mental Ray as a renderer (clear scene).

Launched 3d-coat, choosed "Paint UV Mapped Mesh (Per-Pixel)", choosed robot and select smartmaterial, make a fill whole layer with smart material and then File --> Open in original app. All options is set up like in video demo...

Sorry my english ))

 

P.S.: I can see exported obj, mtl and png`s at C:\Users\Don\Documents\3DC2Mudbox\Objects\

Share this post


Link to post
Share on other sites

Looks like I found what was wrong!

Becose 3ds max obj importer remember setting from previous obj import (in which I turned off "import materials") so script can`t find any material on object after importing it...

So, to fix this, in max I just imported any obj with "import materials" option checked.

And after this - your script starts working without issues :)

Edited by MikeMS
  • Like 1

Share this post


Link to post
Share on other sites

Small update: https://dl.dropboxusercontent.com/u/4210886/3ds%20Max%20Applink%20v1.6c.mzp

 

-Fixes bug that would cause import to hang if user tried to use a material preset while also having material import disabled in the Max OBJ import dialog. Presets will now be ignored if materials disabled in the OBJ importer.

 

Thanks MikeMS for letting me know about it :)

Edited by PolyHertz
  • Like 2

Share this post


Link to post
Share on other sites

By the way, attached is the 3D Coat 2 Thea Template material. You can copy the .mat file to your Documents/Applink_Max3DC directory, so that the Applink will store it as a preset. Don't yet know how to hook the maps up automatically. I tried and tried and tried for about 5hrs to figure out how to get other presets to work with the applink, but thus far it works except for the need to look up the location of your image maps.

 

 

 

 

3D Coat 2 Thea.rar

Share this post


Link to post
Share on other sites

Update: https://dl.dropboxusercontent.com/u/4210886/3ds%20Max%20Applink%20v1.7.mzp

 

Release notes (v1.7):

-Added VRay, Thea, and Corona material presets.
-Added option to keep old material when overwriting a mesh (in right click "Import" button options)
-Added ability to load textures from directories other then the one where obj file is located.
-Fixed bug that could happen if user added a blank, corrupt, or otherwise unusable material preset.
-Removed Opacity checkbox, as it no longer served any real purpose.

Share this post


Link to post
Share on other sites

hi PolyHertz,

let me start with thanking you for this great work of yours. This is a very comfortable app link, especially compared to some solutions found in other tools.

I do have some questions to this app link.

- when I send the model back to 3dsMax it imports a new model instead of assigning the changes to the original model that has been sent to 3dc to be painted. Is it possible to do this differently? Of course I could then delete the original model in 3dsMax and use the new import every time but this might cause additional work to do if the original model is linked to something or the other way around. Similar case if the original model is used in wiring or other connections.

- how are the gamma corrections handled for the textures? Usually the diffuse will be gamma corrected while normal maps and some other maps are imported with a gamma overwrite of 1.0

- You once mentioned problems with the Stingray shader. Sadly I have no clue about programming or scripting. Therefore my idea might be totally wrong. As the Stingray shader is a FX shader which can also be seen as a text file and possibly be made to be imported by adding that whole text passage into your script to be created while the appropriate textures are then replaced with the newly created ones.

 

Thanks again for your great work

Share this post


Link to post
Share on other sites

Hey puntoit,

The next version will have those features (import only materials and reintroduced Stingray shader). :)

As for gamma, not really doing anything special there. The presets change the output curve on gloss textures, but otherwise the maps are left alone.

Share this post


Link to post
Share on other sites

Hey puntoit,

The next version will have those features (import only materials and reintroduced Stingray shader). :)

As for gamma, not really doing anything special there. The presets change the output curve on gloss textures, but otherwise the maps are left alone.

The presets should already have the proper gamma chosen for each map type. Color maps default to Max's set gamma (2.2) and grayscale maps, like gloss and metalness, linear 1.0

Share this post


Link to post
Share on other sites

Hi PolyHertz, thanks for the answer. The features for the next version sound very good. You are really doing a great job here,

 

Hi AbnRanger, I was just confused as when I am looking at the Bitmap node in 3ds Max and click on the path for the bitmap it keeps the information if it has a Gamma Overwrite or not. When I however look at the material that is being created with the app link none of them has an Overwrite.

Share this post


Link to post
Share on other sites

Hi PolyHertz, thanks for the answer. The features for the next version sound very good. You are really doing a great job here,

 

Hi AbnRanger, I was just confused as when I am looking at the Bitmap node in 3ds Max and click on the path for the bitmap it keeps the information if it has a Gamma Overwrite or not. When I however look at the material that is being created with the app link none of them has an Overwrite.

The Arch Design preset should have the greyscale maps (gloss) in linear 1.0 rather than automatic (2.2). The default preset doesn't, I don't think.

Share this post


Link to post
Share on other sites

Yea the maps input gamma (ie. Gamma Override) is not touched at all, just the output curves. Afaik 3D-Coat exports maps with Gamma at 1.0.

I could potentially incorporate a universal Gamma override per-map type (ie. gloss) that users could control in the Presets Utility, though it'd only be possible for Max 2014+

 

Anyhow, if you guys think there should be any changes to specific material presets just upload a .mat file and I can incorporate it :)

Share this post


Link to post
Share on other sites

Yea the maps input gamma (ie. Gamma Override) is not touched at all, just the output curves. Afaik 3D-Coat exports maps with Gamma at 1.0.

I could potentially incorporate a universal Gamma override per-map type (ie. gloss) that users could control in the Presets Utility, though it'd only be possible for Max 2014+

 

Anyhow, if you guys think there should be any changes to specific material presets just upload a .mat file and I can incorporate it :)

Gamma 1.00... If you are talking about the gamma setting in the export panel that is a mid-tone gamma correction exposure slider... 3DC uses  2.2 gamma and I believe all maps are exported at 2.2 gamma. I will show you my photoshop workspace  which is 2.2 gamma. The correction exposure control is set a 1.00 gamma. This can also be seen in the Level controls... The midtone is set at 1.00 but this is all in the 2.2 gamma workspace.

 

Now 3DC does not use an RGB / sRGB embedded profile but the gamma used is 2.2 for exporting.

That is the need why some maps need the override in the Mat preset.

I far as I understand the above information is correct, I am not opposed to being corrected though...

Also If I have misunderstood your statement, I am sorry...

post-518-0-86469300-1456549334_thumb.png

Edited by digman

Share this post


Link to post
Share on other sites

Hello, I am  having trouble setting up the Creating custom material presets: part of the instructions. Do i create the .jpg in the slate material editor or the compact material editor? Do i use a standard material? If the material is made in the slate material editor and use a standard material where do i connect the rough.jpg , metalness.jpg , emissive.jpg , ao.jpg?  Can i use .png instead of .jpg? Any help would be greatly appreciated. Thanks for your time.

Using 3ds Max 2016 , 3d Coat 4.5.19(CUDA)(GL64), 3ds Max Applink v1.7.mzp

 

lmnop2345@gmail.com

Share this post


Link to post
Share on other sites

Here's a more detailed explanation of creating material presets:

 

Creating a custom material preset:
    1. Create you're material however you want, as any type you want (except for DirectX materials).
        Multi-Sub materials are fine too, just don't use a multi-sub inside another multi-sub.
    2. Create a series of blank/dummy texture files named as follows:
        color.jpg , opacity.jpg , rough.jpg , gloss.jpg , specular_color.jpg , metalness.jpg , normal.jpg , emissive.jpg , ao.jpg
    3. Add these files to your material where ever you want the corresponding 3D-Coat maps to be plugged into.
        The maps from 3D-Coat do NOT have to be jpgs, but should all be one format (tga, png, etc.)
    4. In Compact Material Editor on the top menu bar go to Material > Get Material. Or if in the Slate Material Editor the "Materials/Map Browser" window will already be visible on the left.
        In the "Material/Maps Browser" click the top left down arrow > New Material Library...
        Save the Material Library file to the Windows documents folder named "Applink_Max3DC". The material file can be named whatever you want, but it must have the ".mat" extension.
        Drag-drop the material from the Material Editor on to the newly created Material Library listed in the "Material/Map Browser"
        Right click on the Material Library (ie. the ".mat" file in the "Material/Map Browser") > the file path > save.
    5. That's it, you're done! Next time the applink is started your preset will be shown in the drop down list be ready to be used.

Edited by PolyHertz
  • Like 1

Share this post


Link to post
Share on other sites

Update: https://dl.dropboxusercontent.com/u/4210886/3ds%20Max%20Applink%20v1.8.mzp

 

release notes ( v1.8 ):
-Added option to create Material presets using maxscript files.
    --Stingray shader re-introduced as modular maxscript file.
    --Stingray shader contains notes and all info needed for creation of additional maxscript shaders (just open it in any text editor)
    --Maxscript materials and material library files should not share names else it will confuse the preset utility (ie. having both fancyMaterial.mat and fancyMaterial.ms in the same folder is bad)
    --"Auto Switch to Max" + "Auto Import" features may work slower when using Maxscript materials due to a memory bug in Max (which Autodesk will hopefully address at some point).
-Added option to import only materials.
    --Just like with "Auto Overwrite Old mesh", this feature is name dependent. As such, names of Materials/Meshs should be unique and never changed while in 3D-Coat.
    --Note that Multi-sub materials are not yet supported by this mode.
-Added option to Override Gamma universally / for all presets per-map type (gloss, specular color ,etc.) via the Material Presets Utility.
-Added right click options menu to "Auto Clear Temp On Close", which lets users choose if they want to keep all currently in use textures, or just delete everything (default).
-Added right click options menu to "Auto Launch 3DS Max", which lets users choose if they want to launch the applink script on Max startup not.
-Added right click feature for "3D-Coat exe (auto launch)" drop down that makes it now open up the selected directory just like with "Temp Files Directory".
-Modified import feature so that files can be imported multiple times in a row. Re-introduction of feature found in earlier versions.
-Moved right click options menu for "Auto Overwrite Old mesh" to the option itself instead of the "Import" button.
-Fixed bug that caused material editor to fail to add the newly imported materials.

Edited by PolyHertz

Share this post


Link to post
Share on other sites

Another update (mostly bug fixes this time): https://dl.dropboxusercontent.com/u/4210886/3ds%20Max%20Applink%20v1.8a.mzp

 

Changes:

-Various improvements to "Import Only Materials" feature;
    --Multi-Sub materials now supported.
    --Materials import into material editor even if there are no meshs in scene to assign them to.
    --Material names are now correct.
    --Optimized for faster importing.
-Added right click options menu on Import button, which lets user choose between two methods of importing;
    1. Default - Only allow one import per-3DC export.
    2. Debug - Allows user to import the same file repeatedly (via the "Import" button).
    Note; Second method can cause 3DC export to fail if used together with "Auto Import" (due to a bug in 3DC, not the applink), especially with larger files. Should only be used for testing purposes.
-All name-sensitive function now support spaces and dashes (ie. "my mesh name" and "my-mesh-name" will both work now).
-Fixed bug with directX materials which could cause non-Multi/Sub materials to fail on import.
-Will now automatically apply materials to meshs that don't have one when being exported to paint room.

Edited by PolyHertz

Share this post


Link to post
Share on other sites

Small update: https://dl.dropboxusercontent.com/u/4210886/3ds%20Max%20Applink%20v1.8b.mzp

 

changes:

-Added right click options menu for "Import Only Materials", which lets users choose if they want to add imported materials to Material Editor, Objects, or both. (default is both).
-Fixed a bug that could cause "Import Only Materials" to fail outright.

 

---

So, anything else you guys want added? atp I don't have any plans for improvements/features/options past this release.

I can hardly believe how much of my free time over the last few months has been spent on this, wish I'd gotten in on the ground floor when Andrew was paying people for this sort of work (actually I think he was giving some applink authors free 3DC licenses too, heard that somewhere... )

  • Like 1

Share this post


Link to post
Share on other sites

Quick question, Greg. The naming convention for the custom material presets....3D Coat names the normal map output "_nmap". If we use the convention "normal" as you recommend above, will the script properly know to swap the the one named nmap for the one named "normal"...?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×