workaround for Issue UE-250434 getting LiDAR point positions in python

That a method be added in the unreal.LidarPointCloud class that lets users query the selected points and their positions. It is not terribly intuitive to move a box or a sphere and encompass the points you care about, there are already excellent selection tools in LiDAR mode (particularly marquee and paint brush)…

So instead of this:

pnts = selectedLIDAR[0].get_points_in_sphere_as_copies(loc,scl,False,True)

We could do this:

pnts = selectedLIDAR[0].get_selected_points(False,True) We can keep the arguments for visible_only and return_world_space as those are helpful regardless

The logic seems to be there already since there is functionality to deleted selected, so likely this is just about exposing it in Python. This simple step would open the door for lots of new tools that myself and others are writing and/or transporting from Maya to UE that use the selected points to align to other geo/world space of scene/make planar/etc…

Thank you!

Casey Schatz

Steps to Reproduce

Hi there, a few things new and old with the LiDAR plugin in 5.6. This is part bug report and part workaround…

The issue currently described in UE-250434 is as follows:

With the lidar selected, run these lines of python, obviously make sure there are points at the boxLocation

selectedLIDAR = unreal.EditorUtilityLibrary.get_selected_assets()``boxLocation = unreal.Vector(367,107,-723.18777)``boxExtent = unreal.Vector(100,100,100)``pnts = selectedLIDAR[0].get_points_in_box_as_copies(boxLocation,boxExtent,False,True)``print(pnts)

This will result in an array of empty locations:L

LogPython: [{location: {}, color: {b: 70, g: 40, r: 22, a: 121}, normal: {x: 127, y: 127, z: 127}, visible: True}, {location: {}, color: {b: 65, g: 24, r: 3, a: 122}, normal: {x: 127, y: 127, z: 127}, visible: True}{}

Per a tip from Brian Frager to use “get_editor_property” I got this working:

loc,scl = sampleLocation()

pnts = selectedLIDAR[0].get_points_in_sphere_as_copies(loc,scl,False,True)

xList,yList,zList = ,,

for p in pnts:

xList.append(p.location.get\_editor\_property("x"))

yList.append(p.location.get\_editor\_property("y"))

zList.append(p.location.get\_editor\_property("z"))

So while it might be cleaner to get the values via the array, there’s nothing wrong with this as a work around. So I think of greater importance than Issue UE-250434 is to enable python to query the selection of points that are selected via the wonderful tools in LiDAR mode like marquee, paint brush etc…

selectedLIDAR = unreal.EditorUtilityLibrary.get_selected_assets() boxLocation = unreal.Vector(367,107,-723.18777) boxExtent = unreal.Vector(100,100,100) pnts = selectedLIDAR[0].get_points_in_box_as_copies(boxLocation,boxExtent,False,True) print(pnts)

Hi Casey,

Sorry for the delay.

Unfortunately, the developer who can help on this topic will not be available for some weeks.

We will come back to you as soon as they have the time to look into it.

Thanks for your patience.

Regards,

Jean-Luc