Compare commits

..

1593 Commits

Author SHA1 Message Date
753dd8f09a First commit to this branch
This branch is supposed to serve as a template and tutorial to
newcomers of the Blender codebase.
2019-03-03 16:46:26 +11:00
ae977d13f8 Improve slightly the stability of wireframes in old GPUs from AMD.
Tested on `AMD Radeon HD 7570M`.
The reason for crash reduction is still unknown.
2019-03-02 21:01:13 -03:00
52f318b914 Refactor duplicate code for collections.
* Fix incorrect handling of children collections being linked more than
once in the hierarchy (previous code would make a new copy for each
link, instead of just re-linking the first copy for each extra link).

* Simplify some aspects of it (we do not need a GHash for new objects,
we can use ID->newid pointer instead, and some iterations can be done
directly on existing linked lists of old collection, instead of making
temp local copies of them).

* Move all copy logic into a single private recursive function (it was a
bit odd/disturbing to see calling function being indirectly called again
by the recursive helper one - not wrong, but that kind of code path can
quickly become problematic in recursive patterns).

* Added some comments about expected behavior of
`BKE_collection_duplicate()` depending on its booleans options.
2019-03-02 22:00:34 +01:00
dcbc09e429 Cleanup: comma warning 2019-03-03 02:29:43 +11:00
f67e81e295 Cleanup: SDNA/DNA naming
Use 'size' instead of 'len' to represent the size of data in bytes,
'len' is used for the result of 'strlen' or the length of an array
in some parts of 'makesdna.c' & 'dna_genfile.c'.

Also clarify comments and some variable names, no functional changes.
2019-03-03 01:29:08 +11:00
dc858a048b GPencil: Set alpha to 1 for all materials in SOLID mode
To be consistent, the alpha must be set to 1 when solid mode is enabled.
2019-03-02 14:28:44 +01:00
de78ffca84 GPencil: Initialize Fill alpha to 1.0 by default for new materials 2019-03-02 14:15:56 +01:00
ba7656ad25 GPencil: Set Viewport color to black by default
As the 2D viewport color is white, if the object default color is white, when wireframe is enabled the object is invisible.

Now, the grease pencil object default viewport color is black.
2019-03-02 14:13:04 +01:00
cd9c1c10e8 GPencil: Fix Display Textures in Solid mode
There was a bug when selected Solid mode with Material or Texture mode. The textures were not visible.

Now, the mode is passed to shaders to decide if use the solid color or the result texture color. The mode is passed using an array with shading type and mode.
2019-03-02 13:59:18 +01:00
10d41e48b8 Fix BLI_mempool incorrect slop-space calculation
Also ensure elements fit evenly into the chunk size
causing allocations to be slightly smaller in some cases.

In own tests reduces overall memory use by about ~4.5%
for high poly meshes in edit-mode.
2019-03-02 20:31:31 +11:00
cf75aea218 Cleanup: code style & comments 2019-03-02 18:36:42 +11:00
e5b6020ffc Cleanup: remove unused define
There is no reason to keep the option for separate allocations,
it makes code harder to follow.
2019-03-02 18:36:42 +11:00
e72bbd3805 Revert accidental change in submodules from last commit
This reverts part of commit d5c2be7031.
2019-03-02 03:05:58 +01:00
d5c2be7031 CMake: Use static libstdc++ for static builds
This enables static linking of libstdc++ by default when building using
`WITH_STATIC_LIBS`. This makes builds more portable for anyone making
static builds (in particular for older systems).

Reviewed By: brecht, campbellbarton, sergey

Differential Revision: https://developer.blender.org/D4393
2019-03-02 02:53:09 +01:00
490a385c81 Cleanup: comments, assert align is a power of two 2019-03-02 11:57:39 +11:00
b5d87f8028 BLI_memarena: use ASAN memory poison
Detects invalid memory use when WITH_COMPILER_ASAN is enabled.
2019-03-02 11:50:44 +11:00
4d9bf4fc6c Cleanup: use dummy valgrind macros instead of ifdef's 2019-03-02 11:49:03 +11:00
5d9b50054c Cleanup: unused variable 2019-03-02 11:49:03 +11:00
84820e7f58 Revert "Fix T62098: Outliner: Delete hierarchy crash"
This reverts commit d1baed5e3d.

Next time please let original author of the buggy code to take care of
fixing the issue!
2019-03-01 23:04:47 +01:00
ccecc409e4 Fix T62098: Outliner: Delete hierarchy crash.
Stupid mistake in own logic would prevent first deleted ID to be
properly unlinked from rest of .blend file before its deletion...
2019-03-01 23:04:04 +01:00
e0458a3ead Fix drawing order messed up by rB005626b8c6b4
When annotations enabled, image borders were drawn around whole area instead around preview image.

Reviewed by: Brecht

Differential revision: https://developer.blender.org/D4430
2019-03-01 12:23:15 -08:00
Dalai Felinto
d1baed5e3d Fix T62098: Outliner: Delete hierarchy crash
Revert "Outliner: Enable new faster 'Delete Hierarchy' code by default."
This reverts commit 491a98ca44.

It fails in the most basic of tests (see report). No point in leaving
this commit around until it passes the easy to test cases.
2019-03-01 17:21:00 -03:00
Dalai Felinto
42faf52d8b Fixup for fix for OSX build using a build folder name with spaces
Bug introduced on: 1f22e3f311.
This was making regular Mac builds to fail, where they were not failing before.

Tested by William Reynish.
2019-03-01 17:07:08 -03:00
83c6130e87 GPencil: Change display modes
-Wireframe use Background color for X-Ray off
- Added support to Solid mode.
- Solid mode shows fill or not depending X-Ray.
- Solid can use Single, Material, etc.
- Wireframe and Solid mode don't show FXs.
2019-03-01 20:52:04 +01:00
Dalai Felinto
589d089472 Fix T62025: Outliner and viewport missing update after deleting object
Bug introduced on 012483b6e4.

Since we notify similar things when changing active and selected
objects, I believe we didn't notice this was missing a ND_OB_SELECT
notification before the small refactor to use the messenging system
exposed that bug.
2019-03-01 16:28:20 -03:00
943e4ec8f1 Fix unreported: Glitches on the wireframe of curves. 2019-03-01 16:20:40 -03:00
Dalai Felinto
568fa11a04 Fix warning for uiButPushedStateFunc
I changed the number of arguments for uiButPushedStateFunc
and forgot to update parts of the code (rB92182495da881).
2019-03-01 15:59:12 -03:00
6194aa5ce9 Fix T62047 New wireframes missing fresnel effect
Add back some (subtle) fresnel effect on object wireframe.

Dupli/set object still remains flat and need more work.
2019-03-01 19:46:08 +01:00
66228d4362 Fix T62090 : Eevee shader compilation: undefined variable "att1_is_srgb"
The geom shader check was not needed and this uncovered an error in the
GPU_BARYCENTRIC_TEXCO optimization recently commited.
2019-03-01 19:46:08 +01:00
Dalai Felinto
92182495da Fix T62016: Outliner visibility icons drag behaviour broken
We are mixing bool and fancy 3-in-1 func-set buttons in the outliner.
So they would return different pushed state in
ui_drag_toggle_but_pushed_state().

We now have a callback function that allows the button to set its own
pushed_button_state callback function.

Note: This is a bit of overkill since we are planning to change the
3-in-1 outliner buttons. That said, it may be nice to have, since in the
future we can mix those buttons for other things.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D4434
2019-03-01 15:39:04 -03:00
a577499c75 Merge branch 'blender2.7' 2019-03-01 19:29:26 +01:00
4c3be0bf52 Fix T62073: Cycles random hangs rendering with Save Buffers on. 2019-03-01 19:26:57 +01:00
d16386e50b Fix T62087: Crash when rendering in Cycles
The issue was discovered only after recent changes, but roots back
to much older changes.

What was happening is scene's ID recalc flags where never cleared,
which caused ensure_view_layer() to always run copy-on-write on the
scene. This resulted in certain runtime data being cleared, without
proper flag stored in the dependency graph.

This was caused by ID recalc clear function checking whether any ID
was tagged for recalc in that graph or not. This was happening due
to all areas using DEG_id_type_tag() which can only set flags on the
graph from viewport scenes, and could not inform render dependency
graph.

Now ID tyoe tagging is happening on per-graph level, which avoids
possibility of flags running out of sync.

In a bit longer term we also need to get rid of two functions which
are clearing flags: DEG_id_type_tag() and deg_graph_clear_tags().
2019-03-01 19:03:51 +01:00
faec3655d8 Fix T62075: Edges generated by solidify modifier does not appear
This was a missing flag.
2019-03-01 17:17:44 +01:00
fa5950d878 Fix crash with wireframe on highpoly curves on some AMD gpus.
Differential Revision: https://developer.blender.org/D4433
2019-03-01 12:40:20 -03:00
5eee1b4d1b Use original base to see whether it can be ignored from evaluation
Object of evaluated base is not yet copied, so we can not know whether
it has animation on visibility or not.

This issue was reported in T56635#630383.
2019-03-01 16:35:11 +01:00
ed36944adc Cleanup: typo and update comment 2019-03-01 16:06:38 +01:00
Dalai Felinto
7d4e1ac727 Outliner: Collections Duplicate - remove original duplicate operator
Now that we have better options (duplicate collection and duplicate linked) there is no
longer need for the original dupli operator.

In fact, as it was it was of little use if you ever had nested collections.
2019-03-01 11:44:19 -03:00
Dalai Felinto
e7ea99af1b Outliner: Collection - Duplicate Hierarchy, and Duplicate Linked Hierarchy
As per the suggestion on T57064, this introduces two new options to duplicate collections.
We then have:
* Duplicate > Collection (New collection with linked content).
* Duplicate > Hierachy (Duplicate entire hierarchy and make all contents single user).
* Duplicate > Linked Hierarchy (Duplicate entire hierarchy keeping content linked with original).

Development TODO: `single_object_users` can/should use the new functions.

Reviewers: brecht, mont29

Subscribers: pablovazquez, billreynish, JulienKaspar

Differential Revision: https://developer.blender.org/D4394
2019-03-01 11:44:19 -03:00
Dalai Felinto
619c65a4b3 Cleanup: Update comment 2019-03-01 11:44:19 -03:00
Dalai Felinto
dbab52e4c0 Cleanup: Set BKE_key_from_object/_p to take const Object * 2019-03-01 11:44:19 -03:00
3e07eac87b Cleanup: use variable instead of define 2019-03-02 01:30:59 +11:00
33b03f7f68 Cleanup: move theme reset into it's own operator file 2019-03-02 00:53:39 +11:00
3804636ee5 Fix: Better fix for KeyingSet "Export to File" and unescaped characters
Use Python's native raw formatting instead, which should take care of any issues
we may face.
2019-03-02 02:30:31 +13:00
dbeef6751d Cleanup: Adding braces around all cases here to make it easier for the next step 2019-03-02 02:30:31 +13:00
2bad126999 Fix T62057: Particle settings keyframes not showing in Graph Editor channels
In short, the settings to expand/collapse the Particles Animation Dopesheet expander
were no longer getting exposed, so the F-Curves attached to the particle settings
were not showing up in the channels list as that section was collapsed and couldn't
be opened from the UI.

Early on during the development of 2.8, we originally wanted to completely remove
the Particle System. Eventually that decision got walked back, and so particles
were reinstated. Well... most of the relevant code was! One of the areas that was
the most messed up during this process was the animation editor support for these
channels. It seems that there was almost a two-step removal process here -
the first pass tried to keep the channel definitions while removing all references
to particle stuff, while the second pass tried to remove the definitions completely
and/or re-added them in the wrong places, etc. To say the removal/reverting history is
here is "colourful" is an understatement...
2019-03-02 02:30:31 +13:00
bbe98b18fb Cleanup: use preferences prefix for Python operators 2019-03-02 00:23:42 +11:00
53e4a18cdf Collections: mark visibility properties as not animatable.
Better to communicate the current state clearly until this is supported,
for now only object visibility can be animated.
2019-03-01 14:11:44 +01:00
d0e245647c Cleanup: use unsigned types in 3D view editor 2019-03-01 23:43:34 +11:00
053c3bd48a Tool System: add a mode option to 3D view circle select
Support only basic operations: new/add/subtract.
2019-03-01 23:21:24 +11:00
3c10de2c9b 3D View: avoid redundant circle select updates
This refreshes on cursor motion so it's worth avoiding redundant
updates, especially for multi-object edit-modes where many objects
aren't even near the object being selected.

This commit also moves to passing eSelectOp to circle select functions
in preparation for adding a select mode tool option.
2019-03-01 23:09:22 +11:00
3982d3c171 WM: add gesture variable to detect first execution
Needed for circle select to replace the current selection.
2019-03-01 23:00:11 +11:00
9f77c20286 Fix T62053: Composite rendering more images than needed
Reviewers: brecht

Maniphest Tasks: T62053

Differential Revision: https://developer.blender.org/D4432
2019-03-01 12:51:04 +01:00
cbbdb5249f 3D View: move particle circle select out of object mode loop
This doesn't support multi-object editing, no reason to check others.
2019-03-01 22:27:44 +11:00
e795dd4a20 Revert "UI: File menu tweaks."
This reverts commit b104b3cdcf and 04baefcc2f. Changes to core UI like
this should go through review, and doing them during Beta development is
not generally the right moment unless they fix an important problem.
2019-03-01 11:14:38 +01:00
31509461f1 UI: Make Auto Smooth panel open by default 2019-03-01 10:45:59 +01:00
2a731adae7 Fix T62015: Duplicating object, rotating, pivot point not used
Was caused by another fix in the area, and root to the wrong though that
transformation is only initialized from a fully evaluated dependency graph.

The latter one is not a case when changing transformation mode.

Solved by copying transform to an evaluated object.
2019-03-01 10:25:14 +01:00
0451043045 Fix flag on wrong object being modified
The intention was to disable constraints prior evaluation of
the object.

Spotted by Campbell, thanks!
2019-03-01 10:03:07 +01:00
Stefan Werner
1915b5338b build_environment: Fixed make deps on macOS
Two changes:
Removed the explicit version for the macOS SDK, recent
versions of Xcode have a symlink to the newest SDK.
Fixed the build script for OpenMP by removing extra ' marks that
install_name_tool took literally and replaced INSTALL_PATH with
INSTALL_DIR.
2019-03-01 10:01:55 +01:00
90526e1606 WM: improve support for binding actions to modifier keys
Previously a modifier key-map type only worked when the same key was
enabled as a modifier as well.

This allows for users to assign an action to double-tap-shift for eg.
2019-03-01 16:59:28 +11:00
5e32bd47e8 Cleanup: Use braces in event matching logic
Also no need to map the event type for inactive keys.
2019-03-01 16:38:39 +11:00
98bb22a207 Fix object mode lasso de-selection
Lasso actions that only de-selected were handled as if nothing changed.
2019-03-01 14:08:05 +11:00
1bb71a82cb Cleanup: de-duplicate RNA array default args 2019-03-01 13:21:08 +11:00
3bcad47357 Fix T62068: rotation incorrectly re-uses axis
Regression in recent transform changes.
2019-03-01 13:06:20 +11:00
69665bc7f0 RNA: move cursor into own struct
Without this it's impractical to subscribe to any change to the cursor.

Fixes T61969 by having gizmos update on any change to the cursor.
2019-03-01 12:41:40 +11:00
795effcbc8 Fix T61825: animated images not working immediately when enabling auto refresh. 2019-03-01 02:12:40 +01:00
e5194835de Fix T61929: crash on undo in some files with local view. 2019-03-01 01:39:43 +01:00
805f8f8230 Comments: add comments for new transform struct members. 2019-03-01 10:56:46 +11:00
c18289da93 Cleanup: minor improvements to transform comments. 2019-03-01 10:56:46 +11:00
5564601d45 Cleanup: Use const for static number.
Also use double indent instead of mixed tab/spaces.
2019-03-01 10:56:46 +11:00
83fc6103e5 Cleanup: pep8 2019-03-01 10:56:46 +11:00
1f22e3f311 Fix macOS OpenMP build error when using a build folder name with spaces.
Patch by Campbell.
2019-03-01 00:26:42 +01:00
41d1582f1d Cleanup and refactor sequencer proxy properties panel
Split SEQUENCER_PT_proxy to:

SEQUENCER_PT_proxy_settings
 - global settings and operators
SEQUENCER_PT_strip_proxy
 - proxy settings per strip

Author: Guillaume M (mathers)

Reviewed by: ISS, campbellbarton

Differential Revision: https://developer.blender.org/D4262
2019-02-28 15:10:19 -08:00
680c7209ec Hair Particle: Fix issue on OSX due to hardware accelerated subdivision
Workaround to tranform feedback not working on mac.
On some system it crashes (see T58489) and on some other it outputs
garbage (see T60171).

So instead of using transform feedback we render to a texture,
readback the result to system memory and reupload as VBO data.
It is really not ideal performance wise, but it is the simplest
and the most local workaround that still uses the power of the GPU.

This should fix T59426, T60171 and T58489.
2019-02-28 22:56:45 +01:00
fbd8c7dc4e UI: hierarchical nesting
Use correct hierarchical nesting in camera and mesh obdata properties
2019-02-28 22:54:06 +01:00
d505592ffd UI: un-expand enum
Enums don't work well when expanded vertically like this
2019-02-28 21:58:36 +01:00
962af13b18 UI: Properties hierarchical nesting
Make hierarchy more clear and consistent in Render, Object and Particles
2019-02-28 21:53:14 +01:00
993f43dc9e Cleanup/refactor clnor code: add high-level helpers to set custom normals.
Now it will be simpler for code jsut wanting to preserve custom normals
around to set them, without having to add same boiler plate code all the
time around actual code.
2019-02-28 20:47:50 +01:00
090b8c14d2 Fix (unreported) assert in modifier evaluation of weighted normals.
Currently modifier stack assumes there are no poly normals data passed
around, so in case a modifier generates such data, it has to clean it up
after usage.

Whole handling of normals is a bit annoying and week currently, we can
probably enhance that once fully per-mesh item type cddata masks are in?
2019-02-28 20:47:50 +01:00
7d0fcaa69a 'Fix' T61942: Triangulate modifier breaks custom normals.
Not a bug, but supporting preservation of custom normals in that
specific modifier makes sense, in game pipeline contexts.

Could also ease work of IO add-ons that want to export
triangulated geometry...
2019-02-28 20:47:50 +01:00
f95f1a47b4 CustomData: add function to clear layers' flags.
We only had one to set those flags, up til now...
2019-02-28 20:47:50 +01:00
3b3b86f62a UI: Particles
Nicer alignment in Vertex Groups panel
2019-02-28 20:46:05 +01:00
Pablo Vazquez
b104b3cdcf UI: File menu tweaks.
* Group Export with Save, Save As, Save Copy.
* Group Import with Link, Append.

Suggested by @fsiddi
2019-02-28 20:32:39 +01:00
Pablo Vazquez
05bb793b39 UI: Minor tweak on Object Type Visibility popover.
Mirror order of items as in 'Add' object menu.
2019-02-28 20:09:53 +01:00
050cf891f2 GPencil: Cleanup style 2019-02-28 19:54:07 +01:00
Pablo Vazquez
04baefcc2f UI: File menu tweaks.
* Move Revert, Recover Last Session, Recover Auto Save to its own sub-menu.
  Had three entries of the same category, and solves user reports on "Revert" being dangerously accessible under Open.
* Move up Link, Append, Import, Export as they are used more often than e.g. Save Startup File.
2019-02-28 19:45:21 +01:00
775936f0b2 Merge branch 'blender2.7' 2019-02-28 19:17:54 +01:00
da1323d1c9 Fix T60366: texture paint slots not updating when editing material.
Now always refresh when the material changes. Depsgraph tag moved out
of the refresh function since that gets called on depsgraph update,
which should not trigger a second depsgraph update.
2019-02-28 19:17:16 +01:00
e395c82d1f Fix Cycles animation denoising not working for files on a network drive.
Can't do cross-device renaming, so put temporary file in same folder as
output file.
2019-02-28 19:16:08 +01:00
Pablo Vazquez
acd4623471 UI: 3D View 'Add' Menu tweaks
* Remove single item Armature sub-menu. Add Armature straight away, unless the menu is expanded (like with Rigify enabled)
* Group Light and Light Probe between separators
* Move the lesser used Speaker item below Camera
2019-02-28 18:54:00 +01:00
95b150ba87 Depsgraph: Fix wrong disabled bases deletion
Original optimization idea was wrong: it is possible that some other
ID would reference an object which is also used by a base.

Rolled back to a bit more fragile solution.

In the future would be nice to make it somewhat less duplicated with
the builder itself.

Fixes assert failure (and possibly crashes) when adding grease pencil
object and switching to a draw mode.
2019-02-28 18:48:28 +01:00
f864cbd705 Cleanup: Snake style in depsgraph
While it's kind of common to use camel case in C++ this is not
currently agreed style for C++ in Blender.

Got confused by working on other areas with 3rd party libraries.
2019-02-28 18:41:37 +01:00
d3294fd93f UI: Contextual menus
-Rename 'Specials' menus to 'Context' menus for Grease Pencil
-Make Grease Pencil contextual menus follow the design of the regular contextual menus more
-Add more useful operators to the contextual menus in the paint modes
2019-02-28 18:14:48 +01:00
2215541967 Fix T62012: Non-animated property, stuck in previously keyframed values
Was missing ID recalc tag.
2019-02-28 18:09:10 +01:00
2cd478cf19 GPencil: Rename variable name and add alpha to outline
The outline now has some alpha to be more consistent with other Blender areas.
2019-02-28 17:13:05 +01:00
0f37d7162b GPencil: Disable Outline if Overlay is disabled
The main overlay switch and outline option must be checked.
2019-02-28 17:13:05 +01:00
175cb0a0af GPencil: Remove comment line added by error to header text
This line was added accidentally in the header text.
2019-02-28 17:13:05 +01:00
acb3858399 GPencil: Increase outline to 2 pixels
The selection outline of 1 pixel was too thin.
2019-02-28 17:13:05 +01:00
d8f9797c28 GPencil: Hide selecction outline when play animation 2019-02-28 17:13:05 +01:00
5411efdeed GPencil: Draw Outline to Active and Selected objects
Now an outline is drawn when the grease pencil is selected.
2019-02-28 17:13:05 +01:00
9ddc2064a4 GPencil: Remove dummy marker for Grease Pencil objects
After adding selecction using strokes, the dummy is not required because it was added as a provisional solution while we implement stroke selection.
2019-02-28 17:13:05 +01:00
461b1bdfbf GPencil: Add selection support for objects using strokes
Now it's possible to select a grease pencil object without using the dummy.
2019-02-28 17:13:05 +01:00
Pablo Vazquez
8ca45e929a Wonky Menu Down Arrow
Almost every pulldown menu and popover has a little dropdown arrow shape.

Unfortunately it is a bit wonky.  The top of the right side of it is wider than the top of the left side. And both sides are narrower at the bottom than the top. It might be hard to see, but this image should help:

{F6728281}

The patch fixes the symmetry of the shape while keeping the weight as similar as possible. In the following image you can see the outline of the current version in red and this new version in green.

{F6728298}

With patch applied the arrow looks perfect:

{F6728302}

Reviewers: brecht, billreynish

Reviewed By: billreynish

Subscribers: pablovazquez

Tags: #bf_blender, #bf_blender_2.8, #user_interface

Differential Revision: https://developer.blender.org/D4424
2019-02-28 17:05:13 +01:00
ac8c4aad30 Revert "Objects: Remove Textured from object display type"
This reverts commit 6a4a984ff7.
2019-02-28 16:51:24 +01:00
846d265a06 Split base flags on own and collection-defined
This allows to update base flags to a proper state then object's restriction
flags are changed, without requiring to re-evaluate an entire tree of flags.

Some old unused flags are were removed by this change, and also disabling
menu items might not work the same as before. This is something we can bring
back if it's really needed (the way how flags are handled did change since
that interface code was done anyway, so code was looking weird anyway).

Reviewers: brecht

Differential Revision: https://developer.blender.org/D4420
2019-02-28 16:35:12 +01:00
7895c6b83d Remove unused base flag
Was only set and read from a single location.
Removing to keep things more manageable.
2019-02-28 16:35:12 +01:00
8d6732d1f7 Depsgraph: Keep objects which has animated visibility
This allows dependency graph to evaluate drivers of those objects
and put them to a correct state. It will increase memory usage
since now we can no longer save it by skipping copy-on-write for
such objects. It will also currently make things slower, because
we do not have granular enough visibility update of components in
the dependency graph. Can do it later when the rest of the changes
are finished.

This commit does not update restriction flags on the base, since
that is somewhat tricky to do currently: need to somehow see whether
object is disabled due to flags on collection or due to own flags.

Differential Revision: https://developer.blender.org/D4419
2019-02-28 16:28:24 +01:00
9eaa577b9b Depsgraph: Route visibility flags update to proper component 2019-02-28 16:28:24 +01:00
ed90de08e3 Depsgraph: Change the logic about keeping bases in the graph
The idea is to keep bases which are known for sure to be in the
dependency graph. Previously, this code was duplicating logic
around checking restriction flags, which becomes more hard to
maintain once we are moving towards to more comprehensive checks
about whether base is a part of evaluated scene or not.
2019-02-28 16:28:24 +01:00
6a4a984ff7 Objects: Remove Textured from object display type
As discussed with @billreynish this makes little sense now that we don't
have a dedicated textured mode. We don't have a superior texture or shaded
mode anymore and we also cannot mix different engines together (workbench
with eevee/lookdev).

The only feature it removes is the possibility to hide textures for certain
object in solid mode.
2019-02-28 16:15:50 +01:00
cd897c57f8 Fix T62040: Irradiance Volume broken
Was broken by 6a03199b50.

Reintroducing the padding along with a few comment to not reproduce the
same errors.
2019-02-28 16:15:50 +01:00
921c37bfa3 Fix T62050: remove non-persistent timers in load-pre callback
This actually makes more sense than removing them in the
load-post callback. During load, the file might register
timers that would be removed immediately.
2019-02-28 16:07:56 +01:00
5938fd4ccc Fix T61994: crash when box selecting instances
Reviewers: brecht

Differential Revision: https://developer.blender.org/D4427
2019-02-28 15:53:01 +01:00
d7d180bd3d Fix T62021: Wireframe input node doesn't work properly
This fixes the general case. It is still not supported for hairs.

Added a hack in the geometry node to avoid unnecessary geometry shader
usage.
2019-02-28 14:11:12 +01:00
d68484a60f Fix T58405: viewport drawing issues with display device set to None.
Disabling color management this way is not very useful, but as long as the
option is there it should work correct.
2019-02-28 13:41:48 +01:00
bbe5a95d05 Fix T58875: object paste and append Active Collection property not working. 2019-02-28 13:02:55 +01:00
5397f1e45d Preferences: Remove warning concerning selection in edit mode with MSAA
We don't use MSAA anymore for the selection buffers so this warning is no
longer relevant.
2019-02-28 12:10:04 +01:00
4b916612e1 Fix T61878: Selection does not allways work in wireframe mode
This draw surfaces if the xray option is disabled even in wireframe mode.
2019-02-28 12:10:04 +01:00
9d34a9d7e5 DRW: add back edge highlighting for active face drawing
Removed in aa7b013bd5 for performance reasons, however highlights
can't always be seen against specular shading, see: T55456#510873

Instead of having a highlighted inner-edge, use the active edge color.
2019-02-28 18:03:31 +11:00
dd9cedddae 3D View: only calculate view center when needed
When orbit around selection was enabled the selection center was being
calculated even when it wasn't needed.
2019-02-28 15:40:28 +11:00
60a1ccbe2c DRW: use active color for face dot
Matches active vert/edge modes.
2019-02-28 14:57:03 +11:00
e735894070 UI: rename Quit Prompt to Save Prompt
Eventually this should be used to prompt when loading a new file too.
2019-02-28 13:21:25 +11:00
d7baf8e7e7 UI: change behavior for quit prompt
Remove confirmation popup menu, just exit.

Note that this option is mainly for developers or people reviewing
blend files, see D4406 for discussion on reason for keeping this feature
while simplifying how it works.
2019-02-28 13:09:56 +11:00
3d4d7b97c2 Cleanup: style 2019-02-28 12:30:56 +11:00
c51516c3fb Update for rename: constraint_orientation -> orient_type 2019-02-28 12:30:56 +11:00
d4366d57b0 icons_geom: update from svn rev 62198
In the future we'll try to avoid such big updates,
adjusting to material colors could have caused so many files to change.
2019-02-28 12:16:16 +11:00
7188250523 Fix missing NULL check in recent transform changes
Caused bevel to crash.
2019-02-28 12:14:55 +11:00
8aa5eadc54 Cleanup: warning 2019-02-28 12:14:55 +11:00
b1c3d91aed Makefile: icons target now uses make variables
Add examples in help text.
2019-02-28 10:37:49 +11:00
c6681c65dd Makefile: use BLENDER_BIN variable if passed in
When the default build path isn't used,
it's still handy to be able to run utility commands.
2019-02-28 10:35:38 +11:00
c702e57b3c Makefile: move help text to string literal
Editing text in @echo commands wasn't convenient.
2019-02-28 10:12:24 +11:00
005626b8c6 Refactors preview drawing code with few functional modifications:
Fix T61241

 - Changing preview size does not affect drawn image size, only resolution.
 -- Consistent behavior, when changing full-size / proxy / scene render size
 -- Scopes are rendered in *same size* as source image
 -- Over all, user does not have to readjust preview zoom.

Reviewed by: Brecht

Differential revision: https://developer.blender.org/D4315
2019-02-27 13:48:27 -08:00
Pablo Vazquez
b9a37dd97a UI Particles: Minor tweaks to labels
* Capitalize 'Orientation Axis' and 'Multiply Mass with Size'
* Rename 'Scaling' to 'Radius Scale'
2019-02-27 19:50:34 +01:00
Pablo Vazquez
7dd802e66d UI: Rename 'Object' to 'Object Velocity' in particle settings 2019-02-27 19:50:34 +01:00
Pablo Vazquez
5e039c29c8 UI: Rename Display -> Viewport Display panel 2019-02-27 19:50:34 +01:00
3ad2d6caef Cleanup: better names and comments for library ID linking code.
Differential Revision: https://developer.blender.org/D4415
2019-02-27 19:37:42 +01:00
8c4b5ac4c1 Fix T62007: Dial 3d being drawn out of rotating tool.
It was being drawn when any Gizmo was highlighted.
There are several ways to solve this (creating a new parameter to the operator, checking the gizmos in the invoke or creating a global context).
Also, for a micro-optimization, all of those conditions in the `drawDial3d` could be done once in the invoke.
But since all of these changes involve changing the customdata (`TransInfo`), which is already a bit confusing with so many members, I thought it best to make minimal changes.
2019-02-27 13:37:12 -03:00
2b892c6c21 Fix T61988, Bevel miter on small scale.
Take two at fix, hopefully without unintended commits
to submodules this time.
2019-02-27 11:52:30 -05:00
495216d2b8 Armature: Make selection only work on outlines in wireframe mode
This was not working in edit mode and broken in posemode + bounding box
display type.

This makes possible to select bones inside other bones.
2019-02-27 17:46:17 +01:00
28ccc0fa2f Armature: Remove the Transparent Bone overlay option
The option is replaced by the Wireframe mode display which (in edit & pose
mode) does exactly what transparent bones did.
2019-02-27 17:46:17 +01:00
fe5d26807b Armature: Force Transparent bone in wireframe display type/mode
This makes the bones transparent when the object or the viewport display
type is Wireframe. This is in order to make things consistent.

In object mode all bones are fully transparent to not create more visual
noise if the scene is complex.

Another small addition is that the Bounding Box draw mode now works as
expected on armatures.
2019-02-27 17:46:17 +01:00
4243c29463 Revert "Fix T61988: Bevel mitering on small objects."
This reverts commit 048088e1d2.
Accidentally changed submodules. Will resubmit with only
intended changes later.
2019-02-27 11:42:48 -05:00
f57fce3534 Revert "Add library-hint to datablock search menus."
This reverts commit 4669c3692c.
2019-02-27 16:44:49 +01:00
9d6a1b990f Revert "Fix broken 'search pointer' UI since this morning."
This reverts commit 456e3f00e0.
2019-02-27 16:44:49 +01:00
03da3b6593 Transform: fix redo rotate adjusting orientation
Regression in recent update.
Also de-duplicate orientation matrix initialization.
2019-02-28 02:37:17 +11:00
4cd7dc6860 GPencil: Fix memory leak issue
After a previous commit to use unique identifiers for Ghash key, I had missed to free the memory of the name key.

Thanks to Jacques Lucke for detecting the leak.
2019-02-27 15:59:55 +01:00
665d987e7b Keymap: use tap/drag for mode switching w/ pref enabled 2019-02-28 01:04:32 +11:00
117bc1477e Cleanup: remove redundant property assignment
Also cleanup comments
2019-02-28 01:04:32 +11:00
87066782e7 Depsgraph: Make it easier to control which bases being pulled into the graph
Just de-duplicates some logic. Should be no functional changes.
2019-02-27 14:50:42 +01:00
05dc3d43ca Move base flags evaluation to its own function
No need to have iterator loop in the view layer evaluation,
this only makes it more difficult to have base flags covered
by the dependency graph.

Other good thing is that we don't need to worry about whether
base has been removed from the evaluated view layer or not.

Reviewers: brecht

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D4414
2019-02-27 14:45:38 +01:00
8a432c1a40 Transform: shear redo support for other orientations
Shear gizmo now uses a single orientation and sets
different ortho axis instead of constructing a different matrix for
each handle - allowing the redo panel to select orientations.
2019-02-28 00:23:43 +11:00
048088e1d2 Fix T61988: Bevel mitering on small objects.
When edges had small length (less than about .005) the angle
classification didn't work. Needed some normalization of vectors.
2019-02-27 07:51:57 -05:00
Vaishnav S
afc5f82d8d Fix typos related to units 2019-02-27 13:23:27 +01:00
d1f7ae29a2 Cleanup: use "_pad" prefix for pad vars 2019-02-27 22:20:29 +11:00
e097e0c833 Cleanup: header guard names
Missed in file rename.
2019-02-27 19:59:19 +11:00
dd228aa1f6 Fix T61945: Scaling with invalid snap distances
ApplySnapResize did not take into account invalid distances. Added check for this.

Reviewed By: Campbell Barton

Differential Revision: https://developer.blender.org/D4417
2019-02-27 09:30:37 +01:00
4732f90a4f GP: Use unique names for instance objects
When instance objects linked, the name could not be unique.
2019-02-27 08:50:29 +01:00
6155faf5bd GP: Check if Instance loop is needed
This reduces the loop time if the scene is not using instances.
2019-02-27 08:41:13 +01:00
7618851f74 GP: Optimize Instances drawing loop 2019-02-27 08:32:55 +01:00
80ef7fbeb1 Transform: refactor orientation naming and usasge
Transform orientation was previously related to constraints,
recent changes meant it was used even when not constraining to an axis.

Now transform orientation is separate from axis constraints.
2019-02-27 17:30:51 +11:00
3f23b5ffd5 Correct error in recent transform refactor 2019-02-27 16:39:03 +11:00
b21007757f DRW: disable wide edges when face-dots are used
Users who prefer to use face dot's don't get an advantage from drawing
thicker wire.

Requested by @ward
2019-02-27 16:06:37 +11:00
cdda910fc3 Cleanup: remove runtime structs from DNA 2019-02-27 15:39:12 +11:00
79171b15e4 makesdna: enforce use of '_pad' naming convention 2019-02-27 15:27:07 +11:00
6a03199b50 Cleanup: use '_pad' convention for padding in all DNA structs
Avoids mixing these in with regular variables in code-completion.

Use char for pad members except for 'void *', to make size clearer.

Removed/shrink a few redundant padding vars which were >= 8 bytes.
2019-02-27 15:09:48 +11:00
ea69d98580 Cleanup: remove runtime structs from DNA 2019-02-27 14:00:59 +11:00
f595d558f0 Cleanup: remove unused Material.pr_light
Also no need for 14 bytes of padding.
2019-02-27 13:08:06 +11:00
168d3fd528 Cleanup: file rename lamp -> light 2019-02-27 12:36:32 +11:00
1079742db9 Cleanup: rename lamp -> light 2019-02-27 12:26:49 +11:00
918941483f Cleanup: Main struct member names
Rename latt to lattice and don't use plural names.
2019-02-27 11:14:41 +11:00
3051e2f4ae DNA: rename Lamp -> Light
- BKE_lamp -> BKE_light
- Main.lamp -> light
2019-02-27 11:03:16 +11:00
Dalai Felinto
ce104ca896 Fix: Grease Pencil data panels not working with pinning
Note: Things were working fine if you were to pin the Grease Pencil
object, but not if you were pinning the GP data.

In too many poll functions context.object was being requested when
a simple context.gpencil_data would suffit.

Panels that are still not showing in pinning:
* DATA_PT_gpencil_display.

The panel needs to be split in sub-panels, leaving all object-dependent
properties in its own panel so we can poll it away, while showing the
rest.

* * *

This commit doesn't handle greasepencil material. In this case I
recommend we do as properties_material.py and have a generous poll(),
followed by different drawing logics whether or not we have an object.
2019-02-26 19:51:13 -03:00
Dalai Felinto
1beada2c62 Grease Pencil: Strokes Cut icon
The icon was there, but it was not in the Export collection, nor
was it correctly named.
2019-02-26 17:31:52 -03:00
Dalai Felinto
3d59599afe Grease Pencil: Silence warning 2019-02-26 17:31:52 -03:00
b4db7d80f1 Cleanup: use 'poly' for polygons-related data, not 'face'.
In Blender face is for tesselated faces, that kind of miss-naming is a
pretty good way to shoot yourself in the foot at some point or another
(see T61979)...
2019-02-26 21:00:18 +01:00
cae56ad6a2 Fix T61979: Solidify not working in Blender 2.8.
Broken logic in rB181356edba04, thanks most likely to stupid naming
(face in Blender is for tessellated faces, use poly for BMesh polygons).

Cleanup to follow in next commit...
2019-02-26 21:00:18 +01:00
788778d985 GP: Cleanup ToDo comment 2019-02-26 20:32:02 +01:00
930d0070b6 Fix T61956: Errors when instancing grease pencil objects
The problem was not only for instances, but for particles too, and produced segment fault.

For some reason due any internal modification of how duplicated objects are generated, the duplicated object are not available when the draw manager try to use runtime data.

Now, before drawing the particle or the instance, the pointers of the duplicated objects are reassigned to the original "real object" to get full access to runtime data.
2019-02-26 20:28:58 +01:00
92766fb965 UI: Move Pivot next to Orientation in header
-The pivot point and orientation of any transform are strongly related
-It matches the comma-key and period-key on the keyboard who are neighbours
-We get slightly nicer grouping this way, with the two axis-related options on the left and the two toggles on the right

Reviewers: pablovazquez, campbellbarton
Differential Revision: https://developer.blender.org/D4413
2019-02-26 20:24:40 +01:00
4d9697a5a9 Merge branch 'blender2.7' 2019-02-26 20:07:36 +01:00
6b6d1e424c Cleanup: prevent future issues with ID.tag overflow, clarify somes names. 2019-02-26 20:05:28 +01:00
564d252d60 Cleanup: remove unnecessary assert. 2019-02-26 20:01:20 +01:00
2977eb5a0e UI: Icons
New icons from Andrzej Ambroż / jendrzych:
-New trash icon for deleting ID's and other data (currently unused)
-New icon for the Grease Pencil select between strokes mode
-New icon for Proportional Editing Root Falloff curve

Also adjustments for Jump to Next / Prev. Keyframe, Camera ObData, Point Light ObData, Light Probe Object and ObData, Collection & Save icons.
2019-02-26 19:29:01 +01:00
d541430785 UI: Show marker lines in remaining animation spaces
This also includes fixed/slighly refactored drawing code for marker lines.
The old code used the wrong height.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D4411
2019-02-26 17:24:36 +01:00
2b3553eff2 GP: Redesign wireframe mode
Now it's possible use the different Wire modes (Single, Object & Random)

Also support for x-ray mode.

For random colors, the name of the object and the name of the layer is used.

Also some parameters cleanup.
2019-02-26 17:09:29 +01:00
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
ff304d3665 Cycles: Fix build error
introduced by rBdabe5cd31add8aa55b9ad4bce1b591ed4e98f1a1
2019-02-26 08:32:41 -07:00
cb8614e398 Fix (unreported): Snap to grid not considering Focal Length. 2019-02-26 11:38:46 -03:00
07c0174717 Cycles: Fix build error
introduced by rBdabe5cd31add8aa55b9ad4bce1b591ed4e98f1a1
2019-02-26 08:33:47 -07:00
b64856f308 Fix T61637: Edge extrude always uses normal orientation 2019-02-27 02:05:18 +11:00
34c7dbdd7d BLI_math: quat_to_axis_angle was zeroing the axis
When there was no rotation the axis was zerod,
while not exactly a bug, it means changing the angle does nothing
and all axis-angle values are initialized with Y=1,
use this convention when resetting the axis too.
2019-02-27 00:11:23 +11:00
15edae617f Merge branch 'blender2.7' 2019-02-26 14:07:57 +01:00
dabe5cd31a T61971: Compilation Displacement/Background Kernel
Displacement and Background kernels are selectively used, but always compiled. This patch will not compile these kernels when they are not needed.

Displacement kernel is only used for true displacement.
Background kernel is only used when there is a (Cycles)Light of type `LIGHT_BACKGROUND`.

Reviewed By: brecht, #cycles

Tags: #cycles

Maniphest Tasks: T61971

Differential Revision: https://developer.blender.org/D4412
2019-02-26 14:06:25 +01:00
f76c15efb7 Bevel mod: cleanup flags and extra data.
Removed a clnors field unneeded after a recent refactor.
Finished deprecation of flags that haven't been used since pre-bmesh.
2019-02-26 07:35:54 -05:00
95b7d2be2c Units: GP Canvas Offset
Use PROP_TRANSLATION for this to make it correctly display units in the UI.
2019-02-26 13:03:38 +01:00
e6099c7e46 T61576: Do Not (Re-)Compile OpenCL kernels
The goal of this patch is to have limit the number of times
kernels needs to be compiled and are reused as kernels with
different compile directives can lead to identical same
binaries.

The implementation does this by stripping the compile directives.
and reshuffling kernels so the output is more likely to be the
same.

We focussed on the kernels where it was easy to detect and maintain
(bundle, bake, displace, do_volume and background). More optimizations
could be done but they are probably less obvious.

Merged the data_init and state_buffer_size kernels to split_bundle.

This patch will also remove empty kernels for do_volume and bake
when their features are not enabled.

When using the benchmark files there are less background, bake and
do_volume kernels compiled.

Fix: T61576, T61501, T61466

Reviewed By: brecht, #cycles

Differential Revision: https://developer.blender.org/D4390
2019-02-26 12:45:26 +01:00
96f894ae34 Cleanup: Spelling in comment 2019-02-26 12:17:45 +01:00
9dd25a6b2a Depsgraph: Make parameters exit dependent on ID properties 2019-02-26 12:17:45 +01:00
e5be16175e Missed last commit 2019-02-26 21:21:17 +11:00
6ebad22091 Transform: fix rotate redo behavior
- Add XYZ option.
- Orientation now works as expected.

Now a redo for rotation works logically,
setting the axis to Z & the orientation to view.

Resolves T57205
2019-02-26 21:17:17 +11:00
0a87bf6784 Transform: don't set the user constraint when it's not set
The orientation for the redo panel would be set even when not used,
add an 'unset' orientation which defaults to global.
2019-02-26 21:15:45 +11:00
13dd8b69f0 GP: Rename "Dualtone" to "Duotone" 2019-02-26 10:15:13 +01:00
c182bb3adb Fix indentation issue introduced in rB54ffc4e19dc4 2019-02-26 09:33:21 +01:00
06961515e4 Fix T61965: Crash edit-mesh drawing w/ hidden faces 2019-02-26 16:04:23 +11:00
58a394073f BMesh: utility functions for visible element access
Needed for drawing code which skips hidden elements.
2019-02-26 16:03:21 +11:00
2986923f8c UI: disable split layout for cursor transform
There isn't much horizontal space in the side-bar,
also object transform which is very similar doesn't use a split layout.
2019-02-26 14:31:54 +11:00
186bd4d87b Cleanup: indentation, trailing space 2019-02-26 14:31:48 +11:00
1de11c38d4 Cleanup: assign rotation_mode to a variable
Don't access multiple times per draw.
2019-02-26 14:16:37 +11:00
54ffc4e19d Grease Pencil naming: Use clear names for depth ordering
- Add a new panel to differentiate between viewport display and stroke options
- Use clearer naming for depth ordering and stroke thickness properties

Reviewers: antoniov
Differential Revision: https://developer.blender.org/D4405
2019-02-25 21:59:35 +01:00
7efc26709c I18n: enable Abkhaz in Blender. 2019-02-25 20:40:31 +01:00
98c90df56c Merge branch 'blender2.7' 2019-02-25 19:55:49 +01:00
7e40a231a7 Fix T61946: Cycles border render missing samples and crypto metadata. 2019-02-25 19:54:48 +01:00
753e73009f Fix T61801: Wireframes on curves not working 2019-02-25 19:37:16 +01:00
a7acd4690c GP: Rename Colorize "Bi-Tone" to "Dualtone" 2019-02-25 17:46:15 +01:00
5d8a8a6842 GP: Add support for Wireframe mode
When enable Wireframe mode in the shading type, all strokes are displayed as simple 1 pixel lines.

The color of the line is equal to the stroke color or the fill color if the fill is enabled and the stroke is disabled or has invisible alpha value.

In wireframe mode, all FX are disabled because sometimes the effects can make the lines invisible.

The modifiers are not disabled.

Still pending to decide if we must add support for Random colors, but not sure if this is useful in 2D.
2019-02-25 17:46:15 +01:00
cfc2fa33bf Fix transform scale header printing
Clearing constrained axes caused the scale not to print correctly.
2019-02-26 03:20:40 +11:00
f131714056 Fix (unreported) broken code in RNA's datatransfer source layer enum function.
Same issue as in own previous commit actually.
2019-02-25 16:53:11 +01:00
76a9d1984f Fix (unreported) broken code in RNA's datatransfer source layer enum function.
Using a CDLayer data type instead of expected mask... tsst... ;)
2019-02-25 16:41:50 +01:00
c1f9127b64 RNA: disable animating the 3D cursor
Decorators took up space in the UI and this doesn't seem very useful.
2019-02-26 01:49:14 +11:00
86c0ee8020 3D View: support for editing cursor rotation
Add buttons for editing the cursor rotation as well as rotation modes,
similar to object and pose bones.
2019-02-26 01:37:49 +11:00
213ac7b1ac Cleanup: use const args for BLI_math_rotation 2019-02-25 23:18:55 +11:00
54a5059fe9 Cleanup: finish modifiers' hearder re-order from rBe31f0fad9744c813.
For some reason forgot to handle half of modifier files...
2019-02-25 11:57:14 +01:00
Vaishnav S
5ca5e67cc6 Units: Typo "Square/Cubic Thous" -> "Square/Cubic Thou" 2019-02-25 11:43:41 +01:00
e31f0fad97 Cleanup: order of modifiers' headers includes.
BLI should always comes first, before DNA, BKE etc. And
`BLI_utildefines.h` should come before any other BLI (since it's some
sort of system include really, among other things...).

Thisi should help to reduce the noise in patches when adding stuff
like uint64_t members to DNA structs... ;)
2019-02-25 11:39:14 +01:00
1419399f03 Fix T61919: Rename "Smooth Vertex" -> "Smooth Vertices" 2019-02-25 11:12:17 +01:00
b80ff7e2f1 Merge branch 'blender2.7' 2019-02-25 10:29:05 +01:00
9ad379fe55 Fix T61891: Cycles light use nodes button greyed out. 2019-02-25 10:24:40 +01:00
012483b6e4 Fix T60880: Assert deleting grease pencil object from outliner 2019-02-25 16:52:20 +11:00
9a311c58aa writefile: disable buffering when writing ZLIB
While Buffering output is useful for file writing and memfile
compression it's redundant when the output is already buffered.
It doesn't make a significant difference for ZLIB
however it makes a moderate improvement for LZ4, see T56162.
2019-02-25 13:27:23 +11:00
893fa59831 readfile: re-enable read on demand for WIN32
Revert workaround for T61855. It's likely this was caused by slow seek
for compressed files since the same behavior happens on Linux T61880.
2019-02-25 09:02:19 +11:00
5d7ce96b5d GP: Don't set cache as dirty with Onion 2019-02-24 17:00:12 +01:00
ccfda7dc2c GP: Disable Onion calculation when Overlay is OFF
Now, it's not required to disable the Onion in Overlay panel.
2019-02-24 16:03:03 +01:00
20dfa8aa28 readfile: minor changes to support other compression formats
Allow different readers to re-use the file descriptor.
2019-02-24 23:42:05 +11:00
6bab905c9d readfile: Disable delayed data reading for compressed blend files
Seeking gzip files is very slow, disable it.

Resolves T61880
2019-02-24 12:47:48 +11:00
8ed82e82e6 readfile: use regular file access when not a gzip
Allows for different behavior w/ compressed files,
will also make it simpler to support other compression types,
see: T56162
2019-02-24 12:41:37 +11:00
519982fd3e Cleanup: de-duplicate readfile file opening 2019-02-24 10:48:36 +11:00
2f8d8b5e5e GPUBuffer: Fix fast navigate in on smoooth multires grid 2019-02-23 22:36:04 +01:00
f680ab9c4e Fix strips text offset when zooming VSE timeline
Glyph cache is cleared by UI_view2d_zoom_cache_reset, when zooming V2D, but is required to calculate text height in UI_view2d_text_cache_draw

This caused text in strips to "jump around"

There was a comment in UI_view2d_zoom_cache_reset:
While scaling we can accumulate fonts at many sizes (~20 or so).
Not an issue with embedded font, but can use over 500Mb with i18n ones! See [#38244].
2019-02-23 11:37:24 -08:00
82b3b1a3c6 Revert "Glyph cache is cleared by UI_view2d_zoom_cache_reset, when zooming V2D, but is required to calculate text height in UI_view2d_text_cache_draw"
Accidentaly committed unwanted changes.

This reverts commit 6bcdcc96c2.
2019-02-23 11:33:48 -08:00
5cc0bfa73a fix T61122 : Collada Importer: Added support for transparency for Materials.
This fix sets the Base color in the principled BSDF Shader and in
 the Material->r,g,b,a values. So the transparency and color are the
 same when switching the "use nodes" option for the material
2019-02-23 19:35:31 +01:00
5d822f4508 fix T61122 : Added support for Materials with Nodes disabled.
- The Collada exporter did not take care of
  material transparency when nodes are turned off.

- recent change to use ma->alpha_threshold seems to have
  been wrong. transparency is now taken from ma->a when
  nodes are turned off.
2019-02-23 18:17:46 +01:00
0207d20cd4 fix T59951: View all sequences does not take into account region overlap
fix centering preview

Reviewed by: Brecht

Differential revision: https://developer.blender.org/D4388
2019-02-23 06:16:52 -08:00
6bcdcc96c2 Glyph cache is cleared by UI_view2d_zoom_cache_reset, when zooming V2D, but is required to calculate text height in UI_view2d_text_cache_draw
This caused text in strips to "jump around"

There was a comment in UI_view2d_zoom_cache_reset:
While scaling we can accumulate fonts at many sizes (~20 or so).
Not an issue with embedded font, but can use over 500Mb with i18n ones! See [#38244].

Reviewed by: Brecht

Differential revision: https://developer.blender.org/D4389
2019-02-23 06:14:44 -08:00
6eb59c5778 Cleanup: GCC redundant declarations
Previous waning suppression was only tested with clang.
2019-02-23 22:18:34 +11:00
8214a1ae34 GP: Define new Draw Mode
Add a new Draw Mode to display panel in order to define the z-.depth order of the strokes using the real 3D position and not the 2D layer position.

This change makes possible to use VR with grease pencil drawings because the depth of the strokes change with camera position. Also, provide an alternative solution to tasks: T57859, T60325, 

The parameter only works with 3D space depth ordering. The Back and Front depths are incompatible with 3D Space mode.

Options are:
- Back
- Front
- 3D Space->2D Layers (default)
-3D Space->3D Location (new mode)
2019-02-23 11:46:24 +01:00
702a2ba0ef Cleanup: quiet undeclared variable warnings 2019-02-23 19:20:20 +11:00
af5cfa7544 Cleanup: quiet undeclared variable warning 2019-02-23 19:20:20 +11:00
9d309b7978 Cleanup: quiet undeclared variable warning
Also move view_ubo into G_draw.
2019-02-23 19:20:20 +11:00
7a5854f4ce Cleanup: quiet undeclared variable warning
Move bpy_context_module declaration to bpy_rna.h.
2019-02-23 19:20:20 +11:00
6ab634ccc4 Cleanup: use specific names for global variables
hash & hashsizes are generic names, be more specific & define the
generic names locally.

Quiet undeclared variable warnings.
2019-02-23 19:20:20 +11:00
9d78b7edb9 Cleanup: use function instead of extern variable
Quiet undeclared variable warning.
2019-02-23 19:20:19 +11:00
1d2fc413c8 make.bat: Preliminary Visual Studio 2019 support.
VS2019 is binary compatible with the existing vc14 libraries and no
new libraries libs are required in svn.

VS2019 support requires cmake 3.14.

VS2019 is still in pre-release state, you are required to explicitly
select the pre-release version by using:

make full 2019pre
2019-02-22 20:54:27 -07:00
633b77b0ee Make.bat: Fix sub-module detection 2019-02-22 20:53:29 -07:00
7ad367d023 make.bat: Preliminary Visual Studio 2019 support.
VS2019 is binary compatible with the existing vc14 libraries and no
new libraries libs are required in svn.

VS2019 support requires cmake 3.14.

VS2019 is still in pre-release state, you are required to explicitly
select the pre-release version by using:

make full 2019pre
2019-02-22 20:49:22 -07:00
10f3b49026 Make.bat: Fix sub-module detection 2019-02-22 20:02:45 -07:00
085e9e3bed Cleanup: move variable declarations to headers
Quiet undeclared variable warning.
2019-02-23 12:59:13 +11:00
779860d34e readfile: disable delayed data reading for WIN32
Seeking the file causes slow down on Windows.

Resolves T61855
2019-02-23 09:26:37 +11:00
Dalai Felinto
655faca105 Fix: Workbench assert on non-image texture node
This was not report, but it would happen if you open the sample file
from T61858 and changed to solid view with texture.
2019-02-22 18:01:30 -03:00
Dalai Felinto
e9f738754d Cleanup: Remove redudant function call
BKE_main_id_clear_newpoints is already called from copy_object_set_idnew().
2019-02-22 16:41:23 -03:00
0ca623362d Fix T61837: Assert in Eevee multiresolution modfier in sculpt mode
Note that this commit remove the support (that was not really working)
for shadows in sculpt mode.
2019-02-22 17:14:27 +01:00
3b132778de Multires: Support smooth shading when sculpting
On CCG side it is done similar to displacement, where we have
a dedicated functor which evaluates displacement. Might be seemed
as an overkill, but allows to decouple SubdivCCG from mesh entirely,
and maybe even free up coarse mesh in order to save some memory.

Some weak-looking aspect is the call to update normals from the
draw manager. Ideally, the manager will only draw what is already
evaluated. But it's a bit tricky to find a best place for this since
we avoid dependency graph updates during sculpt as much as possible.
The new code mimics the old code, this is how it was in 2.7.

Fix shading part of T58307.
2019-02-22 17:02:51 +01:00
Dalai Felinto
b6c61945ae Fix T55921: Toggling visibility for collections doesn't work in Pose
It is always dangerous to add more shortcuts those days. But this way it
is consistent with 2.79 to a point.

When in edit mode (mesh, greasepencil, ...) 1-3 to change submode still
has priority.

When in posemode or greasepencil draw mode however, 1-9 can still be
used to temporarily get some collections out of the way.
2019-02-22 12:33:24 -03:00
7372058649 Wireframe: Add object and random coloring option in wireframe mode
The option is separated from the solid mode color option.

Random color uses the same method as solid mode.

Selection state is indicated by a brighter color that is outside the
brightness range of the unselected state colors. The active state is
indicated by the outlines that is, now, still drawn in wireframe mode.

Coloring of the selection / active outline is not optimal because it
can look ugly in some cases of color combination. But the outline color
is using index range coloring so it's not trivial to change the color of
the outline per object. For now we use the same outline color used in solid
mode for consistency and also still add an emphasis on the selected objects.

The Single color option uses the theme color. Maybe it would be nice to
change the name of it in a latter commit to avoid confusion.
2019-02-22 16:06:23 +01:00
Dalai Felinto
e278b38b92 Fix T61788: Hidden objects reappear after rendering
The change in outliner and viewport visibility (897e047374) was made
assuming the bases of the render and viewport depsgraph were
independent. Thus we were deliberately setting base visibility when
rendering:

```
/* When rendering, visibility is controlled by the enable/disable option. */
if (mode == DAG_EVAL_RENDER) {
    base->flag |= BASE_VISIBLE;
}
```

However, we were syncing data back to the original depsgraph, leading to
hidden viewport objects to re-appear.

Reviewers: sergey

Differential Revision: https://developer.blender.org/D4391
2019-02-22 11:53:59 -03:00
ce79d86c08 Merge branch 'blender2.7' 2019-02-22 15:53:44 +01:00
3b86c99260 Fix previous commit
Somehow quote got missing the last moment.
2019-02-22 15:53:22 +01:00
86dd9bf53d Merge branch 'blender2.7' 2019-02-22 15:50:36 +01:00
427f3978e1 Always show version when running in background mode
The goal is to make it easy to know which exact blender version
and built was used for a job on a farm. This includes but not
exclusively render farms. But same is handy for simulation tasks
as well.
2019-02-22 15:47:54 +01:00
Dalai Felinto
bef82f72d2 Fix T61600: Physics properties inactive when appending objects
This problem existed in 2.79 as well. The rigid body setting is related
to the scene the object was created.

We now clear all the rigid body properties of the appended objects to
prevent them from lingering in this state where they have settings yet
cannot be used in the simulation.

Reviewers: mont29, brecht

Differential Revision: https://developer.blender.org/D4380
2019-02-22 11:20:27 -03:00
2278763681 Multires: Don't force smooth shading
There is still work needed to be done from multires side to fully
support smooth shading. So can't just always have smooth shading.

Roll back to a proper code in GPU side, the rest will be handled
from CCG side.
2019-02-22 14:45:32 +01:00
947d78b00b Multires: Fix ownership problem causing crashes
Fixes crash when leaving multires mode.

Fixes T61836: Saving while in multires makes blender crash
2019-02-22 13:35:07 +01:00
68aea23c27 Revert "makesrna: Fix build error on windows."
This reverts commit 8b235dd2e3.
2019-02-22 19:45:25 +11:00
b6f8afc13a C logging: make pthread use optional
There is no need for threading for makesrna/makesdna,
disable it to avoid hassles linking build time utilities.
2019-02-22 19:45:22 +11:00
4da53fc3e3 Cleanup: function wrapping, spelling 2019-02-22 18:37:19 +11:00
6bca694bef Comments: add doxy sections to readfile.c
Some minor changes to arrange code into useful sections too.
2019-02-22 18:23:52 +11:00
7bfb6c242b readfile: support blend files over 2gb
Should work for 4gb+ files too however I wasn't able to test that.
2019-02-22 16:56:22 +11:00
358e07f447 readfile: reduce memory usage at load time
Delay loading all DATA sections of the blend file until they're needed.

Loading all data-blocks caused high peak memory usage especially with
libraries - since a lot of data may exist which isn't used directly.

In one test (spring project: 10_010_A.anim.blend),
peaked at ~12.5gig, dropping back to ~2.5gig once loaded.
With this change peaks memory usage reaches ~2.7gig while loading.

Besides this there are some minor gains from not having to read data
from the file-system and we can skip an alloc + memcpy reading data
written with the same version of Blender.
2019-02-22 14:55:18 +11:00
f3e9dff03d Cleanup: rename seek to file_offset
Prepare for seek callback to be added.
2019-02-22 14:05:03 +11:00
1381a4a948 Sculpt Overlay: Fix mask drawn as flat shaded when smooth shading enabled
Removes the flat shader variant since the attrib is specified for each vert
loop in flat shaded mode. It was something leftover from the previous
implementation.
2019-02-22 04:03:59 +01:00
e35b7e7326 GPUBuffers: Fix/cleanup multires implementation
The multires sculpt drawing was a not working in smooth mode.
Also hidding was not supported by the wireframe overlay and flat shaded
faces.

Codewise it is cleaner and index buffers are only updated if the
smoothing changes.
2019-02-22 04:03:59 +01:00
bfbf3b9558 Cleanup: make BHeadN private in readfile.c
Also add macro for accessing BHeadN from BHead.
2019-02-22 13:47:04 +11:00
9541ce2c26 Missed last commit
Harmless but not renamed as intended.
2019-02-22 10:40:51 +11:00
536c3b6578 Cleanup: rename readfile API functions
- blo_bhead_first (was blo_firstbhead)
- blo_bhead_next (was blo_nextbhead)
- blo_bhead_prev (was blo_prevbhead)
- blo_bhead_id_name (was bhead_id_name)
- blo_filedata_free (was blo_freefiledata)
- blo_filedata_from_file (was blo_openblenderfile)
- blo_filedata_from_memory (was blo_openblendermemory)
- blo_filedata_from_memfile (was blo_openblendermemory)
2019-02-22 10:31:17 +11:00
98306c31bd Missed last commit 2019-02-22 09:34:00 +11:00
b2906c2a4a Cleanup: comments, use bool for 'eof' variable
Also remove unused members headerdone, inbuffer & filedes,
use typed enum for file data flags.
2019-02-22 09:29:59 +11:00
d00f54e574 Transform: redo resize now constrains axis values
Before 1bfbfa2810 this wasn't essential because the constraints
prevented the axes from being applied.

Now redo ignores constraints - the input values must be constrained.
2019-02-22 08:52:33 +11:00
4d4ae491c8 makesrna: Remove usage of dynamically linked pthreads4w
With pthreads now being static, there is no more reason to copy the dll.
2019-02-21 14:21:31 -07:00
8ed6985017 Windows: Use static pthreads library. 2019-02-21 14:19:15 -07:00
5d5070dd12 Windows: Use static pthreads library. 2019-02-21 14:16:26 -07:00
Mikhail Rachinskiy
4dd575e5ab UI: enum property menus now expand down, consistent with other menus.
Differential Revision: https://developer.blender.org/D4359
2019-02-21 18:20:05 +01:00
d6b5ee99fe Merge branch 'blender2.7' 2019-02-21 18:04:02 +01:00
Harley Acheson
1de1cedf4c UI: better widget drawing with thick line width.
When the line width was larger than the UI scale, there was not enough
space for thicker widget outlines to draw properly. Now widgets are made
a little larger to accommodate the thicker outlines.

Differential Revision: https://developer.blender.org/D4368
2019-02-21 18:03:34 +01:00
Harley Acheson
86bbadaaee UI: improve corner splitting feedback by showing custom cursors.
* Two cursors for horizontal and vertical split.
* Four cursors for each join direction.
* One cursor to indicate when splitting is not possible.

Differential Revision: https://developer.blender.org/D4264
2019-02-21 18:03:34 +01:00
Harley Acheson
a1e531ebbd UI: increase corner splitting hit area to include screen edges.
Differential Revision: https://developer.blender.org/D4242
2019-02-21 18:03:34 +01:00
1999651da5 makesrna: Fix windows build.
makesrna requires the pthread dll to be available before it can run.
2019-02-21 10:02:54 -07:00
fc55861efa Fix T60646: From instancer texture coordinate doesn't work in viewport
Made it so that generated coordinate is always calculated.

Ideally, it will only be done depending on a current  shading,
but code is quite deep, and doing smarter thing here will end
up in way bigger refactor.

First, make things working, and then make them fast if they
pop up in a profiles.
2019-02-21 17:25:34 +01:00
f1304c973f Fix T61810: Cycles OpenCL denoising broken after recent changes. 2019-02-21 16:47:04 +01:00
6e53fdc18f Cycles OpenCL: Motion Blur Compile Directives
When using preview rendering through a camera or final rendering
the `scene.render.use_motion_blur` was not respected when building
the compile directives.

This patch will when building the compile directives check if
motion blur is enabled at all. This should lead to more efficient
kernels when no motion blur is needed.

Tags: #cycles

Differential Revision: https://developer.blender.org/D4387
2019-02-21 16:33:29 +01:00
9e1f3421bb Fix for Fix (c) T61787: Duplicating a collection instance does not duplicate the dupli_group.
Wrong logic in bitflags handling in own previous commit...
2019-02-21 16:14:34 +01:00
63fd2c99e8 Fix (unreported) Broken DataTransfer modifier when source object is in Edit mode.
Just use common API func to get evaluated mesh of other object in
modifiers, instead of doing our own cooking. ;)
2019-02-21 15:48:29 +01:00
0625a10efb Fix T61787: Duplicating a collection instance does not duplicate the dupli_group.
Transfomr init code called just after duplication (presumably before
regular depsgraph update is executed) would erase new objects'
transflags.

This is more like a hack than a real fix, but since that transform piece
of code is already a hack... Other solution would have been to force DEG
to run after object duplication, think it's better to go with that
solution for now.

Not to mention to fact that dupli flags are put into transflag... ;)
2019-02-21 15:40:17 +01:00
3b88e30181 Cleanup: typos in comments. 2019-02-21 15:40:17 +01:00
fab573bac0 Fix T59338: Blender crashes immediately after loading attached file in ~80% of my attempts.
Issue was a concurrent modification of an evaluated mesh by two
other meshes using it as source for custom normals data transfer.

Note that this fixes the crash (modifiers are strictly forbidden to modify
any data besides their own!), but now will have to add a new CD type to
be able to specifically request 'computed' clnors data layer, and not
only 'encoded' one, for source mesh...
2019-02-21 15:40:17 +01:00
8986c92b65 Merge branch 'blender2.7' 2019-02-21 15:33:07 +01:00
1d38a83139 Fix T61802: EXR preview JPEGs don't have the correct color
Missing color management, probably from the very beginnings of
the OCIO integration.
2019-02-21 15:29:02 +01:00
d518438479 Subdiv: Enable topology cache for animation
This commit makes it so both Subdivision Surface and Multiresolution
modifiers are caching OpenSubdiv topology. This cuts down evaluation
time quite a bit, especially for meshes which don't have many extra
ordinary verticies.

Only working for animation. Other modifications like edit mode needs
more work to make topology cache preserved by copy-on-write.
2019-02-21 15:25:02 +01:00
a51d08f473 Fix: Missing closing brackets in include 2019-02-21 14:36:51 +01:00
John Quillan
fdee84fd56 Fix T61733: wrong alpha for sequencer screen, multiply, .. blend modes.
It was copying the alpha from the foreground instead of background image,
which is not usually what is needed and inconsistent with the compositor.

Differential Revision: https://developer.blender.org/D4371
2019-02-21 13:29:13 +01:00
4f0b61f15b Fix T61791: Motion path step is not taken into account 2019-02-21 13:28:53 +01:00
d542c6a5f3 Fix T61786: local view not exiting correctly after recent changes. 2019-02-21 12:08:01 +01:00
1bfbfa2810 Transform: remove constraints from the redo panel
Constraint options had confusing behavior:

- When non were pressed, the orientation was ignored.
- When any were pressed, the orientation was used,
  but only unconstrained axed could be adjusted.

Now constraining is only used for modal execution
so there is no need to show these in the interface.

When an orientation is selected, the XYZ values always transform
using that space.

Note, transform system should be refactored to support different
orientations w/o having to use constraints.

Addresses T57204
2019-02-21 21:59:15 +11:00
510810c72d Cleanup: Line wrapping 2019-02-21 11:08:33 +01:00
7412f30930 Clip: Check memory allocation during prefetch
Aimed to make prefetching more stable for cases when
it causes Blender to run out of memory.
2019-02-21 10:52:03 +01:00
6e9dca2214 Codestyle: Indentation 2019-02-21 08:52:04 +01:00
fab6c5040d Fix: OpenCL Displacement and light sampling
The bake kernels are also used during mesh displacement and light
importance sampling. We disabled the implementation of these kernels
when baking was not enabled.
2019-02-21 08:11:02 +01:00
f4d9e49f28 Fix redo regression w/ transform constraints
Adjusting a constrained transform would always use global space.
2019-02-21 17:52:13 +11:00
941c03e2bf Fix transform reading all ob-data as a mesh 2019-02-21 17:27:57 +11:00
9b20127355 Tool: Use scale keymap for scale cage tool
Needed so clicking anywhere performs uniform scale.
2019-02-21 16:42:59 +11:00
3feeafac28 Theme: update blender-light theme clipping border
Color was too dark compared to the background color.
2019-02-21 16:10:51 +11:00
8b235dd2e3 makesrna: Fix build error on windows.
rB94f83a4ebd929e7c4f405b1c78d9db842dfe1689 introduced a dependency on pthreads
but did not add it to the linker inputs.
2019-02-20 21:56:11 -07:00
e644da1f8e Keymap: add context menus for paint modes
These are place-holders with only a few items in each, as with the rest
of the context menus they need to be populated & organized.

Weight Paint 'weight' shortcut has been changed from W to Ctrl-F,
to co-exist w/ the context menu shortcut.
2019-02-21 15:43:39 +11:00
a0881a4e94 Fix assert w/ multi-dimensional array printing
Own oversight adding assert, result from MEM_allocN_len may be padded.
2019-02-21 14:49:27 +11:00
c0659c83a9 Keymap: Ctrl-Home/End to set start/end frame
New shortcuts for the dope-sheet.
2019-02-21 14:38:22 +11:00
3d5585fac4 Fix T61563: Info space prints matrices as flat tuple
Add support for printing multi-dimensional arrays.
2019-02-21 12:42:29 +11:00
94f83a4ebd Fix T61765: thread-unsafe logging used 2019-02-21 11:33:50 +11:00
9e4d561a8b Merge branch 'blender2.7' 2019-02-20 23:20:43 +01:00
ccd291aafb Cycles: Fix uninitialized number of hits
Was happening when looking for all intersections for transparent shadow rays
in the case the ray is degenerate.

Still quesitonable whether we should consider this a transparent or opaque
configuraiton. Ideally, we should prevent such rays from happening, but that
is another vector of debugging.
2019-02-20 23:20:07 +01:00
1303bd57f5 Units: Use units for smoke
-Use factor for flame_vorticity, slice_depth, density & volume_density
-Use distance for surface_distance
-Use factor for mix factor in Data Transfer modifier
-Use prop_translation for pivot constraint offset
2019-02-20 21:50:27 +01:00
1af810b4ff Units: Use correct units for transform operators
-Use distance for Shrink/Fatten Distance
-Use factor for Smooth Factor
-Use Factor for Randomize Uniform and Normal values
-Use Distance for Randomize distance amount
-Randomize Transform Scale was wrongly using distance
2019-02-20 21:10:32 +01:00
e2cefc7dad fix T61122 : Collada exporter exported alpha value (always 0) from deprecated material attribute 2019-02-20 20:47:08 +01:00
4ec6b16b4e cycles/opencl: Fix compile error.
added missing quote, introduced in rB15edda3a8e07003bef695cca939744bbea80ad18
2019-02-20 11:44:06 -07:00
9a9336cb45 Merge branch 'blender2.7' 2019-02-20 19:07:25 +01:00
5df82b60d1 Local view: add operator property to disable framing selected objects.
Default behavior is unchanged still, but can be changed in the keymap.
From testing I think this needs better visual feedback to indicate that
you are in local view, if the view does not move it's not as clear.
2019-02-20 19:06:18 +01:00
c4f961a54c Local view: don't restore selection when exiting local view.
Losing the selection can be inconvenient, and it's easy to select all local
objects before exiting local view if needed.
2019-02-20 19:06:18 +01:00
Pablo Vazquez
12a6059f8a UI: Use checkbox for shape keys 'mute'.
Muting functions as enable/disable toggle, it's not viewport-only.
2019-02-20 18:56:26 +01:00
3f65cad5ae Units: Use pixels for denoising radius property, and set Cycles motion blur duration to factor.
Also fix own mistake of using of spaces instead of tabs in RNA.
2019-02-20 18:02:26 +01:00
848f589fdf Tests: only run OpenGL draw tests on lib/tests/opengl, support symlinks.
To keep running these tests relatively fast and practical to run often,
running it on all .blend files is a bit much. So now we only run it on
files from this directory.

Additionally this adds supports for following symlinks, so that you can
easily symlinks to other directories if you want to tests extra files
which may have linked libraries.
2019-02-20 17:13:33 +01:00
fda79dbd79 Cleanup: fix compiler warning. 2019-02-20 16:39:12 +01:00
27c72e22aa Cleanup: fix some versioning code running when not needed. 2019-02-20 16:22:23 +01:00
ee7c9790a2 Fix crash when rendering and drawing curves at the same time
Need to stop modifying original DNA data, this is not safe
for threading and easily avoidable.
2019-02-20 16:09:52 +01:00
7ed5e9f2f7 UI: Make Shutter Speed properties consistent in Eevee & Cycles.
-Use PROP_FACTOR for both (It is a factor of the total frame length)
-Set soft max to 1 and hard max to 2 for both.
2019-02-20 16:04:56 +01:00
32314e2d4e UI: Change name of Sequencer option from 'Draw Waveform' to 'Display Waveform' to fit the naming conventions described in T56648. 2019-02-20 15:28:10 +01:00
8a4cdda373 Merge branch 'blender2.7' 2019-02-20 15:22:23 +01:00
949ab753bb Cycles OpenCL: Remove OpenCL MegaKernel
Using OpenCL MegaKernel has been slow and therefore not usefull.
This patch will remove the mega kernel from the OpenCL codebase
and the OpenCLDeviceBase class.

T61736: removal of mega kernel
T61703: baking does not work with mega kernel

Tags: #cycles

Differential Revision: https://developer.blender.org/D4383
2019-02-20 15:17:22 +01:00
9315cc443b Cycles: Fix wrong vertex color and UV for hair
Was introduced by rB03013c23179 and caused by missing
occasions of when hair strands are zero length.
2019-02-20 14:47:46 +01:00
ffd66ce7d5 Subdiv: Fix function naming
Not sure where displacement came from into there, maybe
file was based on displacement evaluator.
2019-02-20 14:38:24 +01:00
a1bd25af72 Node headers should not respect theme alpha values
As pointed out in https://developer.blender.org/rB558d7dd90e56ca1b4dbf1b7b8b7b555791821148,
the theme color alpha should not be taken into account when rendering node headers.

Reviewed By: Brecht Van Lommel

Differential Revision: https://developer.blender.org/D4338
2019-02-20 14:37:30 +01:00
b285f92d80 Fix File > Save not showing red highlight when saving over existing files.
Don't disable the save over popup through the keymap, just remove it entirely
from the code so that the file browser interprets the property correctly.
2019-02-20 14:04:12 +01:00
cfbcd7f0da Fix missing dependency upgrade when changing image to/from sequence.
Since animation is now handled by the dependency graph.
2019-02-20 13:53:32 +01:00
c985c60bdc Depsgraph: Fix relation when lamp has driver on custom property
Was once again caused by an ambiguity of the entry/exit operations.

Only did for objects since those are the only one who needs this.
The rest types of IDs needs to be checked and only added extra
operations if needed (adding operations and relations causes some
overhead for evaluation, so need to be careful).
2019-02-20 11:48:42 +01:00
e6bdc950d2 Fix T61689: Crash when having image and regular animation
Was caused by ambiguity in entry/exit operation for animation channel.
Made those explicit now,
2019-02-20 11:32:22 +01:00
c57f1f3d27 Depsgraph: Simplify creation of animation nodes 2019-02-20 11:18:38 +01:00
db5db0bfc2 Cleanup: Indentation and wrapping 2019-02-20 11:15:19 +01:00
f62371e6ea Measure Tool: delete now removes protractor when it's active 2019-02-20 17:16:22 +11:00
4d085c9bae Measure Tool: use x/del key to remove the active ruler
Dragging outside the view was only meant to be a temporary workaround.
2019-02-20 16:44:54 +11:00
7ee9fe4991 Cleanup: rename keymap handler callbacks for clarity
Now there are two callbacks, the name 'keymap_callback' is too vague.
2019-02-20 15:43:35 +11:00
effe750ec1 WM: support dynamic keymap handlers
Add getter callback support for 'WM_HANDLER_TYPE_KEYMAP' type handlers
this is needed for key-maps which change based on the active tool.

Replaces 'sneaky_handler' hack which temporarily inserted a handler.
2019-02-20 14:37:15 +11:00
855b3e68ef RNA: use factor when appropriate
- Many factor properties were set to PROP_NONE,
  even properties that had 'Factor' in the name!

- Some time properties were not set to PROP_TIME,
  especially in Particles.

- Changed motion_blur_shutter to use a soft max value of 1 instead of 2.
  Anything > 1 here is not physically correct
  and makes no real logical sense.

- Changed display name of Dynamic Paint dissolve_speed to Dissolve Time,
  since it's a time property, not speed.
2019-02-20 10:18:24 +11:00
079099e8db Cleanup: rename generic handler -> handler_base
Avoids having type specific handler names.
2019-02-20 10:05:40 +11:00
4d83507f39 Cleanup: simplify handler type conditional
Each handler type now has it's own block (fileselect was an exception).
2019-02-20 09:57:38 +11:00
63d77d6d27 Cleanup: rename wmEventHandler_* base -> head
Makes it more clear it's the header/start of the struct.
2019-02-20 09:43:29 +11:00
e53676a5c7 Cleanup: use iterator macros for event handlers 2019-02-20 09:38:33 +11:00
c1c01f062e BLI_listbase: add an iterator macro that supports removal
Avoids manually defining 'for' loops that store the next item in the
linked list.
2019-02-20 09:38:33 +11:00
Dalai Felinto
0e7409d466 EEVEE Shader comments: Explain why material gets darkened when using mix shader
We are still ditching the specular intensity of SSR (ssr_data.xyz).
But at least now there is some comment about it.

See T61704 for user reports on that matter.

Comments with the blessing of Clément Foucault.
2019-02-19 18:51:14 -03:00
a10dc319ca Comment: clarify reason for using scale as size 2019-02-20 08:27:15 +11:00
39afc2775f Cleanup: style 2019-02-20 08:27:01 +11:00
Dalai Felinto
6c0cbfcd53 Fix T61696: Filepath buttons not accepting empty values
The reported case was with the render output filename,
however the same was happening for file open.

Bug introduced on c20c203b82.
I can't find in the original commit any reasoning for the change
that introduced this bug.
2019-02-19 17:24:10 -03:00
e2a90b8045 Merge branch 'blender2.7' 2019-02-19 19:00:46 +01:00
2be29999bd Fix T61701: Orthographic Viewpoints Hidden Grid
If all axis and grid options were turned off, the grid in the main ortho views would not be rendered.
Now we force rendering of the grid regardless of the settings when in one of the main ortho views.

Reviewed By: Brecht Van Lommel

Differential Revision: https://developer.blender.org/D4378
2019-02-19 18:53:15 +01:00
81aa2a93e9 Fix T61274: duplicate current workspace makes the workspace menu disappear.
Differential Revision: https://developer.blender.org/D4321
2019-02-19 18:43:32 +01:00
df8bd07313 fix: Collada replace <polylist> export by <triangle> export for triangulated meshes.
This is a regression from Blender 2.79 where the usage
of <triangles> was already implemented, but unintentionally
removed in Blender 2.80

Also renamed variables for better reading.
2019-02-19 17:49:54 +01:00
667033e89e T61463: Separate Baking kernels
Cycles OpenCL: Split baking kernels in own program

Fix T61463. Before this patch baking was part of the base kernels. There
are 3 baking kernels that and all 3 uses shader evaluation. Only for one
of these kernels the functionality was wrapped in the __NO_BAKING__
compile directive.

When you start baking this leads to long compile times. By separating
in individual programs will reduce the compile times.

Also wrapped all baking kernels with __NO_BAKING__ to reduce the
compilation times.

Impact on compilation time

    job   |   scene_name    | previous |  new  | percentage
  --------+-----------------+----------+-------+------------
   T61463 | empty           |    10.63 |  7.27 |         32%
   T61463 | bmw             |    17.91 | 14.24 |         20%
   T61463 | fishycat        |    19.57 | 15.08 |         23%
   T61463 | barbershop      |    54.10 | 48.18 |         11%
   T61463 | classroom       |    17.55 | 14.42 |         18%
   T61463 | koro            |    18.92 | 17.15 |          9%
   T61463 | pavillion       |    17.43 | 14.23 |         18%
   T61463 | splash279       |    16.48 | 15.33 |          7%
   T61463 | volume_emission |    36.22 | 34.19 |          6%

Impact on render time

    job   |   scene_name    | previous |   new   | percentage
  --------+-----------------+----------+---------+------------
   T61463 | empty           |    21.06 |   20.54 |          2%
   T61463 | bmw             |   198.44 |  189.59 |          4%
   T61463 | fishycat        |   394.20 |  388.50 |          1%
   T61463 | barbershop      |  1188.16 | 1185.49 |          0%
   T61463 | classroom       |   341.08 |  339.27 |          1%
   T61463 | koro            |   472.43 |  360.70 |         24%
   T61463 | pavillion       |   905.77 |  902.14 |          0%
   T61463 | splash279       |    55.26 |   54.92 |          1%
   T61463 | volume_emission |    62.59 |   39.09 |         38%

I don't have a grounded explanation why koro and volume_emission is this much
faster; I have done several tests though...

Maniphest Tasks: T61463

Differential Revision: https://developer.blender.org/D4376
2019-02-19 16:34:55 +01:00
15edda3a8e T61463: Separate Baking kernels
Cycles OpenCL: Split baking kernels in own program

Fix T61463. Before this patch baking was part of the base kernels. There
are 3 baking kernels that and all 3 uses shader evaluation. Only for one
of these kernels the functionality was wrapped in the __NO_BAKING__
compile directive.

When you start baking this leads to long compile times. By separating
in individual programs will reduce the compile times.

Also wrapped all baking kernels with __NO_BAKING__ to reduce the
compilation times.

Impact on compilation time

    job   |   scene_name    | previous |  new  | percentage
  --------+-----------------+----------+-------+------------
   T61463 | empty           |    10.63 |  7.27 |         32%
   T61463 | bmw             |    17.91 | 14.24 |         20%
   T61463 | fishycat        |    19.57 | 15.08 |         23%
   T61463 | barbershop      |    54.10 | 48.18 |         11%
   T61463 | classroom       |    17.55 | 14.42 |         18%
   T61463 | koro            |    18.92 | 17.15 |          9%
   T61463 | pavillion       |    17.43 | 14.23 |         18%
   T61463 | splash279       |    16.48 | 15.33 |          7%
   T61463 | volume_emission |    36.22 | 34.19 |          6%

Impact on render time

    job   |   scene_name    | previous |   new   | percentage
  --------+-----------------+----------+---------+------------
   T61463 | empty           |    21.06 |   20.54 |          2%
   T61463 | bmw             |   198.44 |  189.59 |          4%
   T61463 | fishycat        |   394.20 |  388.50 |          1%
   T61463 | barbershop      |  1188.16 | 1185.49 |          0%
   T61463 | classroom       |   341.08 |  339.27 |          1%
   T61463 | koro            |   472.43 |  360.70 |         24%
   T61463 | pavillion       |   905.77 |  902.14 |          0%
   T61463 | splash279       |    55.26 |   54.92 |          1%
   T61463 | volume_emission |    62.59 |   39.09 |         38%

I don't have a grounded explanation why koro and volume_emission is this much
faster; I have done several tests though...

Maniphest Tasks: T61463

Differential Revision: https://developer.blender.org/D4376
2019-02-19 16:33:50 +01:00
e6f5632eb1 T61513: Refactored Cycles Attribute Retrieval
There is a generic function to retrieve float and float3 attributes
`primitive_attribute_float` and primitive_attribute_float3`. Inside
these functions an prioritised if-else construction checked where
the attribute is stored and then retrieved from that location.

Actually the calling function most of the time already knows where
the data is stored. So we could simplify this by splitting these
functions and remove the check logic.

This patch splits the `primitive_attribute_float?` functions into
`primitive_surface_attribute_float?` and `primitive_volume_attribute_float?`.
What leads to less branching and more optimum kernels.

The original function is still being used by OSL and `svm_node_attr`.

This will reduce the compilation time and render time for kernels.
Especially in production scenes there is a lot of benefit.

Impact in compilation times

    job  |   scene_name    | previous |  new  | percentage
  -------+-----------------+----------+-------+------------
  t61513 | empty           |    10.63 | 10.66 |          0%
  t61513 | bmw             |    17.91 | 17.65 |          1%
  t61513 | fishycat        |    19.57 | 17.68 |         10%
  t61513 | barbershop      |    54.10 | 24.41 |         55%
  t61513 | classroom       |    17.55 | 16.29 |          7%
  t61513 | koro            |    18.92 | 18.05 |          5%
  t61513 | pavillion       |    17.43 | 16.52 |          5%
  t61513 | splash279       |    16.48 | 14.91 |         10%
  t61513 | volume_emission |    36.22 | 21.60 |         40%

Impact in render times

    job  |   scene_name    | previous |  new   | percentage
  -------+-----------------+----------+--------+------------
  61513 | empty           |    21.06 |  20.35 |          3%
  61513 | bmw             |   198.44 | 190.05 |          4%
  61513 | fishycat        |   394.20 | 401.25 |         -2%
  61513 | barbershop      |  1188.16 | 912.39 |         23%
  61513 | classroom       |   341.08 | 340.38 |          0%
  61513 | koro            |   472.43 | 471.80 |          0%
  61513 | pavillion       |   905.77 | 899.80 |          1%
  61513 | splash279       |    55.26 |  54.86 |          1%
  61513 | volume_emission |    62.59 |  61.70 |          1%

There is also a possitive impact when using CPU and CUDA, but they are small.

I didn't split the hair logic from the surface logic due to:

* Hair and surface use same attribute types. It was not clear if it could be
  splitted when looking at the code only.
* Hair and surface are quick to compile and to read. So the benefit is quite
  small.

Differential Revision: https://developer.blender.org/D4375
2019-02-19 16:28:25 +01:00
d6d306441f T61513: Refactored Cycles Attribute Retrieval
There is a generic function to retrieve float and float3 attributes
`primitive_attribute_float` and primitive_attribute_float3`. Inside
these functions an prioritised if-else construction checked where
the attribute is stored and then retrieved from that location.

Actually the calling function most of the time already knows where
the data is stored. So we could simplify this by splitting these
functions and remove the check logic.

This patch splits the `primitive_attribute_float?` functions into
`primitive_surface_attribute_float?` and `primitive_volume_attribute_float?`.
What leads to less branching and more optimum kernels.

The original function is still being used by OSL and `svm_node_attr`.

This will reduce the compilation time and render time for kernels.
Especially in production scenes there is a lot of benefit.

Impact in compilation times

    job  |   scene_name    | previous |  new  | percentage
  -------+-----------------+----------+-------+------------
  t61513 | empty           |    10.63 | 10.66 |          0%
  t61513 | bmw             |    17.91 | 17.65 |          1%
  t61513 | fishycat        |    19.57 | 17.68 |         10%
  t61513 | barbershop      |    54.10 | 24.41 |         55%
  t61513 | classroom       |    17.55 | 16.29 |          7%
  t61513 | koro            |    18.92 | 18.05 |          5%
  t61513 | pavillion       |    17.43 | 16.52 |          5%
  t61513 | splash279       |    16.48 | 14.91 |         10%
  t61513 | volume_emission |    36.22 | 21.60 |         40%

Impact in render times

    job  |   scene_name    | previous |  new   | percentage
  -------+-----------------+----------+--------+------------
  61513 | empty           |    21.06 |  20.35 |          3%
  61513 | bmw             |   198.44 | 190.05 |          4%
  61513 | fishycat        |   394.20 | 401.25 |         -2%
  61513 | barbershop      |  1188.16 | 912.39 |         23%
  61513 | classroom       |   341.08 | 340.38 |          0%
  61513 | koro            |   472.43 | 471.80 |          0%
  61513 | pavillion       |   905.77 | 899.80 |          1%
  61513 | splash279       |    55.26 |  54.86 |          1%
  61513 | volume_emission |    62.59 |  61.70 |          1%

There is also a possitive impact when using CPU and CUDA, but they are small.

I didn't split the hair logic from the surface logic due to:

* Hair and surface use same attribute types. It was not clear if it could be
  splitted when looking at the code only.
* Hair and surface are quick to compile and to read. So the benefit is quite
  small.

Differential Revision: https://developer.blender.org/D4375
2019-02-19 16:25:48 +01:00
c598ad9ac6 FCurves: Remember active fcurve when selecting other bone
Reviewers: brecht

Differential Revision: https://developer.blender.org/D4312
2019-02-19 15:59:09 +01:00
13f28798de Fix T57583: Assert when moving object parented to curve vertex
Can not reliably evaluate object's transform from the original one.

Still not ideal, see the comment in the code.
2019-02-19 15:56:00 +01:00
7c53bca1dd Fix T61702: obmat used incorrectly when calculating constant detail size
Reviewers: brecht

Differential Revision: https://developer.blender.org/D4372
2019-02-19 15:52:49 +01:00
655eb8eabd Fix T61690: Hidden curve vertices are drawn in edit-mode
When hiding the curve handles/points previously, the control points would still be drawn (loose verts).
Now we hide everything related to the handle if it is hidden.

Reviewed By: Clément Foucault

Differential Revision: https://developer.blender.org/D4373
2019-02-19 15:45:40 +01:00
38f0d5f75a Fix T61714, T61712: crash reloading images after recent changes.
Now that we are looping over all image users that were previously ignored,
it shows some scene pointers are invalid. Always clear them on load, and
don't keep scene permanently in the image user except for the image editor.
Otherwise the pointer can go out of date.
2019-02-19 15:40:04 +01:00
Vaishnav S
22eeae8104 Units: Fix some property subtypes
This commit only contains some of the changes in the diff.
Some require more discussion/work.

Differential Revision: https://developer.blender.org/D4337
2019-02-19 15:23:46 +01:00
cba447966e Fix T61683: Linking the instance of a collection crashes Blender.
Do not instance linked object immediately in scene, this was never a
good idea and is doomed to fail nowadays, with complex relations between
objects, collections and scenes.

Instead, this commit refactors a bit linking code to add loose objects
to current scene *after* everything has been imported, and ID pointers
have been properly remapped to new ones - i.e. once new linked data is
supposed to be fully valid, just like we were already doing with
collections.

As a bonus, it means we do not have to pass around scene, view3d etc. to
`BLO_library_link_named_part_ex()` and co.
2019-02-19 13:49:54 +01:00
8138eb0dfe Fix Cycles OpenCL multithreaded compilation not working on Windows. 2019-02-19 13:48:56 +01:00
4df8896062 Playanim: Fix heap use after free on exit
Was caused by the wrong de-initialization order, here is
an ASAN log just in case P916.
2019-02-19 13:08:22 +01:00
bab2d2ba43 Fix T61594: Frame playback is blank
Viewport and scissor were never initialized prior to
window move/resize.
2019-02-19 13:01:36 +01:00
a8bbe140fd Cleanup: remove needless comment ;) 2019-02-19 10:23:23 +01:00
84a5abdb31 Merge branch 'blender2.7' 2019-02-19 08:05:15 +01:00
ecd66f69e7 Revert "Cycles: Change OpenCL split kernel to use single program by default"
This reverts commit c6bf5d4724.

Related to D2264: When multi process opencl kernel compilation is in place single-program compiles slower then multi-program. c6bf5d4724 was created as single-program compiled faster, but this is not the case anymore. So let's revert this change. Production scenes like victor and barbershop even render quicker.

Change in Cycles OpenCL compilation times

>    job    |   scene_name    | compilation_time | render_time
>  Baseline | empty           |            22.73 |       20.63
>  T61514   | empty           |            10.63 |       21.06
>  Baseline | bmw             |            56.44 |      191.00
>  T61514   | bmw             |            17.91 |      198.44
>  Baseline | fishycat        |            59.50 |      393.48
>  T61514   | fishycat        |            19.57 |      394.20
>  Baseline | barbershop      |           212.28 |     1623.53
>  T61514   | barbershop      |            54.10 |     1188.16
>  Baseline | victor          |            67.51 |     1459.80
>  T61514   | victor          |            22.06 |     1381.58
>  Baseline | classroom       |            51.46 |      341.23
>  T61514   | classroom       |            17.55 |      341.08
>  Baseline | koro            |            62.48 |      475.96
>  T61514   | koro            |            18.92 |      472.43
>  Baseline | pavillion       |            54.37 |      903.48
>  T61514   | pavillion       |            17.43 |      905.77
>  Baseline | splash279       |            47.43 |       52.92
>  T61514   | splash279       |            16.48 |       55.26
>  Baseline | volume_emission |           145.22 |       62.38
>  T61514   | volume_emission |            36.22 |       62.59

Reviewers: #cycles, brecht, sergey

Reviewed By: #cycles, brecht

Differential Revision: https://developer.blender.org/D4349
2019-02-19 07:48:51 +01:00
eb4acd5064 Cleanup: return specific handler types 2019-02-19 16:57:36 +11:00
e617e6395b Cleanup: remove unused default handler type 2019-02-19 16:18:58 +11:00
bb6692be8a WM: move keymap handler to it's own type
Illuminate dead code, using wmEventHandler_KeymapFn from gizmo handler
type where it was never set.
2019-02-19 16:18:23 +11:00
d718338828 WM: move dropbox handler to it's own type 2019-02-19 16:17:21 +11:00
f88ea20285 WM: move operator handler to it's own type 2019-02-19 16:17:21 +11:00
eae2942474 WM: move UI handler to it's own type 2019-02-19 16:17:21 +11:00
55ac296358 WM: move gizmo handler to it's own type 2019-02-19 16:17:21 +11:00
0767b63f1b WM: move wmEventHandler.type to a boolean
Currently it's effectively a boolean for file-select handlers.

Prepare for refactoring event handlers into their own types (keymap,
operator, gizmo, ui & dropbox) to help make logic easier to follow.
2019-02-19 16:14:51 +11:00
790cb7799d Cleanup: rename parent_origin_eval to parent_display_origin
The term 'eval' is often used by depsgraph result,
where this is just used for drawing.
2019-02-19 11:38:25 +11:00
ec57d76db8 Fix edit-curve display for hidden handles
When the first handle was hidden, all others would show as hidden too.
2019-02-19 10:04:15 +11:00
53e95a982c Cleanup: remove unused Object.smoothresh 2019-02-19 09:50:00 +11:00
53b484d081 DNA: rename select_color -> select_id
The term color is misleading, it's an integer id that happens to be
written to a color in some cases, then converted back to an integer.
2019-02-19 09:45:48 +11:00
fc10e89918 DNA: rename Object.col -> color
Was confusing, unrelated to:
colbits, col_mask, col_group, actcol & totcol.
2019-02-19 08:48:15 +11:00
ecdd1864d1 Fix (unreported) broken-by-design code in depsgraph's deg_backup_object_runtime()
Committing this since it does fix broken logic (previously in that
condition obdata would always be set to NULL, since
`BKE_object_runtime_reset()` is called before).

However, this has presumably been broken that way since 05/2018, so
maybe that whole condition is not needed anymore? Or NULL pointer was
working as well here?

@sergey eyes are required here I guess ;)
2019-02-18 18:21:44 +01:00
16a290bb6f Fix Object bbox memleak in depsgraph code.
Caused by rBae2b677dcb5a70f5, Object.runtime has lot of weird specific
handlings in depsgraph...

For now modified `deg_backup_object_runtime()` and
`deg_restore_object_runtime()` to mimic previous behavior regarding
Object bbox (i.e. pass it around, instead of wiping it clean).

Reported in T61660.
2019-02-18 18:15:00 +01:00
49c7b34547 Cleanup some Object's bbox code.
Now that bbox is in runtime, no need to explicitely clear it when we
call BKE_object_runtime_reset() two lines below.
2019-02-18 17:55:44 +01:00
aed631fa47 Fix (unreported) wrong handling of some parameters combination in bpy.data.user_map()
Would add undesired keys...
2019-02-18 17:16:33 +01:00
1414c4496c ID Management Py API: Fix (unreported) crash in some cases.
Would crash when passing some kind of invalid parameters, e.g.:

   >>>D.user_map(key_types={'brush'})
2019-02-18 17:16:33 +01:00
b8ec2c9559 ID management: use FOREACH_MAIN_ID in some places. 2019-02-18 17:16:33 +01:00
b36f78abf4 ID management: use FOREACH_MAIN_ID in some places. 2019-02-18 17:16:33 +01:00
4977321c5a ID management: use FOREACH_MAIN_ID in some places. 2019-02-18 17:16:33 +01:00
ff7165957f ID management: use FOREACH_MAIN_ID in some places. 2019-02-18 17:16:33 +01:00
0951778eba ID management: use FOREACH_MAIN_ID in some places. 2019-02-18 17:16:33 +01:00
00d2e9096f ID management: use FOREACH_MAIN_ID in some places. 2019-02-18 17:16:33 +01:00
4c2330bd53 BKE_main: FOREACH macros: fix shadowing 'i' variable. 2019-02-18 17:16:33 +01:00
614a0a47e5 BKE_main: make FOREACH new macros working when deleting some IDs. 2019-02-18 17:16:33 +01:00
28901820a4 Wireframe: Fix selection broken since recent wireframe refactor 2019-02-18 17:03:10 +01:00
f2a21472c4 Fix T61473: Crash particle system is updating
Original and localized particle settings were sharing some
of the runtime pointers.
2019-02-18 17:00:50 +01:00
0e3a2acbfa Fix T57457: animated image sequences not working in Eevee.
The dependency graph now handles updating image users to point to the current
frame, and tags images to be refreshed on the GPU. The image editor user is
still updated outside of the dependency graph.

We still do not support multiple image users using a different current frame
in the same image, same as 2.7. This may require adding a GPU image texture
cache to keep memory usage under control. Things like rendering an animation
while the viewport stays fixed at the current frame works though.
2019-02-18 16:52:01 +01:00
286c34b4ab Fix image filepath changes not refreshing all image users. 2019-02-18 16:38:17 +01:00
a6443b5d1e Fix BKE_image_walk_all_users not including all image users. 2019-02-18 16:38:17 +01:00
8f7ae20f79 Cleanup: rename tpageflag to gpuflag, make it purely runtime data. 2019-02-18 16:38:17 +01:00
c94b3b19a2 Fix T61373: Crash when selecting the edit mode
Some GPUs complain about `error C7011: implicit cast from "int" to "uint"` even if the cast is explicit.
2019-02-18 11:35:17 -03:00
abb147e609 Fix T61636: Drivers don't update on viewport using curves 2019-02-18 16:35:56 +01:00
582ae0c122 Fix crash toggling edit mode of curve with animation
The issue was caused by original f-curves being re-allocated
without informing dependency graph about this.

Was reported in T61636#622757
2019-02-18 16:29:04 +01:00
d02ad52b2d Depsgraph: Make node an owner of its name
The initial idea of using char pointer was to save some
memory since the dependency graph was kind of the one
with the main database.

Nowadays dependency graph should be separatable from the
main database and being self-sustainable.

Other issue which was caused by this pointer is the
re-tagging of operations during relations update: it is
possible to have node which as tagged for update but had
the owner of the name removed (i.e. driver or bone was
removed).
2019-02-18 16:24:51 +01:00
c3ceefb671 Cleanup: Remove unused field 2019-02-18 16:08:05 +01:00
11b8d8a838 DRW: Fix Crash when enabling object wireframe option 2019-02-18 16:02:27 +01:00
d62f8a3176 Overlay: Remove extra contour drawing in wireframe mode
This removes the overhead of rendering the object one more time.
2019-02-18 16:02:27 +01:00
5d58b7f073 Fix T61660: Wrong user counter on curves with shared material.
Patch by @sergey.

Note that this is really a bad thing actually, ideally we should never
get that situation (IDs in Main referencing temp IDs outside of it).
That can lead to many possible similar cases...

Fixing that is not trivial though, so for now we'll have to live with
it, until we have migrated *all* of our temp datablocks generation
outside of Main's.
2019-02-18 15:27:29 +01:00
2c12c9b61e ID management: forbid refcount of used IDs when user ID is outside of Main.
This is related to T61660, but actually does not fix that specific issue
(which is even worse - outside-of-Main ID using inside-of-Main IDs... yuck).
2019-02-18 15:27:29 +01:00
a0d0d37ecd Fix T61666: missing NULL_UNIT that stops iteration over units 2019-02-18 14:25:34 +01:00
03013c2317 Cycles: Keep all hair strands
Previously, hair strands of zero length of too few control
points would have been ignored. This is fine for a render
without motion blur. But once motion blur is enabled it is
becoming more tricky to match topology.

Even more, it was causing access (and possibly writes) past
the array boundaries in case when time step 0 ignored some
strands and steps around it did not.

If this is becoming problematic for BVH to do reliable
intersections this is to be solved on the BVH builder side.
The export from Blender to Cycles shouldn't really make
decisions there.
2019-02-18 15:25:10 +01:00
7b6da0ace7 Jpeg: Fix write past array boundary
Was happening when image buffer had cryptomatte pass, which can easily
exceed 530 bytes used by the buffer.

Now default buffer is bumped to 1K, and also allowed to be heap-allocated
when really need bigger buffer.

Possible optimization is to allocate buffer once, but in practice those
re-allocations will not happen often, so keeping code simpler is not an
issue. Just something for a rainy day.
2019-02-18 15:25:10 +01:00
4c3d486f69 Fix broken Cycles test build after recent commit.
Broken by rB4ce9785e0158, please do full complete build before
committing!
2019-02-18 15:00:17 +01:00
49c100e56c API doc: info_gotcha: extend description of issues related to memory changes.
* Added a TL;DR first paragraph summarizing that one shall not keep any
reference to Blender data when modifying its container.

* Added some info about fact that adding items to some data containers
(like Collection) can also invalidate existing items (due to array
re-allocation).

* Added a Do/Don't example which shows a crash after adding some items
to a collection.

Related to T61297.
2019-02-18 14:36:16 +01:00
9299073d57 Cleanup: API doc 'info_gotcha': typos. 2019-02-18 14:36:16 +01:00
e96445059f Add Abkhaz language to Blender (disabled for until we get some translated content). 2019-02-18 14:36:16 +01:00
68d8627104 Edit Mesh: Cleanup 2019-02-18 14:17:57 +01:00
9ab99ff26b Sculpt Draw: Add support for wireframe geometry
This introduce the wireframe batches. Creating the indices buffer does
not seems to slow down the sculpt in my testing (but it is kind of hard to
test reliably)

This includes a bit of cleanup in gpu_buffers.c.
2019-02-18 14:17:57 +01:00
2cccffd20b Wireframe: Add workaround for osx wide wires 2019-02-18 14:17:57 +01:00
0c4334d0bb Cleanup: Remove old wireframe batch cache code 2019-02-18 14:17:57 +01:00
7a8a2211d1 Wireframe: Fix Artifacts with MSAA
We blit the depth buffer into the MSAA depth buffer so that wires are
properly occluded. This also makes the "In front" option work with MSAA.
2019-02-18 14:17:57 +01:00
9c49c2ef0c GPU: Change multisample resolve shader to output min depth
This will effectively make the AA passes thicker in some cases but it is
required for better AA on wireframes. The trick is to occlude the wire
passes so that they do not output fragment that could be behind actual
geometry.
2019-02-18 14:17:57 +01:00
600da00a94 Wireframe: Add depth offset to prevent zfighting of wireframe overlay 2019-02-18 14:17:57 +01:00
e49d955541 Wireframe: Refactor to use GL_LINES instead of triangles with alpha blend
This gets rid of the progressive fading of the edges as it does not work
with depth perception (sorting problem with alpha blending).
2019-02-18 14:17:57 +01:00
253ff57617 Clamp value in sheen calculation to fix fireflies.
Fixes T59784.

Reviewers: fclem

Reviewed By: fclem

Subscribers: brecht

Maniphest Tasks: T59784

Differential Revision: https://developer.blender.org/D4269
2019-02-18 14:05:16 +01:00
6e72601b90 Fix T61649: Transform resize from UV editor asserts
Change logic for error checking so it's easier to follow.
2019-02-18 22:03:26 +11:00
3b3eba6374 Markers: Make marker lines in sequencer and graph editor optional
- Makes it possible to show a vertical line for every marker in the graph editor.
- Makes the marker line visiblity optional in the sequencer and graph editor.

Request from @hjalti.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D4348
2019-02-18 10:42:06 +01:00
1c3a098cc8 Cleanup: remove unnecessary "_pad*" members 2019-02-18 17:06:11 +11:00
39e0b338d6 Cleanup: use "_pad" prefix for struct members 2019-02-18 16:47:55 +11:00
0b50438451 Cleanup: move 'orig' into Object_Runtime struct 2019-02-18 16:36:02 +11:00
e741472306 Cleanup: remove 'orig' from ObTfmBack
This is runtime data and is re-evaluated before use.
2019-02-18 16:31:02 +11:00
cc10d86535 DNA: rename Object.size -> scale
Resolves a common cause of confusion.
2019-02-18 15:43:55 +11:00
4719e7ec7a UI: motion paths panel layout tweak
- User better alignment for the paths_range_update button.
- Use Flow layout for the Display sub-panel items.
2019-02-18 15:15:43 +11:00
dcb44ddea2 UI: armature properties layout tweaks
- Rename 'Draw Mode' to 'Display As', consistent with other properties.
- Use flow layout.
2019-02-18 15:13:32 +11:00
5bd9878597 RNA: use distance units 2019-02-18 15:04:23 +11:00
61a9f41cf5 UI: bake panel layout improvements
All the controls were just really thrown in there without any proper
organization.
This gives it more structure.

- Correct use of sub-panels to communicate hierarchy and sections.
- Use flow layout for toggles.
- Use consistent names for "Bake Type".
2019-02-18 14:50:42 +11:00
50687b3183 UI: improve light probe properties layout
Smaller adjustments to the Light Probe properties layout.

- Correctly use alignment for multi-property values.
- Correctly use sub-panels.
- Correctly use PROP_FACTOR for visibility_bleed_bias and
  visibility_blur.
2019-02-18 14:12:22 +11:00
6be8c64e9a Fix T61187: Fluid Particle settings UI elements
Some properties were accidentally hidden for particle fluids.

- Made sure we show the Forces and Integration
  sub-panels for particle fluids.
- Slightly re-ordered the sub-panels here, so that the same sub-panels
  are at the top for Newtonian and Fluid particles.
- Separated the Fluid Interaction sub-panel so we can give it a unique
  name.
- Removed lingering unnecessary 'Keys' label in the Keyed physics.
2019-02-18 13:59:46 +11:00
bf9407fc71 Cleanup: spelling 2019-02-18 12:47:17 +11:00
7d792976e1 doxygen: update doxygen & add balembic group 2019-02-18 11:23:40 +11:00
022f339271 DNA: rename Collection.dupli_ofs -> instance_collection 2019-02-18 10:41:04 +11:00
cf966f3b38 DNA: support renaming structs that use the old renaming hack 2019-02-18 10:37:57 +11:00
c377cb2db5 RNA: use clog for logging error messages
Some RNA errors are quite similar, use clog for consistent logging that
always includes the file, function and line number - making errors
quicker to troubleshoot.
2019-02-18 10:24:49 +11:00
4859151154 Cleanup: style 2019-02-18 08:50:02 +11:00
4bbd1b9610 Correct own mistake in near/far cleanup
Error in 2f737c4f47
2019-02-18 08:50:02 +11:00
de13d0a80c doxygen: add newline after \file
While \file doesn't need an argument, it can't have another doxy
command after it.
2019-02-18 08:22:12 +11:00
3316853323 Cleanup: conform headers to have license first
Also remove doxy comments for licenses and add missing GPL header.
2019-02-18 08:22:11 +11:00
a3b3b9d74b DNA: comment on how to avoid DNA rename errors 2019-02-18 08:22:11 +11:00
5657d68a03 Units: allow short unit names be case sensitive when needed.
To distinguish mW and MW without having to deviate from the standard
SI unit abbreviation. For all other units there are no changes.
2019-02-17 16:46:40 +01:00
ce5d079a49 Units: add support for light power units in Watt. Use for Eevee lights.
This affects point, spot and area lights. Sun light strength remains without
a unit. This change does not affect .blend file compatibility in any way, as
with the rest of the unit system it's purely a display and editing feature.

Not used for Cycles yet, that will be done after unifying the settings with
Eevee.
2019-02-17 16:23:00 +01:00
6c24de95c0 Cleanup: remove leftover hemi light code. 2019-02-17 15:58:12 +01:00
c5f13ecbc0 Merge branch 'blender2.7' 2019-02-17 15:57:34 +01:00
8a97b85555 Fix T54504: Cycles wrong backwards compatibility with linked libraries.
The code assumed all datablocks were read from .blend files saved with the
same version. This restructures the Cycles versioning code to take into
account libraries.
2019-02-17 15:41:42 +01:00
319b9d6501 DNA: rename dup_* struct members to instance_* 2019-02-17 19:00:54 +11:00
19a703b0db Cleanup: remove unused bStats struct 2019-02-17 18:09:38 +11:00
e0e6229176 Cleanup: rename Mesh.edit_btmesh -> edit_mesh
When bmesh was in a branch we had both edit_mesh and edit_btmesh,
now there is no reason to use this odd name.
2019-02-17 18:05:18 +11:00
203b964ff4 Cleanup: move flag definition into screen header
This has been moved to screen, move declaration as well.
2019-02-17 12:57:04 +11:00
ae2b677dcb Cleanup: move object bounding-box into runtime struct 2019-02-17 12:52:53 +11:00
d8293fd6be Blenlib/Windows: Fix Build error with clang.
__cpuid comes from intrin.h which was implicitly included somewhere
for msvc builds, but not for clang.
2019-02-16 11:42:55 -07:00
b428929319 Windows: Fix building with llvm/clang 7.0.1
For llvm 6 the visual studio integration was 'not great' and we had
our own, which broke when llvm 7.0.1 came out. llvm now has properly
supported integration available on the VS market place hence we can
retire our custom support.
2019-02-16 11:36:19 -07:00
0d86259fc8 Fix T61591 Bevel tool not executing on mouseup.
When modal map was introduced, left out handling of what
happens when bevel is made active tool in toolbar and user
starts bevel by clicking and dragging.
2019-02-16 09:45:55 -05:00
03ede79c4f Fix T61593: Python can't access HUD region-type 2019-02-16 21:25:29 +11:00
2d1c14f036 Cleanup: rename SPACE_IPO -> SPACE_GRAPH 2019-02-16 16:42:11 +11:00
9d09eda0a3 DNA: rename theme space types
Follow enum naming convention, use "space_" prefix instead of "t".
2019-02-16 16:30:13 +11:00
ae375b4cdc DNA: ensure new names exist when renaming
Fail to build on errors in new names - without this renamed values
would be written to DNA breaking backwards & forwards compatibility.

Note that errors in old names aren't detected.
2019-02-16 13:10:32 +11:00
2f737c4f47 DNA: rename near/far -> clip_start/clip_end
Rename for Camera, View3D (also CameraParams & Render not DNA)
2019-02-16 12:26:07 +11:00
ec471a9b1c DNA: rename SpaceButs -> SpaceProperties 2019-02-16 10:44:15 +11:00
419911b1d1 DNA: rename SpaceIpo -> SpaceGraph 2019-02-16 10:23:40 +11:00
374cbdc63b DNA: rename SpaceOops -> SpaceOutliner 2019-02-16 09:48:29 +11:00
51c034686a DNA: rename camera YF_dofdist -> dof_distance 2019-02-16 09:43:33 +11:00
a2f345468c DNA: support DNA type & name aliases
This allows us to rename struct & struct members in the source code
without changing the file format.

This is useful because the code becomes increasingly confusing when
names such as oops, ipo & dupli aren't used anywhere except DNA headers.

dna_rename_defs.h is used to define renaming operations.

The renaming it's self will be done separately.
2019-02-16 09:32:29 +11:00
bc657ef16e DNA: warn about old versioning being incomplete
Also sync variable names w/ D4342
2019-02-16 08:51:00 +11:00
Dalai Felinto
eff3728db9 Fix T61512: Crash switching workspace with fullscreen area
In this case we simply create a new screen area that copies the currently
fullscreened area.

Note: At the moment there is no indicative in the non-main window that we are in
fullscreen. That happens because this information is part of the bar and we have
no topbar in this window.
2019-02-15 19:13:20 -02:00
Dalai Felinto
2b7752fb00 Fix T61210: Crash/inconsistency when clicking on obdata in outliner
The problem
===========
For armature, if the active object was in pose mode and the newly
selected armature data (not the pose, but the edit armature) we would
get a crash.

For mesh objects, the issue would happen with the active object in object mode.
Then the new selected object would switch to edit mode, however the overall
mode would still be object mode, leading to unsynced mode across the objects.

The solution
============
Using shift to extend selection makes current selected (compatible)
objects to go to edit mode as well. Otherwise only the newly selected
object will switch to edit mode.

This also works if you are in edit mode for a curve, and click in a mesh icon.

This also changes the rules for multi-object editing (or rather, how we
put objects in and out of it). Now shirt is also taking into
consideration there. So if you simply click in another mesh object's
data, it will have only the newly selected object in edit mode.

To reproduce the old behaviour you need to use shift to include the
newly selected object in the multi-edit party.

Reviewers: campbellbarton

Subscribers: brecht

Differential Revision: https://developer.blender.org/D4344
2019-02-15 15:52:46 -02:00
db3bfd0633 Fix T61575: missing Cycles viewport updates when changing settings.
This reverts "Depsgraph: Don't tag original IDs", commit:
5f814cb3b4.
2019-02-15 18:43:33 +01:00
2f60b505c6 GP: Cleanup old ToDo 2019-02-15 18:12:32 +01:00
7e3a395d86 Fix T61572: Crash when copy/pasting nodes
was caused by rBc6e3a20ab60b, copied node was actually added to the
nodetree, resulting in an endless loop.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D4360
2019-02-15 18:03:25 +01:00
6e40e3489f Add global control over disabling high-resolution smoke draw
Can be found in the viewport's simplify panel, allows to easily
disable high-res display for all the smokes in the scene.
2019-02-15 17:55:24 +01:00
14c00cda39 Cleanup: More obvious name for the flag
Not sure what BIG is, it is HIGH RESOLUTION.
2019-02-15 17:29:01 +01:00
f15d810b1f Cleanup: Naming, BKE prefix
Done for smoke functions.

Smoke modifier functions seems an oddballs here,
but probably also to be renamed.
2019-02-15 17:29:01 +01:00
Dalai Felinto
f5ac1f444b Fix T61567: Object loose its rigid body data when moving to collection
At some I unified the "move to collection" with the remove from all collections
functionality. That meant that even when we were still to keep the object in one
of the collections we would clear its rigid body data.

Now why to even remove the rigidbody data when removing an object from all
collections? That mimics the 2.79 behaviour when we were to unlink an
object from a scene. I suspect it has to do with the rigid body data
being tied to the scene rigid body. Which is a strange design anyways
(add to the list?) since an object can be in more than one scene.
2019-02-15 13:04:18 -02:00
512bbf3748 Cleanup: Line wrapping 2019-02-15 16:00:54 +01:00
bcc619532f Depsgraph: Speedup constraint source lookup
Is mainly used by drivers variables. The slow part was about
iterating over all pose channels to find the one which has a
given constraint.

Now we build a look up table, so this operation is way cheaper,

Brings down relations update time from 0.7sec to 0.4 with Spring
production file.
2019-02-15 15:43:11 +01:00
0ecd587991 Depsgraph: Move RNA lookup to an own query class
Currently should have no functional changes, but allows to
implement runction optimizations more localized and easily.
2019-02-15 15:42:58 +01:00
373b8e311d Depsgraph: Correct logging of build time 2019-02-15 15:42:58 +01:00
7ee6635105 Cleanup: Indentation 2019-02-15 15:42:28 +01:00
faa255c0a4 Bevel: remove workspace text message when exiting bevel.
The message with shortcuts was hanging around after bevel
exited.
2019-02-15 09:15:32 -05:00
dd97b09fa8 Bevel: fix twist on bevel of cylinder with >= 200 sides.
This triggered an "almost parallel" case in setting the
offset meet points, which is OK but code needed improvement
put the meet point in a more accurate place.
This ia fix for part of the report T61214.
2019-02-15 08:32:07 -05:00
a5cbe81bed Depsgraph: Show build time on --debug-depsgraph-time
Previously was only shown on --debug-depsgraph-build which
had other unwanted noise.
2019-02-15 12:29:06 +01:00
00fc604478 Fix T61570: Monkey primitive fill color wrong
This was introduced by error in a previous commit.
2019-02-15 12:00:43 +01:00
872ff507a2 Fix Spring characters being in the rest pose on file open
This partially reverts bf2c5217 and makes it so animation is evaluated
for datablocks which were never evaluated within the dependency graph.

Not ideal, but safest way currently.

Animation for already evaluated datablocks will only be evaluated on
manual edits, so the initial bugfix is still valid.
2019-02-15 10:55:12 +01:00
e98ef47ed3 Cleanup: Argument wrapping 2019-02-15 10:52:53 +01:00
5f814cb3b4 Depsgraph: Don't tag original IDs
This is unreliable for cases when multiple dependency graphs
are to be updated.

The only reason why it was attempted to be made is to deal
with cases when ID appears in the dependency graph for the
first time. But even then it should be smart enough bring
itself to an up-to-date state without any extra tricks.
2019-02-15 09:25:26 +01:00
42c53e054f Cleanup: Attempt to clarify some ID_RECALC flags 2019-02-15 09:25:26 +01:00
9800837b98 Cycles: Support multithreaded compilation of kernels
This patch implements a workaround to get the multithreaded compilation from D2231 working.
So far, it only works for Blender, not for Cycles Standalone. Also, I have only tested the Linux codepath in the helper function.
Depends on D2231.

Patch by lukasstockner97, jbakker, brecht

    job    |   scene_name    | compilation_time
----------+-----------------+------------------
    Baseline | empty           |            22.73
    D2264    | empty           |            13.94
    Baseline | bmw             |            56.44
    D2264    | bmw             |            41.32
    Baseline | fishycat        |            59.50
    D2264    | fishycat        |            45.19
    Baseline | barbershop      |           212.28
    D2264    | barbershop      |           169.81
    Baseline | victor          |            67.51
    D2264    | victor          |            53.60
    Baseline | classroom       |            51.46
    D2264    | classroom       |            39.02
    Baseline | koro            |            62.48
    D2264    | koro            |            49.03
    Baseline | pavillion       |            54.37
    D2264    | pavillion       |            38.82
    Baseline | splash279       |            47.43
    D2264    | splash279       |            37.94
    Baseline | volume_emission |           145.22
    D2264    | volume_emission |           121.10

This patch reduced compilation time as the split kernels and base
kernels are compiled in parallel. In cycles debug mode (256) you can set
unmark the opencl single program file, what reduces the compilation time
even further (bmw 17 seconds, barbershop 53 seconds).

Reviewers: brecht, dingto, sergey, juicyfruit, lukasstockner97

Reviewed By: brecht

Subscribers: Loner, jbakker, candreacchio, 3dLuver, LazyDodo, bliblubli

Differential Revision: https://developer.blender.org/D2264
2019-02-15 08:56:20 +01:00
4ce9785e01 Cycles: Support multithreaded compilation of kernels
This patch implements a workaround to get the multithreaded compilation from D2231 working.
So far, it only works for Blender, not for Cycles Standalone. Also, I have only tested the Linux codepath in the helper function.
Depends on D2231.

Reviewers: brecht, dingto, sergey, juicyfruit, lukasstockner97

Reviewed By: brecht

Subscribers: Loner, jbakker, candreacchio, 3dLuver, LazyDodo, bliblubli

Differential Revision: https://developer.blender.org/D2264
2019-02-15 08:49:25 +01:00
d17a027034 Fix DNA struct member versioning logic
Possible error changing names which are shared between structs.
While the problem doesn't occur at the moment, avoid future problems.
2019-02-15 18:17:58 +11:00
925b202641 Cleanup: sync minor changes from D4342
Use naming conventions from the patch so they match when it's applied.
2019-02-15 17:22:33 +11:00
d132c44652 UI: impossible to activate RMB menu on menu items
Right clicking on a menu item now closes it's sub-menus and opens
the button's context menu.

This is needed for adding them to the quick favourites menu.

Resolves T58729, T61015.
2019-02-15 16:13:28 +11:00
90f6fd0a36 Fix T60905: Crash using smooth tool
Tools were relying on gizmos drawing to initialize their gizmos,
now tool gizmos are initialized immediately.
2019-02-15 13:32:31 +11:00
796abc90a8 Fix T58090: Selected curve vertex should stand out
D4002 by @slumber w/ edits.

Use text colors, blending to background if they don't contrast.
2019-02-15 11:58:36 +11:00
986d480566 makesdna: correct function docs
Also use doxy sections & remove parens from return values.
2019-02-15 10:41:10 +11:00
de9026de6e ctodata: make stripping the last byte optional 2019-02-15 10:18:10 +11:00
5c432cd11b Fix T61427: Bevel crash with patch miter.
The adjustment phase had broken assumptions after adding miters,
and sent a null problem to eigen. Fixed code to check assumptions.
2019-02-14 17:21:50 -05:00
0f135f80f2 Fix outliner box select not working when using search filter. 2019-02-14 20:08:48 +01:00
7a41c1634b Merge branch 'blender2.7' 2019-02-14 20:00:37 +01:00
de0e456a6c Cleanup: fix compiler warnings. 2019-02-14 19:39:39 +01:00
9886ae6331 Fix T61470: incorrect saturation clamping in recent bugfix.
We should clamp the result after multiplication.
2019-02-14 19:28:44 +01:00
349357a7bd UI: reword error message when Python script fails.
Differential Revision: https://developer.blender.org/D4353
2019-02-14 18:17:00 +01:00
fb6f1aa12f Fix Cycles Embree crash on macOS, due to too small thread stack size. 2019-02-14 17:21:55 +01:00
93d11edd7e Fix Cycles build error with OpenImageIO 2.x. 2019-02-14 17:20:43 +01:00
1f1eea675f GP: Cleanup some lowercase texts 2019-02-14 16:52:15 +01:00
6995d51c75 GP: Don't activate Fill for new materials
As the fill color alpha is set to zero, it's better keep fill option disabled.
2019-02-14 16:52:14 +01:00
76747d0a11 GP: Avoid eraser in empty frames and add warning.
Also capture event to avoid Move transform.

Note: Now it's using a report message. Maybe this can be removed, but without the message, the event is captured by move transform.
2019-02-14 16:52:14 +01:00
a2510434bb GP: Do not draw in Locked or Invisible layers
It's weird to draw in a layer where the stroke cannot be seen or is not saved.
2019-02-14 16:52:14 +01:00
fa7149893a Cleanup: replace Main ID's foreach functions by macros.
Am really no a big fan of using macros for that kind of things, but
meh... C solution to do that with functions (using callbacks) is
even worse. :(
2019-02-14 16:26:32 +01:00
Dalai Felinto
caf89c3de1 Fix Object > Animation > Bake Action 2019-02-14 13:54:15 +00:00
4f92037158 Fix T61536: can't snap vertex to another vertex in edit mode using curves
Previously, the curve self snapping would only snap to points that were
earlier in the curve structure. This was because of a simple coding
snafu of using break when meaning to use continue.
2019-02-14 14:54:05 +01:00
87bba05d25 Fix T61520: Incorrect assignment of layers to compositor nodes in 2.8 when reading 2.79 .blend
Reviewers: brecht

Maniphest Tasks: T61520

Differential Revision: https://developer.blender.org/D4352
2019-02-14 13:55:35 +01:00
8d421f3d9b Fix T56665: Assert when selecting object
Selecting object w/ a different mode missed refreshing the screen
areas current tool.
2019-02-14 23:34:32 +11:00
816c135270 UI: add symmetrize to armature menu
Was lost on menu reorganization,
minor tweaks to make it match the context menu.
2019-02-14 18:32:04 +11:00
c6cbcf83d0 Fix T61472: Hide Unselected fails w/ no selection
Also skip mesh recalculation when no hide/reveal is performed.
2019-02-14 18:01:30 +11:00
6074f62d1a Fix T61353: Crash converting a curve to a mesh
This was caused by curves pointing to each other
creating a cyclic dependency.

While the dependency graph detects this, generating a mesh for render
recursively generates data which cashes in this case.

Add in a check to detect cyclic links.

Note, this bug exists in 2.7x too - but only crashes on render
since 2.7x didn't use 'for_render' when converting data.
2019-02-14 17:21:55 +11:00
caa8e7ff28 DRW: de-duplicate vertex & weight paint engines
These were almost exact duplicates, use one engine for drawing both
kinds of vertex color.
2019-02-14 15:22:58 +11:00
9478ac701b DRW: use light wire for weight paint mode
Black wire can be hard to see against dark blue,
especially when shading is enabled.

Use light grey, matches 2.7x.
2019-02-14 15:22:58 +11:00
7280d9d1e4 DRW: Increase weight paint wire depth bias
By default wire would z-fight against the surface.
Increase the bias, also don't adjust the 'w' component
since it causes bias that depends on the view direction.
2019-02-14 15:22:58 +11:00
c12b29e884 Cleanup: vertex painting variable use
Assign to local variables when setting up passes,
avoids mix-up between similarly named struct members.
2019-02-14 13:08:49 +11:00
37b7a5c8b8 Fix vertex/weight paint showing edge selection
When vertex/face selection are disabled - show all wire
ignoring selection & hidden state.
2019-02-14 12:40:21 +11:00
a8134647c9 Fix T61360: Weight paint tools ignore face select
Face selection was added in weight paint mode since 2.7x,
however tools hadn't been updated.
2019-02-14 11:47:23 +11:00
6c2a0049e4 Fix T61497: Old keymap causes error on startup
When a keymap has an error loading, don't make it active
since it will be partially loaded and not usable.
2019-02-14 11:11:53 +11:00
a9da750aee DNA: add in-place stripping utility
Minor change from D4342
2019-02-14 09:59:46 +11:00
b42333fba6 Keymap: preference for alternate tap action for some pie menus
This allows secondary keys on tap.
Currently Z-key to toggle wireframe and tilde for navigation.

This is currently experimental, if users like this the preference
can be kept and used where appropriate.
2019-02-14 09:44:13 +11:00
bdeb9f047a Keymap: Alt-N to flip normals
Add shortcut since this has been removed from the context menu,
now it's in the mesh normals menu which isn't so convenient to access.

Shift-N is already used to recalculate normals,
this fits the convention of Alt removing/reversing.
2019-02-14 08:49:26 +11:00
672d7d2d9c Cleanup: indentation 2019-02-14 08:49:26 +11:00
11ec57e211 fix build on xcode with openmp 2019-02-13 22:34:40 +02:00
8365de52bc Fix T61477: freestyle not updating in animation render (again).
Must use the right function to get animation updates now.
2019-02-13 20:04:44 +01:00
dbd9b7590a Merge branch 'blender2.7' 2019-02-13 19:02:43 +01:00
b54b14582b Fix T61505, T61280, bugs in button drag toggle after recent changes. 2019-02-13 19:00:11 +01:00
a75ac18638 Fix T59062: Keyframed node properties stay linked after shading network duplication.
There is no reason not to duplicate Actions too here, especially when
Materials' Actions are pretty much impossible to edit from current UI
(afaik, DopeSheet editor does not has any way to change them?).
2019-02-13 17:20:49 +01:00
ec559912fb Fix T61470: inconsistent HSV node results with saturation > 1.0.
Values outside the 0..1 range produce negative colors, so now clamp to that
range everywhere. Also fixes improper handling of hue > 2.0 in some places.
2019-02-13 17:06:30 +01:00
46c871b4ae GP: Cleanup Paint Poll method
The poll was checking things related to all annotations, but now the check must be only for grease pencil objects and 3D view.
2019-02-13 16:48:41 +01:00
cf92d83c0a Fix T61446: (second part) Some items in editor and mode selectors are not translatable.
That one is utterly ugly fix really, but unfortunately a proper one
would require some changes to our RNA (or more precisely, pyrna) code,
so that when we subscript a dynamically generated RNA collection, the
item is somehow duplicated (and probably 'assigned' to its py object?),
before the temp RNA array memory is freed...
2019-02-13 16:32:58 +01:00
10efc54729 Fix NodeTree types UI messages not being properly tagged for translation.
Probably fix first part of T61446.
2019-02-13 16:19:09 +01:00
a4e81e2dfb Fix T61515: Crash when unloading a scene with pynodes and idprop of type id.
Usual legacy/history crap in NodeTree code... Datablocks's specific
freeing code should never, ever do refcounting management, this is
handled by higher-level code from BKE_library area.
2019-02-13 16:10:46 +01:00
79f5b825a9 Fix T61502: Cycles wrong other object texture coordinates in OSL.
The row/column major matrix conversion was done twice.
2019-02-13 15:03:08 +01:00
c6e3a20ab6 Fix T61506: Wrong user counting with ID properties in pynodes.
Nuke away old nodeCopyNode(), much better to use new BKE_node_copy_ex(),
which behaves as expected for the various optional flags that can be passed.

This also removes the need to handle ID refcounting in calling code
(ugly!) and allows us to remove an even uglier name from our codebase! :D

Note that this fixes three related issues actually, that bug was also
affecting copy/paste of nodes, and 'Separate with copy' operator (the
latter being actually fully wrong, since it was not refcounting
anything, not even node->id pointer...).
2019-02-13 15:02:24 +01:00
74a3d9b410 Merge branch 'blender2.7' 2019-02-13 14:34:26 +01:00
1bbe770030 Fix missing Cycles cryptomatte metadata in renders. 2019-02-13 14:34:17 +01:00
eb7f2457e5 Cleanup: do not cleanup runtime data twice during ID copying...
More or less same code was being executed twice during ID copying.

Makes no sense to add yet another switch-by-ID-type to handle
specificaly runtime data during ID copying, we already have
BKE_xxx_copy_data() functions for that.
2019-02-13 14:31:56 +01:00
3866161da8 Fix T61457, T61489, T61482: build errors and memory warning in Cycles.
For OIIO 2.x we must use unique_ptr. This also required updating the
guarded allocator for std::move to work. Since C++11 construct/destroy
have a default implementation that also works this case, so we just
leave it out.
2019-02-13 14:00:36 +01:00
5e3838faa2 Fix T61499: Missing Camera settings in props except Depth of Field
rB55c281415b67 removed 'BLENDER_RENDER' as a COMPAT_ENGINE but the
cycles addon checks for this in its get_panels() function.

Adding this back for now.

Reviewers: brecht, billreynish

Maniphest Tasks: T61499

Differential Revision: https://developer.blender.org/D4346
2019-02-13 12:32:40 +01:00
57f0b175d7 Fix T61487: quick favorites crash outside of open preferences window 2019-02-13 11:05:14 +01:00
539cbf639f Fix crash removing drivers
Was a use-after-free during relations update.

Now we do similar dependency graph tags, but without any
extra animation update logic, which was accessing various
pointers.

Was found when looking into a file from T56635.
2019-02-13 10:42:32 +01:00
f54c3e3500 GP: Remove debug print 2019-02-13 10:00:02 +01:00
b271cbfcb0 Cleanup: unused DNA struct members
- Timeline theme.
- 3D view runtime variables.
- Exclude EditLatt from SDNA.
2019-02-13 19:14:36 +11:00
2424bb3d5e Fix T61411: Camera clip overlay enabled by expanding UI 2019-02-13 16:39:03 +11:00
ba6cf3cdb6 Cleanup: rename variable name for DNA utils
Rename 'elem_dna' to 'elem_full' to signify it has array/pointer chars.
2019-02-13 11:09:07 +11:00
4d890f3778 Cleanup: unused variable 2019-02-13 11:08:38 +11:00
9a8a5676da Cleanup: style, duplicate includes 2019-02-13 11:00:07 +11:00
61e2e609a1 I18N Messages: fix confusion with Light meanings.
Using ID_LIGHT or ID_ID for "Lamp" meaning, "Light" without context
being for 'not heavy'.

That rename of data-block was not really nice on that side of things :/

Related to T43295.
2019-02-12 22:15:27 +01:00
62f8c55a75 Cleanup: rename BLT_I18NCONTEXT_ID_LAMP -> BLT_I18NCONTEXT_ID_LIGHT. 2019-02-12 21:53:10 +01:00
025df50f61 Fix T51771: UI Messages: Reserve 'Normal' to its geometric meaning.
Using 'Regular' instead for the common meaning, this avoids having to
add some i18n context disambiguation...
2019-02-12 21:34:21 +01:00
9d63b0d539 Fix T61469: wrong object statistics when using instances.
The new code already loops over all instances, don't need to be counted again.
2019-02-12 19:18:32 +01:00
c8e446e1ca Fix T61453: crash rendering after selecting particle settings datablock. 2019-02-12 19:00:48 +01:00
70c5699734 GP: Move to new layer did not work with autolock
When the autolock layer option was enabled, the move to new layer operator was not working as expected.
2019-02-12 18:15:00 +01:00
a1d440de4a Edit Mode: Fix element selection on some old AMD GPUs
Tested on an `AMD Radeon HD 7570M`.
It seems that a VBO containing only `unsigned bytes` or `unsigned shorts` can't be read correctly in a shader.
Strange that if the index buffer repeats the drawing of the vertices (as was done before rBa04dd15193e6) the problem disappears.
The disadvantage of this solution is that the memory size for a selection VBO increases by about 4 times.
But the loss in optimization is negligible.


Thanks to @fclem for pointing out the possible source of the problem and reviewing the fix.
2019-02-12 14:12:57 -02:00
Dalai Felinto
09b40aa039 Fix "typo" in show_object_viewport* RNA_def_property_update 2019-02-12 14:27:30 -02:00
f16763a01d Fix T60999: Duplifaced objects are not drawn in edit mode
Seems to be rather trivial change to use proper cage mesh nowadays.
2019-02-12 17:05:32 +01:00
5aacad16e0 Fix T61462: Missing update when toggling GP layer visibility in the Outliner 2019-02-12 17:01:38 +01:00
027c356e23 Use direct access to evaluated mesh from instancing
It is supposed to be already evaluated. If for some reason it's not
doing such direct evaluation will not be reliable anyway (indirect
dependencies for example).

This fixes an assert part of T61431.
2019-02-12 16:42:34 +01:00
8614f28234 Depsgraph: Special relation for instances and metaballs
Ensures that object which is set for instance-vert or instance-face
is evaluated prior to metaball. This is because metaball will request
list of instances during evaluation.

This should fix issue reported T61431 in release build. The assert is
still there and is to be addressed separately.
2019-02-12 16:42:34 +01:00
7c03d6c4e6 Cleanup: Make parent relations a bit cleaner
Mainly getting rid of old and somewhat misleading and unclear
comments.
2019-02-12 16:42:34 +01:00
03d25184d9 Fix T61458: GP Ctrl + F doesn't do anything
This keymap was used in the old grease pencil and now must be removed.

The keymaps for brush are:

F: Change Radius
Shift + F: Change strength

Ctrl+F -> Removed.
2019-02-12 16:38:02 +01:00
43139bf8b4 Fix T61428: Node editor's 'Interface' panel shows in all tabs
Reviewers: brecht

Maniphest Tasks: T61428

Differential Revision: https://developer.blender.org/D4343
2019-02-12 15:57:05 +01:00
3797fdcfc1 Modifiers: Make Difference default operation for boolean modifier.
Make Difference a default value for boolean modifier operation property.

Currently operation property of the boolean modifier is set to Intersect, which is the least frequently used boolean operation of the three available. It is also goes out of sync with Intersect (Boolean) tool, where Difference is a default operation.

Reviewers: mont29, brecht, sergey

Reviewed By: mont29, brecht, sergey

Subscribers: mont29, brecht, campbellbarton, sergey, billreynish

Tags: #modifiers

Differential Revision: https://developer.blender.org/D4340
2019-02-12 14:14:21 +01:00
87c4f30954 Fix T61455: Import any add-on broken
recent split userpref.py out of wm.py (rB9ec944bbab7a) forgot to move
'module_filesystem_remove' there as well...
2019-02-12 13:33:33 +01:00
20f78dc12f Fix T61430: invoke_popup() does not respect ui scale
Reviewers: brecht

Differential Revision: https://developer.blender.org/D4341
2019-02-12 13:30:24 +01:00
024f5ba2bd Depsgraph: Run rigid body after modifiers are ready
This makes it so modifiers are using object transform prior
to the rigid body simulation, and then result of modifier
stack is fed to the solver.

Solves dependency cycle which was happening when object's
modifier was dependent on the modifier transform.

While now it is not possible to change simulation, things
are somewhat more clear and reliable in other ways.
For example previously, solver was using derives mesh from
a previous step in time, which causes unfixable simulation
issues (with intersections and such)

Fixex T57589: 2.79 Rigid Body Sim. Does Not Behave The Same In 2.8
Fixex T61256: Compositing scenes causes crash, but rendering separately does not
Fixes T61262: Armature and rigid body crash
Fixes T61346: Rigid body with modifiers incorrect work
2019-02-12 12:32:03 +01:00
17416b80f6 Weight modifiers: Remove weird looking dependency
Modifiers are part of geometry component, no way they can
be dependent on the geometry component of the same object.
2019-02-12 12:07:59 +01:00
07ff9e92bb Depsgraph: Add utility function for transform dependency
This is what modifiers are to use to indicate that they depend
on a transformation of the object itself.

Currently should be no functional changes, but in the future
this will allow to easily change transform operation depending
on whether there is a simulation associated with the object.
2019-02-12 12:07:59 +01:00
d3870471ed Fix fur on Spring characters
There is an issue of hair being completely messed up when
switching to a simulation view layer for Autumn.

Restoring back the code which was re-setting particles on
file load. This will re-set unbacked particles on file load
but this appears to be happening in 2.7 as well.

Can not reproduce bugs which were fixed in this area recently,
so maybe it's finally tackled (fingers crossed!).
2019-02-12 10:57:32 +01:00
65ffc414fe Cleanup: move utility functions into dna_utils
Rename old/new to src/dst since renaming happens in both directions
when versioning.
2019-02-12 17:56:35 +11:00
d968db82b7 makesdna: add shared utility module
Currently only a single function was duplicated which isn't so bad,
this change is to allow DNA versioning code to be shared between
dna_genfile.c and makesdna.c.
2019-02-12 17:09:57 +11:00
f96bfde4a5 makesdna: use memarena for string allocations
Include it since versioning code will need to perform
small string allocations too, which doesn't fit will into
the currently used fixed size buffers.
2019-02-12 16:52:54 +11:00
b539aee0c9 BLI_memarena: remove use of BLI_linklist
Preprare for using memarena w/ makesdna, BLI_linklist depends on
BLI_mempool. Since linked list use in here is simple, do it inline.
2019-02-12 16:28:10 +11:00
036ec5cae4 Cleanup: use printf define in makesdna 2019-02-12 10:10:04 +11:00
3ec4c2f842 DNA: support versioning structs & struct members
This is only to be used rarely because it's not forwards compatible.

Replace version patching of old 2.80 DNA with a more generic API.
2019-02-12 09:38:46 +11:00
2a6d03493c WM: default to opening maximized
Blender is typically used maximized or fullscreen,
load maximized instead of attempting to fill the screen bounds.

To load un-maximized use '--window-border' argument.

See D4332
2019-02-12 09:14:10 +11:00
7cca0f9998 Fix T61391: MeshDeform Modifier does not work on a solidified planar mesh.
`BKE_modifier_get_evaluated_mesh_from_evaluated_object()` used by
modifiers needing access to other objects' geometry probably skipped out
of the radar when cage and final evaluated meshes were added to
BMEditMesh? In any case, we do not need to duplicate (and then free!) a
temp mesh from editdata anymore, and we can even add instead a parameter
to get cage instead of final. Also makes modifiers code a bit simpler.
2019-02-11 20:24:07 +01:00
d8888b2f48 Merge branch 'blender2.7' 2019-02-11 18:39:31 +01:00
2a9c8da709 Cycles: add animation denoising test, fix operator to work with single frames. 2019-02-11 18:37:02 +01:00
9efbc8d76f Cycles: backport samples metadata format changes to 2.7.
The render layer name is now always included. Best to keep these consistent,
so that animation denoising and sample merging works the same for both and
tests can be the same. Ref D4311.
2019-02-11 18:18:32 +01:00
558d7dd90e Fix T61376 Group Node Node Editor theme property is missing alpha channel
It is now possible to adjust the group node background alpha.
The defaults are the same as before, but you can now adjust the alpha
level via the theme preferences (and the alpha value is no longer hard
coded).
2019-02-11 16:56:20 +01:00
b8dc7e9cb8 GP: Avoid crash when bruhs setting are invalid
This change avoids crashes for wrong settings, but we need find why the settings were wrong.

Related to T61413
2019-02-11 15:58:04 +01:00
452df3f392 Cleanup: comments 2019-02-12 01:51:03 +11:00
Pablo Vazquez
36aa8499e8 UI: Use icon in Dopesheet 'Toggle Graph Editor' menu item. 2019-02-11 15:46:09 +01:00
Pablo Vazquez
17ce9f61c3 UI: More descriptive labels for Metaball panel.
Also remove redundant "Resolution" label.
2019-02-11 15:46:09 +01:00
b8d4f06b10 Merge branch 'blender2.7' 2019-02-11 15:25:46 +01:00
3117446967 Fix T61362: Hair particles does not appear when rendering
Fix T61406: Particles don't render

Consider initial dependency graph evaluation as a file load.

Is still resetting too much, but that we can solve later.
2019-02-11 15:24:11 +01:00
51d161a89e Depsgraph: Use proper tag source for special case
Special case of handling update tag of 0 was using wrong update
source, causing unwanted point cache resets on file load.
2019-02-11 15:24:11 +01:00
9359200956 Fix build error on macOS after recent changes. 2019-02-11 15:03:28 +01:00
23c14a0bba Fix: Eevee SSS not rendering as expected
Remove forcing separate albedo when rendering. It was creating confusion.
2019-02-11 14:50:25 +01:00
d07cde8de8 Fix T61374 : vertex not visible/selectable if it is at objects origin
It was caused by Null normal if the vertex is at origin. Just add a small
bias to avoid this case.
2019-02-11 14:38:14 +01:00
1a8cd3a8a7 Cleanup: avoid string copy for comparing int id's
More direct and readable.
2019-02-11 23:53:33 +11:00
e379a9ba91 Cycles: add animation denoising Python operator.
This adds a cycles.denoise_animation operator, which denoises an animation
sequence or individual file. Renders must be saved as multilayer EXR files
with denoising data passes.

By default file path and frame range come from the current scene, and EXR
files are denoised in-place. Alternatively, a different input and/or output
file path can be provided.

Denoising settings come from the current view layer. Renders can be denoised
again with different settings, as the original noisy image is preserved along
with other passes and metadata.

There is no user interface yet for this feature, that comes later.

Code by Lukas with modifications by Brecht. This feature was originally
developed for Tangent Animation, thanks for the support!

Differential Revision: https://developer.blender.org/D3889
2019-02-11 13:39:08 +01:00
3f8e263709 Merge branch 'blender2.7' 2019-02-11 13:37:45 +01:00
c10f5d15c2 Cycles: add animation denoising Python operator.
This adds a cycles.denoise_animation operator, which denoises an animation
sequence or individual file. Renders must be saved as multilayer EXR files
with denoising data passes.

By default file path and frame range come from the current scene, and EXR
files are denoised in-place. Alternatively, a different input and/or output
file path can be provided.

Denoising settings come from the current view layer. Renders can be denoised
again with different settings, as the original noisy image is preserved along
with other passes and metadata.

There is no user interface yet for this feature, that comes later.

Code by Lukas with modifications by Brecht. This feature was originally
developed for Tangent Animation, thanks for the support!
2019-02-11 13:32:54 +01:00
9ec944bbab Cleanup: split user preferences out of wm.py
These operations are for handling preference related tasks so move into
into a preferences file.

Operators still need to be renamed.
2019-02-11 23:24:09 +11:00
382fe85e29 Cycles: refactor Blender device settings handling into own file. 2019-02-11 12:53:24 +01:00
55c281415b UI: show camera DOF UI for workbench engine 2019-02-11 22:50:40 +11:00
b10b77d4f0 Fix T61185: Missing modifiers update on changes to texture
Also update relations when modifier texture changes.

Basically same as rB6e00415a85a9, rBca2680aaeb1 but this time for
VertexWeight modifiers

Reviewers: sergey

Maniphest Tasks: T61185

Differential Revision: https://developer.blender.org/D4305
2019-02-11 10:38:30 +01:00
1724ff29e0 readfile: skip negative sized thumbnails
We may want to use 'TEST' BCode in the future for including data
besides thumbnails. This allows negative values to be used w/o
attempting to load a thumbnail.
2019-02-11 19:09:27 +11:00
3ce5e5a857 Cleanup: unused speaker flag 2019-02-11 17:55:52 +11:00
42368a2321 Cleanup: RNA boolean names (use prefix conventions) 2019-02-11 17:49:35 +11:00
826d9ac827 Cleanup: move runtime vars into Camera_Runtime 2019-02-11 16:58:52 +11:00
e215216958 Cleanup: use "_Runtime" suffix for DNA
Was done everywhere except bPoseChannel.
2019-02-11 16:50:23 +11:00
43156d8304 Preferences: remove tweak/drag threshold distinction
Currently the preferences have both tweak and drag threshold,
this is confusing because most actions users would consider
dragging use the 'tweak' setting.

Now one drag threshold is used for both, with a maximum limit of half
the button unit-size in case of dragging UI elements.
2019-02-11 15:48:46 +11:00
1daaa74b08 WM: command line args to start blender maximized
Part of D4323 by @DragMZ
2019-02-11 14:46:25 +11:00
f5249b4e30 Cleanup: use 'struct Main' in header
Causes errors including in some cases.
2019-02-11 14:10:13 +11:00
69b2f52681 DNA: remove Object.display struct
We have a display flag already, use it instead.

Object.display is kept in RNA, exposed via a nested struct,
we can move other display options there.
2019-02-11 10:55:22 +11:00
ffd0fee97c Cleanup: comment indentation & spelling 2019-02-11 10:51:25 +11:00
9ca6fc41ae Bevel: Make modal keymap instead of hardcoded.
Also added keys for toggling harden normals,
and cycling through miter types.
Still to do: add some shortcuts for affecting the
spread value for arc miters.
2019-02-10 16:08:25 -05:00
09f4505712 UI: Color Picker, make HSV default.
Most artists agree that RGB by default is not as flexible as HSV.
It's just the first time it opens anyway, since it will remember whatever
was set last like it always does.
2019-02-10 21:30:08 +01:00
5d2b23766b Link/Append: Instantiate collection rather than objects.
When one is indirectly linking collections, better add collection to the
scene, than instantiating its objects into master collection of the
scene. That is much cleaner.

Noted/related to T61141.
2019-02-10 17:15:15 +01:00
439437fa3a Fix T61141: Append Particle Settings doesn't append the collection properly.
ParticleSettings' duplicollection is now a proper refcounting user of
its collection, which will avoid losing it on save/reload.
2019-02-10 17:15:15 +01:00
96a7e06792 Cleanup: unused struct member
Also replace intptr_t -> int (no good reason to cast to intptr here).
2019-02-10 22:50:04 +11:00
0629359762 I18N: Add Kazakh language.
Disabled for until we get actual first tranlation in SVN repo. ;)

Related to T61102.
2019-02-10 11:04:53 +01:00
0b6dbbc306 Cleanup: move clipping shader lib & define into struct
Also compare clipping with the draw context instead of
accessing the RegionView3D, currently they're matching
but this might not always be the case.
2019-02-10 11:16:31 +11:00
16d7967c2b Cleanup: use shorter name for shader config
The struct name is descriptive,
this isn't going to be confused with other variables.
2019-02-10 11:02:06 +11:00
Dalai Felinto
66c23ea2b4 Cleanup: Use ID_IS_LINKED instead of id.lib 2019-02-09 18:41:52 -02:00
Dalai Felinto
69f50e6ea9 Fix: objects in outliner cannot be disabled
But introduced on 191b8951f7.
Reported on tracker as a comment on 3f537f30e6.
2019-02-09 14:26:27 -02:00
af0eb938b8 Fix T61276: Make Single User unlinks original object.
In that case, we have to consider number of scenes using an object, not
number of collections.
2019-02-09 13:24:31 +01:00
bf4f01779d BKE_object: add util to count number of scenes using an object.
Issue is, ob->id.us is not relevant anymore here, since several
collection might be referencing it inside of a same scene, that is still
only one usage from user perspective...

Note that for now we are just counting scenes instantiating an object,
time will say wether we need more refined/complete check (as a reminder,
most [all?] other Object usages are *not* refcounting ones).
2019-02-09 13:24:31 +01:00
1bf8551f00 GP: Missing in previous commit 2019-02-09 11:08:17 +01:00
b85d5dd9b1 GP: Init stroke buffer always
Related to T61334

This initialization avoid any crash when user saves the file while he is drawing a stroke session.
2019-02-09 10:59:25 +01:00
ade4017293 GNUmakefile: fix deps directory
`uname -p` is unknown on some distros, use posix standard `uname -m`.
2019-02-09 17:00:57 +11:00
7262ac6202 Fix T61332: Python3 syntax errors 2019-02-09 13:10:34 +11:00
Dalai Felinto
191b8951f7 Outliner visibility: Prevent changing linked objects and collections
We still change their base/layer collection visibility, just not what would change the
original ID datablock.
2019-02-08 20:09:37 -02:00
Dalai Felinto
e04d6794d0 Outliner Visibility: Alt+H operator to unhide all objects and collections 2019-02-08 19:59:02 -02:00
Dalai Felinto
744223afbf Outliner Visibility: H operator to hide collection or objects 2019-02-08 19:44:37 -02:00
Dalai Felinto
3f537f30e6 Outliner visibility: Ctrl to isolate object
Ideally it would be nice to make all the base parent collections visible as well.
However we do not know this from the outliner.
2019-02-08 19:15:41 -02:00
0e3d1eee15 Fix (unreported) crash when undoing after ID deletion.
Yes, we do can undo an ID deletion now.

However, this requires extra care in UI 'remapping' to new IDs step
(when undoing, we do not fully reload the UI from saved .blend).
Otherwise, new UI (i.e. one from saved .blend file) might reference
IDs that where freed in old bmain (the one before the undo), we cannot
use those to get ID name then, that would be a nasty use-after-free!

To prevent this, we generate a GSet of all valid ID pointers at that
time (i.e. those found in both old and new Main's), and ensure any ID
we try to remap by its name is in that GSet. Otherwise, there is no
possible remapping, just return NULL.
2019-02-08 18:54:52 +01:00
6ba8e71fa2 BKE_main: add a util to generate/extend a GSet with all ID pointers of a Main database. 2019-02-08 18:53:09 +01:00
4b4a231250 Cleanup: API doc is to be in implementation, not header file. 2019-02-08 18:53:09 +01:00
389515f441 Outliner: Purge: correct tooltip, add more info for user.
While ideally we could have a complete detailed list of deleted IDs,
that would require more work UI wise, think for now we can live with
just a rough summary.

Related to T61209.
2019-02-08 18:53:09 +01:00
a8f28329ad BKE_idcode: Add utils to convert from 'lbarray' index to ID type.
This can be useful to be able to match some random array data with
ListBase array of IDs generated by `set_listbasepointers()`.
2019-02-08 18:53:09 +01:00
Dalai Felinto
02581a7ef8 Fix T61287: Object restrict viewport ignored in instanced collection
make_duplis_collection() depends on the collection object cache,
which was not freed upon object viewport disable change.

The best way to reproduce the bug was to instance the default
collection, disable the cube, save and re-open the file.
Now even if you set the original cube to be enabled, you wouldn't see
the instanced one until you forced collection cache to be freed (e.g.,
changing a collection disable state.
2019-02-08 13:57:12 -02:00
Pablo Vazquez
5228a10f6d UI: Marker position slightly offset.
Tested on various interface sizes and thick lines.

Reported by Blender Studio animators.
2019-02-08 16:18:46 +01:00
e925c20f2f Fix T59339: Particle render without baking issues
Fix T61289: Emitting particles from instances not working properly

The first issue has been re-introduced by a code which was dealing
with missing hair after opening the file. That was re-setting all
particle systems all the time because modifier flags were not copied
back to original. This made every modifier run to be seem as an
initial file open.

Now we copy flags back to an original modifier. But also we are
trying to not do any resets unless needed in that case. This way
we can preserve in-memory caches.

Other part of the change is related on re-setting particle system
if number of mesh elements changed. But we only do it if the
modifier has been already evaluated once.
2019-02-08 15:31:08 +01:00
2f0dbdea4f Bevel, fix crash when adjust offsets with inner arc miter.
Previous assumptions about boundary verts always being attached
to edges are now false.
2019-02-08 09:24:43 -05:00
29922b6ff5 Bevel: fix regression re even adjustment of offsets.
Mistakenly had left a debugging assignment that disabled
the offset pass. This commit re-enables it.
2019-02-08 09:02:29 -05:00
6e2da0883f Fix T61309: mesh_utils.triangle_random_points fails with a TypeError
Caused by an error in rBe65784a0519e.
And since we are going over loop triangles anyways, we can remove the
part quecking for quads [remainder of tessface era] entirely.

Reviewers: campbellbarton

Maniphest Tasks: T61309

Differential Revision: https://developer.blender.org/D4324
2019-02-08 13:58:42 +01:00
813800f143 DRW: support clipping for stick & wire bones 2019-02-08 23:21:22 +11:00
Pablo Vazquez
d723249dcc Typo 2019-02-08 12:55:54 +01:00
Pablo Vazquez
7b03e45202 UI: Icons for some Outliner context menu operations
Mainly 'X' icon for Delete, which was already on modifiers and constraints,
but not for objects. Select icon for object selection and refresh for library reload.
2019-02-08 12:52:23 +01:00
Pablo Vazquez
5d7241a9ee UI: Move View operations to submenu in Outliner context menu
Show One Level, Hide One Level, Show Active, Show Hierarchy were taking
four items on the context menu when they are not accessed that often
from the context menu (they all have shortcuts).

The "View" name is used to match other editors View menus.
2019-02-08 12:52:23 +01:00
Pablo Vazquez
2a514f9764 UI: Icons for basic operations in Outliner context menu
Mainly the first of their category or when they need to be highlighted:
* Delete
* Enable Viewport/Render (match icons to make a visual connection)
* ViewLayers (it's used pretty often so it makes it easier to find)

Also group Show/Show All, Hide/Hide All together.
2019-02-08 12:52:23 +01:00
bf2c5217b3 Fix T61231: File open and undo looses unkeyed changes
Only flush copy-on-write to animation when user makes changes.
2019-02-08 12:17:00 +01:00
e418777109 DRW: edit-mesh edge clipping broke in recent update 2019-02-08 22:06:14 +11:00
2855feb2ae Fix T61196: Mesh select ignores clipping (part 2)
Need to use local clipping planes in this case
2019-02-08 21:52:01 +11:00
0e3475b00d Fix T61255: Mesh Data Transfer: Do not abort when destination has not all source data layers.
Originally, when transferring all source data layers to destination
meshes, code would abort in case destination did not have all needed
layers, and creating them was not allowed.

Now, it will instead transfer data to layers that exists, merely
skipping source ones for which it cannot find a matching destination.
2019-02-08 10:16:00 +01:00
351b24ac14 Fix T58625: Knife project fails w/ curves 2019-02-08 19:18:35 +11:00
0822af4c48 WM: init simulated event from win->eventstate
Ghost event handling code works this way.
2019-02-08 19:01:30 +11:00
46ac288a93 Cleanup: rename V3D_MANIP_* -> V3D_ORIENT_*
Wasn't obvious it's related to orientation,
also term manipulator is no longer in use.
2019-02-08 15:22:15 +11:00
d86894b9e4 Fix T61291: Transform gizmo doesn't update w/ 3D cursor 2019-02-08 15:12:04 +11:00
a9853a7e6c Fix missing NULL check in recent version patch 2019-02-08 12:10:56 +11:00
3d16a268ee Undo System: basic support in background mode
Some developers were using undo for their scripts, this allows for undo
pushes in background mode, however - as with 2.7x, undo isn't
initialized at startup in background mode.

See replies to T60934
2019-02-08 10:15:11 +11:00
e1edb51699 Correct error in last commit 2019-02-08 09:41:28 +11:00
261d42cd84 Cleanup: clear deprecated flags 2019-02-08 09:31:59 +11:00
7fdda18ca1 Remove "Keep Session" preference
As far as we know this wasn't widely used, and relied no storing data
in the temp dir which may be cleared on reboot.

More generally, alternative behavior for a core area like file IO
is not something to keep if it has unresolved issues.

See D4310 for details.
2019-02-08 08:42:50 +11:00
0abf754748 Cleanup: sort struct blocks, description 2019-02-08 07:29:21 +11:00
0021273b31 Fix crash drawing loose vertex from recent changes 2019-02-08 07:27:00 +11:00
dd6dcf8247 Cleanup: Use new BKE_main_foreach_id() in a few more places... 2019-02-07 21:52:54 +01:00
17300991c3 Fix wrong Cycles render status text when only writing denoising passes.
In that case we do prefiltering for the denoising passes, but don't actually
denoise the image.
2019-02-07 20:59:48 +01:00
949bc7aa2a Outliner: modernize Purge operator.
That guy was still from the era where only way to remove an ID was to
save & reload the .blend file. Use modern code instead, should also be
much, much more efficient in big production files.

And that’s another nice occasion to add/test new batch ID deletion code, too. ;)

Related to T61276 Make Single User unlinks original object.
2019-02-07 20:46:53 +01:00
599561de84 BKE_main: add utils to loop over whole IDs of a given Main database.
We are currently having the same boiler plate code in tens of places
accross our code, we can as well have a utils to do that.
2019-02-07 20:46:41 +01:00
d2afa51ddc Edit Mode: Draw Vertices after edges
This avoid edges covering a part of vertices.

This comes at a (very minor) perf cost as vertices can cover some edges
pixels and early discard them with the depth test. But this only happens
in artificialy dense mesh and is not a real problem for common cases.
2019-02-07 20:40:54 +01:00
a04dd15193 Edit Mesh: Only draw vertices once
Only add each vertices to point ibo once. That requires tagging each mvert
in the case of modifier preview.
2019-02-07 20:36:29 +01:00
ea30767997 Edit Mode: Reduce number of edges drawn
This make sure only one line is drawn per edge.

It makes the function mesh_create_edit_loops_points_lines() non-thread safe
but this is fine as of now because nothing is multithreaded at this point.
Also this is the only function use this flag so it might be OK.

The side effect is that we don't need to use depth test in edit mode
overlay so the masking artifact will not appear.
2019-02-07 19:11:01 +01:00
7584ef85bf Edit Mode: Fix edge partially displayed as selected with modifier preview
Force set the flag vertice selected in this case.
2019-02-07 19:06:54 +01:00
aa7b013bd5 Edit Mode: Make active face hint part of the face color
This remove the hint on the face edges. This is because the hint was
displayed on both sides and was requiring to draw every edges twice.
2019-02-07 17:47:55 +01:00
a710af2b25 Edit Mesh: Rework new implementation and use geometry shader to draw lines
This make it (theoriticaly) compatible with all supported hardware with
consistent results.

Also we now draw the lines with analytic anti-aliasing instead of relying
on MSAA (which offers less benefits in our case).

The remaining aliasing comes from edges cut in half by the mesh which is
not rendered with MSAA. Hopefully this is not too much distracting and only
happen if the face is almost parallel to the view.
2019-02-07 17:30:10 +01:00
9b774dfa3b Edit Mode: Fix geometry shader workaround not respecting aspect ratio 2019-02-07 17:30:10 +01:00
dec4f6d7ed Bevel: better attachment points for unbeveled edges, arc miter. 2019-02-07 10:42:28 -05:00
4c42e949e9 GP: Reduce render noise pixel in blend borders 2019-02-07 16:31:03 +01:00
8cc5b68eb1 GP: Cleanup blend pixel function
Clear the function that blend pixels and change parameter.
2019-02-07 16:31:03 +01:00
f3c7f44f91 Merge branch 'blender2.7' 2019-02-07 15:49:41 +01:00
6fdc688cd0 Windows: refactor GHOST wintab handling.
This is backporting a change from 2.8, which may help solve crashes when
activating a window. Previously bringTabletContextToFront() would call
tablet API functions with NULL tablet, which may crash on some drivers.

Ref T60811.
2019-02-07 15:30:59 +01:00
58a1259469 Fix object.users_collection not including scene collections. 2019-02-07 13:01:01 +01:00
9c68ac0448 Show all useful metadata fields in editors
Is available when doing "View -> Show Metadata". Will draw all the
fields which are not part of the stamp at the bottom of the image.

Couple of hand-picked fields are ignored, since those are not very
useful to be seen.

Aimed to ease review of rendered shots.

Reviewers: brecht

Reviewed By: brecht

Subscribers: fsiddi

Differential Revision: https://developer.blender.org/D4316
2019-02-07 11:55:07 +01:00
0885484aa6 Fix T59587: Hair dynamics works different when opened in 2.8
Is a missing do-verisoning code in e3d31b8dfb.

Unfortunately, at this point it is rather tricky to tell old and new
hair dynamics modifiers apart. Probably easier to accept possible
breackage of the files which were created in 2.7 and saved during
2.8 which had incomplete do-version code.
2019-02-07 11:48:42 +01:00
937731dff1 Fix T61272: Undo fails to track multi-edit mode enter/exit
Objects leaving edit-mode weren't restored by edit-mode undo steps.
2019-02-07 20:28:33 +11:00
075a122190 Fix sculpt undo steps not enabling dyntopo
Logic to disable dyntopo when entering sculpt mode was applied on undo.
2019-02-07 20:28:33 +11:00
83d78eb32c Close metadata panels by default
They might be rather long, and not that commonly accessed.
2019-02-07 09:38:49 +01:00
9b86c90193 Fix for images without metadata crashing 2019-02-07 09:34:01 +01:00
d6c0f3796a Fix T61049: Undo dynamic topology sculpt asserts 2019-02-07 13:29:59 +11:00
a5869c367e Cleanup: remove unnecessary undo function 2019-02-07 10:09:56 +11:00
9df4602035 PyAPI: message subscribe option arg now optional 2019-02-07 09:36:52 +11:00
f11b5549ea Cleanup: doxy header 2019-02-07 09:36:52 +11:00
478be344fa Fix T61246: studiolights (un)install problems
- studiolights were not installed to their proper subfolder (thus not
recognized on blender restart)
- they were actually loaded with a wrong path which could lead to
deletion of the original source file when uninstalled again
2019-02-06 23:13:50 +01:00
7325035e60 DRW: support clipping for octahedral & box bones 2019-02-07 08:03:56 +11:00
6152f5cd67 Fix refresh on resetting header alignment 2019-02-07 07:49:11 +11:00
Dalai Felinto
5ed27372ab Remove no-longer needed function 2019-02-06 18:48:50 -02:00
Dalai Felinto
db231e87fc Fixup for outliner visibility not changing disable state
Show Inside (shift + click) was still forcing objects to be visible.
2019-02-06 18:48:50 -02:00
ac9daf3a27 Fix (unreported) crash when iterating on depsgraph instances from RNA.
This is a follow-up to rBb44e6f2b3d32, for some reason that issue was
not detected back then: in some cases, DEG_iterator_objects_next() will
free the temp list of dupli objects once it does not need it anymore,
henceforth freeing the dupli_object_current memory of the DEGObjectIterData
that we are storing in the RNA_Depsgraph_Instances_Iterator struct.

And yes, the uglyness of that hack is getting even better now...

Found while trying to export dupliobjects with FBX...
2019-02-06 21:13:52 +01:00
Dalai Felinto
766741b0aa Outliner visibility: Respect original viewport enable/disable state
Note: We still change it to the collection we are directly isolating/making
visible and its parents (in the case of isolating). But no longer its children.

Feedback and discussion on D4011. The motivation is that if we don't keep those
locked the disable state becomes useless.
2019-02-06 17:06:16 +00:00
Dalai Felinto
e3a3782d7f Outliner visibility unification: Prevent master collection visibility to change
Also satinizing the checks for master collection. The outliner tree
iterators already take care of not including the master collection
there.
2019-02-06 16:13:40 +00:00
fb15dfbddf Depsgraph: Fix dependency cycle when rigid body is involved
Was introduced by point cache reset on manual edits. Needed to
split evaluation and introduce an explicit init key, which allows
to hook up relations which are "monitoring" manual edits to the
channel.

Noticed while looking into T61190.
2019-02-06 17:08:24 +01:00
49e07dfdfb Fix T61190: Crash in particles distribution
Was visible with certain configuration only, is a numeric
instability caused by degenerate ray direction.

Not sure the distribution is correct, just fixing crash
which was caused by usage of watertight intersection.
2019-02-06 16:38:03 +01:00
8c87af7440 Improvements and fixes to Cycles metadata
This is a request by the studio here to make it possible to see how
many samples were used to render a specific shot or a frame. It is a
bit more tricky than simply stamping number of samples from a scene
since rendering is happening in multiple ranges of samples.

This change makes it so Cycles saves configured number of samples for
the specific view layer, and also stores start sample and number of
samples when rendering only a subrange of all samples.

The format used is "cycles.<view_layer_name>.><field>", which allows
to have information about all layers in a multi-layer EXR file.

Ideally we can store simplified "cycles.<field>" if we know that there
is only one render layer in the file, but detecting this is somewhat
tricky since Cycles operates on an evaluated scene which always have
single view layer.

The metadata is shown in the Metadata panels for clip, image and
sequencer spaces.

Example screenshot which shows the metadata:

{F6527727}

Reviewers: brecht

Reviewed By: brecht

Subscribers: fsiddi

Differential Revision: https://developer.blender.org/D4311
2019-02-06 16:11:51 +01:00
e21ae0bb26 Merge branch 'blender2.7' 2019-02-06 15:22:53 +01:00
fccf506ed7 Cycles: animation denoising support in the kernel.
This is the internal implementation, not available from the API or
interface yet. The algorithm takes into account past and future frames,
both to get more coherent animation and reduce noise.

Ref D3889.
2019-02-06 15:18:42 +01:00
c183ac73dc Cycles: tweak outlier detection, preparing for animation denoising.
Ref D3889.
2019-02-06 15:18:38 +01:00
405cacd4cd Cycles: prefilter feature passes separate from denoising.
Prefiltering of feature passes will happen during rendering, which can
then be used for denoising immediately or written as a render pass for
later (animation) denoising.

The number of denoising data passes written is reduced because of this,
leaving out the feature variance passes. The passes are now Normal,
Albedo, Depth, Shadowing, Variance and Intensity.

Ref D3889.
2019-02-06 15:18:29 +01:00
e8292466bc DRW: Support edit-metaball clipping 2019-02-07 00:07:30 +11:00
3e6ebdd2a6 DRW: Support edit-curve clipping 2019-02-06 23:25:31 +11:00
fea5e1dc3a Fix T57342: Crash on render with workbench render engine via command line 2019-02-06 12:16:24 +01:00
4547815847 Cleanup: Remove deprecated ghosting code
Most of this code is deprecated for many years already and does not
work at all in Blender 2.8.

Reviewers: brecht, aligorith

Differential Revision: https://developer.blender.org/D4271
2019-02-06 12:05:34 +01:00
6202bc82b8 Fix T60935: More numerically stable distance to ray computation
The old function was numerically very unstable for 2 reasons:
computing the square and then subtracting the results.

In the example in T60935 all precision was lost and it returned the distance 0
for all points.

I also removed the `depth` parameter since it wasn't used and computing
it would have made the code more complicated.

Reviewers: brecht, campbellbarton

Differential Revision: https://developer.blender.org/D4308
2019-02-06 11:49:12 +01:00
f7613cf41c UI: tweak header position button
Be less prominent.
2019-02-06 21:39:57 +11:00
afd4bf8694 Fix T61136: Header alignment preference has no effect
Users expect this to apply to existing files,
adjust this to apply on load, defaults to off.
2019-02-06 21:20:15 +11:00
18e67813cd Clip editor: Fix drawing metadata for RGBA images
Need to disable blending prior to drawing metadata. Otherwise
text will be drawn on a transparent background.
2019-02-06 10:48:09 +01:00
f3cc63634a Cleanup: Spelling in comment 2019-02-06 10:12:46 +01:00
a6ef823ac4 Fix T61124: Lag on physics simulation
Need to synchronize simulated frame back to original object.

Solves the lag during transformation, but amount of floppyness is
lower for some reason. Final animated object behaves the same as
in older Blender though.
2019-02-06 10:12:46 +01:00
b294600ddc Fix T61051: crash with multi-object mixed mode snapping
rBec3357e03ab1 introduced multi-object snapping.
Seems like this was done without mixed-mode selections in mind.

So code assumed that all selected objects are actually armatures [which
can fail].
In 2.7 this was not a problem, because code only took active object into
account, 2.8 was iterating over all selected_editable_objects.

Now just iterate over objects in posemode instead

Reviewers: brecht, dfelinto

Maniphest Tasks: T61051

Differential Revision: https://developer.blender.org/D4287
2019-02-06 09:46:20 +01:00
2d5e2de88b Cleanup: remove unused toolbox delay preferences 2019-02-06 18:18:54 +11:00
ed53c8ea76 Cleanup: use '_pad' prefix for padding vars 2019-02-06 18:15:58 +11:00
48a36ff9e9 Cleanup: manually apply changes missed last commit
Automatic edits failed for indented comment blocks,
removed indentation & adjusted.
2019-02-06 15:52:04 +11:00
eef4077f18 Cleanup: remove redundant doxygen \file argument
Move \ingroup onto same line to be more compact and
make it clear the file is in the group.
2019-02-06 15:45:22 +11:00
1085c2cc44 Doxygen: don't warn on undocumented params
We don't attempt to have docs for all args, so don't warn about this.
2019-02-06 15:02:07 +11:00
f339b2fd41 Doxygen: update doxyfile 2019-02-06 15:01:04 +11:00
15ad01492e Cleanup: remove deprecated/unused preferences DNA 2019-02-06 14:34:50 +11:00
7f6a4bc416 Cleanup: use doxy headers for preference comments 2019-02-06 14:23:08 +11:00
cd2bf1fc91 Fix T61191: First undo step missing in text editor 2019-02-06 12:59:38 +11:00
e535ff44ff Undo System: remove accumulate/store modes
This complicated handling of undo steps in a generic way
especially switching between undo systems that stored data to ones
that accumulated changes.

Now each undo system must treat it's steps as check-point,
internally it can apply/rewind changes.

This commit also fixes projection paint where the object mode wasn't
following the undo steps.
2019-02-06 11:52:04 +11:00
8996e26116 Fix T61196: Mesh select ignores clipping
Select clipping now works when x-ray is disabled.
2019-02-06 10:34:09 +11:00
dbd7f36da8 GPU: refactor clipped drawing from DRW into GPU
Needed to fix T61196, supporting clipped back-buffer in the 3D view
which is done outside the draw module.

It was also inconvenient having DRW_shader_* versions of GPU_shader_*
API calls.

- Clipping distances are now supported as a shader configuration
  for builtin shaders.
- Add shader config argument when accessing builtin shaders.
- Move GPU_shader_create_from_arrays() from DRW to GPU.
2019-02-06 09:15:16 +11:00
a245d53351 Cleanup: style 2019-02-06 09:14:36 +11:00
Dalai Felinto
897e047374 Outliner visibility unification: Implement 3 levels of viewport visibility
Now collection and objects can be either:
* Disabled for all the view layers.
* Hidden for a view layer but not necessarily for all others.
* Visible for a view layer but not necessarily for all others.

Regarding icons: Whatever we decide to use for the "Hidden for all view
layers" needs to be a toggle-like icon. Because when viewing "Scenes"
instead of "View Layer" in the outliner we should be able to edit the
collection "Hidden for all the view layers" as an on/off option.

The operators are accessible via a Visibility context menu or shortcuts:
* Ctrl + Click: Isolate collection (use shift to extend).
* Alt + Click: Disable collection.
* Shift + Click: Hide/Show collection and its children (objects and collections)

Things yet to be tackled:
* Object outliner context menu can also get a Visibility sub-menu.
* Get better icons for viewport enable/disable.

Note:
* When using emulate 3 button mouse alt+click is used for 2d panning.
  In this case users have to use the operator from the menu.

See T57857 for discussion.

Patch: https://developer.blender.org/D4011
Reviewers: brecht and sergey

Thanks to the reviewers and William Reynish and Julien Kasper in
particular for the feedback.
2019-02-05 19:32:58 -02:00
Dalai Felinto
e3f7f0c3eb Outliner: eyes for collection affect collection visibility
As oppose to affect the collection objects' visibility.
2019-02-05 18:42:02 -02:00
Dalai Felinto
dc7f312326 Outliner: Gray out collections only when they are invisible
Re-factor of 4521d3e707.
2019-02-05 18:42:02 -02:00
7b22c3269b Fix/workaround issues in pose and edit mode
[re-committing]

Edit mode was unable to select, pose mode was unable to move bones.
2019-02-05 18:42:02 -02:00
Dalai Felinto
3d984aa150 Per view-layer collection visibility
[re-committing]

We still control this in the viewport collections visibility menu. But
now we are actually changing the visibility of the collections, not of
the objects.

If a collection is indirectly invisible (because one of its parents are
invisible) we gray it out.

Also if you click directly in the collection names, it "isolates" the
collection by hiding all collections, and showing the direct parents and
all the children of the selected collection.

Development Note:

Right now I'm excluding the hidden collections from the depsgraph.
Thus the need for tagging relations to update.

If this proves to be too slow, we can change.
2019-02-05 18:42:02 -02:00
Dalai Felinto
d1ef6be4a7 Fix T61204: Can't select Camera in stereoscopy mode
This was deliberately disabled since I didn't get the drawing working
originally. It is fully working now.

Note: camera lens widget still needs to be fixed since it still draws it
wrongly.
2019-02-05 18:40:23 -02:00
2778ecb58c UI: make drag lock work also when buttons have > 2 states or use callbacks.
This will help with upcoming outliner visibility icons with 3 states.

It is done by using the icon to identify the state. If that is not unique
there is no visible difference to users anyway.
2019-02-05 20:21:03 +01:00
4c6e7be44b Fix new EEVEE bloom / motion blur defaults not being applied to startup.blend. 2019-02-05 17:19:10 +01:00
07765499ab Fix strict compiler warning, breaking MSVC 2019-02-05 17:02:01 +01:00
08ab09cf04 Clip editor: Fixes for prefetch
Seems metadata was never read while prefetching, at least was
never requested to be read.

Also fixed prefetch for multilayer EXR.
2019-02-05 16:52:36 +01:00
3467e40e01 BKE_mesh_new_from_object(): do not generate temp obj/cu in Main.
When generating a mesh from a curve object, do not generate temp objects
and curves in main, but rather as 'localized' copies.

This is cleaner, and might add a marginal speed-up in some cases (like
rendering thousands of curve objects), since we save some processing.
Note that this is the function behind py API's `Object.to_mesh()` too.
2019-02-05 16:42:16 +01:00
cfc0790a45 Movieclip: Improve support of multilayer EXR files
Use first combined pass if possible. Is not ideal but better than
showing completely empty image.

Also, covers quite a lot of usecases when movie clip editor is
used to review animation render of single-layer renders but with
multiple passes.
2019-02-05 16:26:16 +01:00
7a2a08e0cd Edit Mode: Increase depth Bias for vertices 2019-02-05 16:12:50 +01:00
a13fb30917 Edit Mode: Fix loose edges edit mode normal display broken 2019-02-05 15:02:15 +01:00
5df56668d3 Edit Mode: Fix Xray edit mode broken due to recent refactor 2019-02-05 15:02:15 +01:00
773f3428cf Edit Mesh: Add workaround for system that does not support wide lines
This adds a new geometry shader (specific to edit mesh for now) that
reproduces the effect of glLineWidth > 1.0, since this is not supported on
all platform.

This fix could be generalized to other shaders later.
2019-02-05 15:02:15 +01:00
a131514d0f Edit Mesh: Fix some problem with new implementation
- Add manual depth offset to vertices and edges.
- Revert to plain edge decoration.
- Fix active edge coloring.
- Remove active face display if not in face selection mode.
- Add wide line support.
2019-02-05 15:02:15 +01:00
112cf6eadf Edit Mesh: Remove old unused code and files
Cleanup after recent refactor.
2019-02-05 15:02:15 +01:00
86193d25db Edit Mesh: Refactor Edit cage drawing to use old style drawing
This is work in progress. Look is not final.

This align data VBO data structure used for edti cage drawing to the one
use for normal drawing.

We no longer use barycentric coords to draw the lines an just rasterize
line primitives for edge drawing. This is a bit slower than using the
previous fast method but faster than the "correct" (edge artifact free)
method. This also make the code way simpler.

This also makes it possible to reuse possible and normal vbos used for
shading if the edit cage matches the

This also touches the UV batch code to share as much render data as
possible. The code also prepare for edit cage "modified" drawing cage (with
modifier applied) but is not enabled since selection and operators does not
work with modified cage yet.
2019-02-05 15:02:15 +01:00
f3f2602c88 UVEdit: Add function variants based on ToolSettings
This is better than passing a scene pointer when we don't have one.
2019-02-05 15:02:15 +01:00
e1b5fe156d Support showing metadata for multilayer EXR files
Quite straightforward: first, convert metadata from file to
stamp data which is stored in the render result, and then
for every requested layer/pass use that as a metadata.
2019-02-05 14:25:36 +01:00
56f5fd84fc UI: Add collection move & link to menu 2019-02-05 22:36:46 +11:00
1b4230d4b5 Cleanup: Add precision to comment. 2019-02-05 10:53:17 +01:00
41a15b7d6d Fix (unreported) linestyle/greasepencil actions not being duplicated by full scene copy.
Noted those as missing in XXX comments some time ago, running again on
that code I still see no reason for this missing feature, so now when
doing a full scene copy, including duplication of Freestyl's linestyles
and scene's greasepencil data, their potential Actions will also be
properly duplicated (like it was already the case for world, and scene
itself).
2019-02-05 10:53:17 +01:00
cfe8f76616 Cleanup: typo in comment. 2019-02-05 10:53:16 +01:00
8b716655e2 Cleanup: replace BKE_id_copy_ex by BKE_id_copy where possible.
That way it is obvious when we are using default ID copy behaviour, and
when we are using advanced/specialized ones.
2019-02-05 10:53:16 +01:00
846105d254 Cleanup: use LIB_ID_COPY_LOCALIZE in BKE_libblock_copy_for_localize().
This is a slightly more risky commit, as it is very difficult to fathom
all that may happen when localazing IDs. Would not expect any issue
though.

Note that a big TODO remain to refactor fully that ID localization
process (for 'shading IDs'), it's still doing pretty much same thing as
regular out-of-main copies, but the infamous ntree topic makes it
delicate to handle...
2019-02-05 10:53:16 +01:00
9469ebe1cc Cleanup: sanitize BKE_libblock_copy_for_localize() copy flags.
Asking to not copy animdata, but copy actions, is pure nonsense (and
make LIB_ID_COPY_ACTIONS flag totally useless/no-op).
2019-02-05 10:53:16 +01:00
5123ee74f8 Cleanup: Remove old deprecated BKE_libblock_copy_nolib() from BKE_library.
Was not used anymore, time to get rid of it.
2019-02-05 10:53:16 +01:00
b6771ccaf6 BKE_library: id_copy: More general usage of LIB_ID_COPY_LOCALIZE.
Turns out most of our 'local working copy' cases can use same set of
flags.

Note that this commit adds LIB_ID_COPY_CACHES to all our local meshes
copying, however this is no-op since that flag is unused during mesh
copying... We may want to add another set of flags without that one at
some point, but for now it would not be useful imho.
2019-02-05 10:53:16 +01:00
72724211df BKE_library: add 'no preview' flag to LIB_ID_COPY_LOCALIZE.
No local work copy is expected to need preview data, at least it should
not. Part of copy flags cleanup, done in separate commit in case
something goes wrong here...
2019-02-05 10:53:11 +01:00
b26c9dfcb2 Cleanup: initial regrouping of ID create/copy flags.
Those two first sets of flags should represent some common use cases.
The goal here is to reduce verbosity of calls to BKE_id_copy_ex, and
help make it more obvious the 'common behaviours' of ID copying across
codebase.
2019-02-05 09:49:50 +01:00
8ebb8add85 Cleanup: comments before items in enums. 2019-02-05 09:49:50 +01:00
6a686b0bfb Cleanup: BKE_library: rename id_copy to BKE_id_copy.
Time to follow conventions for that one as well.
2019-02-05 09:49:50 +01:00
7636e9785d Cleanup: BKE_library: remove 'test' param of id_copy.
This was used in *one* place only... much better to have a dedicated
helper for that kind of things. ;)
2019-02-05 09:49:50 +01:00
999f3985c0 Fix T61107: wmGizmo.test_select can't return -1
This is used to skip selection.
2019-02-05 18:39:57 +11:00
49618b0e18 Fix: Ensure that KeyingSet.bl_description field is properly escaped when using the Export to File operator
Previously, if double-quotes appeared in the KeyingSet.bl_description field,
these would cause a syntax error in the resulting .py script export of the
KeyingSet. Since single quotes are even more likely to appear
(e.g. as apostrophes), we now use triple quotes here.

Unreported bug, noticed earlier when investigating T61010.
2019-02-05 16:21:35 +13:00
af2d2d4dff Fix T58221: Spin tool w/ merge first/last crashes
Spinning geometry that included non boundary/wire edges
crashed when merge first/last enabled.
2019-02-05 13:30:07 +11:00
445433a691 Fix empty object front/back display in perspective views 2019-02-05 10:43:16 +11:00
2c84c23a07 Fix T61163: Single sided images show when viewed from side 2019-02-05 10:29:19 +11:00
40f2afcf1d Cleanup: remove contributors for Python files
Following removal from C source code.

See: 8c68ed6df1
2019-02-05 09:17:00 +11:00
ab5e69e660 Cleanup: remove contributors for CMake files
Following removal from C source code.

See: 8c68ed6df1
2019-02-05 09:10:32 +11:00
38984b10ff T61148: Particle properties can not be edited after keyframing
Was happening with certain settings for hair. Need to make a copy
of particle settings before modifying them via animation system.
2019-02-04 14:09:22 +01:00
ff2dd59d4a PyAPI: use _PyObject_LookupAttr
Unlike PyObject_GetAttr, this avoids setting the attribute error
only to clear it - under some conditions.
2019-02-04 23:35:23 +11:00
6b2a91efff Cleanup: use sys.platform instead of platform module
This was indirectly importing other modules we don't use at startup.
`sys.platform` is sufficient.
2019-02-04 23:07:06 +11:00
7e358b6181 Python: bump minimum version to 3.7
All platforms use 3.7 now, supporting both increases chance some scripts
will fail on older versions.
2019-02-04 22:00:30 +11:00
87aa456ea5 Fix T61172: Crash in texture paint undo/redo
Mixing texture paint undo w/ memfile undo was crashing.

The gputextures and render result are written to the FileData.imamap
but weren't read back.
2019-02-04 19:53:09 +11:00
55c29e36dc Undo System: add function to print undo steps
Useful for debugging.
2019-02-04 15:01:55 +11:00
b5c841498c Fix adding a paint texture slot not refreshing
Adding a new slot wasn't refreshing when the
object had no material.
2019-02-04 14:47:02 +11:00
e6a917cd4e UI: Use 'None' label instead of 'No' for Physics Type
Matches other enums in particle settings and pretty much all over Blender.
2019-02-04 01:45:53 +01:00
3be845ce20 Cleanup: Typos in comments (to to) 2019-02-04 01:23:48 +01:00
a6f045de3f UI: clarify ruler tooltip text
See T61151
2019-02-04 10:32:34 +11:00
838a34324a GP: Fix compiler error 2019-02-03 19:56:57 +01:00
2672552cf7 T61140 Shortcut Eraser and Eraser are not the same
Set default eraser with the last eraser used, and remove the toggle button from UI panel.
2019-02-03 13:27:47 +01:00
2a237377ce Fix typos 2019-02-04 00:41:14 +13:00
65340ad73f Fix T60753: Graph Editor showing cache curves regardless of filters
This commit adds a datablock filtering option for cache files channels,
so that a shot with lots of these in addition to standard animation
(e.g. the Spring production files) don't become bogged down by these.

Furthermore, these channels also respect the "Only Selected" toggle too now.
2019-02-04 00:41:14 +13:00
744f633986 Cleanup: trailing commas
Needed for clan-format not to wrap onto one line.
2019-02-03 14:59:11 +11:00
141c6073ca WM: Event simulation support for Python
This feature is intended only for testing,
to automate simulating user input.

- Enabled by '--enable-event-simulate'.
- Disables handling all real input events.
- Access by calling `Window.event_simulate(..)`
- Disabling `bpy.app.use_event_simulate`
  to allow handling real events (can only disable).

Currently only mouse & keyboard events work well,
NDOF, IME... etc could be added as needed.

See D4286 for example usage.
2019-02-02 15:23:55 +11:00
99b8eef6a5 BKE_global: clear deprecated flags on load (all of them) 2019-02-02 14:45:42 +11:00
d46c910b1a Cleanup: match logic for merging G.f & G.fileflags on load 2019-02-02 14:01:48 +11:00
afcbf7cf13 Cleanup: use G_FLAG_*/G_FILE_* for G.f/fileflags
Was confusing eg: G_AUTOPACK belonged to G.fileflags, G_PICKSEL to G.f.
2019-02-02 13:49:13 +11:00
a53011d520 Cleanup: use enum for BKE globals 2019-02-02 13:29:52 +11:00
4ef09cf937 Cleanup: remove author/date info from doxy headers 2019-02-02 11:58:24 +11:00
a3bf8da875 Merge branch 'blender2.7' 2019-02-02 09:37:50 +11:00
9a63fa21eb Color management: change view transform for color pickers and display modes.
* Use simple default view transform for color pickers, as Filmic does not work
  well for all types of colors. We better handle this with an option and tagging
  of colors as emissive or albedo like.
* For solid/workbench we also no longer use Filmic, as there is not enough contrast
  and it's not really needed since this is not physically based lighting.
* For lookdev always take into account the view transform and look. Other view
  settings like exposure are only taken into account if scene lighting is used,
  since these are often dependent on scene light intensity.

Fixes T61022, T57649, T59363.
2019-02-01 20:56:42 +01:00
81fc55f563 Fix T61010: Keying Set - Description edit box disabled, for internal use only.
Wrong property flag for that one, KeyingSet is a regular RNA class, not
a registrable 'interface' one, unlike KeyingSetInfo...
2019-02-01 20:35:33 +01:00
81159e99b8 Fix T61078: Cycles crash with adaptive smoke sim playback.
3D image dimensions should be updated on the Cycles side before loading
the smoke data.
2019-02-01 19:08:49 +01:00
f92b8c2613 Fix T58206: Eevee light energy soft maximum is too low. 2019-02-01 18:04:00 +01:00
530d9f454c Cleanup: Remove manually missing original author
Name was part of the header GPL text.
2019-02-01 17:20:05 +01:00
b8e409ba98 GP: Cleanup retiming to do in same loop 2019-02-01 17:14:28 +01:00
fdc12395c3 Fix T61071: GP Cutter / Boxes bug
Now when remove points from a cyclic stroke, the last island is joined with first island in order to fill the gap of the cyclic.

This change affects not only to cutter, but to any delete process in cyclic strokes.
2019-02-01 16:50:49 +01:00
d70350403f Cleanup: manually remove header text not handled by automation 2019-02-02 02:41:25 +11:00
8c68ed6df1 Cleanup: remove redundant, invalid info from headers
BF-admins agree to remove header information that isn't useful,
to reduce noise.

- BEGIN/END license blocks

  Developers should add non license comments as separate comment blocks.
  No need for separator text.

- Contributors

  This is often invalid, outdated or misleading
  especially when splitting files.

  It's more useful to git-blame to find out who has developed the code.

See P901 for script to perform these edits.
2019-02-02 02:40:00 +11:00
3b57a0d854 Cleanup: remove original author
Missed when removing contributors.
2019-02-02 02:32:20 +11:00
d9d72cc9cb Fix T61043: Blender crashes on VSE zoom / scroll timeline sometimes 2019-02-01 15:58:27 +01:00
6cbb4c576a Cleanup: manually remove header text not handled by automation 2019-02-02 01:49:31 +11:00
6bdbbcd683 Workaround for missing hair after opening the file
Restore reset on file open, at least for now.
2019-02-01 15:40:19 +01:00
227ed1aa35 Fix T60451: Soft body cache not being cleared when it should
Manual edits to object or its dependencies should reset the
point cache. Added special relations for this now.
2019-02-01 15:40:19 +01:00
97fa7974da Cleanup: Shuffle arguments in most used order
Quite often we need to create nodes which defines various
evaluation stages.
2019-02-01 15:40:19 +01:00
a1aa908a31 Depsgraph: Remove placeholder operation 2019-02-01 15:40:19 +01:00
039792caf3 Depsgraph: Use scene operation code
Hopefully, this is the last one.
2019-02-01 15:40:19 +01:00
b78f29b049 Depsgraph: Use operation code for file cache update
All done in separate commits, so it's easier to bisect just in case.
2019-02-01 15:40:19 +01:00
0d2dfd2e2d Depsgraph: Use operation code for armature evaluation 2019-02-01 15:40:19 +01:00
4a30674102 Depsgraph: Use operation code for dupli-group 2019-02-01 15:40:19 +01:00
c1cf4c29da Depsgraph: Use operation code for geometry evaluation done 2019-02-01 15:40:19 +01:00
a86001c56a Depsgraph: Use operation code for geometry evaluation
Affects object data datablocks. Similar to previous commit.

Should not have any functional changes, just some sanitization
to make code more clear.
2019-02-01 15:40:19 +01:00
700e3cc2a8 Depsgraph: Use operation code for geometry evaluation init
Makes it more explicit and avoids strings comparisons during build.
2019-02-01 15:40:19 +01:00
6a54f3bb49 Depsgraph: More clear name for geometry evaluation
For ears it was already how we evaluate modifiers. There is no
need to go more granular than is actually needed. And no need
to use some obscure prefix for operation.
2019-02-01 15:40:19 +01:00
654ae4145f Cleanup: Space for foreach macro 2019-02-01 15:40:19 +01:00
be05abc86a Depsgraph: Add some sanity checks to ensure valid relations 2019-02-01 15:40:19 +01:00
65ec7ec524 Cleanup: remove redundant, invalid info from headers
BF-admins agree to remove header information that isn't useful,
to reduce noise.

- BEGIN/END license blocks

  Developers should add non license comments as separate comment blocks.
  No need for separator text.

- Contributors

  This is often invalid, outdated or misleading
  especially when splitting files.

  It's more useful to git-blame to find out who has developed the code.

See P901 for script to perform these edits.
2019-02-02 01:36:28 +11:00
e4b02334e7 Update submodule hashes, take 2 2019-02-01 15:15:37 +01:00
6398af5048 Ensure submodules point to blender2.7 hashes 2019-02-01 14:51:15 +01:00
7b05b2564d Fix T61088: Cycles particle viewport render stuck in loop.
Object to be instanced should not be modified.
2019-02-01 13:56:13 +01:00
7f0e773dcd 'make links': rename group -> collection in enum in UI
also rename dupli -> instance

Fixes T61086

Reviewers: billreynish

Maniphest Tasks: T61086

Differential Revision: https://developer.blender.org/D4294
2019-02-01 10:58:12 +01:00
1b7c361fbb WM: disable undo operators in background mode & at startup
Show an error instead of crashing, see: T60934
2019-02-01 14:11:26 +11:00
552b2287db Logging: Use CLOG for blenkernel
Part of D4277 by @sobakasu
2019-02-01 12:46:39 +11:00
8a51af7d1c Cleanup: correct doxy headers 2019-02-01 08:41:35 +11:00
7b08c62841 Fix build errors on Visual Studio after recent changes.
SYNCHRONIZE is a Windows macro.
2019-01-31 19:59:13 +01:00
8c2a978b03 UI: rename Free Bake to Delete Bake.
"Free" is more of a programming term related to memory allocation, not a term
we need to use in the interface. Ref T61054.
2019-01-31 19:49:47 +01:00
27d799698d Fix T61065: missing shader update when adding texture slot. 2019-01-31 19:33:38 +01:00
92fa42f2ce Fix T60973: crash baking objects disabled for rendering. 2019-01-31 18:12:26 +01:00
78daa53e89 Fix T61072: missing viewport update when setting render border in image editor. 2019-01-31 18:01:47 +01:00
a37e889aeb Fix T61013: changing top/status bar editor type can be changed with shortcut. 2019-01-31 18:01:47 +01:00
5c5de14ad7 Cleanup: avoid some unnecessary inverse matrix math. 2019-01-31 18:01:47 +01:00
6075b0a454 Fix wrong sculpt constant detail description. 2019-01-31 18:01:47 +01:00
208a0808b3 Fix T60836: Stretch to flickers when vertex group is used
Missing relation to object transform. Needed to convert vertex
position from local target object space to a local space of the
bone.
2019-01-31 17:57:01 +01:00
9d10fc13e7 Fix T61046: Object with cloth jumps around
Was happening due to missing relation from geometry to
transform component. Did not happen in old dependency
graph because that one could never evaluate geometry
prior to transform.
2019-01-31 17:38:01 +01:00
e7dfe15702 Fix T61061: Scopes in image editor are not updating
Scopes were moved to properties area, so need to adjust
the optimization part of tagging.

Ideally, tagging will always happen (and happen for free)
and then drawing code will update scopes when they are
actually displayed. But this is outside of the scope of
this fix since requires some design changes.
2019-01-31 17:15:24 +01:00
d2f3378249 Fix T59339: Particle render without baking issues
The issue was caused by dependency graph resetting particles
when evaluating copy-on-write version of object. Solved by
only doing reset from dependency graph on user edits.

Other issue was caused by modifier itself trying to compare
topology and reset particles when number of vertices or faces
changed. This isn't reliable, since topology might change even
with same number of elements. But also, since copy-on-written
object initially always have those fields zero-ed the reset
was happening on every F12.

The latter issue is solved by moving reset from modifier stack
to places where we exit edit/paint modes which might be changing
topology.

There is still weird issue of particles generated at some
weird location after tapping tab twice, but this is not a new
issue in 2.8 branch and is to be looked separately.
2019-01-31 16:53:19 +01:00
0d2b977c3b Particles: Fixes for synchronization to original
Was missing synchronization of current frame to the original one,
which is one of the issues why point cache does not properly reset
on edits.

Also clear recalc flag on original particle system.

Ideally we need to get rid of recalc on a particle system, since
that is not really covered by tagging system of dependency graph.
2019-01-31 14:57:58 +01:00
72863eb036 Remove direct shape key drivers evaluaiton in object update
This is now hanbdled by the nodes in dependency graph.
2019-01-31 14:31:41 +01:00
c1da8e3b28 Depsgraph: Comb code to a better state all over
Some summary of changes:

- Don't use DEG prefix for types and enumerator values:
  the code is already inside DEG namespace.

- Put code where it locally belongs to: avoid having one
  single header file with all sort of definitions in it.

- Take advantage of modern C++11 enabled by default.
2019-01-31 14:31:41 +01:00
7ccef23c4d Add C++ guards to some blenlib headers 2019-01-31 14:22:46 +01:00
9a7ea778b3 Fix T61030: Drivers for shape keys not evaluated in correct order
Was happening when value of one shape key was driving property of
another shape key of same datablock.

Solved by making shape key blocks properties more granular.
2019-01-31 13:00:11 +01:00
13de53ecc5 Depsgraph: Specify whether RNA path to be resolved as entry or exit
Makes it more explicit whether RNA property is used as a source
dependency for something else, or whether some other dependency
is being hooked up to evaluate that property.
2019-01-31 13:00:11 +01:00
39de1dc342 Cleanup: Spelling in comment 2019-01-31 13:00:11 +01:00
3ea54688b1 Depsgraph: Use more correct update source for an internal tags
Dependency graph will poke some IDs for recalc after finishing building.
Those shouldn't be considered as a user edit.
2019-01-31 13:00:11 +01:00
83ec5fbf8d Depsgraph: Use more clear name for enumerator
Matches enumerator items and type name.
2019-01-31 13:00:11 +01:00
77eaa4790d Fix T61032: Switching to sculpt tab causes undo to set object mode
Workspace switching changed modes w/o the 3D view,
causing sculpt undo's poll function to fail.

Applied the same logic for texture paint too.
2019-01-31 22:58:52 +11:00
b5e93b02c9 Fix T60996: Dyntopo flood fill fails due to missing ob->imat
Reviewers: brecht

Differential Revision: https://developer.blender.org/D4285
2019-01-31 12:42:51 +01:00
f4c0dacde7 Fix: allow curve of driver to be evaluated individually
This is necessary when adding a new keyframe to a fcurve
that also has a driver.

Reviewers: brecht, campbellbarton

Differential Revision: https://developer.blender.org/D4278
2019-01-31 12:19:33 +01:00
83f8f44791 Fix T59495, T59992, T59904, T59178, T60598: broken keyframed value editing.
This removes a bunch of animation/driver evaluations and recalc flags that
should be redundant in the new depsgraph, and were incorrectly affecting
the evaluated scene in a permanent way.

Still two cases that could be removed if the depsgraph is improved, in
BKE_object_handle_data_update and BKE_cachefile_update_frame.

For physics subframe interpolation there are also still calls to
BKE_object_where_is_calc that should ideally be removed as well, though
they are not known to cause keyframing bugs.

Differential Revision: https://developer.blender.org/D4274
2019-01-31 12:04:57 +01:00
7400aa7e59 Depsgraph: remove features incompatible with new system.
Some features are incompatible with multithreading and reliable evaluation
of dependencies. We are now removing them as part of a bigger cleanup to
fix bugs in keyframing and invalid animation evaluations.

* Dupliframes have been removed. This was a hack added before there were
  more powerful features like the array modifier.
* Slow parent has been removed, never worked in 2.8. It was always
  unreliable for use in production due to depending on whatever frame was
  previously evaluated, which was not always the previous frame.
* Particle instanced objects used to have their transform evaluated at
  the particle time. Now it always gets the current time transform.
* Boids can no longer do predictive avoidance of force field objects,
  but still for other particles.

Differential Revision: https://developer.blender.org/D4274
2019-01-31 12:03:05 +01:00
3e072da45b Fix T60432: Blender crashes when dragging objects from other scene from outliner. 2019-01-31 11:03:28 +01:00
8f4b7d706b Sculpt: disable undo flag for sculpt mask lasso
While this is harmless, it did cause T55399 in the past.

Sculpt adds it's own undo steps, so don't request the operator type
to do it too.

This is consistent with other sculpt operators.
2019-01-31 18:51:14 +11:00
77254df480 Fix T59293: Can't assign shortcut to undo history 2019-01-31 17:27:46 +11:00
e8cea26bd7 Cleanup: use doxy comments, clarify some text 2019-01-31 16:35:33 +11:00
6df68efcbb Fix edit-mesh undo using the current selection
Any meshes selected would be added to the mode when reading undo.
2019-01-31 16:06:28 +11:00
293f4d88da Cleanup: style, unused variable 2019-01-31 15:54:37 +11:00
9407456e3f Cleanup: remove EM_IGNORE_LAYER
Call ED_object_editmode_enter_ex instead.
2019-01-31 15:36:24 +11:00
c454db2746 Fix T61047: Undo editmesh separate crashes
Favour G_MAIN in functions that might free it.
2019-01-31 15:07:47 +11:00
5afc247ea1 Fix image paint undo memory leak 2019-01-31 12:35:40 +11:00
8c89790674 Fix T60660: Texture paint undo removes image 2019-01-31 12:07:13 +11:00
51bba03b31 Undo System: add Main argument to encode/decode
Needed since we don't always have the context,
and avoids adding G_MAIN into undo callbacks.
2019-01-31 12:07:13 +11:00
d16e4d077d Fix T61028: Crash when entering wireframe view 2019-01-31 01:35:09 +01:00
da1da3053d Cleanup: add trailing commas
Improve clang-format output.
2019-01-31 08:30:45 +11:00
b21bd431e3 Fix T60378: All armatures reset positions on linked collection when ctrl+z used on anything.
Issue actually exists since ages, probably 2.7x update system forced all
armature proxies to be fully refreshed after an undo?

In any case, proxy_from should only be reset for 'local' proxies (i.e.
directly linked datablocks), not for linked proxies...
2019-01-30 20:34:26 +01:00
f4b1f1f0be Merge branch 'blender2.7' 2019-01-30 18:36:54 +01:00
ab682b1558 Cleanup: use better names for depsgraph driver relations.
Both the driven properties and driver targets were called targets, now make
a distinction.
2019-01-30 18:36:34 +01:00
6164983f9d GP: Remove DEG_get_original_id() from draw manager
Only keep this function when drawing to avoid COW overhead that reduce performance.

After some changes I did some time ago, the use of original ID was not required and this only added depsgraph overhead and problems.

This change solves the problems with updates in render mode.

Related to T57484 and the changes requested by Sergey.
2019-01-30 16:29:38 +01:00
1ceaca7f64 Fix T61017: node_shader_utils did not handle diffuse_color correctly 2019-01-30 14:37:09 +01:00
e08156d799 Fix default material using zero alpha 2019-01-30 23:54:07 +11:00
93dc2d373f Fix (unreported) memleak when copying object and its material with GP settings.
Like... seriously?
2019-01-30 12:00:58 +01:00
534573f6b9 Fix T60957: ASSERT when reloading double-linked file.
Kind of funny to see that this has been missing presumably since the
first version of library linking in Blender, and only gets noticed now.
Then again, that was not really a critical issue, iirc write code
ensures all libraries directly used get properly written, even if flags
are incorrect.
2019-01-30 11:46:49 +01:00
e074204d2f Cleanup: use proper bitflag operators. 2019-01-30 11:38:13 +01:00
25f0284090 Cleanup: Unused function argument 2019-01-30 11:02:36 +01:00
7744203b7f Cycles: improved rounding of sample chunks for resumable renders
When using `--cycles-resumable-num-chunks N` to render a subset of the
samples, having N close to the total number of samples causes rounding
issues.

For example, a file configured for 250 samples and 150 chunks should
have 1.6666 sample per chunk. The old code rounded this to 2 samples per
chunk, which would result in too many samples being rendered. When
rendering a single chunk this doesn't matter much, but when larger chunk
ranges are rendered with `--cycles-resumable-start-chunk` and
`--cycles-resumable-end-chunk` the rounding errors start to add up.

By multiplying with the number of chunks to render first, and only round
to integers after that, this issue is solved. In the above example,
rendering 3 chunks will correctly render 5 samples rather than 6.

When the requested number of chunks is larger than the number of samples
there will be duplicate samples (that is, sample N appearing both in
chunk M and M+1). In this case a warning is printed to stderr.

This is needed for T50977 Progressive render: use non-uniform sample
chunks.

Reviewed by: sergey

Differential Revision: https://developer.blender.org/D4282
2019-01-30 10:51:06 +01:00
fbfe360cb1 Fix T60974: Dyntopo crash on undo after object deleted
Add the ability for undo steps to request memfile undo step added after
them, useful for mode switching, where we need the data to exist for
undo to enter the mode.
2019-01-30 20:44:15 +11:00
a1ae04d15a Versioning: add renaming utility function
Avoids accidents creating duplicate names.

Also ensure screens are sorted on rename.
2019-01-30 09:41:28 +11:00
7894d6c6f1 Cleanup: line length 2019-01-30 09:06:44 +11:00
7d91ef0488 Partial fix for T60982: Editable anim settings in linked action.
This is only partially working, because some bAnimListElem items do not
have any ID pointer set (for wome mysterious reason...), notably the
'group' ones.

Will re-assign to @aligorith for that, this code is rather complicated
and hard to follow (with all those macros ;) ).
2019-01-29 21:49:46 +01:00
93b63537e2 Cleanup: typo in comment. 2019-01-29 21:49:46 +01:00
1a61c209a0 Workbench: Make Material transparency part of the rgba color picker
It is only used for solid mode for now but could be used by eevee in the
future.
2019-01-29 20:34:37 +01:00
43150b02a0 Workbench: Opti: Only request OIT buffers if needed 2019-01-29 20:34:11 +01:00
2cc69a5e20 Workbench: Support transparency from object color alpha
Support the alpha channel use of the object color in solid mode.

The Transparency effect is still using the Xray algorithm and not
true Alpha blending.
2019-01-29 20:34:11 +01:00
Pablo Vazquez
ea3f5af962 UI: Add Dynamic Topology toggle entry to Sculpt menu
Helps to find the shortcut (Ctrl+D) which wasn't exposed anywhere else than in search.
2019-01-29 18:58:34 +01:00
Joel Godin
9552d4b321 Fix: Add units to text offset_x and offset_y properties
Differential Revision: https://developer.blender.org/D4281
2019-01-29 18:31:39 +01:00
2ff6b2925a Fix T60067: some modifiers don't use shape keys correctly 2019-01-29 17:57:21 +01:00
001414fb2f Cycles: delay CUDA and OpenCL initialization to avoid driver crashes.
We've had many reported crashes on Windows where we suspect there is a
corrupted OpenCL driver. The purpose here is to keep Blender generally
usable in such cases.

Now it always shows None / CUDA / OpenCL in the preferences, and only when
selecting one will it reveal if there are any GPUs available. This should
avoid crashes when opening the preferences or on startup.

Differential Revision: https://developer.blender.org/D4265
2019-01-29 17:00:02 +01:00
33dcf9fa71 Add missing Shader FX remapping to library query 2019-01-29 15:41:24 +01:00
8134f3f0a6 Workbench: Add "Shadow" factor to Xray
This just maintain more parity accross the 2 visuals. Note that this is not
"real shadowing" just the facing factor shadowing.
2019-01-29 15:07:53 +01:00
bc99f4903c Workbench: Add transparency support for materials
This adds the posibility of having certain materials transparent in solid
mode. The option is (for now) per material only and thus only shows in
material color mode.

This uses the same rendering technique as Xray mode.

Note that objects are not considered transparent for selection with this.
2019-01-29 15:07:53 +01:00
d88492d4ad Object Mode: Fix reading past buffer end when drawing camera 2019-01-29 15:05:51 +01:00
314ea1b1c7 Workbench: Depth Of Field: Improve noise and Large radius
- Add noise to remove undersampling artifact
- Create 2 mipmaps to the scene color buffer in order to have bigger blurs
- Replace blur2 with a 3x3 median filter that doesn't dilate the highlights
- Use temporal accumulation to remove noise

For some reason all of this exacerbate some bleeding issues happening on
far foreground elements from near foreground elements. The actual problem
was already happening before but was not really noticeable. It needs some
more work to be fixed.
2019-01-29 15:05:51 +01:00
475a07cd0c Fix duplicate brushes from recent startup files
Default versioning caused duplicates when the startup was re-saved.

See c305759762
2019-01-29 23:53:37 +11:00
3b6e4cf7ce Fix T60226: Inset not working well on very small faces
The inset operator uses 0.01 as default for the inset.
When the face is very small than this default is very confusing (see T60226).

The simplest fix seems to be to just use 0 as default.
This is similar to the extrude operator which uses 0 as default as well.

Reviewers: brecht, campbellbarton

Differential Revision: https://developer.blender.org/D4273
2019-01-29 13:39:55 +01:00
79f76c8544 Bevel - better corner shapes for inner arc miters.
The subdivision method for getting corner shapes has a fullness
parameter which had been set by eye before. This change uses fullness
as found by offline search process to best match the superellipsoid
octant in the cube corner case (except cube corner case is still handled
by other code). This somewhat improves the look of cube corners with
inner arc miters, however.
2019-01-29 07:21:59 -05:00
e37b9b5d0d Revert "3D Text: avoid checking null character's text on path"
This reverts commit 8a379e3460.

Caused T58284
2019-01-29 22:54:35 +11:00
964a3f1097 Revert "3D Text: avoid checking null character's text on path"
This reverts commit 8a379e3460.

Caused T58284
2019-01-29 22:50:55 +11:00
8683a4ba40 Fix T59924: Blender 2.8 particle system error
Was missing relation from particle keyed targets to the
particle system, which caused some race conditions.
2019-01-29 10:34:37 +01:00
851d58b34f DRW: support clipping for all lamp types 2019-01-29 20:27:28 +11:00
68ae1f4958 Fix CLOG_STR_AT_SEVERITY macro
Part of D4277 by @sobakasu
2019-01-29 17:28:44 +11:00
c305759762 Fix duplicate brushes being added to startup
All builtin templates have this brush.
2019-01-29 16:27:00 +11:00
78719abc01 Fix T60809: Crash undoing object rename in edit-mode
Currently names are used for edit-mode undo-steps,
any changes to Main ID names cause lookup failure (crashing).

This commit ensures any undo steps that use ID lookups have the same
mem-file undo state loaded that was used to encode the steps.

Renaming also has an undo push added (last commit).
2019-01-29 15:29:22 +11:00
59a0a143dd Library: tag memfile undo for writing after rename
Needed for T60809 fix.
2019-01-29 14:28:55 +11:00
957b4547ae Cleanup: Remove unused MTex.texflag 2019-01-29 09:11:05 +11:00
097b1cd08a Cleanup: remove immediate mode TODO
We've managed without these functions and can add them if needed,
this TODO isn't helping.
2019-01-29 08:42:46 +11:00
68cab3aff6 Cleanup: replace attrib w/ attr
Also rename GPUVertexAttribs to GPUVertAttrLayers,
avoids confusion with GPUVertAttr which isn't closely related.
2019-01-29 08:32:25 +11:00
a9c2971658 Merge branch 'blender2.7'
Conflicts:
	source/creator/CMakeLists.txt
2019-01-28 22:27:45 +01:00
e63869ca80 Fix T60896: Missing update for Auto Texture Space. 2019-01-28 22:25:26 +01:00
491a98ca44 Outliner: Enable new faster 'Delete Hierarchy' code by default.
Some more tests showed no issue, so now feeling reasonably confident.

Old, 'safer' one remains available through setting debug value to 666,
for a few more weeks.
2019-01-28 21:57:56 +01:00
5537117366 Fix several missing cases of copy func for modifiers.
Any time a modifier data has non-ID pointer, it should have own copy
function (and also take care of proper init/reset in its init callback).
2019-01-28 21:49:23 +01:00
147e22ef70 Fix T60840: Serious memleak in solidify modifier.
Another one painful to pin down, due to misleading info in report, and
more than anything else, waaayyyyy too complex example file!
2019-01-28 21:49:23 +01:00
cad1016c20 Fix T60944: Add Tablet eraser support to annotations usin pen 2019-01-28 17:46:11 +01:00
55e171be33 Fix T60566: Warnings in rigid body and certain conrfiguration
Was visible when constraint object is not directly visible via
view layers, need to indirectly pull it into the graph.
2019-01-28 16:39:55 +01:00
a8c0a57fc3 Fix T60599: Multires crash after doing dyntopo sculpt 2019-01-28 16:14:30 +01:00
56cc219070 Fix T59963: Can't manipulate hair keys with G, R, S or mirror transforms
Need to pass proper evaluated mesh to calculate hair matrix.
2019-01-28 15:45:34 +01:00
9bc43223c1 DRW: support clipping for object & lamp centers 2019-01-29 00:27:43 +11:00
20acf3ded2 makesrna: write files w/ spaces instead of tabs
We're preparing to move to spaces, having literal tabs in strings
complicates conversion a little, move makesrna to spaces now.
2019-01-28 23:08:59 +11:00
f992c92872 Fix blenderplayer build after OpenMP changes. 2019-01-28 13:05:40 +01:00
704b336899 Make scene statistics to respect locked interface
Interface is being locked when some destructive operations
are called from non-main thread.

This was causing crash with particles in T60065.
2019-01-28 12:49:45 +01:00
cb69a039e7 Merge branch 'blender2.7' 2019-01-28 22:27:00 +11:00
2e3433c1f7 Fix T60127: Particles texture mapping coordinates objects
Part of the issue was a missing relation. Other part wes
aboud object's inverse matrix never being updated.
2019-01-28 12:19:25 +01:00
66d03f61b8 Cleanup: unused struct declarations 2019-01-28 22:15:46 +11:00
f8ce24f796 Cleanup: sort forward declarations of enum & struct
Done using:
  source/tools/utils_maintenance/c_sort_blocks.py
2019-01-28 22:12:49 +11:00
409a21b32e Merge branch 'blender2.7' 2019-01-28 12:05:51 +01:00
66e6cd5315 Cleanup: unused struct declarations 2019-01-28 22:06:53 +11:00
d918217d35 OSL: remove fresnel template that was not public domain.
Convention is to only have public domain code templates. Also fixes wrong
license header in Cycles.
2019-01-28 12:04:54 +01:00
801901a652 Fix T57069: macOS window contents scaling bug.
The cause of this is unclear, but delaying querying the native pixel size
appears to help in the one case I could reproduce.
2019-01-28 12:01:29 +01:00
c0f88ed8a8 Cleanup: sort forward declarations of enum & struct
Done using:
  source/tools/utils_maintenance/c_sort_blocks.py
2019-01-28 21:17:58 +11:00
Scott Spadea
d473d5be5f Fix: use correct units for some bone properties
Differential Revision: https://developer.blender.org/D4267
2019-01-28 11:01:46 +01:00
e6ba760ce8 Fix: allow removal of addons that are symlinked
Reviewers: campbellbarton

Differential Revision: https://developer.blender.org/D4256
2019-01-28 10:52:54 +01:00
Scott Spadea
534891997a Fix: use pixel as unit for some properties
Differential Revision: https://developer.blender.org/D4266
2019-01-28 10:50:32 +01:00
690478027b Merge branch 'blender2.7' 2019-01-27 20:17:11 +01:00
d377cd5db1 Fix Cycles standalone build as part of Blender. 2019-01-27 20:05:25 +01:00
d97df138d1 Fix T60908: crash in workbench render after DoF changes. 2019-01-27 13:55:18 +01:00
Łukasz Kwoska
f17afe69a3 Fix: Use correct units in Shrinkwrap modifier
Differential Revision: https://developer.blender.org/D4261
2019-01-27 12:23:34 +01:00
25772c9e1d Fix T59921: RuntimeError:bpy.ops.object.gpencil_modifier_apply()
Thanks to Brecht for his help
2019-01-26 16:19:22 +01:00
94d88df3a8 Merge branch 'blender2.7' 2019-01-26 15:54:13 +01:00
b7a9e980a1 macOS: add support for OpenMP, making smoke/fluid/cloth simulations faster.
This bring macOS on par with Windows and Linux. It uses the OpenMP library
added to our precompiled libraries.

Custom flags are set because FindOpenMP from CMake below 3.12 does not support
AppleClang, and more recent versions do not work with our custom directory
location either.

Differential Revision: https://developer.blender.org/D4257
2019-01-26 15:48:56 +01:00
Robert Guetzkow
115e1d441b Cycles: add missing units for properties.
Differential Revision: https://developer.blender.org/D4258
2019-01-26 15:38:50 +01:00
0b28a9a446 Fix build error after recent cleanup. 2019-01-26 15:38:49 +01:00
8d4c4775a0 Cleanup: fix compiler warnings. 2019-01-26 14:49:11 +01:00
Valentin
2a41ea7cc5 Fix: Use correct units for cloth properties
Differential Revision: https://developer.blender.org/D4260
2019-01-26 13:37:29 +01:00
9e3ac14341 Fix incorrect sizeof use in rna array formatting 2019-01-26 23:18:12 +11:00
04a5dbbd09 Correct build error removing includes 2019-01-26 23:08:11 +11:00
f20dbc293f Cleanup: blank lines over doxy headers 2019-01-26 21:43:24 +11:00
1e4aab36c2 Cleanup: remove redundant BKE/BLI/BIF headers 2019-01-26 21:20:25 +11:00
19b5f5493c Cleanup: draw manager headers 2019-01-26 20:08:52 +11:00
b8467273b8 Cleanup: redundant defines
Comment or remove unused defines.
2019-01-26 19:15:30 +11:00
b70877bba7 Cleanup: remove blender-internal update flag 2019-01-26 18:46:40 +11:00
edd34c924b Cleanup: wrapper for built-in shader access 2019-01-26 16:39:05 +11:00
77b66a9666 DRW: support clipping for empty object 2019-01-26 15:49:14 +11:00
9b40da94a3 Keymap: move grease pencil Alt-C to 2.7x map
This has been removed from the default map, so don't use elsewhere.
2019-01-26 12:56:56 +11:00
1b6da95ccb Cleanup: avoid static vars to store legacy shaders 2019-01-26 10:33:14 +11:00
1393335227 GPU: refactor defines into GPUShaderStages
Code comment notes there are "just a few",
now there are enough it's useful to include in GPUShaderStages.
2019-01-26 10:33:14 +11:00
0e95abf74b Cleanup: order GPUShaderStages (vert, geom, frag)
Use names for declarations to support adding defines, coming next.
2019-01-26 10:33:14 +11:00
c1814d593d Workbench: Depth Of Field: Add toggle option in shading popover
Pretty straight forward. Just an option to turn the DoF per viewport.
Default is off as in 2.79.
2019-01-25 21:56:10 +01:00
3223644d14 Workbench: Depth Of Field: Cleanups 2019-01-25 21:56:10 +01:00
ca739ac1d5 GP: Apply scale to particles
The particles were using the scale of the original object and the thickness of the stroke was not correct. Now, the scale is applied by particle.
2019-01-25 20:40:56 +01:00
16c3425fe6 GP: Set cyclic to OFF when use cutter
When cut a stroke, the cyclic must be set to off because keep it gets very weird results.
2019-01-25 20:01:29 +01:00
8bd55cf3d5 Ammend to rBea5326df86cb.
As suggested by @sergey, better use RECALC flag dedicated to pointcache.
2019-01-25 19:54:25 +01:00
Dalai Felinto
699b49e8e9 Fix T58142: Crash when use Cycles to render stereoscopy
This is a quick workaround to prevent the crashes with multi-view.
The ultimate solution can be plenty, and would turn around refactoring
Cycles to handle multi-view internally, so that depsgraph could be freed
before render with no problems.

Reviewers: brecht, sergey

For the complete discussion check: https://developer.blender.org/D4239
2019-01-25 16:04:26 -02:00
Dalai Felinto
fa1d5586a1 Fix Freestyle (ASAN detected) crash
This was very simple to reproduce, just turn on Freestyle and press render.

Now to the truth of things. Most (if not all) of
~BlenderStrokeRenderer() can be removed. I believe this was done back
when freestyle was using G.main, and since we gave freestyle its own
main we can just leave the cleanup for later.

I will leave this for freestyle maintainers to think over though.

Note: There is a chance this was the issue reported on T57890. I will
wait for the reporter to confirm this as fixed though.
2019-01-25 14:58:35 -02:00
da6bda6483 Fix T60783: (Certain) shapekeys stopped working in 2.8.
This commit adds another optional check (when `--debug-io` is set) on
write .blend process, to check and ensure all shape keys have their
'from' pointer properly set to their respective user ID.
This is intended to be used as debuging tool mostly (to try to detect
when/why some of those pointers can become NULL).

For now, it also systematically perform same checks/fixes when loading a
.blend file, to fix all broken ones laying around. Later we might move
that usage to a do_version instead, but for now think it's safer to
always perfom it (and it's rather cheap process anyway).
2019-01-25 17:46:09 +01:00
a42441d145 ShapeKey: add utils to say whether given ID type supports shapekeys.
Those kind of checks are handy to have for generic processing...
2019-01-25 17:46:09 +01:00
2a7b74c237 Cleanup: BLO: move validate code into own header.
Does not make sense to keep that with BLO_writefile.h, this can also be
used by read code, and some other parts of Blender (like ed_undo.c
currently)...
2019-01-25 17:46:09 +01:00
693721cc7e Fix T55462: Ungroup in Node editor crash Blender
If ID doesn't want to do user counting it shouldn't be in main.
2019-01-25 16:49:40 +01:00
Dalai Felinto
d96f1fcd39 Fix T60775: Stereo drawing in image editor broken (shows only right eye) 2019-01-25 13:00:20 -02:00
Pablo Vazquez
5e6487e1f2 UI: Particles
Dupli Collection -> Instance Collection
2019-01-25 15:30:33 +01:00
Pablo Vazquez
9c78302a35 UI: Particles. Open render type panels by default
Render-type panels are only shown when the relevant type is active anyway.
Saves a click especially when using object or collection as render, since
you _have_ to set an object or collection to use it.
2019-01-25 15:30:33 +01:00
Pablo Vazquez
31abd2d877 UI: Particle. Remove unnecessary label for grid distribution
None of the other distribution modes have labels, and it's pretty clear
anyway since the fields below have the Grid word in them.
2019-01-25 15:30:33 +01:00
Pablo Vazquez
abd33f9823 UI: Particles
Remove duplicate "Use Modifier Stack"
2019-01-25 15:30:33 +01:00
2f7279a413 Fix T60204: Crash when opening a File
Missing code from 3d083f37. Need to ensure that ID properties
are properly allocated and restored on read.
2019-01-25 15:20:30 +01:00
71e3002824 Workbench: Depth Of Field: Optimisation
- Compute samples positions on CPU.
- Use 3x3 Box blur instead of 2x2.
- Implement bokeh parameters.

With this commit, dof performance is almost negligeable.
The quality is a bit lower than before but can be improve. Also now big
Circle of confusion are supported (up to 200px).
Cost is ~1.25ms on AMD Vega with a 2560p viewport than full HD and
pretty shallow depth of field.

Coc downsampling and dilation is not used anymore for now (commented).
2019-01-25 15:04:18 +01:00
3f6e14e667 Workbench: Depth Of Field: Initial Commit
The algorithm used is borrowed from :
http://tuxedolabs.blogspot.com/2018/05/bokeh-depth-of-field-in-single-pass.html

This makes it possible to have a decent blur for foreground over defocused
background in one pass only.

The algorithm is using a gather approach that is much faster
than the scatter approach used in Eevee. This makes it possible to have
custom bokeh shapes (not implemented yet) which would be impossible with
a separable gaussian technique.

The blur is done in 2 steps. The first one define the shape of the bokeh
and the second that fill the undersampling.

A downsample max-CoC tile texture speed up the gathering process.
2019-01-25 15:02:49 +01:00
aae2bf7735 T60745: GPU texture alloc failed when opening Preference Windows
Was generating INVALID_FRAMEBUFFER here instead of failled texture alloc.

Add safety asserts in gpu_texture.c and clamp minimum size to 1 inside
GPU_offscreen_create.
2019-01-25 15:02:30 +01:00
3fb72a5432 GP: Use Fill color when drawing strokes for no stroke materials
Artists requested to show the stroke while drawing a new stroke using a material with fill color only, because it's very difficult to see the stroke.

Now the stroke shows always but using the fill color, not the stroke color because maybe is not set.
2019-01-25 14:34:56 +01:00
e198c5a175 Fix crash happening with hair step
The issue was caused by the hair step checking whether
particle system needs to have path cache. This was done
in a way which was traversing an entire scene and was
checking every object for particle instance modifier.

Ideally, path cache should be an own operation in the
dependency graph. Or at least, this flag should be set
by dependency graph builder, similar to curve's path.

Since the code was broken already (it was only checking
first particle instance modifier), it is easier to
remove the buggy code, solve the crash and move on for
now.

If this causes an issue, simply set particle system to
be rendered as path.

Fixes crash with playback of Spring scenes.
2019-01-25 14:02:31 +01:00
da13a3bdee Fix texture paint accessing freed memory
Part of T60660
2019-01-25 23:53:53 +11:00
a761233261 Correct last commit, wire xray is supported 2019-01-25 23:36:31 +11:00
30762a0b39 DRW: disable clipping background drawing w/ xray mode
This interfered with drawing the mesh.
2019-01-25 23:30:27 +11:00
8e8fb1520c Depsgraph: use specific tag to update shading 2019-01-25 23:11:58 +11:00
ea5326df86 Fix T59958: Blender 2.80 - Removing second Particle System cache causes crash.
Usual DEG tag missing.

Also do not tag/send notifiers when we do not change anything!
2019-01-25 12:32:19 +01:00
bfa8fcc542 Fix T60839: Deleting bevel object for curve will not update
Was missing conversion of ID_RECALC_GEOEMTRY to curve's operation.
2019-01-25 11:22:22 +01:00
d87e7af1ec T60748 Second try to fix start extreme in Noise modifier
The first point was moving inverted because first vector was inverted. Now, the vector is changed for the first point to get the same direction.
2019-01-25 10:44:46 +01:00
05ebdc2b71 Fix texture paint showing pink texture on load 2019-01-25 17:25:49 +11:00
6cc5c28d15 Fix UI extension removal
App-templates & keymap names had their extensions removed twice.

Confusing for filenames containing dots.
2019-01-25 13:49:59 +11:00
3d8cbb534f Fix T60777: Grid fill fails when run via Repeat Last 2019-01-25 11:40:22 +11:00
e63c360bcd WM: don't set repeat flag w/ interactive repeat
This allows operators to distinguish between redo and executing
repeat last operator, needed for T60777 fix.
2019-01-25 11:29:41 +11:00
b5a2dc16fc Revert "WM: Repeat Last no longer reuses skip-save properties"
This reverts commit 1d908bffdd.

Enough uses of repeat last expect skip-save properties to be set,
transform being the most obvious example T60777#605681.

I wanted to avoid operators having account for two kinds of 'skip-save'
but this may be unavoidable.
2019-01-25 11:11:07 +11:00
d4433b1bb3 Missed last commit 2019-01-25 11:04:00 +11:00
5632e1b525 Cleanup: replace VSE /w Sequencer
This abbreviation isn't used anywhere else in Blender's UI.
2019-01-25 09:44:32 +11:00
e1efaa6f74 make.bat: remove stray quote in msvc2017 detection.
Shouldn't cause issues, but better safe than sorry.
2019-01-24 15:21:31 -07:00
8acbf8f113 Merge branch 'blender2.7' 2019-01-25 08:54:20 +11:00
4b8b7c821d Cleanup: sort cmake file lists 2019-01-25 08:49:51 +11:00
2218bf02dd Cleanup: sort cmake file lists 2019-01-25 08:30:33 +11:00
e72fa714a8 Cleanup: remove duplicated shaders that only added clipping checks
Originally I wanted to avoid adding draw manager specific ifdef's all
over generic shaders however this isn't needed in so many places.

Also there are shaders that are only used by the draw manager so
duplicating them only to have the original unused doesn't make sense.
2019-01-25 08:01:07 +11:00
6d8394d38b DRW: support clipping for camera objects 2019-01-25 07:13:02 +11:00
a4fe338dd8 Cleanup: add missing braces to draw manager 2019-01-25 07:12:13 +11:00
b1f3a86d99 Cleanup: use macro to set flags 2019-01-25 06:34:02 +11:00
6d58339973 Fix smoke clipping being ignored by Cycles and not being editable after baking.
The value worked in 2.7, but not with copy-on-write in 2.8.
2019-01-24 19:47:01 +01:00
7b48e04b6e Fix T59650: adding texture paint slot image shows wrong color. 2019-01-24 19:08:25 +01:00
63bacfed4b Merge branch 'blender2.7' 2019-01-24 19:02:10 +01:00
6260b3c15e Fix T60597, T60806: Cycles crash rendering principled BSDF + volume interior.
The integrator maximum number of closures was not set properly for the CPU/mega
kernels to match the actual available memory. Before relatively recent code
refactoring we did not use this value in those kernels so it worked fine.
2019-01-24 18:05:42 +01:00
7a353a7037 Fix T60350: Removed objects that are still in the outliner will crash Blender.
We need to force UI to fully redraw, BKE_id_delete & co won't do that
for us.
2019-01-24 17:45:09 +01:00
b33615a080 Cleanup: remove unused "guide_origin" property 2019-01-24 17:40:30 +01:00
6b5416909e Fix T60816: Specify subtype for some properties of mesh operators
Reviewers: brecht

Differential Revision: https://developer.blender.org/D4248
2019-01-24 17:40:30 +01:00
6100dc6a20 bring back possibility to override camera per view
this can now be found in the sidebar View panel

- uses existing 'lock_camera_and_layers' but renames the property to
'use_local_camera'
- uses RNA_def_property_boolean_negative_sdna to flip the value
- remove the local view code in
rna_SpaceView3D_lock_camera_and_layers_set
- update Python code
- update Addons code will be separate commit

Fixes T60756

Reviewers: billreynish, brecht

Maniphest Tasks: T60756

Differential Revision: https://developer.blender.org/D4247
2019-01-24 17:25:22 +01:00
15bae8ac00 Fix T60095: freestyle not rendering animated camera correctly.
Replace legacy view matrix access with same one used by Eevee.
2019-01-24 16:46:11 +01:00
820d1b249d Fix freestyle renders not including some types of animation.
Freestyle Python scripts need to get the evaluated view layer and scene,
not the original one.
2019-01-24 16:46:11 +01:00
28b1bbeb92 Fix T60625: freestyle colletion include / exclude not working. 2019-01-24 16:46:11 +01:00
391e35d5a0 Fix T60669: freestyle rendering holdout / indirect only collections.
To match Cycles we can hide freestyle lines for these.
2019-01-24 16:46:11 +01:00
c26fe3433e Fix T59175: Compress file isn't working when Load UI is disabled.
Do not see why flags from loaded file should be skipped when we do not
load UI, this is not related to UI...

Think we can keep flags from file in both cases, should this raise some
other issue we'll just have to fine tune masked flags in each case
separately.
2019-01-24 16:15:20 +01:00
95db2e8749 Fix GPU linking Error.
"The geometry shader uses varying _I;gl_PerVertex;gl_ClipDistance, but previous shader does not write to it."
2019-01-24 12:42:20 -02:00
35f0a59df6 Merge branch 'blender2.7' 2019-01-24 16:16:05 +01:00
7446c76187 Fix T59175: Compress file isn't working when Load UI is disabled.
Do not see why flags from loaded file should be skipped when we do not
load UI, this is not related to UI...

Think we can keep flags from file in both cases, should this raise some
other issue we'll just have to fine tune masked flags in each case
separately.
2019-01-24 16:13:37 +01:00
8be7ed1408 Merge branch 'blender2.7' 2019-01-24 15:44:06 +01:00
3a527357a5 Cycles: change default displacement method to bump mapping again.
Even though it makes sense logically to have displacement actually displace
the mesh, this is causing a lot of confusion for existing users that are used
to the previous behavior. Further, since Eevee does not support displacement
yet and the discrepancy between the viewport and final render is problematic.
2019-01-24 15:34:47 +01:00
5fc4214ada Fix T60133: texture paint external editing not working
Operator relys on 3DView and was failing from Topbar and Properties
Editor. Now tries to find the biggest 3DView and uses that.

Reviewers: brecht

Maniphest Tasks: T60133

Differential Revision: https://developer.blender.org/D4215
2019-01-24 15:34:44 +01:00
9eee2aa20c Animation player: tweaks for zooming in and out
Use zoom steps lower than 1. This allows to zoom out a high-res
image. For example, before it was not possible to maker 4K image
to fit on FullHD monitor.

Also, don't force zoom to be above 1. Not sure why that was done,
but this disallows zooming out.

It is still not possible to zoom in higher than the window size
allows. In order to support this the player needs to be refactored
in a way that allows to decouple zoom from window size.

Fixes T59177: Animplayer extreme zooms in when playing rendered animation
2019-01-24 15:13:23 +01:00
d011ae1e03 Fix T59972: UV live unwrap does not pack islands.
Packing was not being called after multi-object editing changes. Includes code
refactoring to make function parameters more clear.
2019-01-24 15:01:55 +01:00
bd64206e1a Fix T59933: timeline keyframe display not updating when selecting objects. 2019-01-24 15:01:54 +01:00
a4a60358b5 Fix T58502: scopes don't work in the image editor
There were two problems:
1. The scopes were only updated when the "Scopes" category is active,
   but this category has been removed in Blender 2.8.
2. The scopes moved from the TOOLS to the UI region.
   However the update-code still searched for the "Scopes" category
   in the TOOLS region.

Both problems are fixed with this commit:
1. Scopes have there own category again.
2. The update code is in the correct draw function now.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D4245
2019-01-24 14:41:44 +01:00
bc32240105 Fix T60810: crash editing mesh with subdivision modifier
typo in rBdc7e49298940

Reviewers: fclem

Maniphest Tasks: T60810

Differential Revision: https://developer.blender.org/D4244
2019-01-24 14:36:01 +01:00
6ff4babfd4 Fix T60795: Crash when joining objects with shape keys.
Stupid mistake really, cannot use NO_MAIN here, temp shapekey is in
Main. Using/fully supporting out-of-main temp IDs is still a bit WIP...
2019-01-24 14:33:12 +01:00
f15a5440a1 Multires reshape: correct grids level allocation
Similar to masking grids, need to also check existing grid level.

This is because edit mode might leave allocated grid with 0 levels.
2019-01-24 14:25:06 +01:00
f172cea484 Fix T59423: Mesh deform modifier bind bug causing spiky deformations.
Same as rBac316a6526c7.
(I should have commited in 2.7 first and then merged in 2.8).
2019-01-24 10:32:28 -02:00
ac316a6526 Fix T59423: Mesh deform modifier bind bug causing spiky deformations.
The intersection was being tested between ray and tri, the correct one is segment and tri.
2019-01-24 10:20:59 -02:00
7faf0c8c2f Fix T59145: don't clamp color value in Hue Saturation Value node in eevee 2019-01-24 13:58:59 +01:00
7b35ef23a0 Fix T60807: Can't select when active pose object is hidden
Object mode locking wasn't accounting for the 3D view context
which doesn't have an active object once its hidden.
2019-01-24 23:25:18 +11:00
4162b83590 Cleanup: use braces for single line if statements 2019-01-24 23:25:18 +11:00
e79cdb5541 Cleanup: Replace BASACT use w/ a variable 2019-01-24 23:25:18 +11:00
f0247b5a5c Cleanup: remove make wrapper
Intended for silent build output,
ninja build system can do this now.
2019-01-24 23:25:18 +11:00
3f1f2b3035 Cleanup: removed unused 3D view header template. 2019-01-24 13:19:23 +01:00
1b12c2d423 Fix T58216: backdrop drawing in sequencer broken. 2019-01-24 12:39:39 +01:00
fa818170e3 Subdiv: Fix wrong orig_index for vertices of a loose edge 2019-01-24 12:13:36 +01:00
c4be1f861b Fix T60408: Loose edge distort vertex on a surface
Treat those vertices as infinitely sharp. This matches the way
how OpenSubdiv's topology is being created.
2019-01-24 12:13:36 +01:00
b3ba97ccce Fix T60805: Grease Pencil Rim Effect Problem
The problem was related to cache data that was removed from memory before the FX  finished. This could affect to any FX.

Now all the information is saved in the FX itself in runtime struct to keep memory safe when cache memory is released.
2019-01-24 11:33:35 +01:00
d2afdf3c20 GP: Use matrix location instead of loc 2019-01-24 11:33:35 +01:00
a3261aad13 Fix T54581: Clip editor doesn't synchronize frame on layout change 2019-01-24 10:36:42 +01:00
be32168eb4 DRW: support clipping for object outlines (unselected) 2019-01-24 19:13:38 +11:00
aa1b77dccb DRW: support clipping for object outlines 2019-01-24 18:28:21 +11:00
0b37399cbe Fix T60790, T60636, T60631: MMB emulation issues after recent changes.
The statusbar keymap display should not affect actual event handling.
2019-01-24 07:41:36 +01:00
cd8a342d7c Cleanup: fix compiler warnings. 2019-01-24 07:41:36 +01:00
11428e0b7f DRW: use clipping for depth buffer
Object selection now supports clipping.
2019-01-24 17:12:06 +11:00
4d29312c66 Cleanup: trailing space guardedalloc & memutil 2019-01-24 16:22:44 +11:00
d8a082f914 Correct doxy file 2019-01-24 16:19:45 +11:00
04d18b117c DRW: API for own versions of builtin GPU shaders
DRW_shader_get_builtin_shader can replace GPU_shader_get_builtin_shader
when we need to support clipping.

Use this for loose point & wire drawing in object mode,
clips edges in lattice edit mode.
2019-01-24 16:14:00 +11:00
1d908bffdd WM: Repeat Last no longer reuses skip-save properties
PROP_SKIP_SAVE is often used as a way to detect the difference between
adjusting options from the redo panel and initial execution.

Repeat last operator was executing with skip-save properties set,
preventing operators from initializing them based on the context.

Fixes 60777.
2019-01-24 12:12:23 +11:00
7f77961f1c Fix theme color use for clipping region
Color needed to be converted to linear in the engine,
not the theme.
2019-01-24 10:36:46 +11:00
41a7dd383c Cleanup: style 2019-01-24 09:27:14 +11:00
32c2e941e6 Fix T60417: Hair not instantly updating when editing curve guide
Reviewers: sergey, brecht

Maniphest Tasks: T60417

Differential Revision: https://developer.blender.org/D4193
2019-01-23 20:47:43 +01:00
Pablo Dobarro
657806691b Fix T58438: wrong display of brush angle rotation preview.
Differential Revision: https://developer.blender.org/D4017
2019-01-23 20:25:45 +01:00
Jean Da Costa
b592e34559 Sculpt: add Topology Rake, to align edges along brush while painting.
This helps to generate cleaner topology and define sharp features for dynamic
topology. Best used on relatively low-poly meshes, it is not needed as much
for high detail areas and has a performance impact.

Differential Revision: https://developer.blender.org/D4189
2019-01-23 20:25:14 +01:00
Anton Stötzer
4e9817a4fb Fix wrong f-curve modifier mute checkbox icon / tooltip.
Differential Revision: https://developer.blender.org/D3930
2019-01-23 18:31:15 +01:00
9770d071ff Fix T54834: VSE can't import OGG Theora video 2019-01-23 17:16:17 +01:00
7a9e4e41a9 Cleanup: More clear function name
Otherwise it was read as it does select sequences rather
than counts them.
2019-01-23 17:16:17 +01:00
8377263e0d Sequencer: Fix python error on Add menu on default workspace
It is possible that context does have selected_sequences but
it will be set to None. In this case getattr() will return
None, breaking the intended logic.
2019-01-23 17:16:17 +01:00
Pablo Vazquez
1f907b30d4 UI: Particles UIList
Swap show_render and show_viewport to match outliner (first viewport then render)

Also make list item into an aligned row so it uses less space and looks closer to the outliner.

Before/After: http://pasteall.org/pic/show.php?id=5c9fff53dc6a0e2465f5b86aa751a942
2019-01-23 17:15:58 +01:00
5e3ce0b662 GP: Remove unneeded armature code
This line looks a mistake and it's not needed.
2019-01-23 16:52:25 +01:00
22bc6142c3 Fix T59152: dynamic topology constant detail should be in world space.
It seems more predictable, and makes more sense for future multi-object modes.
2019-01-23 16:48:02 +01:00
409443500b UI: fix horizontal scrollbar overlapping last row of files
Depending on area size, the scrollbar covered the bottom of the text,
with the extra it will only cover the padding at worst.

Differential Revision: https://developer.blender.org/D4207
2019-01-23 15:33:01 +01:00
Harley Acheson
93d226952b UI: make editor corner splitting / joining more reliable.
* Add threshold for minimum amount of mouse movement for dragging to
  get activated.
* Limit angles at which dragging is considered an action, do nothing if
  mouse does not clearly move up/down/left/right.
* Increase action zone size vertically.

Differential Revision: https://developer.blender.org/D4227
2019-01-23 15:23:06 +01:00
ac5278b682 Fix T60791: Don't show automatic weights option when not supported
There are probably many more cases in which the menu looks a little different.
However, I don't know them all and it's too easy to break something accidentally here.
Maybe a user could try the different combinations of object types and check if there are entries that should not be there.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D4240
2019-01-23 15:21:28 +01:00
db78a8ee2e Fix T59939: Masks not Animating in Render
For now this is not part of copy-on-write, and needs extra animation
evaluation.

Reviewers: sergey, brecht

Maniphest Tasks: T59939

Differential Revision: https://developer.blender.org/D4140
2019-01-23 15:12:53 +01:00
ddc278da24 Cleanup: comments above struct members, shader group assignments
Avoid using pointer to pointer when building shader groups.
2019-01-23 23:59:40 +11:00
48eed058b1 3D View: draw clipping region
Only for workbench solid/wire modes.
2019-01-23 23:37:25 +11:00
44e9fe024b Fix T56877: Enabling mask Motion Blur overrides the Feather Falloff
Compositor makes a copy of mask before sampling the mask on different
time steps. The copy of layers did not copy falloff Settings.
2019-01-23 13:04:32 +01:00
e6ad4ec3fc Fix T58994: Subdivision modifier generates artifacts with crease=1
The issue was caused by the lack of averaging of normals for
vertices which are on the ptex face boundaries.
2019-01-23 12:17:30 +01:00
2392f311e9 Merge branch 'blender2.7' 2019-01-23 12:09:08 +01:00
d753726ce7 Add font selection to VSE text strips
Allows users to select a font for text strips in the video sequence editor.

Related: 3610f1fc43 Sequencer: refactor clipboard copy to no longer increase user count.

Reviewed by: Brecht

Differential Revision: https://developer.blender.org/D3621
2019-01-23 12:07:05 +01:00
40cb41647e Sequencer: refactor clipboard copy to no longer increase user count.
The clipboard is not a real user and should not be counted. Only on paste
should the user count increase.

This is part of D3621, and was implemented by Richard Antalik and me.
2019-01-23 12:06:58 +01:00
ac442da4a1 Refactor: use guard clauses instead of nested conditionals 2019-01-23 10:51:22 +01:00
6555e177e9 3D View: add back clipping draw code (disabled)
Disabled for now because of draw-order issues.

Also move clipping test out of view3d_draw_legacy.c
2019-01-23 20:50:43 +11:00
9ff73e61b1 Fix T60778: Grease pencil Hook modifieronly affects strokes with more than 2 points
Also fixed Lattice and Noise modifier.
2019-01-23 10:37:08 +01:00
baa5fe1bfc Cleanup: Spelling in comment 2019-01-23 10:27:55 +01:00
2e5663c2c6 Fix T60781: DOF Distance (pick) crashes
From own recent changes c8e75c2b00
2019-01-23 16:43:18 +11:00
3eebf9ef06 RNA: expose Gizmo.use_operator_tool_properties 2019-01-23 16:30:19 +11:00
4f2bc2f0e5 Cleanup: use doxy comments for gizmo structs
Also move comments before members (better for clang-format).
2019-01-23 16:24:37 +11:00
6dfe6b4f19 Fix T58199: Spin tool top bar settings don't apply 2019-01-23 16:15:01 +11:00
be24da0a98 Gizmo: add support for gizmos to initialize from the active tool 2019-01-23 16:14:52 +11:00
7ce38978ae WM: add tool property getter function
Matches 'ensure' functions but doesn't add data.
2019-01-23 15:36:10 +11:00
2e4f1b592f Cleanup: use eGPU prefix for GPU enum types 2019-01-23 14:16:03 +11:00
14d947dcad DRW: generalize selecting between regular/clipped shaders
Each engine was doing this on its own.
Move to DRWContextState, use an enum.
2019-01-23 13:34:55 +11:00
c403508e41 DRW: changes to object mode engine needed to support clipping
Split out shader struct, no function changes.
2019-01-23 12:37:12 +11:00
dc3b5024be Cleanup: add BEGIN/END to GPL headers 2019-01-23 11:32:43 +11:00
dc84a03a95 License: add missing GPL headers
Information taken from related files committed at the time.
2019-01-23 11:32:43 +11:00
Dalai Felinto
178299278b EEVEE UI: Render/Viewport Samples - follow Cycles
Cycles shows first the render, and then the viewport settings.
One could argue that EEVEE's main setting is the viewport one.

But that is silly. If we need an extra setting for the lookdev mode so be it.
But EEVEE should be treated as an engine just as Cycles.

Also, removed the " Samples" bit from their labels since they are under
the Sampling panel.
2019-01-22 19:48:24 -02:00
4c24782ccf DRW: only show hidden geometry when selection is used
Matches 2.7x behavior.
2019-01-23 08:46:26 +11:00
69529177be Revert "Fix T60126: Gradient affects hidden vertices when weight painting"
This reverts commit 06a6b5dba4.

The error is that geometry was hidden in the first place,
this should only apply when selecting verts/faces.
2019-01-23 08:45:43 +11:00
3891ad8e03 Fix T58492: smoke flow jitters around flow source when using adaptive domain.
This is more like a band-aid than a real fix actually, real fix would be
to understand why rendering smoke requires auto texspace to be ON
(afaict, this was not the case in 2.7x)...

But I've already spent way too much time on this issue, at least now we
get better situation than before (i.e. smoke with adaptive domain works
well even when orig domain mesh has autospace flag disabled).
2019-01-22 21:52:15 +01:00
7886db9ba9 Mesh eval: Do not condition clearing of auto texspace to dirty bbox.
Not sure why that was that way (can't remember any good reason at least,
so assuming this is a dummy mistake from own rB33cbcd73448f), this
should be done in any case.
2019-01-22 21:52:15 +01:00
Harley Acheson
043a005269 UI: disable scene and view layer delete buttons when not available.
Differential Revision: https://developer.blender.org/D4210
2019-01-22 20:35:32 +01:00
Sebastian Parborg
ccc48bf27e Fix T60602: outliner pose bone selection does not update in viewport.
Differential Revision: https://developer.blender.org/D4223
2019-01-22 20:24:42 +01:00
a34297a6d6 GP: Fix UV error for second point
The UV was not calculated for second point (1), only first and > 1
2019-01-22 20:14:12 +01:00
1ddf93a706 Defaults: don't use Filmic view transform in Video Editing template.
It's too slow for now, could be considered if it's optimized more.
2019-01-22 20:00:13 +01:00
fa5ce915df Fix T60722: decimate modifier not working in some cases. 2019-01-22 19:54:35 +01:00
25889423d3 GP: Recalc UV data for primitive strokes
The data was not caculated when complete a primitive and it was only updated when use Edit mode.
2019-01-22 17:54:41 +01:00
Joep Peters
63729bc11f UI: use same light icon for all light types in properties editor tabs.
Differential Revision: https://developer.blender.org/D4237
2019-01-22 17:05:36 +01:00
Joep Peters
1651879d34 UV Editor: support snapping to center of pixels, in addition to corners.
Differential Revision: https://developer.blender.org/D4150
2019-01-22 17:05:18 +01:00
babba31c49 Fix light probe panels not being visible for Cycles. 2019-01-22 17:00:38 +01:00
6f167ccc79 Fix T60748: Move GP stroke extremes with noise modifier 2019-01-22 16:48:45 +01:00
a8902ab49a Fix T58640: Round corner in edge crease of subdivided surfaces
Fix T60502: Creasing behavior on 2.8 seams wrong

Was a mistake in a boundary vertices sharpness calculation.
2019-01-22 15:35:30 +01:00
06a6b5dba4 Fix T60126: Gradient affects hidden vertices when weight painting
Also includes some minor refactoring: use guard clauses instead of nested conditionals.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D4238
2019-01-22 15:31:10 +01:00
8d4bad39c1 Fix T60742, T55974: crash using mesh/curve surface force fields.
Missing dependency graph relations caused race conditions.
2019-01-22 15:24:06 +01:00
Andrew Williams
102631486b Fix potential invalid memory access in surface force field BVH tree.
Free the BVH tree immediately along with the mesh, otherwise we might access
invalid mesh data.

Differential Revision: https://developer.blender.org/D4201
2019-01-22 15:24:06 +01:00
414ebc68c2 Fix T60686: Renaming an animated bone breaks its animation
After rename is done we need to make sure all copies of
corresponding datablocks are updated in all dependency
graphs: otherwise bone will have a new name, but animation
will still be using an old one.
2019-01-22 14:50:58 +01:00
0ec77aaea5 Cleanup: space after template bracket 2019-01-22 13:51:21 +01:00
fc673a285f Git: add TAGS & tags to .gitignore
Index files used by emacs, vim and others, for autocompletion and
searching; generated by etags, universal-ctags and others.

Differential Revision: https://developer.blender.org/D4208
2019-01-22 12:50:13 +01:00
185c2487a6 Fix T60737: Crash workbench rendering
Addition of clipping from 7467049055
didn't account for non viewport display.
2019-01-22 22:27:23 +11:00
585e4848e1 3D View: Support vert & weight paint mask clipping 2019-01-22 22:22:20 +11:00
9c61107ba5 Cleanup: Silence pedantic compiler warning
Was happening in release builds.
2019-01-22 12:05:48 +01:00
362331f0ff Cleanup: Remove unused variable 2019-01-22 12:02:35 +01:00
b2a15de887 Fix T60575: Multiresolution Crashes when appliing more subdivisions
The issue was caused by intermediate DerivedMesh being created with
scene's Simplify settings taken into account. This is what happens
when one area makes implicit decisions based on whether passed Scene
pointer is not NULL.

Made it so ignoring simplification serttings is an explicit flag,
which makes it easier to follow what's going on.
2019-01-22 11:57:23 +01:00
d6d101feca Fix T59395: Subdivision modifier with quality 1 crashes blender
This is actually a workaround for the crash in OpenSubdiv.
Topology refiner will have a crash when special conditions
are met:

- Refiner is configured to use infinitely sharp patches.
- Refinement happens for the level 1 (which we call Quality 1 on
  Blender side).
- Mesh has non-quad faces.

The workaround is to force refinement to happen to level 2 (or
quality 2 on Blender side) when those conditions are met.

Later on with the next OpenSubdiv update we can remove this
workaround, since there was work done on OpenSubdiv side to
deal better with such configurations.

The modifier will now be somewhat slower, but this will be
compensated with upcoming topology cache enabled by default.

The workaround is done when initializing settings, so the
comparison of topology refiner settings is happening without
any extra workarounds there.
2019-01-22 11:57:20 +01:00
fef20d987c Merge branch 'blender2.7' 2019-01-22 11:57:03 +01:00
78d4e0fbf2 Fix full compilation after recent passes changes
Was caused by c9eef249.
2019-01-22 11:56:03 +01:00
0bbca0e221 3D View: Support edit-mesh clipping (only verts)
We'll need to replace built-in shaders to add support for clipping.
2019-01-22 17:23:24 +11:00
ee3c177dd3 Fix T60112: Smooth crashes w/ multiple views 2019-01-22 16:52:17 +11:00
a93cbb70cd Fix T60643: BMesh operator enum args fail when unset from Python
Error introduced with bmesh operator enum support: 1e6a5eb087
2019-01-22 14:28:17 +11:00
88218946da Cleanup: minor changes to reduce code duplication
D4236 by @sobakasu w/ edits.
2019-01-22 13:51:21 +11:00
b4aec52007 Cleanup: de-duplicate font loading code
Part of D4236 by @sobakasu
2019-01-22 13:11:31 +11:00
7f40d553f9 Cleanp: use single global for draw manager
Add 'G_draw' for all draw manager globals,
avoids adding extern to each file.

Connection between `ts` and `globals_ubo` wasn't obvious,
now called `G_draw.block` & `G_draw.block_ubo`.
2019-01-22 12:09:27 +11:00
c7768bcf4b Cleanup: use const args 2019-01-22 12:09:12 +11:00
46d56872d0 Fix error in last commit 2019-01-22 11:24:59 +11:00
14adca06e4 Cleanup: use DRW_shader_create_from_arrays
Avoids messy conditional defines and inline lib allocation.
2019-01-22 11:09:17 +11:00
7c0f925c59 DRW: Add DRW_shader_create_from_arrays utility
While verbose, this is a more flexible way to construct shaders.

Libs & defines can be optionally included for each shader type
which was previously done with inline string creation.
2019-01-22 10:38:28 +11:00
8beab3e339 Cleanup: remove redundant '_sh' suffix, add '_shgrp' 2019-01-22 08:31:07 +11:00
3d9bee2db1 Cleanup: rename shader containers
These only contain shaders, so name Shaders instead of ShaderData.
2019-01-22 08:26:43 +11:00
a712fbda6a GP: Cleanup previous commit 2019-01-21 18:30:15 +01:00
48149459e4 Fix T60714: Avoid creation of nested objects
In grease pencil is not logic add an object inside other object in edit mode. The object must be created only in Object mode.
2019-01-21 18:29:02 +01:00
0af8ad51c0 GP: Fix memory leaks when use cutter with weights
There were some issues when copy the weights and  other memory leaks.

Also some code cleanup.
2019-01-21 17:39:00 +01:00
2b0fb0d7bf Fix keymap preferences UI layout issues for modifier keys. 2019-01-21 17:26:35 +01:00
a6e6ad0756 Fix T60683, T60662: Cycles render crash in edit mode for certain meshes. 2019-01-21 16:10:00 +01:00
14b5668c60 DRW: Fix corner indices order in clipping plane setup
Fix T60667: Eevee: reflection plane bug in rendered view.
2019-01-21 15:21:17 +01:00
9bc47ed0f6 Fix clipping shaders with some AMD/Intel drivers
Caused:
    error: unsized array index must be constant

Use hard coded number of clipping planes, copying the 4th to 5 & 6
when only 4 are used.
2019-01-21 23:55:53 +11:00
0c829e8240 Fix T60709: Apply Object Transform does nothing by default 2019-01-21 13:43:16 +01:00
ba4de7f1a5 GPUShader: Add GPU_VERTEX/FRAGMENT/GEOMETRY_SHADER defines
This makes it possible to have some code specific to each shader inside a
shader library.
2019-01-21 12:54:41 +01:00
f8d040cb70 T60701: GP using cutter tool on stroke with vertex group crashes blender 2019-01-21 11:03:09 +01:00
97c7c0abf5 Cleanup: add clarifying comments for recent NUMA fixes. 2019-01-21 10:54:19 +01:00
42ba294235 Fix T55461: [Vertex Group] "Delete all unlocked groups" not working. 2019-01-21 10:36:38 +01:00
78d2abd9c1 DRW: Support wire overlay clipping 2019-01-21 19:08:42 +11:00
7bc9a563e6 Correct freeing builtin shader from recent commit 2019-01-21 19:07:57 +11:00
7117dfaf67 Fix T60704: Transparency threshold only half visible 2019-01-21 08:59:42 +01:00
a06b2b25ad DRW: pass clipping to geom shader via 'gl_in'
Removes need to pass the worldspace location.
2019-01-21 17:50:31 +11:00
1ab071bd5c Cleanup: remove '_sh' suffix
Shaders are now stored in their own struct, no need for special names.

Also free as an array.
2019-01-21 17:03:52 +11:00
07673a3460 DRW: Support edit-mesh clipping 2019-01-21 16:15:30 +11:00
dd3f518626 Cleanup: rename GPU function to set buffer length 2019-01-21 11:28:41 +11:00
ff10ba8c26 Cleanup: rename terms count/num to len 2019-01-21 11:24:19 +11:00
dbe960fdee Cleanup: replace 'ct' w/ 'len' 2019-01-21 11:22:27 +11:00
923b366549 DRW: set 4 clipping planes for box-clip 2019-01-21 11:12:26 +11:00
c53ebfa9e9 3D View: add back clipping border operator 2019-01-21 11:05:15 +11:00
7467049055 3D View: add back initial clipping support
Use clipping for workbench solid mode drawing.

Other modes & shading support still needs to be added.
2019-01-21 10:43:01 +11:00
0d8d26696f Cleanup: trailing space 2019-01-21 10:41:39 +11:00
49208a3419 Cleanup: shadow warning, style 2019-01-21 10:05:58 +11:00
eff4b68a6f Fix T60678: GP, smoothing a stroke's weights multiple times will lead to unweightable points 2019-01-20 20:38:00 +01:00
6e443b3210 Fix T60677: GP vertex groups get messed up, when deleting a group 2019-01-20 20:31:11 +01:00
6e57534eaa Fix T60671: GP weight paint crash when smoothing weights 2019-01-20 19:37:13 +01:00
69240a66e0 GP: Fix mirror modifier with parent object
Still problems when local rotation.

Some cleanup done.
2019-01-20 19:20:09 +01:00
482c4d099a Cleanup: remove all BLI_utiledefines' ugly vectorial macros.
Not only were those often making doublons with already existing
BLI_math's stuff, but they were also used to hide implicit type
conversions...

As usual this adds some more exotic inlined vector functions (one of
the rare cases where I really miss C++ and its templates... ;) ).
2019-01-20 16:27:06 +01:00
b0dee09a6d Fix bevel modifier spread value bug.
Was using same field as value, by mistake.
2019-01-19 15:58:01 -05:00
8a61ea7296 Cleanup: add trailing commas
Prevents clang-format merging into a single line.
2019-01-19 13:58:35 +11:00
c59370bf64 Merge branch 'blender2.7' 2019-01-18 21:00:24 +01:00
08871b56bc Fix T60627: Cycles render hanging on Windows with threadripper CPU. 2019-01-18 20:59:45 +01:00
c5eb10b110 Fix T60585: Cycles not using all cores on threadripper, after recent changes. 2019-01-18 20:58:56 +01:00
be8202d90b Fix T60585: Cycles not using all cores on threadripper, after recent changes. 2019-01-18 19:18:23 +01:00
b640fd829e Add miter pattern options.
Will document the new options in release notes, then in manual.
Still a bit of work to do on the bulging shape that appears
on cube corners if using arc inner miters, but will do that later.
Also need to do something smarter in clamp overlap.
2019-01-18 12:54:10 -05:00
c9938ebb00 Fix T60615: Cycles baking not working with some modifiers.
Refactors Cycles mesh export a bit to avoid unnecessary copies and to be in
sync with the Blender baker.
2019-01-18 18:39:43 +01:00
985dcbf6db GP: Guides: Fix bug with Mkey and Circular guides
Reported by @pepeland.

Adding missing events on the first point was breaking the guide behaviour.
Also, updated Ckey so it always defaults to Circular mode when guides are off.
2019-01-18 15:50:16 +00:00
b5bc2158a0 View 3D Grid: Improve precision and reduce code complexity
Instead of doing manual ray-plane intersection we use normalized positions
of the grid mesh and apply scaling after interpolation so that we keep
good precision even at really far distances.

Precision is now two order of magnitude better and does not produce the
same kind of artifact at lower clip start values.

This commit also cleanup the implementation.

Fixes T58918 Grid not appearing correctly at low clip start in 2.8
2019-01-18 16:30:05 +01:00
bb4c760fdd Preferences: assortment of minor layout tweaks. 2019-01-18 16:11:54 +01:00
Stefan Werner
5e121c8eab Cycles: Fixed uninitialized memory
Cryptomatte on CPU with accurate mode was hitting uninitialized variables.
This is now explicitly initializing them to NULL.
2019-01-18 15:17:21 +01:00
547cb5e264 Fix/workaround: Undo erase all dyntopo changes
Memfile undo isn't compatible with sculpt or edit-mode.

This didn't work in 2.7x, so best disable memfile undo for now in
situations where it's going to loose data or crash.
2019-01-19 00:53:39 +11:00
985712e5ee Fix loading a file saved w/ dyntopo
Ensure ED_editors_init doesn't create any undo steps
before the initial memfile undo is written.
2019-01-19 00:25:55 +11:00
c8067a5559 Fix undo push entering sculpt mode 2019-01-18 23:15:00 +11:00
1e3203986c Cleanup: remove unnecessary CUDA architecture sm_72, it's for Tegra chips. 2019-01-18 12:38:19 +01:00
d3ec4259af Subdiv CCG: Cleanup, comments 2019-01-18 12:29:53 +01:00
fb053ae2e5 Multires: Correct averaging
Before that only normal component was averaged, which is not
really correct.

Unfortunately, the new code is somewhat slower due to more
involved math to deal properly with non-quad faces, but the
plan is to move averaging from runtime to edit time, This
means, that mdisps will always be continuous around the edges
and no averaging on every frame change of animated character
will be needed.
2019-01-18 12:29:53 +01:00
cb5302f962 Math: Make it possible to use vector for both input and output
Avoids nasty code all over where such math is required, and
compilers can easily deal with such situation.

Don't prefer questionable micro-optimization which comes with
a cost of nasty actual logic code.
2019-01-18 12:29:53 +01:00
91697b0fa0 Multires: Ensure continuity when reshaping from object 2019-01-18 12:29:53 +01:00
45cf6f1cfc Subdiv: Fix wrong corner passed to a callback 2019-01-18 12:29:53 +01:00
02f86482b4 Multires: Simplify reshaping code
The idea is to run reshaping for every boundary vertex
of a grid rather than trying to copy boundary grid
elements.

While this is somewhat slower, this avoids all this
tangent flipping magic, which tempts to be rather tricky
and fragile.
2019-01-18 12:29:53 +01:00
076019c5f2 Multires: Correct function name, to match behavior 2019-01-18 12:29:53 +01:00
3fb6946b76 Multires: Fix spike issues when sculpting on triangles
The boundary copy code was not dealing correct with flipping
tangent vectors, hence causing discontinuity in the final
positions.

Now we only copy boundaries for quads, where we know how to
deal with tangent vectors and where we know that this is
needed.

More clear solution could be to change the code in a way that
handles handles displacement grids of quads in the same way
as it's done for non-quad faces.
2019-01-18 12:29:53 +01:00
9db73be975 Multires: Cleanup, move utility function to a more public place 2019-01-18 12:29:53 +01:00
a676b2b4b4 Multires: Cleanup, more clear naming 2019-01-18 12:29:53 +01:00
fc6aac3916 GP: Create materials when separate active layer
The materials were not created when used the active layer option of the separate operator.
2019-01-18 10:53:14 +01:00
d5b4d71ee7 DRW: Increase frustum culling precision
Use normal_quad_v3 instead of normal_tri_v3 and compute the mean of all
corner distance during frustum plane extraction.

Fix T58243 Flickering of viewport when rotating and zooming
2019-01-18 10:23:05 +01:00
a7b8538f4c DRW: Fix assert when using draw debug API 2019-01-18 09:58:04 +01:00
72b9ab5a22 Fix T60608: Popup dialogs Y-axis reset after drag
Caused by fc32bd729c
2019-01-18 16:56:56 +11:00
61036ca179 3D View: Disable clipping on load
Having clipping limit selection and tools is confusing when not visible.

Disable on load until it's supported
(doing this via ifdef's isn't practical).

Fixes T59580
2019-01-18 13:32:48 +11:00
0ad8f65677 Cycles: Cast to correct base type when checking requested features 2019-01-18 02:59:22 +01:00
b9412923a3 Cleanup: use enum for color picker types 2019-01-18 12:34:11 +11:00
3c2126c6f1 Fix eye-dropper causing undo push w/o any changes
Happened when accessing the eyedropper from a popup.
2019-01-18 12:08:45 +11:00
a3f312dcd1 Fix undo pushes w/ color picker
While changing RGBA or color wheel didn't add undo steps,
HSV and Hex values did.

Disable undo for these button types since an undo push happens when
exiting the picker.
2019-01-18 12:08:45 +11:00
031a9d6424 Merge branch 'blender2.7' 2019-01-18 01:47:32 +01:00
c9eef24903 Fix T56799: Custom render passes missing when using Save Buffers
The problem here was that when a render result is allocated, the standard render passes are added according to the
pass bitfield. Then, when the render engine sets the result, it adds the additional passes which are then merged
into the main render result.

However, when using Save Buffers, the EXR is created before the actual render starts, so it's missing all those
additional passes.

To fix that, we need to query the render engine for a list of additional passes so they can be added before the EXR
is created. Luckily, there already is a function to do that for the node editor.

The same needs to be done when the EXR is loaded back.

Due to how that is implemented though (Render API calls into engine, engine calls back for each pass), if we have
multiple places that call this function there needs to be a way to tell which one the call came from in the pass
registration callback. Therefore, the original caller now provides a callback that is called for each pass.
2019-01-18 00:58:28 +01:00
af316e8bc8 Render API: Fix detection of duplicate render passes 2019-01-18 00:58:28 +01:00
2757469824 UI: only reset eyedropper on cancel when set 2019-01-18 09:31:39 +11:00
7a0cc955cc Fix color picker cancel setting the color to black 2019-01-18 09:29:47 +11:00
8efedf2523 Cleanup: style 2019-01-18 08:59:41 +11:00
d3e856cdfc Audaspace: porting changes from upstream.
- Silence some warnings.
- Fix: Python API memory leak.
- Fix for T54490: VSE breaks when I insert or remove headphones
2019-01-17 21:17:30 +01:00
16fac2149b Physically based defaults for Eevee Bloom and Shutter
Some of Eevee's Bloom defaults are not very good for physically based rendering. This patches addresses this issue.

This picture shows one of the problems with current default. Bloom looks very foggy:
{F6280495}
Even worse, light emitters much dimmer than the Sun can make everything equally hazy if Clamp is set to 1.0 and intensity to 0.8 (current default). Artists often forget to adjust Clamp value and do not know what value to use for realistic intensity. Also, currently both Clamp and Intensity do not have good UI ranges. This is why often Eevee renders end up very hazy and bloom often does not look right.

Bloom effect plays important role to help to distinguish between bright and relatively dim light sources. With current defaults this is broken because Clamp set to 1.0. Also, it cannot be disabled if set to 0 like expected. This patch fixes this and sets it to 0 by default. If users need to clamp, they can do so easily with UI range up to 1000. This range is good enough for most cases and provides enough precision to control lower values, and the highest value helps to limit bloom from the Sun if necessary and will leave untouched most other light emitters. If needed, much higher values for Clamp can be entered manually up to 100000. 10000 is still affects the Sun, but up to 100000 highest limit allows to clamp anything that is much brighter than the Sun if user needs to limit bloom in such cases (for example, bright explosion in the sky or anything else very bright).

I propose new default for bloom Intensity - 0.05 and UI range to suggests realistic values. Bloom Intensity > 0.1 is not realistic for clean lens but the user can enter manually much larger values if needed.

For comparison, here is a my own photo with and without bloom caused by the Sun (on second photo the Sun was occluded with an object).
{F6280500}
{F6280492}
In real life bloom is much more subtle and does not look hazy. If Clamp is disabled, then out of 0.1, 0.05 and 0.025 values I have tried, 0.05 looks most similar to the photo. Here is test render with and without bloom with the Sun in similar position like on the photo:
{F6280496}
{F6280494}
Using color probe 27x27 I compared lightness below the horizon under the Sun. In rendered by Eevee images lightness difference was 17. In case of the photos lightness difference in similar place was 11. I then compared leftmost spot (also below the horizon) and lightness difference was approximately 2 between two photos and 1 between rendered images. In other words, with these settings bloom effect is not too strong and is not too weak. Visually it may seem like decreasing bloom intensity may increase photorealism, but then bloom effect would be too localized even for the Sun.

Besides this single test, I tested in many other scenes as well, with and without the Sun, with different HDRIs, and as far as I can tell 0.05 intensity turned out to be good default - it produces bloom strong enough to be noticeable and not too hazy.

In Cycles shutter default value is 0.50, so for consistency set to 0.5 by default in Eevee too. Besides, 0.5 is typical standard for real cameras, and values higher than 0.5 usually are needed only if very strong motion blur is desired.

Here is summary of all changes:

Bloom Intensity: 0.8 > 0.05
Bloom Intensity UI range: 0-10 > 0-0.1
Bloom Clamp: 1.0 > 0.0 (disabled by default)
Bloom Clamp manual range: 0-1000 > 0-100000
Bloom Clamp UI range: 0-10 > 0-1000
Shutter: 1.0 > 0.5

This patch is related to the discussion in this thread, there are more examples of what bloom will look like with 0.05 intensity by me and others:
https://devtalk.blender.org/t/eevee-needs-to-have-physically-based-defaults/4700

Reviewers: fclem

Reviewed By: fclem

Subscribers: pablovazquez, billreynish, rboxman

Tags: #eevee

Differential Revision: https://developer.blender.org/D4212
2019-01-17 20:03:13 +01:00
6dccc7cdab GPUInterface: Add builtin check in uniform location request.
This is a compile time option to remove the unecessary uniform queries.
2019-01-17 19:48:00 +01:00
844cda8f22 DRW: Make missing uniform debuging print only once 2019-01-17 19:48:00 +01:00
e3b3b32076 DRW: Use name buffer to request uniform location before drawing.
This is in order to avoid GL call during the "cache creation" phase and
support multithreading.
2019-01-17 19:48:00 +01:00
dc7e492989 Fix T60545: Buffer overflow in selection batch creation
Use loose_edges and loose_verts buffer instead of detecting them manually.
2019-01-17 19:48:00 +01:00
4c95899098 GPU: Rename GPU_shader_get_uniform to GPU_shader_get_uniform_ensure
This is in order to make the API more multithread friendly inside the
draw manager.

GPU_shader_get_uniform will only serve to query the shader interface and
not do any GL call, making it threadsafe.

For now it only print a warning if the uniform was not queried before.
2019-01-17 19:44:01 +01:00
938b08b336 GP: Make Close fill strokes visible 2019-01-17 19:33:39 +01:00
260b786d07 Fix T60558: Cycles viewport render mismatch when the camera is a light. 2019-01-17 16:36:05 +01:00
1a3abc7f79 Preferences: fit a little better when opened in place of properties editor. 2019-01-17 15:04:38 +01:00
be079e742d Fix wrong placement of allow negative frames preference. 2019-01-17 12:41:54 +01:00
d86991ef37 Fix T60580: depsgraph object instance 'matrix_world' always returns identity matrix.
While form a strict consistency point of view it could make sense to
return identity matrix for non-instance items, it can be very handy to
get that info (common to both instances and regular objects) directly in
all cases.
2019-01-17 12:34:08 +01:00
32dc085289 Add experimental batch-delete of hierarchy to Outliner.
This uses the same command as regular hierarchy delete, and is only
activated when debug value is set to 666 for now.

Here on file from T60419, it gives about 20% speed-up (from 5.5s to 4.4s).
2019-01-17 12:34:08 +01:00
33dcde4865 RNA Depsgraĥ: add a warning about not using object_instances as a sequence.
Due to how this is generated, each item is freed when steping iteration
to the next one, which means that subscriptions etc. will make blender
crash.
2019-01-17 12:34:08 +01:00
06ee560da7 Fix misleading autokeyframing preference, it's only for new scenes. 2019-01-17 12:00:18 +01:00
ad707115d5 Preferences: add new Viewport, Animation, Navigation, Save & Load sections.
This further changes the preferences organization, to avoid grouping unrelated
settings together. With more sections we can also expand more panels by default,
making it possible to quickly go through sections and see the settings of each.

Panels with less used settings are still collapsed by default, to keep all panel
headers visible without scrolling.

Differential Revision: https://developer.blender.org/D4216
2019-01-17 11:44:33 +01:00
4f9bcd6166 Preferences: tweaks to lights section layout. 2019-01-17 11:28:56 +01:00
f351c7bf23 Preferences: tweak themes/addons/keyamps buttons at the top.
Make layouts more consistent between them, give more room for search field.
Addon online resources links were removed as the links are dead.
2019-01-17 11:28:56 +01:00
944d6f11cb Revert "Preferences: enable interface translation by default, not just tooltips."
This reverts commit c1762b1a08, as this was
intentional since interface translations are often incomplete or use unusual
terms.
2019-01-17 11:28:56 +01:00
18905b4359 Fix preferences layout not shrinking properly on high DPI display. 2019-01-17 11:28:56 +01:00
e44a7d36f4 Fix UI not fully updating while resizing window on Windows and macOS.
This is still not fully correct, since the event loop is blocked by GHOST
and no timer events are happening for animation while the mouse is still.
But for the most part it looks ok.
2019-01-17 11:28:56 +01:00
c8e75c2b00 Fix T60554: Missing undo push changing color
Operators don't have a good way to skip undo,
for now check the button undo flag & return cancelled.
2019-01-17 16:39:38 +11:00
4a3aac478c Cleanup: logic for eyedropper free on failure
Although currently unused, if exec was called and failed it would leak.
2019-01-17 15:43:34 +11:00
3648b3f916 Cleanup: remove duplicate color picker operator
Use internal boolean option to disable accumulation for crypto-matte.
2019-01-17 15:27:24 +11:00
b6854770c7 T60560: Render border gizmo doesn't update display 2019-01-17 14:48:46 +11:00
a8e7275627 BMesh: keep selection history when removing doubles
Auto-merge would loose the active vertex.
2019-01-17 14:17:02 +11:00
6fac10dd0d BMesh: Remove doubles now merges face-flags 2019-01-17 14:17:02 +11:00
4120e535da Cleanup: variable names 2019-01-17 14:17:02 +11:00
9d8445d6a9 Cleanup: de-duplicate loose vert/edge checks 2019-01-17 13:20:44 +11:00
76fdd33df2 Fix T60578: Crash selecting after hiding vertices 2019-01-17 13:05:45 +11:00
2f372654b6 BMesh: keep selection history when removing doubles
Auto-merge would loose the active vertex.
2019-01-17 12:36:17 +11:00
371006ddea BMesh: Remove doubles now merges face-flags 2019-01-17 12:32:12 +11:00
c5ae1cde5c Cleanup: variable names 2019-01-17 12:29:09 +11:00
00dd294a6e Cleanup: unused code 2019-01-17 11:17:45 +11:00
e57ee5934a Fix T60261: Crash pasting a material without a nodetree 2019-01-17 08:59:02 +11:00
dfb63653f4 PyAPI: minor change to bpy.app.debug_value exception handling
Use error from int conversion function.
2019-01-17 08:46:36 +11:00
9bfc9d799e PyAPI: Avoid redundant prefix for PyC_Err_Format_Prefix
Only show the exception value type when it's not a string.
2019-01-17 08:43:57 +11:00
debb68024e PyAPI: add PyC_Err_SetString_Prefix for internal use 2019-01-17 08:38:59 +11:00
8ba86020cc GP: Display Stroke for Fill Alt mode always
When use the Alt mode to draw close strokes, if the color had the stroke diabled, the stroke was not visiblle while drawing.

Now, it's visible while drawing, but it's hidden again when the stoke is finished. To display close strokes, enable stroke mode in material or enter in edit mode.
2019-01-16 20:04:48 +01:00
8102200006 Cleanup/sanitize usages of G.debug_value.
There was no documentation at all, some very bad practices (like using
G.debug_value > 0 as some sort of global debug print switch), and even
an overlapping use of '1' value...

Also, python setter did not check for valid range (since this is a
short, not an int).
2019-01-16 19:43:53 +01:00
feaf846f93 Cleanup: get rid of -666 debug value.
That one was used to allow specifying in system console a new path for
missing libraries, when loading a .blend file.

We now have a much more easy and user-friendly way of repairing missing
linked datablocks/libraries, so this is not needed anymore.
2019-01-16 19:43:53 +01:00
2eec83867b Cleanup: remove dead code in softbody forces evaluation.
This code has been disabled (hidden behind a specific debug value) for
over 10 years now! More than time to get rid of it...
2019-01-16 19:43:53 +01:00
fb9243787b Fix too narrow buttons in addon preferences. 2019-01-16 19:32:10 +01:00
c1762b1a08 Preferences: enable interface translation by default, not just tooltips.
Translation as a whole is still disabled by default as before.
2019-01-16 19:25:17 +01:00
d31ca35c61 Fix outdated user preference descriptions. 2019-01-16 19:25:17 +01:00
69dcdf5e12 Fix broken weight painting colorband in default preferences. 2019-01-16 19:25:17 +01:00
1192fd58a5 GP: Use multiframe falloff in Shear transform 2019-01-16 19:22:20 +01:00
798e67bc9e GP: Use multiframe falloff for Bend transformation 2019-01-16 19:22:13 +01:00
c2dee803e3 Outilner: pass userdata void pointer to outliner_do_object_operation_ex().
Even though it is not used currently, an _ex() func should not ignore
that, it is kind of mandatory for many advanced/complex behaviors.
2019-01-16 17:35:51 +01:00
ece72e15d5 Preferences: remove OpenGL select method preference.
Deprecated GL_SELECT no longer works in OpenGL core profile, so there is no
reason to have this.
2019-01-16 16:16:42 +01:00
49562da98d Preferences: remove unnecessary 16 bit textures preference.
This is a leftover from a time when these were not supported on all GPUs.
2019-01-16 16:16:42 +01:00
a8a89db9c8 Preferences: always do GPU accelerated mipmapping, remove preference.
This setting was added long ago to be cautious in case some GPUs did not
support this propertly, no reason to have it anymore.
2019-01-16 16:16:42 +01:00
0a378b8ebc Fix BKE_id_copy_ex() being able to 'return' garbage in copied ID.
Reported/noted in D4178, it would return immediatly in case of NULL
source ID, without ensuring that return 'copied' ID was properly
initialized.
2019-01-16 16:15:52 +01:00
792c453b2a Merge branch 'blender2.7' 2019-01-16 14:58:53 +01:00
0260d7b726 Cycles: Report whether camera was detected inside volume or not 2019-01-16 14:58:07 +01:00
7d7f5ce19f Multires: Cleanup, comments 2019-01-16 12:20:32 +01:00
514e53bb80 Expose batch IDs deletion in python API.
Follow-up to previous commit.
2019-01-16 12:02:37 +01:00
ce6d20b54e Add experimental batch IDs deletion.
Main idea is to remove IDs to be deleted from Main, to avoid looping on
them to remove other deleted IDs usage (this is the most expensive
process in ID deletion, by far).

Speed improvements when deleting a large amount of IDs from a Main
containing a lot of them is quite significant, some examples for Objects:
* Removing 1k from 10k: 32% quicker (2.5s to 1.7s).
* Removing 10k from 20k: 60% quicker (59s to 23s).
* Removing 20k from 20k: 99.5% quicker (82s to 0.4s)!

Note however that this process is more risky/touchy, since we by-pass
some safety checks from regular ID removal here.
So will only give access to that code from python API for now (in
separate commit), so that it gets really tested. Also still need to
think about how to hook it up in UI (probably mostly for Outliner),
since we often do higher-level operations there...
2019-01-16 12:02:37 +01:00
fcbbfb7789 Fix crash creating new file after modifications
Seems to be caused by cae3750 which changed free() function used
by bmain free to the one which does dependency graph tag. We do
no want to do any tags here.
2019-01-16 11:39:30 +01:00
bcef99d3a7 Cleanup: Spelling in comment 2019-01-16 11:36:54 +01:00
1579dc8c3b Multires: Prepare for cached topology
Note that the actual caching is still disabled, since
more tests is needed with more production-looking files.
2019-01-16 11:00:43 +01:00
6ae72d2d41 OpenSubdiv: Remove topology orientation code
It is no longer used and has some issues in corner cases
which are not handled in a way which OpenSubdiv expects.
2019-01-16 11:00:43 +01:00
7eda267df1 Subdiv: Reset evaluator creation statistics
Makes it more clear to see what was exactly happening at
the last invocation of subsurf modifier.
2019-01-16 11:00:43 +01:00
4fe6a2d950 OpenSubdiv: Implement UV topology comparison 2019-01-16 11:00:43 +01:00
b0c6c65e7b Subdiv: Initial implementation of topology cache
This commit makes it so OpenSubdiv's topology refiner is kept
in memory and reused for until topology changes. There are the
following modifications which causes topology refiner to become
invalid:

- Change in a mesh topology (for example, vertices, edges, and
  faces connectivity).
- Change in UV islands (adding new islands, merging them and
  so on),
- Change in UV smoothing options.
- Change in creases.
- Change in Catmull-Clark / Simple subdivisions.

The following limitations are known:

- CPU evaluator is not yet cached.
- UV islands topology is not checked.

The UV limitation is currently a stopper for making this cache
enabled by default.
2019-01-16 11:00:43 +01:00
e064777cac OpenSubdiv: Correct topology cpmparator
This fixes following errors:

- The code didn't work correctly for edges reconstructed by
  the OpenSubdiv's topology refiner (due to indexing
  difference).

- Sharpness of non-manifold and boundary edges was not
  working correctly.
2019-01-16 11:00:42 +01:00
5a794c9685 OpenSubdiv: Use own utility header
Replaces direct access to std.
2019-01-16 11:00:42 +01:00
f36f60543f OpenSubdiv: Cleanup, indentation 2019-01-16 11:00:42 +01:00
4347879c43 Subdiv: Cleanup, pass mesh by const pointer 2019-01-16 11:00:42 +01:00
6c196248be Subdiv: Cleanup, comments 2019-01-16 11:00:42 +01:00
3d4e92eb96 Alembic: C++11 doesn't need the space between '> >'
C++11 doesn't need the space between '> >' in a nested templated
declaration, so instead of `std::vector<std::pair<a, b> >` we can now
write `std::vector<std::pair<a, b> >`.
2019-01-16 10:59:22 +01:00
3ce9bcee70 Alembic export: write curve/NURBS as mesh
It's now possible to export curves and NURBS as mesh data to Alembic.
This allows artists to do any crazy thing on curves and export the
visual result to Alembic for interoperability with other software (or
caching for later use, etc.). It's an often-requested feature.

This works around T60503 and the fixes export part of T51311.

Note that exporting zero-width curves is currently not supported, as
exporting a faceless mesh (e.g. just edges and vertices) is not
supported by the mesh writer at all.

To test, create a curve with thickness (for example extruded), export to
Alembic and check the 'Curves to Mesh' checkbox in the export options.

Reviewers: sergey

Differential Revision: https://developer.blender.org/D4213
2019-01-16 10:44:39 +01:00
2bb6028d1a Alembic export: separated "writing Alembic mesh" from "writing mesh object"
I moved most of the `AbcMeshWriter` code to a new class
`AbcGenericMeshWriter`. The latter is an abstract class and does not
make any assumptions about the type of Blender object being written.
This makes it possible to write metaballs, curves, nurbs surfaces, etc.
as mesh to Alembic files.

The `AbcMeshWriter` class now is the concrete implementation of
`AbcGenericMeshWriter` for writing mesh objects.

Reviewers: sergey

Differential Revision: https://developer.blender.org/D4213
2019-01-16 10:43:45 +01:00
45042f6a03 Fix uninitialized cursor w/ setting object origin 2019-01-16 19:57:58 +11:00
735653cda8 Fix T52354: Origin to Geometry uses Bounds w/ Median Center is set 2019-01-16 18:32:09 +11:00
c383d74228 Logging: add '--log-show-timestamp' option.
Part of D4214 by @sobakasu w/ edits.
2019-01-16 16:33:05 +11:00
28790fb3a7 BMesh: prevent weld-verts bmop creating selected+hidden verts/edges
Related to error exposed by T59640
Would have fixed crash too, but we want to ignore hidden verts.
2019-01-16 15:32:24 +11:00
7c4803367f BMesh: prevent weld-verts bmop creating selected+hidden verts/edges
Related to error exposed by T59640
Would have fixed crash too, but we want to ignore hidden verts.
2019-01-16 15:31:54 +11:00
c8e5eb58e5 Fix T59640: Transform w/ auto-merge & hidden verts crashes 2019-01-16 15:05:48 +11:00
beaa66bb13 Fix T59640: Transform w/ auto-merge & hidden verts crashes 2019-01-16 15:03:17 +11:00
6299d84e10 Fix uninitialized variable use w/ kdopbvh ray projection
Snapping verts for eg would use these values uninitialized.
2019-01-16 15:02:58 +11:00
5861e1fa28 Object: avoid calling operators in ED_editors_init
Don't call operator when entering sculpt modes.
2019-01-16 11:49:19 +11:00
976917e8cf Cleanup: de-duplicate rotation mode enum 2019-01-16 11:17:13 +11:00
f027cbeeb9 Cleanup: use max frame define 2019-01-16 11:09:51 +11:00
d844271aef GP: Use weight in noise modifier for all types
The weight was used only for position.
2019-01-15 20:24:07 +01:00
b1fa2a8fbb Fix T59826: grease pencil crash with empty material slot. 2019-01-15 18:54:11 +01:00
eb61e6840e Merge branch 'blender2.7' 2019-01-15 18:42:37 +01:00
cac3e16cfb Sequencer: Restore change menu
It was still used by C-key menu, and is very handy to have
when working on a complex edit files.

Was initially removed by e9d06f0866.
2019-01-15 18:34:21 +01:00
a0df26f004 Fix T60383: mesh merge type callback returned NULL 2019-01-15 18:27:21 +01:00
e4c78436c6 Fix T60246: crash with Cycles baking while in edit mode. 2019-01-15 16:53:42 +01:00
2f2272f71a Alembic: removed declaration of non-existing functions
Removed AbcMeshWriter::getMeshInfo() and AbcMeshWriter::getMaterialIndices().
2019-01-15 16:21:04 +01:00
f16b9dc750 Marked TODOs with the actual string TODO
There are some things that need to be done in Alembic for Blender 2.8 to
make all the 'visible/renderable/selected only' options work.
2019-01-15 16:21:04 +01:00
9fed39c7b0 Alembic export: fixed memory leak
If the triangulated mesh was in itself a new mesh that should be freed this
should happen before the function returns (as it only returns a single mesh,
and thus the caller can only free one).
2019-01-15 16:21:04 +01:00
2124f3107c Merge branch 'blender2.7' 2019-01-16 00:28:46 +11:00
5f22de8439 Merge branch 'blender2.7' 2019-01-16 00:27:10 +11:00
665acf22bd Cleanup: commas at the end of enums
Without this clang-format may wrap them onto a single line.
2019-01-16 00:26:24 +11:00
d4c851b976 Cleanup: comment line length (editors)
Prevents clang-format wrapping text before comments.
2019-01-16 00:26:16 +11:00
ee789ccd46 Cleanup: comment line length (blenlib)
Prevents clang-format wrapping text before comments.
2019-01-16 00:14:42 +11:00
0b17547b23 Cleanup: comment line length (creator)
Prevents clang-format wrapping text before comments.
2019-01-16 00:14:34 +11:00
8e46e5189d Cleanup: comment line length (DNA)
Prevents clang-format wrapping text before comments.
2019-01-16 00:14:25 +11:00
88a80fcec8 Cleanup: commas at the end of enums
Without this clang-format may wrap them onto a single line.
2019-01-16 00:03:03 +11:00
2d98dce7ee Cleanup: rename BASE_FROMDUPLI -> BASE_FROM_DUPLI
Matches `BASE_FROM_SET`.
2019-01-15 23:30:31 +11:00
b8e8c0e325 Cleanup: comment line length (editors)
Prevents clang-format wrapping text before comments.
2019-01-15 23:30:31 +11:00
4226ee0b71 Cleanup: comment line length (blenlib)
Prevents clang-format wrapping text before comments.
2019-01-15 23:30:31 +11:00
30c3852ffd Cleanup: comment line length (creator)
Prevents clang-format wrapping text before comments.
2019-01-15 23:30:31 +11:00
328a0f975b Cleanup: comment line length (DNA)
Prevents clang-format wrapping text before comments.
2019-01-15 23:15:35 +11:00
39acbebe46 Fix T60498: Auto IK doesn't work immediately. 2019-01-15 12:07:22 +01:00
48f38f850b Fix T60497: wrong statusbar keymap display with MMB emulation. 2019-01-15 11:42:08 +01:00
bb70594c1b Fix T60497: edgering select not available with LMB select and MMB emulation.
This is now handled with Ctrl + double click LMB, similar to loop select.
2019-01-15 11:42:08 +01:00
0b9a65151d Fix T60410: Crash adjusting torus w/ enter edit-mode preference 2019-01-15 21:36:50 +11:00
e375685e06 Cleanup: pass main instead of context w/ ED_editors_exit/flush_edits
Useful for calling from lower level code.
2019-01-15 21:36:50 +11:00
01029c68d2 Cleanup: rename BKE_libblock_delete to BKE_id_delete. 2019-01-15 11:09:16 +01:00
f55a178db0 Cleanup: rename BKE_libblock_free_us to BKE_id_free_us. 2019-01-15 11:09:16 +01:00
f52d315c35 Cleanup: removed disabled 'slow but safer' piece of code in make_local process.
Has been disabled for nearly two years now, think we can safely assume
new, quicker code is working properly now. :)
2019-01-15 11:09:16 +01:00
c710ca8933 Cleanup: Remove deprecated BKE_libblock_free(_ex) functions, document BKE_id_free(_ex) ones. 2019-01-15 11:09:16 +01:00
cae3750ff9 Cleanup: replace usages of deprecated BKE_libblock_free_ex by BKE_id_free_ex. 2019-01-15 11:09:16 +01:00
6af97b84df Cleanup: replace usages of deprecated BKE_libblock_free by BKE_id_free. 2019-01-15 11:09:16 +01:00
2f39ca3843 Cleanup BKE_id_free_ex().
Add 'missing' bpy code from BKE_libblock_free_ex(), now both functions
do exactly the same thing, only the later is less flexible (fewer
'exotic' behaviors supported, like handling IDs outside of bmain etc.).

Next step: nuke usages of BKE_libblock_free functions, makes no sense to
have twice the same code around!
2019-01-15 11:09:16 +01:00
93867cfafc Correct last commit 2019-01-15 18:56:53 +11:00
b3791d59f6 Fix T60507: Constrained transform shows all axes
Regression in 579c01da60

Move values_modal_offset use out of applyMouseInput
to resolve order of initialization issue.
2019-01-15 18:40:31 +11:00
165caafb99 Revert fix for T48901: Use of XIWarpPointer
Xorg's XIWarpPointer doesn't support multi-head display while
XWarpPointer does.

Revert since this is a known TODO in Xorg and setting a custom
xinput matrix seems not to be used often.

Resolves T50383
2019-01-15 16:49:44 +11:00
9461af299c Revert fix for T48901: Use of XIWarpPointer
Xorg's XIWarpPointer doesn't support multi-head display while
XWarpPointer does.

Revert since this is a known TODO in Xorg and setting a custom
xinput matrix seems not to be used often.

Resolves T50383
2019-01-15 16:44:08 +11:00
dde4375d5c Fix T60504: Armature wire draw type hidden when unselected 2019-01-15 14:02:13 +11:00
745311ed4c Fix T60506: Menu toggle clicks pass through to area 2019-01-15 11:42:07 +11:00
b5a860c9cc CMake: Improve handling of missing TBB & OpenVDB 2019-01-15 11:14:36 +11:00
07541052a0 Fix T60512: Weight paint brushes show weight when unused 2019-01-15 11:06:36 +11:00
62ac0996e7 Cleanup: use BrushCapabilities prefix for RNA types 2019-01-15 10:54:35 +11:00
8c3bd1eda1 Cleanup: style 2019-01-15 10:36:52 +11:00
ee0c2e9b87 Edit Mesh: Improve selected double vertices visibility
The issue is that the edge fix geometry goes on top of the actual drawn
points.

This commit reduce the edge fix size to the strict minimum but does not
get rid of it.

Related to T60139
2019-01-14 23:43:17 +01:00
21fedfbca0 Fix T59482: Creating 2 Particle systems breaks the app 2019-01-14 23:43:17 +01:00
Harley Acheson
84c06e996a UI: indent subpanel headers more.
Differential Revision: https://developer.blender.org/D4206
2019-01-14 20:48:15 +01:00
Christopher Peerman
4693207918 Windows: add support for Windows Ink.
Before this Blender always needed the Wintab driver. This adds support for the
native pressure API in Windows 8+, making it possible to get pressure sensitivity
on e.g. Microsoft Surface hardware without any extra drivers.

By default Blender will automatically use Wintab if available, and if not use
Windows Ink instead. There is also a new user preference to explicitly specify
which API to use if automatic detection fails.

Fixes T57869: no pressure sensitivity with Surface pen or laptop.

Code by Christopher Peerman with some tweaks by Brecht Van Lommel.

Differential Revision: https://developer.blender.org/D4165
2019-01-14 20:48:11 +01:00
eaf282b375 Cleanup: refactor GHOST wintab handling. 2019-01-14 20:48:07 +01:00
6f9e3e9d33 Fix T60476 Loose vertices only partially drawn
Was caused by a missing vbo attachement.

Also fix said Vbo refreshing when selecting.
2019-01-14 18:33:07 +01:00
209afa28c6 Object Mode: Outlines: Add support for thicker outline
Base outline is 2px wide (because of how we detect them).
And since inflating this outline will only produce outlines that are 2*x
thick we map the UI scalling and the outline width setting to the closest
match.

Do note that thicker outlines have a performance cost since they need more
texture fetches and passes.

This fixes T60252 3D View Outline Width not working
2019-01-14 18:33:07 +01:00
065bdc0333 GPUMaterial: Cleanup 2019-01-14 18:33:07 +01:00
dd5602a1e5 Fix T60332: Lattice objects do not display properly in Edit mode
This was caused by wires not having alpha by default, making them disapear
with MSAA.
2019-01-14 18:33:07 +01:00
630a7e73bc Fix incorrect individual origins icon in clip editor.
Differential Revision: https://developer.blender.org/D4020
2019-01-14 17:36:22 +01:00
de1d3e5f5f NLA: implement a new blending mode that intelligently combines actions.
The existing Add and Multiply blending modes have limited usability,
because the appropriate operation for meaningfully combining values
depends on the channel. This adds a new mode that chooses the operation
automatically based on property settings:

- Axis+Angle channels are summed, effectively averaging the
  axis, but adding up the angle. Default is forced to 0.

- Quaternion channels use quaternion multiplication:

  result = prev * value ^ influence

- Scale-like multiplicative channels use multiplication:

  result = prev * (value / default) ^ influence

- Other channels use addition:

  result = prev + (value - default) * influence

Inclusion of default in the computation ensures that combining
keyframed default values of properties keeps the default state,
even if the default isn't 0 or 1.

Strips with this mode can be keyframed normally in Tweak mode,
except that for quaternion rotation keyframing always inserts
all 4 channels, and the channel value sliders on the left side
of Graph/Action editors won't insert keys without Auto Key.
Quaternion keys are also automatically normalized.

Differential Revision: https://developer.blender.org/D4190
2019-01-14 19:14:28 +03:00
9c1a961dc4 Keyframing: refactor insertion code to allow property-global NLA tweaks.
Supporting a strip blending type that treats quaternions as a unit
also means being able to adjust all sub-channels as a unit when
inserting keyframes. This requires refactoring keyframe insertion
code to retrieve array property values for all channels at once,
before iterating over the indices being inserted.
2019-01-14 19:14:28 +03:00
1665278c14 Fix the active sequencer strip not standing out from selected ones.
Set outline contrast back to 2.7 values.
2019-01-14 16:08:26 +01:00
b17591731d Build environment: fixes for Linux debug libraries build. 2019-01-14 15:57:53 +01:00
Alex Fuller
c08c6c8336 Cleanup: add begin/end iterators to Cycles NodeEnum.
Differential Revision: https://developer.blender.org/D4173
2019-01-14 15:57:53 +01:00
Alex Fuller
867ffacabf Fix Cycles node definition typos and incorrect enum value.
Differential Revision: https://developer.blender.org/D4174
2019-01-14 15:57:53 +01:00
Harley Acheson
1af9599aca UI: fix misaligned eyedropper icon in button.
Differential Revision: https://developer.blender.org/D4183
2019-01-14 15:28:04 +01:00
Harley Acheson
06f7b6827d UI: fix panel header contents alignment.
The contents is now properly centered at all zoom levels.

Differential Revision: https://developer.blender.org/D4176
2019-01-14 15:28:01 +01:00
Harley Acheson
ed843774a8 UI: fix horizontal scrollbar overlapping last item.
Differential Revision: https://developer.blender.org/D4202
2019-01-14 15:20:31 +01:00
b5b6555768 cleanup last commit 2019-01-14 14:13:39 +01:00
ec3e2b0ce5 Fix T60304, T60301: setting error message in bevel modifier results in double free 2019-01-14 14:10:33 +01:00
67c5412708 Fix T60441: entering hex color in picker gives wrong result. 2019-01-14 13:09:06 +01:00
7707bf203c Merge branch 'blender2.7' 2019-01-14 12:43:34 +01:00
Christopher Peerman
19fba61d46 Fix T55589: drawing strokes with Microsoft surface pen misses first part.
This disables touch gesture recognition in Blender, avoiding any initial delay
when drawing with grease pencil, texture paint, etc.

Differential Revision: https://developer.blender.org/D4203
2019-01-14 12:25:42 +01:00
728f43d585 Merge branch 'blender2.7' 2019-01-14 12:13:10 +01:00
10fa3b790f Fix T60450: Cycles broken GPU denoising after recent changes. 2019-01-14 11:42:38 +01:00
a6b2ec0bc2 Fix toolbar accelerator w/ user defined keyconfig 2019-01-14 18:59:26 +11:00
2e3e94c796 3D View: don't override animation template view color
D4198 by @charlie w/ edits.
2019-01-14 18:12:13 +11:00
417cd20257 Cleanup: unused function 2019-01-14 18:04:10 +11:00
b3dbe17658 Add font selection to VSE text strips
Allows users to select a font for text strips in the video sequence editor.

Related: 3610f1fc43 Sequencer: refactor clipboard copy to no longer increase user count.

Reviewed by: Brecht

Differential Revision: https://developer.blender.org/D3621
2019-01-13 21:57:09 -08:00
c450461e68 Fix crash on scene unlink
Reviewed by: Brecht

Differential Revision: https://developer.blender.org/D4200
2019-01-13 21:57:08 -08:00
e1c4dc7a64 Fix drawing metadata
ImBuf was freed prior to drawing metadata.

Reviewed by: Brecht

Differential Revision: https://developer.blender.org/D4170
2019-01-13 21:57:08 -08:00
fad5232f8a Fix FPS meter not showing properly with no input
Reviewed by: Brecht

Differential revision: https://developer.blender.org/D4136
2019-01-13 21:57:07 -08:00
f91b21f85b Cleanup: move comments above definitions
For clang-format not to wrap definitions.
2019-01-14 16:30:43 +11:00
a1d73d03eb Cleanup: move comments above definitions
For clang-format not to wrap definitions.
2019-01-14 16:20:55 +11:00
63ee378fa9 Cleanup: move comments above definitions, use enum
For clang-format not to wrap definitions.
2019-01-14 15:58:40 +11:00
af4ab8c6a1 Fix T60248: Crash duplicating collections 2019-01-14 15:36:12 +11:00
65b82e09d9 Fix T57852: Mesh X Mirror option not working
D3869 by @lichtwerk w/ own edits
2019-01-14 15:14:39 +11:00
9c7adcfd8b Fix T60388: Warning entering text edit mode 2019-01-14 14:16:08 +11:00
a980b2f455 Fix message bus ID remapping 2019-01-14 14:08:40 +11:00
723e469686 Fix T60267: Assert manipulating a collection 2019-01-14 13:59:56 +11:00
8a2d48d928 Cleanup: move comments above definitions
For clang-format not to wrap definitions.
2019-01-14 12:43:19 +11:00
9390b2e645 Cleanup: compiler warnings 2019-01-14 11:42:28 +11:00
2826c2be54 NLA: ignore time range when evaluating a raw action.
When editing an action without a strip, or tweaking a strip without
time mapping enabled or supported, the extents of the virtual strip
can't be controlled and are purely derived from keys in the action.

Thus, cutting off evaluation of the action at these arbitrary points
gets in the way of observing the natural extrapolation of the F-Curves
and thus appears to be a mis-feature.

With this change non-mapped actions are evaluated with infinite
range, exactly like they are handled without NLA, unless extend
mode is set to Nothing.
2019-01-12 14:10:33 +03:00
5e356cc5c8 GP: Cleanup missing brackets 2019-01-12 08:36:00 +01:00
Dalai Felinto
ce3475f747 Viewport: Stereoscopy drawing is back
The viewport stereoscopy support helpers are finally ported to 2.80.

We now can scale the camera and the "stereo cameras" will scale
in the viewport as well (unlike 2.7x).

At the moment I disabled the drawing of the camera frame when
stereo is selected and you are looking through the camera.

It is to be fixed later, but for now it draws the border wrong.
In 2.79 this was not a problem because the camera frame was drawn
afterwards as a hack.

Viewport > Stereoscopy:
* Cameras
* Convergence plane
* Convergence plane alpha
* Stereoscopy volume
* Stereoscopy volume alpha
2019-01-11 21:51:15 -02:00
Dalai Felinto
ba89b69ebd BKE_camera_multiview_model_matrix: Add _scaled version
For drawing it is useful to have the non-normalized version of the matrix.
So we can scale up the cameras drawing accordingly.
2019-01-11 21:51:15 -02:00
Dalai Felinto
9f6e09bd8c Drawing API: shgroup_instance and shgroup_instance_alpha clarification
shgroup_instance_alpha was getting a color[4] but would only use the
alpha defined upon creation of the shading group.

This was very limiting since it wouldn't allow for different instances
to have different alpha values.

Patch made with Clément Foucault (he made the code of it, while I fixed
all the parts of the code that were relying on shgroup_instance_alpha.
2019-01-11 21:51:15 -02:00
Dalai Felinto
0bd20aa7df Fix T60328: Stereoscopy Convergence Plane broken
The original issue is that we were changing the camera shiftx
temporarily for the stereoscopic calculation. However we are using the
evaluated object when calculating the projection matrix.

Note: Camera framing drawing for stereo still seems to be broken.
But the viewport itself is now correct.
2019-01-11 21:51:15 -02:00
47be4e9a33 Fix T60401: Shape key's from pointer being set to evaluated CoW ID.
Not sure exactly why this happened for 'apply as shape' and not in other
cases (did not took time to fully trace what happens there). But in any
case, `BKE_key_evaluate_object_ex()` can be called from a fair amount of
places, including during depsgraph evaluation, so setting back key's
owner here is plain wrong in CoW era.
2019-01-11 23:16:27 +01:00
b56b41d51f Fix T60402: Increased data.users value, when running: C.active_object.to_mesh(C.depsgraph, True) - on curve.
More like a band-aid than anything else really, that code is horribly
weak and need to be fully re-written at some point (putting all those
temp data-blocks fully outside of bmain...). But for now should do.
2019-01-11 20:26:52 +01:00
7aecb018f6 =Fix unused func warning in GP code... 2019-01-11 20:14:37 +01:00
1b18e0d8f6 Fix syntax error breaking compile in GP code.
Seriously… Build your code before committing!!!
2019-01-11 20:14:37 +01:00
cd41570b55 Revert "Fix T57371: Generative modifiers in editmode display vertex group weights ..."
This reverts commit 6dbfd7f6d6.
2019-01-11 20:09:42 +01:00
00d2237d2a Fix T57371: Generative modifiers in editmode display vertex group weights
In a better way...

6dbfd7f6d6 would make the final vertex weights always calculated in
edit mode. Now it's only if the option is enabled.
2019-01-11 20:09:42 +01:00
9f51fc656e EditUV: Only clear data VBO when selection changes
This is a small optimisation that make UV selection faster.
2019-01-11 20:09:42 +01:00
ee34275e7d Merge branch 'blender2.7' 2019-01-11 20:03:42 +01:00
1ded3d2f7c Fix T55668: Volume Keyframe on Cut-ted Metastrip (re-doing the fix in better way).
Fix T60194: Sequencer cut loses animation data for the right strip.

Fixing the first also fixes the second. First attempt was delaying
uniquename check at a later step of cut process, after everything had
been duplicated. While this fixed first issue, second one became even
more proeminent (it become active for all strips, and not only
video/audio movie strips in meta's).

So instead, passing along the list of (new) sequences, so that duplicated
seqs can be put there immediately, before checking for unique names,
henceforth ensuring even strips inside meta's get properly handled.
2019-01-11 20:01:01 +01:00
c97794520f Revert "Fix T55668: Volume Keyframe on Cut-ted Metastrip."
This partially reverts commit bb98e83b99.
It fixed 'strips having same name' issue, but broke handling of
animation then. Need to find a better way to handle this.
2019-01-11 19:49:06 +01:00
bb9c9d0eaa GP: New Cutter, Constraints and Segment selection
This commit groups a set of new tools that were tested in grease pencil object branch before moving to master. We decide to do all the development in a separated branch because it could break master during days or weeks before the new tools were ready to deploy.

The commit includes:

- New Cutter tool to trim strokes and help cleaning up drawings.

- New set of constraints and guides to draw different types of shapes. All the credits for this development goes to Charlie Jolly (@charlie), thanks for your help!

- Segment selection mode to select strokes between intersections.

- New operator to change strokes cap mode.

- New option to display only keyframed frames. This option is very important when fill strokes with color.

- Multiple small fixes and tweaks.

Thanks to @pepeland and @mendio for their ideas, tests, reviews and support.

Note: Still pending the final icons for Cutter in Toolbar and Segment Selection in Topbar. @billreynish could help us here?
2019-01-11 19:21:56 +01:00
6dbfd7f6d6 Fix T57371: Generative modifiers in editmode display vertex group weights ...
... incorrectly (or assert)

Thanks @angavrilov and @lichtwerk for the fix.
2019-01-11 18:56:05 +01:00
3a9909f38e Fix T59990: Crash when entering edit mode with skin modifier enabled
The skin modifier does not keep the UV layers.

This just add a safety check when there is no UV layers.
2019-01-11 18:56:05 +01:00
1c7695b848 Merge branch 'blender2.7' 2019-01-11 18:09:05 +01:00
48506a3431 Fix T60145: Cycles resets manually set affinity
This change brings back old original logic which was checking
whether worker threads do fit into an active CPU group. But
it does it a bit smarter now and is also checking affinity
within that group. This way Cycles will use all threads on a
Threadripper2 CPU if it's set to automatic number of threads,
but on another hand will not change affinity if user requested
16 threads and changed Blender affinity.
2019-01-11 17:55:36 +01:00
ff44a9957e Update bundled version of NUMA API library 2019-01-11 17:47:10 +01:00
ba4e6d73af GP: Missing in previous count commit 2019-01-11 17:30:53 +01:00
6abbab5b53 Fix T60415: wrong font preview image alpha blending. 2019-01-11 17:26:54 +01:00
a1764cedbd Fix Python errors batch generating preview images. 2019-01-11 17:26:54 +01:00
854485b4b3 Fix T60411: crash in multi-object pose mode, with some armatures in rest pose. 2019-01-11 17:26:54 +01:00
a369004543 GP: Fix missing Fill properties in Topbar
After some internal changes in the topbar, some properties were not visible if use col() instead of row() in python script.
2019-01-11 17:22:13 +01:00
6c056f9ae2 GP: Reduce memory reallocation in multiedit mode
There was a problem counting the number of points for edit points and lines. Now the total size is used allocating the VBO size and not the stroke size.
2019-01-11 16:58:42 +01:00
1c91b6ee29 UVEdit: Port texpaint_loop_wire to batch request
This removes code duplication and put an end to the old "create at request"
batch creation.

Also it uses the same vbo as the uv layer used for shading. Reducing VRAM
usage.

Also fixes the modified uv display in uv edit mode.
2019-01-11 16:00:23 +01:00
621a6d4a5d UVEdit: Add back uv angle stretch aspect correction
This is now done in shader so that the batches are shared across ImageUV
areas.
2019-01-11 16:00:23 +01:00
5f3fdee53a UVEdit: Port batches to batch request
This is in order to allow more spaces to have their batches created at the
same time and sharing the batches.

This is part of the effort fo making the drawing code more optimized. This
commit however should not introduce any difference.

This commit bypass the aspect ratio correction for angle stretch display
but this should be fixed in the next commit.
2019-01-11 16:00:23 +01:00
86ec304ffa WM: Use draw manager to draw UV image editor spaces
This is in order to use batch cache directly without using tricks like
batch presets reseting the VAOs.

Note: For now it also create a depth buffer for this area which is not
needed. We could get rid of this to lower VRAM usage.
2019-01-11 16:00:23 +01:00
74260a2b6d BMesh: Add BM_face_calc_area_uv 2019-01-11 16:00:23 +01:00
b98e6743dc Texture Paint: Add filtering option for texture paint overlay
The overlay should now use the texture interpolation setting in material
mode.

In image mode, there is now a new button to let the user choose the texture
filter. The option is located in the Texture Slots popover and only shows
in Image mode.
2019-01-11 16:00:23 +01:00
9177bb33f6 Workbench: Support node texture "closest" interpolation option
This makes it possible to paint pixel art using the workbench.

Cubic interpolation is not supported but could be added if needed.
2019-01-11 16:00:23 +01:00
1459a70489 GPUShader: Cleanup Unused shaders 2019-01-11 16:00:23 +01:00
a46dc9b234 Mesh Batch Cache: Cleanup Unused 2019-01-11 16:00:23 +01:00
44e3fc66c7 Edit Mode Selection: Make Vertices not occluded by edges
Debugging the edit mode selection I realized the vertices are often
occluded by edges with the same depth. Sometime it can be the center
pixel of a vertex point and that can lead to some selection issue.

So I increased the offset a bit for the vertices and it seems to fix it.
2019-01-11 16:00:23 +01:00
3bc87227f5 GPUMaterial: Cleanup / optimization 2019-01-11 16:00:23 +01:00
55ddb21b7c Mesh Selection: Port to batch cache request
This makes it more future proof and remove baked id offset inside the vbos.
Instead we add the offset as a uniform. This makes it possible to reuse
the vbos instead of discarding them all the time.

Also using batch request may reduce batches creation time.
2019-01-11 16:00:23 +01:00
4c0c4e7f9f Mesh Batch Cache: Fix wrong assert 2019-01-11 16:00:23 +01:00
9d19ff9076 GPUShader: Add selection id shader
This is to separate id drawing from standard color drawing.
2019-01-11 16:00:23 +01:00
943852c0dc Mesh Batch Cache: Put context evaluation out of batch cache
This is in order to be able to call DRW_mesh_batch_cache_create_requested
outside of the draw manager
2019-01-11 16:00:23 +01:00
bda2cd8ba5 DRW: Fix texture paint crashing if object has no material slot 2019-01-11 16:00:23 +01:00
cca35c1013 Merge branch 'blender2.7' 2019-01-11 15:09:46 +01:00
c1dd74580e Fix T60227: Crash when Cycles uses more than system threads
Tweaked scheduling so it survives this situation by scattering
"extra" threads uniformly over all the NUMA nodes.

There are still tweaks possible to make some specific hardware
configurations work better.
2019-01-11 15:03:48 +01:00
e5a1a9288c Fix T60320: Cycles OpenCL denoising filter errors on some drivers. 2019-01-11 11:25:37 +01:00
5793a84f12 GP: Count all strokes when use multiedit for VBO size
When use multi frame edition, the initial size of the VBO must be bigger than normal edition because the realloc of VBO is very slow.
2019-01-11 11:00:30 +01:00
191e812f36 Fix auto-run warning RNA type 2019-01-11 15:43:53 +11:00
459c4e8e6e Theme: update blender light theme preferences
Copy from properties space.
2019-01-11 15:11:00 +11:00
5119d72f9a Theme: disable blender_light 3D view gradient
- Lost contrast w/ faded wire for dupli/set-scene.
- Make grid darker to increase contrast.
2019-01-11 15:02:58 +11:00
0434511a40 3D View: fade out dupli-wire color 70% 2019-01-11 15:02:58 +11:00
9327013796 3D View: use faded wire for set-scene objects
Matches 2.7x behavior.
2019-01-11 15:02:52 +11:00
ee6e02ccf3 3D View: use dupli wire color for shaded wire drawing
Was only working for loose wire.
2019-01-11 15:02:21 +11:00
40706b56db Cleanup: blend existing colors 2019-01-11 13:27:49 +11:00
45dc53410f Cleanup: avoid repetition versioning theme 2019-01-11 13:23:27 +11:00
a33f3cf9b2 startup: view background color wasn't default 2019-01-11 13:15:38 +11:00
5c6d5cb863 Fix background color use in 3D view
TH_BACK was being used when drawing the 3D view even though
there was no way to set the color in the preferences.

The color was zero'd when moving to the new 2.8x theme.

Having both gradient and background colors was confusing,
especially having to use 'TH_HIGH_GRAD' for the 3D view, 'TH_BACK' for
other views.

Move the background color back to 'TH_BACK', 'TH_BACK_GRAD' is used
when gradients are enabled.
RNA is unchanged so presets don't need updating.
2019-01-11 12:59:19 +11:00
f98e4cbedb Preferences: remove author field
This was only used by collada export metadata.

If metadata like this is needed, we can use per-filetype preferences,
to make it clear when user identifiable information is being used.
2019-01-11 11:00:33 +11:00
6439ed844e Cleanup: remove tabs after line start
Allows expanding tabs before running clang-format.
2019-01-11 10:53:21 +11:00
638079af20 Cleanup: unused vars 2019-01-11 10:52:26 +11:00
b1e286bbfe MSVC: remove compiler __func__ define
No longer needed and exposes a bug in clang-format see: D4185
2019-01-11 09:33:20 +11:00
302970b7a5 MSVC: remove compiler __func__ define
No longer needed and exposes a bug in clang-format see: D4185
2019-01-11 09:22:21 +11:00
Trevor Glauz
8b192e1a6a fix D4187: Collada Importer: Material assignment broken after importing Mesh with multiple materials 2019-01-10 20:24:56 +01:00
bf7a1ef11e Fix T60266: missing viewport updates after changing scene world datablock. 2019-01-10 20:10:48 +01:00
4b0c2152db Fix use of uninitialized GPU context memory in release builds.
Reported by valgrind, not sure it caused any real bugs.
2019-01-10 20:03:05 +01:00
b207f4e4a2 Subdiv: Fix memory leak
Was visible when mesh had n-gons.
2019-01-10 17:09:48 +01:00
e551ddf712 Fix T60393: Subdiv gives wrong vertex colors 2019-01-10 17:09:48 +01:00
41b65d9a8e Fix T59631: Crash in Surface Deform modifier Bind when Dynamic Paint is included.
We should *never* prevent copying basic mesh CDLayers (vertices etc.),
that does not make sense.

I guess issue was not in old DM because geometry was duplicated anyway,
and in 'normal' modifier stack eval, probably because bare mesh was
awlays requested? But we should not have to be explicit here about it.
2019-01-10 16:47:41 +01:00
e31a5a4c62 GP: Fix render glitch when have collision with mesh 2019-01-10 16:26:05 +01:00
0f1775205e Use proper ID to create FModifier RNA pointer
Allows to do simple DEG tag, without extra checks for ID type.

Will solve possible missing updates when modifying f-curve
modifier of a shared action.
2019-01-10 16:22:53 +01:00
ba2b26af31 Support proportional edit scaling on dopesheet keyframes
Fixes T60361

Reviewers: brecht

Maniphest Tasks: T60361

Differential Revision: https://developer.blender.org/D4188
2019-01-10 16:07:47 +01:00
92a081ff83 Fix T60340: Removing f-curve modifier doesn't update animation 2019-01-10 16:05:16 +01:00
fc24d1a974 Keep track of owner of f-curve
This is a part of another which, which needs to tag owner
of f-curve for an update. But since this is too many lines
changed committing separately.

Basically, for f-curve AnimElement we are now storing ID
whih owns the f-curve.
2019-01-10 16:05:16 +01:00
Justin Jones
db36eff9f7 UI: make pie menus stick only when tapping key.
When holding down the key for a while, the pie menu will disappear when
releasing the key. This is under the assumption that in this case the user
decided to cancel the action.

Differential Revision: https://developer.blender.org/D4180
2019-01-10 15:55:34 +01:00
f572a157ba Fix T59913: error saving cloth preset
thx @rombout for investigation!
2019-01-10 15:53:32 +01:00
80281e34fd fix T60049: Collada Exporter: When exporting multiple UVs, the set index must start with 0 2019-01-10 13:15:20 +01:00
16b0a74228 GP: Fix unreported pixel glitches
There was a problem in the caps start and in some situations, the pixel was wrong.

Also changed the way the caps are detected because use the alpha in negative was a hack that maybe will not work with all drivers.
2019-01-10 13:13:44 +01:00
80ffa73b3f Fix T60285: allow negative offsets in shrinkwrap (worked in 2.79). 2019-01-10 12:15:20 +03:00
0f99845d2f 3D View: use faded color for dupli instance outlines
Similar to 2.7x, so instanced geometry can be differentiated.
2019-01-10 18:29:13 +11:00
5ce6b344d5 3D View: use faded color for dupli instance wire & points
Similar to 2.7x, so instanced geometry can be differentiated.
2019-01-10 18:28:53 +11:00
ca8f521971 Undo System: switch active text block when undoing 2019-01-10 14:11:07 +11:00
a44ac44c1e Fix anim_utils.bake_action typo
D4172 by @rcorre
2019-01-10 13:11:48 +11:00
11f9938eed Clenaup: remove unused EM_WAITCURSOR 2019-01-10 13:02:07 +11:00
002d0bd344 Cleanup: remove unused copy menu code
Unused since 2.4x.
2019-01-10 12:55:09 +11:00
b389bb5ef8 Cleanup: end DefNode macro w/ semicolon
Needed for clang-format.
2019-01-10 12:41:32 +11:00
0373ff5e9c Cleanup: end bgl macros w/ semicolon
Needed for clang-format.
2019-01-10 12:38:11 +11:00
1e00f91760 Fix gizmo orientation w/ shear tool 2019-01-10 12:25:09 +11:00
f974a02285 Fix T60358: popup clipping within window
Moving menu contents wasn't working properly.
2019-01-10 11:30:30 +11:00
f9d14ceb40 Fix T60358: popup clipping within window
Moving menu contents wasn't working properly.
2019-01-10 11:18:18 +11:00
609d4f5c92 Fix T60354: Paint color shown when not used
Add 'has_color' check to avoid duplicated tool checks.

Also abbreviate text descriptions.
2019-01-10 10:12:23 +11:00
eb3886c7ac Cleanup: sort RNA types after ename 2019-01-10 09:58:04 +11:00
5100e4419e Cleanup: ensure header guards come first
Causes clang-format not to detect header guards,
indenting all preprocessor lines in the header.
2019-01-10 09:04:44 +11:00
5681631109 Cleanup: ensure header guards come first
Causes clang-format not to detect header guards,
indenting all preprocessor lines in the header.
2019-01-10 08:46:38 +11:00
69c8f0cc3b Merge branch 'blender2.7' 2019-01-10 08:10:50 +11:00
f87b93a567 Fix T55336: Crash w/ dyntopo sculpt 2019-01-10 08:03:25 +11:00
399fd54f88 Undo System: apply accumulation steps
Apply steps between the active and the undo state being decoded.
2019-01-10 08:03:18 +11:00
99d001a10f Fix sculpt redo failing to enable dyntopo 2019-01-10 08:03:09 +11:00
7f5bae28db Fix memfile undo decoding creating undo steps
Exiting modes shouldn't be needed since loading the new memfile
will free the old data.

Sculpt mode dynamic topology was adding undo data on exiting the mode
which isn't logical in this case and can be avoided altogether.
2019-01-10 08:02:51 +11:00
ea0abf52bf Fix T59165: Text operations fail to undo
Some undo operations encode multiple actions, now all are undone/redone.
2019-01-10 08:01:50 +11:00
60799d6fee Merge branch 'blender2.7' 2019-01-09 17:20:58 +01:00
49e3f08815 Build Environment: install clang-format for macOS / Linux.
It's already there for Windows.
2019-01-09 17:18:49 +01:00
0bb0e07e61 Fix Cycles viewport render doing some unnecessary work at the start.
In some cases it would load adaptive kernels or even start rendering
twice because the first time the scene was not fully synced yet.
2019-01-09 17:16:29 +01:00
b7fb3296c1 Fix T60300, T57774: Cycles OpenCL viewport crash with subsurface scattering. 2019-01-09 16:42:03 +01:00
513bc5954c Fix T60351: Blender crashes when using fill tool without existent keyframe 2019-01-09 16:39:07 +01:00
90e354fd7a Revert/Redo ugly rBd12b3767f81d commit (i.e. add locked sorting option to UIList).
Too many things done wrong in original rBd12b3767f81d to list them all
here, hopefully nothing bad sneaked in again this time :|

Also cleaned up a little the 'sort by name', even though (since we only
have two options by default, sort by index and by name) we can abuse it
as a binary option for now, this is not a bitflag...
2019-01-09 15:51:46 +01:00
1c42f1c5ca Fix T60324: node linking UI bugs with some shader nodes. 2019-01-09 14:35:48 +01:00
56ceaea5b5 Fix T60244: Bisect in mirror modifier doesn't work properly.
That was indeed not working properly, not at all. Except for
the basic case, but as soon as you used another object to define the
mirror plane, it would be utterly broken, in several different ways!
2019-01-09 13:28:34 +01:00
ddabad2410 Merge branch 'blender2.7' 2019-01-09 12:56:50 +01:00
1a6a80270d Cycles: Add utility to dump BVH tree as graphviz file 2019-01-09 12:14:20 +01:00
8044e5f2d7 Cycles: Make BVH wider prior to packing
This allows to do more non-trivial tree modifications to make
it more dense and more friendly for vectorization.
2019-01-09 12:14:20 +01:00
ff6ff90cbe Fix T60342: exception when creating cycles integrator or sampling preset 2019-01-09 11:58:48 +01:00
22ddd57363 Fix T60338: Allow user to input units of another system 2019-01-09 10:40:05 +01:00
06d1c2f737 Fix T55336: Crash w/ dyntopo sculpt 2019-01-09 20:27:02 +11:00
3cbe2a19df Undo System: apply accumulation steps
Apply steps between the active and the undo state being decoded.
2019-01-09 20:21:24 +11:00
ef33215bb7 Fix sculpt redo failing to enable dyntopo 2019-01-09 18:10:16 +11:00
7e6d7d53cf Fix memfile undo decoding creating undo steps
Exiting modes shouldn't be needed since loading the new memfile
will free the old data.

Sculpt mode dynamic topology was adding undo data on exiting the mode
which isn't logical in this case and can be avoided altogether.
2019-01-09 17:37:13 +11:00
9012ad155c Fix T59165: Text operations fail to undo
Some undo operations encode multiple actions, now all are undone/redone.
2019-01-09 16:08:40 +11:00
a4d21441f9 Avoid assert w/ recent sculpt changes on undo 2019-01-09 13:25:23 +11:00
4069b10be8 Fix swapped active/selected lattice vertex color 2019-01-09 13:09:03 +11:00
df8e8e5b6b UI: use keymap introspection for tooltip creation
Also support non existing keymap items which gave an error, see: T60335
2019-01-09 12:27:58 +11:00
34143a9e7a WM: add keymap.find_from_operator(...) 2019-01-09 12:26:10 +11:00
d615203342 Fix IS_EVENT_ACTIONZONE macro
Caused tweak events not to display.
2019-01-09 12:22:32 +11:00
3c3d80ea22 Assert: add check to last commit 2019-01-09 10:33:36 +11:00
b536d1b95f Object Mode: only toggle active object mode once
- When toggling a mode that doesn't support multi editing
  only do this once of the active object.

- For sculpt mode create sculpt data since this is needed
  for activating other sculpt objects on reload.
2019-01-09 10:21:51 +11:00
1b6b0fbd95 Fix T60044: Sculpting brush is not visible
Same logic as fix from D4153, but only applied when running undo.
2019-01-09 09:12:57 +11:00
Dalai Felinto
583c321334 Revert "Fix T60044: Sculpting brush is not visible on file load"
This reverts commit 4d8ed937f2.

An alternative fix will come soon as a patch, since this introduced an issue.
Rolling back since the original fix (sculpt cursor on load) is less important
than the issue it introduced (crash on weight paint undo/redo).

Fix T60322.
2019-01-08 18:31:36 -02:00
12e9d52882 Fix T60327: Value input with adaptive imperial units not working properly 2019-01-08 19:20:56 +01:00
ae2af46920 Fix inconsistent naming and behavior for base visible/selected/editable.
Fixes T60251.
2019-01-08 18:50:44 +01:00
b486088218 Fix T60320: Cycles OpenCL volume rendering error on some drivers. 2019-01-08 15:59:10 +01:00
8491dba0c6 Fix T60300: Cycles SSS render hanging with AMD OpenCL. 2019-01-08 15:37:16 +01:00
54985ab5f5 Quick Explode: replace BI based material handling (using 'fade'/'blend')
using a simple shader graph mixing Transparent BSDF now

Fixes T59185

Reviewers: brecht

Maniphest Tasks: T59185

Differential Revision: https://developer.blender.org/D4181
2019-01-08 15:35:06 +01:00
4b55945da6 Quick Explode: use keyword argument 2019-01-08 15:32:45 +01:00
369e1d46f0 Fix T56545: Material referencing missing UV crash 2019-01-09 01:05:43 +11:00
22474062b1 Fix T58479: Quick Favorites Lets you add multiple of the same item
Reviewers: brecht

Maniphest Tasks: T58479

Differential Revision: https://developer.blender.org/D4135
2019-01-08 14:47:05 +01:00
24a84c4742 Fix T60314: Missing strength w/ weight gradient 2019-01-08 23:49:58 +11:00
395120ed72 Typo fixes 2019-01-09 01:41:58 +13:00
9d4ed6d03b Fix T59984: Drivers don't update values in UI or show proper errors
We now perform COW -> original data flushing for all the debug values + error
status flags on Drivers/DriverVariables/DriverTargets, as these are only set
when errors are encountered when evaluating drivers.
2019-01-09 01:41:58 +13:00
b4bb9d59ee Fix T59450: brush colors flip inactive w/ texture paint 2019-01-08 23:25:36 +11:00
152c965b75 Fix T60263: render layer node sockets not showing on file load, for some files. 2019-01-08 13:21:39 +01:00
f9cefc4d17 Fix T60291: Wrong tooltip in for Add Cube tool 2019-01-08 12:24:51 +01:00
ef818009e0 Fix T60306: Circle select tool behaves like a mode 2019-01-08 22:15:00 +11:00
e11bb77f31 Properly clean up Python when exiting due to --python-exit-code
When BPY_python_end() is not called, there can be buffered data still in
`sys.stdout` or `sys.stderr`. This generally isn't an issue when those are
connected to a terminal, but when they are read by another process (in the case
of rendering with Flamenco, for example) we could miss the actual error message
that's causing the exit in the first place.

The following script demonstrates the issue; before this commit neither the
writes to STDERR and STDOUT nor the traceback of the NameError were shown.

    #!/bin/bash

    cat > file-with-errors.py <<EOT
    import sys
    print('THIS IS STDERR', file=sys.stderr)
    print('THIS IS STDOUT', file=sys.stdout)
    nonexisting.monkey = 3
    EOT

    blender --enable-autoexec -noaudio --background \
	any-existing-blendfile.blend \
	--python-exit-code 42 \
	--python file-with-errors.py 2>&1 | cat

Reviewers: campbellbarton, mont29

Reviewed By: campbellbarton, mont29

Subscribers: fsiddi

Differential Revision: https://developer.blender.org/D4168
2019-01-08 12:00:18 +01:00
68b4c57ba5 Merge branch 'blender2.7' 2019-01-08 11:47:35 +01:00
1e386d98ce Make DNA and RNA errors more meaningful and friendly 2019-01-08 11:43:15 +01:00
f2d2bafe85 fix rotational limits not showing for GENERIC ridgid body constraint
oversight in rB502aabb9d0c5

part of T60290
2019-01-08 10:21:26 +01:00
859a4dd51b Fix workbench shading pie menu
Expand the enum since it's dynamic, depending on the render engine.
2019-01-08 17:17:52 +11:00
a0d456daf8 Vertex Paint: support vertex masking
Working in 2.7x, was just disabled in 2.8x.

Fixes T60256
2019-01-08 15:18:28 +11:00
91a155833e Cleanup: comments causing bad clang-format output 2019-01-08 10:37:43 +11:00
3d2ff33c26 Fix T60167: wrong shader nodes in Eevee add menu. 2019-01-07 17:32:40 +01:00
b2a0ffc95f Fix bad enum value since 299ff7dcd1
This is why out-sourcing things to a production-tested formatters
is a very very good idea.
2019-01-07 17:18:33 +01:00
8e35a968c5 Subdiv: Use defined order of corner/edge vertices
This switches evaluation of vertices which are on the boundaries
of PTex faces to a single threaded one. While this introduces
some slowdown it fixes ambiguity of PTex index used to evaluate
particular vertex.

Possible alternative solutions would be:
- Do some pre-calculation of index, then do evaluation in threads.
- Try using Gregory patches and see if that makes any affect.

Fix T60235: Flickering of object instances
2019-01-07 17:14:19 +01:00
e637e8dcc6 Subdiv: Move single threaded code to a single function
Allows to more easily add more passes which are supposed to be run
from a single thread.
2019-01-07 17:14:19 +01:00
1b15eb7e71 Subdiv: Cleanup, de-duplicate code 2019-01-07 17:14:19 +01:00
0218268546 GP: Hide Options and Curves popovers for Fill brushes 2019-01-07 16:22:48 +01:00
43a2a73fdb Fix missing updates when muting/soloing/reordering NLA tracks. 2019-01-07 17:35:51 +03:00
299ff7dcd1 Cleanup: corrections to last commit 2019-01-08 01:00:40 +11:00
5a43406e1b Cleanup: move DNA comments before struct members
Needed for clang-format in some cases, see: T53211
2019-01-08 00:43:00 +11:00
0215caeac2 Cleanup: fix typo. 2019-01-07 14:30:45 +01:00
b786416106 Fix T59151 Bevel modifier has bad input width for percent.
The units scaling was inappropriate when the bevel value was
to be interpreted as a percent, so added a separate rna property
for "Width Percent" and made UI show the width appropriate for
current offset_type.
2019-01-07 07:29:54 -05:00
f19b3f9b77 OpenSundiv: Simplify tweaking of shared stencil/patch settings 2019-01-07 10:33:40 +01:00
cfeffa7529 Fix T60247: app.handlers.undo_post calls undo_pre's function.
Undo and redo post were actually calling respective pre funcs...
2019-01-07 09:53:46 +01:00
6015a03255 Cleanup: naming for return args 2019-01-07 15:34:16 +11:00
07287ceda1 Fix T58964: drivers_remove fails w/ missing paths 2019-01-07 15:27:59 +11:00
abe32d2a35 PyAPI: Add AnimationData.drivers.new/remove methods
Low level functions to directly create and remove drivers,
use when high level functions aren't flexible enough, see: T58964.
2019-01-07 14:06:36 +11:00
96f762500e Cleanup: tweak last commit 2019-01-07 11:16:11 +11:00
430cf7e15e Fix generated toolbar keymap w/ annotation tool 2019-01-07 11:00:46 +11:00
Sebastian Parborg
8c0a77b894 Fix T59944: Template operator_mesh_uv.py fails 2019-01-07 10:21:23 +11:00
496f6adce2 Better bevel normal hardening when some faces were smooth.
Harden normals causes normal splitting, which will not give the
appearance expected due to autosmooth unless some edges are sharpened,
so this change fixes that. Also bevel tool will turn on autosmooth
if not already on if hardening normals.
2019-01-06 18:12:00 -05:00
b4a77a351e Cleanup: add trailing commas to structs 2019-01-07 09:15:07 +11:00
d5c24f2030 Correct error in recent button type check 2019-01-07 09:15:07 +11:00
aa6946f6c9 UI: Use grid-flow layout throughout Preferences
Makes the entire Preferences UI nicely width responsive. Also, move
use_tabs_as_spaces option back to file path options, it was too lonely
in its own panel ;)
2019-01-06 21:53:58 +01:00
2edd32c168 Fix typo. 2019-01-06 18:21:57 +01:00
e7d8b945ce GP: Fix missing initialization converting 2.7 files 2019-01-06 17:22:03 +01:00
eb55990777 Fix T60213: crash loading .blend file with material override. 2019-01-06 15:24:02 +01:00
53d6f40760 UI: tweaks to user preferences layout.
* Expand more sub-panels by default.
* Move release confirms and numeric input settings to Input.
* Move 3D cursor settings to Editing.
* Move region overlap to Interface.
2019-01-06 15:24:01 +01:00
e305560f13 Cleanup: add trailing commas to structs
Needed for clang formatting to workaround bug/limit, see: T53211
2019-01-07 00:34:48 +11:00
f10a88ae8d object.dimensions: add warning about multiple consecutive assignments.
Since this is API-only prop now, it's worth warning about that
limitation.

Follow-up to comments in rB9c928bb93e04.
2019-01-06 13:11:31 +01:00
6c7762687e Fix T60187: Latest couple of builds fail to run, need libGLX.so.0 2019-01-06 11:51:38 +01:00
937a7e8cc2 UI: tweak preferences
- Move author to save&load
  (was incorrectly under text editor).
- Rename Memory -> Memory/Limits
  (some of the settings aren't obviously todo with memory).
2019-01-06 20:41:03 +11:00
a153f7628e Cleanup: style, line length 2019-01-06 20:27:35 +11:00
4b7596ec91 fix T59743: Collada exporter: Add option for exporting flat curves
The Collada exporter suppresses the export of flat animation curves
to optimize the animation (in fact to make the exported file smaller).

But sometimes it is important to also have the flat curves exported
because they may be needed to define an initial transformation to
a fixed location - like translating the weapon from the ground floor
to the back of the model in the report.

I added a new option "all keyed curves" which is disabled by default
but when enabled it also exports flat curves.

feedback is very welcome
2019-01-05 21:52:41 +01:00
Julian Eisel
e8d4304b55 Correct version patching of Preferences theme
In a77b63c569, the Preferences navigation region background was
made brighter. Recently stored userpref.blends (since b00963afc1,
so beta release included) would still use the slightly darker
background for the Preferences navigation region.
Now the version patch added for a77b63c569 also sets the new color
for those recent configs.
2019-01-05 19:53:47 +01:00
674d364af0 fix T60092 collada exporter: exporting a rig with one single bone fails
The problem was that removing entries from a vetor while iterating
the vector was implemented badly. This caused the failure when only
one element was in vector.
2019-01-05 18:08:10 +01:00
9c928bb93e Fix T60183: Images as Planes (addon) Attribute Error.
Partially revert rB1b8c3774a86ebc04fceb9cd, there is no good reason to
make object.dimensions read-only, it works perfectly well from python
API! Only breaking case was that weird multi-editing UI feature, due to
how it sets things. But RNA setter itself works fine, and it's a handy
shortcut/helper for scripts.

Also when breaking API, it is good practivce to at least check official
add-ons...
2019-01-05 16:33:38 +01:00
1461d0185c Theme: update 2019-01-05 21:32:38 +11:00
95736683a9 UI: length now scales proportionally w/ multi-but
Use for object dimensions.
2019-01-05 20:09:25 +11:00
16f49f81dd Cleanup: 3d view panel median value storage 2019-01-05 19:56:20 +11:00
a2120001a8 Cleanup: avoid function call for pointer compare 2019-01-05 19:56:15 +11:00
57d4b869be NLA: rewrite evaluation channel data structures.
Implementing a new intelligent mixing mode that combines quaternions
via multiplication requires rewriting the NLA code to recombine array
properties from separate scalar channels during evaluation.

In addition, stable evaluation of NLA stack requires that any channel
that is touched by any of the actions in the stack should always be
set to a definite value by evaluation, even if no strip affects it
at this point of the timeline. The obvious choice for the fallback
is the default value of the property.

To make scanning all actions reasonably efficient, mapping paths to
channels should be done using hash tables.

Differential Revision: https://developer.blender.org/D4120
2019-01-05 10:52:43 +03:00
Severin
a77b63c569 UI: Preferences Redesign Part 2
(Part 1 was 00963afc14978b)

Does the following changes visible to users:
* Use panels and sub-panels for more structured & logical grouping
* Re-organized options more logically than before (see images in D4148)
* Use flow layout (single column by default).
* New layout uses horizontal margin if there's enough space.
* Change size of Preferences window to suit new layout.
* Move keymap related options from "Input" into own section.
* Own, left-bottom aligned region for Save Preferences button.
* Adjustments of names, tooltips & icons.
* Move buttons from header into the main region (except editor switch).
* Hide Preferences header when opened in temporary window.
* Use full area width for header.
* Don't use slider but regular number widget for UI scale.
* Gray out animation player path option if player isn't "Custom"

Internal changes:
* Rearrange RNA properties to match changed UI structure.
* Introduces new "EXECUTE" region type, see reasoning in D3982.
* Changes to panel layout and AZone code for dynamic panel region.
* Bumps subversion and does versioning for new regions.

RNA changes are documented in the release notes:
https://wiki.blender.org/wiki/Reference/Release_Notes/2.80/Python_API/Preferences_API

Design & implementation mostly done by @billreynish and myself.
I recommend checking out the screenshots posted by William:
https://developer.blender.org/D4148#93787

Reviewed By: brecht

Maniphest Tasks: T54115

Differential Revision: https://developer.blender.org/D4148
2019-01-04 22:18:23 +01:00
4356 changed files with 79248 additions and 94382 deletions

4
.gitignore vendored
View File

@@ -11,6 +11,10 @@ __pycache__/
*.swo
*#
# Indexes for emacs, vi & others
TAGS
tags
# QtCreator
CMakeLists.txt.user

View File

@@ -16,11 +16,6 @@
#
# The Original Code is Copyright (C) 2006, Blender Foundation
# All rights reserved.
#
# The Original Code is: all of this file.
#
# Contributor(s): Jacques Beaurain.
#
# ***** END GPL LICENSE BLOCK *****
#-----------------------------------------------------------------------------
@@ -411,7 +406,7 @@ option(WITH_CYCLES_CUDA_BINARIES "Build Cycles CUDA binaries" OFF)
option(WITH_CYCLES_CUBIN_COMPILER "Build cubins with nvrtc based compiler instead of nvcc" OFF)
option(WITH_CYCLES_CUDA_BUILD_SERIAL "Build cubins one after another (useful on machines with limited RAM)" OFF)
mark_as_advanced(WITH_CYCLES_CUDA_BUILD_SERIAL)
set(CYCLES_CUDA_BINARIES_ARCH sm_30 sm_35 sm_37 sm_50 sm_52 sm_60 sm_61 sm_70 sm_72 sm_75 CACHE STRING "CUDA architectures to build binaries for")
set(CYCLES_CUDA_BINARIES_ARCH sm_30 sm_35 sm_37 sm_50 sm_52 sm_60 sm_61 sm_70 sm_75 CACHE STRING "CUDA architectures to build binaries for")
mark_as_advanced(CYCLES_CUDA_BINARIES_ARCH)
unset(PLATFORM_DEFAULT)
option(WITH_CYCLES_LOGGING "Build Cycles with logging support" ON)
@@ -763,8 +758,8 @@ if(WITH_PYTHON)
# Do this before main 'platform_*' checks,
# because UNIX will search for the old Python paths which may not exist.
# giving errors about missing paths before this case is met.
if(DEFINED PYTHON_VERSION AND "${PYTHON_VERSION}" VERSION_LESS "3.6")
message(FATAL_ERROR "At least Python 3.6 is required to build")
if(DEFINED PYTHON_VERSION AND "${PYTHON_VERSION}" VERSION_LESS "3.7")
message(FATAL_ERROR "At least Python 3.7 is required to build")
endif()
if(NOT EXISTS "${CMAKE_SOURCE_DIR}/release/scripts/addons/modules")
@@ -1058,7 +1053,7 @@ if(WITH_GL_PROFILE_ES20)
else()
if(OpenGL_GL_PREFERENCE STREQUAL "LEGACY" AND OPENGL_gl_LIBRARY)
list(APPEND BLENDER_GL_LIBRARIES ${OPENGL_gl_LIBRARY} ${OPENGL_glx_LIBRARY})
list(APPEND BLENDER_GL_LIBRARIES ${OPENGL_gl_LIBRARY})
else()
list(APPEND BLENDER_GL_LIBRARIES ${OPENGL_opengl_LIBRARY} ${OPENGL_glx_LIBRARY})
endif()
@@ -1122,7 +1117,10 @@ endif()
#-----------------------------------------------------------------------------
# Configure OpenMP.
if(WITH_OPENMP)
find_package(OpenMP)
if(NOT OPENMP_CUSTOM)
find_package(OpenMP)
endif()
if(OPENMP_FOUND)
if(NOT WITH_OPENMP_STATIC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")

View File

@@ -24,11 +24,133 @@
# ../build_linux_i386
# This is for users who like to configure & build blender with a single command.
define HELP_TEXT
Convenience Targets
Provided for building Blender, (multiple at once can be used).
* debug: Build a debug binary.
* full: Enable all supported dependencies & options.
* lite: Disable non essential features for a smaller binary and faster build.
* headless: Build without an interface (renderfarm or server automation).
* cycles: Build Cycles standalone only, without Blender.
* bpy: Build as a python module which can be loaded from python directly.
* deps: Build library dependencies (intended only for platform maintainers).
* config: Run cmake configuration tool to set build options.
Note: passing the argument 'BUILD_DIR=path' when calling make will override the default build dir.
Note: passing the argument 'BUILD_CMAKE_ARGS=args' lets you add cmake arguments.
Project Files
Generate poject files for development environments.
* project_qtcreator: QtCreator Project Files.
* project_netbeans: NetBeans Project Files.
* project_eclipse: Eclipse CDT4 Project Files.
Package Targets
* package_debian: Build a debian package.
* package_pacman: Build an arch linux pacman package.
* package_archive: Build an archive package.
Testing Targets
Not associated with building Blender.
* test:
Run ctest, currently tests import/export,
operator execution and that python modules load
* test_cmake:
Runs our own cmake file checker
which detects errors in the cmake file list definitions
* test_pep8:
Checks all python script are pep8
which are tagged to use the stricter formatting
* test_deprecated:
Checks for deprecation tags in our code which may need to be removed
* test_style_c:
Checks C/C++ conforms with blenders style guide:
https://wiki.blender.org/wiki/Source/Code_Style
* test_style_c_qtc:
Same as test_style but outputs QtCreator tasks format
* test_style_osl:
Checks OpenShadingLanguage conforms with blenders style guide:
https://wiki.blender.org/wiki/Source/Code_Style
* test_style_osl_qtc:
Checks OpenShadingLanguage conforms with blenders style guide:
https://wiki.blender.org/wiki/Source/Code_Style
Static Source Code Checking
Not associated with building Blender.
* check_cppcheck: Run blender source through cppcheck (C & C++).
* check_clang_array: Run blender source through clang array checking script (C & C++).
* check_splint: Run blenders source through splint (C only).
* check_sparse: Run blenders source through sparse (C only).
* check_smatch: Run blenders source through smatch (C only).
* check_spelling_c: Check for spelling errors (C/C++ only).
* check_spelling_c_qtc: Same as check_spelling_c but outputs QtCreator tasks format.
* check_spelling_osl: Check for spelling errors (OSL only).
* check_spelling_py: Check for spelling errors (Python only).
* check_descriptions: Check for duplicate/invalid descriptions.
Utilities
Not associated with building Blender.
* icons:
Updates PNG icons from SVG files.
Optionally pass in variables: 'BLENDER_BIN', 'INKSCAPE_BIN'
otherwise default paths are used.
Example
make icons INKSCAPE_BIN=/path/to/inkscape
* icons_geom:
Updates Geometry icons from BLEND file.
Optionally pass in variable: 'BLENDER_BIN'
otherwise default paths are used.
Example
make icons_geom BLENDER_BIN=/path/to/blender
* tgz:
Create a compressed archive of the source code.
* update:
updates git and all submodules
Environment Variables
* BUILD_CMAKE_ARGS: Arguments passed to CMake.
* BUILD_DIR: Override default build path.
* PYTHON: Use this for the Python command (used for checking tools).
* NPROCS: Number of processes to use building (auto-detect when omitted).
Documentation Targets
Not associated with building Blender.
* doc_py: Generate sphinx python api docs.
* doc_doxy: Generate doxygen C/C++ docs.
* doc_dna: Generate blender file format reference.
* doc_man: Generate manpage.
Information
* help: This help message.
* help_features: Show a list of optional features when building.
endef
# HELP_TEXT (end)
# System Vars
OS:=$(shell uname -s)
OS_NCASE:=$(shell uname -s | tr '[A-Z]' '[a-z]')
# CPU:=$(shell uname -m) # UNUSED
CPU:=$(shell uname -m)
# Source and Build DIR's
@@ -55,7 +177,7 @@ ifndef DEPS_INSTALL_DIR
ifneq ($(OS_NCASE),darwin)
# Add processor type to directory name
DEPS_INSTALL_DIR:=$(DEPS_INSTALL_DIR)_$(shell uname -p)
DEPS_INSTALL_DIR:=$(DEPS_INSTALL_DIR)_$(CPU)
endif
endif
@@ -98,10 +220,12 @@ endif
# -----------------------------------------------------------------------------
# Blender binary path
# Allow passing in own BLENDER_BIN so developers who don't
# use the default build path can still use utility helpers.
ifeq ($(OS), Darwin)
BLENDER_BIN="$(BUILD_DIR)/bin/blender.app/Contents/MacOS/blender"
BLENDER_BIN?="$(BUILD_DIR)/bin/blender.app/Contents/MacOS/blender"
else
BLENDER_BIN="$(BUILD_DIR)/bin/blender"
BLENDER_BIN?="$(BUILD_DIR)/bin/blender"
endif
@@ -196,87 +320,9 @@ config: .FORCE
# -----------------------------------------------------------------------------
# Help for build targets
export HELP_TEXT
help: .FORCE
@echo ""
@echo "Convenience targets provided for building blender, (multiple at once can be used)"
@echo " * debug - build a debug binary"
@echo " * full - enable all supported dependencies & options"
@echo " * lite - disable non essential features for a smaller binary and faster build"
@echo " * headless - build without an interface (renderfarm or server automation)"
@echo " * cycles - build Cycles standalone only, without Blender"
@echo " * bpy - build as a python module which can be loaded from python directly"
@echo " * deps - build library dependencies (intended only for platform maintainers)"
@echo ""
@echo " * config - run cmake configuration tool to set build options"
@echo ""
@echo " Note, passing the argument 'BUILD_DIR=path' when calling make will override the default build dir."
@echo " Note, passing the argument 'BUILD_CMAKE_ARGS=args' lets you add cmake arguments."
@echo ""
@echo ""
@echo "Project Files for IDE's"
@echo " * project_qtcreator - QtCreator Project Files"
@echo " * project_netbeans - NetBeans Project Files"
@echo " * project_eclipse - Eclipse CDT4 Project Files"
@echo ""
@echo "Package Targets"
@echo " * package_debian - build a debian package"
@echo " * package_pacman - build an arch linux pacman package"
@echo " * package_archive - build an archive package"
@echo ""
@echo "Testing Targets (not associated with building blender)"
@echo " * test - run ctest, currently tests import/export,"
@echo " operator execution and that python modules load"
@echo " * test_cmake - runs our own cmake file checker"
@echo " which detects errors in the cmake file list definitions"
@echo " * test_pep8 - checks all python script are pep8"
@echo " which are tagged to use the stricter formatting"
@echo " * test_deprecated - checks for deprecation tags in our code which may need to be removed"
@echo " * test_style_c - checks C/C++ conforms with blenders style guide:"
@echo " https://wiki.blender.org/wiki/Source/Code_Style"
@echo " * test_style_c_qtc - same as test_style but outputs QtCreator tasks format"
@echo " * test_style_osl - checks OpenShadingLanguage conforms with blenders style guide:"
@echo " https://wiki.blender.org/wiki/Source/Code_Style"
@echo " * test_style_osl_qtc - checks OpenShadingLanguage conforms with blenders style guide:"
@echo " https://wiki.blender.org/wiki/Source/Code_Style"
@echo ""
@echo "Static Source Code Checking (not associated with building blender)"
@echo " * check_cppcheck - run blender source through cppcheck (C & C++)"
@echo " * check_clang_array - run blender source through clang array checking script (C & C++)"
@echo " * check_splint - run blenders source through splint (C only)"
@echo " * check_sparse - run blenders source through sparse (C only)"
@echo " * check_smatch - run blenders source through smatch (C only)"
@echo " * check_spelling_c - check for spelling errors (C/C++ only)"
@echo " * check_spelling_c_qtc - same as check_spelling_c but outputs QtCreator tasks format"
@echo " * check_spelling_osl - check for spelling errors (OSL only)"
@echo " * check_spelling_py - check for spelling errors (Python only)"
@echo " * check_descriptions - check for duplicate/invalid descriptions"
@echo ""
@echo "Utilities (not associated with building blender)"
@echo " * icons - Updates PNG icons from SVG files."
@echo " Set environment variables 'BLENDER_BIN' and 'INKSCAPE_BIN'"
@echo " to define your own commands."
@echo " * icons_geom - Updates Geometry icons from BLEND file."
@echo " Set environment variable 'BLENDER_BIN'"
@echo " to define your own command."
@echo " * tgz - create a compressed archive of the source code."
@echo " * update - updates git and all submodules"
@echo ""
@echo "Environment Variables"
@echo " * BUILD_CMAKE_ARGS - arguments passed to CMake."
@echo " * BUILD_DIR - override default build path."
@echo " * PYTHON - use this for the Python command (used for checking tools)."
@echo " * NPROCS - number of processes to use building (auto-detect when omitted)."
@echo ""
@echo "Documentation Targets (not associated with building blender)"
@echo " * doc_py - generate sphinx python api docs"
@echo " * doc_doxy - generate doxygen C/C++ docs"
@echo " * doc_dna - generate blender file format reference"
@echo " * doc_man - generate manpage"
@echo ""
@echo "Information"
@echo " * help - this help message"
@echo " * help_features - show a list of optional features when building"
@echo ""
@echo "$$HELP_TEXT"
# -----------------------------------------------------------------------------
# Packages
@@ -440,9 +486,12 @@ check_descriptions: .FORCE
tgz: .FORCE
./build_files/utils/build_tgz.sh
INKSCAPE_BIN?="inkscape"
icons: .FORCE
"$(BLENDER_DIR)/release/datafiles/blender_icons_update.py"
"$(BLENDER_DIR)/release/datafiles/prvicons_update.py"
BLENDER_BIN=$(BLENDER_BIN) INKSCAPE_BIN=$(INKSCAPE_BIN) \
"$(BLENDER_DIR)/release/datafiles/blender_icons_update.py"
BLENDER_BIN=$(BLENDER_BIN) INKSCAPE_BIN=$(INKSCAPE_BIN) \
"$(BLENDER_DIR)/release/datafiles/prvicons_update.py"
icons_geom: .FORCE
BLENDER_BIN=$(BLENDER_BIN) \

View File

@@ -114,7 +114,7 @@ endif()
if(NOT WIN32 OR ENABLE_MINGW64)
include(cmake/openjpeg.cmake)
if(BUILD_MODE STREQUAL Release)
if(NOT WIN32 OR BUILD_MODE STREQUAL Release)
if(WIN32)
include(cmake/zlib_mingw.cmake)
endif()

View File

@@ -102,7 +102,6 @@ function(harvest from to)
FILES_MATCHING PATTERN ${pattern}
PATTERN "pkgconfig" EXCLUDE
PATTERN "cmake" EXCLUDE
PATTERN "clang" EXCLUDE
PATTERN "__pycache__" EXCLUDE
PATTERN "tests" EXCLUDE)
endif()
@@ -129,8 +128,13 @@ harvest(jemalloc/lib jemalloc/lib "*.a")
harvest(jpg/include jpeg/include "*.h")
harvest(jpg/lib jpeg/lib "libjpeg.a")
harvest(lame/lib ffmpeg/lib "*.a")
harvest(clang/bin llvm/bin "clang-format")
harvest(llvm/bin llvm/bin "llvm-config")
harvest(llvm/lib llvm/lib "libLLVM*.a")
if(APPLE)
harvest(openmp/lib openmp/lib "*")
harvest(openmp/include openmp/include "*.h")
endif()
harvest(ogg/lib ffmpeg/lib "*.a")
harvest(openal/include openal/include "*.h")
if(UNIX AND NOT APPLE)

View File

@@ -23,7 +23,8 @@ ExternalProject_Add(external_openmp
URL_HASH MD5=${OPENMP_HASH}
PREFIX ${BUILD_DIR}/openmp
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openmp ${DEFAULT_CMAKE_FLAGS}
INSTALL_DIR ${LIBDIR}/clang
INSTALL_COMMAND cd ${BUILD_DIR}/openmp/src/external_openmp-build && install_name_tool -id @executable_path/../Resources/lib/libomp.dylib runtime/src/libomp.dylib && make install
INSTALL_DIR ${LIBDIR}/openmp
)
add_dependencies(

View File

@@ -127,8 +127,7 @@ else()
)
set(OSX_ARCHITECTURES x86_64)
set(OSX_DEPLOYMENT_TARGET 10.9)
set(OSX_SDK_VERSION 10.13)
set(OSX_SYSROOT ${XCODE_DEV_PATH}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX${OSX_SDK_VERSION}.sdk)
set(OSX_SYSROOT ${XCODE_DEV_PATH}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk)
set(PLATFORM_CFLAGS "-isysroot ${OSX_SYSROOT} -mmacosx-version-min=${OSX_DEPLOYMENT_TARGET}")
set(PLATFORM_CXXFLAGS "-isysroot ${OSX_SYSROOT} -mmacosx-version-min=${OSX_DEPLOYMENT_TARGET} -std=c++11 -stdlib=libc++")

View File

@@ -36,7 +36,7 @@ add_dependencies(
external_zlib
)
if(BUILD_MODE STREQUAL Debug)
if(WIN32 AND BUILD_MODE STREQUAL Debug)
ExternalProject_Add_Step(external_png after_install
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/png/lib/libpng16_staticd${LIBEXT} ${LIBDIR}/png/lib/libpng16${LIBEXT}
DEPENDEES install

View File

@@ -17,7 +17,6 @@
# ***** END GPL LICENSE BLOCK *****
if(WIN32)
set(PTHREAD_XCFLAGS /MD)
if(MSVC14) # vs2015 has timespec
set(PTHREAD_CPPFLAGS "/I. /DHAVE_CONFIG_H /D_TIMESPEC_DEFINED ")
@@ -25,7 +24,7 @@ if(WIN32)
set(PTHREAD_CPPFLAGS "/I. /DHAVE_CONFIG_H ")
endif()
set(PTHREADS_BUILD cd ${BUILD_DIR}/pthreads/src/external_pthreads/ && cd && nmake VC /e CPPFLAGS=${PTHREAD_CPPFLAGS} /e XCFLAGS=${PTHREAD_XCFLAGS} /e XLIBS=/NODEFAULTLIB:msvcr)
set(PTHREADS_BUILD cd ${BUILD_DIR}/pthreads/src/external_pthreads/ && cd && nmake VC-static /e CPPFLAGS=${PTHREAD_CPPFLAGS} /e XLIBS=/NODEFAULTLIB:msvcr)
ExternalProject_Add(external_pthreads
URL ${PTHREADS_URI}
@@ -35,8 +34,7 @@ if(WIN32)
CONFIGURE_COMMAND echo .
BUILD_COMMAND ${PTHREADS_BUILD}
INSTALL_COMMAND COMMAND
${CMAKE_COMMAND} -E copy ${BUILD_DIR}/pthreads/src/external_pthreads/pthreadVC3.dll ${LIBDIR}/pthreads/lib/pthreadVC3.dll &&
${CMAKE_COMMAND} -E copy ${BUILD_DIR}/pthreads/src/external_pthreads/pthreadVC3${LIBEXT} ${LIBDIR}/pthreads/lib/pthreadVC3${LIBEXT} &&
${CMAKE_COMMAND} -E copy ${BUILD_DIR}/pthreads/src/external_pthreads/libpthreadVC3${LIBEXT} ${LIBDIR}/pthreads/lib/pthreadVC3${LIBEXT} &&
${CMAKE_COMMAND} -E copy ${BUILD_DIR}/pthreads/src/external_pthreads/pthread.h ${LIBDIR}/pthreads/inc/pthread.h &&
${CMAKE_COMMAND} -E copy ${BUILD_DIR}/pthreads/src/external_pthreads/sched.h ${LIBDIR}/pthreads/inc/sched.h &&
${CMAKE_COMMAND} -E copy ${BUILD_DIR}/pthreads/src/external_pthreads/semaphore.h ${LIBDIR}/pthreads/inc/semaphore.h &&

View File

@@ -39,7 +39,7 @@ add_dependencies(
external_zlib
)
if(BUILD_MODE STREQUAL Debug)
if(WIN32 AND BUILD_MODE STREQUAL Debug)
ExternalProject_Add_Step(external_tiff after_install
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tiff/lib/tiffd${LIBEXT} ${LIBDIR}/tiff/lib/tiff${LIBEXT}
DEPENDEES install

View File

@@ -40,16 +40,8 @@ if (WIN32)
)
endif()
else()
if(BUILD_MODE STREQUAL Debug)
ExternalProject_Add_Step(external_zlib after_install
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/zlib/lib/zlibstaticd${LIBEXT} ${LIBDIR}/zlib/lib/${ZLIB_LIBRARY}
DEPENDEES install
)
endif()
if (UNIX)
ExternalProject_Add_Step(external_zlib after_install
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/zlib/lib/libz.a ${LIBDIR}/zlib/lib/libz_pic.a
DEPENDEES install
)
endif()
ExternalProject_Add_Step(external_zlib after_install
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/zlib/lib/libz.a ${LIBDIR}/zlib/lib/libz_pic.a
DEPENDEES install
)
endif()

View File

@@ -1,4 +1,3 @@
#
# VLMC RPM Finder
# Authors: Rohit Yadav <rohityadav89@gmail.com>
#

View File

@@ -16,8 +16,6 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# Contributor(s): Campbell Barton
#
# ***** END GPL LICENSE BLOCK *****
# <pep8 compliant>

View File

@@ -16,8 +16,6 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# Contributor(s): Campbell Barton, M.G. Kishalmi
#
# ***** END GPL LICENSE BLOCK *****
# <pep8 compliant>

View File

@@ -16,8 +16,6 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# Contributor(s): Campbell Barton, M.G. Kishalmi
#
# ***** END GPL LICENSE BLOCK *****
# <pep8 compliant>

View File

@@ -16,8 +16,6 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# Contributor(s): Campbell Barton
#
# ***** END GPL LICENSE BLOCK *****
# <pep8 compliant>

View File

@@ -16,8 +16,6 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# Contributor(s): Campbell Barton
#
# ***** END GPL LICENSE BLOCK *****
# <pep8 compliant>

View File

@@ -16,8 +16,6 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# Contributor(s): Campbell Barton
#
# ***** END GPL LICENSE BLOCK *****
# <pep8 compliant>

View File

@@ -16,8 +16,6 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# Contributor(s): Campbell Barton
#
# ***** END GPL LICENSE BLOCK *****
# <pep8 compliant>

View File

@@ -16,8 +16,6 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# Contributor(s): Campbell Barton
#
# ***** END GPL LICENSE BLOCK *****
# <pep8 compliant>

View File

@@ -52,7 +52,7 @@ set(WITH_X11_XF86VMODE ON CACHE BOOL "" FORCE)
set(WITH_MEM_JEMALLOC ON CACHE BOOL "" FORCE)
set(WITH_CYCLES_CUDA_BINARIES ON CACHE BOOL "" FORCE)
set(CYCLES_CUDA_BINARIES_ARCH sm_30;sm_35;sm_37;sm_50;sm_52;sm_60;sm_61;sm_70;sm_72;sm_75 CACHE STRING "" FORCE)
set(CYCLES_CUDA_BINARIES_ARCH sm_30;sm_35;sm_37;sm_50;sm_52;sm_60;sm_61;sm_70;sm_75 CACHE STRING "" FORCE)
# platform dependent options
if(UNIX AND NOT APPLE)

View File

@@ -1,10 +0,0 @@
#!/bin/bash
# filters CMake output to be more like nan-makefiles
FILTER="^\[ *[0-9]*%] \|^Built target \|^Scanning "
make $@ | \
sed -u -e 's/^Linking .*\//Linking /' | \
sed -u -e 's/^.*\// /' | \
grep --line-buffered -v "$FILTER"
echo "Build Done"

View File

@@ -16,11 +16,6 @@
#
# The Original Code is Copyright (C) 2006, Blender Foundation
# All rights reserved.
#
# The Original Code is: all of this file.
#
# Contributor(s): Jacques Beaurain.
#
# ***** END GPL LICENSE BLOCK *****
macro(list_insert_after
@@ -1398,7 +1393,7 @@ function(find_python_package
NO_DEFAULT_PATH
)
if(NOT EXISTS "${PYTHON_${_upper_package}_PATH}")
if(NOT EXISTS "${PYTHON_${_upper_package}_PATH}")
message(WARNING
"Python package '${package}' path could not be found in:\n"
"'${PYTHON_LIBPATH}/python${PYTHON_VERSION}/site-packages/${package}', "

View File

@@ -16,9 +16,6 @@
#
# The Original Code is Copyright (C) 2016, Blender Foundation
# All rights reserved.
#
# Contributor(s): Sergey Sharybin.
#
# ***** END GPL LICENSE BLOCK *****
# Libraries configuration for Apple.
@@ -385,13 +382,27 @@ if(WITH_CYCLES_EMBREE)
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Xlinker -stack_size -Xlinker 0x100000")
endif()
# CMake FindOpenMP doesn't know about AppleClang before 3.12, so provide custom flags.
if(WITH_OPENMP)
execute_process(COMMAND ${CMAKE_C_COMPILER} --version OUTPUT_VARIABLE COMPILER_VENDOR)
string(SUBSTRING "${COMPILER_VENDOR}" 0 5 VENDOR_NAME) # truncate output
if(${VENDOR_NAME} MATCHES "Apple") # Apple does not support OpenMP reliable with gcc and not with clang
set(WITH_OPENMP OFF)
else() # vanilla gcc or clang_omp support OpenMP
message(STATUS "Using special OpenMP enabled compiler !") # letting find_package(OpenMP) module work for gcc
if(CMAKE_C_COMPILER_ID MATCHES "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "7.0")
# Use OpenMP from our precompiled libraries.
message(STATUS "Using ${LIBDIR}/openmp for OpenMP")
set(OPENMP_CUSTOM ON)
set(OPENMP_FOUND ON)
set(OpenMP_C_FLAGS "-Xclang -fopenmp -I'${LIBDIR}/openmp/include'")
set(OpenMP_CXX_FLAGS "-Xclang -fopenmp -I'${LIBDIR}/openmp/include'")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L'${LIBDIR}/openmp/lib' -lomp")
# Copy libomp.dylib to allow executables like datatoc to work.
if(CMAKE_MAKE_PROGRAM MATCHES "xcodebuild")
set(OPENMP_DYLIB_AUX_PATH "${CMAKE_BINARY_DIR}/bin")
else()
set(OPENMP_DYLIB_AUX_PATH "${CMAKE_BINARY_DIR}")
endif()
execute_process(
COMMAND mkdir -p ${OPENMP_DYLIB_AUX_PATH}/Resources/lib
COMMAND cp -p ${LIBDIR}/openmp/lib/libomp.dylib ${OPENMP_DYLIB_AUX_PATH}/Resources/lib/libomp.dylib)
endif()
endif()

View File

@@ -16,9 +16,6 @@
#
# The Original Code is Copyright (C) 2016, Blender Foundation
# All rights reserved.
#
# Contributor(s): Jacques Beaurain.
#
# ***** END GPL LICENSE BLOCK *****
# Xcode and system configuration for Apple.

View File

@@ -16,9 +16,6 @@
#
# The Original Code is Copyright (C) 2016, Blender Foundation
# All rights reserved.
#
# Contributor(s): Sergey Sharybin.
#
# ***** END GPL LICENSE BLOCK *****
# Libraries configuration for any *nix system including Linux and Unix.
@@ -42,6 +39,10 @@ if(EXISTS ${LIBDIR})
set(WITH_OPENMP_STATIC ON)
endif()
if(WITH_STATIC_LIBS)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libstdc++")
endif()
# Wrapper to prefer static libraries
macro(find_package_wrapper)
if(WITH_STATIC_LIBS)
@@ -245,13 +246,17 @@ if(WITH_OPENVDB)
find_package_wrapper(OpenVDB)
find_package_wrapper(TBB)
find_package_wrapper(Blosc)
if(NOT OPENVDB_FOUND OR NOT TBB_FOUND)
if(NOT TBB_FOUND)
set(WITH_OPENVDB OFF)
set(WITH_OPENVDB_BLOSC OFF)
message(STATUS "TBB not found, disabling OpenVDB")
elseif(NOT OPENVDB_FOUND)
set(WITH_OPENVDB OFF)
set(WITH_OPENVDB_BLOSC OFF)
message(STATUS "OpenVDB not found, disabling it")
elseif(NOT BLOSC_FOUND)
set(WITH_OPENVDB_BLOSC OFF)
message(STATUS "Blosc not found, disabling it")
message(STATUS "Blosc not found, disabling it for OpenVBD")
endif()
endif()

View File

@@ -16,9 +16,6 @@
#
# The Original Code is Copyright (C) 2016, Blender Foundation
# All rights reserved.
#
# Contributor(s): Sergey Sharybin.
#
# ***** END GPL LICENSE BLOCK *****
# Libraries configuration for Windows.
@@ -173,7 +170,10 @@ if(NOT DEFINED LIBDIR)
set(LIBDIR_BASE "windows")
endif()
# Can be 1910..1912
if(MSVC_VERSION GREATER 1909)
if(MSVC_VERSION GREATER 1919)
message(STATUS "Visual Studio 2019 detected.")
set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/${LIBDIR_BASE}_vc14)
elseif(MSVC_VERSION GREATER 1909)
message(STATUS "Visual Studio 2017 detected.")
set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/${LIBDIR_BASE}_vc14)
elseif(MSVC_VERSION EQUAL 1900)

View File

@@ -16,8 +16,6 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# Contributor(s): Campbell Barton, M.G. Kishalmi
#
# ***** END GPL LICENSE BLOCK *****
# <pep8 compliant>

View File

@@ -14,8 +14,6 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# Contributor(s): Campbell Barton
#
# ***** END GPL LICENSE BLOCK *****
# <pep8 compliant>

View File

@@ -29,7 +29,7 @@ try:
os.remove(package_archive)
if os.path.exists(package_dir):
shutil.rmtree(package_dir)
except Exception, ex:
except Exception as ex:
sys.stderr.write('Failed to clean up old package files: ' + str(ex) + '\n')
sys.exit(1)
@@ -40,7 +40,7 @@ try:
for f in os.listdir(package_dir):
if f.startswith('makes'):
os.remove(os.path.join(package_dir, f))
except Exception, ex:
except Exception as ex:
sys.stderr.write('Failed to copy install directory: ' + str(ex) + '\n')
sys.exit(1)
@@ -58,13 +58,13 @@ try:
sys.exit(-1)
subprocess.call(archive_cmd)
except Exception, ex:
except Exception as ex:
sys.stderr.write('Failed to create package archive: ' + str(ex) + '\n')
sys.exit(1)
# empty temporary package dir
try:
shutil.rmtree(package_dir)
except Exception, ex:
except Exception as ex:
sys.stderr.write('Failed to clean up package directory: ' + str(ex) + '\n')
sys.exit(1)

View File

@@ -3,6 +3,9 @@ echo No explicit msvc version requested, autodetecting version.
call "%~dp0\detect_msvc2017.cmd"
if %ERRORLEVEL% EQU 0 goto DetectionComplete
call "%~dp0\detect_msvc2019.cmd"
if %ERRORLEVEL% EQU 0 goto DetectionComplete
call "%~dp0\detect_msvc2015.cmd"
if %ERRORLEVEL% EQU 0 goto DetectionComplete

View File

@@ -1,5 +1,6 @@
if "%BUILD_VS_YEAR%"=="2015" set BUILD_VS_LIBDIRPOST=vc14
if "%BUILD_VS_YEAR%"=="2017" set BUILD_VS_LIBDIRPOST=vc14
if "%BUILD_VS_YEAR%"=="2019" set BUILD_VS_LIBDIRPOST=vc14
if "%BUILD_ARCH%"=="x64" (
set BUILD_VS_SVNDIR=win64_%BUILD_VS_LIBDIRPOST%

View File

@@ -1,4 +1,4 @@
if NOT exist "%BLENDER_DIR%/source/tools" (
if NOT exist "%BLENDER_DIR%\source\tools\.git" (
echo Checking out sub-modules
if not "%GIT%" == "" (
"%GIT%" submodule update --init --recursive --progress

View File

@@ -1,3 +1,5 @@
set BUILD_GENERATOR_POST=
set BUILD_PLATFORM_SELECT=
if "%BUILD_ARCH%"=="x64" (
set MSBUILD_PLATFORM=x64
) else if "%BUILD_ARCH%"=="x86" (
@@ -9,7 +11,7 @@ if "%BUILD_ARCH%"=="x64" (
)
if "%WITH_CLANG%"=="1" (
set CLANG_CMAKE_ARGS=-T"LLVM-vs2017"
set CLANG_CMAKE_ARGS=-T"llvm"
if "%WITH_ASAN%"=="1" (
set ASAN_CMAKE_ARGS=-DWITH_COMPILER_ASAN=On
)
@@ -23,7 +25,14 @@ if "%WITH_CLANG%"=="1" (
if "%WITH_PYDEBUG%"=="1" (
set PYDEBUG_CMAKE_ARGS=-DWINDOWS_PYTHON_DEBUG=On
)
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -G "Visual Studio %BUILD_VS_VER% %BUILD_VS_YEAR%%WINDOWS_ARCH%" %TESTS_CMAKE_ARGS% %CLANG_CMAKE_ARGS% %ASAN_CMAKE_ARGS% %PYDEBUG_CMAKE_ARGS%
if "%BUILD_VS_YEAR%"=="2019" (
set BUILD_PLATFORM_SELECT=-A %MSBUILD_PLATFORM%
) else (
set BUILD_GENERATOR_POST=%WINDOWS_ARCH%
)
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -G "Visual Studio %BUILD_VS_VER% %BUILD_VS_YEAR%%BUILD_GENERATOR_POST%" %BUILD_PLATFORM_SELECT% %TESTS_CMAKE_ARGS% %CLANG_CMAKE_ARGS% %ASAN_CMAKE_ARGS% %PYDEBUG_CMAKE_ARGS%
if NOT EXIST %BUILD_DIR%\nul (
mkdir %BUILD_DIR%
@@ -52,8 +61,8 @@ if "%MUST_CONFIGURE%"=="1" (
%BUILD_CMAKE_ARGS% ^
-H%BLENDER_DIR% ^
-B%BUILD_DIR%
if %ERRORLEVEL% NEQ 0 (
if errorlevel 1 (
echo "Configuration Failed"
exit /b 1
)

View File

@@ -1,76 +1,3 @@
if NOT "%verbose%" == "" (
echo Detecting msvc 2017
)
set BUILD_VS_VER=15
set BUILD_VS_YEAR=2017
set ProgramFilesX86=%ProgramFiles(x86)%
if not exist "%ProgramFilesX86%" set ProgramFilesX86=%ProgramFiles%
set vs_where=%ProgramFilesX86%\Microsoft Visual Studio\Installer\vswhere.exe
if not exist "%vs_where%" (
if NOT "%verbose%" == "" (
echo Visual Studio 2017 ^(15.2 or newer^) is not detected
)
goto FAIL
)
if NOT "%verbose%" == "" (
echo "%vs_where%" -latest %VSWHERE_ARGS% -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64`
)
for /f "usebackq tokens=1* delims=: " %%i in (`"%vs_where%" -latest %VSWHERE_ARGS% -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64`) do (
if /i "%%i"=="installationPath" set VS_InstallDir=%%j
)
if "%VS_InstallDir%"=="" (
if NOT "%verbose%" == "" (
echo Visual Studio is detected but the "Desktop development with C++" workload has not been instlled
goto FAIL
)
)
set VCVARS=%VS_InstallDir%\VC\Auxiliary\Build\vcvarsall.bat
if exist "%VCVARS%" (
call "%VCVARS%" %BUILD_ARCH%
) else (
if NOT "%verbose%" == "" (
echo "%VCVARS%" not found
)
goto FAIL
)
rem try msbuild
msbuild /version > NUL
if errorlevel 1 (
if NOT "%verbose%" == "" (
echo Visual Studio %BUILD_VS_YEAR% msbuild not found
)
goto FAIL
)
if NOT "%verbose%" == "" (
echo Visual Studio %BUILD_VS_YEAR% msbuild found
)
REM try the c++ compiler
cl 2> NUL 1>&2
if errorlevel 1 (
if NOT "%verbose%" == "" (
echo Visual Studio %BUILD_VS_YEAR% C/C++ Compiler not found
)
goto FAIL
)
if NOT "%verbose%" == "" (
echo Visual Studio %BUILD_VS_YEAR% C/C++ Compiler found
)
if NOT "%verbose%" == "" (
echo Visual Studio 2017 is detected successfully
)
goto EOF
:FAIL
exit /b 1
:EOF
call "%~dp0\detect_msvc_vswhere.cmd"

View File

@@ -0,0 +1,3 @@
set BUILD_VS_VER=16
set BUILD_VS_YEAR=2019
call "%~dp0\detect_msvc_vswhere.cmd"

View File

@@ -0,0 +1,79 @@
if NOT "%verbose%" == "" (
echo Detecting msvc %BUILD_VS_YEAR%
)
set ProgramFilesX86=%ProgramFiles(x86)%
if not exist "%ProgramFilesX86%" set ProgramFilesX86=%ProgramFiles%
set vs_where=%ProgramFilesX86%\Microsoft Visual Studio\Installer\vswhere.exe
if not exist "%vs_where%" (
if NOT "%verbose%" == "" (
echo Visual Studio %BUILD_VS_YEAR% is not detected
)
goto FAIL
)
if NOT "%verbose%" == "" (
echo "%vs_where%" -latest %VSWHERE_ARGS% -version ^[%BUILD_VS_VER%.0^,%BUILD_VS_VER%.99^) -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64
)
for /f "usebackq tokens=1* delims=: " %%i in (`"%vs_where%" -latest -version ^[%BUILD_VS_VER%.0^,%BUILD_VS_VER%.99^) %VSWHERE_ARGS% -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64`) do (
if /i "%%i"=="installationPath" set VS_InstallDir=%%j
)
if NOT "%verbose%" == "" (
echo VS_Installdir="%VS_InstallDir%"
)
if "%VS_InstallDir%"=="" (
if NOT "%verbose%" == "" (
echo Visual Studio is detected but the "Desktop development with C++" workload has not been instlled
goto FAIL
)
)
set VCVARS=%VS_InstallDir%\VC\Auxiliary\Build\vcvarsall.bat
if exist "%VCVARS%" (
call "%VCVARS%" %BUILD_ARCH%
) else (
if NOT "%verbose%" == "" (
echo "%VCVARS%" not found
)
goto FAIL
)
rem try msbuild
msbuild /version > NUL
if errorlevel 1 (
if NOT "%verbose%" == "" (
echo Visual Studio %BUILD_VS_YEAR% msbuild not found
)
goto FAIL
)
if NOT "%verbose%" == "" (
echo Visual Studio %BUILD_VS_YEAR% msbuild found
)
REM try the c++ compiler
cl 2> NUL 1>&2
if errorlevel 1 (
if NOT "%verbose%" == "" (
echo Visual Studio %BUILD_VS_YEAR% C/C++ Compiler not found
)
goto FAIL
)
if NOT "%verbose%" == "" (
echo Visual Studio %BUILD_VS_YEAR% C/C++ Compiler found
)
if NOT "%verbose%" == "" (
echo Visual Studio %BUILD_VS_YEAR% is detected successfully
)
goto EOF
:FAIL
exit /b 1
:EOF

View File

@@ -50,10 +50,17 @@ if NOT "%1" == "" (
) else if "%1" == "2017pre" (
set BUILD_VS_YEAR=2017
set VSWHERE_ARGS=-prerelease
set BUILD_VS_YEAR=2017
) else if "%1" == "2017b" (
set BUILD_VS_YEAR=2017
set VSWHERE_ARGS=-products Microsoft.VisualStudio.Product.BuildTools
) else if "%1" == "2019" (
set BUILD_VS_YEAR=2019
) else if "%1" == "2019pre" (
set BUILD_VS_YEAR=2019
set VSWHERE_ARGS=-prerelease
) else if "%1" == "2019b" (
set BUILD_VS_YEAR=2019
set VSWHERE_ARGS=-products Microsoft.VisualStudio.Product.BuildTools
) else if "%1" == "2015" (
set BUILD_VS_YEAR=2015
) else if "%1" == "packagename" (

View File

@@ -1,4 +1,4 @@
# Doxyfile 1.8.11
# Doxyfile 1.8.15
# This file describes the settings to be used by the documentation system
# doxygen (www.doxygen.org) for a project.
@@ -17,11 +17,11 @@
# Project related configuration options
#---------------------------------------------------------------------------
# This tag specifies the encoding used for all characters in the config file
# that follow. The default is UTF-8 which is also the encoding used for all text
# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv
# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv
# for the list of possible encodings.
# This tag specifies the encoding used for all characters in the configuration
# file that follow. The default is UTF-8 which is also the encoding used for all
# text before the first occurrence of this tag. Doxygen uses libiconv (or the
# iconv built into libc) for the transcoding. See
# https://www.gnu.org/software/libiconv/ for the list of possible encodings.
# The default value is: UTF-8.
DOXYFILE_ENCODING = UTF-8
@@ -93,6 +93,14 @@ ALLOW_UNICODE_NAMES = NO
OUTPUT_LANGUAGE = English
# The OUTPUT_TEXT_DIRECTION tag is used to specify the direction in which all
# documentation generated by doxygen is written. Doxygen will use this
# information to generate all generated output in the proper direction.
# Possible values are: None, LTR, RTL and Context.
# The default value is: None.
OUTPUT_TEXT_DIRECTION = None
# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member
# descriptions after the members that are listed in the file and class
# documentation (similar to Javadoc). Set to NO to disable this.
@@ -236,7 +244,12 @@ TAB_SIZE = 4
# will allow you to put the command \sideeffect (or @sideeffect) in the
# documentation, which will result in a user-defined paragraph with heading
# "Side Effects:". You can put \n's in the value part of an alias to insert
# newlines.
# newlines (in the resulting output). You can put ^^ in the value part of an
# alias to insert a newline as if a physical newline was in the original file.
# When you need a literal { or } or , in the value part of an alias you have to
# escape them by means of a backslash (\), this can lead to conflicts with the
# commands \{ and \} for these it is advised to use the version @{ and @} or use
# a double escape (\\{ and \\})
ALIASES =
@@ -274,17 +287,26 @@ OPTIMIZE_FOR_FORTRAN = NO
OPTIMIZE_OUTPUT_VHDL = NO
# Set the OPTIMIZE_OUTPUT_SLICE tag to YES if your project consists of Slice
# sources only. Doxygen will then generate output that is more tailored for that
# language. For instance, namespaces will be presented as modules, types will be
# separated into more groups, etc.
# The default value is: NO.
OPTIMIZE_OUTPUT_SLICE = NO
# Doxygen selects the parser to use depending on the extension of the files it
# parses. With this tag you can assign which parser to use for a given
# extension. Doxygen has a built-in mapping, but you can override or extend it
# using this tag. The format is ext=language, where ext is a file extension, and
# language is one of the parsers supported by doxygen: IDL, Java, Javascript,
# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran:
# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran:
# Fortran. In the later case the parser tries to guess whether the code is fixed
# or free formatted code, this is the default for Fortran type files), VHDL. For
# instance to make doxygen treat .inc files as Fortran files (default is PHP),
# and .f files as C (default is Fortran), use: inc=Fortran f=C.
# Csharp (C#), C, C++, D, PHP, md (Markdown), Objective-C, Python, Slice,
# Fortran (fixed format Fortran: FortranFixed, free formatted Fortran:
# FortranFree, unknown formatted Fortran: Fortran. In the later case the parser
# tries to guess whether the code is fixed or free formatted code, this is the
# default for Fortran type files), VHDL, tcl. For instance to make doxygen treat
# .inc files as Fortran files (default is PHP), and .f files as C (default is
# Fortran), use: inc=Fortran f=C.
#
# Note: For files without extension you can use no_extension as a placeholder.
#
@@ -295,7 +317,7 @@ EXTENSION_MAPPING =
# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments
# according to the Markdown format, which allows for more readable
# documentation. See http://daringfireball.net/projects/markdown/ for details.
# documentation. See https://daringfireball.net/projects/markdown/ for details.
# The output of markdown processing is further processed by doxygen, so you can
# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in
# case of backward compatibilities issues.
@@ -303,6 +325,15 @@ EXTENSION_MAPPING =
MARKDOWN_SUPPORT = YES
# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up
# to that level are automatically included in the table of contents, even if
# they do not have an id attribute.
# Note: This feature currently applies only to Markdown headings.
# Minimum value: 0, maximum value: 99, default value: 0.
# This tag requires that the tag MARKDOWN_SUPPORT is set to YES.
TOC_INCLUDE_HEADINGS = 0
# When enabled doxygen tries to link words that correspond to documented
# classes, or namespaces to their corresponding documentation. Such a link can
# be prevented in individual cases by putting a % sign in front of the word or
@@ -328,7 +359,7 @@ BUILTIN_STL_SUPPORT = NO
CPP_CLI_SUPPORT = NO
# Set the SIP_SUPPORT tag to YES if your project consists of sip (see:
# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen
# https://www.riverbankcomputing.com/software/sip/intro) sources only. Doxygen
# will parse them like normal C++ but will assume all classes use public instead
# of private inheritance when no explicit protection keyword is present.
# The default value is: NO.
@@ -731,7 +762,7 @@ WARNINGS = YES
# will automatically be disabled.
# The default value is: YES.
WARN_IF_UNDOCUMENTED = YES
WARN_IF_UNDOCUMENTED = NO
# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for
# potential errors in the documentation, such as not documenting some parameters
@@ -744,7 +775,8 @@ WARN_IF_DOC_ERROR = YES
# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that
# are documented, but have no documentation for their parameters or return
# value. If set to NO, doxygen will only warn about wrong or incomplete
# parameter documentation, but not about the absence of documentation.
# parameter documentation, but not about the absence of documentation. If
# EXTRACT_ALL is set to YES then this flag will automatically be disabled.
# The default value is: NO.
WARN_NO_PARAMDOC = NO
@@ -792,7 +824,7 @@ INPUT = doxygen.main.h \
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
# libiconv (or the iconv built into libc) for the transcoding. See the libiconv
# documentation (see: http://www.gnu.org/software/libiconv) for the list of
# documentation (see: https://www.gnu.org/software/libiconv/) for the list of
# possible encodings.
# The default value is: UTF-8.
@@ -809,8 +841,8 @@ INPUT_ENCODING = UTF-8
# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp,
# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h,
# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc,
# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f, *.for, *.tcl,
# *.vhd, *.vhdl, *.ucf, *.qsf, *.as and *.js.
# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f95, *.f03, *.f08,
# *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf, *.qsf and *.ice.
FILE_PATTERNS =
@@ -827,7 +859,7 @@ RECURSIVE = YES
# Note that relative paths are relative to the directory from which doxygen is
# run.
EXCLUDE = ../../build_files, \
EXCLUDE = ../../build_files \
../../release
# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
@@ -968,7 +1000,7 @@ INLINE_SOURCES = NO
STRIP_CODE_COMMENTS = YES
# If the REFERENCED_BY_RELATION tag is set to YES then for each documented
# function all documented functions referencing it will be listed.
# entity all documented functions referencing it will be listed.
# The default value is: NO.
REFERENCED_BY_RELATION = YES
@@ -1000,12 +1032,12 @@ SOURCE_TOOLTIPS = YES
# If the USE_HTAGS tag is set to YES then the references to source code will
# point to the HTML generated by the htags(1) tool instead of doxygen built-in
# source browser. The htags tool is part of GNU's global source tagging system
# (see http://www.gnu.org/software/global/global.html). You will need version
# (see https://www.gnu.org/software/global/global.html). You will need version
# 4.8.6 or higher.
#
# To use it do the following:
# - Install the latest version of global
# - Enable SOURCE_BROWSER and USE_HTAGS in the config file
# - Enable SOURCE_BROWSER and USE_HTAGS in the configuration file
# - Make sure the INPUT points to the root of the source tree
# - Run doxygen as normal
#
@@ -1181,6 +1213,17 @@ HTML_COLORSTYLE_GAMMA = 79
HTML_TIMESTAMP = YES
# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML
# documentation will contain a main index with vertical navigation menus that
# are dynamically created via Javascript. If disabled, the navigation index will
# consists of multiple levels of tabs that are statically embedded in every HTML
# page. Disable this option to support browsers that do not have Javascript,
# like the Qt help browser.
# The default value is: YES.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_DYNAMIC_MENUS = YES
# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
# documentation will contain sections that can be hidden and shown after the
# page has loaded.
@@ -1204,13 +1247,13 @@ HTML_INDEX_NUM_ENTRIES = 100
# If the GENERATE_DOCSET tag is set to YES, additional index files will be
# generated that can be used as input for Apple's Xcode 3 integrated development
# environment (see: http://developer.apple.com/tools/xcode/), introduced with
# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a
# environment (see: https://developer.apple.com/xcode/), introduced with OSX
# 10.5 (Leopard). To create a documentation set, doxygen will generate a
# Makefile in the HTML output directory. Running make will produce the docset in
# that directory and running make install will install the docset in
# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at
# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
# for more information.
# startup. See https://developer.apple.com/library/archive/featuredarticles/Doxy
# genXcode/_index.html for more information.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
@@ -1249,7 +1292,7 @@ DOCSET_PUBLISHER_NAME = Publisher
# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three
# additional HTML index files: index.hhp, index.hhc, and index.hhk. The
# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop
# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on
# (see: https://www.microsoft.com/en-us/download/details.aspx?id=21138) on
# Windows.
#
# The HTML Help Workshop contains a compiler that can convert all HTML output
@@ -1325,7 +1368,7 @@ QCH_FILE =
# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help
# Project output. For more information please see Qt Help Project / Namespace
# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace).
# (see: http://doc.qt.io/archives/qt-4.8/qthelpproject.html#namespace).
# The default value is: org.doxygen.Project.
# This tag requires that the tag GENERATE_QHP is set to YES.
@@ -1333,7 +1376,7 @@ QHP_NAMESPACE = org.doxygen.Project
# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt
# Help Project output. For more information please see Qt Help Project / Virtual
# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual-
# Folders (see: http://doc.qt.io/archives/qt-4.8/qthelpproject.html#virtual-
# folders).
# The default value is: doc.
# This tag requires that the tag GENERATE_QHP is set to YES.
@@ -1342,7 +1385,7 @@ QHP_VIRTUAL_FOLDER = doc
# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom
# filter to add. For more information please see Qt Help Project / Custom
# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-
# Filters (see: http://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-
# filters).
# This tag requires that the tag GENERATE_QHP is set to YES.
@@ -1350,7 +1393,7 @@ QHP_CUST_FILTER_NAME =
# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the
# custom filter to add. For more information please see Qt Help Project / Custom
# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-
# Filters (see: http://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-
# filters).
# This tag requires that the tag GENERATE_QHP is set to YES.
@@ -1358,7 +1401,7 @@ QHP_CUST_FILTER_ATTRS =
# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
# project's filter section matches. Qt Help Project / Filter Attributes (see:
# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes).
# http://doc.qt.io/archives/qt-4.8/qthelpproject.html#filter-attributes).
# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_SECT_FILTER_ATTRS =
@@ -1451,7 +1494,7 @@ EXT_LINKS_IN_WINDOW = NO
FORMULA_FONTSIZE = 10
# Use the FORMULA_TRANPARENT tag to determine whether or not the images
# Use the FORMULA_TRANSPARENT tag to determine whether or not the images
# generated for formulas are transparent PNGs. Transparent PNGs are not
# supported properly for IE 6.0, but are supported on all modern browsers.
#
@@ -1463,7 +1506,7 @@ FORMULA_FONTSIZE = 10
FORMULA_TRANSPARENT = YES
# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see
# http://www.mathjax.org) which uses client side Javascript for the rendering
# https://www.mathjax.org) which uses client side Javascript for the rendering
# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX
# installed or if you want to formulas look prettier in the HTML output. When
# enabled you may also need to install MathJax separately and configure the path
@@ -1490,8 +1533,8 @@ MATHJAX_FORMAT = HTML-CSS
# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax
# Content Delivery Network so you can quickly see the result without installing
# MathJax. However, it is strongly recommended to install a local copy of
# MathJax from http://www.mathjax.org before deployment.
# The default value is: http://cdn.mathjax.org/mathjax/latest.
# MathJax from https://www.mathjax.org before deployment.
# The default value is: https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/.
# This tag requires that the tag USE_MATHJAX is set to YES.
MATHJAX_RELPATH = http://www.mathjax.org/mathjax
@@ -1552,7 +1595,7 @@ SERVER_BASED_SEARCH = NO
#
# Doxygen ships with an example indexer (doxyindexer) and search engine
# (doxysearch.cgi) which are based on the open source search engine library
# Xapian (see: http://xapian.org/).
# Xapian (see: https://xapian.org/).
#
# See the section "External Indexing and Searching" for details.
# The default value is: NO.
@@ -1565,7 +1608,7 @@ EXTERNAL_SEARCH = NO
#
# Doxygen ships with an example indexer (doxyindexer) and search engine
# (doxysearch.cgi) which are based on the open source search engine library
# Xapian (see: http://xapian.org/). See the section "External Indexing and
# Xapian (see: https://xapian.org/). See the section "External Indexing and
# Searching" for details.
# This tag requires that the tag SEARCHENGINE is set to YES.
@@ -1617,21 +1660,34 @@ LATEX_OUTPUT = latex
# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
# invoked.
#
# Note that when enabling USE_PDFLATEX this option is only used for generating
# bitmaps for formulas in the HTML output, but not in the Makefile that is
# written to the output directory.
# The default file is: latex.
# Note that when not enabling USE_PDFLATEX the default is latex when enabling
# USE_PDFLATEX the default is pdflatex and when in the later case latex is
# chosen this is overwritten by pdflatex. For specific output languages the
# default can have been set differently, this depends on the implementation of
# the output language.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_CMD_NAME = latex
# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate
# index for LaTeX.
# Note: This tag is used in the Makefile / make.bat.
# See also: LATEX_MAKEINDEX_CMD for the part in the generated output file
# (.tex).
# The default file is: makeindex.
# This tag requires that the tag GENERATE_LATEX is set to YES.
MAKEINDEX_CMD_NAME = makeindex
# The LATEX_MAKEINDEX_CMD tag can be used to specify the command name to
# generate index for LaTeX.
# Note: This tag is used in the generated output file (.tex).
# See also: MAKEINDEX_CMD_NAME for the part in the Makefile / make.bat.
# The default value is: \makeindex.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_MAKEINDEX_CMD = \makeindex
# If the COMPACT_LATEX tag is set to YES, doxygen generates more compact LaTeX
# documents. This may be useful for small projects and may help to save some
# trees in general.
@@ -1766,6 +1822,14 @@ LATEX_BIB_STYLE = plain
LATEX_TIMESTAMP = NO
# The LATEX_EMOJI_DIRECTORY tag is used to specify the (relative or absolute)
# path from which the emoji images will be read. If a relative path is entered,
# it will be relative to the LATEX_OUTPUT directory. If left blank the
# LATEX_OUTPUT directory will be used.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_EMOJI_DIRECTORY =
#---------------------------------------------------------------------------
# Configuration options related to the RTF output
#---------------------------------------------------------------------------
@@ -1805,9 +1869,9 @@ COMPACT_RTF = NO
RTF_HYPERLINKS = NO
# Load stylesheet definitions from file. Syntax is similar to doxygen's config
# file, i.e. a series of assignments. You only have to provide replacements,
# missing definitions are set to their default value.
# Load stylesheet definitions from file. Syntax is similar to doxygen's
# configuration file, i.e. a series of assignments. You only have to provide
# replacements, missing definitions are set to their default value.
#
# See also section "Doxygen usage" for information on how to generate the
# default style sheet that doxygen normally uses.
@@ -1816,8 +1880,8 @@ RTF_HYPERLINKS = NO
RTF_STYLESHEET_FILE =
# Set optional variables used in the generation of an RTF document. Syntax is
# similar to doxygen's config file. A template extensions file can be generated
# using doxygen -e rtf extensionFile.
# similar to doxygen's configuration file. A template extensions file can be
# generated using doxygen -e rtf extensionFile.
# This tag requires that the tag GENERATE_RTF is set to YES.
RTF_EXTENSIONS_FILE =
@@ -1903,6 +1967,13 @@ XML_OUTPUT = xml
XML_PROGRAMLISTING = YES
# If the XML_NS_MEMB_FILE_SCOPE tag is set to YES, doxygen will include
# namespace members in file scope as well, matching the HTML output.
# The default value is: NO.
# This tag requires that the tag GENERATE_XML is set to YES.
XML_NS_MEMB_FILE_SCOPE = NO
#---------------------------------------------------------------------------
# Configuration options related to the DOCBOOK output
#---------------------------------------------------------------------------
@@ -1935,9 +2006,9 @@ DOCBOOK_PROGRAMLISTING = NO
#---------------------------------------------------------------------------
# If the GENERATE_AUTOGEN_DEF tag is set to YES, doxygen will generate an
# AutoGen Definitions (see http://autogen.sf.net) file that captures the
# structure of the code including all documentation. Note that this feature is
# still experimental and incomplete at the moment.
# AutoGen Definitions (see http://autogen.sourceforge.net/) file that captures
# the structure of the code including all documentation. Note that this feature
# is still experimental and incomplete at the moment.
# The default value is: NO.
GENERATE_AUTOGEN_DEF = NO
@@ -2360,6 +2431,11 @@ DIAFILE_DIRS =
PLANTUML_JAR_PATH =
# When using plantuml, the PLANTUML_CFG_FILE tag can be used to specify a
# configuration file for plantuml.
PLANTUML_CFG_FILE =
# When using plantuml, the specified paths are searched for files specified by
# the !include statement in a plantuml block.

View File

@@ -1,10 +1,4 @@
/** \defgroup blenderplayer Blender Player */
/** \defgroup blc bad level calls
* \ingroup blenderplayer
*/
/** \defgroup render Rendering
* \ingroup blender
*/
@@ -29,15 +23,14 @@
* \ingroup python
*/
/** \defgroup blpluginapi Blender pluginapi
* \ingroup blender
* \attention not in use currently
*/
/* ================================ */
/** \defgroup blender Blender */
/** \defgroup balembic BlenderAlembic
* \ingroup blender
*/
/** \defgroup blt BlenTranslation
* \ingroup blender
*/
@@ -81,6 +74,10 @@
* \ingroup blender
*/
/** \defgroup shader_fx Shader Effects
* \ingroup blender
*/
/** \defgroup data DNA, RNA and .blend access*/
/** \defgroup gpu GPU

View File

@@ -222,7 +222,7 @@ Support Overview
.. note::
Using the :mod:`bmesh` api is completely separate api from :mod:`bpy`,
Using the :mod:`bmesh` API is completely separate API from :mod:`bpy`,
typically you would would use one or the other based on the level of editing needed,
not simply for a different way to access faces.
@@ -233,7 +233,7 @@ Creating
All 3 datatypes can be used for face creation.
- polygons are the most efficient way to create faces but the data structure is _very_ rigid and inflexible,
you must have all your vertes and faces ready and create them all at once.
you must have all your vertices and faces ready and create them all at once.
This is further complicated by the fact that each polygon does not store its own verts,
rather they reference an index and size in :class:`bpy.types.Mesh.loops` which are a fixed array too.
- bmesh-faces are most likely the easiest way for new scripts to create faces,
@@ -534,7 +534,7 @@ Strange errors using 'threading' module
Python threading with Blender only works properly when the threads finish up before the script does.
By using ``threading.join()`` for example.
Heres an example of threading supported by Blender:
Here is an example of threading supported by Blender:
.. code-block:: python
@@ -604,12 +604,17 @@ so until its properly supported, best not make use of this.
Help! My script crashes Blender
===============================
**TL;DR:** Do not keep direct references to Blender data (of any kind) when modifying the container
of that data, and/or when some undo/redo may happen (e.g. during modal operators execution...).
Instead, use indices (or other data always stored by value in Python, like string keys...),
that allow you to get access to the desired data.
Ideally it would be impossible to crash Blender from Python
however there are some problems with the API where it can be made to crash.
Strictly speaking this is a bug in the API but fixing it would mean adding memory verification
on every access since most crashes are caused by the Python objects referencing Blenders memory directly,
whenever the memory is freed, further Python access to it can crash the script.
whenever the memory is freed or re-allocated, further Python access to it can crash the script.
But fixing this would make the scripts run very slow,
or writing a very different kind of API which doesn't reference the memory directly.
@@ -619,10 +624,15 @@ Here are some general hints to avoid running into these problems.
especially when working with large lists since Blender can crash simply by running out of memory.
- Many hard to fix crashes end up being because of referencing freed data,
when removing data be sure not to hold any references to it.
- Re-allocation can lead to the same issues
(e.g. if you add a lot of items to some Collection,
this can lead to re-allocating the underlying container's memory,
invalidating all previous references to existing items).
- Modules or classes that remain active while Blender is used,
should not hold references to data the user may remove, instead,
fetch data from the context each time the script is activated.
- Crashes may not happen every time, they may happen more on some configurations/operating-systems.
- Be wary of recursive patterns, those are very efficient at hiding the issues described here.
.. note::
@@ -632,6 +642,55 @@ Here are some general hints to avoid running into these problems.
While the crash may be in Blenders C/C++ code,
this can help a lot to track down the area of the script that causes the crash.
.. note::
Some container modifications are actually safe, because they will never re-allocate existing data
(e.g. linked lists containers will never re-allocate existing items when adding or removing others).
But knowing which cases are safe and which aren't implies a deep understanding of Blender's internals.
That's why, unless you are willing to dive into the RNA C implementation, it's simpler to
always assume that data references will become invalid when modifying their containers,
in any possible way.
**Dont:**
.. code-block:: python
class TestItems(bpy.types.PropertyGroup):
name: bpy.props.StringProperty()
bpy.utils.register_class(TestItems)
bpy.types.Scene.test_items = bpy.props.CollectionProperty(type=TestItems)
first_item = bpy.context.scene.test_items.add()
for i in range(100):
bpy.context.scene.test_items.add()
# This is likely to crash, as internal code may re-allocate
# the whole container (the collection) memory at some point.
first_item.name = "foobar"
**Do:**
.. code-block:: python
class TestItems(bpy.types.PropertyGroup):
name: bpy.props.StringProperty()
bpy.utils.register_class(TestItems)
bpy.types.Scene.test_items = bpy.props.CollectionProperty(type=TestItems)
first_item = bpy.context.scene.test_items.add()
for i in range(100):
bpy.context.scene.test_items.add()
# This is safe, we are getting again desired data *after*
# all modifications to its container are done.
first_item = bpy.context.scene.test_items[0]
first_item.name = "foobar"
Undo/Redo
---------
@@ -716,7 +775,7 @@ the object data but are most common when switching edit-mode.
Array Re-Allocation
-------------------
When adding new points to a curve or vertices's/edges/polygons to a mesh,
When adding new points to a curve or vertices/edges/polygons to a mesh,
internally the array which stores this data is re-allocated.
.. code-block:: python
@@ -729,7 +788,7 @@ internally the array which stores this data is re-allocated.
point.co = 1.0, 2.0, 3.0
This can be avoided by re-assigning the point variables after adding the new one or by storing
indices's to the points rather than the points themselves.
indices to the points rather than the points themselves.
The best way is to sidestep the problem altogether add all the points to the curve at once.
This means you don't have to worry about array re-allocation and its faster too
@@ -745,7 +804,7 @@ along with objects, scenes, collections, bones.. etc.
The ``remove()`` api calls will invalidate the data they free to prevent common mistakes.
The following example shows how this precortion works.
The following example shows how this precaution works.
.. code-block:: python

View File

@@ -14,8 +14,6 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# Contributor(s): Campbell Barton
#
# ##### END GPL LICENSE BLOCK #####
# <pep8 compliant>

View File

@@ -14,8 +14,6 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# Contributor(s): Campbell Barton
#
# ##### END GPL LICENSE BLOCK #####
# <pep8 compliant>

View File

@@ -16,8 +16,6 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# Contributor(s): Bastien Montagne
#
# ##### END GPL LICENSE BLOCK #####
# <pep8 compliant>

View File

@@ -16,11 +16,6 @@
#
# The Original Code is Copyright (C) 2006, Blender Foundation
# All rights reserved.
#
# The Original Code is: all of this file.
#
# Contributor(s): Jacques Beaurain.
#
# ***** END GPL LICENSE BLOCK *****
# Libs that adhere to strict flags

View File

@@ -212,7 +212,7 @@ AUD_API const char* AUD_Sound_write(AUD_Sound* sound, const char* filename, AUD_
std::shared_ptr<IWriter> writer = FileWriter::createWriter(filename, specs, static_cast<Container>(container), static_cast<Codec>(codec), bitrate);
FileWriter::writeReader(reader, writer, 0, buffersize);
}
catch(Exception& e)
catch(Exception&)
{
return "An exception occured while writing.";
}

View File

@@ -140,8 +140,6 @@ Sound_data(Sound* self)
std::memcpy(data, buffer->getBuffer(), buffer->getSize());
Py_INCREF(array);
return reinterpret_cast<PyObject*>(array);
}

View File

@@ -261,6 +261,8 @@ FFMPEGWriter::FFMPEGWriter(std::string filename, DeviceSpecs specs, Container fo
case CHANNELS_SURROUND71:
channel_layout = AV_CH_LAYOUT_7POINT1;
break;
default:
AUD_THROW(FileException, "File couldn't be written, channel layout not supported.");
}
try

View File

@@ -61,10 +61,58 @@ bool OpenALDevice::OpenALHandle::pause(bool keep)
return false;
}
bool OpenALDevice::OpenALHandle::reinitialize()
{
DeviceSpecs specs = m_device->m_specs;
specs.specs = m_reader->getSpecs();
ALenum format;
if(!m_device->getFormat(format, specs.specs))
return true;
m_format = format;
// OpenAL playback code
alGenBuffers(CYCLE_BUFFERS, m_buffers);
if(alGetError() != AL_NO_ERROR)
return true;
m_device->m_buffer.assureSize(m_device->m_buffersize * AUD_DEVICE_SAMPLE_SIZE(specs));
int length;
bool eos;
for(m_current = 0; m_current < CYCLE_BUFFERS; m_current++)
{
length = m_device->m_buffersize;
m_reader->read(length, eos, m_device->m_buffer.getBuffer());
if(length == 0)
break;
alBufferData(m_buffers[m_current], m_format, m_device->m_buffer.getBuffer(), length * AUD_DEVICE_SAMPLE_SIZE(specs), specs.rate);
if(alGetError() != AL_NO_ERROR)
return true;
}
alGenSources(1, &m_source);
if(alGetError() != AL_NO_ERROR)
return true;
alSourceQueueBuffers(m_source, m_current, m_buffers);
if(alGetError() != AL_NO_ERROR)
return true;
alSourcei(m_source, AL_SOURCE_RELATIVE, m_relative);
return false;
}
OpenALDevice::OpenALHandle::OpenALHandle(OpenALDevice* device, ALenum format, std::shared_ptr<IReader> reader, bool keep) :
m_isBuffered(false), m_reader(reader), m_keep(keep), m_format(format),
m_eos(false), m_loopcount(0), m_stop(nullptr), m_stop_data(nullptr), m_status(STATUS_PLAYING),
m_device(device)
m_relative(1), m_device(device)
{
DeviceSpecs specs = m_device->m_specs;
specs.specs = m_reader->getSpecs();
@@ -162,6 +210,9 @@ bool OpenALDevice::OpenALHandle::stop()
if(!m_status)
return false;
if(m_stop)
m_stop(m_stop_data);
m_status = STATUS_INVALID;
alDeleteSources(1, &m_source);
@@ -525,8 +576,6 @@ bool OpenALDevice::OpenALHandle::setOrientation(const Quaternion& orientation)
bool OpenALDevice::OpenALHandle::isRelative()
{
int result;
if(!m_status)
return false;
@@ -535,9 +584,9 @@ bool OpenALDevice::OpenALHandle::isRelative()
if(!m_status)
return false;
alGetSourcei(m_source, AL_SOURCE_RELATIVE, &result);
alGetSourcei(m_source, AL_SOURCE_RELATIVE, &m_relative);
return result;
return m_relative;
}
bool OpenALDevice::OpenALHandle::setRelative(bool relative)
@@ -550,7 +599,9 @@ bool OpenALDevice::OpenALHandle::setRelative(bool relative)
if(!m_status)
return false;
alSourcei(m_source, AL_SOURCE_RELATIVE, relative);
m_relative = relative;
alSourcei(m_source, AL_SOURCE_RELATIVE, m_relative);
return true;
}
@@ -852,6 +903,80 @@ void OpenALDevice::updateStreams()
{
lock();
if(m_checkDisconnect)
{
ALCint connected;
alcGetIntegerv(m_device, alcGetEnumValue(m_device, "ALC_CONNECTED"), 1, &connected);
if(!connected)
{
// quit OpenAL
alcMakeContextCurrent(nullptr);
alcDestroyContext(m_context);
alcCloseDevice(m_device);
// restart
if(m_name.empty())
m_device = alcOpenDevice(nullptr);
else
m_device = alcOpenDevice(m_name.c_str());
// if device opening failed, there's really nothing we can do
if(m_device)
{
// at least try to set the frequency
ALCint attribs[] = { ALC_FREQUENCY, (ALCint)specs.rate, 0 };
ALCint* attributes = attribs;
if(specs.rate == RATE_INVALID)
attributes = nullptr;
m_context = alcCreateContext(m_device, attributes);
alcMakeContextCurrent(m_context);
m_checkDisconnect = alcIsExtensionPresent(m_device, "ALC_EXT_disconnect");
alcGetIntegerv(m_device, ALC_FREQUENCY, 1, (ALCint*)&specs.rate);
// check for specific formats and channel counts to be played back
if(alIsExtensionPresent("AL_EXT_FLOAT32") == AL_TRUE)
specs.format = FORMAT_FLOAT32;
else
specs.format = FORMAT_S16;
// if the format of the device changed, all handles are invalidated
// this is unlikely to happen though
if(specs.format != m_specs.format)
stopAll();
m_useMC = alIsExtensionPresent("AL_EXT_MCFORMATS") == AL_TRUE;
if((!m_useMC && specs.channels > CHANNELS_STEREO) ||
specs.channels == CHANNELS_STEREO_LFE ||
specs.channels == CHANNELS_SURROUND5)
specs.channels = CHANNELS_STEREO;
alGetError();
alcGetError(m_device);
m_specs = specs;
std::list<std::shared_ptr<OpenALHandle> > stopSounds;
for(auto& handle : m_playingSounds)
if(handle->reinitialize())
stopSounds.push_back(handle);
for(auto& handle : m_pausedSounds)
if(handle->reinitialize())
stopSounds.push_back(handle);
for(auto& sound : stopSounds)
sound->stop();
}
}
}
alcSuspendContext(m_context);
cerr = alcGetError(m_device);
if(cerr == ALC_NO_ERROR)
@@ -957,12 +1082,14 @@ void OpenALDevice::updateStreams()
// if it really stopped
if(sound->m_eos && info != AL_INITIAL)
{
if(sound->m_stop)
sound->m_stop(sound->m_stop_data);
// pause or
if(sound->m_keep)
{
if(sound->m_stop)
sound->m_stop(sound->m_stop_data);
pauseSounds.push_back(sound);
}
// stop
else
stopSounds.push_back(sound);
@@ -1005,16 +1132,16 @@ void OpenALDevice::updateStreams()
/******************************************************************************/
OpenALDevice::OpenALDevice(DeviceSpecs specs, int buffersize, std::string name) :
m_playing(false), m_buffersize(buffersize)
m_name(name), m_playing(false), m_buffersize(buffersize)
{
// cannot determine how many channels or which format OpenAL uses, but
// it at least is able to play 16 bit stereo audio
specs.format = FORMAT_S16;
if(name.empty())
if(m_name.empty())
m_device = alcOpenDevice(nullptr);
else
m_device = alcOpenDevice(name.c_str());
m_device = alcOpenDevice(m_name.c_str());
if(!m_device)
AUD_THROW(DeviceException, "The audio device couldn't be opened with OpenAL.");
@@ -1028,6 +1155,8 @@ OpenALDevice::OpenALDevice(DeviceSpecs specs, int buffersize, std::string name)
m_context = alcCreateContext(m_device, attributes);
alcMakeContextCurrent(m_context);
m_checkDisconnect = alcIsExtensionPresent(m_device, "ALC_EXT_disconnect");
alcGetIntegerv(m_device, ALC_FREQUENCY, 1, (ALCint*)&specs.rate);
// check for specific formats and channel counts to be played back

View File

@@ -95,11 +95,16 @@ private:
/// Current status of the handle
Status m_status;
/// Whether the source is relative or not.
ALint m_relative;
/// Own device.
OpenALDevice* m_device;
AUD_LOCAL bool pause(bool keep);
AUD_LOCAL bool reinitialize();
// delete copy constructor and operator=
OpenALHandle(const OpenALHandle&) = delete;
OpenALHandle& operator=(const OpenALHandle&) = delete;
@@ -173,11 +178,21 @@ private:
*/
DeviceSpecs m_specs;
/**
* The device name.
*/
std::string m_name;
/**
* Whether the device has the AL_EXT_MCFORMATS extension.
*/
bool m_useMC;
/**
* Whether the ALC_EXT_disconnect extension is present and device disconnect should be checked repeatedly.
*/
bool m_checkDisconnect;
/**
* The list of sounds that are currently playing.
*/

View File

@@ -296,72 +296,77 @@ const Channel* ChannelMapperReader::CHANNEL_MAPS[] =
ChannelMapperReader::SURROUND71_MAP
};
constexpr float deg2rad(double angle)
{
return float(angle * M_PI / 180.0);
}
const float ChannelMapperReader::MONO_ANGLES[] =
{
0.0f * M_PI / 180.0f
deg2rad(0.0)
};
const float ChannelMapperReader::STEREO_ANGLES[] =
{
-90.0f * M_PI / 180.0f,
90.0f * M_PI / 180.0f
deg2rad(-90.0),
deg2rad( 90.0)
};
const float ChannelMapperReader::STEREO_LFE_ANGLES[] =
{
-90.0f * M_PI / 180.0f,
90.0f * M_PI / 180.0f,
0.0f * M_PI / 180.0f
deg2rad(-90.0),
deg2rad( 90.0),
deg2rad( 0.0)
};
const float ChannelMapperReader::SURROUND4_ANGLES[] =
{
-45.0f * M_PI / 180.0f,
45.0f * M_PI / 180.0f,
-135.0f * M_PI / 180.0f,
135.0f * M_PI / 180.0f
deg2rad( -45.0),
deg2rad( 45.0),
deg2rad(-135.0),
deg2rad( 135.0)
};
const float ChannelMapperReader::SURROUND5_ANGLES[] =
{
-30.0f * M_PI / 180.0f,
30.0f * M_PI / 180.0f,
0.0f * M_PI / 180.0f,
-110.0f * M_PI / 180.0f,
110.0f * M_PI / 180.0f
deg2rad( -30.0),
deg2rad( 30.0),
deg2rad( 0.0),
deg2rad(-110.0),
deg2rad( 110.0)
};
const float ChannelMapperReader::SURROUND51_ANGLES[] =
{
-30.0f * M_PI / 180.0f,
30.0f * M_PI / 180.0f,
0.0f * M_PI / 180.0f,
0.0f * M_PI / 180.0f,
-110.0f * M_PI / 180.0f,
110.0f * M_PI / 180.0f
deg2rad( -30.0),
deg2rad( 30.0),
deg2rad( 0.0),
deg2rad( 0.0),
deg2rad(-110.0),
deg2rad( 110.0)
};
const float ChannelMapperReader::SURROUND61_ANGLES[] =
{
-30.0f * M_PI / 180.0f,
30.0f * M_PI / 180.0f,
0.0f * M_PI / 180.0f,
0.0f * M_PI / 180.0f,
180.0f * M_PI / 180.0f,
-110.0f * M_PI / 180.0f,
110.0f * M_PI / 180.0f
deg2rad( -30.0),
deg2rad( 30.0),
deg2rad( 0.0),
deg2rad( 0.0),
deg2rad( 180.0),
deg2rad(-110.0),
deg2rad( 110.0)
};
const float ChannelMapperReader::SURROUND71_ANGLES[] =
{
-30.0f * M_PI / 180.0f,
30.0f * M_PI / 180.0f,
0.0f * M_PI / 180.0f,
0.0f * M_PI / 180.0f,
-110.0f * M_PI / 180.0f,
110.0f * M_PI / 180.0f,
-150.0f * M_PI / 180.0f,
150.0f * M_PI / 180.0f
deg2rad( -30.0),
deg2rad( 30.0),
deg2rad( 0.0),
deg2rad( 0.0),
deg2rad(-110.0),
deg2rad( 110.0),
deg2rad(-150.0),
deg2rad( 150.0)
};
const float* ChannelMapperReader::CHANNEL_ANGLES[] =

View File

@@ -16,11 +16,6 @@
#
# The Original Code is Copyright (C) 2006, Blender Foundation
# All rights reserved.
#
# The Original Code is: all of this file.
#
# Contributor(s): Jacques Beaurai, Erwin Coumans
#
# ***** END GPL LICENSE BLOCK *****
set(INC

View File

@@ -16,10 +16,6 @@
#
# The Original Code is Copyright (C) 2012, Blender Foundation
# All rights reserved.
#
# Contributor(s): Blender Foundation,
# Sergey Sharybin
#
# ***** END GPL LICENSE BLOCK *****
# NOTE: This file is automatically generated by bundle.sh script

View File

@@ -16,11 +16,6 @@
#
# The Original Code is Copyright (C) 2006, Blender Foundation
# All rights reserved.
#
# The Original Code is: all of this file.
#
# Contributor(s): Jacques Beaurain.
#
# ***** END GPL LICENSE BLOCK *****
set(INC

View File

@@ -16,11 +16,6 @@
#
# The Original Code is Copyright (C) 2006, Blender Foundation
# All rights reserved.
#
# The Original Code is: all of this file.
#
# Contributor(s): Jacques Beaurain.
#
# ***** END GPL LICENSE BLOCK *****
set(INC

View File

@@ -1490,4 +1490,3 @@ int curve_fit_cubic_to_points_refit_fl(
return result;
}

View File

@@ -16,10 +16,6 @@
#
# The Original Code is Copyright (C) 2016, Blender Foundation
# All rights reserved.
#
# Contributor(s): Blender Foundation,
# Sergey Sharybin
#
# ***** END GPL LICENSE BLOCK *****
set(INC

View File

@@ -16,11 +16,6 @@
#
# The Original Code is Copyright (C) 2013, Blender Foundation
# All rights reserved.
#
# The Original Code is: all of this file.
#
# Contributor(s): Jason Wilkins
#
# ***** END GPL LICENSE BLOCK *****
set(INC

View File

@@ -16,11 +16,6 @@
#
# The Original Code is Copyright (C) 2006, Blender Foundation
# All rights reserved.
#
# The Original Code is: all of this file.
#
# Contributor(s): Jacques Beaurain.
#
# ***** END GPL LICENSE BLOCK *****
set(INC

View File

@@ -16,10 +16,6 @@
#
# The Original Code is Copyright (C) 2016, Blender Foundation
# All rights reserved.
#
# Contributor(s): Blender Foundation,
# Sergey Sharybin
#
# ***** END GPL LICENSE BLOCK *****
set(INC

View File

@@ -16,9 +16,6 @@
#
# The Original Code is Copyright (C) 2014, Blender Foundation
# All rights reserved.
#
# Contributor(s): Sergey Sharybin
#
# ***** END GPL LICENSE BLOCK *****
set(INC

View File

@@ -16,9 +16,6 @@
#
# The Original Code is Copyright (C) 2014, Blender Foundation
# All rights reserved.
#
# Contributor(s): Sergey Sharybin
#
# ***** END GPL LICENSE BLOCK *****
# avoid noisy warnings

View File

@@ -16,11 +16,6 @@
#
# The Original Code is Copyright (C) 2006, Blender Foundation
# All rights reserved.
#
# The Original Code is: all of this file.
#
# Contributor(s): Daniel Genrich
#
# ***** END GPL LICENSE BLOCK *****
set(INC

View File

@@ -16,11 +16,6 @@
#
# The Original Code is Copyright (C) 2006, Blender Foundation
# All rights reserved.
#
# The Original Code is: all of this file.
#
# Contributor(s): Daniel Genrich
#
# ***** END GPL LICENSE BLOCK *****
remove_strict_flags()

View File

@@ -16,11 +16,6 @@
#
# The Original Code is Copyright (C) 2006, Blender Foundation
# All rights reserved.
#
# The Original Code is: all of this file.
#
# Contributor(s): Jacques Beaurain.
#
# ***** END GPL LICENSE BLOCK *****
set(INC

View File

@@ -16,11 +16,6 @@
#
# The Original Code is Copyright (C) 2013, Blender Foundation
# All rights reserved.
#
# The Original Code is: all of this file.
#
# Contributor(s): none yet.
#
# ***** END GPL LICENSE BLOCK *****
set(INC

View File

@@ -1,6 +1,4 @@
/*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
@@ -17,10 +15,6 @@
*
* The Original Code is Copyright (C) 2013 Blender Foundation.
* All rights reserved.
*
* Contributor(s): none yet.
*
* ***** END GPL LICENSE BLOCK *****
*/
#ifndef __WCWIDTH_H__

View File

@@ -16,11 +16,6 @@
#
# The Original Code is Copyright (C) 2012, Blender Foundation
# All rights reserved.
#
# The Original Code is: all of this file.
#
# Contributor(s): Sergey Sharybin.
#
# ***** END GPL LICENSE BLOCK *****
set(INC

View File

@@ -16,11 +16,6 @@
#
# The Original Code is Copyright (C) 2006, Blender Foundation
# All rights reserved.
#
# The Original Code is: all of this file.
#
# Contributor(s): Jacques Beaurain.
#
# ***** END GPL LICENSE BLOCK *****
# add_subdirectory(atomic) # header only

View File

@@ -24,9 +24,6 @@
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
@@ -45,17 +42,13 @@
* All rights reserved.
*
* The Original Code is: adapted from jemalloc.
*
* ***** END GPL LICENSE BLOCK *****
*/
/**
* \file atomic_ops.h
/** \file
* \ingroup Atomic
*
* \author Copyright (C) 2016 Blender Foundation, adapted from jemalloc.
* \brief Provides wrapper around system-specific atomic primitives, and some extensions (faked-atomic operations
* over float numbers).
* \brief Provides wrapper around system-specific atomic primitives,
* and some extensions (faked-atomic operations over float numbers).
*/
#ifndef __ATOMIC_OPS_H__

View File

@@ -24,9 +24,6 @@
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
@@ -45,8 +42,6 @@
* All rights reserved.
*
* The Original Code is: adapted from jemalloc.
*
* ***** END GPL LICENSE BLOCK *****
*/
#ifndef __ATOMIC_OPS_EXT_H__

View File

@@ -24,9 +24,6 @@
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
@@ -45,8 +42,6 @@
* All rights reserved.
*
* The Original Code is: adapted from jemalloc.
*
* ***** END GPL LICENSE BLOCK *****
*/
#ifndef __ATOMIC_OPS_UNIX_H__

View File

@@ -24,9 +24,6 @@
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
@@ -45,8 +42,6 @@
* All rights reserved.
*
* The Original Code is: adapted from jemalloc.
*
* ***** END GPL LICENSE BLOCK *****
*/
#ifndef __ATOMIC_OPS_UTILS_H__

View File

@@ -1,6 +1,4 @@
/*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* Copyright 2009-2011 Jörg Hermann Müller
*
* This file is part of AudaSpace.
@@ -18,12 +16,10 @@
* You should have received a copy of the GNU General Public License
* along with Audaspace; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* ***** END GPL LICENSE BLOCK *****
*/
/** \file audaspace/intern/AUD_PyInit.cpp
* \ingroup audaspaceintern
/** \file
* \ingroup audaspaceintern
*/
#include "AUD_PyInit.h"

View File

@@ -1,6 +1,4 @@
/*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* Copyright 2009-2011 Jörg Hermann Müller
*
* This file is part of AudaSpace.
@@ -18,12 +16,10 @@
* You should have received a copy of the GNU General Public License
* along with Audaspace; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* ***** END GPL LICENSE BLOCK *****
*/
/** \file audaspace/intern/AUD_PyInit.h
* \ingroup audaspaceintern
/** \file
* \ingroup audaspaceintern
*/

View File

@@ -1,6 +1,4 @@
/*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* Copyright 2009-2011 Jörg Hermann Müller
*
* This file is part of AudaSpace.
@@ -18,12 +16,10 @@
* You should have received a copy of the GNU General Public License
* along with Audaspace; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* ***** END GPL LICENSE BLOCK *****
*/
/** \file audaspace/intern/AUD_Set.cpp
* \ingroup audaspaceintern
/** \file
* \ingroup audaspaceintern
*/
#include <set>

View File

@@ -1,6 +1,4 @@
/*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* Copyright 2009-2011 Jörg Hermann Müller
*
* This file is part of AudaSpace.
@@ -18,12 +16,10 @@
* You should have received a copy of the GNU General Public License
* along with Audaspace; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* ***** END GPL LICENSE BLOCK *****
*/
/** \file AUD_Set.h
* \ingroup audaspace
/** \file
* \ingroup audaspace
*/
#ifndef __AUD_SET_H__

View File

@@ -1,6 +1,4 @@
/*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
@@ -14,15 +12,13 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* ***** END GPL LICENSE BLOCK *****
*/
#ifndef __CLOG_H__
#define __CLOG_H__
#ifndef __CLG_LOG_H__
#define __CLG_LOG_H__
/** \file clog/CLG_log.h
* \ingroup clog
/** \file
* \ingroup clog
*
* C Logging Library (clog)
* ========================
@@ -53,8 +49,6 @@
* - `WARN`: General warnings (which aren't necessary to show to users).
* - `ERROR`: An error we can recover from, should not happen.
* - `FATAL`: Similar to assert. This logs the message, then a stack trace and abort.
*
*
* Verbosity Level
* ---------------
*
@@ -90,11 +84,6 @@ extern "C" {
# define _CLOG_ATTR_PRINTF_FORMAT(format_param, dots_param)
#endif
#if defined(_MSC_VER) && !defined(__func__)
# define __func__MSVC
# define __func__ __FUNCTION__
#endif
#define STRINGIFY_ARG(x) "" #x
#define STRINGIFY_APPEND(a, b) "" a #b
#define STRINGIFY(x) STRINGIFY_APPEND("", x)
@@ -145,6 +134,7 @@ void CLG_exit(void);
void CLG_output_set(void *file_handle);
void CLG_output_use_basename_set(int value);
void CLG_output_use_timestamp_set(int value);
void CLG_fatal_fn_set(void (*fatal_fn)(void *file_handle));
void CLG_backtrace_fn_set(void (*fatal_fn)(void *file_handle));
@@ -174,7 +164,7 @@ void CLG_logref_init(CLG_LogRef *clg_ref);
#define CLOG_STR_AT_SEVERITY(clg_ref, severity, verbose_level, str) { \
CLG_LogType *_lg_ty = CLOG_ENSURE(clg_ref); \
if (((_lg_ty->flag & CLG_FLAG_USE) && (_lg_ty->level >= verbose_level)) || (severity >= CLG_SEVERITY_WARN)) { \
CLG_log_str(lg, severity, __FILE__ ":" STRINGIFY(__LINE__), __func__, str); \
CLG_log_str(_lg_ty, severity, __FILE__ ":" STRINGIFY(__LINE__), __func__, str); \
} \
} ((void)0)
@@ -192,23 +182,19 @@ void CLG_logref_init(CLG_LogRef *clg_ref);
#define CLOG_ERROR(clg_ref, ...) CLOG_AT_SEVERITY(clg_ref, CLG_SEVERITY_ERROR, 0, __VA_ARGS__)
#define CLOG_FATAL(clg_ref, ...) CLOG_AT_SEVERITY(clg_ref, CLG_SEVERITY_FATAL, 0, __VA_ARGS__)
#define CLOG_STR_INFO(clg_ref, level, ...) CLOG_STR_AT_SEVERITY(clg_ref, CLG_SEVERITY_INFO, level, __VA_ARGS__)
#define CLOG_STR_WARN(clg_ref, ...) CLOG_STR_AT_SEVERITY(clg_ref, CLG_SEVERITY_WARN, 0, __VA_ARGS__)
#define CLOG_STR_ERROR(clg_ref, ...) CLOG_STR_AT_SEVERITY(clg_ref, CLG_SEVERITY_ERROR, 0, __VA_ARGS__)
#define CLOG_STR_FATAL(clg_ref, ...) CLOG_STR_AT_SEVERITY(clg_ref, CLG_SEVERITY_FATAL, 0, __VA_ARGS__)
#define CLOG_STR_INFO(clg_ref, level, str) CLOG_STR_AT_SEVERITY(clg_ref, CLG_SEVERITY_INFO, level, str)
#define CLOG_STR_WARN(clg_ref, str) CLOG_STR_AT_SEVERITY(clg_ref, CLG_SEVERITY_WARN, 0, str)
#define CLOG_STR_ERROR(clg_ref, str) CLOG_STR_AT_SEVERITY(clg_ref, CLG_SEVERITY_ERROR, 0, str)
#define CLOG_STR_FATAL(clg_ref, str) CLOG_STR_AT_SEVERITY(clg_ref, CLG_SEVERITY_FATAL, 0, str)
/* Allocated string which is immediately freed. */
#define CLOG_STR_INFO_N(clg_ref, level, ...) CLOG_STR_AT_SEVERITY_N(clg_ref, CLG_SEVERITY_INFO, level, __VA_ARGS__)
#define CLOG_STR_WARN_N(clg_ref, ...) CLOG_STR_AT_SEVERITY_N(clg_ref, CLG_SEVERITY_WARN, 0, __VA_ARGS__)
#define CLOG_STR_ERROR_N(clg_ref, ...) CLOG_STR_AT_SEVERITY_N(clg_ref, CLG_SEVERITY_ERROR, 0, __VA_ARGS__)
#define CLOG_STR_FATAL_N(clg_ref, ...) CLOG_STR_AT_SEVERITY_N(clg_ref, CLG_SEVERITY_FATAL, 0, __VA_ARGS__)
#ifdef __func__MSVC
# undef __func__MSVC
#endif
#define CLOG_STR_INFO_N(clg_ref, level, str) CLOG_STR_AT_SEVERITY_N(clg_ref, CLG_SEVERITY_INFO, level, str)
#define CLOG_STR_WARN_N(clg_ref, str) CLOG_STR_AT_SEVERITY_N(clg_ref, CLG_SEVERITY_WARN, 0, str)
#define CLOG_STR_ERROR_N(clg_ref, str) CLOG_STR_AT_SEVERITY_N(clg_ref, CLG_SEVERITY_ERROR, 0, str)
#define CLOG_STR_FATAL_N(clg_ref, str) CLOG_STR_AT_SEVERITY_N(clg_ref, CLG_SEVERITY_FATAL, 0, str)
#ifdef __cplusplus
}
#endif
#endif /* __CLOG_H__ */
#endif /* __CLG_LOG_H__ */

View File

@@ -18,6 +18,7 @@
set(INC
.
../atomic
../guardedalloc
)
@@ -31,4 +32,7 @@ set(SRC
CLG_log.h
)
# Disabled for makesdna/makesrna.
add_definitions(-DWITH_CLOG_PTHREADS)
blender_add_lib(bf_intern_clog "${SRC}" "${INC}" "${INC_SYS}")

View File

@@ -1,6 +1,4 @@
/*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
@@ -14,12 +12,10 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* ***** END GPL LICENSE BLOCK *****
*/
/** \file clog/clog.c
* \ingroup clog
/** \file
* \ingroup clog
*/
#include <stdarg.h>
@@ -28,14 +24,29 @@
#include <stdint.h>
#include <assert.h>
/* Disable for small single threaded programs
* to avoid having to link with pthreads. */
#ifdef WITH_CLOG_PTHREADS
# include <pthread.h>
# include "atomic_ops.h"
#endif
/* For 'isatty' to check for color. */
#if defined(__unix__) || defined(__APPLE__) || defined(__HAIKU__)
# include <unistd.h>
# include <sys/time.h>
#endif
#if defined(_MSC_VER)
# include <io.h>
# include <windows.h>
#endif
/* For printing timestamp. */
#define __STDC_FORMAT_MACROS
#include <inttypes.h>
/* Only other dependency (could use regular malloc too). */
#include "MEM_guardedalloc.h"
@@ -65,15 +76,23 @@ typedef struct CLG_IDFilter {
typedef struct CLogContext {
/** Single linked list of types. */
CLG_LogType *types;
#ifdef WITH_CLOG_PTHREADS
pthread_mutex_t types_lock;
#endif
/* exclude, include filters. */
CLG_IDFilter *filters[2];
bool use_color;
bool use_basename;
bool use_timestamp;
/** Borrowed, not owned. */
int output;
FILE *output_file;
/** For timer (use_timestamp). */
uint64_t timestamp_tick_start;
/** For new types. */
struct {
int level;
@@ -346,12 +365,35 @@ static void clg_ctx_backtrace(CLogContext *ctx)
fflush(ctx->output_file);
}
static uint64_t clg_timestamp_ticks_get(void)
{
uint64_t tick;
#if defined(_MSC_VER)
tick = GetTickCount64();
#else
struct timeval tv;
gettimeofday(&tv, NULL);
tick = tv.tv_sec * 1000 + tv.tv_usec / 1000;
#endif
return tick;
}
/** \} */
/* -------------------------------------------------------------------- */
/** \name Logging API
* \{ */
static void write_timestamp(CLogStringBuf *cstr, const uint64_t timestamp_tick_start)
{
char timestamp_str[64];
const uint64_t timestamp = clg_timestamp_ticks_get() - timestamp_tick_start;
const uint timestamp_len = snprintf(
timestamp_str, sizeof(timestamp_str), "%" PRIu64 ".%03u ",
timestamp / 1000, (uint)(timestamp % 1000));
clg_str_append_with_len(cstr, timestamp_str, timestamp_len);
}
static void write_severity(CLogStringBuf *cstr, enum CLG_Severity severity, bool use_color)
{
assert((unsigned int)severity < CLG_SEVERITY_LEN);
@@ -403,6 +445,10 @@ void CLG_log_str(
char cstr_stack_buf[CLOG_BUF_LEN_INIT];
clg_str_init(&cstr, cstr_stack_buf, sizeof(cstr_stack_buf));
if (lg->ctx->use_timestamp) {
write_timestamp(&cstr, lg->ctx->timestamp_tick_start);
}
write_severity(&cstr, severity, lg->ctx->use_color);
write_type(&cstr, lg);
@@ -435,6 +481,10 @@ void CLG_logf(
char cstr_stack_buf[CLOG_BUF_LEN_INIT];
clg_str_init(&cstr, cstr_stack_buf, sizeof(cstr_stack_buf));
if (lg->ctx->use_timestamp) {
write_timestamp(&cstr, lg->ctx->timestamp_tick_start);
}
write_severity(&cstr, severity, lg->ctx->use_color);
write_type(&cstr, lg);
@@ -483,6 +533,14 @@ static void CLG_ctx_output_use_basename_set(CLogContext *ctx, int value)
ctx->use_basename = (bool)value;
}
static void CLG_ctx_output_use_timestamp_set(CLogContext *ctx, int value)
{
ctx->use_timestamp = (bool)value;
if (ctx->use_timestamp) {
ctx->timestamp_tick_start = clg_timestamp_ticks_get();
}
}
/** Action on fatal severity. */
static void CLG_ctx_fatal_fn_set(CLogContext *ctx, void (*fatal_fn)(void *file_handle))
{
@@ -527,6 +585,9 @@ static void CLG_ctx_level_set(CLogContext *ctx, int level)
static CLogContext *CLG_ctx_init(void)
{
CLogContext *ctx = MEM_callocN(sizeof(*ctx), __func__);
#ifdef WITH_CLOG_PTHREADS
pthread_mutex_init(&ctx->types_lock, NULL);
#endif
ctx->use_color = true;
ctx->default_type.level = 1;
CLG_ctx_output_set(ctx, stdout);
@@ -549,6 +610,9 @@ static void CLG_ctx_free(CLogContext *ctx)
MEM_freeN(item);
}
}
#ifdef WITH_CLOG_PTHREADS
pthread_mutex_destroy(&ctx->types_lock);
#endif
MEM_freeN(ctx);
}
@@ -585,6 +649,10 @@ void CLG_output_use_basename_set(int value)
CLG_ctx_output_use_basename_set(g_ctx, value);
}
void CLG_output_use_timestamp_set(int value)
{
CLG_ctx_output_use_timestamp_set(g_ctx, value);
}
void CLG_fatal_fn_set(void (*fatal_fn)(void *file_handle))
{
@@ -621,9 +689,24 @@ void CLG_level_set(int level)
void CLG_logref_init(CLG_LogRef *clg_ref)
{
assert(clg_ref->type == NULL);
CLG_LogType *clg_ty = clg_ctx_type_find_by_name(g_ctx, clg_ref->identifier);
clg_ref->type = clg_ty ? clg_ty : clg_ctx_type_register(g_ctx, clg_ref->identifier);
#ifdef WITH_CLOG_PTHREADS
/* Only runs once when initializing a static type in most cases. */
pthread_mutex_lock(&g_ctx->types_lock);
#endif
if (clg_ref->type == NULL) {
CLG_LogType *clg_ty = clg_ctx_type_find_by_name(g_ctx, clg_ref->identifier);
if (clg_ty == NULL) {
clg_ty = clg_ctx_type_register(g_ctx, clg_ref->identifier);
}
#ifdef WITH_CLOG_PTHREADS
atomic_cas_ptr((void **)&clg_ref->type, clg_ref->type, clg_ty);
#else
clg_ref->type = clg_ty;
#endif
}
#ifdef WITH_CLOG_PTHREADS
pthread_mutex_unlock(&g_ctx->types_lock);
#endif
}
/** \} */

View File

@@ -36,7 +36,7 @@ if(WITH_CYCLES_OSL)
endif()
if(NOT CYCLES_STANDALONE_REPOSITORY)
list(APPEND LIBRARIES bf_intern_glew_mx bf_intern_guardedalloc)
list(APPEND LIBRARIES bf_intern_glew_mx bf_intern_guardedalloc bf_intern_numaapi)
endif()
if(WITH_CYCLES_LOGGING)

View File

@@ -63,7 +63,7 @@ public:
bool fast_math;
};
bool compile_cuda(CompilationSettings &settings)
static bool compile_cuda(CompilationSettings &settings)
{
const char* headers[] = {"stdlib.h" , "float.h", "math.h", "stdio.h"};
const char* header_content[] = {"\n", "\n", "\n", "\n"};
@@ -99,7 +99,7 @@ bool compile_cuda(CompilationSettings &settings)
headers); // includeNames
if(result != NVRTC_SUCCESS) {
fprintf(stderr, "Error: nvrtcCreateProgram failed (%x)\n\n", result);
fprintf(stderr, "Error: nvrtcCreateProgram failed (%d)\n\n", (int)result);
return false;
}
@@ -112,7 +112,7 @@ bool compile_cuda(CompilationSettings &settings)
result = nvrtcCompileProgram(prog, options.size(), &opts[0]);
if(result != NVRTC_SUCCESS) {
fprintf(stderr, "Error: nvrtcCompileProgram failed (%x)\n\n", result);
fprintf(stderr, "Error: nvrtcCompileProgram failed (%d)\n\n", (int)result);
size_t log_size;
nvrtcGetProgramLogSize(prog, &log_size);
@@ -128,14 +128,14 @@ bool compile_cuda(CompilationSettings &settings)
size_t ptx_size;
result = nvrtcGetPTXSize(prog, &ptx_size);
if(result != NVRTC_SUCCESS) {
fprintf(stderr, "Error: nvrtcGetPTXSize failed (%x)\n\n", result);
fprintf(stderr, "Error: nvrtcGetPTXSize failed (%d)\n\n", (int)result);
return false;
}
vector<char> ptx_code(ptx_size);
result = nvrtcGetPTX(prog, &ptx_code[0]);
if(result != NVRTC_SUCCESS) {
fprintf(stderr, "Error: nvrtcGetPTX failed (%x)\n\n", result);
fprintf(stderr, "Error: nvrtcGetPTX failed (%d)\n\n", (int)result);
return false;
}
@@ -148,7 +148,7 @@ bool compile_cuda(CompilationSettings &settings)
return true;
}
bool link_ptxas(CompilationSettings &settings)
static bool link_ptxas(CompilationSettings &settings)
{
string cudapath = "";
if(settings.cuda_toolkit_dir.size())
@@ -166,7 +166,7 @@ bool link_ptxas(CompilationSettings &settings)
int pxresult = system(ptx.c_str());
if(pxresult) {
fprintf(stderr, "Error: ptxas failed (%x)\n\n", pxresult);
fprintf(stderr, "Error: ptxas failed (%d)\n\n", pxresult);
return false;
}
@@ -177,17 +177,19 @@ bool link_ptxas(CompilationSettings &settings)
return true;
}
bool init(CompilationSettings &settings)
static bool init(CompilationSettings &settings)
{
#ifdef _MSC_VER
if(settings.cuda_toolkit_dir.size()) {
SetDllDirectory((settings.cuda_toolkit_dir + "/bin").c_str());
}
#else
(void)settings;
#endif
int cuewresult = cuewInit(CUEW_INIT_NVRTC);
if(cuewresult != CUEW_SUCCESS) {
fprintf(stderr, "Error: cuew init fialed (0x%x)\n\n", cuewresult);
fprintf(stderr, "Error: cuew init fialed (0x%d)\n\n", cuewresult);
return false;
}
@@ -229,7 +231,7 @@ bool init(CompilationSettings &settings)
return true;
}
bool parse_parameters(int argc, const char **argv, CompilationSettings &settings)
static bool parse_parameters(int argc, const char **argv, CompilationSettings &settings)
{
OIIO::ArgParse ap;
ap.options("Usage: cycles_cubin_cc [options]",

View File

@@ -363,13 +363,8 @@ static void options_parse(int argc, const char **argv)
string devicename = "CPU";
bool list = false;
vector<DeviceType>& types = Device::available_types();
/* TODO(sergey): Here's a feedback loop happens: on the one hand we want
* the device list to be printed in help message, on the other hand logging
* is not initialized yet so we wouldn't have debug log happening in the
* device initialization.
*/
/* List devices for which support is compiled in. */
vector<DeviceType> types = Device::available_types();
foreach(DeviceType type, types) {
if(device_names != "")
device_names += ", ";
@@ -421,7 +416,7 @@ static void options_parse(int argc, const char **argv)
}
if(list) {
vector<DeviceInfo>& devices = Device::available_devices();
vector<DeviceInfo> devices = Device::available_devices();
printf("Devices:\n");
foreach(DeviceInfo& info, devices) {
@@ -456,15 +451,12 @@ static void options_parse(int argc, const char **argv)
/* find matching device */
DeviceType device_type = Device::type_from_string(devicename.c_str());
vector<DeviceInfo>& devices = Device::available_devices();
bool device_available = false;
vector<DeviceInfo> devices = Device::available_devices(DEVICE_MASK(device_type));
foreach(DeviceInfo& device, devices) {
if(device_type == device.type) {
options.session_params.device = device;
device_available = true;
break;
}
bool device_available = false;
if (!devices.empty()) {
options.session_params.device = devices.front();
device_available = true;
}
/* handle invalid configurations */

View File

@@ -17,6 +17,7 @@ set(INC_SYS
set(SRC
blender_camera.cpp
blender_device.cpp
blender_mesh.cpp
blender_object.cpp
blender_object_cull.cpp
@@ -40,6 +41,7 @@ set(SRC
set(ADDON_FILES
addon/__init__.py
addon/engine.py
addon/operators.py
addon/osl.py
addon/presets.py
addon/properties.py
@@ -49,6 +51,10 @@ set(ADDON_FILES
add_definitions(${GL_DEFINITIONS})
if(WITH_CYCLES_DEVICE_OPENCL)
add_definitions(-DWITH_OPENCL)
endif()
if(WITH_CYCLES_NETWORK)
add_definitions(-DWITH_NETWORK)
endif()

View File

@@ -37,6 +37,8 @@ if "bpy" in locals():
importlib.reload(version_update)
if "ui" in locals():
importlib.reload(ui)
if "operators" in locals():
importlib.reload(operators)
if "properties" in locals():
importlib.reload(properties)
if "presets" in locals():
@@ -119,6 +121,7 @@ classes = (
def register():
from bpy.utils import register_class
from . import ui
from . import operators
from . import properties
from . import presets
import atexit
@@ -131,6 +134,7 @@ def register():
properties.register()
ui.register()
operators.register()
presets.register()
for cls in classes:
@@ -142,6 +146,7 @@ def register():
def unregister():
from bpy.utils import unregister_class
from . import ui
from . import operators
from . import properties
from . import presets
import atexit
@@ -149,6 +154,7 @@ def unregister():
bpy.app.handlers.version_update.remove(version_update.do_versions)
ui.unregister()
operators.unregister()
properties.unregister()
presets.unregister()

View File

@@ -270,14 +270,11 @@ def register_passes(engine, scene, srl):
engine.register_pass(scene, srl, "Noisy Image", 4, "RGBA", 'COLOR')
if crl.denoising_store_passes:
engine.register_pass(scene, srl, "Denoising Normal", 3, "XYZ", 'VECTOR')
engine.register_pass(scene, srl, "Denoising Normal Variance", 3, "XYZ", 'VECTOR')
engine.register_pass(scene, srl, "Denoising Albedo", 3, "RGB", 'COLOR')
engine.register_pass(scene, srl, "Denoising Albedo Variance", 3, "RGB", 'COLOR')
engine.register_pass(scene, srl, "Denoising Depth", 1, "Z", 'VALUE')
engine.register_pass(scene, srl, "Denoising Depth Variance", 1, "Z", 'VALUE')
engine.register_pass(scene, srl, "Denoising Shadow A", 3, "XYV", 'VECTOR')
engine.register_pass(scene, srl, "Denoising Shadow B", 3, "XYV", 'VECTOR')
engine.register_pass(scene, srl, "Denoising Image Variance", 3, "RGB", 'COLOR')
engine.register_pass(scene, srl, "Denoising Shadowing", 1, "X", 'VALUE')
engine.register_pass(scene, srl, "Denoising Variance", 3, "RGB", 'COLOR')
engine.register_pass(scene, srl, "Denoising Intensity", 1, "X", 'VALUE')
clean_options = ("denoising_diffuse_direct", "denoising_diffuse_indirect",
"denoising_glossy_direct", "denoising_glossy_indirect",
"denoising_transmission_direct", "denoising_transmission_indirect",

View File

@@ -0,0 +1,141 @@
#
# Copyright 2011-2019 Blender Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# <pep8 compliant>
import bpy
from bpy.types import Operator
from bpy.props import StringProperty
class CYCLES_OT_use_shading_nodes(Operator):
"""Enable nodes on a material, world or light"""
bl_idname = "cycles.use_shading_nodes"
bl_label = "Use Nodes"
@classmethod
def poll(cls, context):
return (getattr(context, "material", False) or getattr(context, "world", False) or
getattr(context, "light", False))
def execute(self, context):
if context.material:
context.material.use_nodes = True
elif context.world:
context.world.use_nodes = True
elif context.light:
context.light.use_nodes = True
return {'FINISHED'}
class CYCLES_OT_denoise_animation(Operator):
"Denoise rendered animation sequence using current scene and view " \
"layer settings. Requires denoising data passes and output to " \
"OpenEXR multilayer files"
bl_idname = "cycles.denoise_animation"
bl_label = "Denoise Animation"
input_filepath: StringProperty(
name='Input Filepath',
description='File path for image to denoise. If not specified, uses the render file path and frame range from the scene',
default='',
subtype='FILE_PATH')
output_filepath: StringProperty(
name='Output Filepath',
description='If not specified, renders will be denoised in-place',
default='',
subtype='FILE_PATH')
def execute(self, context):
import os
preferences = context.preferences
scene = context.scene
view_layer = context.view_layer
in_filepath = self.input_filepath
out_filepath = self.output_filepath
in_filepaths = []
out_filepaths = []
if in_filepath != '':
# Denoise a single file
if out_filepath == '':
out_filepath = in_filepath
in_filepaths.append(in_filepath)
out_filepaths.append(out_filepath)
else:
# Denoise animation sequence with expanded frames matching
# Blender render output file naming.
in_filepath = scene.render.filepath
if out_filepath == '':
out_filepath = in_filepath
# Backup since we will overwrite the scene path temporarily
original_filepath = scene.render.filepath
for frame in range(scene.frame_start, scene.frame_end + 1):
scene.render.filepath = in_filepath
filepath = scene.render.frame_path(frame=frame)
in_filepaths.append(filepath)
if not os.path.isfile(filepath):
scene.render.filepath = original_filepath
self.report({'ERROR'}, f"Frame '{filepath}' not found, animation must be complete.")
return {'CANCELLED'}
scene.render.filepath = out_filepath
filepath = scene.render.frame_path(frame=frame)
out_filepaths.append(filepath)
scene.render.filepath = original_filepath
# Run denoiser
# TODO: support cancel and progress reports.
import _cycles
try:
_cycles.denoise(preferences.as_pointer(),
scene.as_pointer(),
view_layer.as_pointer(),
input=in_filepaths,
output=out_filepaths)
except Exception as e:
self.report({'ERROR'}, str(e))
return {'FINISHED'}
self.report({'INFO'}, "Denoising completed.")
return {'FINISHED'}
classes = (
CYCLES_OT_use_shading_nodes,
CYCLES_OT_denoise_animation
)
def register():
from bpy.utils import register_class
for cls in classes:
register_class(cls)
def unregister():
from bpy.utils import unregister_class
for cls in classes:
unregister_class(cls)

View File

@@ -24,7 +24,7 @@ class AddPresetIntegrator(AddPresetBase, Operator):
'''Add an Integrator Preset'''
bl_idname = "render.cycles_integrator_preset_add"
bl_label = "Add Integrator Preset"
preset_menu = "CYCLES_MT_integrator_presets"
preset_menu = "CYCLES_PT_integrator_presets"
preset_defines = [
"cycles = bpy.context.scene.cycles"
@@ -49,7 +49,7 @@ class AddPresetSampling(AddPresetBase, Operator):
'''Add a Sampling Preset'''
bl_idname = "render.cycles_sampling_preset_add"
bl_label = "Add Sampling Preset"
preset_menu = "CYCLES_MT_sampling_presets"
preset_menu = "CYCLES_PT_sampling_presets"
preset_defines = [
"cycles = bpy.context.scene.cycles"

View File

@@ -360,7 +360,8 @@ class CyclesRenderSettings(bpy.types.PropertyGroup):
description="Distance between volume shader samples when rendering the volume "
"(lower values give more accurate and detailed results, but also increased render time)",
default=0.1,
min=0.0000001, max=100000.0, soft_min=0.01, soft_max=1.0, precision=4
min=0.0000001, max=100000.0, soft_min=0.01, soft_max=1.0, precision=4,
unit='LENGTH'
)
volume_max_steps: IntProperty(
@@ -376,14 +377,14 @@ class CyclesRenderSettings(bpy.types.PropertyGroup):
description="Size of a micropolygon in pixels",
min=0.1, max=1000.0, soft_min=0.5,
default=1.0,
subtype="PIXEL"
subtype='PIXEL'
)
preview_dicing_rate: FloatProperty(
name="Preview Dicing Rate",
description="Size of a micropolygon in pixels during preview render",
min=0.1, max=1000.0, soft_min=0.5,
default=8.0,
subtype="PIXEL"
subtype='PIXEL'
)
max_subdivisions: IntProperty(
@@ -456,6 +457,7 @@ class CyclesRenderSettings(bpy.types.PropertyGroup):
description="Pixel filter width",
min=0.01, max=10.0,
default=1.5,
subtype='PIXEL'
)
seed: IntProperty(
@@ -502,6 +504,7 @@ class CyclesRenderSettings(bpy.types.PropertyGroup):
"progressively increasing it to the full viewport size",
min=8, max=16384,
default=64,
subtype='PIXEL'
)
debug_reset_timeout: FloatProperty(
@@ -596,7 +599,8 @@ class CyclesRenderSettings(bpy.types.PropertyGroup):
name="Camera Cull Margin",
description="Margin for the camera space culling",
default=0.1,
min=0.0, max=5.0
min=0.0, max=5.0,
subtype='FACTOR'
)
use_distance_cull: BoolProperty(
@@ -609,7 +613,8 @@ class CyclesRenderSettings(bpy.types.PropertyGroup):
name="Cull Distance",
description="Cull objects which are further away from camera than this distance",
default=50,
min=0.0
min=0.0,
unit='LENGTH'
)
motion_blur_position: EnumProperty(
@@ -639,6 +644,7 @@ class CyclesRenderSettings(bpy.types.PropertyGroup):
description="Scanline \"exposure\" time for the rolling shutter effect",
default=0.1,
min=0.0, max=1.0,
subtype='FACTOR',
)
texture_limit: EnumProperty(
@@ -718,7 +724,7 @@ class CyclesRenderSettings(bpy.types.PropertyGroup):
debug_opencl_kernel_single_program: BoolProperty(
name="Single Program",
default=True,
default=False,
update=_devices_update_callback,
)
del _devices_update_callback
@@ -889,7 +895,7 @@ class CyclesMaterialSettings(bpy.types.PropertyGroup):
name="Displacement Method",
description="Method to use for the displacement",
items=enum_displacement_methods,
default='DISPLACEMENT',
default='BUMP',
)
@classmethod
@@ -1196,12 +1202,14 @@ class CyclesCurveRenderSettings(bpy.types.PropertyGroup):
description="Minimal pixel width for strands (0 - deactivated)",
min=0.0, max=100.0,
default=0.0,
subtype='PIXEL'
)
maximum_width: FloatProperty(
name="Maximal width",
description="Maximum extension that strand radius can be increased by",
min=0.0, max=100.0,
default=0.1,
subtype='PIXEL'
)
subdivisions: IntProperty(
name="Subdivisions",
@@ -1336,6 +1344,7 @@ class CyclesRenderLayerSettings(bpy.types.PropertyGroup):
description="Size of the image area that's used to denoise a pixel (higher values are smoother, but might lose detail and are slower)",
min=1, max=25,
default=8,
subtype="PIXEL",
)
denoising_relative_pca: BoolProperty(
name="Relative filter",
@@ -1348,6 +1357,12 @@ class CyclesRenderLayerSettings(bpy.types.PropertyGroup):
default=False,
update=update_render_passes,
)
denoising_neighbor_frames: IntProperty(
name="Neighbor Frames",
description="Number of neighboring frames to use for denoising animations (more frames produce smoother results at the cost of performance)",
min=0, max=7,
default=0,
)
use_pass_crypto_object: BoolProperty(
name="Cryptomatte Object",
description="Render cryptomatte object pass, for isolating objects in compositing",
@@ -1446,7 +1461,7 @@ class CyclesPreferences(bpy.types.AddonPreferences):
def get_devices(self):
import _cycles
# Layout of the device tuples: (Name, Type, Persistent ID)
device_list = _cycles.available_devices()
device_list = _cycles.available_devices(self.compute_device_type)
# Make sure device entries are up to date and not referenced before
# we know we don't add new devices. This way we guarantee to not
# hold pointers to a resized array.
@@ -1470,7 +1485,7 @@ class CyclesPreferences(bpy.types.AddonPreferences):
def get_num_gpu_devices(self):
import _cycles
device_list = _cycles.available_devices()
device_list = _cycles.available_devices(self.compute_device_type)
num = 0
for device in device_list:
if device[1] != self.compute_device_type:
@@ -1483,25 +1498,32 @@ class CyclesPreferences(bpy.types.AddonPreferences):
def has_active_device(self):
return self.get_num_gpu_devices() > 0
def draw_impl(self, layout, context):
available_device_types = self.get_device_types(context)
if len(available_device_types) == 1:
layout.label(text="No compatible GPUs found", icon='INFO')
def _draw_devices(self, layout, device_type, devices):
box = layout.box()
found_device = False
for device in devices:
if device.type == device_type:
found_device = True
break
if not found_device:
box.label(text="No compatible GPUs found", icon='INFO')
return
layout.row().prop(self, "compute_device_type", expand=True)
for device in devices:
box.prop(device, "use", text=device.name)
def draw_impl(self, layout, context):
row = layout.row()
row.prop(self, "compute_device_type", expand=True)
cuda_devices, opencl_devices = self.get_devices()
row = layout.row()
if self.compute_device_type == 'CUDA' and cuda_devices:
box = row.box()
for device in cuda_devices:
box.prop(device, "use", text=device.name)
if self.compute_device_type == 'OPENCL' and opencl_devices:
box = row.box()
for device in opencl_devices:
box.prop(device, "use", text=device.name)
if self.compute_device_type == 'CUDA':
self._draw_devices(row, 'CUDA', cuda_devices)
elif self.compute_device_type == 'OPENCL':
self._draw_devices(row, 'OPENCL', opencl_devices)
def draw(self, context):
self.draw_impl(self.layout, context)

View File

@@ -19,12 +19,8 @@
import bpy
from bpy_extras.node_utils import find_node_input
from bl_operators.presets import PresetMenu
import _cycles
from bpy.types import (
Panel,
Operator,
)
from bpy.types import Panel
class CYCLES_PT_sampling_presets(PresetMenu):
@@ -636,6 +632,8 @@ class CYCLES_RENDER_PT_performance_acceleration_structure(CyclesButtonsPanel, Pa
bl_parent_id = "CYCLES_RENDER_PT_performance"
def draw(self, context):
import _cycles
layout = self.layout
layout.use_property_split = True
layout.use_property_decorate = False
@@ -1277,27 +1275,6 @@ class CYCLES_OBJECT_PT_cycles_settings_performance(CyclesButtonsPanel, Panel):
col.prop(cob, "use_distance_cull")
class CYCLES_OT_use_shading_nodes(Operator):
"""Enable nodes on a material, world or light"""
bl_idname = "cycles.use_shading_nodes"
bl_label = "Use Nodes"
@classmethod
def poll(cls, context):
return (getattr(context, "material", False) or getattr(context, "world", False) or
getattr(context, "light", False))
def execute(self, context):
if context.material:
context.material.use_nodes = True
elif context.world:
context.world.use_nodes = True
elif context.light:
context.light.use_nodes = True
return {'FINISHED'}
def panel_node_draw(layout, id_data, output_type, input_name):
if not id_data.use_nodes:
layout.operator("cycles.use_shading_nodes", icon='NODETREE')
@@ -1776,76 +1753,140 @@ class CYCLES_RENDER_PT_bake(CyclesButtonsPanel, Panel):
cbk = scene.render.bake
rd = scene.render
col = layout.column()
col.prop(rd, "use_bake_multires")
if rd.use_bake_multires:
col.prop(rd, "bake_type")
layout.operator("object.bake_image", icon='RENDER_STILL')
layout.prop(rd, "use_bake_multires")
layout.prop(rd, "bake_type")
col = layout.column()
col.prop(rd, "bake_margin")
col.prop(rd, "use_bake_clear")
else:
layout.operator("object.bake", icon='RENDER_STILL').type = cscene.bake_type
layout.prop(rd, "use_bake_multires")
layout.prop(cscene, "bake_type")
class CYCLES_RENDER_PT_bake_influence(CyclesButtonsPanel, Panel):
bl_label = "Influence"
bl_context = "render"
bl_parent_id = "CYCLES_RENDER_PT_bake"
COMPAT_ENGINES = {'CYCLES'}
@classmethod
def poll(cls, context):
scene = context.scene
cscene = scene.cycles
rd = scene.render
if rd.use_bake_multires == False and cscene.bake_type in {
'NORMAL', 'COMBINED', 'DIFFUSE', 'GLOSSY', 'TRANSMISSION', 'SUBSURFACE'}:
return True
def draw(self, context):
layout = self.layout
layout.use_property_split = True
layout.use_property_decorate = False # No animation.
scene = context.scene
cscene = scene.cycles
cbk = scene.render.bake
rd = scene.render
col = layout.column()
if cscene.bake_type == 'NORMAL':
col.prop(cbk, "normal_space", text="Space")
sub = col.column(align=True)
sub.prop(cbk, "normal_r", text="Swizzle R")
sub.prop(cbk, "normal_g", text="G")
sub.prop(cbk, "normal_b", text="B")
elif cscene.bake_type == 'COMBINED':
row = col.row(align=True)
row.use_property_split = False
row.prop(cbk, "use_pass_direct", toggle=True)
row.prop(cbk, "use_pass_indirect", toggle=True)
flow = col.grid_flow(row_major=False, columns=0, even_columns=False, even_rows=False, align=True)
flow.active = cbk.use_pass_direct or cbk.use_pass_indirect
flow.prop(cbk, "use_pass_diffuse")
flow.prop(cbk, "use_pass_glossy")
flow.prop(cbk, "use_pass_transmission")
flow.prop(cbk, "use_pass_subsurface")
flow.prop(cbk, "use_pass_ambient_occlusion")
flow.prop(cbk, "use_pass_emit")
elif cscene.bake_type in {'DIFFUSE', 'GLOSSY', 'TRANSMISSION', 'SUBSURFACE'}:
row = col.row(align=True)
row.use_property_split = False
row.prop(cbk, "use_pass_direct", toggle=True)
row.prop(cbk, "use_pass_indirect", toggle=True)
row.prop(cbk, "use_pass_color", toggle=True)
class CYCLES_RENDER_PT_bake_selected_to_active(CyclesButtonsPanel, Panel):
bl_label = "Selected to Active"
bl_context = "render"
bl_parent_id = "CYCLES_RENDER_PT_bake"
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'CYCLES'}
@classmethod
def poll(cls, context):
scene = context.scene
rd = scene.render
return rd.use_bake_multires == False
def draw_header(self, context):
scene = context.scene
cbk = scene.render.bake
self.layout.prop(cbk, "use_selected_to_active", text="")
def draw(self, context):
layout = self.layout
layout.use_property_split = True
layout.use_property_decorate = False # No animation.
scene = context.scene
cscene = scene.cycles
cbk = scene.render.bake
rd = scene.render
layout.active = cbk.use_selected_to_active
col = layout.column()
col.prop(cbk, "use_cage", text="Cage")
if cbk.use_cage:
col.prop(cbk, "cage_extrusion", text="Extrusion")
col.prop(cbk, "cage_object", text="Cage Object")
else:
col.prop(cbk, "cage_extrusion", text="Ray Distance")
class CYCLES_RENDER_PT_bake_output(CyclesButtonsPanel, Panel):
bl_label = "Output"
bl_context = "render"
bl_parent_id = "CYCLES_RENDER_PT_bake"
COMPAT_ENGINES = {'CYCLES'}
def draw(self, context):
layout = self.layout
layout.use_property_split = True
layout.use_property_decorate = False # No animation.
scene = context.scene
cscene = scene.cycles
cbk = scene.render.bake
rd = scene.render
if rd.use_bake_multires:
layout.prop(rd, "bake_margin")
layout.prop(rd, "use_bake_clear", text="Clear Image")
if rd.bake_type == 'DISPLACEMENT':
col.prop(rd, "use_bake_lores_mesh")
col.operator("object.bake_image", icon='RENDER_STILL')
else:
col.prop(cscene, "bake_type")
col = layout.column()
if cscene.bake_type == 'NORMAL':
col.prop(cbk, "normal_space", text="Space")
sub = col.column(align=True)
sub.prop(cbk, "normal_r", text="Swizzle R")
sub.prop(cbk, "normal_g", text="G")
sub.prop(cbk, "normal_b", text="B")
elif cscene.bake_type == 'COMBINED':
row = col.row(align=True)
row.use_property_split = False
row.prop(cbk, "use_pass_direct", toggle=True)
row.prop(cbk, "use_pass_indirect", toggle=True)
col = col.column()
col.active = cbk.use_pass_direct or cbk.use_pass_indirect
col.prop(cbk, "use_pass_diffuse")
col.prop(cbk, "use_pass_glossy")
col.prop(cbk, "use_pass_transmission")
col.prop(cbk, "use_pass_subsurface")
col.prop(cbk, "use_pass_ambient_occlusion")
col.prop(cbk, "use_pass_emit")
elif cscene.bake_type in {'DIFFUSE', 'GLOSSY', 'TRANSMISSION', 'SUBSURFACE'}:
row = col.row(align=True)
row.use_property_split = False
row.prop(cbk, "use_pass_direct", toggle=True)
row.prop(cbk, "use_pass_indirect", toggle=True)
row.prop(cbk, "use_pass_color", toggle=True)
layout.separator()
col = layout.column()
col.prop(cbk, "margin")
col.prop(cbk, "use_clear", text="Clear Image")
col.separator()
col.prop(cbk, "use_selected_to_active")
sub = col.column()
sub.active = cbk.use_selected_to_active
sub.prop(cbk, "use_cage", text="Cage")
if cbk.use_cage:
sub.prop(cbk, "cage_extrusion", text="Extrusion")
sub.prop(cbk, "cage_object", text="Cage Object")
else:
sub.prop(cbk, "cage_extrusion", text="Ray Distance")
layout.separator()
layout.operator("object.bake", icon='RENDER_STILL').type = cscene.bake_type
layout.prop(cbk, "margin")
layout.prop(cbk, "use_clear", text="Clear Image")
class CYCLES_RENDER_PT_debug(CyclesButtonsPanel, Panel):
@@ -1886,8 +1927,7 @@ class CYCLES_RENDER_PT_debug(CyclesButtonsPanel, Panel):
col.separator()
col = layout.column()
col.label(text="OpenCL Flags:")
col.prop(cscene, "debug_opencl_kernel_type", text="Kernel")
col.label(text='OpenCL Flags:')
col.prop(cscene, "debug_opencl_device_type", text="Device")
col.prop(cscene, "debug_opencl_kernel_single_program", text="Single Program")
col.prop(cscene, "debug_use_opencl_debug", text="Debug")
@@ -1935,7 +1975,7 @@ class CYCLES_RENDER_PT_simplify_viewport(CyclesButtonsPanel, Panel):
col.prop(rd, "simplify_child_particles", text="Child Particles")
col.prop(cscene, "texture_limit", text="Texture Limit")
col.prop(cscene, "ao_bounces", text="AO Bounces")
col.prop(rd, "use_simplify_smoke_highres")
class CYCLES_RENDER_PT_simplify_render(CyclesButtonsPanel, Panel):
bl_label = "Render"
@@ -2136,7 +2176,6 @@ classes = (
CYCLES_OBJECT_PT_cycles_settings,
CYCLES_OBJECT_PT_cycles_settings_ray_visibility,
CYCLES_OBJECT_PT_cycles_settings_performance,
CYCLES_OT_use_shading_nodes,
CYCLES_LIGHT_PT_preview,
CYCLES_LIGHT_PT_light,
CYCLES_LIGHT_PT_nodes,
@@ -2158,6 +2197,9 @@ classes = (
CYCLES_MATERIAL_PT_settings_surface,
CYCLES_MATERIAL_PT_settings_volume,
CYCLES_RENDER_PT_bake,
CYCLES_RENDER_PT_bake_influence,
CYCLES_RENDER_PT_bake_selected_to_active,
CYCLES_RENDER_PT_bake_output,
CYCLES_RENDER_PT_debug,
CYCLES_NODE_PT_settings,
CYCLES_NODE_PT_settings_surface,

View File

@@ -22,50 +22,39 @@ import math
from bpy.app.handlers import persistent
def foreach_notree_node(nodetree, callback, traversed):
if nodetree in traversed:
return
traversed.add(nodetree)
def foreach_cycles_nodetree_group(nodetree, traversed):
for node in nodetree.nodes:
callback(node)
if node.bl_idname == 'ShaderNodeGroup':
foreach_notree_node(node.node_tree, callback, traversed)
group = node.node_tree
if group and group not in traversed:
traversed.add(group)
yield group, group.library
yield from foreach_cycles_nodetree_group(group, traversed)
def foreach_cycles_node(callback):
def foreach_cycles_nodetree():
traversed = set()
for material in bpy.data.materials:
if material.node_tree:
foreach_notree_node(
material.node_tree,
callback,
traversed,
)
nodetree = material.node_tree
if nodetree:
yield nodetree, material.library
yield from foreach_cycles_nodetree_group(nodetree, traversed)
for world in bpy.data.worlds:
if world.node_tree:
foreach_notree_node(
world.node_tree,
callback,
traversed,
)
nodetree = world.node_tree
if nodetree:
yield nodetree, world.library
foreach_cycles_nodetree_group(nodetree, traversed)
for light in bpy.data.lights:
if light.node_tree:
foreach_notree_node(
light.node_tree,
callback,
traversed,
)
nodetree = light.node_tree
if nodetree:
yield nodetree, light.library
foreach_cycles_nodetree_group(nodetree, traversed)
def displacement_node_insert(material, nodetree, traversed):
if nodetree in traversed:
return
traversed.add(nodetree)
for node in nodetree.nodes:
if node.bl_idname == 'ShaderNodeGroup':
displacement_node_insert(material, node.node_tree, traversed)
def displacement_node_insert(nodetree):
# Gather links to replace
displacement_links = []
for link in nodetree.links:
@@ -95,13 +84,6 @@ def displacement_node_insert(material, nodetree, traversed):
nodetree.links.new(node.outputs['Displacement'], to_socket)
def displacement_nodes_insert():
traversed = set()
for material in bpy.data.materials:
if material.node_tree:
displacement_node_insert(material, material.node_tree, traversed)
def displacement_principled_nodes(node):
if node.bl_idname == 'ShaderNodeDisplacement':
if node.space != 'WORLD':
@@ -111,11 +93,7 @@ def displacement_principled_nodes(node):
node.subsurface_method = 'BURLEY'
def square_roughness_node_insert(material, nodetree, traversed):
if nodetree in traversed:
return
traversed.add(nodetree)
def square_roughness_node_insert(nodetree):
roughness_node_types = {
'ShaderNodeBsdfAnisotropic',
'ShaderNodeBsdfGlass',
@@ -124,9 +102,7 @@ def square_roughness_node_insert(material, nodetree, traversed):
# Update default values
for node in nodetree.nodes:
if node.bl_idname == 'ShaderNodeGroup':
square_roughness_node_insert(material, node.node_tree, traversed)
elif node.bl_idname in roughness_node_types:
if node.bl_idname in roughness_node_types:
roughness_input = node.inputs['Roughness']
roughness_input.default_value = math.sqrt(max(roughness_input.default_value, 0.0))
@@ -156,13 +132,6 @@ def square_roughness_node_insert(material, nodetree, traversed):
nodetree.links.new(node.outputs['Value'], to_socket)
def square_roughness_nodes_insert():
traversed = set()
for material in bpy.data.materials:
if material.node_tree:
square_roughness_node_insert(material, material.node_tree, traversed)
def mapping_node_order_flip(node):
"""
Flip euler order of mapping shader node
@@ -244,18 +213,12 @@ def custom_bake_remap(scene):
scene.render.bake.use_pass_indirect = False
def ambient_occlusion_node_relink(material, nodetree, traversed):
if nodetree in traversed:
return
traversed.add(nodetree)
def ambient_occlusion_node_relink(nodetree):
for node in nodetree.nodes:
if node.bl_idname == 'ShaderNodeAmbientOcclusion':
node.samples = 1
node.only_local = False
node.inputs['Distance'].default_value = 0.0
elif node.bl_idname == 'ShaderNodeGroup':
ambient_occlusion_node_relink(material, node.node_tree, traversed)
# Gather links to replace
ao_links = []
@@ -272,13 +235,6 @@ def ambient_occlusion_node_relink(material, nodetree, traversed):
nodetree.links.new(from_node.outputs['Color'], to_socket)
def ambient_occlusion_nodes_relink():
traversed = set()
for material in bpy.data.materials:
if material.node_tree:
ambient_occlusion_node_relink(material, material.node_tree, traversed)
@persistent
def do_versions(self):
if bpy.context.preferences.version <= (2, 78, 1):
@@ -304,160 +260,199 @@ def do_versions(self):
if not bpy.data.is_saved:
return
# Clamp Direct/Indirect separation in 270
if bpy.data.version <= (2, 70, 0):
for scene in bpy.data.scenes:
cscene = scene.cycles
sample_clamp = cscene.get("sample_clamp", False)
if (sample_clamp and
not cscene.is_property_set("sample_clamp_direct") and
not cscene.is_property_set("sample_clamp_indirect")):
# Map of versions used by libraries.
library_versions = {}
library_versions[bpy.data.version] = [None]
for library in bpy.data.libraries:
library_versions.setdefault(library.version, []).append(library)
cscene.sample_clamp_direct = sample_clamp
cscene.sample_clamp_indirect = sample_clamp
# Do versioning per library, since they might have different versions.
max_need_versioning = (2, 79, 6)
for version, libraries in library_versions.items():
if version > max_need_versioning:
continue
# Change of Volume Bounces in 271
if bpy.data.version <= (2, 71, 0):
# Scenes
for scene in bpy.data.scenes:
cscene = scene.cycles
if not cscene.is_property_set("volume_bounces"):
cscene.volume_bounces = 1
if scene.library not in libraries:
continue
# Caustics Reflective/Refractive separation in 272
if bpy.data.version <= (2, 72, 0):
for scene in bpy.data.scenes:
cscene = scene.cycles
if (cscene.get("no_caustics", False) and
not cscene.is_property_set("caustics_reflective") and
# Clamp Direct/Indirect separation in 270
if version <= (2, 70, 0):
cscene = scene.cycles
sample_clamp = cscene.get("sample_clamp", False)
if (sample_clamp and
not cscene.is_property_set("sample_clamp_direct") and
not cscene.is_property_set("sample_clamp_indirect")):
cscene.sample_clamp_direct = sample_clamp
cscene.sample_clamp_indirect = sample_clamp
# Change of Volume Bounces in 271
if version <= (2, 71, 0):
cscene = scene.cycles
if not cscene.is_property_set("volume_bounces"):
cscene.volume_bounces = 1
# Caustics Reflective/Refractive separation in 272
if version <= (2, 72, 0):
cscene = scene.cycles
if (cscene.get("no_caustics", False) and
not cscene.is_property_set("caustics_reflective") and
not cscene.is_property_set("caustics_refractive")):
cscene.caustics_reflective = False
cscene.caustics_refractive = False
cscene.caustics_reflective = False
cscene.caustics_refractive = False
# Baking types changed
if version <= (2, 76, 6):
custom_bake_remap(scene)
# Euler order was ZYX in previous versions.
if bpy.data.version <= (2, 73, 4):
foreach_cycles_node(mapping_node_order_flip)
# Several default changes for 2.77
if version <= (2, 76, 8):
cscene = scene.cycles
if bpy.data.version <= (2, 76, 5):
foreach_cycles_node(vector_curve_node_remap)
# Samples
if not cscene.is_property_set("samples"):
cscene.samples = 10
# Baking types changed
if bpy.data.version <= (2, 76, 6):
for scene in bpy.data.scenes:
custom_bake_remap(scene)
# Preview Samples
if not cscene.is_property_set("preview_samples"):
cscene.preview_samples = 10
# Several default changes for 2.77
if bpy.data.version <= (2, 76, 8):
for scene in bpy.data.scenes:
cscene = scene.cycles
# Filter
if not cscene.is_property_set("filter_type"):
cscene.pixel_filter_type = 'GAUSSIAN'
# Samples
if not cscene.is_property_set("samples"):
cscene.samples = 10
# Tile Order
if not cscene.is_property_set("tile_order"):
cscene.tile_order = 'CENTER'
# Preview Samples
if not cscene.is_property_set("preview_samples"):
cscene.preview_samples = 10
if version <= (2, 76, 10):
cscene = scene.cycles
if cscene.is_property_set("filter_type"):
if not cscene.is_property_set("pixel_filter_type"):
cscene.pixel_filter_type = cscene.filter_type
if cscene.filter_type == 'BLACKMAN_HARRIS':
cscene.filter_type = 'GAUSSIAN'
# Filter
if not cscene.is_property_set("filter_type"):
cscene.pixel_filter_type = 'GAUSSIAN'
if version <= (2, 78, 2):
cscene = scene.cycles
if not cscene.is_property_set("light_sampling_threshold"):
cscene.light_sampling_threshold = 0.0
# Tile Order
if not cscene.is_property_set("tile_order"):
cscene.tile_order = 'CENTER'
if version <= (2, 79, 0):
cscene = scene.cycles
# Default changes
if not cscene.is_property_set("aa_samples"):
cscene.aa_samples = 4
if not cscene.is_property_set("preview_aa_samples"):
cscene.preview_aa_samples = 4
if not cscene.is_property_set("blur_glossy"):
cscene.blur_glossy = 0.0
if not cscene.is_property_set("sample_clamp_indirect"):
cscene.sample_clamp_indirect = 0.0
# Lamps
for light in bpy.data.lights:
clight = light.cycles
if light.library not in libraries:
continue
# MIS
if not clight.is_property_set("use_multiple_importance_sampling"):
clight.use_multiple_importance_sampling = False
if version <= (2, 76, 5):
clight = light.cycles
for mat in bpy.data.materials:
cmat = mat.cycles
# MIS
if not clight.is_property_set("use_multiple_importance_sampling"):
clight.use_multiple_importance_sampling = False
# Volume Sampling
if not cmat.is_property_set("volume_sampling"):
cmat.volume_sampling = 'DISTANCE'
if bpy.data.version <= (2, 76, 9):
# Worlds
for world in bpy.data.worlds:
cworld = world.cycles
if world.library not in libraries:
continue
# World MIS Samples
if not cworld.is_property_set("samples"):
cworld.samples = 4
if version <= (2, 76, 9):
cworld = world.cycles
# World MIS Resolution
if not cworld.is_property_set("sample_map_resolution"):
cworld.sample_map_resolution = 256
# World MIS Samples
if not cworld.is_property_set("samples"):
cworld.samples = 4
if bpy.data.version <= (2, 76, 10):
for scene in bpy.data.scenes:
cscene = scene.cycles
if cscene.is_property_set("filter_type"):
if not cscene.is_property_set("pixel_filter_type"):
cscene.pixel_filter_type = cscene.filter_type
if cscene.filter_type == 'BLACKMAN_HARRIS':
cscene.filter_type = 'GAUSSIAN'
# World MIS Resolution
if not cworld.is_property_set("sample_map_resolution"):
cworld.sample_map_resolution = 256
if bpy.data.version <= (2, 78, 2):
for scene in bpy.data.scenes:
cscene = scene.cycles
if not cscene.is_property_set("light_sampling_threshold"):
cscene.light_sampling_threshold = 0.0
if version <= (2, 79, 4) or \
(version >= (2, 80, 0) and version <= (2, 80, 18)):
cworld = world.cycles
# World MIS
if not cworld.is_property_set("sampling_method"):
if cworld.get("sample_as_light", True):
cworld.sampling_method = 'MANUAL'
else:
cworld.sampling_method = 'NONE'
if bpy.data.version <= (2, 79, 0):
for scene in bpy.data.scenes:
cscene = scene.cycles
# Default changes
if not cscene.is_property_set("aa_samples"):
cscene.aa_samples = 4
if not cscene.is_property_set("preview_aa_samples"):
cscene.preview_aa_samples = 4
if not cscene.is_property_set("blur_glossy"):
cscene.blur_glossy = 0.0
if not cscene.is_property_set("sample_clamp_indirect"):
cscene.sample_clamp_indirect = 0.0
if bpy.data.version <= (2, 79, 1) or \
(bpy.data.version >= (2, 80, 0) and bpy.data.version <= (2, 80, 3)):
displacement_nodes_insert()
if bpy.data.version <= (2, 79, 2):
# Materials
for mat in bpy.data.materials:
cmat = mat.cycles
if not cmat.is_property_set("displacement_method"):
cmat.displacement_method = 'BUMP'
if mat.library not in libraries:
continue
foreach_cycles_node(displacement_principled_nodes)
if version <= (2, 76, 5):
cmat = mat.cycles
# Volume Sampling
if not cmat.is_property_set("volume_sampling"):
cmat.volume_sampling = 'DISTANCE'
if bpy.data.version <= (2, 79, 3) or \
(bpy.data.version >= (2, 80, 0) and bpy.data.version <= (2, 80, 4)):
# Switch to squared roughness convention
square_roughness_nodes_insert()
if version <= (2, 79, 2):
cmat = mat.cycles
if not cmat.is_property_set("displacement_method"):
cmat.displacement_method = 'BUMP'
if bpy.data.version <= (2, 80, 15):
# Copy cycles hair settings to internal settings
# Change default to bump again.
if version <= (2, 79, 6) or \
(version >= (2, 80, 0) and version <= (2, 80, 41)):
cmat = mat.cycles
if not cmat.is_property_set("displacement_method"):
cmat.displacement_method = 'DISPLACEMENT'
# Nodes
for nodetree, library in foreach_cycles_nodetree():
if library not in libraries:
continue
# Euler order was ZYX in previous versions.
if version <= (2, 73, 4):
for node in nodetree.nodes:
mapping_node_order_flip(node)
if version <= (2, 76, 5):
for node in nodetree.nodes:
vector_curve_node_remap(node)
if version <= (2, 79, 1) or \
(version >= (2, 80, 0) and version <= (2, 80, 3)):
displacement_node_insert(nodetree)
if version <= (2, 79, 2):
for node in nodetree.nodes:
displacement_principled_nodes(node)
if version <= (2, 79, 3) or \
(version >= (2, 80, 0) and version <= (2, 80, 4)):
# Switch to squared roughness convention
square_roughness_node_insert(nodetree)
if version <= (2, 79, 4):
ambient_occlusion_node_relink(nodetree)
# Particles
for part in bpy.data.particles:
cpart = part.get("cycles", None)
if cpart:
part.shape = cpart.get("shape", 0.0)
part.root_radius = cpart.get("root_width", 1.0)
part.tip_radius = cpart.get("tip_width", 0.0)
part.radius_scale = cpart.get("radius_scale", 0.01)
part.use_close_tip = cpart.get("use_closetip", True)
if part.library not in libraries:
continue
if bpy.data.version <= (2, 79, 4) or \
(bpy.data.version >= (2, 80, 0) and bpy.data.version <= (2, 80, 18)):
for world in bpy.data.worlds:
cworld = world.cycles
# World MIS
if not cworld.is_property_set("sampling_method"):
if cworld.get("sample_as_light", True):
cworld.sampling_method = 'MANUAL'
else:
cworld.sampling_method = 'NONE'
ambient_occlusion_nodes_relink()
# Copy cycles hair settings to internal settings
if version <= (2, 80, 15):
cpart = part.get("cycles", None)
if cpart:
part.shape = cpart.get("shape", 0.0)
part.root_radius = cpart.get("root_width", 1.0)
part.tip_radius = cpart.get("tip_width", 0.0)
part.radius_scale = cpart.get("radius_scale", 0.01)
part.use_close_tip = cpart.get("use_closetip", True)

View File

@@ -228,12 +228,17 @@ static void blender_camera_from_object(BlenderCamera *bcam,
bcam->sensor_fit = BlenderCamera::HORIZONTAL;
else
bcam->sensor_fit = BlenderCamera::VERTICAL;
}
else if(b_ob_data.is_a(&RNA_Light)) {
/* Can also look through spot light. */
BL::SpotLight b_light(b_ob_data);
float lens = 16.0f / tanf(b_light.spot_size() * 0.5f);
if (lens > 0.0f) {
bcam->lens = lens;
}
}
bcam->motion_steps = object_motion_steps(b_ob, b_ob);
}
else {
/* from light not implemented yet */
}
bcam->motion_steps = object_motion_steps(b_ob, b_ob);
}
static Transform blender_camera_matrix(const Transform& tfm,
@@ -643,7 +648,7 @@ static void blender_camera_from_view(BlenderCamera *bcam,
if(b_rv3d.view_perspective() == BL::RegionView3D::view_perspective_CAMERA) {
/* camera view */
BL::Object b_ob = (b_v3d.lock_camera_and_layers())? b_scene.camera(): b_v3d.camera();
BL::Object b_ob = (b_v3d.use_local_camera())? b_v3d.camera(): b_scene.camera();
if(b_ob) {
blender_camera_from_object(bcam, b_engine, b_ob, skip_panorama);
@@ -779,7 +784,7 @@ static void blender_camera_border(BlenderCamera *bcam,
return;
}
BL::Object b_ob = (b_v3d.lock_camera_and_layers())? b_scene.camera(): b_v3d.camera();
BL::Object b_ob = (b_v3d.use_local_camera())? b_v3d.camera(): b_scene.camera();
if(!b_ob)
return;

View File

@@ -185,9 +185,7 @@ static bool ObtainCacheParticleData(Mesh *mesh,
float3 cKey = make_float3(nco[0], nco[1], nco[2]);
cKey = transform_point(&itfm, cKey);
if(step_no > 0) {
float step_length = len(cKey - pcKey);
if(step_length == 0.0f)
continue;
const float step_length = len(cKey - pcKey);
curve_length += step_length;
}
CData->curvekey_co.push_back_slow(cKey);
@@ -336,9 +334,6 @@ static void ExportCurveTrianglePlanes(Mesh *mesh, ParticleCurveData *CData,
/* compute and reserve size of arrays */
for(int sys = 0; sys < CData->psys_firstcurve.size(); sys++) {
for(int curve = CData->psys_firstcurve[sys]; curve < CData->psys_firstcurve[sys] + CData->psys_curvenum[sys]; curve++) {
if(CData->curve_keynum[curve] <= 1 || CData->curve_length[curve] == 0.0f)
continue;
numverts += 2 + (CData->curve_keynum[curve] - 1)*2;
numtris += (CData->curve_keynum[curve] - 1)*2;
}
@@ -349,9 +344,6 @@ static void ExportCurveTrianglePlanes(Mesh *mesh, ParticleCurveData *CData,
/* actually export */
for(int sys = 0; sys < CData->psys_firstcurve.size(); sys++) {
for(int curve = CData->psys_firstcurve[sys]; curve < CData->psys_firstcurve[sys] + CData->psys_curvenum[sys]; curve++) {
if(CData->curve_keynum[curve] <= 1 || CData->curve_length[curve] == 0.0f)
continue;
float3 xbasis;
float3 v1;
float time = 0.0f;
@@ -421,9 +413,6 @@ static void ExportCurveTriangleGeometry(Mesh *mesh,
/* compute and reserve size of arrays */
for(int sys = 0; sys < CData->psys_firstcurve.size(); sys++) {
for(int curve = CData->psys_firstcurve[sys]; curve < CData->psys_firstcurve[sys] + CData->psys_curvenum[sys]; curve++) {
if(CData->curve_keynum[curve] <= 1 || CData->curve_length[curve] == 0.0f)
continue;
numverts += (CData->curve_keynum[curve] - 1)*resolution + resolution;
numtris += (CData->curve_keynum[curve] - 1)*2*resolution;
}
@@ -434,9 +423,6 @@ static void ExportCurveTriangleGeometry(Mesh *mesh,
/* actually export */
for(int sys = 0; sys < CData->psys_firstcurve.size(); sys++) {
for(int curve = CData->psys_firstcurve[sys]; curve < CData->psys_firstcurve[sys] + CData->psys_curvenum[sys]; curve++) {
if(CData->curve_keynum[curve] <= 1 || CData->curve_length[curve] == 0.0f)
continue;
float3 firstxbasis = cross(make_float3(1.0f,0.0f,0.0f),CData->curvekey_co[CData->curve_firstkey[curve]+1] - CData->curvekey_co[CData->curve_firstkey[curve]]);
if(!is_zero(firstxbasis))
firstxbasis = normalize(firstxbasis);
@@ -564,9 +550,6 @@ static void ExportCurveSegments(Scene *scene, Mesh *mesh, ParticleCurveData *CDa
/* compute and reserve size of arrays */
for(int sys = 0; sys < CData->psys_firstcurve.size(); sys++) {
for(int curve = CData->psys_firstcurve[sys]; curve < CData->psys_firstcurve[sys] + CData->psys_curvenum[sys]; curve++) {
if(CData->curve_keynum[curve] <= 1 || CData->curve_length[curve] == 0.0f)
continue;
num_keys += CData->curve_keynum[curve];
num_curves++;
}
@@ -584,19 +567,27 @@ static void ExportCurveSegments(Scene *scene, Mesh *mesh, ParticleCurveData *CDa
/* actually export */
for(int sys = 0; sys < CData->psys_firstcurve.size(); sys++) {
for(int curve = CData->psys_firstcurve[sys]; curve < CData->psys_firstcurve[sys] + CData->psys_curvenum[sys]; curve++) {
if(CData->curve_keynum[curve] <= 1 || CData->curve_length[curve] == 0.0f)
continue;
size_t num_curve_keys = 0;
for(int curvekey = CData->curve_firstkey[curve]; curvekey < CData->curve_firstkey[curve] + CData->curve_keynum[curve]; curvekey++) {
float3 ickey_loc = CData->curvekey_co[curvekey];
float time = CData->curvekey_time[curvekey]/CData->curve_length[curve];
float radius = shaperadius(CData->psys_shape[sys], CData->psys_rootradius[sys], CData->psys_tipradius[sys], time);
if(CData->psys_closetip[sys] && (curvekey == CData->curve_firstkey[curve] + CData->curve_keynum[curve] - 1))
for(int curvekey = CData->curve_firstkey[curve];
curvekey < CData->curve_firstkey[curve] + CData->curve_keynum[curve];
curvekey++)
{
const float3 ickey_loc = CData->curvekey_co[curvekey];
const float curve_time = CData->curvekey_time[curvekey];
const float curve_length = CData->curve_length[curve];
const float time = (curve_length > 0.0f)
? curve_time / curve_length
: 0.0f;
float radius = shaperadius(CData->psys_shape[sys],
CData->psys_rootradius[sys],
CData->psys_tipradius[sys],
time);
if(CData->psys_closetip[sys] &&
(curvekey == CData->curve_firstkey[curve] + CData->curve_keynum[curve] - 1))
{
radius = 0.0f;
}
mesh->add_curve_key(ickey_loc, radius);
if(attr_intercept)
attr_intercept->add(time);
@@ -623,8 +614,10 @@ static void ExportCurveSegments(Scene *scene, Mesh *mesh, ParticleCurveData *CDa
static float4 CurveSegmentMotionCV(ParticleCurveData *CData, int sys, int curve, int curvekey)
{
float3 ickey_loc = CData->curvekey_co[curvekey];
float time = CData->curvekey_time[curvekey]/CData->curve_length[curve];
const float3 ickey_loc = CData->curvekey_co[curvekey];
const float curve_time = CData->curvekey_time[curvekey];
const float curve_length = CData->curve_length[curve];
float time = (curve_length > 0.0f) ? curve_time / curve_length : 0.0f;
float radius = shaperadius(CData->psys_shape[sys], CData->psys_rootradius[sys], CData->psys_tipradius[sys], time);
if(CData->psys_closetip[sys] && (curvekey == CData->curve_firstkey[curve] + CData->curve_keynum[curve] - 1))
@@ -683,13 +676,7 @@ static void ExportCurveSegmentsMotion(Mesh *mesh, ParticleCurveData *CData, int
int num_curves = 0;
for(int sys = 0; sys < CData->psys_firstcurve.size(); sys++) {
if(CData->psys_curvenum[sys] == 0)
continue;
for(int curve = CData->psys_firstcurve[sys]; curve < CData->psys_firstcurve[sys] + CData->psys_curvenum[sys]; curve++) {
if(CData->curve_keynum[curve] <= 1 || CData->curve_length[curve] == 0.0f)
continue;
/* Curve lengths may not match! Curves can be clipped. */
int curve_key_end = (num_curves+1 < (int)mesh->curve_first_key.size() ? mesh->curve_first_key[num_curves+1] : (int)mesh->curve_keys.size());
const int num_center_curve_keys = curve_key_end - mesh->curve_first_key[num_curves];
@@ -715,7 +702,10 @@ static void ExportCurveSegmentsMotion(Mesh *mesh, ParticleCurveData *CData, int
else {
/* Number of keys has changed. Genereate an interpolated version
* to preserve motion blur. */
float step_size = 1.0f / (num_center_curve_keys-1);
const float step_size =
num_center_curve_keys > 1
? 1.0f / (num_center_curve_keys - 1)
: 0.0f;
for(int step_index = 0;
step_index < num_center_curve_keys;
++step_index)
@@ -774,11 +764,10 @@ static void ExportCurveTriangleUV(ParticleCurveData *CData,
for(int sys = 0; sys < CData->psys_firstcurve.size(); sys++) {
for(int curve = CData->psys_firstcurve[sys]; curve < CData->psys_firstcurve[sys] + CData->psys_curvenum[sys]; curve++) {
if(CData->curve_keynum[curve] <= 1 || CData->curve_length[curve] == 0.0f)
continue;
for(int curvekey = CData->curve_firstkey[curve]; curvekey < CData->curve_firstkey[curve] + CData->curve_keynum[curve] - 1; curvekey++) {
time = CData->curvekey_time[curvekey]/CData->curve_length[curve];
const float curve_time = CData->curvekey_time[curvekey];
const float curve_length = CData->curve_length[curve];
time = (curve_length > 0.0f) ? curve_time / curve_length : 0.0f;
for(int section = 0; section < resol; section++) {
uvdata[vertexindex] = CData->curve_uv[curve];
@@ -819,9 +808,6 @@ static void ExportCurveTriangleVcol(ParticleCurveData *CData,
for(int sys = 0; sys < CData->psys_firstcurve.size(); sys++) {
for(int curve = CData->psys_firstcurve[sys]; curve < CData->psys_firstcurve[sys] + CData->psys_curvenum[sys]; curve++) {
if(CData->curve_keynum[curve] <= 1 || CData->curve_length[curve] == 0.0f)
continue;
for(int curvekey = CData->curve_firstkey[curve]; curvekey < CData->curve_firstkey[curve] + CData->curve_keynum[curve] - 1; curvekey++) {
for(int section = 0; section < resol; section++) {
/* Encode vertex color using the sRGB curve. */
@@ -1049,9 +1035,9 @@ void BlenderSync::sync_curves(Mesh *mesh,
size_t i = 0;
/* Encode vertex color using the sRGB curve. */
for(size_t curve = 0; curve < CData.curve_vcol.size(); curve++)
if(!(CData.curve_keynum[curve] <= 1 || CData.curve_length[curve] == 0.0f))
fdata[i++] = color_srgb_to_linear_v3(CData.curve_vcol[curve]);
for(size_t curve = 0; curve < CData.curve_vcol.size(); curve++) {
fdata[i++] = color_srgb_to_linear_v3(CData.curve_vcol[curve]);
}
}
}
}
@@ -1094,9 +1080,9 @@ void BlenderSync::sync_curves(Mesh *mesh,
if(uv) {
size_t i = 0;
for(size_t curve = 0; curve < CData.curve_uv.size(); curve++)
if(!(CData.curve_keynum[curve] <= 1 || CData.curve_length[curve] == 0.0f))
uv[i++] = CData.curve_uv[curve];
for(size_t curve = 0; curve < CData.curve_uv.size(); curve++) {
uv[i++] = CData.curve_uv[curve];
}
}
}
}

View File

@@ -0,0 +1,109 @@
/*
* Copyright 2011-2013 Blender Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "blender/blender_device.h"
#include "blender/blender_util.h"
CCL_NAMESPACE_BEGIN
int blender_device_threads(BL::Scene& b_scene)
{
BL::RenderSettings b_r = b_scene.render();
if(b_r.threads_mode() == BL::RenderSettings::threads_mode_FIXED)
return b_r.threads();
else
return 0;
}
DeviceInfo blender_device_info(BL::Preferences& b_preferences, BL::Scene& b_scene, bool background)
{
PointerRNA cscene = RNA_pointer_get(&b_scene.ptr, "cycles");
/* Default to CPU device. */
DeviceInfo device = Device::available_devices(DEVICE_MASK_CPU).front();
if(get_enum(cscene, "device") == 2) {
/* Find network device. */
vector<DeviceInfo> devices = Device::available_devices(DEVICE_MASK_NETWORK);
if(!devices.empty()) {
device = devices.front();
}
}
else if(get_enum(cscene, "device") == 1) {
/* Find cycles preferences. */
PointerRNA cpreferences;
BL::Preferences::addons_iterator b_addon_iter;
for(b_preferences.addons.begin(b_addon_iter); b_addon_iter != b_preferences.addons.end(); ++b_addon_iter) {
if(b_addon_iter->module() == "cycles") {
cpreferences = b_addon_iter->preferences().ptr;
break;
}
}
/* Test if we are using GPU devices. */
enum ComputeDevice {
COMPUTE_DEVICE_CPU = 0,
COMPUTE_DEVICE_CUDA = 1,
COMPUTE_DEVICE_OPENCL = 2,
COMPUTE_DEVICE_NUM = 3,
};
ComputeDevice compute_device = (ComputeDevice)get_enum(cpreferences,
"compute_device_type",
COMPUTE_DEVICE_NUM,
COMPUTE_DEVICE_CPU);
if(compute_device != COMPUTE_DEVICE_CPU) {
/* Query GPU devices with matching types. */
uint mask = DEVICE_MASK_CPU;
if(compute_device == COMPUTE_DEVICE_CUDA) {
mask |= DEVICE_MASK_CUDA;
}
else if(compute_device == COMPUTE_DEVICE_OPENCL) {
mask |= DEVICE_MASK_OPENCL;
}
vector<DeviceInfo> devices = Device::available_devices(mask);
/* Match device preferences and available devices. */
vector<DeviceInfo> used_devices;
RNA_BEGIN(&cpreferences, device, "devices") {
if(get_boolean(device, "use")) {
string id = get_string(device, "id");
foreach(DeviceInfo& info, devices) {
if(info.id == id) {
used_devices.push_back(info);
break;
}
}
}
} RNA_END;
if(!used_devices.empty()) {
int threads = blender_device_threads(b_scene);
device = Device::get_multi_device(used_devices,
threads,
background);
}
/* Else keep using the CPU device that was set before. */
}
}
return device;
}
CCL_NAMESPACE_END

View File

@@ -0,0 +1,37 @@
/*
* Copyright 2011-2013 Blender Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef __BLENDER_DEVICE_H__
#define __BLENDER_DEVICE_H__
#include "MEM_guardedalloc.h"
#include "RNA_types.h"
#include "RNA_access.h"
#include "RNA_blender_cpp.h"
#include "device/device.h"
CCL_NAMESPACE_BEGIN
/* Get number of threads to use for rendering. */
int blender_device_threads(BL::Scene& b_scene);
/* Convert Blender settings to device specification. */
DeviceInfo blender_device_info(BL::Preferences& b_preferences, BL::Scene& b_scene, bool background);
CCL_NAMESPACE_END
#endif /* __BLENDER_DEVICE_H__ */

View File

@@ -756,13 +756,11 @@ static void create_mesh(Scene *scene,
return;
}
BL::Mesh::vertices_iterator v;
BL::Mesh::polygons_iterator p;
if(!subdivision) {
numtris = numfaces;
}
else {
BL::Mesh::polygons_iterator p;
for(b_mesh.polygons.begin(p); p != b_mesh.polygons.end(); ++p) {
numngons += (p->loop_total() == 4)? 0: 1;
numcorners += p->loop_total();
@@ -774,6 +772,7 @@ static void create_mesh(Scene *scene,
mesh->reserve_subd_faces(numfaces, numngons, numcorners);
/* create vertex coordinates and normals */
BL::Mesh::vertices_iterator v;
for(b_mesh.vertices.begin(v); v != b_mesh.vertices.end(); ++v)
mesh->add_vertex(get_float3(v->co()));
@@ -808,13 +807,10 @@ static void create_mesh(Scene *scene,
}
/* create faces */
vector<int> nverts(numfaces);
if(!subdivision) {
BL::Mesh::loop_triangles_iterator t;
int ti = 0;
for(b_mesh.loop_triangles.begin(t); t != b_mesh.loop_triangles.end(); ++t, ++ti) {
for(b_mesh.loop_triangles.begin(t); t != b_mesh.loop_triangles.end(); ++t) {
BL::MeshPolygon p = b_mesh.polygons[t->polygon_index()];
int3 vi = get_int3(t->vertices());
@@ -835,10 +831,10 @@ static void create_mesh(Scene *scene,
* NOTE: Autosmooth is already taken care about.
*/
mesh->add_triangle(vi[0], vi[1], vi[2], shader, smooth);
nverts[ti] = 3;
}
}
else {
BL::Mesh::polygons_iterator p;
vector<int> vi;
for(b_mesh.polygons.begin(p); p != b_mesh.polygons.end(); ++p) {
@@ -1065,37 +1061,26 @@ Mesh *BlenderSync::sync_mesh(BL::Depsgraph& b_depsgraph,
mesh->name = ustring(b_ob_data.name().c_str());
if(requested_geometry_flags != Mesh::GEOMETRY_NONE) {
/* mesh objects does have special handle in the dependency graph,
* they're ensured to have properly updated.
*
* updating meshes here will end up having derived mesh referencing
* freed data from the blender side.
*/
if(preview && b_ob.type() != BL::Object::type_MESH) {
b_ob.update_from_editmode(b_data);
}
/* For some reason, meshes do not need this... */
bool apply_modifiers = (b_ob.type() != BL::Object::type_MESH);
bool need_undeformed = mesh->need_attribute(scene, ATTR_STD_GENERATED);
mesh->subdivision_type = object_subdivision_type(b_ob, preview, experimental);
/* Disable adaptive subdivision while baking as the baking system
* currently doesnt support the topology and will crash.
*/
/* Adaptive subdivision setup. Not for baking since that requires
* exact mapping to the Blender mesh. */
if(scene->bake_manager->get_baking()) {
mesh->subdivision_type = Mesh::SUBDIVISION_NONE;
}
else {
mesh->subdivision_type = object_subdivision_type(b_ob, preview, experimental);
}
/* For some reason, meshes do not need this... */
bool need_undeformed = mesh->need_attribute(scene, ATTR_STD_GENERATED);
BL::Mesh b_mesh = object_to_mesh(b_data,
b_ob,
b_depsgraph,
apply_modifiers,
need_undeformed,
mesh->subdivision_type);
if(b_mesh) {
/* Sync mesh itself. */
if(view_layer.use_surfaces && show_self) {
if(mesh->subdivision_type != Mesh::SUBDIVISION_NONE)
create_subd_mesh(scene, mesh, b_ob, b_mesh, used_shaders,
@@ -1106,11 +1091,12 @@ Mesh *BlenderSync::sync_mesh(BL::Depsgraph& b_depsgraph,
create_mesh_volume_attributes(scene, b_ob, mesh, b_scene.frame_current());
}
if(view_layer.use_hair && show_particles && mesh->subdivision_type == Mesh::SUBDIVISION_NONE)
/* Sync hair curves. */
if(view_layer.use_hair && show_particles && mesh->subdivision_type == Mesh::SUBDIVISION_NONE) {
sync_curves(mesh, b_mesh, b_ob, false);
}
/* free derived mesh */
b_data.meshes.remove(b_mesh, false, true, false);
free_object_to_mesh(b_data, b_ob, b_mesh);
}
}
mesh->geometry_flags = requested_geometry_flags;
@@ -1176,7 +1162,6 @@ void BlenderSync::sync_mesh_motion(BL::Depsgraph& b_depsgraph,
b_ob,
b_depsgraph,
false,
false,
Mesh::SUBDIVISION_NONE);
}
@@ -1287,7 +1272,7 @@ void BlenderSync::sync_mesh_motion(BL::Depsgraph& b_depsgraph,
sync_curves(mesh, b_mesh, b_ob, true, motion_step);
/* free derived mesh */
b_data.meshes.remove(b_mesh, false, true, false);
free_object_to_mesh(b_data, b_ob, b_mesh);
}
CCL_NAMESPACE_END

View File

@@ -461,7 +461,7 @@ Object *BlenderSync::sync_object(BL::Depsgraph& b_depsgraph,
uint motion_steps;
if(scene->need_motion() == Scene::MOTION_BLUR) {
if(need_motion == Scene::MOTION_BLUR) {
motion_steps = object_motion_steps(b_parent, b_ob);
mesh->motion_steps = motion_steps;
if(motion_steps && object_use_deform_motion(b_parent, b_ob)) {

View File

@@ -18,9 +18,12 @@
#include "blender/CCL_api.h"
#include "blender/blender_device.h"
#include "blender/blender_sync.h"
#include "blender/blender_session.h"
#include "render/denoising.h"
#include "util/util_debug.h"
#include "util/util_foreach.h"
#include "util/util_logging.h"
@@ -37,6 +40,10 @@
#include <OSL/oslconfig.h>
#endif
#ifdef WITH_OPENCL
#include "device/device_intern.h"
#endif
CCL_NAMESPACE_BEGIN
namespace {
@@ -60,7 +67,6 @@ bool debug_flags_sync_from_scene(BL::Scene b_scene)
PointerRNA cscene = RNA_pointer_get(&b_scene.ptr, "cycles");
/* Backup some settings for comparison. */
DebugFlags::OpenCL::DeviceType opencl_device_type = flags.opencl.device_type;
DebugFlags::OpenCL::KernelType opencl_kernel_type = flags.opencl.kernel_type;
/* Synchronize shared flags. */
flags.viewport_static_bvh = get_enum(cscene, "debug_bvh_type");
/* Synchronize CPU flags. */
@@ -74,18 +80,6 @@ bool debug_flags_sync_from_scene(BL::Scene b_scene)
/* Synchronize CUDA flags. */
flags.cuda.adaptive_compile = get_boolean(cscene, "debug_use_cuda_adaptive_compile");
flags.cuda.split_kernel = get_boolean(cscene, "debug_use_cuda_split_kernel");
/* Synchronize OpenCL kernel type. */
switch(get_enum(cscene, "debug_opencl_kernel_type")) {
case 0:
flags.opencl.kernel_type = DebugFlags::OpenCL::KERNEL_DEFAULT;
break;
case 1:
flags.opencl.kernel_type = DebugFlags::OpenCL::KERNEL_MEGA;
break;
case 2:
flags.opencl.kernel_type = DebugFlags::OpenCL::KERNEL_SPLIT;
break;
}
/* Synchronize OpenCL device type. */
switch(get_enum(cscene, "debug_opencl_device_type")) {
case 0:
@@ -111,8 +105,7 @@ bool debug_flags_sync_from_scene(BL::Scene b_scene)
flags.opencl.debug = get_boolean(cscene, "debug_use_opencl_debug");
flags.opencl.mem_limit = ((size_t)get_int(cscene, "debug_opencl_mem_limit"))*1024*1024;
flags.opencl.single_program = get_boolean(cscene, "debug_opencl_kernel_single_program");
return flags.opencl.device_type != opencl_device_type ||
flags.opencl.kernel_type != opencl_kernel_type;
return flags.opencl.device_type != opencl_device_type;
}
/* Reset debug flags to default values.
@@ -123,10 +116,8 @@ bool debug_flags_reset()
DebugFlagsRef flags = DebugFlags();
/* Backup some settings for comparison. */
DebugFlags::OpenCL::DeviceType opencl_device_type = flags.opencl.device_type;
DebugFlags::OpenCL::KernelType opencl_kernel_type = flags.opencl.kernel_type;
flags.reset();
return flags.opencl.device_type != opencl_device_type ||
flags.opencl.kernel_type != opencl_kernel_type;
return flags.opencl.device_type != opencl_device_type;
}
} /* namespace */
@@ -203,10 +194,10 @@ static PyObject *exit_func(PyObject * /*self*/, PyObject * /*args*/)
static PyObject *create_func(PyObject * /*self*/, PyObject *args)
{
PyObject *pyengine, *pyuserpref, *pydata, *pyregion, *pyv3d, *pyrv3d;
PyObject *pyengine, *pypreferences, *pydata, *pyregion, *pyv3d, *pyrv3d;
int preview_osl;
if(!PyArg_ParseTuple(args, "OOOOOOi", &pyengine, &pyuserpref, &pydata,
if(!PyArg_ParseTuple(args, "OOOOOOi", &pyengine, &pypreferences, &pydata,
&pyregion, &pyv3d, &pyrv3d, &preview_osl))
{
return NULL;
@@ -217,9 +208,9 @@ static PyObject *create_func(PyObject * /*self*/, PyObject *args)
RNA_pointer_create(NULL, &RNA_RenderEngine, (void*)PyLong_AsVoidPtr(pyengine), &engineptr);
BL::RenderEngine engine(engineptr);
PointerRNA userprefptr;
RNA_pointer_create(NULL, &RNA_Preferences, (void*)PyLong_AsVoidPtr(pyuserpref), &userprefptr);
BL::Preferences userpref(userprefptr);
PointerRNA preferencesptr;
RNA_pointer_create(NULL, &RNA_Preferences, (void*)PyLong_AsVoidPtr(pypreferences), &preferencesptr);
BL::Preferences preferences(preferencesptr);
PointerRNA dataptr;
RNA_main_pointer_create((Main*)PyLong_AsVoidPtr(pydata), &dataptr);
@@ -245,11 +236,11 @@ static PyObject *create_func(PyObject * /*self*/, PyObject *args)
int width = region.width();
int height = region.height();
session = new BlenderSession(engine, userpref, data, v3d, rv3d, width, height);
session = new BlenderSession(engine, preferences, data, v3d, rv3d, width, height);
}
else {
/* offline session or preview render */
session = new BlenderSession(engine, userpref, data, preview_osl);
session = new BlenderSession(engine, preferences, data, preview_osl);
}
return PyLong_FromVoidPtr(session);
@@ -388,9 +379,18 @@ static PyObject *sync_func(PyObject * /*self*/, PyObject *args)
Py_RETURN_NONE;
}
static PyObject *available_devices_func(PyObject * /*self*/, PyObject * /*args*/)
static PyObject *available_devices_func(PyObject * /*self*/, PyObject * args)
{
vector<DeviceInfo>& devices = Device::available_devices();
const char *type_name;
if(!PyArg_ParseTuple(args, "s", &type_name)) {
return NULL;
}
DeviceType type = Device::type_from_string(type_name);
uint mask = (type == DEVICE_NONE) ? DEVICE_MASK_ALL : DEVICE_MASK(type);
mask |= DEVICE_MASK_CPU;
vector<DeviceInfo> devices = Device::available_devices(mask);
PyObject *ret = PyTuple_New(devices.size());
for(size_t i = 0; i < devices.size(); i++) {
@@ -616,8 +616,148 @@ static PyObject *opencl_disable_func(PyObject * /*self*/, PyObject * /*value*/)
DebugFlags().opencl.device_type = DebugFlags::OpenCL::DEVICE_NONE;
Py_RETURN_NONE;
}
static PyObject *opencl_compile_func(PyObject * /*self*/, PyObject *args)
{
PyObject *sequence = PySequence_Fast(args, "Arguments must be a sequence");
if(sequence == NULL) {
Py_RETURN_FALSE;
}
vector<string> parameters;
for(Py_ssize_t i = 0; i < PySequence_Fast_GET_SIZE(sequence); i++) {
PyObject *item = PySequence_Fast_GET_ITEM(sequence, i);
PyObject *item_as_string = PyObject_Str(item);
const char *parameter_string = PyUnicode_AsUTF8(item_as_string);
parameters.push_back(parameter_string);
Py_DECREF(item_as_string);
}
Py_DECREF(sequence);
if (device_opencl_compile_kernel(parameters)) {
Py_RETURN_TRUE;
}
else {
Py_RETURN_FALSE;
}
}
#endif
static bool denoise_parse_filepaths(PyObject *pyfilepaths, vector<string>& filepaths)
{
if(PyUnicode_Check(pyfilepaths)) {
const char *filepath = PyUnicode_AsUTF8(pyfilepaths);
filepaths.push_back(filepath);
return true;
}
PyObject *sequence = PySequence_Fast(pyfilepaths, "File paths must be a string or sequence of strings");
if(sequence == NULL) {
return false;
}
for(Py_ssize_t i = 0; i < PySequence_Fast_GET_SIZE(sequence); i++) {
PyObject *item = PySequence_Fast_GET_ITEM(sequence, i);
const char *filepath = PyUnicode_AsUTF8(item);
if(filepath == NULL) {
PyErr_SetString(PyExc_ValueError, "File paths must be a string or sequence of strings.");
Py_DECREF(sequence);
return false;
}
filepaths.push_back(filepath);
}
Py_DECREF(sequence);
return true;
}
static PyObject *denoise_func(PyObject * /*self*/, PyObject *args, PyObject *keywords)
{
static const char *keyword_list[] = {"preferences", "scene", "view_layer",
"input", "output",
"tile_size", "samples", NULL};
PyObject *pypreferences, *pyscene, *pyviewlayer;
PyObject *pyinput, *pyoutput = NULL;
int tile_size = 0, samples = 0;
if (!PyArg_ParseTupleAndKeywords(args, keywords, "OOOO|Oii", (char**)keyword_list,
&pypreferences, &pyscene, &pyviewlayer,
&pyinput, &pyoutput,
&tile_size, &samples)) {
return NULL;
}
/* Get device specification from preferences and scene. */
PointerRNA preferencesptr;
RNA_pointer_create(NULL, &RNA_Preferences, (void*)PyLong_AsVoidPtr(pypreferences), &preferencesptr);
BL::Preferences b_preferences(preferencesptr);
PointerRNA sceneptr;
RNA_id_pointer_create((ID*)PyLong_AsVoidPtr(pyscene), &sceneptr);
BL::Scene b_scene(sceneptr);
DeviceInfo device = blender_device_info(b_preferences, b_scene, true);
/* Get denoising parameters from view layer. */
PointerRNA viewlayerptr;
RNA_pointer_create((ID*)PyLong_AsVoidPtr(pyscene), &RNA_ViewLayer, PyLong_AsVoidPtr(pyviewlayer), &viewlayerptr);
PointerRNA cviewlayer = RNA_pointer_get(&viewlayerptr, "cycles");
DenoiseParams params;
params.radius = get_int(cviewlayer, "denoising_radius");
params.strength = get_float(cviewlayer, "denoising_strength");
params.feature_strength = get_float(cviewlayer, "denoising_feature_strength");
params.relative_pca = get_boolean(cviewlayer, "denoising_relative_pca");
params.neighbor_frames = get_int(cviewlayer, "denoising_neighbor_frames");
/* Parse file paths list. */
vector<string> input, output;
if(!denoise_parse_filepaths(pyinput, input)) {
return NULL;
}
if(pyoutput) {
if(!denoise_parse_filepaths(pyoutput, output)) {
return NULL;
}
}
else {
output = input;
}
if(input.empty()) {
PyErr_SetString(PyExc_ValueError, "No input file paths specified.");
return NULL;
}
if(input.size() != output.size()) {
PyErr_SetString(PyExc_ValueError, "Number of input and output file paths does not match.");
return NULL;
}
/* Create denoiser. */
Denoiser denoiser(device);
denoiser.params = params;
denoiser.input = input;
denoiser.output = output;
if (tile_size > 0) {
denoiser.tile_size = make_int2(tile_size, tile_size);
}
if (samples > 0) {
denoiser.samples_override = samples;
}
/* Run denoiser. */
if(!denoiser.run()) {
PyErr_SetString(PyExc_ValueError, denoiser.error.c_str());
return NULL;
}
Py_RETURN_NONE;
}
static PyObject *debug_flags_update_func(PyObject * /*self*/, PyObject *args)
{
PyObject *pyscene;
@@ -746,11 +886,11 @@ static PyObject *enable_print_stats_func(PyObject * /*self*/, PyObject * /*args*
static PyObject *get_device_types_func(PyObject * /*self*/, PyObject * /*args*/)
{
vector<DeviceInfo>& devices = Device::available_devices();
vector<DeviceType> device_types = Device::available_types();
bool has_cuda = false, has_opencl = false;
for(int i = 0; i < devices.size(); i++) {
has_cuda |= (devices[i].type == DEVICE_CUDA);
has_opencl |= (devices[i].type == DEVICE_OPENCL);
foreach(DeviceType device_type, device_types) {
has_cuda |= (device_type == DEVICE_CUDA);
has_opencl |= (device_type == DEVICE_OPENCL);
}
PyObject *list = PyTuple_New(2);
PyTuple_SET_ITEM(list, 0, PyBool_FromLong(has_cuda));
@@ -772,12 +912,16 @@ static PyMethodDef methods[] = {
{"osl_update_node", osl_update_node_func, METH_VARARGS, ""},
{"osl_compile", osl_compile_func, METH_VARARGS, ""},
#endif
{"available_devices", available_devices_func, METH_NOARGS, ""},
{"available_devices", available_devices_func, METH_VARARGS, ""},
{"system_info", system_info_func, METH_NOARGS, ""},
#ifdef WITH_OPENCL
{"opencl_disable", opencl_disable_func, METH_NOARGS, ""},
{"opencl_compile", opencl_compile_func, METH_VARARGS, ""},
#endif
/* Standalone denoising */
{"denoise", (PyCFunction)denoise_func, METH_VARARGS|METH_KEYWORDS, ""},
/* Debugging routines */
{"debug_flags_update", debug_flags_update_func, METH_VARARGS, ""},
{"debug_flags_reset", debug_flags_reset_func, METH_NOARGS, ""},
@@ -801,7 +945,7 @@ static struct PyModuleDef module = {
"Blender cycles render integration",
-1,
methods,
NULL, NULL, NULL, NULL
NULL, NULL, NULL, NULL,
};
CCL_NAMESPACE_END

View File

@@ -30,6 +30,7 @@
#include "render/shader.h"
#include "render/stats.h"
#include "util/util_algorithm.h"
#include "util/util_color.h"
#include "util/util_foreach.h"
#include "util/util_function.h"
@@ -114,9 +115,6 @@ BlenderSession::~BlenderSession()
void BlenderSession::create()
{
create_session();
if(b_v3d)
session->start();
}
void BlenderSession::create_session()
@@ -395,6 +393,41 @@ static void add_cryptomatte_layer(BL::RenderResult& b_rr, string name, string ma
render_add_metadata(b_rr, prefix+"manifest", manifest);
}
void BlenderSession::stamp_view_layer_metadata(Scene *scene, const string& view_layer_name)
{
BL::RenderResult b_rr = b_engine.get_result();
string prefix = "cycles." + view_layer_name + ".";
/* Configured number of samples for the view layer. */
b_rr.stamp_data_add_field(
(prefix + "samples").c_str(),
to_string(session->params.samples).c_str());
/* Store ranged samples information. */
if(session->tile_manager.range_num_samples != -1) {
b_rr.stamp_data_add_field(
(prefix + "range_start_sample").c_str(),
to_string(session->tile_manager.range_start_sample).c_str());
b_rr.stamp_data_add_field(
(prefix + "range_num_samples").c_str(),
to_string(session->tile_manager.range_num_samples).c_str());
}
/* Write cryptomatte metadata. */
if(scene->film->cryptomatte_passes & CRYPT_OBJECT) {
add_cryptomatte_layer(b_rr, view_layer_name + ".CryptoObject",
scene->object_manager->get_cryptomatte_objects(scene));
}
if(scene->film->cryptomatte_passes & CRYPT_MATERIAL) {
add_cryptomatte_layer(b_rr, view_layer_name + ".CryptoMaterial",
scene->shader_manager->get_cryptomatte_materials(scene));
}
if(scene->film->cryptomatte_passes & CRYPT_ASSET) {
add_cryptomatte_layer(b_rr, view_layer_name + ".CryptoAsset",
scene->object_manager->get_cryptomatte_assets(scene));
}
}
void BlenderSession::render(BL::Depsgraph& b_depsgraph_)
{
b_depsgraph = b_depsgraph_;
@@ -410,9 +443,6 @@ void BlenderSession::render(BL::Depsgraph& b_depsgraph_)
/* render each layer */
BL::ViewLayer b_view_layer = b_depsgraph.view_layer_eval();
/* We do some special meta attributes when we only have single layer. */
const bool is_single_layer = (b_scene.view_layers.length() == 1);
/* temporary render result to find needed passes and views */
BL::RenderResult b_rr = begin_render_result(b_engine, 0, 0, 1, 1, b_view_layer.name().c_str(), NULL);
BL::RenderResult::layers_iterator b_single_rlay;
@@ -425,26 +455,27 @@ void BlenderSession::render(BL::Depsgraph& b_depsgraph_)
buffer_params.passes = passes;
PointerRNA crl = RNA_pointer_get(&b_view_layer.ptr, "cycles");
bool use_denoising = get_boolean(crl, "use_denoising");
bool denoising_passes = use_denoising || get_boolean(crl, "denoising_store_passes");
bool full_denoising = get_boolean(crl, "use_denoising");
bool write_denoising_passes = get_boolean(crl, "denoising_store_passes");
session->tile_manager.schedule_denoising = use_denoising;
buffer_params.denoising_data_pass = denoising_passes;
bool run_denoising = full_denoising || write_denoising_passes;
session->tile_manager.schedule_denoising = run_denoising;
buffer_params.denoising_data_pass = run_denoising;
buffer_params.denoising_clean_pass = (scene->film->denoising_flags & DENOISING_CLEAN_ALL_PASSES);
buffer_params.denoising_prefiltered_pass = write_denoising_passes;
session->params.use_denoising = use_denoising;
session->params.denoising_passes = denoising_passes;
session->params.denoising_radius = get_int(crl, "denoising_radius");
session->params.denoising_strength = get_float(crl, "denoising_strength");
session->params.denoising_feature_strength = get_float(crl, "denoising_feature_strength");
session->params.denoising_relative_pca = get_boolean(crl, "denoising_relative_pca");
session->params.run_denoising = run_denoising;
session->params.full_denoising = full_denoising;
session->params.write_denoising_passes = write_denoising_passes;
session->params.denoising.radius = get_int(crl, "denoising_radius");
session->params.denoising.strength = get_float(crl, "denoising_strength");
session->params.denoising.feature_strength = get_float(crl, "denoising_feature_strength");
session->params.denoising.relative_pca = get_boolean(crl, "denoising_relative_pca");
scene->film->denoising_data_pass = buffer_params.denoising_data_pass;
scene->film->denoising_clean_pass = buffer_params.denoising_clean_pass;
session->params.denoising_radius = get_int(crl, "denoising_radius");
session->params.denoising_strength = get_float(crl, "denoising_strength");
session->params.denoising_feature_strength = get_float(crl, "denoising_feature_strength");
session->params.denoising_relative_pca = get_boolean(crl, "denoising_relative_pca");
scene->film->denoising_prefiltered_pass = buffer_params.denoising_prefiltered_pass;
scene->film->pass_alpha_threshold = b_view_layer.pass_alpha_threshold();
scene->film->tag_passes_update(scene, passes);
@@ -452,6 +483,12 @@ void BlenderSession::render(BL::Depsgraph& b_depsgraph_)
scene->integrator->tag_update(scene);
BL::RenderResult::views_iterator b_view_iter;
int num_views = 0;
for(b_rr.views.begin(b_view_iter); b_view_iter != b_rr.views.end(); ++b_view_iter) {
num_views++;
}
int view_index = 0;
for(b_rr.views.begin(b_view_iter); b_view_iter != b_rr.views.end(); ++b_view_iter, ++view_index) {
b_rview_name = b_view_iter->name();
@@ -473,7 +510,12 @@ void BlenderSession::render(BL::Depsgraph& b_depsgraph_)
/* Attempt to free all data which is held by Blender side, since at this
* point we knwo that we've got everything to render current view layer.
*/
free_blender_memory_if_possible();
/* At the moment we only free if we are not doing multi-view (or if we are rendering the last view).
* See T58142/D4239 for discussion.
*/
if(view_index == num_views - 1) {
free_blender_memory_if_possible();
}
/* Make sure all views have different noise patterns. - hardcoded value just to make it random */
if(view_index != 0) {
@@ -511,28 +553,8 @@ void BlenderSession::render(BL::Depsgraph& b_depsgraph_)
break;
}
if(is_single_layer) {
BL::RenderResult b_rr = b_engine.get_result();
string num_aa_samples = string_printf("%d", session->params.samples);
b_rr.stamp_data_add_field("Cycles Samples", num_aa_samples.c_str());
/* TODO(sergey): Report whether we're doing resumable render
* and also start/end sample if so.
*/
}
/* Write cryptomatte metadata. */
if(scene->film->cryptomatte_passes & CRYPT_OBJECT) {
add_cryptomatte_layer(b_rr, b_rlay_name+".CryptoObject",
scene->object_manager->get_cryptomatte_objects(scene));
}
if(scene->film->cryptomatte_passes & CRYPT_MATERIAL) {
add_cryptomatte_layer(b_rr, b_rlay_name+".CryptoMaterial",
scene->shader_manager->get_cryptomatte_materials(scene));
}
if(scene->film->cryptomatte_passes & CRYPT_ASSET) {
add_cryptomatte_layer(b_rr, b_rlay_name+".CryptoAsset",
scene->object_manager->get_cryptomatte_assets(scene));
}
/* add metadata */
stamp_view_layer_metadata(scene, b_rlay_name);
/* free result without merging */
end_render_result(b_engine, b_rr, true, true, false);
@@ -683,10 +705,14 @@ void BlenderSession::bake(BL::Depsgraph& b_depsgraph_,
}
}
int object = object_index;
/* Object might have been disabled for rendering or excluded in some
* other way, in that case Blender will report a warning afterwards. */
if (object_index != OBJECT_NONE) {
int object = object_index;
bake_data = scene->bake_manager->init(object, tri_offset, num_pixels);
populate_bake_data(bake_data, object_id, pixel_array, num_pixels);
bake_data = scene->bake_manager->init(object, tri_offset, num_pixels);
populate_bake_data(bake_data, object_id, pixel_array, num_pixels);
}
/* set number of samples */
session->tile_manager.set_samples(session_params.samples);
@@ -697,7 +723,7 @@ void BlenderSession::bake(BL::Depsgraph& b_depsgraph_,
}
/* Perform bake. Check cancel to avoid crash with incomplete scene data. */
if(!session->progress.get_cancel()) {
if(!session->progress.get_cancel() && bake_data) {
scene->bake_manager->bake(scene->device, &scene->dscene, scene, session->progress, shader_type, bake_pass_filter, bake_data, result);
}
@@ -804,7 +830,6 @@ void BlenderSession::synchronize(BL::Depsgraph& b_depsgraph_)
{
free_session();
create_session();
session->start();
return;
}
@@ -857,6 +882,10 @@ void BlenderSession::synchronize(BL::Depsgraph& b_depsgraph_)
/* reset time */
start_resize_time = 0.0;
}
/* Start rendering thread, if it's not running already. Do this
* after all scene data has been synced at least once. */
session->start();
}
bool BlenderSession::draw(int w, int h)
@@ -1384,9 +1413,15 @@ void BlenderSession::update_resumable_tile_manager(int num_samples)
return;
}
const int num_samples_per_chunk = (int)ceilf((float)num_samples / num_resumable_chunks);
if (num_resumable_chunks > num_samples) {
fprintf(stderr, "Cycles warning: more sample chunks (%d) than samples (%d), "
"this will cause some samples to be included in multiple chunks.\n",
num_resumable_chunks, num_samples);
}
int range_start_sample, range_num_samples;
const float num_samples_per_chunk = (float)num_samples / num_resumable_chunks;
float range_start_sample, range_num_samples;
if(current_resumable_chunk != 0) {
/* Single chunk rendering. */
range_start_sample = num_samples_per_chunk * (current_resumable_chunk - 1);
@@ -1398,19 +1433,25 @@ void BlenderSession::update_resumable_tile_manager(int num_samples)
range_start_sample = num_samples_per_chunk * (start_resumable_chunk - 1);
range_num_samples = num_chunks * num_samples_per_chunk;
}
/* Round after doing the multiplications with num_chunks and num_samples_per_chunk
* to allow for many small chunks. */
int rounded_range_start_sample = (int)floor(range_start_sample + 0.5f);
int rounded_range_num_samples = max((int)floor(range_num_samples + 0.5f), 1);
/* Make sure we don't overshoot. */
if(range_start_sample + range_num_samples > num_samples) {
range_num_samples = num_samples - range_num_samples;
if(rounded_range_start_sample + rounded_range_num_samples > num_samples) {
rounded_range_num_samples = num_samples - rounded_range_num_samples;
}
VLOG(1) << "Samples range start is " << range_start_sample << ", "
<< "number of samples to render is " << range_num_samples;
scene->integrator->start_sample = range_start_sample;
scene->integrator->start_sample = rounded_range_start_sample;
scene->integrator->tag_update(scene);
session->tile_manager.range_start_sample = range_start_sample;
session->tile_manager.range_num_samples = range_num_samples;
session->tile_manager.range_start_sample = rounded_range_start_sample;
session->tile_manager.range_num_samples = rounded_range_num_samples;
}
void BlenderSession::free_blender_memory_if_possible()

View File

@@ -151,6 +151,8 @@ public:
static bool print_render_stats;
protected:
void stamp_view_layer_metadata(Scene *scene, const string& view_layer_name);
void do_write_update_render_result(BL::RenderResult& b_rr,
BL::RenderLayer& b_rlay,
RenderTile& rtile,

Some files were not shown because too many files have changed in this diff Show More