Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem exporting geometry per vertices #12

Closed
ttsesm opened this issue Oct 16, 2020 · 8 comments
Closed

Problem exporting geometry per vertices #12

ttsesm opened this issue Oct 16, 2020 · 8 comments

Comments

@ttsesm
Copy link

ttsesm commented Oct 16, 2020

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
Copy link
Owner

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

@ttsesm
Copy link
Author

ttsesm commented Oct 19, 2020

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
Copy link
Author

ttsesm commented Oct 29, 2020

@rgsouthall did you fix this issue?

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

@rgsouthall
Copy link
Owner

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
Copy link
Author

ttsesm commented Oct 29, 2020

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
Copy link
Owner

rgsouthall commented Oct 29, 2020 via email

@ttsesm
Copy link
Author

ttsesm commented Oct 29, 2020

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

Ok, I see. Thanks for the clarification.

@ttsesm
Copy link
Author

ttsesm commented Nov 11, 2020

I guess this is also addressed in commit 19f4be8

@ttsesm ttsesm closed this as completed Nov 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants