Jump to content
3DCoat Forums

3DS Max Applink - Complete Rewrite


PolyHertz
 Share

Recommended Posts

  • Reputable Contributor

 

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!

 

Looks like you have your 3D Coat install folder in a drive with the letter E: ....which could be the culprit. Applink might be looking for 3D Coat in the C drive. Just a guess.

Link to comment
Share on other sites

It looks like it's failing to write one of the basic files. Two possibilities:

 

1. Windows permissions are interfering with files being written to your users directory.

2. Max is having problems with the file path itself (maybe due to the "ø" in your user name).

Edited by PolyHertz
Link to comment
Share on other sites

  • Member

I can confirm that version 1.8c does not work when 3D coat is installed on a drive other than the C drive.  I installed the applink with no problem on a pc with 3d coat installed on the c drive.  When I tried to do the same on another windows 7 computer we have that has 3D coat installed on the E drive (since the ssd C drive is getting a bit full), the temp directory path field comes up blank in the app link rollout and the error,  "No  "+" function for undefined " is displayed for the line that has "tmp Root Exp file = tmp Files Path + "export.txt".  Based on the forum messages, I have tried the following without any success:

 

Ran 3ds max as administrator both before and after install

Edited the file, Applink_3DC_settings.ini to contain a temp directory set up on the E drive

 

If I right click on the temp directory field of the app link dialog, I get another error to the effect that shell explorer.exe is expecting  a string but is getting "undefined"..

 

However, as soon as I created a new Exchange directory on the C drive at C:\Users\[user Name]\Documents\  the app link works.  This is irrespective ot the path specified in the .ini file , which still points to the E:\ drive location for the Temp directory.  So the installed script apparently expects the Exchange folder to be only on the C:\Drive and doesn't allow/recognize an Exchange folder on another drive irrespective of the path specified in the .ini file.  Anyway this worked for me, and I thought I would pass this along in case someone else finds it to be helpful.

 

Thanks for the useful script.

Link to comment
Share on other sites

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

 

Changes:

-Added ability to select alternative Exchange (temp files) directories via "Other..." at bottom of drop down list (just like for exe files).

-Added a ton of error checking for those that have 3D-Coat on a drive other then "C:/".

-Corona material presets have had their gloss output inverted.

Edited by PolyHertz
  • Like 1
Link to comment
Share on other sites

  • Member

Sorry if I wasn't clear about the ini file -- I was referring only to the one that your script created.  I do not know of any created by 3D Coat.  Very impressive turnaround with the update btw.  Version 1.8d installed without any hiccups.  Thanks for your efforts and impressive responsiveness.

Link to comment
Share on other sites

  • Member

Thanks Polyhertz for the update.  I think I picked up a glitch in that while the temp directory field of the applink rollout now correctly gives the option of changing the directory, when the user selects the directory there is a missing "\" at the end of the path.  This (at least in my case) caused the applink to not open the mesh i I was trying to export into 3D Coat.  The fix I found was to simply edit the AppLink_3DC_settings.ini file (written by your script) and add the missing backslash to the end of the path.  After that the exchange between apps worked perfectly as far as I can tell.  Just wanted to pass this along in case it is helpful.

Link to comment
Share on other sites

  • Member

Thanks for updating it. It solved everything for me. 

I had one last problem and that was that even after last update, my mesh did not import to 3d coat, it opened 3D-coat and nothing happened after that. Turns out that it was because I had moved my "Documents" directory to another harddrive..did this to avoid unecessary writes and trashdata to the SSD drive which contains "C:".

Windows does not solve the "move to another location" very efficiently, it actually moves the directory to another drive and link it directly, microsoft should be slapped for this solution, it's not a good way to do it, it should have been moved AND created a symlink from the old location to the new one to fool the system. To many programs rely on the original C:\%userprofile% folder. 
This would also explain why some programs have been acting funky. 

Just so people know. 3D-Coat actually installs into the redirected user profile folders, but the applink does not, there is a mismatch, so the applink will not find the exchange folder located in the directory because it's not located under C:\Users\<user>\3D-CoatV45.

The solution is simple though:

 

1. Install the applink like usual.

2. move the applink folder called "Applink_Max3DC" located under "C:\users\<user>\Documents\" to the profile location that you chose.

3. Open a command line window with elevated right ( run as administrator )

4. Type:

cd c:\users\<USERNAME>\Documents 

You NEED to do this first to get the right location or else you will have a useless symlink lying in your System32 folder.

 

5. use the command below to create a symbolic link.

mklink /d Applink_Max3DC [YourDrive e.g F:\]DocumentsFolder\Applink_Max3DC

You should get a confirmation message if it was created correctly.

 

6. Now you need to make an symlink for the 3D-CoatV45 Folder to.

mklink /d 3D-CoatV45 [YourDrive e.g F:\]DocumentsFolder\Applink_Max3DC

Same here with confirmation message.

 

You should now have 2 folders in your default profile folder that looks like shortcuts, you may want to right click on them and check that they point to the right path etc.

Now test!

I tested my symlinks and they work.

 

Protip: You can also use mklink command on basicly everything and it can trick programs to think your location is somewhere it's not, hence why it's genious to use in many cases.
If you use OneDrive for example ( which does not let you right click and syncronize folders (come on microsoft....) you can create symlinks to get around this. But remember to only use symlinks INTO a cloud based storage program, not the other way, that might turn out problematic. I will not go into more detail here ( yeah shutup Mr.Digression ).

 

Just thought maybe someone else might run into this problem. :)

Link to comment
Share on other sites

Could someone who has their documents folder on a different drive then C:/ run this and let me know if the window that pops up shows the correct directory path? Also what OS your using (since I don't know if the registry values have the same location across different Windows versions)

 

https://dl.dropboxusercontent.com/u/4210886/showDocPath.ms

Link to comment
Share on other sites

  • Member

Hi PolyHertz,

 

I have My documents on my E drive ( the specific path is E:\My Documents ) , and when I ran the script, the following appeared  in the popup window     E:\

 

I have Windows 7.Professional, Service Pack 1.

 

Hope this is helpful. 

 

C_Man

Link to comment
Share on other sites

  • 3 weeks later...
  • Member

I tested it as well, I got the full path when trying the .ms file you linked. It displayed exactly "D:\Documents" here. I have Windows 10. However, the documents path should be the same on all Windows versions since windows visa to present.

They will always be stored under "C:\Users\%username%\Documents" by default.  The Library however might name the "Documents" folder "My Documents".

WIndows versions prior to Windows Vista had another system for documents, which is not used anymore. So any version above vista should use the same pathing in the registry. 

Link to comment
Share on other sites

  • Member

I just installed this and have a small issue to report. When 3DC opens, I never get the 'Import' panel. All I see is the regular options panel (...Voxel Sculpting, Repair Scanned Mesh, Vertex Painting...etc. )

 

I exported from Max 2016 after having 'uninstalled' the Applink first go round. I restarted Max and installed and tried to export a teapot with VRay basic material. 3DC opens and then nothing else. I tried a Standard material also. I rebooted the whole machine for kicks, not necessary I realize but what the heck. No help. 

 

I searched for some .ini's or something to see if maybe a path was incorrect for something. I do see in the 'Export' folder a 'run.txt' under my Max 2016 folder that is generated. That .txt file is completely blank. Not sure if that indicates anything or not. 

 

Finally, the '.mat' files are in the proper place:  "C:\Users\%username%\Documents"

Edited by RobH2
Link to comment
Share on other sites

Are you sure that the correct Temp Files path for your version of 3D-Coat is selected? If using any version of 3D-Coat 4.5 it should be the 3D-CoatV45 in your documents. It wont import the mesh if this isn't set correctly.

 

The run.txt is supposed to be blank (it's what lets you use 'Export To' when sending files from 3D-Coat to Max). This is auto-generated for all 3D-Coat document folders when the applink is started.

When you export from Max to 3D-Coat, it should generate an an input.obj and import.txt file in the Exchange directory of your specified temp folder. 3D-Coat then deletes the import.txt as soon as its done importing the OBJ.

Edited by PolyHertz
Link to comment
Share on other sites

  • Member

Hi, yes, the correct Temp File path is selected and the input.obj is indeed created. 3DC just doesn't open the 'Import' window when it automatically opens. The 'import.txt' file in the Temp File path references the correct path as well (actually, the path that it is in). 

 

Certainly, I can go import 'input.obj' manually, but that defeats the purpose a bit.  Odd...

Link to comment
Share on other sites

Sounds like an issue with 3D-Coat itself instead of the applink. Which version of 3D-Coat are you using so I can test it?

 

Edit: Just tried it with the latest version (4.5.37) and it imported without any issues. Hmmm...

Edited by PolyHertz
Link to comment
Share on other sites

  • Member

I thought I had the most current version. When I use check for updates in 3DC it says I'm current. Ok, I'll see if i can find a newer version. 

 

Edit: Are you suggesting I grab the Beta because 4.5.19 is the latest version I see on the main site for downloading?

Edited by RobH2
Link to comment
Share on other sites

  • Member

I grabbed the latest Beta and still no go. I checked 'AppLink_3DC_settings.ini' and the switches I'm setting are being written to it. I examined the .mcr and my paths are correct so that everything should be able to be found. 

 

The only odd thing I'm finding is that when I select the 'Temp' path it's doing this:

 

Say I want the Temp path to be d:\Exchange. The .obj gets written to the root of d: and is named "Exchangeinput.obj". If I add another folder to d:\Exchange and make it d"\Exchange\Exchange, the .obj is written to d:\Exchange\Exchangeinput.obj. It skips the second folder in the path. 

Link to comment
Share on other sites

  • Member

I can confirm that did in fact fix the Temporary File path issue. 

 

The Applink still won't function properly for me. I did completely uninstall 3DC, clean the registry and reboot. I reinstalled the latest Beta 4.5.37 and it still fails to open the 'Import' dialog. I just get the normal splash screen with the 12 options. 

 

If I'm the only user experiencing this you can stop diagnosing with me. I can live without the link. But, if you want to continue to analyze it, I'm happy to keep working with you. I enjoy figuring these things out. I'm not a programmer but know my way around the OS.

Link to comment
Share on other sites

Lets try this (confirm that the Temp directory is being properly read in general by 3D-Coat);

 

1. First, confirm that 'File > Export To > 3DS Max 201X' is there. If it is, that means 3D-Coat is seeing the run.txt file and thus the directory is being properly read.

2. Now delete all copies of run.txt in every 3D-Coat exchange directory. restart 3D-Coat and make sure the Export To option is missing. If it is, good, else, it means its reading from somewhere else...

3. Create a single text file in the 'Exhange > 3DS Max' directory you're trying to use, and rename it to run.txt . Run 3D-Coat, and if the Export To feature is back we can safely say that directory is being read by 3D-Coat.

 

If all that pans out, then one of these two things being the culprit would be my guess:

-Windows permissions issues. Windows10 is blocking 3D-Coat from reading the file automatically and thus it's ignoring it.

-Max 2017 is writing the OBJ in a way which the 3DC autoloader doesn't like (you're the first person to use it with Max 2017 afaik).

Link to comment
Share on other sites

  • Member

FYI, I guess i updated my signature too much. I have Max 2017 but never use Max for production for about 4-months after release as none of my plugins will have updates for a few months. So, I'm having this failure in Max 2016. 

 

I do not have 'File>Export>3DS Max 201X'. So, it's not seeing ANY 'run.txt' anywhere, right? So I guess I need to figure out where 3DC is looking for it and place it there. That would be the first thing to fix and then we can look at permissions, etc. 

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