You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Error: Python: Traceback (most recent call last):
File "/Users/mav/dev/BlenderProc/examples/basics/semantic_segmentation/main.py", line 66, in <module>
poi = bproc.object.compute_poi(objs)
File "/Users/mav/dev/BlenderProc/blenderproc/python/types/MeshObjectUtility.py", line 701, in compute_poi
bb_points = obj.get_bound_box()
AttributeError: 'Curve' object has no attribute 'get_bound_box'
I can create a PR if you like, the question is why do some object types not have this function. I simply fixed it with:
for obj in objects:
if hasattr(obj, "get_bound_box") and callable(getattr(obj, "get_bound_box")):
# Get bounding box corners
bb_points = obj.get_bound_box()
# Compute mean coords of bounding box
mean_bb_points.append(np.mean(bb_points, axis=0))
in def compute_poi(objects: List[MeshObject]) -> np.ndarray.
Minimal code example
No response
Files required to run the code
No response
Expected behavior
I would have expected no AttributeError
BlenderProc version
2.7.1
The text was updated successfully, but these errors were encountered:
thanks for the report. I think the problem is that load_blend returns a List[Entity] while compute_poi requires a List[MeshObject] (Entity is a parent class of MeshObject). So you would need to filter out all objects that are no MeshObject first.
If you want the curves to be considered in the poi computation, you probably would need to write your own compute_poi function.
Describe the issue
I copied some code and was facing an issue with:
I can create a PR if you like, the question is why do some object types not have this function. I simply fixed it with:
in
def compute_poi(objects: List[MeshObject]) -> np.ndarray
.Minimal code example
No response
Files required to run the code
No response
Expected behavior
I would have expected no AttributeError
BlenderProc version
2.7.1
The text was updated successfully, but these errors were encountered: