43 void SceneExporter::exportHierarchy()
49 for (
node = this->export_settings.get_export_set();
node;
node =
node->next) {
55 for (
node = this->export_settings.get_export_set();
node;
node =
node->next) {
57 if (this->export_settings.is_export_root(ob)) {
72 for (
int index = 0; index < base_objects.
size(); index++) {
81 void SceneExporter::writeNodeList(std::vector<Object *> &child_objects,
Object *parent)
89 for (
auto *child : child_objects) {
97 void SceneExporter::writeNode(
Object *ob)
99 ViewLayer *view_layer = blender_context.get_view_layer();
101 std::vector<Object *> child_objects;
103 bool can_export =
bc_is_in_Export_set(this->export_settings.get_export_set(), ob, view_layer);
106 bool armature_exported =
false;
109 if (ob_arm !=
nullptr) {
111 this->export_settings.get_export_set(), ob_arm, view_layer);
115 armature_exported =
true;
120 COLLADASW::Node colladaNode(mSW);
136 bool instance_controller_created =
false;
137 if (armature_exported) {
140 if (!instance_controller_created) {
141 COLLADASW::InstanceGeometry instGeom(mSW);
142 instGeom.setUrl(COLLADASW::URI(
144 get_geometry_id(ob, this->export_settings.get_use_object_instantiation())));
147 instGeom.getBindMaterial(), ob, this->export_settings.get_active_uv_only());
159 COLLADASW::InstanceCamera instCam(
166 COLLADASW::InstanceLight instLa(
177 printf(
"\t%s\n", object->id.name);
186 std::string con_tag = con_name +
"_constraint";
187 printf(
"%s\n", con_name.c_str());
188 printf(
"%s\n\n", con_tag.c_str());
189 colladaNode.addExtraTechniqueChildParameter(
"blender", con_tag,
"type", con->
type);
190 colladaNode.addExtraTechniqueChildParameter(
"blender", con_tag,
"enforce", con->
enforce);
191 colladaNode.addExtraTechniqueChildParameter(
"blender", con_tag,
"flag", con->
flag);
192 colladaNode.addExtraTechniqueChildParameter(
193 "blender", con_tag,
"headtail", con->
headtail);
194 colladaNode.addExtraTechniqueChildParameter(
195 "blender", con_tag,
"lin_error", con->
lin_error);
196 colladaNode.addExtraTechniqueChildParameter(
197 "blender", con_tag,
"own_space", con->
ownspace);
198 colladaNode.addExtraTechniqueChildParameter(
199 "blender", con_tag,
"rot_error", con->
rot_error);
200 colladaNode.addExtraTechniqueChildParameter(
201 "blender", con_tag,
"tar_space", con->
tarspace);
202 colladaNode.addExtraTechniqueChildParameter(
203 "blender", con_tag,
"lin_error", con->
lin_error);
209 ListBase targets = {
nullptr,
nullptr};
219 std::string tar_id((obtar) ?
id_name(obtar) :
"");
220 colladaNode.addExtraTechniqueChildParameter(
"blender", con_tag,
"target_id", tar_id);
233 writeNodeList(child_objects, ob);
237 writeNodeList(child_objects, ob);
#define FOREACH_COLLECTION_OBJECT_RECURSIVE_END
#define FOREACH_COLLECTION_OBJECT_RECURSIVE_BEGIN(_collection, _object)
const bConstraintTypeInfo * BKE_constraint_typeinfo_get(struct bConstraint *con)
General operations, lookup, etc. for blender objects.
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
void bc_remove_mark(Object *ob)
int bc_is_marked(Object *ob)
bool bc_is_in_Export_set(LinkNode *export_set, Object *ob, ViewLayer *view_layer)
void bc_get_children(std::vector< Object * > &child_set, Object *ob, ViewLayer *view_layer)
bool add_instance_controller(Object *ob)
void add_armature_bones(Object *ob_arm, ViewLayer *view_layer, SceneExporter *se, std::vector< Object * > &child_objects)
void add_material_bindings(COLLADASW::BindMaterial &bind_material, Object *ob, bool active_uv_only)
std::string get_camera_id(Object *ob)
std::string translate_id(const char *idString)
std::string get_geometry_id(Object *ob)
std::string encode_xml(std::string xml)
std::string get_light_id(Object *ob)
std::string id_name(void *id)
Object * bc_get_assigned_armature(Object *ob)
struct Collection * instance_collection
struct bConstraintTarget * next
int(* get_constraint_targets)(struct bConstraint *con, struct ListBase *list)
void(* flush_constraint_targets)(struct bConstraint *con, struct ListBase *list, bool no_copy)
struct bConstraint * next