Commit Graph

10569 Commits

Author SHA1 Message Date
Campbell Barton a15b3c4d11 Code cleanup: use bool 2014-04-11 11:33:29 +10:00
Campbell Barton 7cdaf56b30 Dyntopo: use hidden face flags in more places 2014-04-11 07:51:14 +10:00
Antony Riakiotakis 6292b60a3f Dyntopo: Minor display optimization.
While hiding, flush the hidden flags to the faces. This avoids iterating
through all the loops while updating the GPU buffers.
2014-04-10 22:31:39 +03:00
Sergey Sharybin df63e8fd93 Speedup track preview widget for byte images
This gives a huge speedup gain for cases when you've got
rather huge markers on a byte images.

Done by skipping IMB_float_from_rect()/IMB_rect_from_float()
for such cases. We can sample the buffers without color space
conversion.
2014-04-10 21:14:36 +06:00
Campbell Barton 9b60174e75 BMesh: DM_to_bmesh_ex, no need to calloc 2014-04-10 11:35:17 +10:00
Campbell Barton 82628a6b0e Code cleanup: use struct type for mempool & style edits 2014-04-10 06:49:25 +10:00
Antony Riakiotakis 1c811d96b2 Make material array account for mesh/object storage of materials 2014-04-09 18:37:54 +03:00
Campbell Barton 9de24c82ba View3D: disable LOD when game engine is disabled or ifdef'd 2014-04-09 11:52:34 +10:00
Antony Riakiotakis b5d3f183b0 Add material storage to derivedmesh.
The variables are considered invalid unless DM_update_materials is
called prior to use. Only use case currently is
mesh drawing. This helps with excessive allocation on the stack during
GPUObject creation, but may help elsewhere in the future as well.
2014-04-09 04:03:44 +03:00
Campbell Barton ebaf3781fa Dyntopo: replace GHash with GSet, saves some memory 2014-04-08 14:45:48 +10:00
Campbell Barton 593b698b44 DerivedMesh: replace edgehash with edgeset 2014-04-08 14:45:04 +10:00
Campbell Barton 412826a504 Mempool: delay allocating an initial chunk, its not always used 2014-04-08 12:58:56 +10:00
Campbell Barton 1e6d2b1dbf Code cleanup: remove paranoid NULL check 2014-04-08 07:46:28 +10:00
Campbell Barton c61eb64f06 Fix T39635: Crash convening curve to mesh 2014-04-08 07:41:38 +10:00
Bastien Montagne 6eb20ca048 Fix own broken rB95b25e7333c4 (crash on any undo op :/).
Issue here was that buttons_texture_context_compute() was getting scene from (button-customized) context,
before the button paths (and hence, context) had been updated. So after an undo, it was getting an invalid
(freed by undo) scene pointer.

Now update BCONTEXT_SCENE path before calling buttons_texture_context_compute().
2014-04-07 17:17:40 +02:00
Campbell Barton ea01b24bba Fix T39623: deleting an object crashes 2014-04-07 20:25:52 +10:00
Bastien Montagne 95b25e7333 Fix T39562: Properties panel Pinning is broken
'scene' was simply not handled in button context.
2014-04-07 12:23:24 +02:00
Bastien Montagne 8714ae09f8 Fix T39563: Tiny unit-display problem in constraint panels.
There is no good solution here, since RNA props can only have one type/unit.
Tried to find the less worse one - have different RNA props for same DNA value
(a bit like the angle/length for camera lens).

Also fixed two other issues with Transform conctraint:
* Angle were still in degrees (yes, another backward-compatibility breacking).
* Scale was absolute, unlike loc/rot.

Also cleaned up a bit the code, replaced some magic numbers by proper enums, ...
2014-04-07 12:17:01 +02:00
Campbell Barton b95e826841 Code cleanup: remove unused functions and convert int -> bool 2014-04-07 17:00:08 +10:00
Campbell Barton 2527d0ce8f Dyntopo: minor speedups with bmesh use. 2014-04-07 13:48:36 +10:00
Campbell Barton 212717416b Dyntopo: avoid mask layer lookups while adding/removing verts 2014-04-07 13:05:39 +10:00
Bastien Montagne 07f8c5c3b6 Better code for (bone axis + roll) to mat
See T39470 and D436. Code by @tippisum, with some minor edits by @mont29.

Tested with various rigs, including Rigify, CGcookie flex rig, and gooseberry/pataz caterpillar.

Riggers, please test it, no change expected in behaviour.

Reviewers: aligorith

CC: tippisum

Differential Revision: https://developer.blender.org/D436
2014-04-06 19:15:50 +02:00
Campbell Barton 1e504bc123 Dyntopo: minor optimizations for edge queue 2014-04-05 16:30:55 +11:00
Campbell Barton 61c73b49d3 Remove redundant call to CustomData_get_offset 2014-04-05 12:32:25 +11:00
Campbell Barton af59ee340f Mempool: remove BLI_MEMPOOL_SYSMALLOC, MEM_* allocs are more efficient now 2014-04-05 12:14:05 +11:00
Antony Riakiotakis 321c35ec6c Solve issue with dyntopo collapse.
It was possible to delete a masked vertex during collapsing. Looks like
this is one of the causes for hangs during masked flood filling.
2014-04-05 02:31:36 +03:00
Sergey Sharybin 71a2ff12a8 Fix crash happening in DAG_pose_sort() due to threading issues
This function used ugly hack with static variable which was
preventing some type checks in DAG nodes. Using this variable
form multiple threads is not considered safe, apparently.

Solved by moving this variable inside the DAGForest structure.
so it's global for the graph now, but different graphs does not
run into conflicts.

This required passing the forest to some functions, which doesn't
look so much nice, but don't want to spend time on making this
code look beautiful because it is really to be replaced by the
new dependency graph.

This is really bad bug actually which is must go to 'a'.
2014-04-04 12:46:08 +06:00
Campbell Barton 45b02cee47 Code cleanup: no need to use calloc when memory is initialized after
also replace AT with __func__ since AT expands the full pathname
2014-04-04 14:26:01 +11:00
Campbell Barton 2bba04f1b0 Cloth: replace EdgeHash with EdgeSet 2014-04-04 14:15:57 +11:00
Campbell Barton f38331adef Code cleanup: style 2014-04-03 09:24:09 +11:00
Antony Riakiotakis 03bd418d16 Fix T39517,
Issue here is that "show diffuse" option does not respect its intended
purpose which is to be used only for masking.

There are a couple of caveats here:

Dyntopo and multires -always- have mask data enabled, and thus as soon
as one goes to dyntopo mode or adds a multires modifier he would get the
default grey color instead.

Matcaps would break when nodes asked for a diffuse material color (this
was broken before too). Solved by adding global material state for when
matcaps are enabled. Also matcaps don't always played well with VBOs
off.

Added a few more missing updates for mask operators to notify
show_diffuse property as changed. This was also needed on rebuilding
dyntopo pbvh.

Also make zero mask color duller again after artist feedback.
2014-04-03 00:39:42 +03:00
Antony Riakiotakis 8c730b1059 Fix T39520, show diffuse not working in dyntopo.
Was marked as a todo in the code.

This does not yet take care of correct display for multi material
meshes, since it would need correct separation of faces during pbvh
creation. Instead we just take material of first face in node and assume
that the rest faces have the same. This will create some funky effects
if one attempts to sculpt in this way.

Note: This does not yet address T39517
2014-04-02 18:56:19 +03:00
Bastien Montagne 4faef1e10c Add drag-resize to uiTemplatePreview (mat/tex/etc. preview widget).
This is done by adding a new button type, GRIP, similar to other numbuttons
(scroll, slider, ...), which here controls the preview height.

Then, we add a new DNA struct to be able to save that height in Blend files
(note I choose not to use Panel struct for this, because we would then have the
same limitation we used to have with uiLists, only one preview per panel
and no preview outside panel).

This implies a change to template_preview UI RNA/py API (each preview needs an ID),
but this is backward compatible, as by default datablock type will be used if no ID is
given (which means e.g. all material previews with no ID will have same height).

Reviewers: brecht

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D342
2014-04-02 13:03:11 +02:00
Sergey Sharybin 11ee2d8b97 implement cache line for image editor
It works exactly the same as a cache line in movie clip editor.
2014-04-02 16:54:30 +06:00
Bastien Montagne 35747ee3d5 Rename "BLI_cpu.h" to "BLI_system.h" and add to it BLI_getpid() helper.
There is not much sense to have a whole BLI file just to check SSE2 on CPUs...
So idea is to rename it to more generic "BLI_system", and add to it more system-related
utils, like e.g. an include helper for getpid(), which allows to hide unix/windows
internals from rest of the code...

Reviewers: campbellbarton

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D439
2014-04-02 11:59:43 +02:00
Kevin Dietrich cb7cfd3ab6 Cycles: add dedicated UV Map node, easier to find and has convenient auto complete.
Fixes T37954.

Reviewed By: brecht, dingto

Differential Revision: https://developer.blender.org/D230
2014-04-02 11:53:44 +02:00
Sergey Sharybin eed3974d11 Fix T39545: "Track selected markers", does not stop at end of video
Issue was cauzed by some weird clamping of current frame. Not sure
why it was here at the first point -- it's from the day0 of movie
clip datablock.
2014-04-02 14:11:35 +06:00
Antony Riakiotakis 7c513f5913 Fix some redrawing and possibly other issues in dyntopo:
When node face gets deleted, added or exchanged, the nodes should update
their draw buffers, normals and bounding boxes. This was not being done
before so there were graphical glitches apparent, especially in collapse
mode.
2014-04-02 00:57:33 +03:00
Antony Riakiotakis 3ed49a810d Make matcaps suck less
This commit does various changes for matcaps:

One is taking advantage of drawing with pbvh (which would only happen
with dyntopo previously) and drawing with partial redraw during
sculpting.

The second one is support for masks. To make this work in the special
case of multires, which uses flat shading, I use the only available flat
shaded builtins in OpenGL 2.0 which are color and secondary color.

Abusing colors in that way is also essential for flat shading to work if
we are to use pbvh draw in multires, since it is the color that is being
interpolated flatly, not the normal (which can only interpolated
smoothly). The pbvh drawing code for multires used last triangle
element's normal to compute the shading which would only produce smooth
results. This could change if we did the shading in the vertex shader
for flat shaded primitives, but this is more complex and makes it harder
to have one shader to rule the mole.

Also increased the brightness of the default diffuse color for
sculpting. This should be useful since artists like to tweak the
lighting settings and it will give them the full dynamic range of the
lights, but also it helps with correct brightness of sculpted matcaps.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D435
2014-04-01 19:27:13 +03:00
Campbell Barton 617557b08e Code cleanup: remove TRUE/FALSE & WITH_BOOL_COMPAT define 2014-04-01 15:22:28 +11:00
Campbell Barton 90b94fdce5 Fix for leak in BKE_sequence_sound_init 2014-04-01 08:44:00 +11:00
Campbell Barton d25ba1eccd Changes to openmp threads commit (UI and RNA)
- use same names as render threads
- remove OpenMP from UI
- remove details from tips
2014-04-01 08:30:24 +11:00
Bastien Montagne a5be03b270 Fix deffects reported by CoverityScan (nothing dramatic, but at least one was a (minor) bug). 2014-03-31 16:42:15 +02:00
Joshua Leung b37dc6a8bd Fix T39291: "Stepped" F-curve modifier does not work as expected when stacked after other modifiers
Evaluation of time-warping modifiers ("Stepped" is one of them) didn't actually
end up distorting the time to look up what values other modifiers in the stack
generate. This meant that when a "stepped" fmodifier was on top of a "generator",
the stepped fmodifier looked like it didn't have any effect.

(This fix requires a bit of testing still, so should be left for 2.71)
2014-04-01 01:54:40 +13:00
Jens Verwiebe 49ca3fdf16 Fix compile due forgot remove BKE_scene_omp_threads_update from patch 2014-03-31 14:53:30 +02:00
Campbell Barton 097a3756c0 Code cleanup: use bool 2014-03-31 23:39:08 +11:00
Sergey Sharybin dc9f4f53c0 Didn't meant to commit debug-only-code in the previous commit! 2014-03-31 18:02:46 +06:00
Sergey Sharybin a64bcc1037 Code cleanup: use bool/true/false in movieclip.c 2014-03-31 18:01:35 +06:00
Jens Verwiebe 277fb1a31f Sculpt/dyntopo: Make the omp threads configurable to overcome performance issues
- autodetect optimal default, which typically avoids HT threads
- can store setting in .blend per scene
- this does not touch general omp max threads, due i found other areas where the calculations are fitting for huge corecount
- Intel notes, some of the older generation processors with HyperThreading would not provide significant performance boost for FPU intensive applications. On those systems you might want to set OMP_NUM_THREADS = total number of cores (not total number of hardware theads).
2014-03-31 13:51:49 +02:00
Sergey Sharybin a9b82244de Code cleanup: fixes for function prototypes 2014-03-31 17:35:56 +06:00