Merge pull request #20034 from Faless/master_fixes

Fix server and GDNative in master branch
This commit is contained in:
Thomas Herzog 2018-07-16 15:50:30 +02:00 committed by GitHub
commit 9eb082004d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 11 deletions

View file

@ -288,8 +288,8 @@ void AnimationNodeOneShot::_bind_methods() {
ADD_GROUP("", ""); ADD_GROUP("", "");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "sync"), "set_use_sync", "is_using_sync"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "sync"), "set_use_sync", "is_using_sync");
BIND_CONSTANT(MIX_MODE_BLEND) BIND_ENUM_CONSTANT(MIX_MODE_BLEND)
BIND_CONSTANT(MIX_MODE_ADD) BIND_ENUM_CONSTANT(MIX_MODE_ADD)
} }
AnimationNodeOneShot::AnimationNodeOneShot() { AnimationNodeOneShot::AnimationNodeOneShot() {

View file

@ -71,9 +71,9 @@ void AnimationNodeStateMachineTransition::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::INT, "priority", PROPERTY_HINT_RANGE, "0,32,1"), "set_priority", "get_priority"); ADD_PROPERTY(PropertyInfo(Variant::INT, "priority", PROPERTY_HINT_RANGE, "0,32,1"), "set_priority", "get_priority");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "disabled"), "set_disabled", "is_disabled"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "disabled"), "set_disabled", "is_disabled");
BIND_CONSTANT(SWITCH_MODE_IMMEDIATE); BIND_ENUM_CONSTANT(SWITCH_MODE_IMMEDIATE);
BIND_CONSTANT(SWITCH_MODE_SYNC); BIND_ENUM_CONSTANT(SWITCH_MODE_SYNC);
BIND_CONSTANT(SWITCH_MODE_AT_END); BIND_ENUM_CONSTANT(SWITCH_MODE_AT_END);
} }
AnimationNodeStateMachineTransition::AnimationNodeStateMachineTransition() { AnimationNodeStateMachineTransition::AnimationNodeStateMachineTransition() {

View file

@ -877,7 +877,7 @@ void AnimationTree::_process_graph(float p_delta) {
continue; continue;
t->loc = t->loc.linear_interpolate(loc, blend); t->loc = t->loc.linear_interpolate(loc, blend);
if (t->rot_blend_accum==0) { if (t->rot_blend_accum == 0) {
t->rot = rot; t->rot = rot;
t->rot_blend_accum = blend; t->rot_blend_accum = blend;
} else { } else {
@ -1052,7 +1052,7 @@ void AnimationTree::_process_graph(float p_delta) {
float len = t->start > time ? (a->get_length() - t->start) + time : time - t->start; float len = t->start > time ? (a->get_length() - t->start) + time : time - t->start;
if (len > t->len) { if (len > t->len) {
stop=true; stop = true;
} }
} }
@ -1065,7 +1065,7 @@ void AnimationTree::_process_graph(float p_delta) {
} }
} }
float db = Math::linear2db(MAX(blend,0.00001)); float db = Math::linear2db(MAX(blend, 0.00001));
if (t->object->has_method("set_unit_db")) { if (t->object->has_method("set_unit_db")) {
t->object->call("set_unit_db", db); t->object->call("set_unit_db", db);
} else { } else {
@ -1310,16 +1310,17 @@ void AnimationTree::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_root_motion_transform"), &AnimationTree::get_root_motion_transform); ClassDB::bind_method(D_METHOD("get_root_motion_transform"), &AnimationTree::get_root_motion_transform);
ClassDB::bind_method(D_METHOD("_node_removed"), &AnimationTree::_node_removed); ClassDB::bind_method(D_METHOD("_node_removed"), &AnimationTree::_node_removed);
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "tree_root", PROPERTY_HINT_RESOURCE_TYPE, "AnimationRootNode", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_DO_NOT_SHARE_ON_DUPLICATE), "set_tree_root", "get_tree_root"); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "tree_root", PROPERTY_HINT_RESOURCE_TYPE, "AnimationRootNode", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_DO_NOT_SHARE_ON_DUPLICATE), "set_tree_root", "get_tree_root");
ADD_PROPERTY(PropertyInfo(Variant::NODE_PATH, "anim_player",PROPERTY_HINT_NODE_PATH_VALID_TYPES,"AnimationPlayer"), "set_animation_player", "get_animation_player"); ADD_PROPERTY(PropertyInfo(Variant::NODE_PATH, "anim_player", PROPERTY_HINT_NODE_PATH_VALID_TYPES, "AnimationPlayer"), "set_animation_player", "get_animation_player");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "active"), "set_active", "is_active"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "active"), "set_active", "is_active");
ADD_PROPERTY(PropertyInfo(Variant::INT, "process_mode", PROPERTY_HINT_ENUM, "Physics,Idle"), "set_process_mode", "get_process_mode"); ADD_PROPERTY(PropertyInfo(Variant::INT, "process_mode", PROPERTY_HINT_ENUM, "Physics,Idle"), "set_process_mode", "get_process_mode");
ADD_GROUP("Root Motion", "root_motion_"); ADD_GROUP("Root Motion", "root_motion_");
ADD_PROPERTY(PropertyInfo(Variant::NODE_PATH, "root_motion_track"), "set_root_motion_track", "get_root_motion_track"); ADD_PROPERTY(PropertyInfo(Variant::NODE_PATH, "root_motion_track"), "set_root_motion_track", "get_root_motion_track");
BIND_ENUM_CONSTANT(ANIMATION_PROCESS_PHYSICS);
BIND_ENUM_CONSTANT(ANIMATION_PROCESS_IDLE);
} }
AnimationTree::AnimationTree() { AnimationTree::AnimationTree() {