Skip to content

Commit

Permalink
Merge pull request #22 from fishbotics/traversaro-patch-1
Browse files Browse the repository at this point in the history
Fix export of color in material that is not child of robot tag
  • Loading branch information
fishbotics authored Oct 3, 2024
2 parents 0f774a7 + b4436aa commit 8285cb5
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 8285cb5

Please sign in to comment.