Skip to content

Instantly share code, notes, and snippets.

@JarLowrey
Last active May 4, 2017 13:11
Show Gist options
  • Save JarLowrey/4c03f9bda678802abcf84f1dc475a8f5 to your computer and use it in GitHub Desktop.
Save JarLowrey/4c03f9bda678802abcf84f1dc475a8f5 to your computer and use it in GitHub Desktop.
Physics Editor exporter for Godot Game Engine. Written by @aombk, re-hosted here. Unzip in C:\Program Files\CodeAndWeb\PhysicsEditor\resources\exporters - https://github.com/godotengine/godot/issues/3405#issuecomment-298074473
<exporter>
<!-- identifier of the exporter -->
<name>1godot.xml</name>
<!-- name for the dropbox -->
<displayName>Godot XML Exporter</displayName>
<!-- description of the exporter -->
<description>Godot XML Exporter by aombk</description>
<!-- exporter version -->
<version>0.1</version>
<!-- direction of the y axis: up / down -->
<yAxisDirection>down</yAxisDirection>
<!-- physics engine to use: box2d, chipmunk -->
<physicsEngine>box2d</physicsEngine>
<!-- name of the template file -->
<template>godot.xml</template>
<!-- file exension for the data file -->
<fileExtension>xml</fileExtension>
<!-- anchor point settings -->
<anchorPoint>
<!-- are anchor points supported ? yes/no -->
<enabled>no</enabled>
<!-- relative position of the default anchor point -->
<relX>0.5</relX>
<relY>0.5</relY>
</anchorPoint>
<origin>
<relX>0.5</relX>
<relY>0.5</relY>
<type>fixed</type>
</origin>
</exporter>
<?xml version="1.0" encoding="UTF-8" ?>
<resource_file type="PackedScene" subresource_count="1" version="2.1" version_name="Godot Engine v2.1.stable.official">
<main_resource>
<dictionary name="_bundled" shared="false">
<string> "conn_count" </string>
<int> 0 </int>
<string> "conns" </string>
<int_array len="0"> </int_array>
<string> "editable_instances" </string>
<array len="0" shared="false">
</array>
<string> "names" </string>
<string_array len="5">
<string> "CollisionPolygon2D" </string>
<string> "build_mode" </string>
<string> "polygon" </string>
<string> "shape_range" </string>
<string> "trigger" </string>
</string_array>
<string> "node_count" </string>
<int> 1 </int>
<string> "node_paths" </string>
<array len="0" shared="false">
</array>
<string> "nodes" </string>
<int_array len="15"> -1, -1, 0, 0, -1, 4, 1, 0, 2, 1, 3, 2, 4, 3, 0 </int_array>
<string> "variants" </string>
<array len="4" shared="false">
<int> 0 </int>
{% for body in bodies %}{% for fixture in body.fixtures %}
<vector2_array len="{{fixture.hull|length}}">{% for point in fixture.hull %}{% if not forloop.first %},{% endif %}{{point.x|floatformat:2}},{{point.y|floatformat:2}}{% endfor %}{% endfor %}{% endfor %}</vector2_array>
<vector2> -1, -1 </vector2>
<bool> False </bool>
</array>
<string> "version" </string>
<int> 2 </int>
</dictionary>
</main_resource>
</resource_file>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment