Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Werner <stefan.werner@tangent-animation.com>2018-11-23 15:08:15 +0300
committerStefan Werner <stefan.werner@tangent-animation.com>2018-11-23 15:19:53 +0300
commit071f4f4ce0b9520ab0c73d6d68365ad449ca8b80 (patch)
tree9f37bfcac669366b9ad5fb7605f2fbbed9b71b0a /source/blender/collada
parent0a2b2d59a5897212ba3771503feb6770fb636bc8 (diff)
Cycles: Improved robustness of hair motion blur.motion_curve_fix
In some instances, the number of control vertices of a hair could change mid-frame. Cycles would then be unable to calculate proper motion blur for those hairs. This adds interpolated CVs to fill in for the missing data. While this will not necessarily result in a fully accurate reconstruction of the guide hair, it preserves motion blur instead of disabling it. Reviewers: #cycles, sergey Reviewed By: #cycles, sergey Subscribers: sergey, brecht, #cycles Tags: #cycles Differential Revision: https://developer.blender.org/D3695
Diffstat (limited to 'source/blender/collada')
-rw-r--r--source/blender/collada/AnimationExporter.cpp41
-rw-r--r--source/blender/collada/AnimationImporter.h11
-rw-r--r--source/blender/collada/ArmatureExporter.cpp2
-rw-r--r--source/blender/collada/ArmatureImporter.cpp6
-rw-r--r--source/blender/collada/ControllerExporter.cpp4
-rw-r--r--source/blender/collada/GeometryExporter.cpp4
-rw-r--r--source/blender/collada/GeometryExporter.h2
-rw-r--r--source/blender/collada/MeshImporter.cpp18
-rw-r--r--source/blender/collada/SceneExporter.cpp2
-rw-r--r--source/blender/collada/collada_utils.cpp4
10 files changed, 48 insertions, 46 deletions
diff --git a/source/blender/collada/AnimationExporter.cpp b/source/blender/collada/AnimationExporter.cpp
index 6e4561809fd..e5c54fd9917 100644
--- a/source/blender/collada/AnimationExporter.cpp
+++ b/source/blender/collada/AnimationExporter.cpp
@@ -65,25 +65,26 @@ bool AnimationExporter::is_flat_line(std::vector<float> &values, int channel_cou
* <source>, <sampler>, and <channel> entries.
* This is is used for creating sampled Transformation Animations for either:
*
- * 1-axis animation:
- * times contains the time points in seconds from within the timeline
- * values contains the data (list of single floats)
- * channel_count = 1
- * axis_name = ['X' | 'Y' | 'Z']
- * is_rot indicates if the animation is a rotation
+ * 1-axis animation:
+ * times contains the time points in seconds from within the timeline
+ * values contains the data (list of single floats)
+ * channel_count = 1
+ * axis_name = ['X' | 'Y' | 'Z']
+ * is_rot indicates if the animation is a rotation
*
- * 3-axis animation:
- * times contains the time points in seconds from within the timeline
- * values contains the data (list of floats where each 3 entries are one vector)
- * channel_count = 3
- * axis_name = "" (actually not used)
- * is_rot = false (see xxx below)
+ * 3-axis animation:
+ * times contains the time points in seconds from within the timeline
+ * values contains the data (list of floats where each 3 entries are one vector)
+ * channel_count = 3
+ * axis_name = "" (actually not used)
+ * is_rot = false (see xxx below)
*
- * xxx: I tried to create a 3 axis rotation animation
- * like for translation or scale. But i could not
- * figure out how to setup the channel for this case.
- * So for now rotations are exported as 3 separate 1-axis collada animations
- * See export_sampled_animation() further down.
+ * xxx:
+ * I tried to create a 3 axis rotation animation
+ * like for translation or scale. But i could not
+ * figure out how to setup the channel for this case.
+ * So for now rotations are exported as 3 separate 1-axis collada animations
+ * See export_sampled_animation() further down.
*/
void AnimationExporter::create_sampled_animation(int channel_count,
std::vector<float> &times,
@@ -139,7 +140,7 @@ void AnimationExporter::create_sampled_animation(int channel_count,
* Export all animation FCurves of an Object.
*
* Note: This uses the keyframes as sample points,
- * and exports "baked keyframes" while keeping the tangent infromation
+ * and exports "baked keyframes" while keeping the tangent information
* of the FCurves intact. This works for simple cases, but breaks
* especially when negative scales are involved in the animation.
*
@@ -417,8 +418,8 @@ void AnimationExporter::make_anim_frames_from_targets(Object *ob, std::vector<fl
bConstraintTarget *ct;
Object *obtar;
/* get targets
- * - constraints should use ct->matrix, not directly accessing values
- * - ct->matrix members have not yet been calculated here!
+ * - constraints should use ct->matrix, not directly accessing values
+ * - ct->matrix members have not yet been calculated here!
*/
cti->get_constraint_targets(con, &targets);
diff --git a/source/blender/collada/AnimationImporter.h b/source/blender/collada/AnimationImporter.h
index f63329158f0..ff49bc369cf 100644
--- a/source/blender/collada/AnimationImporter.h
+++ b/source/blender/collada/AnimationImporter.h
@@ -181,11 +181,12 @@ public:
// prerequisites:
// animlist_map - map animlist id -> animlist
// curve_map - map anim id -> curve(s)
- Object * translate_animation_OLD(Main *bmain, COLLADAFW::Node *node,
- std::map<COLLADAFW::UniqueId, Object*>& object_map,
- std::map<COLLADAFW::UniqueId, COLLADAFW::Node*>& root_map,
- COLLADAFW::Transformation::TransformationType tm_type,
- Object *par_job = NULL);
+ Object *translate_animation_OLD(
+ Main *bmain, COLLADAFW::Node *node,
+ std::map<COLLADAFW::UniqueId, Object*>& object_map,
+ std::map<COLLADAFW::UniqueId, COLLADAFW::Node*>& root_map,
+ COLLADAFW::Transformation::TransformationType tm_type,
+ Object *par_job = NULL);
void find_frames( std::vector<float>* frames, std::vector<FCurve*>* curves );
void find_frames_old( std::vector<float>* frames, COLLADAFW::Node * node, COLLADAFW::Transformation::TransformationType tm_type );
diff --git a/source/blender/collada/ArmatureExporter.cpp b/source/blender/collada/ArmatureExporter.cpp
index 52f7c5627b9..432ce92b49d 100644
--- a/source/blender/collada/ArmatureExporter.cpp
+++ b/source/blender/collada/ArmatureExporter.cpp
@@ -69,7 +69,7 @@ void ArmatureExporter::add_armature_bones(bContext *C, Object *ob_arm, Scene *sc
Main *bmain = CTX_data_main(C);
// write bone nodes
- bArmature * armature = (bArmature *)ob_arm->data;
+ bArmature *armature = (bArmature *)ob_arm->data;
bool is_edited = armature->edbo != NULL;
if (!is_edited)
diff --git a/source/blender/collada/ArmatureImporter.cpp b/source/blender/collada/ArmatureImporter.cpp
index e8b665b2020..a96d1e76a99 100644
--- a/source/blender/collada/ArmatureImporter.cpp
+++ b/source/blender/collada/ArmatureImporter.cpp
@@ -460,11 +460,11 @@ void ArmatureImporter::create_armature_bones(Main *bmain, std::vector<Object *>
if (!ob_arm)
continue;
- bArmature * armature = (bArmature *)ob_arm->data;
+ bArmature *armature = (bArmature *)ob_arm->data;
if (!armature)
continue;
- char * bone_name = (char *)bc_get_joint_name(*ri);
+ char *bone_name = (char *)bc_get_joint_name(*ri);
Bone *bone = BKE_armature_find_bone_name(armature, bone_name);
if (bone) {
fprintf(stderr, "Reuse of child bone [%s] as root bone in same Armature is not supported.\n", bone_name);
@@ -589,7 +589,7 @@ Object *ArmatureImporter::create_armature_bones(Main *bmain, SkinInfo& skin)
}
// enter armature edit mode
- bArmature * armature = (bArmature *)ob_arm->data;
+ bArmature *armature = (bArmature *)ob_arm->data;
ED_armature_to_edit(armature);
totbone = 0;
diff --git a/source/blender/collada/ControllerExporter.cpp b/source/blender/collada/ControllerExporter.cpp
index 5673d33fcbf..a5f96123fd4 100644
--- a/source/blender/collada/ControllerExporter.cpp
+++ b/source/blender/collada/ControllerExporter.cpp
@@ -398,13 +398,13 @@ std::string ControllerExporter::add_morph_weights(Key *key, Object *ob)
return source_id;
}
-//Added to implemente support for animations.
+//Added to implement support for animations.
void ControllerExporter::add_weight_extras(Key *key)
{
// can also try the base element and param alternative
COLLADASW::BaseExtraTechnique extra;
- KeyBlock * kb = (KeyBlock *)key->block.first;
+ KeyBlock *kb = (KeyBlock *)key->block.first;
//skip the basis
kb = kb->next;
for (; kb; kb = kb->next) {
diff --git a/source/blender/collada/GeometryExporter.cpp b/source/blender/collada/GeometryExporter.cpp
index 5f310c26da3..eb627b5c066 100644
--- a/source/blender/collada/GeometryExporter.cpp
+++ b/source/blender/collada/GeometryExporter.cpp
@@ -166,9 +166,9 @@ void GeometryExporter::operator()(Object *ob)
closeGeometry();
if (this->export_settings->include_shapekeys) {
- Key * key = BKE_key_from_object(ob);
+ Key *key = BKE_key_from_object(ob);
if (key) {
- KeyBlock * kb = (KeyBlock *)key->block.first;
+ KeyBlock *kb = (KeyBlock *)key->block.first;
//skip the basis
kb = kb->next;
for (; kb; kb = kb->next) {
diff --git a/source/blender/collada/GeometryExporter.h b/source/blender/collada/GeometryExporter.h
index dea97fc1286..fd9db7b1fd2 100644
--- a/source/blender/collada/GeometryExporter.h
+++ b/source/blender/collada/GeometryExporter.h
@@ -143,7 +143,7 @@ private:
const ExportSettings *export_settings;
- Mesh * get_mesh(Scene *sce, Object *ob, int apply_modifiers);
+ Mesh *get_mesh(Scene *sce, Object *ob, int apply_modifiers);
};
struct GeometryFunctor {
diff --git a/source/blender/collada/MeshImporter.cpp b/source/blender/collada/MeshImporter.cpp
index d121268d8d9..1f24010b04e 100644
--- a/source/blender/collada/MeshImporter.cpp
+++ b/source/blender/collada/MeshImporter.cpp
@@ -183,7 +183,7 @@ void VCOLDataWrapper::get_vcol(int v_index, MLoopCol *mloopcol)
case COLLADAFW::MeshVertexData::DATA_TYPE_FLOAT:
{
COLLADAFW::ArrayPrimitiveType<float> *values = mVData->getFloatValues();
- if (values->empty() || values->getCount() <= (v_index * stride + 2)) return; // xxx need to create an eror instead
+ if (values->empty() || values->getCount() <= (v_index * stride + 2)) return; // xxx need to create an error instead
mloopcol->r = unit_float_to_uchar_clamp((*values)[v_index * stride]);
mloopcol->g = unit_float_to_uchar_clamp((*values)[v_index * stride + 1]);
@@ -194,7 +194,7 @@ void VCOLDataWrapper::get_vcol(int v_index, MLoopCol *mloopcol)
case COLLADAFW::MeshVertexData::DATA_TYPE_DOUBLE:
{
COLLADAFW::ArrayPrimitiveType<double> *values = mVData->getDoubleValues();
- if (values->empty() || values->getCount() <= (v_index * stride + 2)) return; // xxx need to create an eror instead
+ if (values->empty() || values->getCount() <= (v_index * stride + 2)) return; // xxx need to create an error instead
mloopcol->r = unit_float_to_uchar_clamp((*values)[v_index * stride]);
mloopcol->g = unit_float_to_uchar_clamp((*values)[v_index * stride + 1]);
@@ -546,7 +546,7 @@ unsigned int MeshImporter::get_loose_edge_count(COLLADAFW::Mesh *mesh) {
}
// =================================================================
-// This functin is copied from source/blender/editors/mesh/mesh_data.c
+// This function is copied from source/blender/editors/mesh/mesh_data.c
//
// TODO: (As discussed with sergey-) :
// Maybe move this function to blenderkernel/intern/mesh.c
@@ -585,7 +585,7 @@ void MeshImporter::mesh_add_edges(Mesh *mesh, int len)
// =================================================================
// Read all loose edges.
// Important: This function assumes that all edges from existing
-// faces have allready been generated and added to me->medge
+// faces have already been generated and added to me->medge
// So this function MUST be called after read_faces() (see below)
// =================================================================
void MeshImporter::read_lines(COLLADAFW::Mesh *mesh, Mesh *me)
@@ -679,7 +679,7 @@ void MeshImporter::read_polys(COLLADAFW::Mesh *collada_mesh, Mesh *me)
unsigned int vertex_count = mp->getGroupedVerticesVertexCount(group_index);
for (unsigned int vertex_index = 0; vertex_index < vertex_count - 2; vertex_index++) {
- // For each triangle store indeces of its 3 vertices
+ // For each triangle store indices of its 3 vertices
unsigned int triangle_vertex_indices[3] = {first_vertex, position_indices[1], position_indices[2]};
set_poly_indices(mpoly, mloop, loop_index, triangle_vertex_indices, 3);
@@ -944,7 +944,7 @@ static bool bc_has_same_material_configuration(Object *ob1, Object *ob2)
/**
*
- * Caution here: This code assumes tha all materials are assigned to Object
+ * Caution here: This code assumes that all materials are assigned to Object
* and no material is assigned to Data.
* That is true right after the objects have been imported.
*
@@ -1078,7 +1078,7 @@ MTFace *MeshImporter::assign_material_to_geom(COLLADAFW::MaterialBinding cmateri
Material *ma = uid_material_map[ma_uid];
- // Attention! This temporaly assigns material to object on purpose!
+ // Attention! This temporarily assigns material to object on purpose!
// See note above.
ob->actcol=0;
assign_material(m_bmain, ob, ma, mat_index + 1, BKE_MAT_ASSIGN_OBJECT);
@@ -1138,7 +1138,7 @@ Object *MeshImporter::create_mesh_object(COLLADAFW::Node *node, COLLADAFW::Insta
{
const COLLADAFW::UniqueId *geom_uid = &geom->getInstanciatedObjectId();
- // check if node instanciates controller or geometry
+ // check if node instantiates controller or geometry
if (isController) {
geom_uid = armature_importer->get_geometry_uid(*geom_uid);
@@ -1241,7 +1241,7 @@ bool MeshImporter::write_geometry(const COLLADAFW::Geometry *geom)
// BKE_mesh_calc_edges(me, false, false);
// read_lines() must be called after the face edges have been generated.
- // Oterwise the loose edges will be silently deleted again.
+ // Otherwise the loose edges will be silently deleted again.
read_lines(mesh, me);
return true;
diff --git a/source/blender/collada/SceneExporter.cpp b/source/blender/collada/SceneExporter.cpp
index a0d1b6b5333..b571b7503d5 100644
--- a/source/blender/collada/SceneExporter.cpp
+++ b/source/blender/collada/SceneExporter.cpp
@@ -59,7 +59,7 @@ void SceneExporter::exportHierarchy(bContext *C, Scene *sce)
ob->id.tag |= LIB_TAG_DOIT;
}
- // Now find all exportable base ojects (highest in export hierarchy)
+ // Now find all exportable base objects (highest in export hierarchy)
for (node = this->export_settings->export_set; node; node = node->next) {
Object *ob = (Object *) node->link;
if (bc_is_base_node(this->export_settings->export_set, ob)) {
diff --git a/source/blender/collada/collada_utils.cpp b/source/blender/collada/collada_utils.cpp
index 07e2c834221..b25a35a5452 100644
--- a/source/blender/collada/collada_utils.cpp
+++ b/source/blender/collada/collada_utils.cpp
@@ -603,7 +603,7 @@ inline bool isInteger(const std::string & s)
{
if (s.empty() || ((!isdigit(s[0])) && (s[0] != '-') && (s[0] != '+'))) return false;
- char * p;
+ char *p;
strtol(s.c_str(), &p, 10);
return (*p == 0);
@@ -768,7 +768,7 @@ float bc_get_property(Bone *bone, std::string key, float def)
/**
* Read a custom bone property and convert to matrix
- * Return true if conversion was succesfull
+ * Return true if conversion was successful
*
* Return false if:
* - the property does not exist