Commit Graph

1068 Commits

Author SHA1 Message Date
62aa004c25 Style Cleanup: whitespace 2014-01-12 22:05:24 +11:00
49aa701645 Add profile control parameter to Bevel.
Parameter controls concavity / convexity.
    <.25 means: concave inward
    .25 means: straight slanted
    >.25 means: concave outward
    .5 means: circular (the default)
    1 means: straight along original sides
For now, there is a hard lower limit of .15
because more work is needed to get decent
results in the range below that.

The profile is actually a superellipse, and the
parameter is 1/4 of the exponent in the implicit equation
for a superellipse, except at the extreme values of 0 and 1.
2014-01-08 07:40:01 -05:00
d490e686f0 Fix T38100: laplacian smooth crash 2014-01-08 03:56:43 +11: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
a5606fadbb Code Cleanup: remove object arg to CDDM_from_mesh mesh_create_derived 2013-12-26 08:27:08 +11:00
d064968c27 Fix T37914: Mask modifier behaves differently until painted 2013-12-24 14:39:14 +11:00
0a5e00e8e8 Code Cleanup: style 2013-12-24 05:04:29 +11:00
c1c26c36f6 Style Cleanup: remove preprocessor indentation (updated wiki style guide too) 2013-12-22 14:12:19 +11:00
b01cbede04 error in last commit, missing normal update. 2013-12-22 07:19:48 +11:00
a183aa6c67 error in last commit, flag names. 2013-12-22 07:16:41 +11:00
d5263c37fa Modifier: New Wireframe Modifier
Based on patch originally by Thomas Beck,
uses options similar to solidify.
2013-12-22 07:13:48 +11:00
c80c596194 Fix for mesh deform modifier missing copy for flag. 2013-12-22 04:45:00 +11:00
158b4e61a0 Mesh Modifiers: refactor copying using a generic function 2013-12-22 04:37:26 +11:00
e7ac87a254 Fix T37869: vertex paint + wireframe draw mode + smoke domain did not draw correct. 2013-12-19 18:52:26 +01:00
19c0c7992a Fix T37003, Fix T37859: smoke modifier taking deforming modifiers into account
in some cases.

The smoke modifier now ignores the modifier evaluation for generated texture
coordinates, which would previously cause the undeformed mesh to be cached for
flow objects. Dynamic paint has a similar exception, and other physics systems
avoid it by not being a constructive modifier.
2013-12-19 18:25:14 +01:00
d7033d5637 Fix T37691: Screw modifier created zero length normals 2013-12-19 07:57:16 +11:00
7214001cdb Fix T37837: mirror modifier merge does not place vertices at the center.
This was broken since BMesh.
2013-12-18 11:15:11 +01:00
e23f77b935 Code Cleanup: move mesh mapping functions into their own file/header 2013-12-12 16:28:52 +11:00
41e70cfb39 Add meaningful default for SimpleDeform modifier's angle prop. 2013-12-11 22:12:10 +01: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
1782376d97 Laplacian Deform Modifier: fix possible NULL pointer dereference. 2013-12-03 09:06:22 +11:00
a31b450093 Screw Modifier: UV support
- When existing faces are available use their UV values
- When no faces are connected to an edge - generate UV's

Also add option to stretch U/V to bounds.
2013-11-26 21:31:32 +11:00
44718b66f1 Screw Modifier: copy face data when the original face is known.
also de-duplicate code for handling the closing face strip.
2013-11-26 21:07:24 +11:00
07bde9e797 Usual ui messages fixes... 2013-11-25 22:51:46 +01:00
2b4c68b902 CMake Build: option to compile without opennl/superlu. 2013-11-25 15:36:19 +11:00
673bd9a009 Mesh Modifiers: Added Laplacian Deform
Part of soc-2013-sketch_mesh branch

See: http://wiki.blender.org/index.php/User:Apinzonf/Doc:2.6/Manual/Modifiers/Deform/Laplacian_Deform
2013-11-24 07:10:42 +11:00
ac021a42ad Code Cleanup: use strict flags for screw modifier, reduce sign conversion 2013-11-21 10:36:56 +11:00
1ea47c9af9 Code Cleanup: style, spelling and pep8 edits 2013-11-20 03:40:10 +11:00
74a1e4dcf2 Fix T37519: Screw Modifier ignores material setup
This was more a missing feature then a bug, the modifier never handled
existing faces however with ngons its possible to get more useful
results. Also order edges from the faces (if available),
gives control over the face-winding-direction.
2013-11-19 13:15:12 +11:00
cee7fbdfaa Fix T37413 - Fit-Curve option for Array Modifier ignores constraint results
Unless I'm missing something here (probably with regards to parenting),
it makes more sense that constraint results are considered here as well
(for example, if Limit Scale constraints get applied on the object),
as this allows for greater flexibility when creating setups with this.
2013-11-18 14:02:49 +13:00
bfb9cefccb Added options for how bevel amount is measured.
Now there is an 'Offset Type' dropdown on tool
shelf with types:
Offset - current method, offset of new edge
  from old along sliding face
Width - width of new bevel face (if segments=1)
Depth - amount a chamfering plane moves down
  from original edge
Percent - percent of way sliding edges move
  along their adjacent edges

The different options mainly are useful when
beveling more than one edge at once.

Leaving as a TODO to put these in the modifier,
as doing that has more permanent effects so
want to let users shake out problems with this
first.
2013-11-10 12:31:57 +00:00
26dc289d99 Fix [#37315] Mirror+MeshDeform cause crash when Vertex Group is referred
One hour of efforts to spot such a small dummy typo!
2013-11-04 23:33:23 +00:00
c241bf30a0 Fix #37252: Mask modifier doesn't copy settings on object copy 2013-10-30 09:44:29 +00:00
Dalai Felinto
a7b44c82e5 Triangulate Modifier: using different ngon and quad methods
Quads: Beauty, Fixed, Fixed Alternate, Shortest Diagonal
Ngons: Beauty, Scanfill

* Shortest Diagonal is the default method in the modifier (popular
  elsewhere), but beauty is the default in Ctrl+T).

* Remove the need for output slot and beauty operator to be called
after Clt+T

Patch with collaborations and reviewed by Campbell Barton
2013-10-29 02:42:51 +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
ce741bc223 Code cleanup: de-duplicate implementation of get_texture_value
Expect to be no functional changes :)
2013-10-20 13:01:07 +00:00
d6b21df2e6 correct include guards and add checks in check_style_c.py for them. 2013-09-19 23:17:52 +00:00
a30a817933 UVProject modifier was still requiring old tesselated UV data instead of new poly/loop ones. 2013-09-18 15:48:24 +00:00
9f74134862 replace BLI_edgehash_insert with BLI_edgehash_reinsert for explode operator, was inserting the same edges more then once. 2013-09-15 01:47:40 +00:00
c9dfe7bd74 more localized fix for [#36299], only changes behavior for subsurf with orco in editmode 2013-09-12 10:41:00 +00:00
8beb565c59 code cleanup: headers - doxy comments. 2013-09-12 03:02:50 +00:00
00bd7da674 correct error in recent changes for building with openmp.
rename DM_OMP_LIMIT to BKE_MESH_OMP_LIMIT and set to 0 when in debug mode, same for BM_OMP_LIMIT.
2013-09-09 05:42:26 +00:00
9467d99405 replace sqrt(dot()) with length functions. 2013-09-03 22:32:03 +00:00
0994e7f96f move timeit macros into their own include, since they are only used for testing and unrelated to PIL_time.h typical use. 2013-09-03 21:22:43 +00:00
54310b8086 bmesh: internal api change, remove BMOElemMapping, its not needed since the values can be stored in the ghash directly.
saves 24 bytes per element (per vertex/edge/face on a 64bit system), for bmesh operators.
2013-09-02 03:13:51 +00:00
75383a79f6 array modifier was adding vertices to the 'targetmap' multiple times.
this is supported by weldop but would prefer not to allow multiple keys in the map.
2013-08-27 23:32:11 +00:00
52216889c0 Remove unused function NewBooleanMesh 2013-08-26 14:53:40 +00:00
f2acb10b6b edge hash: take an arg for the guarded-malloc string (as ghash does) 2013-08-24 13:08:55 +00:00
6cba2b8d73 move bmesh tools into their own include,
changes to tool args would rebuild far too many files and these are mainly by modifiers outside of bmesh.
2013-08-23 04:22:07 +00:00
9470754fd3 bmesh api cleanup, face creation args now accept an example face (as with vertex and edge),
also replace BM_face_create_quad_tri_v with BM_face_create_verts
2013-08-21 07:51:47 +00:00