Commit Graph

864 Commits

Author SHA1 Message Date
2ebe4f69a9 Compilation error fix and strict warning silence for previous commits 2014-01-13 16:33:18 +06:00
a8b3abc7fc Remove direct lattice modifiers calc from the drawing code
Same as mballs and curves it was only to work around DAG stupidness
which hopefully was fixed in one of the previous commits.

From quick tests everything works fine, if something is broken now
poke me to find a proper solution.
2014-01-13 16:29:07 +06:00
b82cce04d6 Remove direct mball creation from the drawing code
This is the same case as curves, and really this is now
totally up to DAG, If something fails, poke me to fix the DAG.
2014-01-13 16:18:08 +06:00
ba15dd595f Remove direct displist creation from drawing code
It was some kind of workaround for DAG glitch in 2009
(commit hash 8c5c7ebb0) and according to the comment
was needed to make select outline show immediately.

After some tests it appears DAG behaves almost fine now
(just needed to make it so layer is flushed properly to
the set scene) and no reason to have rather confusing
call in the code.
2014-01-13 15:57:50 +06:00
fc39e895e9 Style Cleanup: whitespace 2014-01-12 22:27:55 +11:00
4a372102c7 Text3d: move text selection boxes from Curve to EditFont struct
resolves T38079
2014-01-07 17:12:24 +11:00
99d050f88b Text3d: selection in editmode now follows rotated text along path 2014-01-05 22:20:33 +11:00
d94202b312 Fix T37170: Missing curve outline when using constructive modifiers
Issue was caused by wrong bool flag assignment.
2014-01-02 22:59:21 +06:00
709041ed0b Threaded object update and EvaluationContext
Summary:
Made objects update happening from multiple threads. It is a task-based
scheduling system which uses current dependency graph for spawning new
tasks. This means threading happens on object level, but the system is
flexible enough for higher granularity.

Technical details:

- Uses task scheduler which was recently committed to trunk
  (that one which Brecht ported from Cycles).

- Added two utility functions to dependency graph:
  * DAG_threaded_update_begin, which is called to  initialize threaded
    objects update. It will also schedule root DAG node to the queue,
    hence starting evaluation process.

    Initialization will calculate how much parents are to be evaluation
    before current DAG node can be scheduled. This value is used by task
    threads for faster detecting which nodes might be scheduled.

  * DAG_threaded_update_handle_node_updated which is  called from task
    thread function when node was fully handled.

	This function decreases num_pending_parents of node children and
	schedules children with zero valency.

    As it might have become clear, task thread receives DAG nodes and
    decides which callback to call for it.

    Currently only BKE_object_handle_update is called for object nodes.

    In the future it'll call node->callback() from Ali's new DAG.

- This required adding some workarounds to the render pipeline.
  Mainly to stop using get_object_dm() from modifiers' apply callback.
  Such a call was only a workaround for dependency graph glitch when
  rendering scene with, say, boolean modifiers before displaying
  this scene.

  Such change moves workaround from one place to another, so overall
  hackentropy remains the same.

- Added paradigm of EvaluaitonContext. Currently it's more like just a
  more reliable replacement for G.is_rendering which fails in some
  circumstances.

  Future idea of this context is to also store all the local data needed
  for objects evaluation such as local time, Copy-on-Write data and so.

  There're two types of EvaluationContext:

  * Context used for viewport updated and owned by Main. In the future
    this context might be easily moved to Window or Screen to allo
    per-window/per-screen local time.

  * Context used by render engines to evaluate objects for render purposes.
    Render engine is an owner of this context.

  This context is passed to all object update routines.

Reviewers: brecht, campbellbarton

Reviewed By: brecht

CC: lukastoenne

Differential Revision: https://developer.blender.org/D94
2013-12-26 17:24:42 +06:00
07ebe89364 Missed this in last commit 2013-12-25 19:25:46 +01:00
1fef90695e 3D View: Draw rigid body collision shapes. 2013-12-25 19:17:00 +01:00
c15062015c 3D View: Fix drawing bounds for game engine
Needs to be drawn around the origin to accurately represent collision
shapes.
2013-12-25 19:17:00 +01:00
e9e08a1d12 Game Engine: Level of detail support and tools
Levels of detail can be added and modified in the object panel. The object
panel also contains new tools for generating levels of detail, setting up
levels of detail based on object names (useful for importing), and
clearing an object's level of detail settings. This is meant as a game
engine feature, though the level of details settings can be previewed in
the viewport.

Reviewed By: moguri, nexyon, brecht

Differential Revision: http://developer.blender.org/D109
2013-12-17 17:03:27 -08:00
90e7be4710 Fix T37727: z-offset problems with camera view 2013-12-09 21:20:08 +11:00
46eef60d93 Cleanup: Internal degrees removal.
This patch changes most of the reamining degrees usage in internal code into radians.
I let a few which I know off asside, for reasons explained below - and I'm not sure to have found out all of them.

WARNING: this introduces forward incompatibility, which means files saved from this version won't open 100% correctly
         in previous versions (a few angle properties would use radians values as degrees...).

Details:
- Data:
-- Lamp.spotsize: Game engine exposed this setting in degrees, to not break the API here I kept it as such
                  (using getter/setter functions), still using radians internally.
-- Mesh.smoothresh: Didn't touch to this one, as we will hopefully replace it completely by loop normals currently in dev.

- Modifiers:
-- EdgeSplitModifierData.split_angle, BevelModifierData.bevel_angle: Done.

- Postprocessing:
-- WipeVars.angle (sequencer's effect), NodeBokehImage.angle, NodeBoxMask.rotation, NodeEllipseMask.rotation: Done.

- BGE:
-- bConstraintActuator: Orientation type done (the minloc[0] & maxloc[0] cases). Did not touch to 'limit location' type,
                        it can also limit rotation, but it exposes through RNA the same limit_min/limit_max, which hence
                        can be either distance or angle values, depending on the mode. Will leave this to BGE team.
-- bSoundActuator.cone_outer_angle_3d, bSoundActuator.cone_inner_angle_3d: Done (note I kept degrees in BGE itself,
                                                                           as it seems this is the expected value here...).
-- bRadarSensor.angle: Done.

Reviewers: brecht, campbellbarton, sergey, gaiaclary, dfelinto, moguri, jbakker, lukastoenne, howardt

Reviewed By: brecht, campbellbarton, sergey, gaiaclary, moguri, jbakker, lukastoenne, howardt
Thanks to all!

Differential Revision: http://developer.blender.org/D59
2013-12-03 20:35:45 +01:00
1decd824f3 Code Cleanup: use math functions and reduce View3d axis drawing into a loop 2013-11-24 21:26:16 +11:00
044a342ecb Fix a wrong check ls == NULL || lb->first == NULL 2013-11-21 19:11:24 +06:00
ea79dcebe2 Fix T37468: image empties now use no interpolation when mipmaps are disabled.
Image empties don't actually support mipmaps right now, but the user preference
doubles as a way to disable any kind of interpolating in texture filter and just
show nearest neighbour filter, so for this is a bit more consistent.
2013-11-18 11:26:37 +01:00
5ef717bec6 [#37327] Inconsistent numeric input conversion.
Issue was actually that micrometer was not drawing correctly (from r58165), reverted that fix and instead use utf8 drawing for editmode metrics when using a unit system (we already had a similar hack for surfaces and volumes, anyway).
2013-11-08 11:25:50 +00:00
c215faf9f4 Fix [#37319] Forcefield on translated, unselected lamp draws in origin.
drawlamp() was not resetting OGL matrix to its org value!

Thanks to Philipp Oeser for initial investigation, and Brecht for review. :)
2013-11-05 15:53:55 +00:00
f0780904bc correct error in recent commit. 2013-10-28 23:35:25 +00:00
3264461598 move bmesh array lookup data and utility functions from editmesh into bmesh,
since enough bmesh operations can also take advantage of direct index lookups on verts/edges/faces.

developers note:
- EDBM_index_arrays_init/ensure/free -> BM_mesh_elem_table_ensure/init/free
- EDBM_vert/edge/face_at_index -> BM_vert/edge/face_at_index
- EDBM_uv_element_map_create/free -> BM_uv_element_map_create/free
- ED_uv_element_get -> BM_uv_element_get
2013-10-28 02:05:33 +00:00
7f9cdae280 fix for outline width theme option being ignored for non mesh object types. 2013-10-26 02:14:07 +00:00
4514eeaa8e drawobject: Fix sphere bounds drawing
Would draw ellipsoid instead, which is not so useful and wrong when 
used for rigid body collision shape visualization.

svn merge -r59887:59888 ^/branches/soc-2013-rigid_body_sim
2013-10-25 02:20:23 +00:00
304a32bf1f style cleanup 2013-10-23 02:52:27 +00:00
34cd28d283 Partial fix for [#37159] Particle Emitter set to not render still appears in 3D view, when display set to rendered only. Emitter also appears in all GL Renders and some F12 renders.
Fixed OpenGL part: in draw_object, when object has some particle systems and none of them render the emitter, and display option is set to show only rendered objects, skip this object.

Note: Cycles matter I did not investigate, looks like a render-engine issue.
2013-10-21 15:44:09 +00:00
b6db417ee4 code cleanup: use const's for vector args. 2013-10-12 02:19:37 +00:00
07306c5f9c Fix #36718: Wrong lighting on text objects
In fact, all curve objects were flipped in GLSL mode.
This is because of the way how normals are calculated
for them (inwards vs. outwards).

We might want to make normals consistent all over, but
that would be the bigger change. For ow just made some
tweaks to OpenGL setup.

Thanks Brecht for the review and tests!
2013-09-17 14:20:00 +00:00
1bbc432ead Fix #36356: faces not drawn with constructive modifier + dynamic paint, where it
overrides material colors with dynamic paint colors.
2013-09-09 20:46:43 +00:00
ea94411db6 Enable vertex snapping to bundle positions
This means it's possible now to snap stuff to
reconstructed tracks positions.
2013-09-09 11:37:37 +00:00
1ff96dc6c9 Don't check for an object mode that is excluded as a prerequisite for
entering this branch of code.
2013-08-26 14:58:16 +00:00
4800d7fc34 Remove dirty normals assert from drawobject.c
Dirty normals already being checked in DerivedMesh.c,
and this things really rather be localized in one
single place than being checked all over the code.
2013-08-26 14:53:33 +00:00
3a73f635c2 Fix #36441: opengl render of smoke wrong after regular render with blender internal.
Object.imat isn't always the inverse of Object.obmat, needs to be set before usage
as mentioned in DNA_object_types.h.

Thanks to Miika for tracking down the cause of this bug.
2013-08-23 22:57:29 +00:00
785a67f396 Partial revert of recenr cu->disp merge commit
That ended up in tricky code trying to mimic depsgraph
branch behavior API-wise preserving texspace and bound
box calculation compatible with previous releases.

So for now bring cu->disp back to the trunk but keep
texpsace and boundbox APIs the same as in the branch.

This keeps texpsapce and boundbox behavior fully compatible
with previous releases and still makes API the same as
for meshes.
2013-08-21 07:40:19 +00:00
f6b13c83ab correct NULL pointer dereference with recent displist changes. 2013-08-21 02:30:19 +00:00
c46cbc602e Make lattice deform safe for threading
Lattice deformation used to store some runtime data
inside of lattice datablock itself. It's something
which is REALLY bad. Ideally DNA shouldn't contain
and runtime data.

For now solved it in a way that initialization of
lattice deform will create a structure which contains
lattice object for which deformation is calculating
and that runtime data which used to be stored in
lattice datablock itself.

It works really fine for mesh deform modifier, but
there's still runtime data stored in particle system
DNA, It didn't look something easy to be solved, so
leaving this as-is for now.

--
svn merge -r58277:58278 -r58795:58796 ^/branches/soc-2013-depsgraph_mt
2013-08-19 10:11:48 +00:00
527ddb0a5b Move bevel list and path from Curve to Object datablock
I know this is not so much nice to have this guys hanging
around in a general Object datablock and ideally they better
be wrapped around into a structure like DerivedMesh or
something like this. But this is pure runtime only stuff and
we could re-wrap them around later.

Main purpose of this is making curves more thread safe,
so no separate threads will ever start freeing the same path
or the same bevel list.

It also makes sense because path and bevel shall include
deformation coming from modifiers which are applying on
pre-tesselation point and different objects could have
different set of modifiers. This used to be really confusing
in the past and now data which depends on object is stored
in an object, making things clear for understanding even.

This doesn't make curve code fully thread-safe due to
pre-tesselation modifiers still modifies actual nurbs and
lock is still needed in makeDispListsCurveTypes, but this
change makes usage of paths safe for threading.

Once modifiers will stop modifying actual nurbs, curves
will be fully safe for threading.

Actually, this commit also contains wrapping runtime curve
members into own structure

This allows easier assignment on file loading, keeps curve-
specific runtime data grouped and saves couple of bytes in
Object for non-curve types.

--
svn merge -r57938:57939 ^/branches/soc-2013-depsgraph_mt
svn merge -r57957:57958^/branches/soc-2013-depsgraph_mt
2013-08-19 09:25:24 +00:00
2acf0a1354 Always use ob->bb when drawing the curve types
It used to be a check for ob->bb ? ob->bb : cu->bb but
in fact it doesn't make sense and only makes code more
crappy.

Making displist for mballs and curves/surfaces/fonts
already ensures object has walid bounding box.

--
svn merge -r57938:57939 ^/branches/soc-2013-depsgraph_mt
2013-08-19 09:07:09 +00:00
98c574e41a use 'greater/less then or equal to' operators rather then adding 1. 2013-08-11 05:40:35 +00:00
81acaf5f15 quiet double-promotion warnings, change octree.cpp to use a float (vector accumulated into a float anyway) 2013-08-06 06:38:52 +00:00
8052bf0ec2 add missing NULL checks from BKE_constraint_get_typeinfo(), so constraints from the future dont crash.
also remove some redundant NULL checks.
2013-08-03 22:03:15 +00:00
ceaec3c86a Fix [#36265]: Smoke doesn't work if domain object has negative scale. 2013-08-01 12:09:12 +00:00
6864f2c285 move suspicious break statement in drawDispListsolid() to prevent falling through. 2013-07-28 11:15:26 +00:00
b7bf20d950 optimization: only calculate the normals for passing into derivedMesh foreachMappedVert/foreachMappedFaceCenter when needed,
this means in editmode with wire draw, face and vertex normals don't have to be calculated at all.

in most cases the normals are not used so add a flag that makes calculating them only for functions that need them.
also fix face normal calculation for CDDM, was using quad calculation for ngons too.
2013-07-22 22:59:47 +00:00
1b85328545 hidden-wire draw option: always use the cage when masking out faces otherwise modifiers give odd results. 2013-07-22 21:45:01 +00:00
177ea51fab fix for unintended fall-through in switch statement, also reduce undo_pos increments in text editor. 2013-07-21 08:34:02 +00:00
7db1d6556d code cleanup: add break statements in switch ()'s, (even at the last case). 2013-07-21 08:16:37 +00:00
32f3771d0b hidden wireframe option for mesh editmode, important for retopology mode (can be used with xray). 2013-07-20 03:51:49 +00:00
3c4c2478b6 fix for own regression, face index ranges still need checking in some places. 2013-07-14 23:41:33 +00:00
aabddad346 draw loopcut display on the deformed mesh when in editmode. 2013-07-10 02:05:16 +00:00