Code Monkey home page Code Monkey logo

vpx_lightmapper's Introduction

Visual Pinball X Light Mapper

A Blender add-on to help building pretty baked tables for the world's favorite pinball simulator.

Disclaimer

This tool is a hobby project, developped independently from the great team behind Visual Pinball X. Please do not bother them with issues regarding this tool.

This tool is just my attempt at building better tables. It is shared in the hope that it may help others to build nice tables. There is no dedicated ressources behind this project. It is in a pre-alpha state, with no support. There are bugs more or less everywhere, so it is to be used with extreme care and at your own risk!

Table of contents

What is it ?

Visual Pinball X is a game engine dedicated to pinball game simulation. It is a great tool which has allowed a whole community to grow and produce incredible pinball tables (VPForums, VPUniverse, Orbitalpin, Pinball Nirvana, VPDB, PinSimDB,...). For the graphic part, it includes a nice realtime rendering engine which allows great visual results.

To obtain the best visuals, table creators may choose to precompute parts of the rendering of their table in a more advanced offline renderer like Blender, a.k.a. "baking" the rendering. This works especially nicely for pinball games since the game is played from a fixed point of view, allowing to efficently bake view dependent lighting effects.

The visual quality of a pinball simulation is also tighlty linked to the rendering of the many (up to hundred) lights that are used in a pinball. The texture baking approach can be extended regarding precomputing the effect of lighting by using "light maps", that is to say models with precomputed textures storing the effect of lights. These models are a shell around the table objects, with texture storing the lighting. When playing the pinball table, they are renderered by adding the lights contribution to the base model.

This tool aims at helping with the process of creating VPX tables by:

  • making importing/updating table a fast, simple and easy task,
  • easing camera setup,
  • automating the full bakemap/lightmap process, with a good level of optimization.

Property Panel

The UI is available in the scene property panel, inside the "VPX Light Mapper" pane. Lots of informations and tools are also available in the information (N key) panel of the 3D view and the collection property panel (bake & light groups configuration).

Features

This toolkit offers the following features:

  • Import VPX table including lights & materials, easily update edited table
  • Setup camera according to VPX camera, including 'layback' support
  • Automatically detect occluded objects that can be exclude from bake meshes
  • Automatically setup groups of non overlapping objects
  • Batch render bakemap/lightmap, automatically optimizing renders
  • Generate mesh for bake/lightmaps and optimize them (subividing for limited prejection distortion, pruning of unneeded faces for lightmaps, limited dissolve, backface removal,...)
  • Render nested texture combining all the bakemap/lightmap
  • Export directly playable VPX table file with updated geometry, textures and script

Installation

Blender Console

This add-on use the Blender console for all its output. You need to enable the console before everything else (Window > Toggle System Console).

Blender add-on

  1. Download add-on (zipped) from the release section.
  2. In blender, go to : Edit -> Preferences -> Add-ons -> Install.
  3. Select the downloaded file.
  4. This add-on requires external python dependencies that are likely not available with your default Blender installation. If so, it will show an 'install dependencies' button that you need to click before use. After installing the dependencies, Blender will not immediatly detect them: you will have to restart Blender.

Depending on your security configuration, this additional dependency installation step may need to be performed from a Blender instance started with administrator rights. In this case, the installation process is somewhat more complex since you will need to install the add-on as administrator, then the dependencies, then close Blender and restart it from a normal account, and install the add-on again (the first time it was installed to your admin account, so it is not available from your normal acount, but the dependencies are installed system wide and will be available).

Visual Pinball X with additive blended primitives

Additionnally, this tool needs the latest, not yet released, build of Visual Pinball X or Visual Pinball for VR. These are available here for VPX and here for VPVR. Be aware that these builds are not release version but alpha build. Therefore you are likely to encounter bugs, and you should not use them without backing up your work first.

Import tool

The import tool is used to create a scene setup (empty or from an existing table), then update it. The initial imports will create the default collections, loads everything and try to set up the right collections. Lights are imported as emitting geometry or point lights depending on the 'bulb' option in VPX. Lights which are likely inserts follow a specific process (generate a slightly reflective cup below playfield, generate a translucency map for the playfield)

When updating, the process is the following:

  • All textures are reloaded
  • Objects link to groups (Hidden/Bake/...) are left untouched except for deleted objects which are moved to the 'Hidden' collection
  • World environment is (re)created if missing. The environment texture is updated in the shader node named 'VPX.Mat.Tex.IBL'
  • Objects are identified by their link to VPX object (look in 3D View side panel, there you can see/edit the VPX identifier, eventually associated to a subpart for multipart objects like bumpers). If object is not found, it is created like on initial import but if object is found, it is updated according to its configuration (available in the 3D View side panel):
    • If not disabled, meshes/curves/light informations are replaced by the ones defined in the VPX table,
    • If not disabled, position/rotation/scale are redefined to match the one of the VPX table
    • If the material slot is empty, it is (re)created.
    • If the material slot use a material with matching material name, the core material node group and image texture of the material are updated with VPX material data

Therefore, if you modify an object, you have to disable the corresponding import properties or your changes will be lost on the next update.

To take control of a material, either change the material to a non 'VPX.' named one or simply modify inside the existing material (which will still get updates but only on the aforementioned nodes. Other objects with the same material/image pair will use the same Blender material and therefore will have these changes applied too).

Camera tool

Since having a matching camera with the player view point is needed for correct perspective projected baking, a dedicated tool allows you to manage it automatically. It will update the camera according to your settings (which are imported from the VPX table).

The tool always fit the camera to the objects to be baked, processing layback according to the selected mode:

  • Disable: don't take layback in account (this won't render well in VPX),
  • Deform: deform geometry by applying a layback lattice (this will somewhat break the shading but is the most faithfull to VPX rendering),
  • Camera: this will adjust camera inclination and rendering properties to correspond to VPX rendering without breaking the shading. This mode is the one recommended for good quality baking.

Bakemap/Lightmap tool

The workflow can be whatever you want, but the tool was designed around the following one:

  1. Create a table in VPX
  2. Import the table in Blender (or update if this is done after the first iteration)
  3. Adjust the generated baking configuration (light groups, bake groups, bake modes,...)
  4. Improve the materials and adjust the lights in Blender
  5. Bake
  6. Review the result direclty inside Blender
  7. Export an updated table with all the bakes
  8. Adapt the table script, using the generated helper
  9. Test and adjust in VPX, eventually go back to step 2, using update button

The texture baking is performed according to:

  • Light groups, which define each lighting situation to be computed,
  • Bake groups, which define groups of object to be rendered, baked together and exported.

This tools performs baking using 'projected UV unwrapping'. This means that the baking is performed from the bake camera point of view, texture coordinates of the models are computed automatically by projecting them from the camera point of view. This method works well in the context of baking a pinball table:

  • you don't need to unwrap your models,
  • you can use default Blender's shading nodes,
  • the produced texture have uniform texel density (which is good for performance and visual quality). The drawback of this technique is that it is highly point of view dependent and won't work well on objects or ligths that can be moved. Alson this technique needs ad-hoc texture packing algorithm since normal uv-packing only works well if baking is performed after uv packing which is not the case here.

The lightmap baker automates all the baking process according to the following workflow for each bake group:

  1. Identify non overlapping groups of objects from the camera point of view
  2. For each light situation, render each non overlapping object groups from the camera point of view and store these renders in a cache
  3. Generate an optimized mesh for each bake group, suitable for fixed view baking (including preliminary mesh optimization, and automatically subdivision to avoid projection artefacts)
  4. For each light group, derive an optimized mesh by removing unlit faces
  5. For all of these meshes, compute a texture map from the initial renders
  6. Export all this to an updated VPX file

In the collection property panel, each bake groups has a 'bake mode' which determine how it will be processed:

  • Group: outputs a single mesh per bake group
  • Split: outputs a single mesh per object in the group, do not perform backface culling Additionally, each group must be marked as 'opaque' or 'non opaque'. This information is needed for VPX to correctly render transparent objects (they need to be rendered after opaque one, from back to front), to allow render optimization (static opaque objects are prerendered, giving a large performance boost), and to correctly process object border shading (transparency of borders of opaque objects is discarded).

In the collection property panel, each light collection has a 'light mode' which determine how it will be processed:

  • Solid: content of the collection is used for the base bake (not a lightmap).
  • Group: all lights are treated as a group and generate a single lightmap,
  • Split: each light of the collection generate a lightmap, Note that all lights or emissive objects must be placed in one of these collections or they will influence each of the lightmap, creating ugly artefacts.

Exporting consist in generating a new VPX table file with the new packed bake/lightmap images, and the bake/lightmap primitives. The exporter has an option to decide what to do with the initial items of the table that have been baked:

  • Default: don't touh them,
  • Hide: hide items that have been baked,
  • Remove: remove items that have been baked and do not have physics, hide the one that have been baked but are needed for physics,
  • Remove all: same as remove, but also remove images that are not needed anymore.

Quick start

This little guide gives you the step to create your first lightmap baked table:

  1. Open VPX and create a new default table (Ctrl+N), then save it.
  2. Open Blender, open the Blender console, install the add-on
  3. Delete everything from the default Blender scene
  4. In the scene panel, press the 'Import' button, and select the saved default VPX table
  5. Press 0 for camera point of view
  6. In the 3D view, in the right panel (N shotcut), select the VLM pane
  7. In the 3D view, select the primitives on the left and right side of the table, then move them to the 'Hidden' collection
  8. In the 'Active' collection, select all shadow objects ('FlipperRsh', 'BallShadow1',...) and move them to the 'Hidden' collection
  9. Move the remaining primitive of the 'Active' collection to the 'Default' collection
  10. Save your scene
  11. In the scene panel, select a target resolution (start with very low for an ugly but fast preview), then press 'Batch'
  12. Wait (this may be long depending on your computer and the resolution), watching in the console what is happening 13 You can preview/inspect the result directly in blender: select 'Rendered' mode for the 3D View, you now have a pink table! Select it, and press 'Load/Unload Renders' in the VLM panel to view it with the baked textures. Do the same for the different bake/light mesh you want to inspect.
  13. Open the new VPX table and play! You will the see the baked objects. Though, lights won't be synchronnized until you update your table script.

Usefull hints

Optimizing the bake mesh (and render time)

As much as possible, you should avoid including occluded (not directly visible) geometry from your bakes. To help you in doing so, the add-on offers a small tool that will identify occluded geometry from the camera point of view. You can then choose to mark them as 'Indirect' (it will influence the image but won't be part of the bake mesh). This tool can be accessed from the 3D view, by clicking the button 'Select Occluded'. Note that this can be a lengthy operation. Another side benefit of tagging as indirect the occluded geometry is that this will help limiting the number of render groups, and therefore limit the render time.

Beside this user action, to avoid ending up with very large meshes (in terms of number of faces, as well as overdraw when rendering in VPX), all produced meshes are optimized by:

  • pruning duplicate vertices,
  • performing a limited dissolve of the mesh (see Blender doc),
  • performing backface culling,
  • removing unlit faces from lightmaps.

Inserts

The importer has an option to detect inserts (lights placed on the playfield, with a name which does not start by 'gi') and apply the following process:

  • move light slightly below playfield,
  • generate a cup mesh, opened on the top side, corresponding to the VPX light shape, with a core reflective material,
  • adjust the playfield material to be partly translucent for the inserts, using an automatically generated translucency map.

Transparent objects (plastic ramps, bumper caps,...) and alpha blending

Visual Pinball X performs alpha blending of transparent objects. This means that the object is rendered on top of objects behind it, blending the color between them according to the alpha channel of the used texture. This can be compared to the shading of a transparent glass with an indice of refraction of 1 (i.e. non refractive glass). Alpha blending needs the opaque objects to be rendered first, then the alpha blended parts, rendering the ones in the back first, then the ones in the front.

Blender can render glass, outputing to the alpha channel the amount of escaping rays, that is to say rays that are transmitted through the glass and reaching the background. This is great since it gives full control on what is rendered to the user. To enable this, in 'Render Properties > Film > Transparent' check 'Transparent Glass' and increase 'Roughness Threshold'. In the case of a pinball table, transparent objects usually have other objects behind them, therefore rays are not escaping but reaching other elements. If we want to view a ball passing behind 2 elements, they have to be rendered as 2 layers: a background opaque one, and an alpha blended one. To let Blender knows about this separation between the 2 layers, we need to place a mesh between them with an holdout shader.

Note that, with this setup, there won't be any shadowing, since there is no shadowing support inside VPX. So a ball passing under a transparent object will not occlude light coming from behind it.

Managing the cache

Each step of the bake/lightmap process is saved in a cache located along the blend file (that's the reason why you need to save your blend before starting the bake process). For the moment, this cache is manually managed. Inside it, you will find 3 folders:

  • Object Masks: contains the mask computed for each object during the 'Group' step. You need to manually delete elements (or the whole folder) when objects are moved
  • Renders: contains the actual renders. This needs to be manually cleared for render to actually happen (or if you know what you do, clear the only the elements you want to rerender)
  • Export: contains the packmaps in Png and WebP format. As for the other folders, this needs to be manually cleared for packmaps to be regenerated

vpx_lightmapper's People

Contributors

freezy avatar mpcarr avatar vbousquet avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vpx_lightmapper's Issues

Feature Request: Option to Enable (vpx) reflections on objects

I've been experimenting with using reflection probes to make mirrored sideblades in vpx and every time I render a new batch from Blener I have to manually select all the lightmaps and bakemaps in VPX and check the 'enable reflections' box. It would be handy to be able to do this on a per-collection (and per-object) basis in Blender before exporting to VPX.

Division by Zero error...

Not sure if this is helpful or not .. but loading up a table and I get this error. The actual table seems to load just fine - I am using the plugin just to view in 3d to get things correct... (3.5 blender and latest no-beta 10.7.3 vpx)

image

No module named 'win32crypt'

Hi, I am trying to install this addon in my fresh blender installation. But when I want it to install dependencies I get the error:
No module named 'win32crypt'
There is almost no additional info on this. I assume this is related to windows 11...

I already tried installing pypiwin32 with pip but this only caused, that for some reason the "Install dependencies" button in blender became disabled. I as you get no info for disabled buttons (generally a bad UX-Style in software development) I cannot anything more about it. To get back to an enabled button I reinstalled blender entirely.

Ofc I am starting blender with admin-permissions to do this.

The batch button

The batch button lacks one argument:

    def execute(self, context):
        start_time = time.time()
        print(f"\nStarting complete bake batch...")
        vlm_baker.compute_render_groups(context)
        vlm_baker.render_all_groups(context)
        vlm_baker.create_bake_meshes(context)
        vlm_baker.render_packmaps(context)
        vlm_export.export_vpx(context)
        print(f"\nBatch baking performed in a total time of {int(time.time() - start_time)}s.")
        return {"FINISHED"}

Each vlm_baker call requires a first parameter 'op' for error reporting.

Vertex with valence higher than 65535

Here is another error I get when running the batch on "Creature from the black lagoon":

Info: Removed: 17 vertices, 11 edges, 0 faces
. 39168 faces removed (model has 60492 vertices and 52257 faces)
.   199 edges subdivided to avoid projection distortion and better lightmap pruning (length threshold: 0.1, longest edge: 0.91).
.   248 edges subdivided to avoid projection distortion and better lightmap pruning (length threshold: 0.1, longest edge: 0.58).
.   275 edges subdivided to avoid projection distortion and better lightmap pruning (length threshold: 0.1, longest edge: 0.36).
.   315 edges subdivided to avoid projection distortion and better lightmap pruning (length threshold: 0.1, longest edge:  0.2).
.     6 edges subdivided to avoid projection distortion and better lightmap pruning (length threshold: 0.1, longest edge: 0.19).
.     2 edges subdivided to avoid projection distortion and better lightmap pruning (length threshold: 0.1, longest edge: 0.19).
.     2 edges subdivided to avoid projection distortion and better lightmap pruning (length threshold: 0.1, longest edge: 0.19).
.     2 edges subdivided to avoid projection distortion and better lightmap pruning (length threshold: 0.1, longest edge: 0.19).
.     2 edges subdivided to avoid projection distortion and better lightmap pruning (length threshold: 0.1, longest edge: 0.19).
.     2 edges subdivided to avoid projection distortion and better lightmap pruning (length threshold: 0.1, longest edge: 0.19).
.     2 edges subdivided to avoid projection distortion and better lightmap pruning (length threshold: 0.1, longest edge: 0.19).
.     2 edges subdivided to avoid projection distortion and better lightmap pruning (length threshold: 0.1, longest edge: 0.19).
.     2 edges subdivided to avoid projection distortion and better lightmap pruning (length threshold: 0.1, longest edge: 0.19).
.     2 edges subdivided to avoid projection distortion and better lightmap pruning (length threshold: 0.1, longest edge: 0.19).
.     2 edges subdivided to avoid projection distortion and better lightmap pruning (length threshold: 0.1, longest edge: 0.19).
.     2 edges subdivided to avoid projection distortion and better lightmap pruning (length threshold: 0.1, longest edge: 0.19).
Error: Failure in TopologyRefinerFactory<>::Create() -- vertex with valence 65547 > 65535 max.
Error: Failure in TopologyRefinerFactory<>::Create() -- vertex with valence 65547 > 65535 max.
Error: Failure in TopologyRefinerFactory<>::Create() -- vertex with valence 65547 > 65535 max.
.     2 edges subdivided to avoid projection distortion and better lightmap pruning (length threshold: 0.1, longest edge: 0.19).
Error: Failure in TopologyRefinerFactory<>::Create() -- vertex with valence 65547 > 65535 max.
Error: Failure in TopologyRefinerFactory<>::Create() -- vertex with valence 131083 > 65535 max.
Error: Failure in TopologyRefinerFactory<>::Create() -- vertex with valence 131083 > 65535 max.
Error: Failure in TopologyRefinerFactory<>::Create() -- vertex with valence 131083 > 65535 max.
.     2 edges subdivided to avoid projection distortion and better lightmap pruning (length threshold: 0.1, longest edge: 0.19).
Error: Failure in TopologyRefinerFactory<>::Create() -- vertex with valence 131083 > 65535 max.
Error: Failure in TopologyRefinerFactory<>::Create() -- vertex with valence 262155 > 65535 max.
Error: Failure in TopologyRefinerFactory<>::Create() -- vertex with valence 262155 > 65535 max.
Error: Failure in TopologyRefinerFactory<>::Create() -- vertex with valence 262155 > 65535 max.
.     2 edges subdivided to avoid projection distortion and better lightmap pruning (length threshold: 0.1, longest edge: 0.19).
Error: Failure in TopologyRefinerFactory<>::Create() -- vertex with valence 262155 > 65535 max.
Error: Failure in TopologyRefinerFactory<>::Create() -- vertex with valence 524299 > 65535 max.
Error: Failure in TopologyRefinerFactory<>::Create() -- vertex with valence 524299 > 65535 max.
Error: Failure in TopologyRefinerFactory<>::Create() -- vertex with valence 524299 > 65535 max.
.     2 edges subdivided to avoid projection distortion and better lightmap pruning (length threshold: 0.1, longest edge: 0.19).
Error: Failure in TopologyRefinerFactory<>::Create() -- vertex with valence 524299 > 65535 max.

Error in Blender 4.0

Cannot complete a batch in Blender 4.0. 'Groups' step finishes but when rendering the first group error comes up
"1-2 args execution context is supported"

Import Broken for 4.1

'Mesh' object has no attribute 'calc_normals_split'.

The Mesh auto_smooth property has been replaced by a modifier node group asset (89e3ba4e25).

Division by Zero Stacktrace

Here is another one. That happened when batchprocessing the sample-table of VPX.

Python: Traceback (most recent call last):
  File "C:\Users\simon\AppData\Roaming\Blender Foundation\Blender\3.0\scripts\addons\vpx_lightmapper\__init__.py", line 382, in execute
    vlm_baker.render_all_groups(self, context)
  File "C:\Users\simon\AppData\Roaming\Blender Foundation\Blender\3.0\scripts\addons\vpx_lightmapper\vlm_baker.py", line 504, in render_all_groups
    state, restore_func = setup_light_scenario(context, scenario, group_mask)
  File "C:\Users\simon\AppData\Roaming\Blender Foundation\Blender\3.0\scripts\addons\vpx_lightmapper\vlm_baker.py", line 400, in setup_light_scenario
    influence = get_light_influence(scenario[2], group_mask)
  File "C:\Users\simon\AppData\Roaming\Blender Foundation\Blender\3.0\scripts\addons\vpx_lightmapper\vlm_baker.py", line 332, in get_light_influence
    alpha_y = light_yr / light_xr
ZeroDivisionError: float division by zero

location: <unknown location>:-1
Error: Python: Traceback (most recent call last):
  File "C:\Users\simon\AppData\Roaming\Blender Foundation\Blender\3.0\scripts\addons\vpx_lightmapper\__init__.py", line 382, in execute
    vlm_baker.render_all_groups(self, context)
  File "C:\Users\simon\AppData\Roaming\Blender Foundation\Blender\3.0\scripts\addons\vpx_lightmapper\vlm_baker.py", line 504, in render_all_groups
    state, restore_func = setup_light_scenario(context, scenario, group_mask)
  File "C:\Users\simon\AppData\Roaming\Blender Foundation\Blender\3.0\scripts\addons\vpx_lightmapper\vlm_baker.py", line 400, in setup_light_scenario
    influence = get_light_influence(scenario[2], group_mask)
  File "C:\Users\simon\AppData\Roaming\Blender Foundation\Blender\3.0\scripts\addons\vpx_lightmapper\vlm_baker.py", line 332, in get_light_influence
    alpha_y = light_yr / light_xr
ZeroDivisionError: float division by zero

location: <unknown location>:-1

Issues with dual drives.

Use of relative path seems to have some issues. Not sure how important VPXMeshes.blend is in the process; but, it will also complain and skip generating a new VLM vpx as the path gets "corrupted".

Resulting vpx is stripped of many of the primitaves.

When I open the - VLM.vpx file there are a number of primitives that are gone/removed from the file. Is this something that I am doing wrong on the collection phase? I moved them to hidden. In atleast one case, the primitave should not be hidden - as it could impact the lighting.

Three Stacktraces

Just as a little help, here are three stacktraces which most likely are easy to fix/workaround each:

Rendering packmaps
Info: No orphaned data-blocks to purge
. Rendering packmap #0 containing 2 bake/light map
Python: Traceback (most recent call last):
  File "C:\Program Files\Blender Foundation\Blender 3.0\3.0\scripts\addons\vpx_lightmapper\__init__.py", line 364, in execute
    vlm_baker.render_packmaps(context)
  File "C:\Program Files\Blender Foundation\Blender 3.0\3.0\scripts\addons\vpx_lightmapper\vlm_baker.py", line 1799, in render_packmaps
    print(f'. {obj.vlmSettings.bake_name} has an HDR range of {hdr_range:>5.2} (lightmap: {is_light})')
ValueError: Precision not allowed in integer format specifier

location: <unknown location>:-1
Error: Python: Traceback (most recent call last):
  File "C:\Program Files\Blender Foundation\Blender 3.0\3.0\scripts\addons\vpx_lightmapper\__init__.py", line 364, in execute
    vlm_baker.render_packmaps(context)
  File "C:\Program Files\Blender Foundation\Blender 3.0\3.0\scripts\addons\vpx_lightmapper\vlm_baker.py", line 1799, in render_packmaps
    print(f'. {obj.vlmSettings.bake_name} has an HDR range of {hdr_range:>5.2} (lightmap: {is_light})')
ValueError: Precision not allowed in integer format specifier

location: <unknown location>:-1

Something is wrong with the print() output. I commented that line and it works. I don't know python syntax but the {hdr_range:>5.2} looks suspicious to me. As if the curly braces should be only around hdr_range or the colon doesn't belong there.

Python: Traceback (most recent call last):
  File "C:\Program Files\Blender Foundation\Blender 3.0\3.0\scripts\addons\vpx_lightmapper\__init__.py", line 362, in execute
    vlm_baker.render_all_groups(context)
  File "C:\Program Files\Blender Foundation\Blender 3.0\3.0\scripts\addons\vpx_lightmapper\vlm_baker.py", line 543, in render_all_groups
    state, restore_func = setup_light_scenario(context, scenario, group_mask)
  File "C:\Program Files\Blender Foundation\Blender 3.0\3.0\scripts\addons\vpx_lightmapper\vlm_baker.py", line 439, in setup_light_scenario
    influence = get_light_influence(scenario[2], group_mask)
  File "C:\Program Files\Blender Foundation\Blender 3.0\3.0\scripts\addons\vpx_lightmapper\vlm_baker.py", line 360, in get_light_influence
    influence_radius = light.data.shadow_soft_size + math.log10(light.data.energy) * 250 * global_scale # empirically observed
ValueError: math domain error

location: <unknown location>:-1
Error: Python: Traceback (most recent call last):
  File "C:\Program Files\Blender Foundation\Blender 3.0\3.0\scripts\addons\vpx_lightmapper\__init__.py", line 362, in execute
    vlm_baker.render_all_groups(context)
  File "C:\Program Files\Blender Foundation\Blender 3.0\3.0\scripts\addons\vpx_lightmapper\vlm_baker.py", line 543, in render_all_groups
    state, restore_func = setup_light_scenario(context, scenario, group_mask)
  File "C:\Program Files\Blender Foundation\Blender 3.0\3.0\scripts\addons\vpx_lightmapper\vlm_baker.py", line 439, in setup_light_scenario
    influence = get_light_influence(scenario[2], group_mask)
  File "C:\Program Files\Blender Foundation\Blender 3.0\3.0\scripts\addons\vpx_lightmapper\vlm_baker.py", line 360, in get_light_influence
    influence_radius = light.data.shadow_soft_size + math.log10(light.data.energy) * 250 * global_scale # empirically observed
ValueError: math domain error

location: <unknown location>:-1

Here light.data.energy becomes negative. I worked around it for now using max(0.00001, light.data.energy) because I am not sure if the calculation would work for log10(0) which is -infinity.

Rendering packmaps
Info: No orphaned data-blocks to purge
. Rendering packmap #0 containing 8 bake/light map
Python: Traceback (most recent call last):
  File "C:\Program Files\Blender Foundation\Blender 3.0\3.0\scripts\addons\vpx_lightmapper\__init__.py", line 364, in execute
    vlm_baker.render_packmaps(context)
  File "C:\Program Files\Blender Foundation\Blender 3.0\3.0\scripts\addons\vpx_lightmapper\vlm_baker.py", line 1791, in render_packmaps
    extremas = Image.open(os.path.abspath(path)).getextrema()
  File "C:\Program Files\Blender Foundation\Blender 3.0\3.0\python\lib\site-packages\PIL\Image.py", line 2953, in open
    fp = builtins.open(filename, "rb")
FileNotFoundError: [Errno 2] No such file or directory: '\\\\shaq - Bakes\\Renders\\Environment - Group 0.exr'

location: <unknown location>:-1
Error: Python: Traceback (most recent call last):
  File "C:\Program Files\Blender Foundation\Blender 3.0\3.0\scripts\addons\vpx_lightmapper\__init__.py", line 364, in execute
    vlm_baker.render_packmaps(context)
  File "C:\Program Files\Blender Foundation\Blender 3.0\3.0\scripts\addons\vpx_lightmapper\vlm_baker.py", line 1791, in render_packmaps
    extremas = Image.open(os.path.abspath(path)).getextrema()
  File "C:\Program Files\Blender Foundation\Blender 3.0\3.0\python\lib\site-packages\PIL\Image.py", line 2953, in open
    fp = builtins.open(filename, "rb")
FileNotFoundError: [Errno 2] No such file or directory: '\\\\shaq - Bakes\\Renders\\Environment - Group 0.exr'

location: <unknown location>:-1

No VLM.Bake

Hi, after a lot of time, trying to install Python's librairies, i have now a new error message : No 'VLM.Bake' collection to process.

When i import my pinball table, i can't see any collections, any playfield.... So i think there are things not well done at the exportation in VPX... but i don't know what.
Thanks for your answers ;)
JPJ

PS : i still have an error in the Add-ons, but the "Install Dependencies" is grey, and do nothing... (using 0.0.7)

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.