rgsouthall / vi-suite06

VI-Suite release for Blender 2.8
32 stars 8 forks source link

Problem exporting geometry per vertices #12

Closed ttsesm closed 3 years ago

ttsesm commented 3 years ago

Hi Ryan,

I was working with some geometries and I've noticed that exporting the geometry per vertices in the LiVi Geometry node for some of them was failing with the following error:

Traceback (most recent call last):
  File "/home/ttsesm/Development/BlenderProc/blender/blender-2.83.2-linux64/2.83/scripts/addons/vi-suite06/vi_operators.py", line 589, in invoke
    radgexport(self, node)
  File "/home/ttsesm/Development/BlenderProc/blender/blender-2.83.2-linux64/2.83/scripts/addons/vi-suite06/livi_export.py", line 184, in radgexport
    ovp.rtpoints(bm, node.offset, str(frame))
  File "/home/ttsesm/Development/BlenderProc/blender/blender-2.83.2-linux64/2.83/scripts/addons/vi-suite06/livi_func.py", line 69, in rtpoints
    self['cverts'], self['lisenseareas'][frame] = gp.index, [vertarea(bm, gp) for gp in gpoints]    
  File "/home/ttsesm/Development/BlenderProc/blender/blender-2.83.2-linux64/2.83/scripts/addons/vi-suite06/livi_func.py", line 69, in <listcomp>
    self['cverts'], self['lisenseareas'][frame] = gp.index, [vertarea(bm, gp) for gp in gpoints]    
  File "/home/ttsesm/Development/BlenderProc/blender/blender-2.83.2-linux64/2.83/scripts/addons/vi-suite06/vi_func.py", line 865, in vertarea
    eps = [mathutils.geometry.intersect_line_line(face.calc_center_median(), ofaces[i].calc_center_median(), ovs[i][0].co, ovs[i][1].co)[1] for i in range(2)]
  File "/home/ttsesm/Development/BlenderProc/blender/blender-2.83.2-linux64/2.83/scripts/addons/vi-suite06/vi_func.py", line 865, in <listcomp>
    eps = [mathutils.geometry.intersect_line_line(face.calc_center_median(), ofaces[i].calc_center_median(), ovs[i][0].co, ovs[i][1].co)[1] for i in range(2)]
TypeError: 'NoneType' object is not subscriptable

location: <unknown location>:-1

location: <unknown location>:-1
Error: Traceback (most recent call last):
  File "/home/ttsesm/Development/BlenderProc/blender/blender-2.83.2-linux64/2.83/scripts/addons/vi-suite06/vi_operators.py", line 589, in invoke
    radgexport(self, node)
  File "/home/ttsesm/Development/BlenderProc/blender/blender-2.83.2-linux64/2.83/scripts/addons/vi-suite06/livi_export.py", line 184, in radgexport
    ovp.rtpoints(bm, node.offset, str(frame))
  File "/home/ttsesm/Development/BlenderProc/blender/blender-2.83.2-linux64/2.83/scripts/addons/vi-suite06/livi_func.py", line 69, in rtpoints
    self['cverts'], self['lisenseareas'][frame] = gp.index, [vertarea(bm, gp) for gp in gpoints]    
  File "/home/ttsesm/Development/BlenderProc/blender/blender-2.83.2-linux64/2.83/scripts/addons/vi-suite06/livi_func.py", line 69, in <listcomp>
    self['cverts'], self['lisenseareas'][frame] = gp.index, [vertarea(bm, gp) for gp in gpoints]    
  File "/home/ttsesm/Development/BlenderProc/blender/blender-2.83.2-linux64/2.83/scripts/addons/vi-suite06/vi_func.py", line 865, in vertarea
    eps = [mathutils.geometry.intersect_line_line(face.calc_center_median(), ofaces[i].calc_center_median(), ovs[i][0].co, ovs[i][1].co)[1] for i in range(2)]
  File "/home/ttsesm/Development/BlenderProc/blender/blender-2.83.2-linux64/2.83/scripts/addons/vi-suite06/vi_func.py", line 865, in <listcomp>
    eps = [mathutils.geometry.intersect_line_line(face.calc_center_median(), ofaces[i].calc_center_median(), ovs[i][0].co, ovs[i][1].co)[1] for i in range(2)]
TypeError: 'NoneType' object is not subscriptable

location: <unknown location>:-1

The corresponding per faces option seems to work without issues on the other hand.

rgsouthall commented 3 years ago

I can't replicate. I would need a Blend file that exhibits this.

ttsesm commented 3 years ago

Hi Ryan,

Please find attached a blend file. It contains a house structure grouped in 6 rooms. See image below:

image

The issue happens only when Room#0_0 is active and I am trying to export the geometry:

image

test.zip

ttsesm commented 3 years ago

@rgsouthall did you fix this issue?

With the latest git version I am not getting this error anymore.

rgsouthall commented 3 years ago

I did not fix it per se as it's a geometry problem, but the VI-Suite now reports zero area if the area associated with a vertex cannot be calculated instead of throwing up an error..

ttsesm commented 3 years ago

Ok, but I am a bit puzzled now. Shouldn't this be zero anyways? How do you specify the area of a point since it is a single point. I mean for a face you get the area of the shape based on the vertices that structure the face but for an individual vertex/point how you do that.

rgsouthall commented 3 years ago

I use an algorithm to calculate a pseudo vertex area from neighbouring faces.

On Thu, 29 Oct 2020 at 13:51, ttsesm notifications@github.com wrote:

Ok, but I am a bit puzzled now. Shouldn't this be zero anyways? How do you specify the area of a point since it is a single point. I mean for a face you get the area of the shape based on the vertices that structure the face but for a vertex/point how you do that.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/rgsouthall/vi-suite06/issues/12#issuecomment-718766037, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAOOW4VVWYWL3FGQSMBOEDLSNFXMTANCNFSM4STH4CTQ .

ttsesm commented 3 years ago

I use an algorithm to calculate a pseudo vertex area from neighbouring faces.

Ok, I see. Thanks for the clarification.

ttsesm commented 3 years ago

I guess this is also addressed in commit https://github.com/rgsouthall/vi-suite06/commit/19f4be8956a4a5df6c0c07bb96501d077c497d69