[Bf-blender-cvs] [0798534a57e] new-object-types: Fix a few places that missed the new build option
Brecht Van Lommel
noreply at git.blender.org
Wed Feb 26 19:50:38 CET 2020
Commit: 0798534a57e0f9a30a0a24edf3c1985136333c28
Author: Brecht Van Lommel
Date: Wed Feb 26 19:26:50 2020 +0100
Branches: new-object-types
https://developer.blender.org/rB0798534a57e0f9a30a0a24edf3c1985136333c28
Fix a few places that missed the new build option
===================================================================
M intern/cycles/blender/blender_curves.cpp
M intern/cycles/blender/blender_geometry.cpp
M intern/cycles/blender/blender_object.cpp
M source/blender/makesrna/intern/rna_action.c
M source/blender/makesrna/intern/rna_object.c
M source/blender/makesrna/intern/rna_space.c
M source/blender/makesrna/intern/rna_userdef.c
===================================================================
diff --git a/intern/cycles/blender/blender_curves.cpp b/intern/cycles/blender/blender_curves.cpp
index 55633170c45..983894db309 100644
--- a/intern/cycles/blender/blender_curves.cpp
+++ b/intern/cycles/blender/blender_curves.cpp
@@ -1362,12 +1362,15 @@ void BlenderSync::sync_hair(BL::Depsgraph b_depsgraph,
geom->used_shaders = used_shaders;
if (view_layer.use_hair && scene->curve_system_manager->use_curves) {
+#ifdef WITH_NEW_OBJECT_TYPES
if (b_ob.type() == BL::Object::type_HAIR) {
/* Hair object. */
sync_hair(hair, b_ob, false);
assert(mesh == NULL);
}
- else {
+ else
+#endif
+ {
/* Particle hair. */
bool need_undeformed = geom->need_attribute(scene, ATTR_STD_GENERATED);
BL::Mesh b_mesh = object_to_mesh(
@@ -1403,13 +1406,16 @@ void BlenderSync::sync_hair_motion(BL::Depsgraph b_depsgraph,
/* Export deformed coordinates. */
if (ccl::BKE_object_is_deform_modified(b_ob, b_scene, preview)) {
+#ifdef WITH_NEW_OBJECT_TYPES
if (b_ob.type() == BL::Object::type_HAIR) {
/* Hair object. */
sync_hair(hair, b_ob, true, motion_step);
assert(mesh == NULL);
return;
}
- else {
+ else
+#endif
+ {
/* Particle hair. */
BL::Mesh b_mesh = object_to_mesh(b_data, b_ob, b_depsgraph, false, Mesh::SUBDIVISION_NONE);
if (b_mesh) {
diff --git a/intern/cycles/blender/blender_geometry.cpp b/intern/cycles/blender/blender_geometry.cpp
index 03d1f220dca..fd664e92be1 100644
--- a/intern/cycles/blender/blender_geometry.cpp
+++ b/intern/cycles/blender/blender_geometry.cpp
@@ -38,10 +38,17 @@ Geometry *BlenderSync::sync_geometry(BL::Depsgraph &b_depsgraph,
BL::Material material_override = view_layer.material_override;
Shader *default_shader = (b_ob.type() == BL::Object::type_VOLUME) ? scene->default_volume :
scene->default_surface;
+#ifdef WITH_NEW_OBJECT_TYPES
Geometry::Type geom_type = ((b_ob.type() == BL::Object::type_HAIR || use_particle_hair) &&
(scene->curve_system_manager->primitive != CURVE_TRIANGLES)) ?
Geometry::HAIR :
Geometry::MESH;
+#else
+ Geometry::Type geom_type = ((use_particle_hair) &&
+ (scene->curve_system_manager->primitive != CURVE_TRIANGLES)) ?
+ Geometry::HAIR :
+ Geometry::MESH;
+#endif
/* Find shader indices. */
vector<Shader *> used_shaders;
@@ -120,7 +127,11 @@ Geometry *BlenderSync::sync_geometry(BL::Depsgraph &b_depsgraph,
geom->name = ustring(b_ob_data.name().c_str());
+#ifdef WITH_NEW_OBJECT_TYPES
if (b_ob.type() == BL::Object::type_HAIR || use_particle_hair) {
+#else
+ if (use_particle_hair) {
+#endif
sync_hair(b_depsgraph, b_ob, geom, used_shaders);
}
else if (b_ob.type() == BL::Object::type_VOLUME || object_fluid_gas_domain_find(b_ob)) {
@@ -160,7 +171,11 @@ void BlenderSync::sync_geometry_motion(BL::Depsgraph &b_depsgraph,
return;
}
+#ifdef WITH_NEW_OBJECT_TYPES
if (b_ob.type() == BL::Object::type_HAIR || use_particle_hair) {
+#else
+ if (use_particle_hair) {
+#endif
sync_hair_motion(b_depsgraph, b_ob, geom, motion_step);
}
else if (b_ob.type() == BL::Object::type_VOLUME || object_fluid_gas_domain_find(b_ob)) {
diff --git a/intern/cycles/blender/blender_object.cpp b/intern/cycles/blender/blender_object.cpp
index b49e2b91e98..4e488f12d0d 100644
--- a/intern/cycles/blender/blender_object.cpp
+++ b/intern/cycles/blender/blender_object.cpp
@@ -69,7 +69,11 @@ bool BlenderSync::object_is_mesh(BL::Object &b_ob)
BL::Object::type_enum type = b_ob.type();
+#ifdef WITH_NEW_OBJECT_TYPES
if (type == BL::Object::type_VOLUME || type == BL::Object::type_HAIR) {
+#else
+ if (type == BL::Object::type_VOLUME) {
+#endif
/* Will be exported attached to mesh. */
return true;
}
diff --git a/source/blender/makesrna/intern/rna_action.c b/source/blender/makesrna/intern/rna_action.c
index 50d26011279..5f7d5e14869 100644
--- a/source/blender/makesrna/intern/rna_action.c
+++ b/source/blender/makesrna/intern/rna_action.c
@@ -568,6 +568,7 @@ static void rna_def_dopesheet(BlenderRNA *brna)
RNA_def_property_ui_icon(prop, ICON_FILE, 0);
RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL);
+# ifdef WITH_NEW_OBJECT_TYPES
prop = RNA_def_property(srna, "show_hairs", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag2", ADS_FILTER_NOHAIR);
RNA_def_property_ui_text(
@@ -581,6 +582,7 @@ static void rna_def_dopesheet(BlenderRNA *brna)
prop, "Display Point Cloud", "Include visualization of point cloud related animation data");
RNA_def_property_ui_icon(prop, ICON_OUTLINER_OB_POINTCLOUD, 0);
RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL);
+# endif
prop = RNA_def_property(srna, "show_volumes", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag2", ADS_FILTER_NOVOLUME);
diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c
index 9fd9e04284f..ba8c8606ddd 100644
--- a/source/blender/makesrna/intern/rna_object.c
+++ b/source/blender/makesrna/intern/rna_object.c
@@ -224,8 +224,10 @@ const EnumPropertyItem rna_enum_object_type_items[] = {
OBTYPE_CU_SURF,
{OB_MBALL, "META", 0, "Meta", ""},
OBTYPE_CU_FONT,
+#ifdef WITH_NEW_OBJECT_TYPES
{OB_HAIR, "HAIR", 0, "Hair", ""},
{OB_POINTCLOUD, "POINTCLOUD", 0, "PointCloud", ""},
+#endif
{OB_VOLUME, "VOLUME", 0, "Volume", ""},
{0, "", 0, NULL, NULL},
{OB_ARMATURE, "ARMATURE", 0, "Armature", ""},
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index 47df9ea68e5..039bd96070d 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -4138,10 +4138,12 @@ static void rna_def_space_view3d(BlenderRNA *brna)
{"Surface", (1 << OB_SURF), {"show_object_viewport_surf", "show_object_select_surf"}},
{"Meta", (1 << OB_MBALL), {"show_object_viewport_meta", "show_object_select_meta"}},
{"Font", (1 << OB_FONT), {"show_object_viewport_font", "show_object_select_font"}},
+# ifdef WITH_NEW_OBJECT_TYPES
{"Hair", (1 << OB_HAIR), {"show_object_viewport_hair", "show_object_select_hair"}},
{"Point Cloud",
(1 << OB_POINTCLOUD),
{"show_object_viewport_pointcloud", "show_object_select_pointcloud"}},
+# endif
{"Volume", (1 << OB_VOLUME), {"show_object_viewport_volume", "show_object_select_volume"}},
{"Armature",
(1 << OB_ARMATURE),
@@ -5405,12 +5407,14 @@ static void rna_def_fileselect_params(BlenderRNA *brna)
{FILTER_ID_TE, "TEXTURE", ICON_TEXTURE_DATA, "Textures", "Show/hide Texture data-blocks"},
{FILTER_ID_TXT, "TEXT", ICON_TEXT, "Texts", "Show/hide Text data-blocks"},
{FILTER_ID_VF, "FONT", ICON_FONT_DATA, "Fonts", "Show/hide Font data-blocks"},
+# ifdef WITH_NEW_OBJECT_TYPES
{FILTER_ID_HA, "HAIR", ICON_HAIR_DATA, "Hairs", "Show/hide Hair data-blocks"},
{FILTER_ID_PT,
"POINTCLOUD",
ICON_POINTCLOUD_DATA,
"Point Clouds",
"Show/hide Point Cloud data-blocks"},
+# endif
{FILTER_ID_VO, "VOLUME", ICON_VOLUME_DATA, "Volumes", "Show/hide Volume data-blocks"},
{FILTER_ID_WO, "WORLD", ICON_WORLD_DATA, "Worlds", "Show/hide World data-blocks"},
{FILTER_ID_WS,
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index 4ccc7008d4c..5eb83b06a90 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -4982,6 +4982,7 @@ static void rna_def_userdef_edit(BlenderRNA *brna)
RNA_def_property_ui_text(
prop, "Duplicate GPencil", "Causes grease pencil data to be duplicated with the object");
+# ifdef WITH_NEW_OBJECT_TYPES
prop = RNA_def_property(srna, "use_duplicate_hair", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_HAIR);
RNA_def_property_ui_text(
@@ -4991,6 +4992,7 @@ static void rna_def_userdef_edit(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_POINTCLOUD);
RNA_def_property_ui_text(
prop, "Duplicate Point Cloud", "Causes point cloud data to be duplicated with the object");
+# endif
prop = RNA_def_property(srna, "use_duplicate_volume", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_VOLUME);
More information about the Bf-blender-cvs
mailing list