Age | Commit message (Collapse) | Author |
|
|
|
|
|
This is an alternative method for fitting a curve which incrementally simplifies the curve, then re-fits.
Generally gives better results, also improves corner detection.
|
|
We need to leave tweak mode before trying to modifiy the action as doing
so will leave Blender in a semi-corrupted state.
Reviewers: #animation
Reviewed by: aligorith
Maniphest Tasks: T48397
Differential Revision: https://developer.blender.org/D2119
|
|
3D view
There was a misusage of the `outcol` and `texcol` params. The actual
formula should have been:
incol = facm * outcol + fact * ((one - outcol) * texcol * outcol +
outcol * scr);
To make sure the result is consistent with material mode, reuse the
material blend function (mix_soft), similarly to what most other texture
blend modes do.
|
|
|
|
|
|
Suspicious conditional found by PVS-Studio T48917
Original code (from Blender’s initial open-source commit!) looks like
it’s testing inputs to atan2f, to avoid undefined function values.
Passing xn=0 does *not* always evaluate to 0 though… I’m not sure if
this is a coding error or was done for a desired visual result.
Also changed xn==0 to xn>=0 to avoid function call in more cases.
Good description and visualization of atan2f function:
http://en.cppreference.com/w/c/numeric/math/atan2
|
|
|
|
Missing NULL checks caused crash in BKE_reportf formatting.
|
|
|
|
|
|
|
|
|
|
Redundant conditional (line 939) found with PVS-Studio T48917
There’s still a lot of true/false, 1/0, SELECT/DESELECT usage nearby.
Not a problem, just confusing to read.
|
|
Checking a condition right after we’ve checked it (and it hasn’t
changed). Most of these are trivial to understand.
split_quads in convertblender.c:
It seems quads should be processed and triangles should be marked as
not needing split. So I removed the outer vlr->v4 check.
Found with PVS-Studio T48917
|
|
Also resolves: T34294
|
|
Assigning within a conditional is confusing and error prone so I
rewrote in a more straightforward way.
Found with PVS-Studio T48917
|
|
Found with PVS-Studio T48917
|
|
Found with PVS-Studio T48917
|
|
Some of these check that dimensions match before running code that
assumes they do match.
For imb_stereo3d_write_anaglyph I *assume* this change reflects the
intended behavior. Before it was always grabbing alpha from buffer 0.
Found with PVS-Studio T48917
|
|
|
|
|
|
Check to ensure we do not delete last instancing of an indirectly used object (forbidden
because it creates 'ghost' objects user have no real way to re-instance) was defeated by
the backward pointer 'proxy_from', which generated a 'false' indirect usage of (local)
proxy object itself (the one we are trying to delete).
Fixed by actually considering that ID usage as local if proxy object itself is local
(because that pointer actually does not 'pertain' to the object holding it, but to its proxy).
Yeah, it's... complicated, twisted and ugly - it's proxy.
|
|
(A - A).norm() is always 0 so condition is always true.
(A - B).norm() and (B - A).norm() both compute the same distance so I
picked one to match surrounding code.
Found with PVS-Studio T48917
|
|
`ray_is_normalized` == true in DerivedMesh
|
|
|
|
|
|
I don’t think any other codec enum makes sense here, so probably just
an extra copy/paste. Here are the video codecs:
AV_CODEC_ID_NONE
AV_CODEC_ID_MPEG4
AV_CODEC_ID_MJPEG
AV_CODEC_ID_DNXHD
AV_CODEC_ID_MPEG2VIDEO
AV_CODEC_ID_MPEG1VIDEO
AV_CODEC_ID_DVVIDEO
AV_CODEC_ID_THEORA
AV_CODEC_ID_PNG <— alpha
AV_CODEC_ID_QTRLE <— alpha
AV_CODEC_ID_FFV1 <— alpha (if enabled)
AV_CODEC_ID_HUFFYUV <— alpha
AV_CODEC_ID_H264
AV_CODEC_ID_FLV1
Found with PVS-Studio T48917
|
|
Also renamed BKE_mesh_calc_islands_loop_poly_uv to BKE_mesh_calc_islands_loop_poly_edgeseam,
to avoid confusion...
|
|
Maps edges to all their pair of loops.
|
|
|
|
|
|
This is really not elegant solution, but simplest for now.
Ideally, we'd check all IDs first and directly 'make local' (without need to copy)
those only indirectly used by other datablocks to be made local. Would also save us from the
need of the extra 'lib_local' parameter recently added to id_make_local.
Current code seems to work well enough though, and this is not high priority to fix imho.
|
|
Those bone pointers in object's pose bite again - turns out they can be accessed
before pose actually gets rebuilt in some cases (e.g. from undo writefile), so
we need to clear the pointers immediately.
|
|
Adding make_local for vfont/gpencil/group/freestyle linestyle/mask/scene/sound/text.
Note that there are still some lose ends here, since some type are not handled by id_copy
(Scene, Sound and VFont), which means in case a datablock of that type is used both
directly and indirectly, localization will fail.
Scene copying might be doable though (maybe with a simple new 'full shalow' mode to existing BKE_scene_copy?),
not sure about sounds and vfonts... Situations where this becomes an issue should be very rare corner cases anyway.
|
|
id_make_local and later remapping are supposed to handle that already,
and in a much much saner and more complete way.
|
|
Turns out most BKE_foo_make_local datablock-specific functions are actually doing
exactly the same thing, only two currently need special additional operations
(object and brush ones). So added a BKE_id_make_local_generic instead
of copying same code over and over.
Also, changed a bit how make_local works in case we are localizing a whole library.
We need to do the 'remap' step (from old linked ID to new local one) in the second loop,
otherwise we miss some dependencies. This fixes main part of T48907.
|
|
|
|
Mainly the changes are related on establishing API to feed UV islands
to OpenSubdiv, so it will know all the connectivity information and
will be able to do proper interpolation.
Island calculation is currently rather slow, not sure how to make it
fast and not use lots of allocations.
Shouldn't be THAT bad, since this code is only runs once when creating
OSD mesh, and it's probably still faster than our orientation code.
|
|
|
|
|
|
|
|
|
|
|
|
Also remove unused 'material_from' function (which isn't very useful).
|
|
BKE_mesh_new_from_object.
Don't know why this was ever added to start with, BKE_mesh_new_from_object shall never affect ob->data!
|
|
Note that issue has several levels here actually, first one was metaball's materials
not being properly copied into new mesh (code was commented out because of some crash it
seems, made it a bit closer to mesh one and got no crash at all...).
Then, we were calling test_object_materials when ob->data is actually *not* new tmpmesh!
Will remove this call completely in next commit (to make it easier to bisect), I cannot see
any case where object would be assigned with newly generated tmpmesh in this func.
|
|
|
|
A bit work in progress, currently the following limitations:
- Texture shading only, Material shading will come later
- No UVs subdivision yet
- Always uses active UV and currently changing active UV will
not properly update the viewport.
Well, need to start somewhere :)
|