ladybug-tools / ladybug-blender

:beetle: :orange_book: Ladybug plugin for Blender
GNU General Public License v3.0
47 stars 9 forks source link

LB Windrose Error - freq_line undefined #21

Open seamoo opened 4 years ago

seamoo commented 4 years ago

Running: Blender 2.9.0 LadyBug Version 0.0.201008

Hi Getting the following error when trying to build a Windrose.

Traceback (most recent call last): File "C:\Users\smooney\AppData\Roaming\Blender Foundation\Blender\2.90\scripts\addons\ladybug_tools\nodes\ladybug\LB_Out.py", line 33, in execute node.refresh() File "C:\Users\smooney\AppData\Roaming\Blender Foundation\Blender\2.90\scripts\addons\ladybug_tools\nodes\ladybug\LB_Out.py", line 60, in refresh self.process() File "C:\Users\smooney\AppData\Roaming\Blender Foundation\Blender\2.90\scripts\addons\ladybug_tools\nodes\ladybug\LB_Out.py", line 77, in process for geometries in socket.sv_get(): File "C:\Users\smooney\AppData\Roaming\Blender Foundation\Blender\2.90\scripts\addons\sverchok-master\core\sockets.py", line 125, in sv_get return self.convert_data(SvGetSocket(self, deepcopy), implicit_conversions) File "C:\Users\smooney\AppData\Roaming\Blender Foundation\Blender\2.90\scripts\addons\sverchok-master\core\socket_data.py", line 121, in SvGetSocket raise SvNoDataError(socket, msg="not found in socket_data_cache") sverchok.core.socket_data.SvNoDataError: node LB Out (socket geometry) not found in socket_data_cache

location: :-1

LBWindRose

Moult commented 4 years ago

I can replicate this error. It is half related to #16. The other half is a bug upstream I believe. So, ping @mostaphaRoudsari and @chriswmackey .

By the way, try and get the error in the console as soon as you plug the first output of the culprit node (i.e. the one that turns red). That way, it'll show the right error message. The error message you've shown is for the LB Out node, which is complaining that it can't get any valid geometry. This is not the true error, as the error happened in the LB Wind Rose error.

For a temporary workaround, Set show frequency to True:

image

@mostaphaRoudsari and @chriswmackey - the actual error is:

  File "/home/dion/.config/blender/2.90/scripts/addons/ladybug_tools/nodes/ladybug/LB_Wind_Rose.py", line 321, in process_ladybug
    all_freq_line.append(freq_line)
UnboundLocalError: local variable 'freq_line' referenced before assignment

I think this is due to: https://github.com/ladybug-tools/ladybug-grasshopper/blob/master/ladybug_grasshopper/src/LB%20Wind%20Rose.py#L272-L282 - where freq_line is only defined if _show_freq_ is True. Due to the missing defaults, this defaults to false, thus triggering the error - that is already reported in #16. In addition, I believe freq_line should be defined. I'm hesitating to submit a PR for this, as I'm not too familiar with the usecases of freq line, but hopefully my explanation makes sense.

Moult commented 4 years ago

By the way, @seamoo just a fun tip you might be interested in is setting the color management to Standard as shown below if you're working with coloured meshes. It defaults to Filmic, which is great for renders, but not so great for scientific colour legends :)

image

seamoo commented 4 years ago

I can replicate this error. It is half related to #16. The other half is a bug upstream I believe. So, ping @mostaphaRoudsari and @chriswmackey .

By the way, try and get the error in the console as soon as you plug the first output of the culprit node (i.e. the one that turns red). That way, it'll show the right error message. The error message you've shown is for the LB Out node, which is complaining that it can't get any valid geometry. This is not the true error, as the error happened in the LB Wind Rose error.

For a temporary workaround, Set show frequency to True:

image

@mostaphaRoudsari and @chriswmackey - the actual error is:

  File "/home/dion/.config/blender/2.90/scripts/addons/ladybug_tools/nodes/ladybug/LB_Wind_Rose.py", line 321, in process_ladybug
    all_freq_line.append(freq_line)
UnboundLocalError: local variable 'freq_line' referenced before assignment

I think this is due to: https://github.com/ladybug-tools/ladybug-grasshopper/blob/master/ladybug_grasshopper/src/LB%20Wind%20Rose.py#L272-L282 - where freq_line is only defined if _show_freq_ is True. Due to the missing defaults, this defaults to false, thus triggering the error - that is already reported in #16. In addition, I believe freq_line should be defined. I'm hesitating to submit a PR for this, as I'm not too familiar with the usecases of freq line, but hopefully my explanation makes sense.

Hi @Moult . Working now. As you said it needed the boolean input in show frequency. Cheers! I will look at capturing the error through the console going forward. The colour managment one had not seen before and will check it out!

Sean