Getting occlusion state of BMesh elements. #36651

Closed
opened 2013-09-03 16:23:44 +02:00 by Gert De Roost · 4 comments
Member

%%%My first "real" patch so bear with me...

It allows getting occlusion state of BMesh elements in a given RegionView3D.

rv3d = bpy.context.space_data.region_3d
v = bm.verts[0]
state = v.occlusion_get(rv3d)

Current implementation returns False for elements that dont have their component selection mode on.
(As they arent drawn to backbuffer) Maybe this is expected behaviour or we might set/unset the
component mode to verts+edges+faces during the time of the call...? Needs decision.

Also I dont know if I handled new needed include files well (I havent any experience with this big C projects...)
And I exposed an internal rna function in rna_internal.h because it was needed by my code to get the area
and region from given region_data.

I have been wrestling with all ways of raycasting to get occlusion state before so I suppose this addition will be welcome.

Gert De Roost

%%%

%%%My first "real" patch so bear with me... It allows getting occlusion state of BMesh elements in a given RegionView3D. rv3d = bpy.context.space_data.region_3d v = bm.verts[0] state = v.occlusion_get(rv3d) Current implementation returns False for elements that dont have their component selection mode on. (As they arent drawn to backbuffer) Maybe this is expected behaviour or we might set/unset the component mode to verts+edges+faces during the time of the call...? Needs decision. Also I dont know if I handled new needed include files well (I havent any experience with this big C projects...) And I exposed an internal rna function in rna_internal.h because it was needed by my code to get the area and region from given region_data. I have been wrestling with all ways of raycasting to get occlusion state before so I suppose this addition will be welcome. Gert De Roost %%%
Author
Member

Changed status to: 'Open'

Changed status to: 'Open'
Author
Member

%%%New version :

Copied over code (few lines) included from rna_internal.h, and removed the dependency.

Thats cleaner!%%%

%%%New version : Copied over code (few lines) included from rna_internal.h, and removed the dependency. Thats cleaner!%%%

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Campbell Barton self-assigned this 2015-03-11 13:19:04 +01:00

There is a branch to add mathutils.kdtree, We intend to expose this in a way BMesh can make use of (so you can get a kdtree from).

I'd rather go with this as a way to check mesh and do ray-casts.

There is a branch to add `mathutils.kdtree`, We intend to expose this in a way BMesh can make use of (so you can get a kdtree from). I'd rather go with this as a way to check mesh and do ray-casts.
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-addons#36651
No description provided.