Jump to content
3DCoat Forums
haikalle

Blender Applink

Recommended Posts

13 hours ago, haikalle said:

Are you using "Open in original App" option. That option only updates the mesh you have brought from blender. If you use Export to -> Blender option, that will always creates new mesh.

Ah I see! I'll try that instead then. Thanks!

Share this post


Link to post
Share on other sites

@haikalle

I remove add on for 2.91 build once, then up-date 2.91 release from blender -git, build again. then activate, re-activate 3d coat add on. 

So I suppose, current my 2.91 use recent version or stable version of 3d coat to blender.

Then I do same test.. I could set exchange folda path , I could export cube.  to 3d coat. then I use "open in original app" and set texture options.

finally I click, "Get back" now I see this error.

location: <unknown location>:-1
Error: Python: Traceback (most recent call last):
  File "C:\myprograms\blender291-git\build_windows_Release_x64_vc16_Release\bin\Release\2.91\scripts\addons\io_coat3D\__init__.py", line 235, in invoke
    Export_folder  = global_exchange_folder
NameError: name 'global_exchange_folder' is not defined

location: <unknown location>:-1

Though I hope if I shut down and re-run blender, next time it will work .

Then as recent versions I had seen strange erroer about folda setting etc with blender 2.92 release 

sometimes it say "can not generate same folda which already generated, "  when I set the Exchange folda"  then the folda name is not exchange but "3DC2Blender "

I suppose, build in 2.91 is newer than 2.92 ?  or if you up-date for 2.92 but 2.91 build, not up-date?  because I had seen different erroer message for 2 version blender and coat plug in.

 

Share this post


Link to post
Share on other sites

And it is important , when set paths for 3d coat exporter..  

I use non default directory to store blush smart material,,  or scene etc,  for 3d coat.  then save them in another drive volume.

we can set it from 3d coat .

top menu Edit> re locate 3d coat data then set the data folda path. 

Maybe half of 3d coat user prefer it. (without they have enough space in main drive (ssd etc )  Then I afraid if it cause issue .

because as default 3d coat exchange directory. or  3DC2Blender will be generated in the Data directory I suppose. Then anyway I made Exchange folda in the data directory which I set, and set Exchange path from 3d coat plug in UI. (there are 2 ways,, but usually when I up-date 3d coat, I need to set path again from 3d coat N key panell of blender (then sometimes it show erroer when I set exchange path ) 

mysetting.thumb.JPG.f2b5bf67f9d2b4e7cca44d6d6c8e703e.JPG

but your plug in seems still try to generate 3dc2blender in my documents... (though if it not cause issue, I do not care,,) but I may hope not generate any folda in my doucments by apricaitons, (utnill I really hope it)   but hope to make it in user customize 3d coat data directory... 

and it is my request,,

So there seems 3 directory and some setting files. which related with 3d coat exporter.  I hope to get clear knowledge about them...

we must set "Exchange " folda.. then we can set "Object and Texture" folda as blender property>scene>3d coat. do I still need "3dc2blender"?   I thought if the folda is used only for other version exporter..  

 

Edited by tokikake

Share this post


Link to post
Share on other sites

daily 2.92 has the latest version. I checked and indeed 2.91 has older version of applink. I will try to update that too. I would like see the error you get with 2.92 version.

EDIT: I didn't know that you can change exchange path in 3d-coat.....interesting.

Edited by haikalle

Share this post


Link to post
Share on other sites
39 minutes ago, haikalle said:

daily 2.92 has the latest version. I checked and indeed 2.91 has older version of applink. I will try to update that too. I would like see the error you get with 2.92 version.

EDIT: I didn't know that you can change exchange path in 3d-coat.....interesting.

I may re-build 2.92 (I aifraid, so I often import your offered test version, when I re-build blender not change it,,then I may remove once, and clean up-date and re-build ^^;)

And I think I could change exchange path from your plug in UI..  the interesting one, is 3d coat massive data directory which save all texture or blush etc ^^;

It was long time request, many user asked it,, then there were setting file before.. (we need to edit it )  and it gradually improved, then finally 3d coat offer UI command, we can set 3d coat data path.

Then I can not remember any more, as default where 3d coat exchange folda will be generated. but anyway I hope to keep default file strcuture, then I made exchange directory, in my 3d coat data (which I set , not in my documents,,  ) and I set the path as 3d coat exchange folda. (from your plug in UI)

So I set exchange file paht from blender UI, (not in 3d coat ^^;,  I really feel difficult to understand, which aprication (3d coat, or your coat plug in) do what about those improter directory,, so do not know detail ^^;

Anyway I can recommend for all user, you can change 3d coat massive huge data folda, as you like.. it need to be announced  with loud voice I feel ^^;)

 

Share this post


Link to post
Share on other sites

@haikalle

1. I delete 3d coat add on, in my 2.92 build add on directory. (default location )

2. I update 2.92 master, then build again. (use blender offer batch) "make release"

3. it generate 3d coat add on (I suppose recent or your confirmed version) . so I once de-activate and activate.

4. about this time, 3d coat not show "please set exchange directory" as user UI, so I only see "send" and "Get Budk"

5. I confrimed, I have exchange folda, where I set before and it is same, in scene 3d coat exchange file path.

4.  load cube. set default material (principled bsdf attached)

5. click "Send" 

6. it show erroer (and it is what I had seen, and could not solve it )

location: <unknown location>:-1
Error: Python: Traceback (most recent call last):
  File "C:\myprograms\blender-git\build_windows_Release_x64_vc16_Release\bin\Release\2.92\scripts\addons\io_coat3D\__init__.py", line 501, in invoke
    bpy.ops.export_applink.pilgway_3d_coat()
  File "C:\myprograms\blender-git\build_windows_Release_x64_vc16_Release\bin\Release\2.92\scripts\modules\bpy\ops.py", line 132, in __call__
    ret = _op_call(self.idname_py(), None, kw)
RuntimeError: Error: Python: Traceback (most recent call last):
  File "C:\myprograms\blender-git\build_windows_Release_x64_vc16_Release\bin\Release\2.92\scripts\addons\io_coat3D\__init__.py", line 511, in execute
    foundExchangeFolder, global_exchange_folder = folders.InitFolders()
  File "C:\myprograms\blender-git\build_windows_Release_x64_vc16_Release\bin\Release\2.92\scripts\addons\io_coat3D\folders.py", line 33, in InitFolders
    os.makedirs(os.path.dirname(exchangeFile))
  File "C:\myprograms\blender-git\build_windows_Release_x64_vc16_Release\bin\Release\2.92\python\lib\os.py", line 223, in makedirs
    mkdir(name, mode)
FileExistsError: [WinError 183] 譌「縺ォ蟄伜惠縺吶k繝輔ぃ繧、繝ォ繧剃ス懈・縺吶k縺薙→縺ッ縺ァ 縺阪∪縺帙s縲・ 'C:\\Users\\TAKE\\Documents\\3DC2Blender'

The Win Error seems Garbled characters, but when I send, I catch it with info window. as japanese readable word.

That means " you can not generate fle, which you already made" = 3dc2blender (directory?)

or it is same as the linked erroer

https://stackoverflow.com/questions/54491021/why-am-i-getting-the-error-fileexistserror-winerror-183-cannot-create-a-file

Then I afraid, if my setting is matter (change 3d coat data directory,, and it not work with your current version)

error.thumb.JPG.1d1b0e41bc43222aa6d79c83dde9d45c.JPG

just to confrim, I keep to use same 3d coat data directory longtime, then it worked before.

And I remember I requested, to offer option to set Exchange directory as I like.. then you kindly offer way, so it worked

Only recent versions show this issue. and I did not remember when plug in return 3dc2blender directory. again,,,

Anyway  I can not export "cube" from your add on  with recent versions. ^^;  (I do not remember which version worked for me,,)

Edited by tokikake

Share this post


Link to post
Share on other sites

And I arelady tried once remove all generate folda (3DC2blender, and Exchange , directory, files which generated in them)

then start again. but after all I set Exchange directory from your plug in UI, then cube with mat, try to "Send", it say , same error.

so I suppose,, when  set Exchange path, plug in will auto generate 3DC2blender. after that click "send" then it maybe generate file in 3DC2blender

but it try to generate same directory "3DC2blender" again. with files. (but I know, it is just my assamption, and you know more than for me) 

just hope you can solve without many dificulity. 

Share this post


Link to post
Share on other sites

And I test again, this time only delete the problem folda "3DC2blender" but keep Exchange directory. 

if I remove the 3DC2blender directory (there is no file in the directory)  , and launch blender,  plug in not ask me to set Exchange path.

but when I click" send", plug in seems lost Exchange folda path setting. then ask me again. like this pic.

askme.thumb.JPG.e3ca57463d9353f0016809d0d40e77f6.JPG

then on the time, there is no "3DC2blender" directory. 

I click "Apply folda">> then I check my document,, yes when I click "apply folda" to set "Exchange" path, your plug in genearte empty "3DC2Blender" in my document already.

then I click "send",, now it show the error (the directory is already exist so you can not genearte again)

Hope it help something,, to solve issue. (so I do not know why other win user can export without problem ^^; maybe version ?)

Share this post


Link to post
Share on other sites

@haikalle

If there will be up-date (or you can confirm this  problem)  reply  please.  At current I can not use plug in for the erroer to paint in 3d coat. I think folda.py seems something wrong to generate those folda with file. (there are many if condition in the code for each PC , then maybe with my case (windows 10)   , plug in try to re generate the folda which already generated again. 

it seems happen when I set exchange path . (so once it worked, I think I may not see this problem, because your plug in need not re-assgin exchange directory, then may not generate 3dc2blender again . I happend to reset the exchange path, so maybe it cause issue.

I am afraid if it only happen with my PC  or I need to use default location for Exchange directory. At current with my setting,, I set path of Exchange in I volume 3d coat data.  but 3dc2blender always be generated in my documents directory by plug- in.  . I do not think I need to change my 3d coat data directory, but if I need to set default location for exchange directory, I simply change it..  

 

Share this post


Link to post
Share on other sites
22 hours ago, haikalle said:

@tokikake

Sorry, busy with school work, but I'm able check this bug on coming weekend.

Ah OK do not mind, I only need to know, if it only happen with my setting. Then school work and enjoy your holiday is more important^_^

I may see code if I can edit ^^

 

Share this post


Link to post
Share on other sites

OK I could solve my issue.  it seems once I delete the Exchange_folda.txt,  script could not generate it again. (maybe it try to generate , but cause erroer, because it try to generate 3dc2blender which already generated when I set "Exchange" folda path.. then script start loop or sotp by erroer (FileExistsError: [WinError 183] , it actually complain, the3dc2blender is already exits. (but there is no "Exchange_floda.txt" still)

Then what I did is, actually make the empty "Exchange_folda.txt" manually,, and locate it in the "3dc2blender". at same time, I hide 

def InitFolders():

    platform = os.sys.platform
    coat3D = bpy.context.scene.coat3D

    #    Global variable foundExchangeFolder (True / False) guides these steps
    # 1. Read Exchange_folder.txt, if not success ->
    # 2. Try to find exchange folder from system hard drive, if not success -->
    # 3. Leave foundExchangeFolder = False 

    # 1. #################################################################

    if(platform == 'win32' or platform == 'darwin'):
        exchangeFile = os.path.expanduser("~") + os.sep + 'Documents' + os.sep + '3DC2Blender' + os.sep + 'Exchange_folder.txt'
    else:
        exchangeFile = os.path.expanduser("~") + os.sep + '3DC2Blender' + os.sep + 'Exchange_folder.txt'
    if(os.path.isfile(exchangeFile)):
        folderPath = ''

        folderPathh = open(exchangeFile)
        for line in folderPathh:
            folderPath = line
            break
        folderPathh.close()

        if(os.path.isdir(os.path.abspath(folderPath)) and folderPath.rfind('Exchange') >= 0):
            coat3D.exchangeFolder = folderPath
            return True, coat3D.exchangeFolder
    #else:
        #os.makedirs(os.path.dirname(exchangeFile)) __ I hide here, so script stop to generate the dir (not file) which already exit when set "Exchange"

the section, which tried to make directory = 3dc2blender,,  

the problem seems script check file exist or not,, then try to make directory.  (but directory is already generated  for my case by set Exchange folda)

Now I could return textures as same as before ^^  (it temp work,, so when haikalle find time,, check it please,, some if condition to detect user setting, seems make things more complex I feel,, you try to make things work for all case, but it include un-necessary double check then cause non intended erroer,, (try to generaete same folda etc) 

Then if other win user see same issue, then try to this edit of code,  you need to manually generate "Exchange_folda.txt"  too.

 hide the section from the folda.py   can stop FileExistsError: [WinError 183] , but script can not find exchangeFile = "Exchane_folda.txt" so it request to set "Exchange" path again. then cause forever loop.  (you can not do anything ^^;)

Edited by tokikake

Share this post


Link to post
Share on other sites

Late summer, early autumn the Blender applink stopped working on my Windows 10 I7-4770S / GTX 1060 computer. Previously it worked flawlessly. I was building a replacement computer based on the Ryzen 7 3700 CPU and RTX 2060 so I put up with it,  believing when I do a fresh  install of Windows, Photoshop, Lightroom, 3DC, Blender and DAZ Studio, everything would work fine. And everything is...

EXCEPT the Blender applink is not working on my Ryzen pc.

I suspect a Windows update broke something.

I do have folders "C:\Users\kenmo\Documents\3DC2Blender" and an exchange folder in the folder I've defined for my 3DC assets - "G:\3DCOAT\3D-CoatV48\Exchange"

I did not create these two folders. They appeared after I installed the 3DC addon in Blender 2.9.0.1 and launching 3DC & Blender.

However NOTHING appears in the folder.

Perhaps I using the wrong Blender version? 

If that is the case WHY doesn't this forum have a link for the correct Blender Addon as they do for Modo, 3DMax, etc instead of telling users to search Github for it?

As I've said this plugin worked flawlessly a couple of months ago and then suddenly it was broken.

And now on a pristine install of Windows, 3DC & Blender it still is not working.

 

 

Share this post


Link to post
Share on other sites

I just installed Alpha ver 2.9.2 of Blender and I get this error message.

 

 

3DC-Blender.png

Share this post


Link to post
Share on other sites

Launching the command prompt as Administrator and doing a directory listing for  hidden files - there was nothing in the 3DC2BLender folder

Directory.JPG

Share this post


Link to post
Share on other sites

I uninstalled the addon that ships with Blender 2.9.1 and installed the one in this thread "io_coat3D_new5.zip" and it does put some models in FBX format into folder

C:\Users\kenmo\Documents\3DC2Blender\ApplinkObjects

But they are not passed onto 3DC 4.9.65 GL

DirFull.JPG

Share this post


Link to post
Share on other sites

I imported a model I created in MOI3D into Blender 2.9.2 and tried an exchange to 3DC for per pixel painting.

MOI-Blender.JPG

Share this post


Link to post
Share on other sites

The model appears in the ApplinkObjects folder. But is not passed on to 3DC 4.9.64

 

 

MOI-Dir.JPG

Share this post


Link to post
Share on other sites

However I can import the model into 3DCoat using file import.

Is there a setting in the 3DC that I am not aware of?

Moi-3DC.JPG

Share this post


Link to post
Share on other sites
11 hours ago, kenmo said:

I just installed Alpha ver 2.9.2 of Blender and I get this error message.

 

 

3DC-Blender.png

That is why I need to manuall edit.  (but I am not the author so I can not full edit to work without some step)

The erroer happen,  script try to generate the 3dc2blender which already generated by same add on script, when you set the Exchange folda.

Thare are many conditions, when script try to generate the directory,, so some code seems need to be clean up by author. 

then try 

1. make empty new txt file save as  "Exchange_folder.txt"  without lauch any aprication.

2. set the "Exchange_folder.txt" in the "3dc2blender" directory. where script already generated . 

empty.thumb.JPG.b32ccbeb78f89cd19b375d77889b7c05.JPG

 if you had removed the  "3dc2blender"directory,, re-launch script then force it to make 3dc2blender

 (though it show same erroer) , then quit blender, locate empty "" txt in the 3dc2blender.

basically once you make the "Exchange_folder.txt", this add on (3d coat applink)  not try to generate the problem directory. 

then auto discribe  your " Exchange path" in the  "Exchange_folder.txt. txt" correctly.  (so you need not manuall set path)

 

If it still not work for you, you may need to edit code, but I suppose it work with my up-date test .

Edited by tokikake

Share this post


Link to post
Share on other sites

And I remember when export mesh from blender, you may need to set material (pricinpled bsdf) for each material slot. (or at least you need one material slot which assgined and set the material  (default principled bsdf is OK). , then app link can generate original nodes when you import textures . 

sometimes i forget to set material, then paint in 3d coat, return, plug in can not set 3d coat nodes. (so I usually apply default principled bsdf for each material slots)

 

Share this post


Link to post
Share on other sites

And one more,, recent versions (which packed 2.92 alpha) plug in , tex.py there is one simple error. 

I suppose some version once resolved it, but anyway, today I up-date with Git blender 2.92 then force to generate app-link again, I found the issue.

(it happen when you open in original app >> get back)  blender show error log.

I could solve it 

        else:
            for texture_info in texturelist:
                if (os.path.isfile(texture_list[3])):

to change

        else:
            for texture_info in texturelist:
                if (os.path.isfile(texture_info[3])):

(I suppose it should be)^_^

then now I could return and generate coat texture nodes without problem. then basically about some case (your export setting), app-link generate nodes, but

set UDIM tile, then could not apply it correctly. (So you may better not use "Skip UV set name if there is one uv tile option" when you export textures from 3d coat)

Share this post


Link to post
Share on other sites
1 hour ago, haikalle said:

@tokikake Thats great. Thank you. Do you have access to make commits into blender git? 

No when I up-date one add on for blender 2.8,   I was asked by other developer to up-load  with git.  But I do not know how it work well , and may not plan to lern it..

 (so I afraid, I break something etc,, for official)    Then at curent  I only use Git to download blender versions and branches ... sorry ^^;

 

Share this post


Link to post
Share on other sites

Then about both is caused you try to up-date by our request so frequently for all versions , then it seems some solved issue return or sometimes change with new version I feel.

(at current win user may only see the win erroer 183, when they once clean up folda and txt for setting.. (so it only happen for some user)

another one (itexture_info[3]) is simple type miss I feel. I could catch the erroer before, then forgot it,, but today I test to confirm my way, then I see the erroer. 

Then I do not know if it is right or not, so haikalle check please.. (If it need to use other list,,) . I really like this plug-in, then hope it stable and easy to use when user first try it.

and I really apreciate, you just make this add on for other user  (I sometimes have thought you are one of 3d coat dev team,, but  you are not ^^;  if you did not offer this add on,, I think many blender user may hesitate to try 3d coat I feel...   your add on is really important for us.  

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

×