|
|
@@ -1,369 +0,0 @@
|
|
|
-diff --git a/build_files/build_environment/install_deps.sh b/build_files/build_environment/install_deps.sh
|
|
|
-index 6cd725494b3..6ce61b8c7d6 100755
|
|
|
---- a/build_files/build_environment/install_deps.sh
|
|
|
-+++ b/build_files/build_environment/install_deps.sh
|
|
|
-@@ -340,7 +340,7 @@ LLVM_FORCE_REBUILD=false
|
|
|
- LLVM_SKIP=false
|
|
|
-
|
|
|
- # OSL needs to be compiled for now!
|
|
|
--OSL_VERSION="1.7.5"
|
|
|
-+OSL_VERSION="1.8.10"
|
|
|
- OSL_VERSION_MIN=$OSL_VERSION
|
|
|
- OSL_FORCE_BUILD=false
|
|
|
- OSL_FORCE_REBUILD=false
|
|
|
-diff --git a/source/blender/collada/EffectExporter.cpp b/source/blender/collada/EffectExporter.cpp
|
|
|
-index d33ce725e58..bf36943b324 100644
|
|
|
---- a/source/blender/collada/EffectExporter.cpp
|
|
|
-+++ b/source/blender/collada/EffectExporter.cpp
|
|
|
-@@ -46,7 +46,9 @@ extern "C" {
|
|
|
- #include "BKE_customdata.h"
|
|
|
- #include "BKE_mesh.h"
|
|
|
- #include "BKE_material.h"
|
|
|
-+ #include "BKE_idprop.h"
|
|
|
- }
|
|
|
-+#include <sstream>
|
|
|
-
|
|
|
- EffectsExporter::EffectsExporter(COLLADASW::StreamWriter *sw, const ExportSettings *export_settings) : COLLADASW::LibraryEffects(sw), export_settings(export_settings) {
|
|
|
- }
|
|
|
-@@ -196,6 +198,26 @@ void EffectsExporter::writeTextures(
|
|
|
- texture.setChildElementName("bump");
|
|
|
- ep.addExtraTechniqueColorOrTexture(COLLADASW::ColorOrTexture(texture));
|
|
|
- }
|
|
|
-+ // AnKi: Add some textures
|
|
|
-+ if (t->mapto & MAP_HAR) {
|
|
|
-+ COLLADASW::Texture texture(key);
|
|
|
-+ texture.setTexcoord(uvname);
|
|
|
-+ texture.setSampler(*sampler);
|
|
|
-+ texture.setProfileName("blender");
|
|
|
-+ texture.setChildElementName("roughness_tex");
|
|
|
-+ ep.addExtraTechniqueColorOrTexture(COLLADASW::ColorOrTexture(texture));
|
|
|
-+ }
|
|
|
-+ if (t->mapto & MAP_DISPLACE) {
|
|
|
-+ COLLADASW::Texture texture(key);
|
|
|
-+ texture.setTexcoord(uvname);
|
|
|
-+ texture.setSampler(*sampler);
|
|
|
-+ texture.setProfileName("blender");
|
|
|
-+ texture.setChildElementName("height");
|
|
|
-+ ep.addExtraTechniqueColorOrTexture(COLLADASW::ColorOrTexture(texture));
|
|
|
-+ }
|
|
|
-+ if ((t->mapto & MAP_COLMIR) || (t->mapto & MAP_RAYMIRR)) {
|
|
|
-+ ep.setReflective(createTexture(ima, uvname, sampler));
|
|
|
-+ }
|
|
|
- }
|
|
|
-
|
|
|
- void EffectsExporter::operator()(Material *ma, Object *ob)
|
|
|
-@@ -358,6 +380,68 @@ void EffectsExporter::operator()(Material *ma, Object *ob)
|
|
|
- writeTextures(ep, key, sampler, t, ima, uvname);
|
|
|
- }
|
|
|
-
|
|
|
-+ // AnKi: Export extra properties
|
|
|
-+ static const char *property_names[] = {
|
|
|
-+ "diffuse_texture_detail",
|
|
|
-+ "normal_texture_detail",
|
|
|
-+ "material_override",
|
|
|
-+ "metallic",
|
|
|
-+ "roughness",
|
|
|
-+ "subsurface",
|
|
|
-+ NULL};
|
|
|
-+ IDProperty *rprop = ma->id.properties;
|
|
|
-+ while (rprop) {
|
|
|
-+ if (rprop->type == IDP_GROUP) {
|
|
|
-+ // Search properties
|
|
|
-+ const char **iter = property_names;
|
|
|
-+ while (*iter != NULL) {
|
|
|
-+ const char *prop_name = *iter;
|
|
|
-+ IDProperty *prop = IDP_GetPropertyFromGroup(rprop, prop_name);
|
|
|
-+
|
|
|
-+ if (prop) {
|
|
|
-+ const char *value = NULL;
|
|
|
-+ float valuef = 0.0;
|
|
|
-+ bool ok = true;
|
|
|
-+
|
|
|
-+ if(prop->type == IDP_STRING) {
|
|
|
-+ value = IDP_String(prop);
|
|
|
-+ }
|
|
|
-+ else if (prop->type == IDP_FLOAT) {
|
|
|
-+ valuef = IDP_Float(prop);
|
|
|
-+ }
|
|
|
-+ else if (prop->type == IDP_DOUBLE) {
|
|
|
-+ valuef = IDP_Double(prop);
|
|
|
-+ }
|
|
|
-+ else if (prop->type == IDP_INT) {
|
|
|
-+ valuef = IDP_Int(prop);
|
|
|
-+ }
|
|
|
-+ else {
|
|
|
-+ printf("Property value type cannot be handled\n");
|
|
|
-+ ok = false;
|
|
|
-+ }
|
|
|
-+
|
|
|
-+ if (ok)
|
|
|
-+ {
|
|
|
-+ if (value) {
|
|
|
-+ printf("Found %s property \"%s\"\n", prop_name, value);
|
|
|
-+ ep.addExtraTechniqueParameter("blender", prop_name, COLLADASW::String(value));
|
|
|
-+ }
|
|
|
-+ else {
|
|
|
-+ printf("Found %s property %f\n", prop_name, valuef);
|
|
|
-+ std::stringstream ss;
|
|
|
-+ ss << valuef;
|
|
|
-+ ep.addExtraTechniqueParameter("blender", prop_name, COLLADASW::String(ss.str()));
|
|
|
-+ }
|
|
|
-+ }
|
|
|
-+ } // end found
|
|
|
-+
|
|
|
-+ ++iter;
|
|
|
-+ } // end iterate property_names
|
|
|
-+ } // end group
|
|
|
-+
|
|
|
-+ rprop = rprop->next;
|
|
|
-+ }
|
|
|
-+
|
|
|
- // performs the actual writing
|
|
|
- ep.addProfileElements();
|
|
|
- bool twoSided = false;
|
|
|
-diff --git a/source/blender/collada/GeometryExporter.cpp b/source/blender/collada/GeometryExporter.cpp
|
|
|
-index 4b693332715..04fb3ee71f3 100644
|
|
|
---- a/source/blender/collada/GeometryExporter.cpp
|
|
|
-+++ b/source/blender/collada/GeometryExporter.cpp
|
|
|
-@@ -47,6 +47,7 @@ extern "C" {
|
|
|
- #include "BKE_customdata.h"
|
|
|
- #include "BKE_material.h"
|
|
|
- #include "BKE_mesh.h"
|
|
|
-+ #include "BKE_idprop.h"
|
|
|
- }
|
|
|
-
|
|
|
- #include "collada_internal.h"
|
|
|
-@@ -154,12 +155,135 @@ void GeometryExporter::operator()(Object *ob)
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-+ // AnKi: Export mesh properties
|
|
|
-+ {
|
|
|
-+ static const char *property_names[] = {
|
|
|
-+ "particles",
|
|
|
-+ "collision",
|
|
|
-+ "sector",
|
|
|
-+ "portal",
|
|
|
-+ "lod1",
|
|
|
-+ "skip",
|
|
|
-+ "reflection_probe",
|
|
|
-+ "gi_probe",
|
|
|
-+ "gi_probe_fade_distance",
|
|
|
-+ "gi_probe_cell_size",
|
|
|
-+ "reflection_proxy",
|
|
|
-+ "occluder",
|
|
|
-+ "collision_mesh",
|
|
|
-+ "decal_diffuse_atlas",
|
|
|
-+ "decal_diffuse_sub_texture",
|
|
|
-+ "decal_diffuse_factor",
|
|
|
-+ "decal_normal_roughness_atlas",
|
|
|
-+ "decal_normal_roughness_sub_texture",
|
|
|
-+ "decal_normal_roughness_factor",
|
|
|
-+ NULL};
|
|
|
-+
|
|
|
-+ ID *mesh_id = (ID*)ob->data;
|
|
|
-+ IDProperty *rprop = mesh_id->properties;
|
|
|
-+ while (rprop) {
|
|
|
-+ if (rprop->type == IDP_GROUP) {
|
|
|
-+ const char **iter = property_names;
|
|
|
-+ while (*iter != NULL) {
|
|
|
-+ const char *prop_name = *iter;
|
|
|
-+ IDProperty *prop = IDP_GetPropertyFromGroup(rprop, prop_name);
|
|
|
-+
|
|
|
-+ if (prop) {
|
|
|
-+ const char *value = NULL;
|
|
|
-+ float valuef = 0.0;
|
|
|
-+ bool ok = true;
|
|
|
-+
|
|
|
-+ if(prop->type == IDP_STRING) {
|
|
|
-+ value = IDP_String(prop);
|
|
|
-+ }
|
|
|
-+ else if (prop->type == IDP_FLOAT) {
|
|
|
-+ valuef = IDP_Float(prop);
|
|
|
-+ }
|
|
|
-+ else if (prop->type == IDP_DOUBLE) {
|
|
|
-+ valuef = IDP_Double(prop);
|
|
|
-+ }
|
|
|
-+ else if (prop->type == IDP_INT) {
|
|
|
-+ valuef = IDP_Int(prop);
|
|
|
-+ }
|
|
|
-+ else {
|
|
|
-+ printf("Property value type cannot be handled\n");
|
|
|
-+ ok = false;
|
|
|
-+ }
|
|
|
-+
|
|
|
-+ if (ok) {
|
|
|
-+ if (value) {
|
|
|
-+ printf("Found %s property \"%s\"\n", prop_name, value);
|
|
|
-+
|
|
|
-+ std::string str = std::string("<") + prop_name + ">" + value + "</" + prop_name + ">";
|
|
|
-+ mSW->appendTextBlock(str.c_str());
|
|
|
-+ }
|
|
|
-+ else {
|
|
|
-+ printf("Found %s property \"%f\"\n", prop_name, valuef);
|
|
|
-+
|
|
|
-+ std::stringstream ss;
|
|
|
-+ ss << "<" << prop_name << ">" << valuef << "</" << prop_name << ">";
|
|
|
-+ mSW->appendTextBlock(ss.str().c_str());
|
|
|
-+ }
|
|
|
-+ }
|
|
|
-+ } // end found
|
|
|
-+
|
|
|
-+ ++iter;
|
|
|
-+ } // end iterate property_names
|
|
|
-+ } // end group
|
|
|
-+
|
|
|
-+ rprop = rprop->next;
|
|
|
-+ }
|
|
|
-+ }
|
|
|
-+
|
|
|
- closeMesh();
|
|
|
-
|
|
|
- if (me->flag & ME_TWOSIDED) {
|
|
|
- mSW->appendTextBlock("<extra><technique profile=\"MAYA\"><double_sided>1</double_sided></technique></extra>");
|
|
|
- }
|
|
|
-
|
|
|
-+ // AnKi: Export object properties
|
|
|
-+ {
|
|
|
-+ static const char *property_names[] = {
|
|
|
-+ "add some",
|
|
|
-+ NULL};
|
|
|
-+ IDProperty *rprop = ob->id.properties;
|
|
|
-+ while (rprop) {
|
|
|
-+ if (rprop->type == IDP_GROUP) {
|
|
|
-+ // Search properties
|
|
|
-+ const char **iter = property_names;
|
|
|
-+ while (*iter != NULL) {
|
|
|
-+ const char *prop_name = *iter;
|
|
|
-+ IDProperty *prop = IDP_GetPropertyFromGroup(rprop, prop_name);
|
|
|
-+
|
|
|
-+ if (prop) {
|
|
|
-+ const char *value = NULL;
|
|
|
-+
|
|
|
-+ if(prop->type == IDP_STRING) {
|
|
|
-+ value = IDP_String(prop);
|
|
|
-+ }
|
|
|
-+ else {
|
|
|
-+ printf("Property's value is not string\n");
|
|
|
-+ }
|
|
|
-+
|
|
|
-+ if (value) {
|
|
|
-+ printf("Found %s property \"%s\"\n", prop_name, value);
|
|
|
-+
|
|
|
-+ std::string str = std::string("<") + prop_name + ">" + value + "</" + prop_name + ">";
|
|
|
-+ mSW->appendTextBlock(str.c_str());
|
|
|
-+ }
|
|
|
-+ else {
|
|
|
-+ printf("Value error in %s property\n", prop_name);
|
|
|
-+ }
|
|
|
-+ } // end found
|
|
|
-+
|
|
|
-+ ++iter;
|
|
|
-+ } // end iterate property_names
|
|
|
-+ } // end group
|
|
|
-+
|
|
|
-+ rprop = rprop->next;
|
|
|
-+ }
|
|
|
-+ }
|
|
|
-+
|
|
|
- closeGeometry();
|
|
|
-
|
|
|
- if (this->export_settings->include_shapekeys) {
|
|
|
-diff --git a/source/blender/collada/LightExporter.cpp b/source/blender/collada/LightExporter.cpp
|
|
|
-index 02c5438ec47..6db17d8d082 100644
|
|
|
---- a/source/blender/collada/LightExporter.cpp
|
|
|
-+++ b/source/blender/collada/LightExporter.cpp
|
|
|
-@@ -31,6 +31,9 @@
|
|
|
- #include "COLLADASWLight.h"
|
|
|
-
|
|
|
- #include "BLI_math.h"
|
|
|
-+extern "C" {
|
|
|
-+#include "BKE_idprop.h"
|
|
|
-+}
|
|
|
-
|
|
|
- #include "LightExporter.h"
|
|
|
- #include "collada_internal.h"
|
|
|
-@@ -107,6 +110,7 @@ void LightsExporter::operator()(Object *ob)
|
|
|
- cla.setLinearAttenuation(linatt);
|
|
|
- cla.setQuadraticAttenuation(quadatt);
|
|
|
- exportBlenderProfile(cla, la);
|
|
|
-+ cla.addExtraTechniqueParameter("FCOLLADA", "outer_cone", RAD2DEGF(la->spotsize)); // AnKi: Add cone angle
|
|
|
- addLight(cla);
|
|
|
- }
|
|
|
- // lamp
|
|
|
-@@ -191,5 +195,48 @@ bool LightsExporter::exportBlenderProfile(COLLADASW::Light &cla, Lamp *la)
|
|
|
- cla.addExtraTechniqueParameter("blender", "sky_exposure", la->sky_exposure);
|
|
|
- cla.addExtraTechniqueParameter("blender", "sky_colorspace", la->sky_colorspace);
|
|
|
-
|
|
|
-+ // AnKi: Export properties
|
|
|
-+ static const char *property_names[] = {
|
|
|
-+ "lens_flare",
|
|
|
-+ "lens_flare_first_sprite_size",
|
|
|
-+ "lens_flare_color",
|
|
|
-+ "specular_color",
|
|
|
-+ "shadow",
|
|
|
-+ "light_event_intensity",
|
|
|
-+ "light_event_frequency",
|
|
|
-+ NULL};
|
|
|
-+ IDProperty *rprop = la->id.properties;
|
|
|
-+ while (rprop) {
|
|
|
-+ if (rprop->type == IDP_GROUP) {
|
|
|
-+ // Search properties
|
|
|
-+ const char **iter = property_names;
|
|
|
-+ while (*iter != NULL) {
|
|
|
-+ const char *prop_name = *iter;
|
|
|
-+ IDProperty *prop = IDP_GetPropertyFromGroup(rprop, prop_name);
|
|
|
-+
|
|
|
-+ if (prop) {
|
|
|
-+ const char *value = NULL;
|
|
|
-+
|
|
|
-+ if(prop->type == IDP_STRING) {
|
|
|
-+ value = IDP_String(prop);
|
|
|
-+ }
|
|
|
-+
|
|
|
-+ if (value) {
|
|
|
-+ printf("Found %s property \"%s\"\n", prop_name, value);
|
|
|
-+
|
|
|
-+ cla.addExtraTechniqueParameter("blender", prop_name, COLLADASW::String(value));
|
|
|
-+ }
|
|
|
-+ else {
|
|
|
-+ printf("Value error in %s property\n", prop_name);
|
|
|
-+ }
|
|
|
-+ } // end found
|
|
|
-+
|
|
|
-+ ++iter;
|
|
|
-+ } // end iterate property_names
|
|
|
-+ } // end group
|
|
|
-+
|
|
|
-+ rprop = rprop->next;
|
|
|
-+ }
|
|
|
-+
|
|
|
- return true;
|
|
|
- }
|
|
|
-diff --git a/source/blender/collada/SceneExporter.cpp b/source/blender/collada/SceneExporter.cpp
|
|
|
-index 4e08548449f..4eb2580dd6b 100644
|
|
|
---- a/source/blender/collada/SceneExporter.cpp
|
|
|
-+++ b/source/blender/collada/SceneExporter.cpp
|
|
|
-@@ -28,6 +28,7 @@ extern "C" {
|
|
|
- #include "BLI_utildefines.h"
|
|
|
- #include "BKE_object.h"
|
|
|
- #include "BLI_listbase.h"
|
|
|
-+ #include "BKE_group.h"
|
|
|
- }
|
|
|
-
|
|
|
- #include "SceneExporter.h"
|
|
|
-@@ -232,6 +233,14 @@ void SceneExporter::writeNodes(bContext *C, Object *ob, Scene *sce)
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-+ // AnKi: Export group
|
|
|
-+ Group *group = BKE_group_object_find(NULL, ob);
|
|
|
-+ if (group) {
|
|
|
-+ colladaNode.addExtraTechniqueParameter("blender", "group", COLLADASW::String(group->id.name));
|
|
|
-+ } else {
|
|
|
-+ colladaNode.addExtraTechniqueParameter("blender", "group", COLLADASW::String("none"));
|
|
|
-+ }
|
|
|
-+
|
|
|
- for (std::list<Object *>::iterator i = child_objects.begin(); i != child_objects.end(); ++i) {
|
|
|
- if (bc_is_marked(*i)) {
|
|
|
- bc_remove_mark(*i);
|