Implementation of T71948
Implementation of T71948
Split this function in two separate functions. We only call displacement or rotation at a single time.
add const where needed. (this needs to be done for the whole patch). adding more keywords makes code more readable.
remove the i_ and just use a different name for the local copy.
use lowercase names for function names. Except when indicating a module public function
is val modified at all or is this to fix potential threading issues?
Possible index out of bound
Don't use char
unneeded quat_to_mat4 writes a complete mat4
unneeded float conversion. better to let the compiler decide. Not sure if FIDIV instruction will be selected by all compilers :-)
Can we use .orig directly and not use the tmp variable.
add TODO(pdobarro): if something is a todo item
put pose_ik_chain_len and pose_ik_chain in a PoseIKChain struct.
Add a description
Think we are almost done, just some small clean up/code readability.
This is codewise not part of the enum, You could add it as a static const.
the flip_qt_qt uses ePaintSymmetryFlags we should clean up replace all const char symm parameters with a const ePaintSymmetryFlags symm.
don't use char
Doesn't need to be casted to char.
unneeded cast to char in this function. Would it make sense to change int i to ePaintSymmetryAreas symm. Or convert the i inside the brackets to ePaintSymmetryAreas symm.
The problem with casting to char is that when we want to add more stuff to the ePaintSymmetryAreas, the char might trigger undesired results that are hard to track.
[422/799] Building C object source/blender/editors/sculpt_paint/CMakeFiles/bf_editor_sculpt_paint.dir/sculpt.c.o /home/jeroen/blender-git/blender/source/blender/editors/sculpt_paint/sculpt.c: In function ‘sculpt_pose_ik_chain_init’: /home/jeroen/blender-git/blender/source/blender/editors/sculpt_paint/sculpt.c:4092:64: warning: passing argument 3 of ‘sculpt_nearest_vertex_get’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] int nearest_vertex_index = sculpt_nearest_vertex_get(sd, ob, initial_location, FLT_MAX, true); ^~~~~~~~~~~~~~~~ /home/jeroen/blender-git/blender/source/blender/editors/sculpt_paint/sculpt.c:445:12: note: expected ‘float *’ but argument is of type ‘const float *’ static int sculpt_nearest_vertex_get( ^~~~~~~~~~~~~~~~~~~~~~~~~
I see this variable, but still a few calls to the same function. Could that be improved?
I got a segmentation error here. weights are not always initialized. Root cause: br->pose_ik_segments == 0
Yes you fixed the crash, but not the root cause :-)
when starting blender the pose brush is set to 0 segments. Check with --factory-startup fixing this should be the right solution.
this code seems not be correct. When starting blender with a factory settings the pose brush still has 0 pose_ik_segments
this seems to be a patch, not a fix. pose_ik_segments must never be zero.
Is this change part of this patch or should it be added to a different patch?
At this point it is not clear why .weights isn't freed.
this should never happen, so could be removed?
These properties are needed for this patch. pose_smooth_iterations was introduced in a previous patch, but I think it was accidentally removed in the refactor.
I did see some additional changes were added to this patch that also seemed to be unrelated (alpha of the add_col and sub_col). best to add that to a separate patch.
Error: Not freed memory blocks: 3, total unfreed memory 0.007507 MB Pose IK Chain len: 16 0x7f13402ec728 Pose IK Chain Segments len: 1616 0x7f133fbf4338 Pose IK weights len: 2304 0x7f1338499e38
If we can fix this it is good to commit.