Commit Graph

92 Commits

Author SHA1 Message Date
Campbell Barton
2e2fd12a55 Cleanup: comments for is_path_builtin
Also reduce scope of import.
2019-10-31 18:01:58 +11:00
Sebastian Parborg
b1b0e56a72 Fix T59065: Blender default keyset is deletable by user!
Previously, you could delete presets that were part of the blender
default install. Now we check if the preset file resides in the bundled
file paths. If so, prevent deletion of the preset.

Reviewed By: Campbell

Differential Revision: http://developer.blender.org/D4522
2019-10-30 19:23:36 +01:00
Campbell Barton
c8c3e7d284 Cleanup: trailing space, remove tabs, pep8 2019-09-10 06:17:59 +10:00
Campbell Barton
d2e474d043 Cleanup: use trailing commas for multi-line arguments 2019-06-21 08:36:03 +10:00
Antonioya
3f4dd54ff7 GPencil: Fix presets error after changing parameter name
The old use_follow_draw was renamed to alignment_mode
2019-05-20 16:41:16 +02:00
Campbell Barton
fc37238b17 Cleanup: unused args/vars/imports in bl_operators 2019-05-09 12:42:05 +10:00
Antonioya
7440f98f98 Fix T63897: GPencil Material Presets showing error
This error was introduced in a previous commit with the rename of the parameter.

Also added some missing values.
2019-04-26 10:14:50 +02:00
Campbell Barton
ad9addbf46 Cleanup: unused imports 2019-03-17 21:00:56 +11:00
Campbell Barton
100854c17c UI: rename PresetMenu to PresetPanel, move to bl_ui.utils
Confusing to call a menu a panel when subclasses need to define
panel specific variables.

Avoid having bl_ui depend on bl_operator module too.
Since this isn't an operator, add utils modules for shared types.
2019-03-13 13:32:10 +11:00
Campbell Barton
bbe98b18fb Cleanup: use preferences prefix for Python operators 2019-03-02 00:23:42 +11:00
Charlie Jolly
65de468396 GP: Draw: Stroke Trim
New edit mode operator and post-processing brush option.

Trim works on a single GP stroke. It removes trailing points before and after the first intersection (or loop) nearest to the start of the stroke.
2019-02-26 16:04:27 +00:00
Philipp Oeser
f572a157ba Fix T59913: error saving cloth preset
thx @rombout for investigation!
2019-01-10 15:53:32 +01:00
Campbell Barton
7fac1bfc20 Context: remove active_gpencil_brush
We don't have this for other painting modes,
no need for a special case here.
2018-12-17 17:17:43 +11:00
Campbell Barton
c9f24a5690 WM: remove interaction presets
These only exposed a few options, which didn't end up helping
much to make Blender's key-map fit the behavior of other applications.
2018-11-20 08:11:46 +11:00
Campbell Barton
0f1a63d34c PyAPI: add bpy.utils.execfile
Wraps `importlib.util`, avoids duplicate preset loading calls.
2018-11-18 11:49:03 +11:00
Campbell Barton
b8d21f9b9b Cleanup: typo, whitespace 2018-11-15 18:50:18 +11:00
Campbell Barton
5ec1d709e7 WM: use Python bytecode cache to run presets
Key-maps can be very large, avoid parsing on every startup.
2018-11-15 18:46:00 +11:00
Antonioya
dc346c05fe GP: Add missing preset properties 2018-11-09 20:04:37 +01:00
Campbell Barton
c469c72405 Cleanup: grease pencil RNA naming
Follow naming conventions for boolean's,

Also rename enable_settings -> use_settings_postprocess.
2018-10-31 11:51:15 +11:00
7dc2a5a267 Fix T57144: saving theme presets not working after recent changes. 2018-10-10 18:27:01 +02:00
e1293da014 Splash: add themes to first time setup in splash screen.
* Add default theme as Blender Dark.
* Rename Flatty Light to Blender Light.
* When setting theme, reset to default first for consistent results.
2018-10-08 19:46:00 +02:00
Jacques Lucke
2d21eb79ad Units: Support for fixed units
Users can select the main unit they want to use now.
Previously the displayed unit always depended on the magnitude of the value.
The old behavior can be restored by switching to the "Adaptive" mode for length, mass and time units.

Meters, kilograms and seconds are the default units for new and old scenes.

The selected unit is also the default unit for user input.
E.g. if cm is selected, whenever the user inputs a unitless number into a field of type length, it will be interpreted as cm.

Reviewer: brecht

Differential: https://developer.blender.org/D3740
2018-10-03 10:20:16 +02:00
Campbell Barton
af1cf00003 Merge branch 'master' into blender2.8 2018-09-13 18:19:24 +10:00
Campbell Barton
a6fc718029 PyAPI: add API call to get an operators type
Getting the instance leaks memory and was only meant to be used for
generating docs.
2018-09-13 18:16:06 +10:00
Antonioya
59670e999a GP: Add new presets for materials
This allow create prests without import materials and include a requested predefined settings for Stroke only, Fill only and Stroke and Fill.
2018-08-16 11:24:45 +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
45addee39e Fix presets not working after Python refactoring. 2018-07-24 17:31:36 +02:00
Campbell Barton
cca87ccc75 UI: remove space/region from popover args
Instead use global panel-type list.
2018-07-13 19:16:35 +02:00
Campbell Barton
09aa799e53 PyAPI: Use annotations for RNA definitions
- Logical use of fields since they define type information.
- Avoids using ordered-dict metaclass.

Properties using regular assignments will print a warning and load,
however the order is undefined.
2018-07-11 22:18:09 +02:00
Campbell Barton
a61480c271 Merge branch 'master' into blender2.8 2018-06-26 22:56:39 +02:00
Campbell Barton
532c8ac583 Cleanup: pep8 function indentation 2018-06-26 19:58:56 +02:00
Campbell Barton
ab9e2dccd3 Cleanup: follow naming conventions
Using panels for presets printed warnings for classes named as menus.
2018-06-20 16:32:31 +02:00
7a10cfe7fe UI: preset popover buttons in panel headers.
Moves the preset into a menu for the panel header, so it can be changed
without opening the panel and takes up less space. Two remaining issues:

* For long lists the add new preset button can be scrolled off screen.
* We should support showing the name of the chosen preset in the panel
  header, but the current preset system does not support detecting which
  preset is used.

Differential Revision: https://developer.blender.org/D3366
2018-06-13 15:22:34 +02:00
61759f3b55 Cleanup: remove code for removed Blender Internal properties. 2018-04-28 16:15:42 +02:00
Ton Roosendaal
51b796ff15 Remove Blender Internal and legacy viewport from Blender 2.8.
Brecht authored this commit, but he gave me the honours to actually
do it. Here it goes; Blender Internal. Bye bye, you did great!

* Point density, voxel data, ocean, environment map textures were removed,
  as these only worked within BI rendering. Note that the ocean modifier
  and the Cycles point density shader node continue to work.
* Dynamic paint using material shading was removed, as this only worked
  with BI. If we ever wanted to support this again probably it should go
  through the baking API.
* GPU shader export through the Python API was removed. This only worked
  for the old BI GLSL shaders, which no longer exists. Doing something
  similar for Eevee would be significantly more complicated because it
  uses a lot of multiplass rendering and logic outside the shader, it's
  probably impractical.
* Collada material import / export code is mostly gone, as it only worked
  for BI materials. We need to add Cycles / Eevee material support at some
  point.
* The mesh noise operator was removed since it only worked with BI
  material texture slots. A displacement modifier can be used instead.
* The delete texture paint slot operator was removed since it only worked
  for BI material texture slots. Could be added back with node support.

* Not all legacy viewport features are supported in the new viewport, but
  their code was removed. If we need to bring anything back we can look at
  older git revisions.
* There is some legacy viewport code that I could not remove yet, and some
  that I probably missed.
* Shader node execution code was left mostly intact, even though it is not
  used anywhere now. We may eventually use this to replace the texture
  nodes with Cycles / Eevee shader nodes.

* The Cycles Bake panel now includes settings for baking multires normal
  and displacement maps. The underlying code needs to be merged properly,
  and we plan to add back support for multires AO baking and add support
  to Cycles baking for features like vertex color, displacement, and other
  missing baking features.

* This commit removes DNA and the Python API for BI material, lamp, world
  and scene settings. This breaks a lot of addons.
* There is more DNA that can be removed or renamed, where Cycles or Eevee
  are reusing some old BI properties but the names are not really correct
  anymore.
* Texture slots for materials, lamps and world were removed. They remain
  for brushes, particles and freestyle linestyles.
* 'BLENDER_RENDER' remains in the COMPAT_ENGINES of UI panels. Cycles and
  other renderers use this to find all panels to show, minus a few panels
  that they have their own replacement for.
2018-04-19 17:35:25 +02:00
Campbell Barton
8d3efb2b90 Fix T53772: Presets don't support colons 2018-01-14 14:31:39 +11:00
Campbell Barton
9bdda427e6 PyAPI: remove bpy.utils.register_module()
In preparation for it being removed, see: T47811
2017-03-18 20:03:24 +11:00
Bastien Montagne
43f7d5643f Fix T50926: python crashes with path containing utf8 characters.
Default text encoding is platform-dependent in python, and windows
usually do not use utf-8 as default...
2017-03-14 16:04:45 +01:00
Campbell Barton
7f3da8f5c9 UI: Presets for scene units
This adds simple preset menu for unit scale scene property.

D1799 by @alm
2016-03-25 05:03:25 +11:00
Campbell Barton
98b95fb325 Error in own recent commit, (left in debug test) 2015-12-03 08:09:04 +11:00
Campbell Barton
d9f5a4ed79 Report error when removing presets fails 2015-12-01 20:07:10 +11:00
Campbell Barton
60ddaf045a Python API: use cached translation tables
bpy.path.clean_name() and AddPresetBase.as_filename() were doing
inefficient search-replace of individual characters.

Use cached replacement table instead.
2015-06-13 19:47:32 +10:00
Campbell Barton
8a231185aa Doc: minor fixes
- check for class/static methods assumed nonzero args.
- subclass references and set-flag items are now sorted.
- use 'order' for Py operator mix-ins,
  so operator settings don't show in random order.
2015-05-12 18:23:24 +10:00
Campbell Barton
7095f47665 cleanup: pep8
also remove empty class parenthesis
2015-01-29 15:35:06 +11:00
Lukas Tönne
bb76e96339 Presets for hair dynamics.
This is necessary because the hair dynamics settings are not part of the
ParticleSettings datablock, but part of the convoluted cloth modifier
inside the particle system struct. In the future this will be recoded
properly, but in the meantime presets provide a simple an unobtrusive
way to have reusable dynamics settings for hair.

Conflicts:
	release/scripts/startup/bl_ui/properties_particle.py
2015-01-20 09:30:09 +01:00
Campbell Barton
09c83d6fea Viewport: Add adjustable safe areas, 3d-view & VSE
Also adds safe-area presets.

D325 by Diego Gangl with own edits.
2015-01-19 16:47:57 +11:00
Lukas Tönne
cf3bb40c62 Fix T41081: Presets not working on pinned properties panels.
Preset operators should avoid using `bpy.context.object.data` as a base
path to properties. This path is not available in the buttons context
when using pinned datablocks! Instead use the specific
`bpy.context.camera` and `bpy.context.lamp.sky` paths now, which lead to
the correct datablocks in any case.
2014-07-18 11:37:57 +02:00
Sergey Sharybin
57b62881f4 Added track weight to presets
Useful for cases when you need to create bunch of witness tracks.
2014-02-19 18:43:36 +06:00
Sergey Sharybin
5d20db1d87 Added an option to camera preset to include/exclude focal length from the preset
Useful for cameras which have fixed focal length.
2014-02-19 18:18:02 +06:00
Bastien Montagne
bbcfadff35 Work around for bug [#37376] wrong tooltips on few minus buttons
Until we have a way to customize tooltips based on operator parameters...
2013-11-10 08:15:24 +00:00