KirilStrezikozin / BakeMaster-Blender-Addon

Welcome to BakeMaster, a powerful and feature-packed baking solution created for Blender - an open-source 3D Computer graphics software.
Other
34 stars 6 forks source link

REQUEST: Make Decal object baking more universal (Decal frame preview) #67

Closed KirilStrezikozin closed 6 months ago

KirilStrezikozin commented 7 months ago

This feature request is:

Is your feature request related to a problem? Please describe. marcovivirito (Discord) was looking for a way to 'bake from view'. 'Bake from view' is not an official term and means using a render camera to render-bake from a particular view or baking details down onto a flat plane (high-to-lowpoly). The initial issue marcovivirito faced is not connected to this issue, but making BakeMaster's Decal object baking more universal may suit his initial needs.

Describe the solution you'd like to be implemented Currently, only Decal Pass map is baked using the render-bake approach (read brief explanation above). Even if BM Object is a Decal Object, all other maps are not render-baked, but just simply baked using the object's UVs. Also, Decal Pass baking enforces object rescaling to fit within 1x1 m box, and the offset value cannot be previewed. What I'm planning to implement is:

KirilStrezikozin commented 7 months ago

Side TODOs:

KirilStrezikozin commented 7 months ago

https://github.com/KirilStrezikozin/BakeMaster-Blender-Addon-Dev/commit/a98f6042e791824af74187ab8889595c18cb57a2 - This one is pretty stable and resistant to Blender's events. I made it to cancel whenever invalid data is detected (e.g. when a user deleted the custom camera and did not turn off the frame preview beforehand or removed a BM Object). It does not fail to cancel itself but fails to delete the custom camera when the source object was accidentally deleted or one undo even was fired (2 undo's work though :1st_place_medal:). I should also replace bm_obj_i reference stored in __decal_view handler with bm_obj_name, which would make the operator cancel when bm objects are moved.

KirilStrezikozin commented 7 months ago

Looks like the only vulnerability of the Decal View OT is an undo even just after the source object was deleted. The custom camera object is restored, but Decal View OT had already fired a cancel due to deletion of the source object, thus, it's properties got reset.

KirilStrezikozin commented 7 months ago

Ok, I've found some more:

  1. When the source object is hidden, Decal Object is ghost object is fired to debug.
  2. When user switches active area, ctx.area becomes None
KirilStrezikozin commented 6 months ago
KirilStrezikozin commented 6 months ago

Issues while incorporating decal frame preview into bake: