-fixed bug importing skeletons

This commit is contained in:
Juan Linietsky 2014-02-23 10:35:05 -03:00
parent 6c27ac58b8
commit 51609ffc04
3 changed files with 566 additions and 564 deletions

View file

@ -43,7 +43,8 @@ bool Skeleton::_set(const StringName& p_path, const Variant& p_value) {
int which=path.get_slice("/",1).to_int();
String what=path.get_slice("/",2);
if (which==bones.size() && what=="name") {
add_bone(p_value);
@ -94,7 +95,7 @@ bool Skeleton::_get(const StringName& p_name,Variant &r_ret) const {
if (what=="name")
r_ret=get_bone_name(which);
if (what=="parent")
else if (what=="parent")
r_ret=get_bone_parent(which);
else if (what=="rest")
r_ret=get_bone_rest(which);
@ -250,7 +251,7 @@ void Skeleton::add_bone(const String& p_name) {
ERR_FAIL_COND( bones[i].name=="p_name");
}
Bone b;
b.name=p_name;
bones.push_back(b);

File diff suppressed because it is too large Load diff

View file

@ -108,6 +108,7 @@ Error ColladaImport::_populate_skeleton(Skeleton *p_skeleton,Collada::Node *p_no
Collada::NodeJoint *joint = static_cast<Collada::NodeJoint*>(p_node);
p_skeleton->add_bone(p_node->name);
if (p_parent>=0)
p_skeleton->set_bone_parent(r_bone,p_parent);