Commit Graph

171 Commits

Author SHA1 Message Date
Campbell Barton 7de712e1e5 Fix uv-sculpt use w/ tool-system 2018-11-21 17:56:10 +11:00
Campbell Barton 2b3b481c3d Merge branch 'master' into blender2.8 2018-11-14 11:27:42 +11:00
Campbell Barton b97a2c3688 Cleanup: naming for paint modes
- Rename ePaint* -> PAINT_MODE_*.
- Use PAINT_OVERLAY_ prefix for eOverlayControlFlags.
2018-11-14 11:20:08 +11:00
Campbell Barton 101fd08348 Merge branch 'master' into blender2.8 2018-11-07 11:59:41 +11:00
Campbell Barton 59e70d5f8d Cleanup: renmae ePaintTexture(Projective) -> 3D
Matches ePaintTexture2D, less verbose.
2018-11-07 11:52:14 +11:00
Campbell Barton c19dafd2a6 Paint: paint.brush_select now supports gpencil
Replace grease pencil specific brush select operator.
2018-11-07 11:42:30 +11:00
Campbell Barton bc1c263a8a Cleanup: naming (inconsistent paint_mode term) 2018-11-07 09:43:07 +11:00
Campbell Barton 80109c976c Brush: split out vertex paint tool & blend mode
- Vertex & weight paint now use the 'blend' setting.
- Weight paint now has it's own tool setting,
  since weight paint doesn't deal with color - we'll likely
  support different tools eventually.
2018-11-06 18:06:33 +11:00
Campbell Barton a90bcdf93d Tool System: use tool type enum to access brushes
Previously the brush names were used which had the limit that:

- Brush names that were deleted wouldn't show up in the toolbar.
- Naming collisions between user defined brushes and existing tools
  broke tool selection.

Now brushes are created as needed when tools are selected.

Note, vertex/weight paint combine tool and blend modes,
this should be split out into a separate enum.
2018-11-06 12:39:51 +11:00
Campbell Barton 1b928c2d9a Paint: add tool offset & mode to runtime data
It was getting too impractical to call BKE_paint_brush_tool_info
which needed to lookup the scene pointers.

Now each store tool offset and brush mode in 'Paint.runtime'
2018-11-05 16:18:43 +11:00
Campbell Barton 8b31f6fb21 Paint: add BKE_paint_ensure to initialize toolsettings
Each mode had its own logic for initializing paint structs,
move to a single function.

Also remove "BKE_brush_get_gpencil_paint", entering grease pencil
mode is responsible for ensuring the data is created.
2018-11-05 15:31:25 +11:00
Campbell Barton 888a0735ee Tool System: validate tool slots when setting modes
Needed for entering paint modes on new scenes.
2018-11-03 16:52:06 +11:00
Campbell Barton 13c3c9b22f Cleanup: move brush query into utility function 2018-11-03 15:55:45 +11:00
Campbell Barton ac8d787327 Tool System: brushes are now categorized by tool
The toolbar now shows brush types, the brush selector now
only shows brushes matching the current tool type.

Details:

- Add's Paint.tool_slots (used by the toolbar).
- Removed custom grease pencil brush tool code.
- Bumped subversion.

See T57526 for details.
2018-11-02 19:40:39 +11:00
Dalai Felinto 9a670a67d2 Fix for assert when sampling color to non-existent palette 2018-10-09 12:43:11 +00:00
Sergey Sharybin 8e8952b7e3 Multires: Initial work to get sculpting to work with OpenSubdiv
Allows to go to sculpt mode, do brush strokes, get out of sculpt mode
and have deformation preserved.

The issues currently is that the current implementation of CCG
storage is created from the limit surface, without displacement
taken into account. It is trivial to get displaced coordinates,
but it is more tricky to get displaced normals. This is something
to be solved next.

Another limitation is that this only works for sculpting at a maximal
multires level. There is code to be done to support propagation
of displacement onto a higher levels.
2018-09-14 14:43:56 +02:00
Sergey Sharybin 3fbdcefa17 Subdiv: Initial implementation of CCG
Attempts to substitude CCGDM with an OpenSubdiv based structure
which has less abstraction levels. The missing part in this
substitude is a face pointers which old CCGDM/multires code was
using to stitch faces (averaging boundaries).

Another curial bit missing: "reshaping" of multires CD_MDISPS
to the state of new PBVH grids.

The new code is only available when OpenSubdiv modifier is
enabled (WITH_OPENSUBDIV_MODIFIER=ON) and with debug value of
128. This is so this WIP code is not interfering with current
production machines in the studio.

Reviewers: brecht

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D3685
2018-09-11 16:37:02 +02:00
Antonioya 66da2f537a New Grease Pencil object for 2D animation
This commit merge the full development done in greasepencil-object branch and include mainly the following features.

- New grease pencil object.
- New drawing engine.
- New grease pencil modes Draw/Sculpt/Edit and Weight Paint.
- New brushes for grease pencil.
- New modifiers for grease pencil.
- New shaders FX.
- New material system (replace old palettes and colors).
- Split of annotations (old grease pencil) and new grease pencil object.
- UI adapted to blender 2.8.

You can get more info here:

https://code.blender.org/2017/12/drawing-2d-animation-in-blender-2-8/
https://code.blender.org/2018/07/grease-pencil-status-update/

This is the result of nearly two years of development and I want thanks firstly the other members of the grease pencil team: Daniel M. Lara, Matias Mendiola and Joshua Leung for their support, ideas and to keep working in the project all the time, without them this project had been impossible.

Also, I want thanks other Blender developers for their help, advices and to be there always to help me, and specially to Clément Foucault, Dalai Felinto, Pablo Vázquez and Campbell Barton.
2018-07-31 10:50:43 +02:00
Campbell Barton 06a1a66a9b Merge branch 'master' into blender2.8 2018-06-17 17:10:19 +02:00
Campbell Barton 6fc8a74886 Cleanup: trailing space for blenkernel 2018-06-17 17:05:51 +02:00
Bastien Montagne 160cb9a284 Merge branch 'master' into blender2.8
Conflicts:
	intern/cycles/blender/blender_object.cpp
	source/blender/alembic/intern/abc_exporter.cc
	source/blender/alembic/intern/abc_mball.cc
	source/blender/alembic/intern/abc_mball.h
	source/blender/blenkernel/BKE_anim.h
	source/blender/blenkernel/BKE_displist.h
	source/blender/blenkernel/BKE_dynamicpaint.h
	source/blender/blenkernel/BKE_group.h
	source/blender/blenkernel/BKE_mball.h
	source/blender/blenkernel/BKE_mball_tessellate.h
	source/blender/blenkernel/BKE_object.h
	source/blender/blenkernel/BKE_scene.h
	source/blender/blenkernel/intern/anim.c
	source/blender/blenkernel/intern/depsgraph.c
	source/blender/blenkernel/intern/displist.c
	source/blender/blenkernel/intern/dynamicpaint.c
	source/blender/blenkernel/intern/group.c
	source/blender/blenkernel/intern/mball.c
	source/blender/blenkernel/intern/mball_tessellate.c
	source/blender/blenkernel/intern/mesh_convert.c
	source/blender/blenkernel/intern/object.c
	source/blender/blenkernel/intern/object_dupli.c
	source/blender/blenkernel/intern/object_update.c
	source/blender/blenkernel/intern/pointcache.c
	source/blender/blenkernel/intern/scene.c
	source/blender/blenkernel/intern/smoke.c
	source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
	source/blender/depsgraph/intern/builder/deg_builder_relations.cc
	source/blender/editors/include/ED_object.h
	source/blender/editors/object/object_add.c
	source/blender/editors/object/object_edit.c
	source/blender/editors/object/object_modifier.c
	source/blender/editors/physics/dynamicpaint_ops.c
	source/blender/editors/sculpt_paint/paint_vertex.c
	source/blender/editors/sculpt_paint/sculpt_uv.c
	source/blender/editors/space_view3d/drawobject.c
	source/blender/editors/space_view3d/view3d_draw.c
	source/blender/editors/transform/transform_conversions.c
	source/blender/editors/transform/transform_snap_object.c
	source/blender/editors/util/ed_util.c
	source/blender/gpu/intern/gpu_material.c
	source/blender/makesrna/intern/rna_meta.c
	source/blender/makesrna/intern/rna_object_api.c
	source/blender/modifiers/intern/MOD_dynamicpaint.c
	source/blenderplayer/bad_level_call_stubs/stubs.c
2018-06-11 14:39:38 +02:00
Bastien Montagne 8055ed2741 Cleanup: remove some G.main usages... 2018-06-11 12:15:14 +02:00
Bastien Montagne 3e86bb2d0b Sculpt/Paint: move PBVH building to use evaluated mesh instead of deprecated Derivedmesh.
Pretty straightforward changes, merely mimicking dm-related code,
which was already essentially using either Mesh or BMesh data to
build the PBVH...

Note that we "lose" the subsurf (a.k.a. grid) PBVH case here, but that
one was already dead code in current blender2.8, since final dm is
always a cddm built from evaluated mesh.

Proper fix is pending new code for subsurf/multires area.
2018-06-08 17:23:25 +02:00
Campbell Barton bfe1d0e0dc Merge branch 'master' into blender2.8 2018-06-01 18:26:42 +02:00
Campbell Barton 75fc1c3507 Cleanup: trailing whitespace (comment blocks)
Strip unindented comment blocks - mainly headers to avoid conflicts.
2018-06-01 18:19:39 +02:00
Brecht Van Lommel 34ab90f546 Depsgraph: remove EvaluationContext, pass Depsgraph instead.
The depsgraph was always created within a fixed evaluation context. Passing
both risks the depsgraph and evaluation context not matching, and it
complicates the Python API where we'd have to expose both which is not so
easy to understand.

This also removes the global evaluation context in main, which assumed there
to be a single active scene and view layer.

Differential Revision: https://developer.blender.org/D3152
2018-04-16 19:55:33 +02:00
Campbell Barton 9a11aeb300 Merge branch 'master' into blender2.8 2018-04-16 17:24:20 +02:00
Campbell Barton 85de548e03 Cleanup: indentation 2018-04-16 17:08:27 +02:00
Campbell Barton 1c24c04e60 Remove workspace object mode, reverts changes w/ 2.8
This caused too many problems syncing object modes
with multiple objects/windows/workspaces, see: D3130 for details.
2018-04-05 18:21:14 +02:00
Campbell Barton 5db950e860 Cleanup: use workspace for object_mode when possible 2018-02-09 22:14:39 +11:00
Campbell Barton 345c6298e9 Object Mode: move to workspace struct
- Read-only access can often use EvaluationContext.object_mode
- Write access to go to WorkSpace.object_mode.
- Some TODO's remain (marked as "TODO/OBMODE")
- Add-ons will need updating
  (context.active_object.mode -> context.workspace.object_mode)
- There will be small/medium issues that still need resolving
  this does work on a basic level though.

See D3037
2018-02-08 21:14:26 +11:00
Campbell Barton f9f64ca4a3 Use eObjectMode for function arguments 2018-02-06 23:34:58 +11:00
Campbell Barton 885d78150d Use eObjectMode for function arguments 2018-02-06 23:27:49 +11:00
Campbell Barton c7fecab2ef Object Mode: Use eval_ctx mode for drawing, paint & modifiers 2018-02-06 18:03:28 +11:00
Campbell Barton a1c45a453f Merge branch 'master' into blender2.8 2018-02-05 17:58:31 +11:00
Campbell Barton ceb645bc56 Fix T53986: Crash saving during sculpt stroke
Also remove unused struct member.
2018-02-05 17:54:13 +11:00
Sergey Sharybin 0d64857c3f Merge branch 'master' into blender2.8 2018-01-30 14:32:27 +01:00
Campbell Barton d0f63d402d Fix T53943: Weight paint crash in new scene 2018-01-30 20:33:20 +11:00
Sergey Sharybin ec3248437d Merge branch 'master' into blender2.8 2018-01-15 13:55:52 +01:00
Sergey Sharybin 4d8b78b0a9 Sculpting: Sdd an option to hide mask in viewport
Brushes themselves are still affected by the mask, but the viewport is not
showing the mask. This way it's easier to see details while sculpting.

Studio request by Julien Kaspar
2018-01-15 11:43:59 +01:00
Sergey Sharybin c46a9d8117 Merge branch 'master' into blender2.8 2017-12-18 16:19:12 +01:00
Campbell Barton 076616898b Fix T53577: Rake sculpt/paint wrong on first step 2017-12-18 14:35:15 +11:00
Dalai Felinto b79b8478ee Cleanup: Rename ViewLayer *sl > ViewLayer *view_layer 2017-11-23 14:58:01 -02:00
Dalai Felinto 3abe8b3292 Rename any instance of scene layer or render layer in code with view layer
The RenderResult struct still has a listbase of RenderLayer, but that's ok
since this is strictly for rendering.

* Subversion bump (to 2.80.2)
* DNA low level doversion (renames) - only for .blend created since 2.80 started

Note: We can't use DNA_struct_elem_find or get file version in init_structDNA,
so we are manually iterating over the array of the SDNA elements instead.

Note 2: This doversion change with renames can be reverted in a few months. But
so far it's required for 2.8 files created between October 2016 and now.

Reviewers: campbellbarton, sergey

Differential Revision: https://developer.blender.org/D2927
2017-11-23 07:48:23 -02:00
Campbell Barton 0ffa64a45f Merge branch 'master' into blender2.8 2017-10-17 14:06:49 +11:00
Campbell Barton 99520e3f92 Cleanup: use 'e' prefix for enum typedefs
Convention was only followed loosely,
apply to DNA where changes aren't likely to conflict.

(Skipped ModifierType for eg).
2017-10-17 13:49:20 +11:00
Sergey Sharybin 63c472b4f9 Merge branch 'master' into blender2.8 2017-10-04 22:18:05 +05:00
Campbell Barton f4b1f9b925 Vertex Paint: remove accumulate (soc-2017-vertex_paint)
This secondary accumulation option accumulated brush falloff.
The same option in image painting accumulates color
as vertex paiht 'Spray' does.

Giving this option different behavior for vertex paint seems strange.
Also this is basically increasing falloff over time.

Remove the new code, expose existing 'Spray' as 'Accumulate'
to match other paint modes.
2017-10-03 19:09:28 +11:00
Sergey Sharybin 2bfa061a15 Merge branch 'master' into blender2.8
Notes:

- Changes in paint_vertex.c were simple to merge, mainly related on passing
  evaluation context.

- Conflicts in EditDM and drawmesh.c are solved using code from blender2.8
  branch. Those areas are deprecated and not to be used in final release.

  However, it's possible that some reference code from master is lost, so
  keep attention when adding alpha support for vertex painting.
2017-10-03 12:59:06 +05:00
Campbell Barton b2a10fa615 Vertex Paint: projection options
This makes vertex paint match image painting more closely.

- Add falloff shape option sphere/circle
  where sphere uses a 3D radius around the cursor and
  circle uses a 2D radius (projected), like previous releases.
- Add normal angle option so you can control the falloff.
- Add Cull option, to paint onto faces pointing away.

Disabling normals, culling and using circle falloff
allows you to paint through the mesh.
2017-10-02 22:07:58 +11:00