mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-12-07 00:09:14 +08:00
fix metashape_to_json() if there is no 'components' tag in .xml (#1906)
fix metashape_to_json() if no 'components' in .xml
This commit is contained in:
1 parent
b1ddb9e695
commit
79b06ee2bf
1 file changed
+2
@@ -115,6 +115,7 @@ def metashape_to_json( # pylint: disable=too-many-statements
|
|||||||
sensor_dict[sensor.get("id")] = s
|
sensor_dict[sensor.get("id")] = s
|
||||||
|
|
||||||
components = chunk.find("components")
|
components = chunk.find("components")
|
||||||
|
if components is not None:
|
||||||
component_dict = {}
|
component_dict = {}
|
||||||
for component in components:
|
for component in components:
|
||||||
transform = component.find("transform")
|
transform = component.find("transform")
|
||||||
@@ -171,6 +172,7 @@ def metashape_to_json( # pylint: disable=too-many-statements
|
|||||||
num_skipped += 1
|
num_skipped += 1
|
||||||
continue
|
continue
|
||||||
transform = np.array([float(x) for x in camera.find("transform").text.split()]).reshape((4, 4))
|
transform = np.array([float(x) for x in camera.find("transform").text.split()]).reshape((4, 4))
|
||||||
|
if components is not None:
|
||||||
component_id = camera.get("component_id")
|
component_id = camera.get("component_id")
|
||||||
if component_id in component_dict:
|
if component_id in component_dict:
|
||||||
transform = component_dict[component_id] @ transform
|
transform = component_dict[component_id] @ transform
|
||||||
|
|||||||
Reference in new issue
Block a user