Skip to content

Commit

Permalink
Fix export of color in material that is not child of robot tag
Browse files Browse the repository at this point in the history
  • Loading branch information
traversaro authored Sep 26, 2024
1 parent 0f774a7 commit b4436aa
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion urchin/urdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -1054,10 +1054,13 @@ def _to_xml(self, parent, path):
color.attrib["rgba"] = np.array2string(self.color)[1:-1]
node.append(color)

# For non-top-level elements just save the material with a name
else:
node = ET.Element("material")
node.attrib["name"] = self.name
if self.color is not None:
color = ET.Element("color")
color.attrib["rgba"] = np.array2string(self.color)[1:-1]
node.append(color)
return node

def copy(self, prefix="", scale=None):
Expand Down

0 comments on commit b4436aa

Please sign in to comment.