Jump to content
3DCoat Forums
haikalle

Blender Applink

Recommended Posts

Here new update for applink. This only fixes that annoing "source" error. Hope everything works ok after this.

io_coat3D.zip 

I updated this into 2.90 daily build so you can download this that way too.

  • Like 1
  • Thanks 2

Share this post


Link to post
Share on other sites

Now there is some realtime updating in applink. you still have getback button so don't worry :) and you need to use it when you bring your mesh into blender first time. But now applink will update textures that has already texture node in blender. This hopefully decrease some "getBack" clicks. 

Included alredy in daily 2.90 builds. 

Share this post


Link to post
Share on other sites

Small demo how liveupdate works now. You need to do the first getback click but after that it should work without pressing that button anymore.

  • Thanks 1

Share this post


Link to post
Share on other sites

Yes the live up-date work-flow seems reasonable for me.:rofl:

I have one question,,  when  I export  2nd  texture set  as individual name from 3d coat,  

 app link will auto add " Fake User" for all import textures, so blender may not auto delete texture path when we save the scene?

 

 

 

Share this post


Link to post
Share on other sites

I decided to rewrite small part of applink that includes folders/paths functions. Nothing new for end user this time, but to maintain this code became a bit easier I hope :)

 io_coat3D.zip

@tokikake Sorry I don't fully understand how I should change the code in applink for you request.

Edited by haikalle
  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

I up-date 2.91 alpha (git master)  (today), then activate 3d coat app-link add on again.   Now it seems lost "Exchange" directory, then I set my exchange directory and, "apply folda" but app-link not show any button to send mesh for 3d coat from blender.

I use user custom 3d coat link directory in another HD volume ,

like "I:\myfile\3dcoat\link\3D-CoatLink\Exchange\"   so it is not 3d coat default, is it matter?  or  Do I need to download your new zip here?  (I had used same exchange directory, then other version had worked without problem)

exchange.thumb.JPG.ad8cf3f7b0a2665f941e52751a69427c.JPG

And I did not get any error log about this, (in console) but when I de-activate or activate app-link add-on, it show error,

"""Python: Traceback (most recent call last):
  File "C:\myprograms\blender-git\build_windows_Release_x64_vc15_Release\bin\Release\2.91\scripts\addons\io_coat3D\__init__.py", line 1460, in draw
    coat3D = bpy.context.scene.coat3D
AttributeError: 'Scene' object has no attribute 'coat3D'"""

(though if  I try same thing again,  now it added correctly but I afraid if it realated this problem  (script miss up-date some scene variables etc)

====
Ok now it seems work,  I quit then re-run blender. now it return buttons thanks.. I will test and request again, about texture (or material data-block) things.

Then  I needed to check how current app-link  work  untill  request correclty :blush:

Above request is related how we keep 2 different material, when we use app-link to make and save "material variation" for same mesh and save as blender data- block.

1 way is "save as different material with fake-user" , 2nd way is save as "different texture (if we keep to use same material) with fake user" then exchange "texture" in the "image texture nodes"  of material. (it may need more work because we need to exchange all texture for all shader nodes which use image"

I needed to confirm current app-link manner..(with change material in blender etc) untill request you. (but now I simply can not export mesh ^^;)

Edited by tokikake
add log and pic

Share this post


Link to post
Share on other sites

I did several commitments for 2.90 daily builds and It may happenned that you got version that was not finished yet. Now it should work in daily builds and here is also download zip

io_coat3D.zip

Edited by haikalle

Share this post


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

I did several commitments for 2.90 daily builds and It may happenned that you got version that was not finished yet. Now it should work in daily builds and here is also download zip

io_coat3D.zip

Hi thanks now I could test again.^_^

Then what I means (save texture as Fake user) is  when I export textures from 3d coat with app-link,  it generate 3d coat nodes for the material.

I know (already test), we should not change " material slot"  in blender when we use app-link (or we need to re-export mesh from blender again)

Keep material as same as before, then app-link can overwrite textures when we edit and export from 3d coat.  (it is reasonable I feel)

Then  I hope to keep 2 texture for same nodes (like diffuse) then export texture as different pre-fix from 3d coat. 

 app-link can change path correctly.   then What I hope is,  just apply texture as Fake user,, when export  textuers from 3d coat,

like this pic,,, (in the pic those 3 exported texture not fake user, so they will be removed from data-block) 

fakeuser.thumb.JPG.61a4b3ed071357edece5d2fe611fe275.JPG

fakepython.thumb.JPG.2afffe1630a23f7977337cf9ced74041.JPG

if app-link auto add " fake user" for those textures, saved blender scene can keep it. (texture path with texture data block name) then I can exchange them manually without serching around texture which I imported before..

And I think It only need when user use "Get Buck" button, because if we hope auto-up-date, it usually not change texture path, (use same texture to overwrite).  but if user use "get back" that means, we may hope to make new texture as variation I suppose.

(hope you understand what I means :blush:

Edited by tokikake

Share this post


Link to post
Share on other sites

Then if we hope to save 2 texture set withou

5 minutes ago, haikalle said:

Here you are :)

io_coat3D.zip

Too quick work ^^ ,, thanks :hi:

Then I do not know if it is useful for others, so anytime you change if others not hope it (not auto-add fake user). (blender data-block sometimes annoying,)

===

btw if user hope to keep 2 material for same mesh, another way is add fake user for material, and make new material, export again with app-link, so it work correctly.. (I do not know which is best option,, maybe change material, and exporr again is good workfolow for complex mesh (which have many uvtile or UDIM etc)

Edited by tokikake

Share this post


Link to post
Share on other sites

This is what I was thinking too. If I could choose I maybe would leave it as it was, no fake users. But if there is more user feedback about this topic lets then discuss more about it... but I think that there is pros and cons in both ways and I can happily leave it like this at the moment.

Share this post


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

Here you are :)

io_coat3D.zip

mm,, it seems not add fake user for texture,, when I re-activate and test again with new scene. (though as you said, I think it may need more user feed back,,) 

Share this post


Link to post
Share on other sites

Any advice on my predicament gratefully recieved .

 

Blender 2.83.9 (Same Results with Blender 2.8 In Testing)

Having no luck with the 3D-Coat Applink on my Mac and have been trying for hours to resolve things with no luck.

If I press send Per-Pixel Painting to 3DCoat 4.9.62 nothing happens.
If I press send Per-Pixel Painting to 3DCoat  4.9.02 It lets me proceed to begin painting a texture
When I’ve painted a texture and press Open In Original App I see no texture applied in Blender in Rendered or Material Preview.

I can find no imported image applied as a texture on my uv’ed mesh but I do see a strange node arrangement. When I press cntrl + T on the Principled BDSF Shader I can also find no available list of texture maps.

As a btw there is a Blender Cycles option but no option for Blender Applink in the 'Open In Original App' drop down - nor is there a Get Back Button in Blender - just a Send Option.

nodes.jpg

Share this post


Link to post
Share on other sites

@The Candy-floss Kid Sorry to hear. If you coudl help me a bit then I'm sure we can tackle these issues one by one. I don't have mac computer so testing addon in that platform gives some extra headache for me :) First could you download latest 2.90 daily build that includes the latest applink.

Then with basic cube if you try to export that as ppp into 3d-coat. does that works and if not does blender show any errors in log window? If you could share short video too that would be very helpful.

Share this post


Link to post
Share on other sites

@haikalle

Many thanks for your reply.

I loaded a clean new OS on an external HD - my current one does not run Blender 2.9.

This gives me a totally fresh load of both Blender 2.9 and 3DCoat 4.9.62.

Sadly I didn't get it too work but here is the report error that appeared which will hopefuly be of help with regard tracking the issue.

 

applink error report.jpg

Share this post


Link to post
Share on other sites

@The Candy-floss Kid

It seams that you are still using old version of applink. Are you able to manually copy addon into your blender folder. If yes then exctract and copy this folder to there:

io_coat3D.zip             

This most likely dosen't fix that bug yet but I want to make sure that you have latest addon version.

Edited by haikalle

Share this post


Link to post
Share on other sites

@haikalle

Installed the latest Applink as you so kindly made available.

Had no luck at first getting the ’Send’ to open in 3DCoat 4.9.62 so I loaded the latest Mac Version 3DCoat 4.9.65. This version did import the Blender ‘Send’ of the default cube to Per Pixel Painting.

Having finished > 3DCoat > Open In Original App
Blender >’Get Back’  ……… Fail with Error Report.  Image attached below.

get back.jpg

Share this post


Link to post
Share on other sites

So the error log show, you have no data.json file in the directory. 

I am not mac user, but can you check add on directory, where you installed 3d coat? 

Though I do not check all version but even though I use windows, I need to use aprication add on directory about this add on.  

If you install add on in user custom directory, it may cause issue.

As you can see, the console show 2 different add on directory. 

I can see,  you install io_coat3d  in

pathA  "..../Blender 2.9.app/Contents/Resouce..../Scripts/addons/io_coat3d"

but the script need to get data.json (it usually locate in  io_coat3d directory)   , then it serch   the file in 

 pathB    "...../MacOS/2.90/scripts/addons/io_coat3d" 

I suppose you have no io_coat3d folda in pathB  .  if follow the console log, you need to install io_coat3d , in path B not path A

I do not know how you install the add on, but you may need manually move io_coat3d (add on) package to path B.  (then delete io_coat3d from path A or blender may complain)

 

  • Like 1

Share this post


Link to post
Share on other sites

@tokikake

@haikalle

Many thanks for your reply tokikake.

The Applink exchange works with no version of Blender on the Mac I use.
Taking a closer look it seems all versions seem to be looking in the wrong place for the .json file.

The Blender Download for Mac by default has the io_coat3D Addon placed here (taking Blender 2.8 as example):
Applications/Blender 2.8.app/Contents/Resources/2.80/scripts/addons/io_coat3D

The secondary location on a Mac for added scripts is here:
Users/Username /Library/Application Support/Blender/2.80>scripts/addons/io_coat3D

All errors regarding every version of the Applink I’ve tested on Blender 2.8, 2.8.3.and 2.9 seem to be stemming from the fact that the Applink is looking for the .json here: Applications/Blender 2.8.app/Contents/MacOS/2.80/scripts/addons/io_coat3D/data.json

When in fact that default location for scripts that ship with Blender is:

Applications/Blender 2.8.app/Contents/Resources/2.80/scripts/addons/io_coat3D/data.json

Whether I place the io_coat3D Applink in the default location for shipped scripts or remove it and place it instead in the the secondary location for added scripts appears to make no difference,

The operation always fails when the applink looks in a place where scripts do not exist - there is no scripts/addons/io_coat3D/data.json file at the location Applications/Blender 2.8.app/Contents/MacOS/2.80

 

Share this post


Link to post
Share on other sites
6 hours ago, The Candy-floss Kid said:

@tokikake

@haikalle

Many thanks for your reply tokikake.

The Applink exchange works with no version of Blender on the Mac I use.
Taking a closer look it seems all versions seem to be looking in the wrong place for the .json file.

The Blender Download for Mac by default has the io_coat3D Addon placed here (taking Blender 2.8 as example):
Applications/Blender 2.8.app/Contents/Resources/2.80/scripts/addons/io_coat3D

All errors regarding every version of the Applink I’ve tested on Blender 2.8, 2.8.3.and 2.9 seem to be stemming from the fact that the Applink is looking for the .json here: Applications/Blender 2.8.app/Contents/MacOS/2.80/scripts/addons/io_coat3D/data.json

When in fact that default location for scripts that ship with Blender is:

Applications/Blender 2.8.app/Contents/Resources/2.80/scripts/addons/io_coat3D/data.json

The operation always fails when the applink looks in a place where scripts do not exist - there is no scripts/addons/io_coat3D/data.json file at the location Applications/Blender 2.8.app/Contents/MacOS/2.80

 

I see, , to correct it, need to edit mac version script code, which serch the data.json.   Though I may try, temporally,

1.   make the directory first, (though it is not default location, but even though you add new directory in app directory, it may not cause problem.

Applications/Blender 2.8.app/Contents/MacOS/2.80/scripts/addons/io_coat3D/

then actually copy and paste the "json file" form add on directory,.. (but I know, it is not default add on directory, so even though it solve the error,, If it cause another issue etc,,)

I suppose with your reply,   haikalle will solve this problem.   

 

Share this post


Link to post
Share on other sites

I think (though it may need not for haikalle, he know how it work) as console show

the tex.py line 397, which set json path,

json_address = os.path.dirname(bpy.app.binary_path) + os.sep + str(bpy.app.version[0]) + '.' + str(bpy.app.version[1]) + os.sep + 'scripts' + os.sep + 'addons' + os.sep + 'io_coat3D' + os.sep + 'data.json'

not work for mac version. 

Can you test this version tex.py please?  I use (__file__)  

then change 

json_address = os.path.dirname(os.path.abspath(__file__)) + os.sep + 'data.json'

it seems worked for me, (so maybe for mac it work too)

  (please keep default one then if it now work replace again)

tex.py

Edited by tokikake

Share this post


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

@The Candy-floss Kid

@tokikake

Thatnks you both. Could someone that has mac do this test for me. open blender and go to python console. Then write: 

bpy.app.binary_path
 
What do you get as result?

Though I do not know how mac install blender,, but it seems different from windows blender file structure, 

https://b3d101.org/en/pymove3d-python-3dworld/blender-python-api/

 it show exe path, but mac version may not locate add on directory as sub directory of the exe.

Share this post


Link to post
Share on other sites

I asked this from blender chat in it looks like that:

bpy.app.binary_path = <stuff>/Blender2.82a.app/Contents/MacOS/Blender

So if I replace '/MacOS/Blender' into 'Resources'. This maybe fixes the problem? Here is test build

io_coat3D.zip

 

 

`

Edited by haikalle

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

×