Skip to content

Commit

Permalink
python: use new material API in meshcat_visualizer
Browse files Browse the repository at this point in the history
  • Loading branch information
jorisv committed Dec 13, 2023
1 parent 410e7fa commit cfdc74a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions bindings/python/pinocchio/visualize/meshcat_visualizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,10 +464,11 @@ def to_material_color(rgba) -> int:
if float(meshColor[3]) != 1.0:
material.transparent = True
material.opacity = float(meshColor[3])
if geometry_object.overrideMaterial:
material.emissive = to_material_color(geometry_object.meshEmissionColor)
material.specular = to_material_color(geometry_object.meshSpecularColor)
material.shininess = geometry_object.meshShininess*100.
geom_material = geometry_object.meshMaterial
if geometry_object.overrideMaterial and isinstance(geom_material, pin.GeometryPhongMaterial):
material.emissive = to_material_color(geom_material.meshEmissionColor)
material.specular = to_material_color(geom_material.meshSpecularColor)
material.shininess = geom_material.meshShininess*100.
self.viewer[viewer_name].set_object(obj, material)

if is_mesh: # Apply the scaling
Expand Down

0 comments on commit cfdc74a

Please sign in to comment.