summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/variant_call.cpp3
-rw-r--r--core/variant_op.cpp319
-rw-r--r--doc/base/classes.xml260
-rw-r--r--platform/windows/os_windows.cpp2
-rw-r--r--tools/collada/collada.cpp25
-rw-r--r--tools/collada/collada.h2
-rw-r--r--tools/editor/icons/2x/icon_gizmo_listener.pngbin0 -> 1906 bytes
-rw-r--r--tools/editor/icons/2x/icon_listener.pngbin0 -> 941 bytes
-rw-r--r--tools/editor/icons/icon_gizmo_listener.pngbin1698 -> 950 bytes
-rw-r--r--tools/editor/icons/icon_listener.pngbin449 -> 504 bytes
-rw-r--r--tools/editor/icons/source/icon_gizmo_listener.svg100
-rw-r--r--tools/editor/icons/source/icon_headphones.svg119
-rw-r--r--tools/editor/icons/source/icon_listener.svg101
-rw-r--r--tools/editor/io_plugins/editor_import_collada.cpp4
-rw-r--r--tools/editor/io_plugins/editor_scene_import_plugin.cpp75
-rw-r--r--tools/export/blender25/io_scene_dae/export_dae.py10
16 files changed, 747 insertions, 273 deletions
diff --git a/core/variant_call.cpp b/core/variant_call.cpp
index eb3ab65f40..d427a80541 100644
--- a/core/variant_call.cpp
+++ b/core/variant_call.cpp
@@ -1663,6 +1663,9 @@ _VariantCall::addfunc(Variant::m_vtype,Variant::m_ret,_SCS(#m_method),VCALL(m_cl
_VariantCall::constant_data[Variant::IMAGE].value["FORMAT_ATC_ALPHA_INTERPOLATED"]=Image::FORMAT_ATC_ALPHA_INTERPOLATED;
_VariantCall::constant_data[Variant::IMAGE].value["FORMAT_CUSTOM"]=Image::FORMAT_CUSTOM;
+ _VariantCall::constant_data[Variant::IMAGE].value["INTERPOLATE_NEAREST"]=Image::INTERPOLATE_NEAREST;
+ _VariantCall::constant_data[Variant::IMAGE].value["INTERPOLATE_BILINEAR"]=Image::INTERPOLATE_BILINEAR;
+ _VariantCall::constant_data[Variant::IMAGE].value["INTERPOLATE_CUBIC"]=Image::INTERPOLATE_CUBIC;
}
void unregister_variant_methods() {
diff --git a/core/variant_op.cpp b/core/variant_op.cpp
index 6065094da7..9f706e75cf 100644
--- a/core/variant_op.cpp
+++ b/core/variant_op.cpp
@@ -861,7 +861,6 @@ void Variant::evaluate(const Operator& p_op, const Variant& p_a, const Variant&
} break;
//logic
case OP_AND: {
-
bool l = p_a.booleanize(r_valid);
if (!r_valid)
return;
@@ -969,6 +968,30 @@ Variant Variant::get_named(const StringName& p_index, bool *r_valid) const {
return get(p_index.operator String(),r_valid);
}
+
+#define DEFAULT_OP_ARRAY_CMD(m_name, m_type, skip_test, cmd)\
+ case m_name: {\
+ skip_test;\
+\
+ if (p_index.get_type()==Variant::INT || p_index.get_type()==Variant::REAL) {\
+ int index = p_index;\
+ m_type *arr=reinterpret_cast<m_type* >(_data._mem);\
+\
+ if (index<0)\
+ index += arr->size();\
+ if (index>=0 && index<arr->size()) {\
+ valid=true;\
+ cmd;\
+ }\
+ }\
+ } break;
+
+#define DEFAULT_OP_DVECTOR_SET(m_name, dv_type, skip_cond)\
+ DEFAULT_OP_ARRAY_CMD(m_name, DVector<dv_type>, if(skip_cond) return;, arr->set(index, p_value);return)
+
+#define DEFAULT_OP_DVECTOR_GET(m_name, dv_type)\
+ DEFAULT_OP_ARRAY_CMD(m_name, const DVector<dv_type>, 0, return arr->get(index))
+
void Variant::set(const Variant& p_index, const Variant& p_value, bool *r_valid) {
static bool _dummy=false;
@@ -989,7 +1012,10 @@ void Variant::set(const Variant& p_index, const Variant& p_value, bool *r_valid)
int idx=p_index;
String *str=reinterpret_cast<String*>(_data._mem);
- if (idx <0 || idx>=str->length())
+ int len = str->length();
+ if (idx<0)
+ idx += len;
+ if (idx<0 || idx>=len)
return;
String chr;
@@ -1003,7 +1029,7 @@ void Variant::set(const Variant& p_index, const Variant& p_value, bool *r_valid)
return;
}
- *str = str->substr(0,idx)+chr+str->substr(idx+1,str->length());
+ *str = str->substr(0,idx)+chr+str->substr(idx+1, len);
valid=true;
return;
@@ -1018,6 +1044,8 @@ void Variant::set(const Variant& p_index, const Variant& p_value, bool *r_valid)
// scalar index
int idx=p_index;
+ if (idx<0)
+ idx += 2;
if (idx>=0 && idx<2) {
Vector2 *v=reinterpret_cast<Vector2*>(_data._mem);
@@ -1076,6 +1104,8 @@ void Variant::set(const Variant& p_index, const Variant& p_value, bool *r_valid)
int index = p_index;
+ if (index<0)
+ index += 3;
if (index>=0 && index<3) {
Matrix32 *v=_data._matrix32;
@@ -1112,6 +1142,8 @@ void Variant::set(const Variant& p_index, const Variant& p_value, bool *r_valid)
if (p_index.get_type()==Variant::INT || p_index.get_type()==Variant::REAL) {
//scalar index
int idx=p_index;
+ if (idx<0)
+ idx += 3;
if (idx>=0 && idx<3) {
Vector3 *v=reinterpret_cast<Vector3*>(_data._mem);
@@ -1246,6 +1278,8 @@ void Variant::set(const Variant& p_index, const Variant& p_value, bool *r_valid)
int index = p_index;
+ if (index<0)
+ index += 3;
if (index>=0 && index<3) {
Matrix3 *v=_data._matrix3;
@@ -1284,6 +1318,8 @@ void Variant::set(const Variant& p_index, const Variant& p_value, bool *r_valid)
int index = p_index;
+ if (index<0)
+ index += 4;
if (index>=0 && index<4) {
Transform *v=_data._transform;
valid=true;
@@ -1372,6 +1408,8 @@ void Variant::set(const Variant& p_index, const Variant& p_value, bool *r_valid)
} else if (p_index.get_type()==Variant::INT) {
int idx = p_index;
+ if (idx<0)
+ idx += 4;
if (idx>=0 || idx<4) {
Color *v=reinterpret_cast<Color*>(_data._mem);
(*v)[idx]=p_value;
@@ -1786,145 +1824,14 @@ void Variant::set(const Variant& p_index, const Variant& p_value, bool *r_valid)
valid=true; //always valid, i guess? should this really be ok?
return;
} break; // 20
- case ARRAY: {
-
-
- if (p_index.get_type()==Variant::INT || p_index.get_type()==Variant::REAL) {
-
- int index = p_index;
- Array *arr=reinterpret_cast<Array* >(_data._mem);
-
- if (index >=0 && index <arr->size()) {
- valid=true;
- (*arr)[index]=p_value;
- return;
- }
- }
-
- } break;
- case RAW_ARRAY: {
-
- if (p_value.type!=Variant::REAL && p_value.type!=Variant::INT)
- return;
-
- if (p_index.get_type()==Variant::INT || p_index.get_type()==Variant::REAL) {
-
- int index = p_index;
- DVector<uint8_t> *arr=reinterpret_cast<DVector<uint8_t>* >(_data._mem);
-
- if (index >=0 && index <arr->size()) {
- valid=true;
- arr->set(index,p_value);
- return;
- }
- }
-
- } break;
- case INT_ARRAY: {
- if (p_value.type!=Variant::REAL && p_value.type!=Variant::INT)
- return;
-
- if (p_index.get_type()==Variant::INT || p_index.get_type()==Variant::REAL) {
-
- int index = p_index;
- DVector<int> *arr=reinterpret_cast<DVector<int>* >(_data._mem);
-
- if (index >=0 && index <arr->size()) {
- valid=true;
- arr->set(index,p_value);
- return;
- }
- }
- } break;
- case REAL_ARRAY: {
-
- if (p_value.type!=Variant::REAL && p_value.type!=Variant::INT)
- return;
-
- if (p_index.get_type()==Variant::INT || p_index.get_type()==Variant::REAL) {
-
- int index = p_index;
- DVector<real_t> *arr=reinterpret_cast<DVector<real_t>* >(_data._mem);
-
- if (index >=0 && index <arr->size()) {
- valid=true;
- arr->set(index,p_value);
- return;
- }
- }
-
- } break;
- case STRING_ARRAY: {
-
- if (p_value.type!=Variant::STRING)
- return;
-
- if (p_index.get_type()==Variant::INT || p_index.get_type()==Variant::REAL) {
-
- int index = p_index;
- DVector<String> *arr=reinterpret_cast<DVector<String>* >(_data._mem);
-
- if (index >=0 && index <arr->size()) {
- valid=true;
- arr->set(index,p_value);
- return;
- }
- }
-
- } break; //25
- case VECTOR2_ARRAY: {
-
- if (p_value.type!=Variant::VECTOR2)
- return;
-
- if (p_index.get_type()==Variant::INT || p_index.get_type()==Variant::REAL) {
-
- int index = p_index;
- DVector<Vector2> *arr=reinterpret_cast<DVector<Vector2>* >(_data._mem);
-
- if (index >=0 && index <arr->size()) {
- valid=true;
- arr->set(index,p_value);
- return;
- }
- }
-
- } break;
- case VECTOR3_ARRAY: {
-
- if (p_value.type!=Variant::VECTOR3)
- return;
-
- if (p_index.get_type()==Variant::INT || p_index.get_type()==Variant::REAL) {
-
- int index = p_index;
- DVector<Vector3> *arr=reinterpret_cast<DVector<Vector3>* >(_data._mem);
-
- if (index >=0 && index <arr->size()) {
- valid=true;
- arr->set(index,p_value);
- return;
- }
- }
-
- } break;
- case COLOR_ARRAY: {
-
- if (p_value.type!=Variant::COLOR)
- return;
-
- if (p_index.get_type()==Variant::INT || p_index.get_type()==Variant::REAL) {
-
- int index = p_index;
- DVector<Color> *arr=reinterpret_cast<DVector<Color>* >(_data._mem);
-
- if (index >=0 && index <arr->size()) {
- valid=true;
- arr->set(index,p_value);
- return;
- }
- }
- } break;
+ DEFAULT_OP_ARRAY_CMD(ARRAY, Array, ;, (*arr)[index]=p_value;return)
+ DEFAULT_OP_DVECTOR_SET(RAW_ARRAY, uint8_t, p_value.type != Variant::REAL && p_value.type != Variant::INT)
+ DEFAULT_OP_DVECTOR_SET(INT_ARRAY, int, p_value.type != Variant::REAL && p_value.type != Variant::INT)
+ DEFAULT_OP_DVECTOR_SET(REAL_ARRAY, real_t, p_value.type != Variant::REAL && p_value.type != Variant::INT)
+ DEFAULT_OP_DVECTOR_SET(STRING_ARRAY, String, p_value.type != Variant::STRING) // 25
+ DEFAULT_OP_DVECTOR_SET(VECTOR2_ARRAY, Vector2, p_value.type != Variant::VECTOR2)
+ DEFAULT_OP_DVECTOR_SET(VECTOR3_ARRAY, Vector3, p_value.type != Variant::VECTOR3)
+ DEFAULT_OP_DVECTOR_SET(COLOR_ARRAY, Color, p_value.type != Variant::COLOR)
default: return;
}
@@ -1950,6 +1857,8 @@ Variant Variant::get(const Variant& p_index, bool *r_valid) const {
int idx=p_index;
const String *str=reinterpret_cast<const String*>(_data._mem);
+ if (idx<0)
+ idx += str->length();
if (idx >=0 && idx<str->length()) {
valid=true;
@@ -1963,6 +1872,8 @@ Variant Variant::get(const Variant& p_index, bool *r_valid) const {
if (p_index.get_type()==Variant::INT || p_index.get_type()==Variant::REAL) {
// scalar index
int idx=p_index;
+ if (idx<0)
+ idx += 2;
if (idx>=0 && idx<2) {
const Vector2 *v=reinterpret_cast<const Vector2*>(_data._mem);
@@ -2008,6 +1919,8 @@ Variant Variant::get(const Variant& p_index, bool *r_valid) const {
if (p_index.get_type()==Variant::INT || p_index.get_type()==Variant::REAL) {
//scalar index
int idx=p_index;
+ if (idx<0)
+ idx += 3;
if (idx>=0 && idx<3) {
const Vector3 *v=reinterpret_cast<const Vector3*>(_data._mem);
@@ -2038,6 +1951,8 @@ Variant Variant::get(const Variant& p_index, bool *r_valid) const {
int index = p_index;
+ if (index<0)
+ index += 3;
if (index>=0 && index<3) {
const Matrix32 *v=_data._matrix32;
@@ -2133,7 +2048,8 @@ Variant Variant::get(const Variant& p_index, bool *r_valid) const {
if (p_index.get_type()==Variant::INT || p_index.get_type()==Variant::REAL) {
int index = p_index;
-
+ if (index<0)
+ index += 3;
if (index>=0 && index<3) {
const Matrix3 *v=_data._matrix3;
@@ -2163,7 +2079,8 @@ Variant Variant::get(const Variant& p_index, bool *r_valid) const {
if (p_index.get_type()==Variant::INT || p_index.get_type()==Variant::REAL) {
int index = p_index;
-
+ if (index<0)
+ index += 4;
if (index>=0 && index<4) {
const Transform *v=_data._transform;
valid=true;
@@ -2227,6 +2144,8 @@ Variant Variant::get(const Variant& p_index, bool *r_valid) const {
} else if (p_index.get_type()==Variant::INT) {
int idx = p_index;
+ if (idx<0)
+ idx += 4;
if (idx>=0 || idx<4) {
const Color *v=reinterpret_cast<const Color*>(_data._mem);
valid=true;
@@ -2489,110 +2408,14 @@ Variant Variant::get(const Variant& p_index, bool *r_valid) const {
return *res;
}
} break; // 20
- case ARRAY: {
- if (p_index.get_type()==Variant::INT || p_index.get_type()==Variant::REAL) {
-
- int index = p_index;
- const Array *arr=reinterpret_cast<const Array* >(_data._mem);
-
- if (index >=0 && index <arr->size()) {
- valid=true;
- return (*arr)[index];
- }
- }
-
- } break;
- case RAW_ARRAY: {
- if (p_index.get_type()==Variant::INT || p_index.get_type()==Variant::REAL) {
-
- int index = p_index;
- const DVector<uint8_t> *arr=reinterpret_cast<const DVector<uint8_t>* >(_data._mem);
-
- if (index >=0 && index <arr->size()) {
- valid=true;
- return arr->get(index);
- }
- }
-
- } break;
- case INT_ARRAY: {
- if (p_index.get_type()==Variant::INT || p_index.get_type()==Variant::REAL) {
-
- int index = p_index;
- const DVector<int> *arr=reinterpret_cast<const DVector<int>* >(_data._mem);
-
- if (index >=0 && index <arr->size()) {
- valid=true;
- return arr->get(index);
- }
- }
- } break;
- case REAL_ARRAY: {
-
- if (p_index.get_type()==Variant::INT || p_index.get_type()==Variant::REAL) {
-
- int index = p_index;
- const DVector<real_t> *arr=reinterpret_cast<const DVector<real_t>* >(_data._mem);
-
- if (index >=0 && index <arr->size()) {
- valid=true;
- return arr->get(index);
- }
- }
-
- } break;
- case STRING_ARRAY: {
- if (p_index.get_type()==Variant::INT || p_index.get_type()==Variant::REAL) {
-
- int index = p_index;
- const DVector<String> *arr=reinterpret_cast<const DVector<String>* >(_data._mem);
-
- if (index >=0 && index <arr->size()) {
- valid=true;
- return arr->get(index);
- }
- }
-
- } break; //25
- case VECTOR2_ARRAY: {
- if (p_index.get_type()==Variant::INT || p_index.get_type()==Variant::REAL) {
-
- int index = p_index;
- const DVector<Vector2> *arr=reinterpret_cast<const DVector<Vector2>* >(_data._mem);
-
- if (index >=0 && index <arr->size()) {
- valid=true;
- return arr->get(index);
- }
- }
-
- } break;
- case VECTOR3_ARRAY: {
- if (p_index.get_type()==Variant::INT || p_index.get_type()==Variant::REAL) {
-
- int index = p_index;
- const DVector<Vector3> *arr=reinterpret_cast<const DVector<Vector3>* >(_data._mem);
-
- if (index >=0 && index <arr->size()) {
- valid=true;
- return arr->get(index);
- }
- }
-
- } break;
- case COLOR_ARRAY: {
-
- if (p_index.get_type()==Variant::INT || p_index.get_type()==Variant::REAL) {
-
- int index = p_index;
- const DVector<Color> *arr=reinterpret_cast<const DVector<Color>* >(_data._mem);
-
- if (index >=0 && index <arr->size()) {
- valid=true;
- return arr->get(index);
- }
- }
- } break;
+ DEFAULT_OP_ARRAY_CMD(ARRAY, const Array, 0, return (*arr)[index])
+ DEFAULT_OP_DVECTOR_GET(RAW_ARRAY, uint8_t)
+ DEFAULT_OP_DVECTOR_GET(INT_ARRAY, int)
+ DEFAULT_OP_DVECTOR_GET(REAL_ARRAY, real_t)
+ DEFAULT_OP_DVECTOR_GET(STRING_ARRAY, String)
+ DEFAULT_OP_DVECTOR_GET(VECTOR2_ARRAY, Vector2)
+ DEFAULT_OP_DVECTOR_GET(VECTOR3_ARRAY, Vector3)
+ DEFAULT_OP_DVECTOR_GET(COLOR_ARRAY, Color)
default: return Variant();
}
diff --git a/doc/base/classes.xml b/doc/base/classes.xml
index d329d5344f..9b8940bc50 100644
--- a/doc/base/classes.xml
+++ b/doc/base/classes.xml
@@ -1809,9 +1809,33 @@
</constant>
<constant name="PROPERTY_USAGE_NETWORK" value="4">
</constant>
+ <constant name="PROPERTY_USAGE_EDITOR_HELPER" value="8">
+ </constant>
+ <constant name="PROPERTY_USAGE_CHECKABLE" value="16">
+ </constant>
+ <constant name="PROPERTY_USAGE_CHECKED" value="32">
+ </constant>
+ <constant name="PROPERTY_USAGE_INTERNATIONALIZED" value="64">
+ </constant>
+ <constant name="PROPERTY_USAGE_BUNDLE" value="128">
+ </constant>
+ <constant name="PROPERTY_USAGE_CATEGORY" value="256">
+ </constant>
+ <constant name="PROPERTY_USAGE_STORE_IF_NONZERO" value="512">
+ </constant>
+ <constant name="PROPERTY_USAGE_STORE_IF_NONONE" value="1024">
+ </constant>
+ <constant name="PROPERTY_USAGE_NO_INSTANCE_STATE" value="2048">
+ </constant>
+ <constant name="PROPERTY_USAGE_RESTART_IF_CHANGED" value="4096">
+ </constant>
<constant name="PROPERTY_USAGE_DEFAULT" value="7">
Default usage (storage and editor).
</constant>
+ <constant name="PROPERTY_USAGE_DEFAULT_INTL" value="71">
+ </constant>
+ <constant name="PROPERTY_USAGE_NOEDITOR" value="5">
+ </constant>
<constant name="METHOD_FLAG_NORMAL" value="1">
</constant>
<constant name="METHOD_FLAG_EDITOR" value="2">
@@ -4325,7 +4349,7 @@
Generic array datatype.
</brief_description>
<description>
- Generic array, contains several elements of any type, accessible by numerical index starting at 0. Arrays are always passed by reference.
+ Generic array, contains several elements of any type, accessible by numerical index starting at 0. Negative indices can be used to count from the right, like in Python. Arrays are always passed by reference.
</description>
<methods>
<method name="append">
@@ -9404,6 +9428,96 @@
<description>
</description>
</method>
+ <method name="has_icon_override" qualifiers="const">
+ <return type="bool">
+ </return>
+ <argument index="0" name="name" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="has_stylebox_override" qualifiers="const">
+ <return type="bool">
+ </return>
+ <argument index="0" name="name" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="has_font_override" qualifiers="const">
+ <return type="bool">
+ </return>
+ <argument index="0" name="name" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="has_color_override" qualifiers="const">
+ <return type="bool">
+ </return>
+ <argument index="0" name="name" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="has_constant_override" qualifiers="const">
+ <return type="bool">
+ </return>
+ <argument index="0" name="name" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="has_icon" qualifiers="const">
+ <return type="bool">
+ </return>
+ <argument index="0" name="name" type="String">
+ </argument>
+ <argument index="1" name="type" type="String" default="&quot;&quot;">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="has_stylebox" qualifiers="const">
+ <return type="bool">
+ </return>
+ <argument index="0" name="name" type="String">
+ </argument>
+ <argument index="1" name="type" type="String" default="&quot;&quot;">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="has_font" qualifiers="const">
+ <return type="bool">
+ </return>
+ <argument index="0" name="name" type="String">
+ </argument>
+ <argument index="1" name="type" type="String" default="&quot;&quot;">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="has_color" qualifiers="const">
+ <return type="bool">
+ </return>
+ <argument index="0" name="name" type="String">
+ </argument>
+ <argument index="1" name="type" type="String" default="&quot;&quot;">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="has_constant" qualifiers="const">
+ <return type="bool">
+ </return>
+ <argument index="0" name="name" type="String">
+ </argument>
+ <argument index="1" name="type" type="String" default="&quot;&quot;">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="get_parent_control" qualifiers="const">
<return type="Control">
</return>
@@ -9523,6 +9637,10 @@
<description>
</description>
</method>
+ <method name="minimum_size_changed">
+ <description>
+ </description>
+ </method>
</methods>
<signals>
<signal name="focus_enter">
@@ -15119,6 +15237,7 @@ Example: (content-length:12), (Content-Type:application/json; charset=UTF-8)
<argument index="2" name="dest" type="Vector2" default="0">
</argument>
<description>
+ Copy a "src_rect" [Rect2] from "src" [Image] to this [Image] on coordinates "dest".
</description>
</method>
<method name="brush_transfer">
@@ -15129,6 +15248,7 @@ Example: (content-length:12), (Content-Type:application/json; charset=UTF-8)
<argument index="2" name="pos" type="Vector2" default="0">
</argument>
<description>
+ Transfer data from "src" to this [Image] using a "brush" as a mask/brush on coordinates "pos".
</description>
</method>
<method name="brushed">
@@ -15141,6 +15261,7 @@ Example: (content-length:12), (Content-Type:application/json; charset=UTF-8)
<argument index="2" name="pos" type="Vector2" default="0">
</argument>
<description>
+ Return a new [Image] from this [Image] that is created by brushhing see [method brush_transfer].
</description>
</method>
<method name="compressed">
@@ -15149,6 +15270,7 @@ Example: (content-length:12), (Content-Type:application/json; charset=UTF-8)
<argument index="0" name="format" type="int" default="0">
</argument>
<description>
+ Return a new compressed [Image] from this [Image] using one of [Image].COMPRESS_*.
</description>
</method>
<method name="converted">
@@ -15157,18 +15279,21 @@ Example: (content-length:12), (Content-Type:application/json; charset=UTF-8)
<argument index="0" name="format" type="int" default="0">
</argument>
<description>
+ Return a new [Image] from this [Image] with a different format.
</description>
</method>
<method name="decompressed">
<return type="Image">
</return>
<description>
+ Return a new decompressed [Image].
</description>
</method>
<method name="empty">
<return type="bool">
</return>
<description>
+ Return whether this [Image] is empty(no data).
</description>
</method>
<method name="fix_alpha_edges">
@@ -15179,18 +15304,21 @@ Example: (content-length:12), (Content-Type:application/json; charset=UTF-8)
<return type="RawArray">
</return>
<description>
+ Return the raw data of the [Image].
</description>
</method>
<method name="get_format">
<return type="int">
</return>
<description>
+ Return the format of the [Image], one of [Image].FORMAT_*.
</description>
</method>
<method name="get_height">
<return type="int">
</return>
<description>
+ Return the height of the [Image].
</description>
</method>
<method name="get_pixel">
@@ -15203,6 +15331,7 @@ Example: (content-length:12), (Content-Type:application/json; charset=UTF-8)
<argument index="2" name="mipmap_level" type="int" default="0">
</argument>
<description>
+ Return the color of the pixel in the [Image] on coordinates "x,y" on mipmap level "mipmap_level".
</description>
</method>
<method name="get_rect">
@@ -15211,18 +15340,21 @@ Example: (content-length:12), (Content-Type:application/json; charset=UTF-8)
<argument index="0" name="area" type="Rect2" default="0">
</argument>
<description>
+ Return a new [Image] that is a copy of "area" in this [Image].
</description>
</method>
<method name="get_used_rect">
<return type="Rect2">
</return>
<description>
+ Return the area of this [Image] that is used/visibly colored/opaque.
</description>
</method>
<method name="get_width">
<return type="int">
</return>
<description>
+ Return the width of the [Image].
</description>
</method>
<method name="load">
@@ -15231,6 +15363,7 @@ Example: (content-length:12), (Content-Type:application/json; charset=UTF-8)
<argument index="0" name="path" type="String" default="0">
</argument>
<description>
+ Load an [Image].
</description>
</method>
<method name="put_pixel">
@@ -15243,6 +15376,7 @@ Example: (content-length:12), (Content-Type:application/json; charset=UTF-8)
<argument index="3" name="mipmap_level" type="int" default="0">
</argument>
<description>
+ Put a pixel of "color" on coordinates "x,y" on mipmap level "mipmap_level".
</description>
</method>
<method name="resized">
@@ -15255,6 +15389,7 @@ Example: (content-length:12), (Content-Type:application/json; charset=UTF-8)
<argument index="2" name="interpolation" type="int" default="1">
</argument>
<description>
+ Return a new [Image] from this [Image] that is resized to size "x,y" using [Image].INTERPOLATE_*.
</description>
</method>
<method name="save_png">
@@ -15263,6 +15398,7 @@ Example: (content-length:12), (Content-Type:application/json; charset=UTF-8)
<argument index="0" name="path" type="String" default="0">
</argument>
<description>
+ Save this [Image] as a png.
</description>
</method>
<method name="Image">
@@ -15336,12 +15472,20 @@ Example: (content-length:12), (Content-Type:application/json; charset=UTF-8)
</constant>
<constant name="FORMAT_CUSTOM" value="22">
</constant>
+ <constant name="INTERPOLATE_NEAREST" value="0">
+ </constant>
+ <constant name="INTERPOLATE_BILINEAR" value="1">
+ </constant>
+ <constant name="INTERPOLATE_CUBIC" value="2">
+ </constant>
</constants>
</class>
<class name="ImageTexture" inherits="Texture" category="Core">
<brief_description>
+ A [Texture] based on an [Image].
</brief_description>
<description>
+ A [Texture] based on an [Image]. Can be created from an [Image].
</description>
<methods>
<method name="create">
@@ -15354,6 +15498,9 @@ Example: (content-length:12), (Content-Type:application/json; charset=UTF-8)
<argument index="3" name="flags" type="int" default="7">
</argument>
<description>
+ Create a new [ImageTexture] with "width" and "height".
+ "format" one of [Image].FORMAT_*.
+ "flags" one or more of [Texture].FLAG_*.
</description>
</method>
<method name="create_from_image">
@@ -15362,54 +15509,63 @@ Example: (content-length:12), (Content-Type:application/json; charset=UTF-8)
<argument index="1" name="flags" type="int" default="7">
</argument>
<description>
+ Create a new [ImageTexture] from an [Image] with "flags" from [Texture].FLAG_*.
</description>
</method>
<method name="get_format" qualifiers="const">
<return type="int">
</return>
<description>
+ Return the format of the [ImageTexture], one of [Image].FORMAT_*.
</description>
</method>
<method name="load">
<argument index="0" name="path" type="String">
</argument>
<description>
+ Load an [ImageTexure].
</description>
</method>
<method name="set_data">
<argument index="0" name="image" type="Image">
</argument>
<description>
+ Set the [Image] of this [ImageTexture].
</description>
</method>
<method name="get_data" qualifiers="const">
<return type="Image">
</return>
<description>
+ Return the [Image] of this [ImageTexture].
</description>
</method>
<method name="set_storage">
<argument index="0" name="mode" type="int">
</argument>
<description>
+ Set the storage type. One of [ImageTexture].STORAGE_*.
</description>
</method>
<method name="get_storage" qualifiers="const">
<return type="int">
</return>
<description>
+ Return the storage type. One of [ImageTexture].STORAGE_*.
</description>
</method>
<method name="set_lossy_storage_quality">
<argument index="0" name="quality" type="float">
</argument>
<description>
+ Set the storage quality in case of [ImageTexture].STORAGE_COMPRESS_LOSSY.
</description>
</method>
<method name="get_lossy_storage_quality" qualifiers="const">
<return type="float">
</return>
<description>
+ Return the storage quality for [ImageTexture].STORAGE_COMPRESS_LOSSY.
</description>
</method>
<method name="fix_alpha_edges">
@@ -15437,10 +15593,13 @@ Example: (content-length:12), (Content-Type:application/json; charset=UTF-8)
</methods>
<constants>
<constant name="STORAGE_RAW" value="0">
+ [Image] data is stored raw and unaltered.
</constant>
<constant name="STORAGE_COMPRESS_LOSSY" value="1">
+ [Image] data is compressed with a lossy algorithm. You can set the storage quality with [method set_lossy_storage_quality].
</constant>
<constant name="STORAGE_COMPRESS_LOSSLESS" value="2">
+ [Image] data is compressed with a lossless algorithm.
</constant>
</constants>
</class>
@@ -17861,8 +18020,11 @@ Example: (content-length:12), (Content-Type:application/json; charset=UTF-8)
</class>
<class name="LargeTexture" inherits="Texture" category="Core">
<brief_description>
+ A Texture capable of storing many smaller Textures with offsets.
</brief_description>
<description>
+ A Texture capable of storing many smaller Textures with offsets.
+ You can dynamically add pieces(Textures) to this fLargeTexture] using different offsets.
</description>
<methods>
<method name="add_piece">
@@ -17873,6 +18035,7 @@ Example: (content-length:12), (Content-Type:application/json; charset=UTF-8)
<argument index="1" name="texture" type="Texture">
</argument>
<description>
+ Add another [Texture] to this [LargeTexture], starting on offset "ofs".
</description>
</method>
<method name="set_piece_offset">
@@ -17881,6 +18044,7 @@ Example: (content-length:12), (Content-Type:application/json; charset=UTF-8)
<argument index="1" name="ofs" type="Vector2">
</argument>
<description>
+ Set the offset of the piece with index "idx" to "ofs".
</description>
</method>
<method name="set_piece_texture">
@@ -17889,22 +18053,26 @@ Example: (content-length:12), (Content-Type:application/json; charset=UTF-8)
<argument index="1" name="texture" type="Texture">
</argument>
<description>
+ Set the [Texture] of the piece with index "idx" to "ofs".
</description>
</method>
<method name="set_size">
<argument index="0" name="size" type="Vector2">
</argument>
<description>
+ Set the size of this [LargeTexture].
</description>
</method>
<method name="clear">
<description>
+ Clear the [LargeTexture].
</description>
</method>
<method name="get_piece_count" qualifiers="const">
<return type="int">
</return>
<description>
+ Return the number of pieces currently in this [LargeTexture].
</description>
</method>
<method name="get_piece_offset" qualifiers="const">
@@ -17913,6 +18081,7 @@ Example: (content-length:12), (Content-Type:application/json; charset=UTF-8)
<argument index="0" name="idx" type="int">
</argument>
<description>
+ Return the offset of the piece with index "idx".
</description>
</method>
<method name="get_piece_texture" qualifiers="const">
@@ -17921,6 +18090,7 @@ Example: (content-length:12), (Content-Type:application/json; charset=UTF-8)
<argument index="0" name="idx" type="int">
</argument>
<description>
+ Return the [Texture] of the piece with index "idx".
</description>
</method>
</methods>
@@ -18672,6 +18842,36 @@ Example: (content-length:12), (Content-Type:application/json; charset=UTF-8)
</theme_item>
</theme_items>
</class>
+<class name="Listener" inherits="Spatial" category="Core">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <methods>
+ <method name="make_current">
+ <description>
+ </description>
+ </method>
+ <method name="clear_current">
+ <description>
+ </description>
+ </method>
+ <method name="is_current" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_listener_transform" qualifiers="const">
+ <return type="Transform">
+ </return>
+ <description>
+ </description>
+ </method>
+ </methods>
+ <constants>
+ </constants>
+</class>
<class name="MainLoop" inherits="Object" category="Core">
<brief_description>
Main loop is the abstract main loop base class.
@@ -22296,6 +22496,18 @@ Example: (content-length:12), (Content-Type:application/json; charset=UTF-8)
<description>
</description>
</method>
+ <method name="set_use_vsync">
+ <argument index="0" name="enable" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="is_vsnc_enabled" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
</methods>
<constants>
<constant name="DAY_SUNDAY" value="0">
@@ -24239,6 +24451,18 @@ Example: (content-length:12), (Content-Type:application/json; charset=UTF-8)
<description>
</description>
</method>
+ <method name="set_region_rect">
+ <argument index="0" name="rect" type="Rect2">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="get_region_rect" qualifiers="const">
+ <return type="Rect2">
+ </return>
+ <description>
+ </description>
+ </method>
<method name="set_draw_center">
<argument index="0" name="draw_center" type="bool">
</argument>
@@ -36652,6 +36876,14 @@ This method controls whether the position between two cached points is interpola
<description>
</description>
</method>
+ <method name="erase">
+ <argument index="0" name="pos" type="int">
+ </argument>
+ <argument index="1" name="chars" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="extension">
<return type="String">
</return>
@@ -37373,6 +37605,18 @@ This method controls whether the position between two cached points is interpola
<description>
</description>
</method>
+ <method name="set_region_rect">
+ <argument index="0" name="region" type="Rect2">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="get_region_rect" qualifiers="const">
+ <return type="Rect2">
+ </return>
+ <description>
+ </description>
+ </method>
<method name="set_draw_center">
<argument index="0" name="enable" type="bool">
</argument>
@@ -41705,6 +41949,12 @@ This method controls whether the position between two cached points is interpola
2-element structure that can be used to represent positions in 2d-space, or any other pair of numeric values.
</description>
<methods>
+ <method name="abs">
+ <return type="Vector2">
+ </return>
+ <description>
+ </description>
+ </method>
<method name="angle">
<return type="float">
</return>
@@ -44551,11 +44801,13 @@ This method controls whether the position between two cached points is interpola
</argument>
<argument index="1" name="arg1" type="Rect2">
</argument>
- <argument index="2" name="arg2" type="RID">
+ <argument index="2" name="arg2" type="Rect2">
</argument>
- <argument index="3" name="arg3" type="RealArray">
+ <argument index="3" name="arg3" type="RID">
</argument>
- <argument index="4" name="arg4" type="Color" default="Color(1,1,1,1)">
+ <argument index="4" name="arg4" type="RealArray">
+ </argument>
+ <argument index="5" name="arg5" type="Color" default="Color(1,1,1,1)">
</argument>
<description>
</description>
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp
index 5e3dc438d0..9034541f37 100644
--- a/platform/windows/os_windows.cpp
+++ b/platform/windows/os_windows.cpp
@@ -708,7 +708,7 @@ LRESULT OS_Windows::WndProc(HWND hWnd,UINT uMsg, WPARAM wParam, LPARAM lParam) {
case WM_SETCURSOR: {
if(LOWORD(lParam) == HTCLIENT) {
- if(mouse_mode == MOUSE_MODE_HIDDEN) {
+ if(mouse_mode == MOUSE_MODE_HIDDEN || mouse_mode == MOUSE_MODE_CAPTURED) {
//Hide the cursor
if(hCursor == NULL)
hCursor = SetCursor(NULL);
diff --git a/tools/collada/collada.cpp b/tools/collada/collada.cpp
index 8f40ec1469..f0fde20dfc 100644
--- a/tools/collada/collada.cpp
+++ b/tools/collada/collada.cpp
@@ -482,6 +482,24 @@ Transform Collada::_read_transform(XMLParser& parser) {
return _read_transform_from_array(array);
}
+String Collada::_read_empty_draw_type(XMLParser& parser) {
+
+ String empty_draw_type = "";
+
+ if (parser.is_empty())
+ return empty_draw_type;
+
+ while (parser.read()==OK) {
+ if (parser.get_node_type() == XMLParser::NODE_TEXT) {
+ empty_draw_type = parser.get_node_data();
+ }
+ else
+ if (parser.get_node_type() == XMLParser::NODE_ELEMENT_END)
+ break; // end parsing text
+ }
+ return empty_draw_type;
+}
+
Variant Collada::_parse_param(XMLParser& parser) {
if (parser.is_empty())
@@ -1664,6 +1682,8 @@ Collada::Node* Collada::_parse_visual_scene_node(XMLParser& parser) {
Vector<Node::XForm> xform_list;
Vector<Node*> children;
+
+ String empty_draw_type="";
Node *node=NULL;
@@ -1771,7 +1791,9 @@ Collada::Node* Collada::_parse_visual_scene_node(XMLParser& parser) {
xform_list.push_back(xf);
- } else if (section=="technique" || section=="extra") {
+ } else if (section=="empty_draw_type") {
+ empty_draw_type = _read_empty_draw_type(parser);
+ } else if (section == "technique" || section=="extra") {
} else if (section!="node") {
//usually what defines the type of node
@@ -1817,6 +1839,7 @@ Collada::Node* Collada::_parse_visual_scene_node(XMLParser& parser) {
node->name=name;
node->id=id;
+ node->empty_draw_type=empty_draw_type;
if (node->children.size()==1) {
if (node->children[0]->noname && !node->noname) {
diff --git a/tools/collada/collada.h b/tools/collada/collada.h
index 8983b8faf0..01934a1e76 100644
--- a/tools/collada/collada.h
+++ b/tools/collada/collada.h
@@ -403,6 +403,7 @@ public:
String name;
String id;
+ String empty_draw_type;
bool noname;
Vector<XForm> xform_list;
Transform default_transform;
@@ -635,6 +636,7 @@ private: // private stuff
Vector<float> _read_float_array(XMLParser& parser);
Vector<String> _read_string_array(XMLParser& parser);
Transform _read_transform(XMLParser& parser);
+ String _read_empty_draw_type(XMLParser& parser);
void _joint_set_owner(Collada::Node *p_node, NodeSkeleton *p_owner);
void _create_skeletons(Collada::Node **p_node, NodeSkeleton *p_skeleton=NULL);
diff --git a/tools/editor/icons/2x/icon_gizmo_listener.png b/tools/editor/icons/2x/icon_gizmo_listener.png
new file mode 100644
index 0000000000..48b5742b87
--- /dev/null
+++ b/tools/editor/icons/2x/icon_gizmo_listener.png
Binary files differ
diff --git a/tools/editor/icons/2x/icon_listener.png b/tools/editor/icons/2x/icon_listener.png
new file mode 100644
index 0000000000..c6f8799744
--- /dev/null
+++ b/tools/editor/icons/2x/icon_listener.png
Binary files differ
diff --git a/tools/editor/icons/icon_gizmo_listener.png b/tools/editor/icons/icon_gizmo_listener.png
index b6267e779a..b2ac0f2396 100644
--- a/tools/editor/icons/icon_gizmo_listener.png
+++ b/tools/editor/icons/icon_gizmo_listener.png
Binary files differ
diff --git a/tools/editor/icons/icon_listener.png b/tools/editor/icons/icon_listener.png
index 1fa4cb4a9f..e6f1af45c3 100644
--- a/tools/editor/icons/icon_listener.png
+++ b/tools/editor/icons/icon_listener.png
Binary files differ
diff --git a/tools/editor/icons/source/icon_gizmo_listener.svg b/tools/editor/icons/source/icon_gizmo_listener.svg
new file mode 100644
index 0000000000..a53b08af44
--- /dev/null
+++ b/tools/editor/icons/source/icon_gizmo_listener.svg
@@ -0,0 +1,100 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="32"
+ height="32"
+ viewBox="0 0 32 32"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.91 r13725"
+ inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/2x/icon_gizmo_listener.png"
+ inkscape:export-xdpi="180"
+ inkscape:export-ydpi="180"
+ sodipodi:docname="icon_gizmo_listener.svg">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="15.999999"
+ inkscape:cx="4.4071843"
+ inkscape:cy="17.118049"
+ inkscape:document-units="px"
+ inkscape:current-layer="g4175"
+ showgrid="true"
+ units="px"
+ inkscape:snap-bbox="true"
+ inkscape:bbox-paths="true"
+ inkscape:bbox-nodes="true"
+ inkscape:snap-bbox-edge-midpoints="true"
+ inkscape:snap-bbox-midpoints="false"
+ inkscape:snap-object-midpoints="true"
+ inkscape:snap-center="true"
+ inkscape:window-width="1920"
+ inkscape:window-height="1016"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1">
+ <inkscape:grid
+ type="xygrid"
+ id="grid3336"
+ empspacing="4" />
+ </sodipodi:namedview>
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0,-1020.3622)">
+ <g
+ id="g4175"
+ transform="matrix(2,0,0,2,-16,-1040.3622)">
+ <path
+ inkscape:connector-curvature="0"
+ id="path4274"
+ d="m 21.928203,1032.3622 -1.738281,1.0039 a 6,6 0 0 1 0.810547,2.9961 6,6 0 0 1 -0.808594,2.998 l 1.736328,1.002 a 8,8 0 0 0 0,-8 z"
+ style="opacity:1;fill:#f7f5cf;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ <rect
+ y="1043.3622"
+ x="11"
+ height="2"
+ width="1"
+ id="rect4147"
+ style="opacity:1;fill:#f7f5cf;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ <path
+ id="path4149"
+ d="m 14,1031.3622 a 5,5 0 0 0 -5,5 l 2,0 a 3,3 0 0 1 3,-3 3,3 0 0 1 3,3 l 2,0 a 5,5 0 0 0 -5,-5 z"
+ style="opacity:1;fill:#f7f5cf;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ inkscape:connector-curvature="0" />
+ <path
+ sodipodi:nodetypes="csc"
+ inkscape:connector-curvature="0"
+ id="path4155"
+ d="m 18,1036.3622 c 0,4 -3,4 -3,5 0,3 -2,3 -3,3"
+ style="fill:none;fill-rule:evenodd;stroke:#f7f5cf;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ </g>
+ </g>
+</svg>
diff --git a/tools/editor/icons/source/icon_headphones.svg b/tools/editor/icons/source/icon_headphones.svg
new file mode 100644
index 0000000000..456a9b8d4e
--- /dev/null
+++ b/tools/editor/icons/source/icon_headphones.svg
@@ -0,0 +1,119 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="16"
+ height="16"
+ viewBox="0 0 16 16"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.91 r13725"
+ inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_listener.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90"
+ sodipodi:docname="icon_headphones.svg">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="15.999999"
+ inkscape:cx="17.327656"
+ inkscape:cy="15.295288"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="true"
+ units="px"
+ inkscape:snap-bbox="true"
+ inkscape:bbox-paths="true"
+ inkscape:bbox-nodes="true"
+ inkscape:snap-bbox-edge-midpoints="true"
+ inkscape:snap-bbox-midpoints="true"
+ inkscape:snap-object-midpoints="true"
+ inkscape:snap-center="true"
+ inkscape:window-width="1920"
+ inkscape:window-height="1016"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ showguides="true"
+ inkscape:snap-intersection-paths="false"
+ inkscape:object-nodes="true"
+ inkscape:snap-smooth-nodes="true">
+ <inkscape:grid
+ type="xygrid"
+ id="grid3336"
+ empspacing="4" />
+ </sodipodi:namedview>
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0,-1036.3622)">
+ <path
+ style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ d="m 1,1046.3622 0,3 2,0 0,2 2,0 0,-5 -4,0 z"
+ id="rect4168"
+ inkscape:connector-curvature="0" />
+ <path
+ style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ d="m 11,1046.3622 0,5 2,0 0,-2 2,0 0,-3 -4,0 z"
+ id="rect4170"
+ inkscape:connector-curvature="0" />
+ <path
+ style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ d="m 8,1037.3622 a 7,7 0 0 0 -7,7 l 2,0 a 5,5 0 0 1 5,-5 5,5 0 0 1 5,5 l 2,0 a 7,7 0 0 0 -7,-7 z"
+ id="path4185"
+ inkscape:connector-curvature="0" />
+ <rect
+ style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="rect4189"
+ width="2"
+ height="2"
+ x="1"
+ y="1044.3622" />
+ <rect
+ y="1044.3622"
+ x="13"
+ height="2"
+ width="2"
+ id="rect4191"
+ style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ <circle
+ style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="path4194"
+ cx="3"
+ cy="1049.3622"
+ r="2" />
+ <circle
+ r="2"
+ cy="1049.3622"
+ cx="-13"
+ id="circle4198"
+ style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ transform="scale(-1,1)" />
+ </g>
+</svg>
diff --git a/tools/editor/icons/source/icon_listener.svg b/tools/editor/icons/source/icon_listener.svg
new file mode 100644
index 0000000000..f815cb842a
--- /dev/null
+++ b/tools/editor/icons/source/icon_listener.svg
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="16"
+ height="16"
+ viewBox="0 0 16 16"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.91 r13725"
+ inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_listener.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90"
+ sodipodi:docname="icon_listener.svg">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="45.254831"
+ inkscape:cx="10.056734"
+ inkscape:cy="9.0499711"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="true"
+ units="px"
+ inkscape:snap-bbox="true"
+ inkscape:bbox-paths="true"
+ inkscape:bbox-nodes="true"
+ inkscape:snap-bbox-edge-midpoints="true"
+ inkscape:snap-bbox-midpoints="true"
+ inkscape:snap-object-midpoints="true"
+ inkscape:snap-center="true"
+ inkscape:window-width="1920"
+ inkscape:window-height="1016"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ showguides="true"
+ inkscape:snap-intersection-paths="false"
+ inkscape:object-nodes="true"
+ inkscape:snap-smooth-nodes="true"
+ inkscape:snap-midpoints="true">
+ <inkscape:grid
+ type="xygrid"
+ id="grid3336"
+ empspacing="4" />
+ </sodipodi:namedview>
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0,-1036.3622)">
+ <path
+ style="opacity:1;fill:#fc9c9c;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ d="m 13.928203,1038.3622 -1.738281,1.0039 a 6,6 0 0 1 0.810547,2.9961 6,6 0 0 1 -0.808594,2.998 l 1.736328,1.002 a 8,8 0 0 0 0,-8 z"
+ id="path4274"
+ inkscape:connector-curvature="0" />
+ <rect
+ style="opacity:1;fill:#fc9c9c;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="rect4147"
+ width="1"
+ height="2"
+ x="3"
+ y="1049.3622" />
+ <path
+ style="opacity:1;fill:#fc9c9c;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ d="M 6 1 A 5 5 0 0 0 1 6 L 3 6 A 3 3 0 0 1 6 3 A 3 3 0 0 1 9 6 L 11 6 A 5 5 0 0 0 6 1 z "
+ transform="translate(0,1036.3622)"
+ id="path4149" />
+ <path
+ style="fill:none;fill-rule:evenodd;stroke:#fc9c9c;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 10,1042.3622 c 0,4 -3,4 -3,5 0,3 -2,3 -3,3"
+ id="path4155"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="csc" />
+ </g>
+</svg>
diff --git a/tools/editor/io_plugins/editor_import_collada.cpp b/tools/editor/io_plugins/editor_import_collada.cpp
index f008c4a736..f0aec113d1 100644
--- a/tools/editor/io_plugins/editor_import_collada.cpp
+++ b/tools/editor/io_plugins/editor_import_collada.cpp
@@ -355,6 +355,10 @@ Error ColladaImport::_create_scene(Collada::Node *p_node, Spatial *p_parent) {
p_parent->add_child(node);
node->set_owner(scene);
+ if (p_node->empty_draw_type!="") {
+ node->set_meta("empty_draw_type", Variant(p_node->empty_draw_type));
+ }
+
for(int i=0;i<p_node->children.size();i++) {
Error err = _create_scene(p_node->children[i],node);
diff --git a/tools/editor/io_plugins/editor_scene_import_plugin.cpp b/tools/editor/io_plugins/editor_scene_import_plugin.cpp
index 594d3f5bcd..f346306f61 100644
--- a/tools/editor/io_plugins/editor_scene_import_plugin.cpp
+++ b/tools/editor/io_plugins/editor_scene_import_plugin.cpp
@@ -41,6 +41,10 @@
#include "scene/3d/physics_body.h"
#include "scene/3d/portal.h"
#include "scene/3d/vehicle_body.h"
+#include "scene/resources/sphere_shape.h"
+#include <scene/resources/box_shape.h>
+#include <scene/resources/ray_shape.h>
+#include <scene/resources/plane_shape.h>
#include "tools/editor/create_dialog.h"
#include "os/os.h"
@@ -1685,28 +1689,61 @@ Node* EditorSceneImportPlugin::_fix_node(Node *p_node,Node *p_root,Map<Ref<Mesh>
mi->set_baked_light_texture_id(layer);
}
- if (p_flags&SCENE_FLAG_CREATE_COLLISIONS && _teststr(name,"colonly") && p_node->cast_to<MeshInstance>()) {
+ if (p_flags&SCENE_FLAG_CREATE_COLLISIONS && _teststr(name,"colonly")) {
if (isroot)
return p_node;
-
- MeshInstance *mi = p_node->cast_to<MeshInstance>();
- Node * col = mi->create_trimesh_collision_node();
- ERR_FAIL_COND_V(!col,NULL);
-
- col->set_name(_fixstr(name,"colonly"));
- col->cast_to<Spatial>()->set_transform(mi->get_transform());
- p_node->replace_by(col);
- memdelete(p_node);
- p_node=col;
-
- StaticBody *sb = col->cast_to<StaticBody>();
- CollisionShape *colshape = memnew( CollisionShape);
- colshape->set_shape(sb->get_shape(0));
- colshape->set_name("shape");
- sb->add_child(colshape);
- colshape->set_owner(p_node->get_owner());
-
+
+ if (p_node->cast_to<MeshInstance>()) {
+ MeshInstance *mi = p_node->cast_to<MeshInstance>();
+ Node * col = mi->create_trimesh_collision_node();
+ ERR_FAIL_COND_V(!col,NULL);
+
+ col->set_name(_fixstr(name,"colonly"));
+ col->cast_to<Spatial>()->set_transform(mi->get_transform());
+ p_node->replace_by(col);
+ memdelete(p_node);
+ p_node=col;
+
+ StaticBody *sb = col->cast_to<StaticBody>();
+ CollisionShape *colshape = memnew( CollisionShape);
+ colshape->set_shape(sb->get_shape(0));
+ colshape->set_name("shape");
+ sb->add_child(colshape);
+ colshape->set_owner(p_node->get_owner());
+ } else if (p_node->has_meta("empty_draw_type")) {
+ String empty_draw_type = String(p_node->get_meta("empty_draw_type"));
+ print_line(empty_draw_type);
+ StaticBody *sb = memnew( StaticBody);
+ sb->set_name(_fixstr(name,"colonly"));
+ sb->cast_to<Spatial>()->set_transform(p_node->cast_to<Spatial>()->get_transform());
+ p_node->replace_by(sb);
+ memdelete(p_node);
+ CollisionShape *colshape = memnew( CollisionShape);
+ if (empty_draw_type == "CUBE") {
+ BoxShape *boxShape = memnew( BoxShape);
+ boxShape->set_extents(Vector3(1, 1, 1));
+ colshape->set_shape(boxShape);
+ colshape->set_name("BoxShape");
+ } else if (empty_draw_type == "SINGLE_ARROW") {
+ RayShape *rayShape = memnew( RayShape);
+ rayShape->set_length(1);
+ colshape->set_shape(rayShape);
+ colshape->set_name("RayShape");
+ sb->cast_to<Spatial>()->rotate_x(Math_PI / 2);
+ } else if (empty_draw_type == "IMAGE") {
+ PlaneShape *planeShape = memnew( PlaneShape);
+ colshape->set_shape(planeShape);
+ colshape->set_name("PlaneShape");
+ } else {
+ SphereShape *sphereShape = memnew( SphereShape);
+ sphereShape->set_radius(1);
+ colshape->set_shape(sphereShape);
+ colshape->set_name("SphereShape");
+ }
+ sb->add_child(colshape);
+ colshape->set_owner(sb->get_owner());
+ }
} else if (p_flags&SCENE_FLAG_CREATE_COLLISIONS &&_teststr(name,"col") && p_node->cast_to<MeshInstance>()) {
diff --git a/tools/export/blender25/io_scene_dae/export_dae.py b/tools/export/blender25/io_scene_dae/export_dae.py
index cdd845e384..3bb440ffe5 100644
--- a/tools/export/blender25/io_scene_dae/export_dae.py
+++ b/tools/export/blender25/io_scene_dae/export_dae.py
@@ -1104,6 +1104,14 @@ class DaeExporter:
self.writel(S_NODES,il,'<instance_light url="#'+lightid+'"/>')
+ def export_empty_node(self,node,il):
+
+ self.writel(S_NODES,4,'<extra>')
+ self.writel(S_NODES,5,'<technique profile="GODOT">')
+ self.writel(S_NODES,6,'<empty_draw_type>'+node.empty_draw_type+'</empty_draw_type>')
+ self.writel(S_NODES,5,'</technique>')
+ self.writel(S_NODES,4,'</extra>')
+
def export_curve(self,curve):
@@ -1264,6 +1272,8 @@ class DaeExporter:
self.export_camera_node(node,il)
elif (node.type=="LAMP"):
self.export_lamp_node(node,il)
+ elif (node.type=="EMPTY"):
+ self.export_empty_node(node,il)
for x in node.children:
self.export_node(x,il)