Code Monkey home page Code Monkey logo

Comments (2)

Naxela avatar Naxela commented on August 26, 2024

Hi, thank you for the bug report

I'm sorry for answering a bit late (life is a bit busy in the arctic).

In terms of what you're seeking, due to context issues in Blender, calling bpy.ops.tlm.build_lightmaps() doesn't quite work, but it should be possible to invoke the building process in another way by calling the following:

import thelightmapper

thelightmapper.utility.build.prepare_build(0, True)

It is more or less the same command that the button calls but without being an operator call

Let me know if it doesn't work

Cheers,
Naxela

from the_lightmapper.

emadurandal avatar emadurandal commented on August 26, 2024

Thanks for the answer. The way works. Baked textures were output but some error occurs.

>>> thelightmapper.utility.build.prepare_build(0, True)
Logger started Init
Building lightmaps
(3, 6, 13)
No previous material for Cube
No previous material for 平面
No Previous material array for: Cube
No Previous material array for: 平面
Preparing: UV initiation for object: Cube
Preparing: UV initiation for object: 平面
PREPARE: ATLAS
PREPARE: OBJECTS
Preprocessing material for: Cube
Managing layer for Obj: Cube
Preprocessing material for: 平面
Managing layer for Obj: 平面
Config mesh catch omitted: REMEMBER TO SET IT BACK NAXELA
Beginning build
Baking 0/1 (0.0%) : Cube
Elapsed time: 0.03s | ETA remaining: 0.03s
Baking combined: Direct + Indirect
情報: 内部画像にベイクマップを保存しました。外部ファイルに保存、またはパックしてください
Baking 1/1 (100.0%) : 平面
Elapsed time: 0.16s | ETA remaining: 0.0s
Baking combined: Direct + Indirect
情報: 内部画像にベイクマップを保存しました。外部ファイルに保存、またはパックしてください
Managing build
CPU Encoding
CHECKING FOR REPART
Node2: C:\Users\ema_d\Downloads\thelightmapper_ex\Lightmaps\Cube_baked.hdr => C:\Users\ema_d\Downloads\thelightmapper_ex\Lightmaps\Cube_baked.png
CHECKING FOR REPART
Node2: C:\Users\ema_d\Downloads\thelightmapper_ex\Lightmaps\平面_baked.hdr => C:\Users\ema_d\Downloads\thelightmapper_ex\Lightmaps\平面_baked.png
Lightmap building finished

Traceback (most recent call last):
  File "<blender_console>", line 1, in <module>
  File "C:\Users\ema_d\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\thelightmapper\addon\utility\build.py", line 118, in prepare_build
    begin_build()
  File "C:\Users\ema_d\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\thelightmapper\addon\utility\build.py", line 708, in begin_build
    manage_build()
  File "C:\Users\ema_d\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\thelightmapper\addon\utility\build.py", line 1100, in manage_build
    setGui(0)
  File "C:\Users\ema_d\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\thelightmapper\addon\utility\build.py", line 1312, in setGui
    driver["TLM_UI"].remove_handle()
  File "C:\Users\ema_d\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\thelightmapper\addon\utility\gui\Viewport.py", line 77, in remove_handle
    bpy.types.SpaceView3D.draw_handler_remove(self.handle2, 'WINDOW')
ValueError: callback_remove(handler): NULL handler given, invalid or already removed
image

But it worked anyway, so it is good. You may close this Issue. Thank you.

from the_lightmapper.

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.