Changeset View
Changeset View
Standalone View
Standalone View
source/blender/io/collada/SceneExporter.cpp
| Show First 20 Lines • Show All 185 Lines • ▼ Show 20 Lines | else if (ob->type == OB_EMPTY) { /* TODO: handle groups (OB_DUPLICOLLECTION */ | ||||
| colladaNode.addExtraTechniqueChildParameter( | colladaNode.addExtraTechniqueChildParameter( | ||||
| "blender", con_tag, "tar_space", con->tarspace); | "blender", con_tag, "tar_space", con->tarspace); | ||||
| colladaNode.addExtraTechniqueChildParameter( | colladaNode.addExtraTechniqueChildParameter( | ||||
| "blender", con_tag, "lin_error", con->lin_error); | "blender", con_tag, "lin_error", con->lin_error); | ||||
| /* not ideal: add the target object name as another parameter. | /* not ideal: add the target object name as another parameter. | ||||
| * No real mapping in the .dae | * No real mapping in the .dae | ||||
| * Need support for multiple target objects also. */ | * Need support for multiple target objects also. */ | ||||
| const bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con); | |||||
| ListBase targets = {nullptr, nullptr}; | |||||
| if (cti && cti->get_constraint_targets) { | |||||
| ListBase targets = {nullptr, nullptr}; | |||||
| if (BKE_constraint_targets_get(con, &targets)) { | |||||
| bConstraintTarget *ct; | bConstraintTarget *ct; | ||||
| Object *obtar; | Object *obtar; | ||||
| cti->get_constraint_targets(con, &targets); | |||||
| for (ct = (bConstraintTarget *)targets.first; ct; ct = ct->next) { | for (ct = (bConstraintTarget *)targets.first; ct; ct = ct->next) { | ||||
| obtar = ct->tar; | obtar = ct->tar; | ||||
| std::string tar_id((obtar) ? id_name(obtar) : ""); | std::string tar_id((obtar) ? id_name(obtar) : ""); | ||||
| colladaNode.addExtraTechniqueChildParameter("blender", con_tag, "target_id", tar_id); | colladaNode.addExtraTechniqueChildParameter("blender", con_tag, "target_id", tar_id); | ||||
| } | } | ||||
| if (cti->flush_constraint_targets) { | BKE_constraint_targets_flush(con, &targets, true); | ||||
| cti->flush_constraint_targets(con, &targets, true); | |||||
| } | |||||
| } | } | ||||
| con = con->next; | con = con->next; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| bc_remove_mark(ob); | bc_remove_mark(ob); | ||||
| writeNodeList(child_objects, ob); | writeNodeList(child_objects, ob); | ||||
| colladaNode.end(); | colladaNode.end(); | ||||
| } | } | ||||
| else { | else { | ||||
| writeNodeList(child_objects, ob); | writeNodeList(child_objects, ob); | ||||
| } | } | ||||
| } | } | ||||