Skip to content

Instantly share code, notes, and snippets.

@michalpelka
Created October 4, 2022 19:58
Show Gist options
  • Select an option

  • Save michalpelka/f9bcd277de1bb9ba5fd50d718af060af to your computer and use it in GitHub Desktop.

Select an option

Save michalpelka/f9bcd277de1bb9ba5fd50d718af060af to your computer and use it in GitHub Desktop.
Export Collider definition from Blender to use in URDF
import bpy
import
obj = bpy.context.active_object
l = obj.location
e = obj.rotation_euler
s = obj.scale
#print ('<origin rpy="%f %f %f" xyz="%f %f %f"/>' % (e[0],e[1],e[2], l[0],l[1],l[2]))
print ('<origin rpy="%f %f %f" xyz="%f %f %f"/>' % (e[0],e[1],e[2], l[0],l[1],l[2]))
print ('<geometry>')
print (' <box size="%f %f %f"/>' % (s[0],s[1],s[2]))
print ('</geometry>')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment