leomoon-studios / leomoon-lightstudio

Light Studio plugin for Blender
https://leomoon.com/store/plugins/leomoon-lightstudio/
GNU General Public License v3.0
353 stars 45 forks source link

BUG: Light Brush #48

Closed letoast closed 2 years ago

letoast commented 3 years ago

Blender version 2.93.3

Pressing F and clicking on any mesh produces this error:

location: <unknown location>:-1
Error: Python: Traceback (most recent call last):
  File "C:\Users\Ciril\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\leomoon-lightstudio-master\light_brush.py", line 237, in modal
    raycast(override_context, override_event, self.normal_type)
  File "C:\Users\Ciril\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\leomoon-lightstudio-master\light_brush.py", line 64, in raycast
    for obj, matrix in visible_objects_and_duplis():
  File "C:\Users\Ciril\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\leomoon-lightstudio-master\light_brush.py", line 35, in visible_objects_and_duplis
    depsgraph = context.depsgraph
AttributeError: 'OverrideContext' object has no attribute 'depsgraph'
leomoon commented 3 years ago

Hello,

What version of LightStudio are you using? The latest version is 2.9.2 and I can't reproduce the error with Blender 2.93.3.

letoast commented 2 years ago

Greetings, after testing on another computer, there is no error using the light brush... May be an error with python then, I guess I'll have to debug it somehow. I'll try tomorrow and close the issue if it's not affected by the plugin

leomoon commented 2 years ago

Do you have any other plugin installed? Maybe there's plugin that LightStudio is not compatible with.

letoast commented 2 years ago

Sorry for the long waiting time, but I figured out what the problem is. To replicate: Part 1 - set up a simple library file

  1. New blender file, delete everything but the default cube
  2. Create a new empty
  3. Parent the cube to the empty (the empty should be the parent)

Part 2 - set up the file that will use the library file for instancing

  1. New blender file, delete everything
  2. File -> Link -> link the collection from the Part 1 file
  3. Light Studio -> Create LightStudio
  4. Add a light
  5. Open LightStudio Control Panel
  6. Select the light, press F
  7. Try to select on of the faces of the linked cube
  8. Get error: image

My guess is that the plugin is trying to get the normal of the selection, but the selection is an empty, so it doesn't have them. Mind you, this doesn't happen if the model is not linked(if you try to select a normal of a model that is parented to an empty in the original file, the Light Brush works)

I don't know if links work by zipping files, but anyway, here's the minimal setup(I do suggest you try doing it on your own just in case): LightStudioTest.zip :

leomoon commented 2 years ago

this is fixed in LightStudio 2.10.0