Commit Graph

881 Commits

Author SHA1 Message Date
2dd2bcf2de Fix/workarond for scenes rendered for sequencer preview
This is really a workaround which brings back direct display
list creation from drawing code. This is rather nasty to do
but proper solution would require some major sequencer redesign.
2014-02-12 14:06:13 +06:00
38e58612ef Revert own previous commit rBe2f9afbaabbd.
The "Cast Shadows" worked as expected, but it can cause problem in some cases.
For example, when using strand render, we need disabling only buffer shadows,
but the previous changes made that impossible. "Cast Shadows" should be added
as a newly created option.
2014-02-12 05:46:26 +09:00
e2f9afbaab Blender Internal: Modify material property "Cast Buffer Shadows" to affect ray shadows also, and rename it to "Cast Shadows".
This allows us to make materials that don't cast ray shadows.
Turning off this property can reduce the rendering time slightly.

Note: RNA path is changed to "use_cast_shadows" as well. The older
path "use_cast_buffer_shadows" still can be used as its alias, but
it will be removed after updating some addons.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D272
2014-02-11 17:06:21 +09:00
b3afbcab8f ListBase API: add utility api funcs for clearing and checking empty 2014-02-08 06:24:05 +11:00
39ad2cd8f8 Fix lamps drawing only partially in OpenGL render.
It should draw lamps entirely, this happened due to hack to hide object centers.
2014-02-05 22:14:25 +01:00
6a4f2fd552 Fix T35810: Texture faces display white in 3D view, when used as a Particle Object
This in fact seems some kind of video driver limitation, because it worked fine
on windows but failed on linux here. The guess is that textures doesn't always
work on display lists, or we simply do have some wrong OGL context somewhere.

This is a workaround for until bigger viewport draw refactor is done (as Brecht
mentioned display lists are deprecated in new OGL anyway).
2014-02-05 23:46:01 +06:00
d900f5be55 Code cleanup: use bools where possible 2014-02-03 19:35:44 +11:00
d34d7451a9 Viewport Drawing: apply matcaps to all objects 2014-01-29 03:39:19 +11:00
90ff9d7dca Code cleanup: remove check for painting non-mesh objects (its impossible) 2014-01-29 03:38:07 +11:00
a5c35fb27f Code cleanup: use booleans where appropriate 2014-01-28 04:00:04 +11:00
Kevin Mackay
fbc7ab30ff Curves: save active point to file
Changed curve active point from pointer to index. Allows curve active point to be saved to file and retained between modes for free. Also some small optimisations by removing pointer look up code.

- Made active point access functions into BKE API calls.
- Fixes operators where curve de-selection resulted in unsel-active point.
- Split curve delete into 2 functions
2014-01-27 15:21:04 +11:00
568e678fa3 Code cleanup: fix gcc/clang compiler warning in release build. 2014-01-16 22:28:09 +01:00
af93ebcb50 Code Cleanup: style and redundant casts 2014-01-16 19:15:53 +11:00
bb1a7e4d87 Code Cleanup: simplify matcaps checks and quiet warning 2014-01-16 18:32:57 +11:00
054982d2dd Fix text overlap when using edge angle & length
From D193 by Ron Davis with some edits.
2014-01-15 20:03:19 +11:00
54e56cd309 Fix T38209: Curve's didn't account for negative scale
Would use the face winding from the previously drawn mesh
2014-01-15 00:35:43 +11:00
ff98be83a9 Empties with Images draw type: add support for movies and image sequences
This adds an ImageUser to such empties with all the typical settings.

Reviewed By: brecht, campbellbarton

Differential Revision: https://developer.blender.org/D108
2014-01-13 22:18:31 +01:00
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