isl-org / isl-org/Open3D

Is there a way to keep the texture on the mesh, after "o3d.visualization.rendering.MaterialRecord()" is called

Open
#4,603 1 comment 0 reactions 1 assignee Claimed by @errissa View on GitHub
question ui visualization
Dominant language
C++
Stars
14k
Forks
2.6k
Avg merge
5d 18h
Merged PRs (30d)
6

Description

### Checklist

- [X] I have searched for [similar issues](https://github.com/isl-org/Open3D/issues).
- [X] For Python issues, I have tested with the [latest development wheel](http://www.open3d.org/docs/latest/getting_started.html#development-version-pip).
- [X] I have checked the [release documentation](http://www.open3d.org/docs/release/) and the [latest documentation](http://www.open3d.org/docs/latest/) (for `master` branch).

### My Question

Dear Developer-Team,

I am currently working on an animation for an IMU sensor. I have a while-loop with a delay(). After each altering of the geometry, I remove it from the scene and add it again to it. Between that, I have to to call `o3d.visualization.rendering.MaterialRecord()`. But with that call, I lose my texture. I could reload the texture as well, but that slows down the animation quite a lot. Is there a way to keep the texture on the mesh?

```
while 1:
time.sleep(0.1)

def update_sensorNode_positions():

for sensorNodeObject in self.sensorNodeObjectList:

# remove sensorNode from scene
self.vis.remove_geometry(str(sensorNodeObject.sensorNodeID))

self.mat = o3d.visualization.rendering.MaterialRecord()
self.mat.shader = "defaultLit"
self.mat.albedo_img = config.textureOfSensorNode

self.vis.add_geometry(str(sensorNodeObject.sensorNodeID), sensorNodeObject.meshBox, self.mat)

o3d.visualization.gui.Application.instance.post_to_main_thread(self.vis, update_sensorNode_positions)
```

Thanks in advance.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.