Code Monkey home page Code Monkey logo

Comments (24)

dmax3d avatar dmax3d commented on July 17, 2024 1

addon preference is default, not forcing CPU or GPU (system is CPU)

backing AO gives good result and this in terminal:

Mode changed ao
Info: Total files 0 | Changed 0 | Failed 0
Bake 'ao'
Bake cube
Info: Baking map saved to internal image, save it externally or pack it
Bake sphere
Info: Baking map saved to internal image, save it externally or pack it
Info: Baking finished in 0.41s.

backing CAVITY give wrong result and this in terminal:

Bake 'cavity'
Bake cube
Info: Baking map saved to internal image, save it externally or pack it
Bake sphere
Info: Baking map saved to internal image, save it externally or pack it
Info: Baking finished in 0.13s.

so NO errors, but the result is pure black damn#[$%&@ God know why!

from textools-blender.

dmax3d avatar dmax3d commented on July 17, 2024 1

The new op_bake is giving the following:

Mode changed cavity
Bake 'cavity'
Get material bake_cavity from /Users/dmax/Library/Application Support/Blender/3.4/scripts/addons/TexTools-Blender-master/resources/materials.blend
Material not yet loaded: cavity
Material can't be loaded: cavity
Bake cube
Info: Baking map saved to internal image, save it externally or pack it
Bake sphere
Info: Baking map saved to internal image, save it externally or pack it
Traceback (most recent call last):
  File "/Users/dmax/Library/Application Support/Blender/3.4/scripts/addons/TexTools-Blender-master/op_bake.py", line 192, in execute
    bake(
  File "/Users/dmax/Library/Application Support/Blender/3.4/scripts/addons/TexTools-Blender-master/op_bake.py", line 627, in bake
    bpy.data.materials.remove(mtl, do_unlink=True)
ReferenceError: StructRNA of type Material has been removed
Error: Python: Traceback (most recent call last):
  File "/Users/dmax/Library/Application Support/Blender/3.4/scripts/addons/TexTools-Blender-master/op_bake.py", line 192, in execute
    bake(
  File "/Users/dmax/Library/Application Support/Blender/3.4/scripts/addons/TexTools-Blender-master/op_bake.py", line 627, in bake
    bpy.data.materials.remove(mtl, do_unlink=True)
ReferenceError: StructRNA of type Material has been removed

so yes to both your questions: material can't be loaded and the filepath is pointing to the actual material file inside resources (the only difference in the path is the "Library" since my localization is italian "Libreria" but I don't think could be the problem)!

from textools-blender.

dmax3d avatar dmax3d commented on July 17, 2024 1

A thing come to my mind about materials: starting from blender 3.4 some shader/nodes has changed, as example MixRBG no more exist and become Mix Node, and maybe others. This internal switch corrupted a couple of my works in the past. That is suspicious since your addon looks to be broken exactly starting from 3.4!!!

from textools-blender.

dmax3d avatar dmax3d commented on July 17, 2024 1

You rock! Solved! Everything works fine finally!!!

image

from textools-blender.

franMarz avatar franMarz commented on July 17, 2024 1

No, thank you for asking anyway!

from textools-blender.

franMarz avatar franMarz commented on July 17, 2024

Thank you for the report. Can't reproduce in 3.4.1, I'm getting correct results. Can you send a .blend test file?

from textools-blender.

dmax3d avatar dmax3d commented on July 17, 2024

Thank you for the report. Can't reproduce in 3.4.1, I'm getting correct results. Can you send a .blend test file?

Ah! Damn, at this point I think it is related to my Blender installation/preferences that conflict in some way. Let me make a new "clean" installation from scratch then we will see.

Thanks!

from textools-blender.

franMarz avatar franMarz commented on July 17, 2024

OK. If that doesn't work, please try to bake the type "Diffuse" of an object with a Principled BSDF material assigned using the Blender way, under the Render Properties panel > Bake tab. If you get nothing on the target image texture chosen to bake into, placed inside the object's material, then you may have a hardware or driver problem.

from textools-blender.

dmax3d avatar dmax3d commented on July 17, 2024

Well, it looks like the latest working Blender build is the 3.3.1...

Starting from the 3.4.1 or even 3.6.5 I'm getting the black issue. Tested on Mac OS 12.6 and 13.2 on different machines (iMac and Macbook pro).

Now, let me try your suggested test

from textools-blender.

dmax3d avatar dmax3d commented on July 17, 2024

...aaand your test was positive (I can bake the diffuse type) inside Blender 3.6.5 where TexTools fail!

from textools-blender.

franMarz avatar franMarz commented on July 17, 2024

Weird. Can you open Blender with the console (in Mac is a bit cumbersome as far as I know) and tell me whether or not there is any error message after trying to bake with textools ?

from textools-blender.

franMarz avatar franMarz commented on July 17, 2024

Pathing issues are common with macOS but shouldn't trigger when baking Diffuse with the addon unless a naming collision between textures occurs.
Maybe you're forcing to use either the CPU or the GPU in the addon preferences, while without the addon you just use the Device specified in the Render Properties tab; if you have differences between CPU and GPU rendering in Blender, that can be one possible answer to this very problem of being baking which really is a vanilla Blender Type, just called from code.

I don't have a Mac to investigate this further, so I'll need any more insights from either you or other Mac users around this, namely tracebacks. I hope you get some, if not, maybe you'll need a modified version of the Bake module without the try - finally main structure.

from textools-blender.

franMarz avatar franMarz commented on July 17, 2024

OK. What about "tangent normal" or "UV" bake modes? They follow the same path in the code as AO. None of the 40 modes render correctly besides AO?

from textools-blender.

franMarz avatar franMarz commented on July 17, 2024

More importantly, I removed the try-finally structure in the attached file, because it hides possible tracebacks. Can you change the Bake module from where you have TexTools installed with the file in the attached ZIP, restart Blender, try again "Cavity" with the console open and tell me whether there is something new?
op_bake.zip

from textools-blender.

dmax3d avatar dmax3d commented on July 17, 2024

Hard to say 100% sure about all the modes, but ao, specular, roughness, object normal, specular tint, glossiness, base color, object bevel (give same result of object normal), combined, diffuse, they seem to works as far as I can understand with my basic test. Black or unsure result for the others.

from textools-blender.

dmax3d avatar dmax3d commented on July 17, 2024

okay, now with your modded "op_bake" file we got following results:

  • for the AO baking (which works):
Mode changed ao
Bake 'ao'
Bake cube
Info: Baking map saved to internal image, save it externally or pack it
Bake sphere
Info: Baking map saved to internal image, save it externally or pack it
Traceback (most recent call last):
  File "/Users/dmax/Library/Application Support/Blender/3.4/scripts/addons/TexTools-Blender-master/op_bake.py", line 192, in execute
    bake(
  File "/Users/dmax/Library/Application Support/Blender/3.4/scripts/addons/TexTools-Blender-master/op_bake.py", line 627, in bake
    bpy.data.materials.remove(mtl, do_unlink=True)
ReferenceError: StructRNA of type Material has been removed
Error: Python: Traceback (most recent call last):
  File "/Users/dmax/Library/Application Support/Blender/3.4/scripts/addons/TexTools-Blender-master/op_bake.py", line 192, in execute
    bake(
  File "/Users/dmax/Library/Application Support/Blender/3.4/scripts/addons/TexTools-Blender-master/op_bake.py", line 627, in bake
    bpy.data.materials.remove(mtl, do_unlink=True)
ReferenceError: StructRNA of type Material has been removed
  • for the CAVITY (which does not work):
Mode changed cavity
Bake 'cavity'
Bake cube
Info: Baking map saved to internal image, save it externally or pack it
Bake sphere
Info: Baking map saved to internal image, save it externally or pack it
Traceback (most recent call last):
  File "/Users/dmax/Library/Application Support/Blender/3.4/scripts/addons/TexTools-Blender-master/op_bake.py", line 192, in execute
    bake(
  File "/Users/dmax/Library/Application Support/Blender/3.4/scripts/addons/TexTools-Blender-master/op_bake.py", line 627, in bake
    bpy.data.materials.remove(mtl, do_unlink=True)
ReferenceError: StructRNA of type Material has been removed
Error: Python: Traceback (most recent call last):
  File "/Users/dmax/Library/Application Support/Blender/3.4/scripts/addons/TexTools-Blender-master/op_bake.py", line 192, in execute
    bake(
  File "/Users/dmax/Library/Application Support/Blender/3.4/scripts/addons/TexTools-Blender-master/op_bake.py", line 627, in bake
    bpy.data.materials.remove(mtl, do_unlink=True)
ReferenceError: StructRNA of type Material has been removed


basically same results, but one is painting the ao right, the other is painting pure black... hope this helps...

from textools-blender.

franMarz avatar franMarz commented on July 17, 2024

The latest errors aren't related to this, but knowing the modes which are behaving well for you is really helpful.
Could you please try the new modified bake module I attach here and tell me, when trying to bake cavity, if you get in the console the message "Material can't be loaded" and whether or not the filepath shown after "Get material bake_cavity from " points to an actual blendfile in your system?
op_bake.zip

from textools-blender.

franMarz avatar franMarz commented on July 17, 2024

Great insights, I think we're getting close to the solution. It's hard to understand why I still get correct results though, but I'll look into the materials' node structures next. Thank you.

from textools-blender.

franMarz avatar franMarz commented on July 17, 2024

Maybe related to this, an unreported change in Blender pathing to internal blendfile structures since 3.4, which it seems is making append and linking fail in macOS and linux only: bpy.ops.wm.append not functioning properly with Blender 3.6?

I made a new modified op_bake.py, could you test it before I upload it to master?
op_bake.zip

from textools-blender.

franMarz avatar franMarz commented on July 17, 2024

Great! Node differences between versions were properly handed by versioning then. Thank you for the continued feedback, we fixed it! Closing after updating master.

from textools-blender.

dmax3d avatar dmax3d commented on July 17, 2024

Thanks to you as well! More than a good customer support and for a free product! Is there a way to donate?

from textools-blender.

franMarz avatar franMarz commented on July 17, 2024

I need a last test from you, I hope you're still there. The solution I adopted can be problematic again in the future, I've taken a more robust (a elegant) approach in this last modified bake module. Can you test Cavity with it in Blender 3.3, and in any of Blender versions 3.4 or 3.6 and tell me if it works in both?

op_bake.zip

from textools-blender.

dmax3d avatar dmax3d commented on July 17, 2024

Okay tested on 3.3, 3.4 and 3.6: everything looks fine!

from textools-blender.

franMarz avatar franMarz commented on July 17, 2024

Great, thank you!

from textools-blender.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.