Jump to content
3DCoat Forums

3DS Max Applink - Complete Rewrite


PolyHertz
 Share

Recommended Posts

New Applink released! Get it here!

Applink 2.1 release notes:
    - Added Some additional features for the custom preset utility. You can now modify existing presets, bitmap/extras menues can be hidden, and UI height is user scalable.
    - Added export option 'fix wire names' (workaround for bug in Maxs obj exporter which results in some exports material names becoming something like "wire_195270274").
    - Added support for Octane renderer bitmaps (no default preset, but you can make your own now).
    - Default Arnold/Metalray presets are now hidden depending on the renderer(s) you have installed.
    - Clear Temp On Close now also clears UserData directories (previously only cleared exchange directories).
    - Fixed a bug that could cause 'export to' folders to incorrectly named.
    - Fixed bug that could happen if over 24 materials were imported at once.
    - Fixed bug that could cause "Apply preset to Mesh" feature to fail.

3DSMax version compatibility:
    - Max 2018 and newer ; All features are enabled and fully supported.
    - Max 2017 and older ; Dissabled docking mode ( downside of using a UI designed for Max 2018+ ).
    - Max 2015 and older ; Dissabled 'make custom preset' feature.
    - Max 2013 and older ; Dissabled Gamma override feature.
    - Max 2012 ; Oldest supported version of Max. Many features are dissabled, but otherwise it should work just fine.

Installation:
    1. Open the zip file and copy all the contents somewhere on your PC (like your desktop)
    2. In your Windows Documents directory, assuming 3D-Coat is installed you should have a folder called "Applinks", copy the "Max_Settings" folder in to there.
    3. Copy the .BMP files to your max icons directory (search for "Icons" or "IconsDark" in you Max directory depending on your theme, newer versions of Max they will be in the "UI_ln" folder).
    4. Run the file "3ds Max Applink v2.0.mcr" by dragging and dropping it on to the 3DS Max viewport, or scripting > run script.
    5. After install is successfully completed, find the app under Customize > Keyboard/Toolbar tab > Category: Pilgway.

Creating a custom preset:
    1. Under Options - Meterials, click on the "Make Custom Preset" button.
    2. At the top of the window that appears select the material you would like to turn into a preset, and just below it give the preset a name.
    3. Once you've selected the material any bitmap nodes attached to it will be listed below, here you can select what kinds of textures from 3D-Coat you want to use in them.
        If your material has many bitmaps, open the slate material editor and double click on a bitmap node, then in the applink custom preset window press "Expand only selected bitmap" to collapse all other bitmaps in the list.
    4. After setting up your bitmaps, you can set additional settings that are affected whenever the preset is used, such as changing viewport or render settings.
        So, if you made a preset that required the Arnold renderer, you could set the renderer in those additional settings as Arnold by pressing "Use Current". Now Arnold will automatically load alongside the preset.
    5. Press "Generate Preset", the window will close, and your new preset will now be listed in the main applink window.
        That's it, you're done! Congrats on making your first preset!

PSA: DO NOT USE EXPORT CONSTRUCTOR IN 3D-COAT! IT MUST BE DISABLED ON EXPORT FOR THE APPLINKS MATERIAL PRESETS TO WORK!
The export constructor changes texture file names resulting in the applink not knowing where to put those textures. Presets will still load, but only placeholder textures (like "C:/color.png") will be in the material if you use export constructor.
It is possible to use the export constructor with multiple changes to the settings to get all names back to how they are by default, but it's not recommended.

 


 

  • Like 4
Link to comment
Share on other sites

  • Reputable Contributor

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
Link to comment
Share on other sites

  • 2 weeks later...

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
Link to comment
Share on other sites

  • Reputable Contributor

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. :)

Link to comment
Share on other sites

  • 2 weeks later...
  • Member

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\

Link to comment
Share on other sites

  • Member

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
Link to comment
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
Link to comment
Share on other sites

  • Reputable Contributor

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

Link to comment
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.

Link to comment
Share on other sites

  • Advanced Member

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

Link to comment
Share on other sites

  • Reputable Contributor

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

Link to comment
Share on other sites

  • Advanced Member

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.

Link to comment
Share on other sites

  • Reputable Contributor

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.

Link to comment
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 :)

Link to comment
Share on other sites

  • Reputable Contributor

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
Link to comment
Share on other sites

  • New Member

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

Link to comment
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
Link to comment
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
Link to comment
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
Link to comment
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
Link to comment
Share on other sites

  • 2 weeks later...
  • Reputable Contributor

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"...?

Link to comment
Share on other sites

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

 

Changes:
-Fixed issue with "Export To" directories not being properly created (bug affected v1.8+ ).
-Fixed special right-click Export mode (export without auto-importing into 3DC feature)
-Fixed a bug that happened if users tried to import a mesh with a preset enabled without exporting any maps from 3D-Coat.
-Fixed some minor UI issues (radio buttons not showing what was selected by default).
-Fixed bug where auto-import would activate when switching different Temp directories.

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...
  • Member

Hmm, I get this no matter what I do, Manual install and drag install:

 

I get this when I run the script or click the 3d coat applink button:

--   currentINIsettings: #("UVs", "", "Default (no preset used)", "E:\games\steam games\steamapps\common\3d-coat\3D-CoatDX64C.exe", undefined, undefined, false, undefined, undefined, true, true, true, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, ...)
--   scriptDirTMP: "C:\Users\Bjørn\AppData\Local\Autodesk\3dsMax\2016 - 64bit\ENU\scripts\"
--   runfile: undefined
>> MAXScript Rollout Handler Exception:
-- No ""+"" function for undefined <<

-- Error occurred in anonymous codeblock; filename: C:\Users\Bjørn\AppData\Local\Autodesk\3dsmax\2016 - 64bit\ENU\usermacros\GregsScripts-g_3DCappLink.mcr; position: 41240; line: 801
--  Frame:
--   tmpFilesPath: undefined
-- No ""+"" function for undefined

Error generated on this line:

	------Get newest export.txt file------
	tmpRootEXPfile = (tmpFilesPath + "export.txt")
	tmpMaxEXPfile = (tmpFilesPath + maxver + "/export.txt")
	existA = doesFileExist tmpRootEXPfile
	existB = doesFileExist tmpMaxEXPfile

Get this when I press the Import button.

--   called in expButton.pressed(); filename: C:\Users\Bjørn\AppData\Local\Autodesk\3dsMax\2016 - 64bit\ENU\usermacros\GregsScripts-g_3DCappLink.mcr; position: 78114; line: 1475
--  Frame:
--   expSuccess: undefined
>> MAXScript Rollout Handler Exception:
-- No ""+"" function for undefined <<
undefined

This error happens on this line:

	--Perform actual export
	tdcExpSuccessful = false
	if (noPrompt == true) and ((getCurrentSelection()).count != 0) do (tdcExpSuccessful = exportFile (tdcTmpDir +"input.obj") #noprompt selectedOnly:true using:ObjExp)
	if (noPrompt == false) and ((getCurrentSelection()).count != 0) do (tdcExpSuccessful = exportFile (tdcTmpDir +"input.obj") selectedOnly:true using:ObjExp)

Nothing happens when trying to send this to 3D-coat naturally.

 

Found some forum posts with the same error, but those were related to older 3d coat version mismatch etc. Which is not the case for me. ( I could not find the specific lines mentioned in a search at least. )

 

I get around this by exporting and importing back & forth. Not the first time this happens, even had problems with autodesks integrated "send to" command between 3dsmax, maya and mudbox as well.

 

I'be been trying to find out whats wrong, could it be a steam installed 3d-coat? I had to manually update some of the code because I have my steam library installed on another harddrive. Before that the applet did not even appear, it did after i changed those lines, however, there must be something more I need to check..problem is, there is quite the few lines of code and it's easy to miss something when going through it not know what to look for.

 

Thanks in advance!

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...