[Bf-blender-cvs] [14b69ac29dd] cycles_procedural_api: cleanup, format
Kévin Dietrich
noreply at git.blender.org
Sun Dec 6 06:26:28 CET 2020
Commit: 14b69ac29ddf9d40758aa0610e3094b16c3c0ace
Author: Kévin Dietrich
Date: Thu Dec 3 15:06:25 2020 +0100
Branches: cycles_procedural_api
https://developer.blender.org/rB14b69ac29ddf9d40758aa0610e3094b16c3c0ace
cleanup, format
===================================================================
M intern/cycles/render/alembic.cpp
M intern/cycles/render/alembic.h
M source/blender/editors/io/io_alembic.c
M source/blender/io/alembic/intern/abc_reader_curves.cc
M source/blender/makesrna/intern/rna_cachefile.c
===================================================================
diff --git a/intern/cycles/render/alembic.cpp b/intern/cycles/render/alembic.cpp
index 947bcce9e53..1f34aeb4b38 100644
--- a/intern/cycles/render/alembic.cpp
+++ b/intern/cycles/render/alembic.cpp
@@ -38,7 +38,7 @@ CCL_NAMESPACE_BEGIN
* least a way to tell which frame data to load, so we do not load the entire archive for a few
* frames. */
-/* TODO(@kevindietrich) : arrays are emptied when passed to the sockets, so for now we copy the
+/* TODO(@kevindietrich): arrays are emptied when passed to the sockets, so for now we copy the
* arrays to avoid reloading the data */
static float3 make_float3_from_yup(const Imath::Vec3<float> &v)
@@ -59,11 +59,11 @@ static M44d convert_yup_zup(const M44d &mtx)
return scale_mat * rot_mat * trans_mat;
}
-void transform_decompose(const Imath::M44d &mat,
- Imath::V3d &scale,
- Imath::V3d &shear,
- Imath::Quatd &rotation,
- Imath::V3d &translation)
+static void transform_decompose(const Imath::M44d &mat,
+ Imath::V3d &scale,
+ Imath::V3d &shear,
+ Imath::Quatd &rotation,
+ Imath::V3d &translation)
{
Imath::M44d mat_remainder(mat);
@@ -79,10 +79,10 @@ void transform_decompose(const Imath::M44d &mat,
rotation = extractQuat(mat_remainder);
}
-M44d transform_compose(const Imath::V3d &scale,
- const Imath::V3d &shear,
- const Imath::Quatd &rotation,
- const Imath::V3d &translation)
+static M44d transform_compose(const Imath::V3d &scale,
+ const Imath::V3d &shear,
+ const Imath::Quatd &rotation,
+ const Imath::V3d &translation)
{
Imath::M44d scale_mat, shear_mat, rot_mat, trans_mat;
@@ -516,9 +516,10 @@ void AlembicObject::load_all_data(IPolyMeshSchema &schema, Progress &progress)
AttributeRequestSet requested_attributes = get_requested_attributes();
- cached_data.vertices.set_time_sampling(*schema.getTimeSampling());
- cached_data.triangles.set_time_sampling(*schema.getTimeSampling());
- cached_data.triangles_loops.set_time_sampling(*schema.getTimeSampling());
+ const TimeSamplingPtr time_sampling = schema.getTimeSampling();
+ cached_data.vertices.set_time_sampling(*time_sampling);
+ cached_data.triangles.set_time_sampling(*time_sampling);
+ cached_data.triangles_loops.set_time_sampling(*time_sampling);
/* start by reading the face sets (per face shader), as we directly split polygons to triangles
*/
@@ -536,7 +537,7 @@ void AlembicObject::load_all_data(IPolyMeshSchema &schema, Progress &progress)
const ISampleSelector iss = ISampleSelector(static_cast<index_t>(i));
const IPolyMeshSchema::Sample sample = schema.getValue(iss);
- const double time = schema.getTimeSampling()->getSampleTime(static_cast<index_t>(i));
+ const double time = time_sampling->getSampleTime(static_cast<index_t>(i));
add_positions(sample.getPositions(), time, cached_data);
@@ -571,7 +572,9 @@ void AlembicObject::load_all_data(IPolyMeshSchema &schema, Progress &progress)
data_loaded = true;
}
-void AlembicObject::load_all_data(const ICurvesSchema &schema, Progress &progress, float default_radius)
+void AlembicObject::load_all_data(const ICurvesSchema &schema,
+ Progress &progress,
+ float default_radius)
{
cached_data.clear();
diff --git a/intern/cycles/render/alembic.h b/intern/cycles/render/alembic.h
index 4787962d6b8..4014d7322d2 100644
--- a/intern/cycles/render/alembic.h
+++ b/intern/cycles/render/alembic.h
@@ -206,7 +206,9 @@ class AlembicObject : public Node {
Object *get_object();
void load_all_data(Alembic::AbcGeom::IPolyMeshSchema &schema, Progress &progress);
- void load_all_data(const Alembic::AbcGeom::ICurvesSchema &schema, Progress &progress, float default_radius);
+ void load_all_data(const Alembic::AbcGeom::ICurvesSchema &schema,
+ Progress &progress,
+ float default_radius);
bool has_data_loaded() const;
diff --git a/source/blender/editors/io/io_alembic.c b/source/blender/editors/io/io_alembic.c
index 78a5434b697..20aa7f6ac5e 100644
--- a/source/blender/editors/io/io_alembic.c
+++ b/source/blender/editors/io/io_alembic.c
@@ -714,7 +714,8 @@ void WM_OT_alembic_import(wmOperatorType *ot)
"force_modifier",
false,
"Force Modifier",
- "Add a cache modifier for every object in the Alembic archive, even if they are not animated");
+ "Add a cache modifier for every object in the Alembic archive, even if they are "
+ "not animated");
RNA_def_boolean(ot->srna,
"is_sequence",
diff --git a/source/blender/io/alembic/intern/abc_reader_curves.cc b/source/blender/io/alembic/intern/abc_reader_curves.cc
index 753d6f064e9..422ba25d8f3 100644
--- a/source/blender/io/alembic/intern/abc_reader_curves.cc
+++ b/source/blender/io/alembic/intern/abc_reader_curves.cc
@@ -222,7 +222,8 @@ void AbcCurveReader::read_curve_sample(Curve *cu,
float weight = 1.0f;
const bool do_radius = (radiuses != nullptr) && (radiuses->size() > 1);
- float radius = (radiuses && radiuses->size() == 1) ? (*radiuses)[0] : m_settings->default_curves_radius;
+ float radius = (radiuses && radiuses->size() == 1) ? (*radiuses)[0] :
+ m_settings->default_curves_radius;
nu->type = CU_NURBS;
diff --git a/source/blender/makesrna/intern/rna_cachefile.c b/source/blender/makesrna/intern/rna_cachefile.c
index 67e284bfdc6..807c1a29e10 100644
--- a/source/blender/makesrna/intern/rna_cachefile.c
+++ b/source/blender/makesrna/intern/rna_cachefile.c
@@ -202,10 +202,10 @@ static void rna_def_cachefile(BlenderRNA *brna)
prop = RNA_def_property(srna, "default_curves_radius", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "default_curves_radius");
- RNA_def_property_ui_text(
- prop,
- "Curves Radius",
- "Value to use for defining the curves width when the curves in the Alembic archive do not have a property for it");
+ RNA_def_property_ui_text(prop,
+ "Curves Radius",
+ "Value to use for defining the curves width when the curves in the "
+ "Alembic archive do not have a property for it");
RNA_def_property_update(prop, 0, "rna_CacheFile_update");
RNA_define_lib_overridable(false);
More information about the Bf-blender-cvs
mailing list