Compare commits

...

530 Commits

Author SHA1 Message Date
05517c9bed Merge remote-tracking branch 'origin/blender2.8' into temp-eeveelightcache
# Conflicts:
#	source/blender/draw/engines/eevee/eevee_lightprobes.c
2018-07-09 23:03:21 +02:00
ff11750ee9 GPUTexture: Fix GPU_texture_read for depth stencil format 2018-07-09 22:33:29 +02:00
abbd997193 Eevee: LightCache: Use render visibility to select the probe
If a probe is not visible during render, it will not be selected to be
baked into the lightcache.
2018-07-09 22:29:45 +02:00
0f13e53669 Eevee: LightCache: Fix cache validation. 2018-07-09 22:26:48 +02:00
6100c236fb Eevee: LightCache: Fix wrong mipmap size 2018-07-09 22:23:34 +02:00
0bbccd3741 Eevee: LightCache: Fix problem caused by probe sorting 2018-07-09 22:22:37 +02:00
07e368cb5f UI: hide status bar constraints when not used 2018-07-09 18:25:47 +02:00
881cc17ffa UI: hide status bar items when 2018-07-09 18:14:41 +02:00
113b053d5b WM: add utility function to refresh status bar 2018-07-09 18:14:41 +02:00
12d4ebcaa3 Merge branch 'master' into blender2.8 2018-07-09 17:57:37 +02:00
8c528a4f0a Cleanup: use const transform args 2018-07-09 17:57:05 +02:00
5a56e4997f Depsgraph: Fix non-working drivers after recent relations change 2018-07-09 17:42:36 +02:00
cf9f0b35be UI: add search to popup toolbar
Add for convenience only.
2018-07-09 17:37:15 +02:00
deaa90b5a5 Eevee: LightCache: Add Light Cache infos in the UI
This is still a bit basic but will be enhance in the future.
2018-07-09 17:08:05 +02:00
be8855a2ef UI: move visibility panel into the side bar 2018-07-09 17:00:09 +02:00
0e6abf414f Keymap: use Shift-AccentGrave for fly/walk mode 2018-07-09 16:44:26 +02:00
a21742a07b Eevee: LightCache: Small fixes and cleanups 2018-07-09 15:48:12 +02:00
65ac6e214d Eevee: LightProbe: UI tweaks 2018-07-09 15:47:30 +02:00
0b9350bb51 Eevee: LightCache: Add free operator. 2018-07-09 15:46:57 +02:00
edeb9e5b01 Fix T55868: duplicating collection instances fails sometimes. 2018-07-09 15:37:36 +02:00
e8bc8bf618 UI: Minor tweaks to default theme
Based on feedback from the 'User Feedback' devtalk forum

* More opaque panels for the viewport
* Darker state colors
* Current frame color consistency for MCE
2018-07-09 15:36:37 +02:00
7bb7c3e5cb GPUTexture: Fix mipmap size calculation. 2018-07-09 15:34:01 +02:00
49099c9048 Eevee: LightCache: Add cubemap only baking button. 2018-07-09 15:33:23 +02:00
edb78d528b Keymap: Remove AccentGrave for each
Use only F3 for search since this is a common enough key
and it turns out having AccentGrave access on non US layouts is
too unreliable.
2018-07-09 14:55:31 +02:00
d37929c85b Depsgraph: Force modifier stack update when mesh is copied
Modifier stack might reference arrays from mesh, so if any of sub-data
pointer changed, modifier stack is to be re-evaluated.
2018-07-09 14:42:56 +02:00
f84956738b Depsgraph: Forbid flush from copy-on-write operations down the road
Old behavior: tagging ID with DEG_TAG_COPY_ON_WRITE will do copy-on-write
(as requested), but will also flush changes to all operations with depends
on it. This means, for example, tagging object for copy-on-write will force
its modifier stack to be evaluated.

This was needed in the earlier days of copy-on-write when things were not
well defined and when lots of areas were not doing proper tagging.

New behavior: tagging ID with DEG_TAG_COPY_ON_WRITE will only ensure copy
of the dadatblock is up to date, without flushing updates to any dependencies.

This means following things:

- We can update parts of ID without invoking heavy computation of other
  parts of same ID. For example, tagging object for COPY_ON_WRITE update
  on mode change will not force modifiers stack to update.

- If some dependent datablock is dependent on pointers which are invalidated
  by copy-on-write (like, evaluated mesh referencing custom data layers from
  original mesh), this will either require explicit tag or explicit relation
  in the dependency graph.

  Currently can not find a faulty case since tagging of mesh happens with
  either 0 (which means, everything) or with GEOMETRY, which also forces
  all dependent modifier stacks to be re-evaluated.

This fixes missing PBVH when going into sculpt mode (sculpt mode toggle
was tagging object for COPY_ON_WRITE update, which was forcing modifier
stack to be updated, which was freeing PBVH.

Some other operations might also become faster with this change.
2018-07-09 14:42:56 +02:00
bf02c4ba00 Keymap: Add back Shift-R 'repeat last'
This may be used often in a workflow, so keep the key.
2018-07-09 14:08:25 +02:00
53c24bf97c Keymap: macos only operator search key: Cmd-F
Add Cmd-F for apple because it's not easily available on some systems.
2018-07-09 14:06:51 +02:00
a724963640 Fix object mode menu crashing w/o active object 2018-07-09 13:39:12 +02:00
ce885edfee UI: Remove 1 pixel gap between panel header and background 2018-07-09 12:57:51 +02:00
b24232ff34 Keymap: Remove modal keymaps from blender_27x
Hard coded keys have been removed from transform.
Since these keymaps will likely remain unchanged,
remove them to avoid maintenance overhead.
2018-07-09 08:55:06 +02:00
d2923d7d62 UI: hide redundant transform keymap items 2018-07-09 08:41:51 +02:00
32396b3164 WM: support for filtering modal keymap items
Modal keymap display often shows items which aren't used,
add a poll funciton to hide these from the status bar.
2018-07-09 08:39:09 +02:00
ac8aff2b28 Merge branch 'master' into blender2.8 2018-07-09 07:42:46 +02:00
6793aebad2 Cleanup: remove 'Orientation' from keymap item name
It's constraint not an orientation,
in transform context it can be inferred.
2018-07-09 07:39:26 +02:00
4c5541feef Merge branch 'master' into blender2.8 2018-07-09 07:30:58 +02:00
70e2824126 Keymap: remove some hard coded transform events
Also re-order for display purposes
2018-07-09 07:29:12 +02:00
fb81446f56 Merge branch 'master' into blender2.8 2018-07-09 06:41:21 +02:00
9856dd9fec Cleanup: right shift 2018-07-09 06:38:07 +02:00
4ab37b3225 3D View: select exclude w/ ob-center enabled 2018-07-09 06:29:48 +02:00
aed82dafff Icons: support for drawing event icons
Use for drawing modal operator header keys.
2018-07-08 22:17:42 +02:00
907dd3d34a Fix crash in lamp preview render
Missing NULL check in object type filtering.
2018-07-08 21:15:39 +02:00
73d2d75eed Cleanup: rename 'ct' to 'len' for editors 2018-07-08 13:19:10 +02:00
9fb9125184 Cleanup: rename 'ct' to 'len' for gpu 2018-07-08 13:14:49 +02:00
804205babe Cleanup: rename 'ct' to 'len' for gawain 2018-07-08 13:05:41 +02:00
392ed710d6 Cleanup: rename 'ct' to 'len' for size vars 2018-07-08 12:50:00 +02:00
6d72d3c862 Cleanup: abbreviate unsigned types (editors, wm) 2018-07-08 12:49:36 +02:00
9d43ed521c Cleanup: abbreviate unsigned types (draw manager) 2018-07-08 12:49:03 +02:00
1f51b0212f Eevee: LightCache: Add Autobake property
This also add partial probe update per type (only update cubemap if needed)
but it seems to be broken by some double update tagging in the depsgraph.
2018-07-08 09:28:58 +02:00
b5811bccf8 Correct recent keymap change, writing all keymaps 2018-07-07 20:03:30 +02:00
8467a7a351 Keymap: store 2.7x map as data instead of running code 2018-07-07 19:53:05 +02:00
f7bce99e4d Keymap: support for reading/writing keymaps as data
Instead of running code to create a keymap, store them as data.
This allows for keymaps to share content as well as running
transformations at load time.
2018-07-07 19:53:02 +02:00
5480de3fca Fix scale in Apply Pose As Rest Pose for bendy bones.
Scale is multiplicative, and adding it up causes the bone to bloat.
2018-07-07 15:10:41 +03:00
6d0d237be3 Eevee: LightCache: Add auto update when lightprobe are being modified
One draw back is that there is a significant overhead caused by creating
the batches for the new depsgraph. Caching the depsgraph between subsequent
update is not possible right now because we cannot update it. This is to be
adressed in the future.

There is no option to disable auto update right now.
2018-07-07 12:58:46 +02:00
1f539cd7ef Merge branch 'master' into blender2.8 2018-07-07 11:32:40 +02:00
97cd8bfae1 Cleanup: isinstance can take multiple types 2018-07-07 11:29:57 +02:00
0f1000ce0b Cleanup: pep8, style 2018-07-07 09:02:34 +02:00
80a31d30a4 Merge branch 'master' into blender2.8 2018-07-07 08:53:00 +02:00
4b373ed086 Cleanup: pep8 2018-07-07 08:48:35 +02:00
252207cc7a Cleanup: redundant poll checks 2018-07-07 08:36:17 +02:00
a6340a5068 Viewport: in Lookdev shading, disable scene lights and world by default.
Now we light with just a user defined HDRI by default, which is useful
for material setup and texture painting and lighting without having to
set up any scene lights.

Previously it would use the scene world without lights by default, which
in some files is just black.
2018-07-06 20:22:03 +02:00
aed09d4329 Cleanup: remove unused shader node compatibility flag.
No longer needed after Blender Internal removal and Eevee replacing the
Cycles GLSL shading nodes.
2018-07-06 20:22:03 +02:00
74fd17e9d7 UI/Python: rename Lamps to Lights, to follow more standard terminology.
Internally it's still mostly named lamps, though some modules like Cycles
were already calling them lights.
2018-07-06 20:06:09 +02:00
4ac048f4e4 Merge branch 'master' into blender2.8 2018-07-06 19:34:41 +02:00
Julian Eisel
29b8adec61 UI: Add extra padding to menus to draw sub-menu triangles in
Shortcut strings would be offset to the left to make space for the triangles,
breaking the alignment with other shortcut strings. Now this alignment is kept
by making menus slightly wider if there's a sub-menu triangle visible, making
room for the triangle.
2018-07-06 19:33:13 +02:00
Julian Eisel
2a199f5093 UI: Use flat triangle drawing for indicating submenus
Left the RIGHTARROW_THIN icon in, even though it's not used in C code anymore.
However add-ons may do (e.g. Amaranth does).
2018-07-06 19:33:13 +02:00
b94222b090 PyDrivers: update bytecode check for Python3.6 2018-07-06 19:31:00 +02:00
d360eced65 UI: Single-column for 3D Cursor panel in 3D View 2018-07-06 18:29:57 +02:00
Vuk Gardašević
4674cffe29 UI: 3D View, View panel: single-column, flow and subpanel
See D3525
2018-07-06 18:23:15 +02:00
a48b52d546 3D View: support object type visibility/selection
Trying to have a single option for this is too likely to be
insufficient in some cases.

Instead, support object type visibility & selectability per view-port.
2018-07-06 17:53:40 +02:00
63f3e1ac7c Merge branch 'master' into blender2.8 2018-07-06 17:16:23 +02:00
22150eb409 Animation player: Ensure new frames are displayed while dragging mouse
Thanks Campbell for review!
2018-07-06 17:15:40 +02:00
49af17beb8 Fix T55796: Motion Paths are not being drawn as overlay
Remove depth testing flags from motion path pass drawing,
so that they always appear to draw in "x-ray" style on top
of everything, making it easier for animators to see what
they're doing.
2018-07-07 02:53:34 +12:00
4e4e88f02b UI: Default theme unification
More unification of colors and roundness.

Also use accent color as current_frame indicator.
2018-07-06 16:15:34 +02:00
5402529deb DEG: Fix drawdata type usage 2018-07-06 15:17:58 +02:00
7538716d57 Merge remote-tracking branch 'origin/blender2.8' into temp-eeveelightcache 2018-07-06 14:50:54 +02:00
7ea26cc9c5 Keymap: update 2.7x 2018-07-06 14:50:04 +02:00
15f4aa182f Depsgraph: Relations builder should not tag ID in all depsgraphs 2018-07-06 14:46:35 +02:00
571e773fbe Keymap: outliner now uses A/Alt-A for selection 2018-07-06 14:45:30 +02:00
79dabc537e Merge branch 'master' into blender2.8 2018-07-06 14:41:52 +02:00
3527857cdc Cleanup: use outliner_flag_* name prefix 2018-07-06 14:40:13 +02:00
b0c32818ba UI: small layout fixes for RMB context menus. 2018-07-06 14:32:25 +02:00
9fc79a4033 UI: disable broken horizontal properties editor alignment. 2018-07-06 14:19:11 +02:00
3da1207b48 UI: draw search popups with menu background, instead of box.
Otherwise these are not visible well with the new dark theme.
2018-07-06 14:19:11 +02:00
a364150c14 Fix crash with properties editor pinning. 2018-07-06 14:19:11 +02:00
02f903d099 Fix layout issue with enum property separators. 2018-07-06 14:19:11 +02:00
2aba2de92b Merge branch 'master' into blender2.8
Conflicts:
	source/blender/editors/screen/screen_edit.c
2018-07-06 14:03:51 +02:00
843d5d707d Merge remote-tracking branch 'origin/master' into blender2.8 2018-07-06 13:53:35 +02:00
81a93df6d2 Fix crash when startup file has an image in it
This fixes an issue introduced in d192d72312.
When starting up, the UI hasn't been fully initialised yet, and calling
wm_event_do_depsgraph() can trigger icon updates when the startup file
contains an image, causing a segfault due to a not-yet-initialised ghash
for the icons.
2018-07-06 13:52:35 +02:00
0987c11c76 fix c++ comment style in 3cc2a9b934 2018-07-06 13:15:44 +02:00
12ce0cfb21 Ocean Modifier: removed unused refresh flags
The flags were set and cleared correctly, but nothing was actually reading
them.
2018-07-06 12:50:04 +02:00
7691040166 Ocean Modifier: removed the MOD_OCEAN_REFRESH_ADD flag
The flag was only used in readfile.c, and resulted in a delayed call to
BKE_ocean_add(); this call is now immediately made instead as it's not
very expensive.
2018-07-06 12:46:58 +02:00
ccef83b2fb Merge branch 'master' into blender2.8
Conflicts:
source/blender/editors/screen/screen_edit.c
2018-07-06 12:30:48 +02:00
dd5c25fab2 Remove print left in by accident 2018-07-06 12:10:30 +02:00
3cc2a9b934 Fix T55581: kill running (render) jobs when deleting a scene
also fixed passing WM_JOB_TYPE_ANY to WM_jobs_kill_type()

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D3498
2018-07-06 11:58:13 +02:00
Stefan Werner
df30b50f2f Cycles: Enabled half precision textures for OpenCL devices that support the cl_khr_fp16 extension. 2018-07-06 11:42:34 +02:00
3e0920c61a Fix view pie menu 2018-07-06 11:17:50 +02:00
6379c7bd47 Addons: silence warnings instead of disabling 2018-07-06 11:03:24 +02:00
174a3348ab Addons: svg has been updated 2018-07-06 10:23:08 +02:00
Stefan Werner
d20d2bcb7f Cycles: Fixed OpenCL kernel build, it threw a compiler error. 2018-07-06 10:21:25 +02:00
de777ad9e6 Merge branch 'master' into blender2.8 2018-07-06 10:18:52 +02:00
1daa20ad9f Cleanup: strip trailing space for cycles 2018-07-06 10:17:58 +02:00
6d38d82437 Cycles: missed when renaming updated RNA 2018-07-06 10:16:28 +02:00
aff8b02394 Merge branch 'master' into 28 2018-07-06 10:10:47 +02:00
62fbb7d4a1 Empty Object: Center images by default 2018-07-06 10:05:37 +02:00
ed2204933a Fix typo in empty image drawing 2018-07-06 10:01:05 +02:00
27e0d6cbd0 Fix image drag and drop
- Dropping now creates empty images w/o holding Ctrl.
- Dropping background images works when cursor over camera.
2018-07-06 09:10:07 +02:00
3314d0bcb6 Disable addons which haven't been updated
Gave noisy warnings on startup.
2018-07-06 08:04:28 +02:00
5b3545f99f Merge branch 'master' into blender2.8 2018-07-06 07:56:08 +02:00
d56b90705e BKE_addons: utility to remove by name 2018-07-06 07:55:29 +02:00
288bcb2593 Further tweaks to drawing of non-selected graph editor keyframes
The previous commit only solves the problem when using the default
theme using factory settings. For previously saved themes, there could
still be problems, as the alpha values were still 0.

This commit improves the logic here so that while keyframe points on
unselected F-Curves will still get faded out (to not stick out too much
from the curves they live on), but the effect will not be as pronounced
(i.e. the points will stay visible all the time).
2018-07-06 15:38:25 +12:00
a71c2deac5 Fix T55777: Non-selected keys in Graph Editor are invisible
Restore theem setting default for Graph Editor's vertex,
with default alpha set to 1.0. The alpha value here needs
to be non-zero, as the alpha values currently get used
when drawing verts.
2018-07-06 15:15:45 +12:00
88a6aab8bb Fix T55775: Crash when select keyframe on object channels in Timeline editor 2018-07-06 15:01:28 +12:00
08ae597d63 Cleanup: flag checks 2018-07-05 22:56:18 +02:00
f5d096798c Merge branch 'master' into blender2.8 2018-07-05 22:50:07 +02:00
52655f5161 Cleanup: flag checks 2018-07-05 22:49:42 +02:00
8dff538989 Merge branch 'master' into blender2.8 2018-07-05 22:46:04 +02:00
0e2915b292 RNA: correct callback type
Missed when changing callbacks from int to bool type.
2018-07-05 22:25:34 +02:00
45fdf41be8 RNA: use is_dirty prefix for checking updates
Common convention for read-only update checks
2018-07-05 21:49:36 +02:00
a3f5d4cb14 Keymap: Make Ctrl-Tab toggles pose mode
Showing a pie menu is redundant since tab is already
mapped to edit mode.

Bypass the menu for pose mode toggle.
2018-07-05 21:28:25 +02:00
72e04f9890 Draw Manager: simplify object mask usage
Remove flag defines, use object types directly.
2018-07-05 20:43:50 +02:00
e5ca319f9d Cleanup: minor changes to last commit, #2 2018-07-05 19:49:05 +02:00
7112e96e0f Cleanup: minor changes to last commit 2018-07-05 19:41:38 +02:00
1bf5cc57bd Keymap: convenience Alt-MMB view switching
Allows to quickly set the view axis for advanced users,
Requested by @hjalti
2018-07-05 19:31:10 +02:00
f2de8a190f 3D View: support setting the relative axis
This sets the closest view axis, as if the current view is 'front'.

Useful to switch to the nearest left/right/top/bottom.
2018-07-05 19:31:10 +02:00
a883f0fd54 UI: add separators in properties editor header tabs. 2018-07-05 19:27:50 +02:00
dbdafe1209 Shaders: add target setting to material output node.
This makes it possible to have a single shading nodetree that contains
separate Cycles and Eevee shaders. By default the target is set to All
so shaders are shared.
2018-07-05 18:43:48 +02:00
5bd57aaa05 Viewport: tweak Z key shading toggle.
* Z now goes to solid mode when in lookdev or rendered mode.
* Alt-Z was broken after removal of texture mode, now toggles lookdev mode.
* Simplify code by turning it into a single operator.
2018-07-05 17:51:58 +02:00
d8223468fe GPU: avoid unnecessary multiple nodetree localize and output finding. 2018-07-05 17:51:58 +02:00
c974a35953 Cleanup: indentation 2018-07-05 17:08:16 +02:00
997b73c1db 3D View: split view-numpad into two operators
Naming operator based on keys it used was strange,
split into view-axis and view-camera.
2018-07-05 17:08:13 +02:00
404bacc639 Refactored into a single option
Technical all options are still there for finetuning.
2018-07-05 16:57:22 +02:00
35f8198c9d Refactor: SHOW->HIDE
HIDE needs less code also in the future, RNA still uses SHOW.
2018-07-05 16:57:22 +02:00
4dfcc6c25a Overlay: enable/disable drawing of specific object types.
This patch will allow users to customize what object types will be drawn by the object mode overlay.
It supports: Empties, Lamps, Cameras, Speakers, Armatures and Lightprobes.

It currently does not support Physics objects due to the overlap it has with other objects types.

Also be aware that in pose mode the armature is drawn, but not by the object mode overlay

Reviewers: campbellbarton

Tags: #bf_blender_2.8

Differential Revision: https://developer.blender.org/D3524
2018-07-05 16:57:22 +02:00
5db711fdd9 Depsgraph: Preserve engine data when doing object copy on write update 2018-07-05 16:56:47 +02:00
ec98d8cc9e Cleanup: Undefined function declarations 2018-07-05 16:56:47 +02:00
d192d72312 Ensure dependency graph exists before initializing editors
Will help entering sculpt mode on file load by making it possible
to fully initialize sculpt session. The goal is to make sure PBVH
exists since the very beginning of file open (missing PBVH is a
reason why object is not visible before first stroke).

This is not enough yet to fully solve the issue, since entering
sculpt mode tags object for Copy-on-Write update, which frees
PBVH.
2018-07-05 16:56:47 +02:00
c1678a3723 Revert "Overlay: enable/disable drawing of specific object types."
This reverts commit f7ec70895c.
2018-07-05 16:51:49 +02:00
f7ec70895c Overlay: enable/disable drawing of specific object types.
Added a option to the overlay popover that controls the visibility of
non-renderable objects like lamps, cameras, speakers, armatures, curves
empties and force fields.

After discussion we went for a single option with more detailed check in
the object_mode draw engine.

Differential Revision: https://developer.blender.org/D3524
2018-07-05 16:46:06 +02:00
Stefan Werner
4d00e95ee3 Cycles: Adding native support for UINT16 textures.
Textures in 16 bit integer format are sometimes used for displacement, bump and normal maps and can be exported by tools like Substance Painter. Without this patch, Cycles would promote those textures to single precision floating point, causing them to take up twice as much memory as needed.

Reviewers: #cycles, brecht, sergey

Reviewed By: #cycles, brecht, sergey

Subscribers: sergey, dingto, #cycles

Tags: #cycles

Differential Revision: https://developer.blender.org/D3523
2018-07-05 13:53:34 +02:00
a4328a4b70 Cleanup: warning 2018-07-05 12:32:31 +02:00
d13fb7a7c4 Sculpt: Fix disappearing object on undo
Tagging object for copy on write will ruin its PBVH.

Since sculpting is an "original" domain, we only need to
update draw batches to update.
2018-07-05 12:32:06 +02:00
397d088611 UI: show modal operator keymaps in the status bar
This is work in progress, transform keymap especially
needs some filtering on it's keymap.
2018-07-05 12:27:15 +02:00
1517fa4309 Fix build w/o fluidsim 2018-07-05 12:27:15 +02:00
03ef9f3214 Fluidsim: fixed memory leak 2018-07-05 12:22:55 +02:00
f4ce6d02cd Fluidsim: ported from DerivedMesh to Mesh
Also removed a bunch of unnecessary #include statements from fluidsim.c.
2018-07-05 11:30:38 +02:00
99a6d616e8 Ported CDDM_apply_vert_normals from DM to Mesh 2018-07-05 11:30:38 +02:00
edd59aa2be Revert "Keymap: use Shift-Space for auto-complete"
This reverts commit 30680b8d51.

Conflicts with typing in capitals.
2018-07-05 08:28:42 +02:00
30680b8d51 Keymap: use Shift-Space for auto-complete
Resolve conflict w/ maximized area.
2018-07-05 08:16:22 +02:00
49b86bcfec Merge branch 'master' into blender2.8 2018-07-05 07:54:47 +02:00
cd17b32583 Cleanup: pep8 2018-07-05 07:53:21 +02:00
656739067f Merge remote-tracking branch 'origin/blender2.8' into temp-eeveelightcache 2018-07-05 00:16:21 +02:00
74a17505fd Eevee: LightCache: Sort probes by size
This makes the probes more intuitive to use.

Most of the time, large probes englobe
smaller ones. If they are not sorted, the smaller ones will be occluded
by larger ones influence.
2018-07-05 00:15:42 +02:00
53c63db2ee Fix issue with closing child windows in recent changes. 2018-07-04 19:33:15 +02:00
cc6fd329e6 Eevee: LightCache: Fix compilation error. 2018-07-04 18:42:41 +02:00
b1bc3dfb89 GPUTexture: Support GL_R11FG11FB10F textures w/ GPU_DATA_FLOAT data
This was needed for matcaps.
2018-07-04 18:42:23 +02:00
535fec0661 Workspaces: change behavior when window layout for workspace is missing.
When switching the workspace in a window that does not yet have a layout
for the newly active workspace, we now duplicate the layout from the
previously active workspace. Previously it duplicated the layout from
the first window in the newly active workspace.
2018-07-04 18:40:33 +02:00
c43443d530 Workspaces: store view layer per main window, instead of per workspace.
It was a bit odd that the scene was stored per window but not the view
layer. The reasoning was that you would use different view layers for
different tasks. This is still possible, but it's more predictable to
switch them both explicitly, and with child window support manually
syncing the view layers between multiple windows is no longer needed
as often.
2018-07-04 18:40:33 +02:00
4e2228525f Workspaces: add main and child windows.
* Main windows show a topbar and statusbar, and select a workspace and
  scene. They are created with Window > New Main Window.

* Child windows do not show a topbar or statusbar. These follow the
  workspace and scene of their parent main window. Created with Window >
  New Window or View > Duplicate Area into New Window.

* The purpose of this change is to support multi monitor setups where you
  just want to put more editors on the other monitors. Without multiple
  topbars and statusbars, working within a single workspace and scene.
  Creating multiple main windows is intended to be a concious choice to
  do different tasks in different workspaces and scenes.

* Note these changes do not currently affect how the operating system
  treats the windows.

* When changing the workspace, the layout in all child windows changes.
  This makes sense if we consider child windows to be just a way to
  extend the main window across more monitors. In some case it may be
  useful to keep the same layout though, we can add an option for this
  depending on user feedback.
2018-07-04 18:40:33 +02:00
2bef8ca1b8 Cleanup: pass window to listeners, instead of screen + workspace. 2018-07-04 18:40:33 +02:00
5a1aa5b935 Keymap: movie-clip center frame, match graph view 2018-07-04 18:37:27 +02:00
54fba73812 Keymap: proportional edit keys 2018-07-04 18:25:21 +02:00
59415598e4 Fix Pose Mode selection overlay breaking other overlay.
Fix T55758
2018-07-04 18:14:12 +02:00
a8b5658437 UI: Node Link Menu to use same colors as regular menus
Node link menus (like shader settings in Material properties) used a slightly
brighter variant of the menu widget. Making it hard to style and match the rest.

Make it use widget_menuiconbut, which is just the menu widget with an icon and no arrows.

Thanks Brecht for the help!
2018-07-04 18:00:12 +02:00
1df1514d31 Kemap: mirror, flip changes from T55162 2018-07-04 17:48:09 +02:00
7e0ceb2ff6 Keymap: outliner changes from T55162 2018-07-04 17:26:16 +02:00
46d8aa6d94 UI: Default theme tweaks for Node editor 2018-07-04 17:24:20 +02:00
49fdf0b946 Keymap: Resolve inconsistencies, T55162 2018-07-04 17:10:41 +02:00
7c47b338c0 Depsgraph: Don't force copy-on-write when shading changes
Shading is supposed to be dealing with draw manager batch cached
thingamajigs, but was causing full object update.

This was causing both flickering in sculpt mode (PBVH was removed,
why it was SOMETIMES restored before draw is a mystery), and was
also causing things to be really slow.
2018-07-04 16:44:44 +02:00
56ace4b209 Depsgraph: Log entry operations which are directly modified and tagged 2018-07-04 16:44:44 +02:00
4bbbfdb26a UI: Default Theme: editor tabs more prominent
Workaround for now until all editors tabs share the dedicated Tab theme
settings under User Interface (which the top bar is currently using).

Thanks SimonStorl-Schulke from devtalk forum for feedback.
2018-07-04 16:33:50 +02:00
03ff3aebc4 Weight Paint: draw from original mesh
Selection changes weren't showing.
2018-07-04 16:27:23 +02:00
da71d831c3 Merge remote-tracking branch 'origin/blender2.8' into temp-eeveelightcache
# Conflicts:
#	source/blender/draw/engines/eevee/eevee_lightprobes.c
2018-07-04 16:01:28 +02:00
c767523727 Eevee: Fix incorrect padding in octahedral mapping
This fixes T54439
2018-07-04 15:58:21 +02:00
a232b4926f UI: Default theme tweaks to animation channels 2018-07-04 15:39:46 +02:00
f03079eff0 UI: Fix channels using editor header color as background
Channels were using TH_HEADER which is usually gray and unrelated to channels list.
Use sub channel color instead (light blue in the default theme).
2018-07-04 15:39:46 +02:00
1545657d7a Cleanup: remove unused zbuf member 2018-07-04 15:36:42 +02:00
fd341dd6f7 Added copyData flag to ocean modifier 2018-07-04 15:15:08 +02:00
d663ec48c0 Fluid Sim: Removed unused PointCache pointer
The only uses were setting it to NULL and asserting it is NULL.
2018-07-04 15:10:45 +02:00
175fe29e58 Cloth simulation: share point cache between CoW copies of objects 2018-07-04 14:54:16 +02:00
60b9d413db Pass copy flag to modifier copyData function
This will allow modifiers to decide whether to copy or share caches between
ModifierData copies.
2018-07-04 14:52:14 +02:00
c960804747 Cycles Denoising: Pass tile buffers to every OpenCL kernel to conform to standard and get rid of set_tile_info 2018-07-04 14:38:03 +02:00
f1525cf534 Cycles Denoising: Correctly handle target buffer in tile unmapping and move device swap logic to the device_memory 2018-07-04 14:37:55 +02:00
9db8bdbc65 Cycles Denoising: Cleanup: Rename tiles to tile_info 2018-07-04 14:37:24 +02:00
97a0d6fcc7 Cycles Denoising: Refactor denoiser tile handling
This deduplicates the calls for tile (un)mapping and allows to have a target buffer that is different from the source buffer (needed for baking and animation denoising).
2018-07-04 14:36:01 +02:00
b10c64bd2f Cycles Denoising: Split main function into logical steps 2018-07-04 14:35:05 +02:00
88b297da99 Keymap: resolve group/un-group inconsistencies
Apply grouping changes proposed in T55162

- Ctrl-G to make a group.
- Ctrl-Alt-G to ungroup.
2018-07-04 14:00:21 +02:00
7d355008bf Fix NLA transform crash 2018-07-04 13:54:22 +02:00
8aa1ef2675 Keymap: Add back Ctrl-M for mirror 2018-07-04 13:46:07 +02:00
72e090a3cf Keymap: Remove pie menu from tab-key
Based on discussion with @eyecandy & @venomgfx,
we agreed that Tab drag/click, is too easy to accidentally press
while moving the cursor.
It's also not typical to activate the operator on release which
introduces a small lag switching edit-mode.

This is a shame since in some ways its a nice way to re-use the key,
overall it just feels a little too unpredictable for such an important
action.

This commit makes the following changes.

- Tab: toggles edit-mode.
- Ctrl-Tab: opens pie menu.
- Ctrl-AccentGrave: toggles manipulator.

Note, while AccentGrave isn't always available
this shortcut is not essential.
2018-07-04 13:04:11 +02:00
8da2e97ec3 UI: Default theme use color for value slider item
Matches Flatty Light
2018-07-04 12:54:08 +02:00
67f4e9783b UI: Fix node triangle always using selected color
Now uses the text color instead.

Thanks to devtalk community for spotting this.
2018-07-04 12:54:08 +02:00
f9660a78ea Keymap: use add key instead of verify
Caused Xkey to be added but not delete key.
2018-07-04 12:49:23 +02:00
b575c50753 CMake: Add missing header file to list of sources 2018-07-04 12:10:02 +02:00
769c57b38a SoftBody: share point cache between CoW copies
This is the same approach as 98a0bcd425
applied to soft body simulation. In short, CoW copies share the point cache,
and treat it as read-only except when the depsgraph is active.
2018-07-04 11:33:27 +02:00
9e4d667c2c SoftBody: refactored sbFree()
This prevents having to wrap each call to sbFree() in an if(ob->soft)
condition and assign ob->soft = NULL after calling.

Furthermore, passing `Object *` allows us to change freeing behaviour
depending on whether the object is an evaluated copy or an original (not
done in this commit yet).
2018-07-04 11:22:57 +02:00
75b5ff6698 Softbody: unified copy functions
This unifies two almost-identical functions at the expense of having to
add one single 'flag' value at one call.

This makes copy_softbody() aware of the source/dest objects, allowing it
to make a distinction between doing depsgraph evaluation copies and real
object copies. This will be used in an upcoming commit to ensure that
the pointcache is shared between CoW copies, similar to the current
approach for rigidbody simulation.
2018-07-04 11:22:32 +02:00
13ec4be594 Fix T55750: Crash on moving sequencer strip
Custom-data free callback was freeing transform data too.
2018-07-04 10:31:31 +02:00
405c6c077f UI: Adjust width of Pivot, Shading and Transform Orientations popovers 2018-07-04 02:23:52 +02:00
969111f9b5 Cleanup: pep8 2018-07-03 22:35:37 +02:00
46bdbc6c78 UI: adjust popover width for overlays & toolbar 2018-07-03 19:55:51 +02:00
9e5002aded UI: optional ui-unit-width for popovers
Some popovers don't fit well with the default width,
allow panels to adjust as needed.
2018-07-03 19:55:01 +02:00
16878072a4 T55441: Pop-over large arrow offset when wide 2018-07-03 19:40:21 +02:00
bb9355e703 View3D: Remove v3d->zbuf
This is because depth test is set before drawing anything now. There is no
case where we want to draw without depth test that is not selection and
this case is not handle by v3d->zbuf anymore.

UI assume depth test is off by default. The DRWManager assume it's on.

This should fix T55623.
2018-07-03 19:22:15 +02:00
79152371c3 UI: add tool properties contexts
Currently unused, create for add-ons to populate.
2018-07-03 18:45:45 +02:00
81a23d1f2d Tool System: add operator for introspection
In some cases we want associate use an operator for a tool
for introspection, so we can for eg, automatically
use the same binding for in the popup toolbar.

Space-G/R/S for transform now work as accelerator keys again.

Also Space-E for extrude.
2018-07-03 18:38:08 +02:00
51acd54760 Fix tool-system error running in background mode 2018-07-03 18:02:16 +02:00
00db85ea81 Theme: use alpha for lamp wire
Needed for showing helper line to plane.
2018-07-03 17:46:23 +02:00
3da9d36554 Fix T55709: Pose Library - Add New Pose crashes 2018-07-03 16:50:17 +02:00
f14680b1be UI: Default theme, more tweaks
Also make the selected list items not as bright, boxes darker and
adjustments for contrast and accessibility.
2018-07-03 16:43:06 +02:00
4632e4fde4 Keymap: Use easily accessible key for animation
Based on animator feedback, this key is accessed many times a day.
Swap Shift-Space /w Ctrl-Space (full-screen area).
2018-07-03 16:37:15 +02:00
cde6bbfea1 Keymap: update 2.7x map 2018-07-03 16:34:12 +02:00
48d7cf680e Keymap: Select/De-Select support for anim-editors
Also update menu items, adding select/de-select.
2018-07-03 16:28:59 +02:00
69e512243c Cleanup: Remove unused variable 2018-07-03 15:39:32 +02:00
14b0510d21 Edit Mesh Overlay: Fix floating point instability artifacts
This was visible when vertices were very close to the near clip plane.
2018-07-03 15:39:31 +02:00
1c5b375390 UI: Default theme update for contrast
Selected color is now .9 alpha so keyed/animated/driven statuses
show through when widget is active. Assign color for overriden state.

Also fix progress bar not visible.
2018-07-03 15:36:33 +02:00
fbafa4352b Keymap: Select/De-Select now use A, Alt-A
There are still some keys to update because
some operators only support toggle.
2018-07-03 15:10:12 +02:00
c0c0eb7e7e Fix typo in transform orientations. 2018-07-03 14:52:34 +02:00
33a5cde313 Keymap: Adjust animate and manipulator toggle keys
Make room for Alt-A to be used for de-select.
Discussed with artists in studio & @venomgfx,

- Use Ctrl-Space for animation.
- Use Ctrl-Tab to toggle manipulator.
- Remove mirror transform binding.
2018-07-03 14:51:53 +02:00
76d7186d61 UI: use new transform orientation when created. 2018-07-03 14:24:22 +02:00
03ca4a57c7 Cleanup: move snap/pivot/orientation popovers to proper file. 2018-07-03 14:24:22 +02:00
a2ce6af2f5 Correct tool rename
Needed to update manipulator too.
2018-07-03 14:20:05 +02:00
952ae70109 Cleanup: unused function 2018-07-03 13:53:52 +02:00
c118b852b7 Tool System: move transform into a top-level tool
Also rename move to grab.
2018-07-03 13:52:04 +02:00
967b84534a Workbench: Fix wrong shading shadoow direction. 2018-07-03 13:36:04 +02:00
e30f25ba22 GHOST: Fix assert and rebind previous ogl context. 2018-07-03 13:36:04 +02:00
433e3db8d8 Revert "GHOST: Delay opengl context initialization"
This reverts commit 128926a41b.
2018-07-03 13:36:04 +02:00
6c9fe9cd8c Revert "GHOST: WGL: Delay context initialization for offscreen contexts."
This reverts commit 800c3c5ca5.

# Conflicts:
#	intern/ghost/intern/GHOST_ContextWGL.cpp
2018-07-03 13:36:04 +02:00
d78bcf9055 Revert "GHOST: Fix uninitialized var"
This reverts commit 27b6734022.
2018-07-03 13:36:04 +02:00
7a8403dbb0 Revert "GHOST: Fix uninitialized values."
This reverts commit aca403c819.
2018-07-03 13:36:04 +02:00
c50e1216a6 Fix dimmed shortcut key display issues in toolbar menu and color picker.
Draw with alpha * 0.5 instead of using item them color, this doesn't work
well in the toolbar menu and highlighted menu items otherwise.
2018-07-03 13:08:25 +02:00
48c93640d2 Cleanup: fix compiler warning. 2018-07-03 13:08:25 +02:00
b868e58d9b Sculpt: Fix wrong object used for crazy space calculation
Was applying modifiers twice, when it should not have.

Is expected to solve mesh corruption when in sculpt mode.
2018-07-03 12:53:29 +02:00
6d0e172fef Sculpt: Cleanup, spelling 2018-07-03 12:49:57 +02:00
268bcb8027 Sculpt: Fix ghosting artifacts when sculpting in workbench engine 2018-07-03 12:29:49 +02:00
cf2096cfd9 Nodes: add new image button to image nodes. 2018-07-03 12:25:50 +02:00
72a051f957 Cleanup: remove generation context from image new operator. 2018-07-03 12:19:16 +02:00
b4ccec6742 Fix ID buttons not working in popover menus. 2018-07-03 12:16:30 +02:00
a94d582a40 Sculpt: Fix possible race condition with undo nodes
it is possible that two threads will request same undo node, only one
of them will initialize the node. The issue is that initialization is
happening outside of a lock, which was making one thread to use non-
initialized node.

If this change is ever a bottleneck, make a lock inside of node.
2018-07-03 11:06:29 +02:00
a9211e808c UI: hide empty status mouse button when dragging 2018-07-03 10:30:13 +02:00
4bc11b72e5 Workbench: CleanUp whitespaces 2018-07-03 10:25:07 +02:00
6016abc1a3 Workbench: Fix texture drawing
Somehow not sure when the test for textures was performed on an
uninitialized variable resulting in never showing the textures at all
2018-07-03 09:54:25 +02:00
8dc18b54ad Workbench: Fix ghosting and crash in X-Ray mode
When playing animations the anti-aliasing was not reset, resulting in
ghosts from previous frames to be drawn. Also when playing animations
and switching to X-Ray mode for the first time would most likely
result in a write to uninitialized memory.
2018-07-03 09:29:04 +02:00
39678442e1 Cleanup: typos 2018-07-03 09:22:02 +02:00
d7982f71e9 Keymap: remove 'Screen Editing' from 2.7x map
Uses action-zones which aren't currently working in keymap presets.
2018-07-03 09:04:44 +02:00
1ff5cc8c1a addons: disable addons with versions below 2.8 2018-07-03 07:59:08 +02:00
7a0750016e Merge branch 'master' into blender2.8 2018-07-03 07:23:15 +02:00
eb7286bfd2 Python: Print file:line when editing UI source 2018-07-03 07:22:26 +02:00
105192e5a2 Cleanup: pep8 2018-07-03 07:13:27 +02:00
646f8bdb48 Cleanup: pep8 2018-07-03 07:12:24 +02:00
00fc1d70a7 Merge branch 'master' into blender2.8 2018-07-03 06:58:34 +02:00
8c15d612a5 Cleanup: pep8 2018-07-03 06:55:02 +02:00
b66aa0b0a6 Cleanup: pep8 2018-07-03 06:48:44 +02:00
e856eb7e8b UI: don't change the theme area when setting theme 2018-07-03 05:57:27 +02:00
Julian Eisel
be5482ba2f UI: Dim color of shortcut label in menus and toolbar
The shortcut labels now use the "Item" theme color. Its contrast for hovered
items is a bit low, but not too bad.

Note that this also changes the color of the little toolbar triangle to be grey
(the same color we use for the keymap label). IMHO that looks better though.
This doesn't update any themes other than the default one.

Part of T54711.
2018-07-03 00:54:46 +02:00
98d2055089 Fix ugly half alignment in timeline header. 2018-07-02 20:25:59 +02:00
5b5e23cec3 Splash: add "Alpha" text and link to the development fund. 2018-07-02 20:08:43 +02:00
Macelaru Tiberiu
2203b041e1 Sculpting: add Manual detail mode for dynamic topology.
In this mode mesh detail does not change on each stroke, but only when
using flood fill.

Differential Revision: https://developer.blender.org/D3515
2018-07-02 20:08:42 +02:00
8c7ddf944e Theme: use highlight from flatty light
Also make text & number editing use same colors.
2018-07-02 20:08:15 +02:00
6fce49ab08 Theme: desaturate colors
Having everything tinted gives isn't good for color perception.
2018-07-02 20:08:15 +02:00
31c9bd35bc Workbench: Fix use of uninitialized memory. 2018-07-02 19:21:01 +02:00
dc87648970 UI: Fix Properties with consecutive icons enabled in dropdown menus
It was using ICON_UNLOCKED when the property was true.

This affected the use_lock_interface properties now displayed in the Render
menu.
2018-07-02 19:14:06 +02:00
e35f9f0408 Merge branch 'master' into blender2.8 2018-07-02 18:55:24 +02:00
dbe1b07e05 Cleanup: right shift 2018-07-02 18:45:26 +02:00
Vuk Gardašević
12603826ea UI: Transform Orientations panel as popover
Functionality fits in the Transform Orientations, no need for a dedicated
panel in the viewport sidebar.

See D3511
2018-07-02 18:44:05 +02:00
9f80429ab6 Cleanup: use _f, _i suffix for GPU state API 2018-07-02 18:27:05 +02:00
c2814f5b28 Merge branch 'master' into blender2.8 2018-07-02 18:18:16 +02:00
73c577d46a Painting: fix uninitialized variable use 2018-07-02 18:16:37 +02:00
William Reynish
ac8b641b77 Outliner: remove view menu, move more into RMB context menu and filter popover. 2018-07-02 17:40:20 +02:00
ae6872e26f UI: update status bar mouse icons, draw in text color. 2018-07-02 17:40:20 +02:00
5d77216ef7 Cleanup: remove unused icon code after OpenGL upgrade. 2018-07-02 17:40:20 +02:00
861cf1d131 Fix modal keymap breaking exporter
We could support quotes in keymap names, for now don't write them.
2018-07-02 17:37:15 +02:00
94bc1a40b4 Fix sculpt key bindings 2018-07-02 17:33:34 +02:00
778b272552 Theme: use black for object wire
Would too easily loose contrast with shaded objects.

See: T55673
2018-07-02 17:09:45 +02:00
adc8569deb Error in theme color cleanup #2 2018-07-02 17:04:17 +02:00
Julian Eisel
bea364fe2a Fix: Global area edges couldn't call right click menu to join/split
Operators ignored edges along the screen-layout bounds. They should've ignored
those along window bounds instead.

Although the global areas can not be joined/split, the adjacent areas can. So
the menu should still be shown.
Had to change the return value of area joining operator, so that an error report
can show up when trying to join over a global area edge. Think this is fine to
do, but you never know with such stuff.

Preferably we'd gray out the "Join Area" item in the menu when clicking on the
edge of a global area. Unfotunately the operator uses coordinates passed as
operator properties to find the right edge/areas, which we cannot access from
the poll callback.
2018-07-02 16:56:54 +02:00
878b09562c Error in last commit 2018-07-02 16:52:08 +02:00
f4f85b9db7 Cleanup: remove redundant theme colors
Remove unused colors (colors which RNA has no access to).
2018-07-02 16:34:47 +02:00
ecc0945117 UI: show favourites from properties-space in the 3D view
This allows settings to be toggled in the 3D view.
2018-07-02 15:57:12 +02:00
5fd2ea58a6 UI: Header consistency
Snap before proportional editing, pivot after
2018-07-02 15:53:56 +02:00
41a7225794 UI: align header menus to space them closely 2018-07-02 15:47:00 +02:00
4d05dd880a Keymap: reinstate Ctrl-L key
Linking based on selection may be done often, so adding back.
2018-07-02 15:27:19 +02:00
e5767eaad1 Cycles: Fix missing curve hair when building with GCC-8 in release mode
Reshuffle cast intrinsics to make XOR to operate on __m128i rather
than on __m128.

Hopefully this does not affect performance.
2018-07-02 15:16:14 +02:00
8e0cfcfc90 Keymap: add back macos preferences shortcut
Would like to avoid OS-keys, but apparently this is expected on OSX.
2018-07-02 15:15:27 +02:00
f2124c5624 UI: revert 3D menu alignment
This caused collapsed menu to draw in a row,
will look into alternate way to avoid menus taking too much room.
2018-07-02 15:02:45 +02:00
6a323d196f UI: Header consistency for 3D Viewport
Alignment/snapping/proportional edit to the right like in all other editors,
keeping the center for the shading/overlay settings.
2018-07-02 14:54:20 +02:00
69e437ba22 UI: Header consistency for Text editor 2018-07-02 14:54:20 +02:00
79c8f5ac0d UI: Header consistency for Squencer 2018-07-02 14:54:20 +02:00
ea57345adb UI: Header consistency for Node editor
Also move use_insert_offset to the View menu as it is not toggled that often
to take space in the header.
2018-07-02 14:54:20 +02:00
fd6d149347 UI: Header consistency for UV/Image editor 2018-07-02 14:54:20 +02:00
5b7f0d36f3 UI: Header consistency for animation editors 2018-07-02 14:54:20 +02:00
cec11c86e5 UI: File Browser header consistency
Move "Recursion" and "Display Size" to a new View menu.

Thanks Campbell for helping with wonky menus.
2018-07-02 14:54:20 +02:00
34678388f3 Outliner: add outliner wide RMB context menu.
All right click menus in the outliner now include OUTLINER_MT_context.
2018-07-02 14:52:22 +02:00
b3098c30a6 UI: add workspace cycling menu items 2018-07-02 14:30:28 +02:00
20046defd7 UI: update mouse icons in status bar. 2018-07-02 13:46:09 +02:00
2e15ee0dcf Keymap: add back X-Key for delete
This is needed as part of modeling work-flow, so keep it accessible.
2018-07-02 13:00:43 +02:00
3b0148d2aa Keymap: use Page Up/Down for workspace switching
These are common keys for changing tabs,
leaving tab free to be used for tools/mode switching.
2018-07-02 12:49:45 +02:00
06994e954b UI: add screen split to window context menu 2018-07-02 12:46:51 +02:00
ec22327a5f Merge branch 'master' into blender2.8 2018-07-02 12:43:36 +02:00
c6416ae653 Screen: support splitting from floating menu 2018-07-02 12:40:17 +02:00
b076b3853c Merge branch 'master' into blender2.8 2018-07-02 12:03:56 +02:00
b88e51dd55 Cleanup: use bool for poll functions 2018-07-02 11:51:31 +02:00
ad5a20efce Commit D3494 : Compiled shader lookup fix
Authored by Pavel Rudko (PavelRudko) on Thu, Jun 21, 10:41 AM.

Original description:

I've encounterd into a problem with blender 2.8.
See the example screenshot (scene, shader setup). For some materials it's not enough to calculate hash based on fragment code and defines. In some cases attribute names may change. And if we change uv set name, for example, vertex shader is not recompiled, and another attribute name inside it is used.
2018-07-02 11:05:48 +02:00
bfbfb1c47e Correct f-string in own recent changes 2018-07-02 09:18:38 +02:00
bf7c815169 Fix T55675: Crash internal animation player 2018-07-01 21:07:18 +02:00
37994e0af2 Merge branch 'master' into blender2.8 2018-07-01 20:15:21 +02:00
26c5a1c301 Cleanup: right shift in interface code 2018-07-01 20:12:07 +02:00
192e5d65a7 Keymap: add generally useful popups to F-Keys 1..4
This allows key bindings: link/append and user-preferences
to be accessed via keys - without having to assign keys to each action.

- F1: Context sensitive help.
- F2: File Context Menu.
- F3: Search.
- F4: Window Context Menu.

Other keys F5..10, remain free,
ideally they can be kept for user actions.
2018-07-01 17:51:31 +02:00
71e65daf5c Fix T55687: compile error when not using c++11. 2018-07-01 16:48:19 +02:00
9c5203c98f Fix T55626, fix T55106: Cycles motion blur + persistent images bug. 2018-07-01 16:32:35 +02:00
36a9436d80 Merge branch 'master' into blender2.8 2018-07-01 16:22:06 +02:00
ddee0931b8 RNA: use bool for boolean RNA types
We were using int's for bool arguments in BKE,
just to avoid having wrapper functions.
2018-07-01 15:57:59 +02:00
3ec6f2172d Cleanup: reduce variable scope 2018-07-01 10:32:47 +02:00
fadad17c58 Cleanup: avoid calloc when immediately overwritten 2018-07-01 10:26:37 +02:00
bc95c7a3ea Cleanup: remove num argument prefix 2018-07-01 09:23:51 +02:00
1c0aa4e396 Cleanup: RNA naming 2018-07-01 09:13:04 +02:00
b4998548ab Cleanup: use '_len' suffix for line stipple 2018-07-01 08:42:16 +02:00
ab6e23ffbb 3D View: use 3px dashed relationship line
Seems this was accidentally doubled from 2.7x?
2018-07-01 08:36:22 +02:00
0d31ab362e Revert "Experimental Tweak: Only show relationship lines between objects when either the parent/child object is selected"
This reverts commit 9129319647.

This meant users needed to select everything to see relationship lines,
this isn't always easy since objects can have limit-selection set.

This could be made into an enum option if it's important.
2018-07-01 08:28:12 +02:00
24979ccb65 UI: set default theme outline alpha
The outline wasn't being set causing it not to draw.
2018-07-01 08:04:39 +02:00
9daf6b12a6 Merge branch 'master' into blender2.8 2018-07-01 07:24:46 +02:00
9738de820a Cleanup: use f-string 2018-06-30 22:02:41 +02:00
6a13b6324b UI: support check-boxes in quick menu
Could support other RNA types,
however menus don't work well in this case.
2018-06-30 21:08:48 +02:00
7d48a342d6 Merge branch 'master' into blender2.8 2018-06-30 18:06:20 +02:00
bea62c5c1a Cleanup: split out context member query 2018-06-30 18:05:01 +02:00
62fcf34a41 RNA: check for 3D view overlay/shading
Use to calculate paths for the info window.
2018-06-30 17:43:14 +02:00
Severin
b08fa7a6d9 UI: Support status-bar hiding
Just like the top-bar, the status-bar can now be hidden/collapsed by dragging
its edge. We display a small line with the editor outline color then, so there
is something that can be dragged up to un-collapse the area again.
This collapsed state is not written to files yet.
2018-06-30 17:01:03 +02:00
eb47ac4569 UI: correct menu label comparison 2018-06-30 16:00:18 +02:00
Severin
7f4ce6c62b Fix corrupt screen when splitting areas after collapsing top-bar 2018-06-30 15:41:04 +02:00
b35aa659d1 DNA: rename operator idname 2018-06-30 14:17:13 +02:00
eb63b32dee Merge branch 'master' into blender2.8 2018-06-30 13:52:04 +02:00
bdc1108e8c Cleanup: remove unused context arg to menu 2018-06-30 12:31:53 +02:00
41176cd3d8 UI: support adding menu's to favourites 2018-06-30 12:08:08 +02:00
62ff53ff19 UI: move queries into interface_query.c 2018-06-30 10:58:56 +02:00
b89307acfd Merge branch 'master' into blender2.8 2018-06-30 10:56:12 +02:00
a42fd3de5d UI: Add 'interface_query.c'
Interface files are increasingly mixing up too much functionality,
add a file only to handle queries.

More functions can be moved/added here.
2018-06-30 10:49:04 +02:00
ea6fef9385 Merge branch 'master' into blender2.8 2018-06-30 10:32:55 +02:00
b26e9f0000 Cleanup: rename bmesh_queries -> bmesh_query
Other files with the same purpose already used 'query'.
2018-06-30 10:32:21 +02:00
16a8f35df1 Keymap: 2.7x, use fractions 2018-06-30 10:20:16 +02:00
d15bff5e96 Keymap: 2.7x uses spacebar for search. 2018-06-30 10:06:30 +02:00
ba1f292b32 UI: add operator search to edit-menu
While this is most useful to access from an active-region,
it's not discoverable without a menu entry.
2018-06-30 10:04:08 +02:00
25b7bdb6a9 Merge branch 'master' into blender2.8 2018-06-30 09:29:38 +02:00
5c0d8bcdc7 Cleanup: use f-string 2018-06-30 09:25:23 +02:00
Severin
1f1c2d8ce8 Cleanup: Move area geometry management into an own file
Area geometry management is quite complex and not easy to get into. We should
gradualy build an API that abstracts away this complexity.
2018-06-30 01:56:07 +02:00
Severin
a55b00b53b Fix a number of small errors in area coordinate handling
For example collapsing the lower part of the topbar with 2x interface scale
would hide the top-bar header region. There were also more asserts when changing
window size and moving area edges afterwards (same assert as in T55298).
Fixes are similar to e626998a26.

With all the recent fixes I've done, area geometry handling should be stable
again. Let's hope I'm right :)
2018-06-30 00:42:19 +02:00
Severin
48ad67ef82 Cleanup: Add/use function to get area width/height from area vertices
This used to be rather cryptic and it was easy to forget the `+ 1` which in fact
is needed to get the correct width/height, see e626998a26. This should
also fix some minor off-by-one errors.
2018-06-29 21:29:06 +02:00
728e92422e Fix T54524: keyframe and driver colors not showing in shape key list.
This reverts commit 357b72e0a7 which caused
the issue, we need a better fix for that cosmetic issue from T50862. For
now displaying keyframes and drivers is the more important one.
2018-06-29 21:23:13 +02:00
Severin
ac2e10d47b Fix memory leak when using scroll-bars 2018-06-29 20:57:43 +02:00
Severin
9b6aed845a Cleanup: Remove unused argument in recursive function 2018-06-29 20:35:32 +02:00
0c94528829 Cleanup: naming in MOD_utils. 2018-06-29 19:02:19 +02:00
3bc21bc5f7 Cleanup: Moar DM busting, mostly cleaning up MOD_utils. 2018-06-29 18:58:13 +02:00
3aa61499d0 Fix unnecessary empty space in shading popover. 2018-06-29 17:58:58 +02:00
ccacf3ae3c Cycles: change AO node default to 16 samples and only local off. 2018-06-29 15:43:55 +02:00
ccca2c0164 Workbench: Spherical Harmonics tests
Added a compile directive in order to test SH4 in stead of SH2Win.
For now I disabled SH4, it is a bit more clear, but has a small
performance impact. Will check later for a better approach
2018-06-29 14:59:30 +02:00
5ba87cf22e Cleanup: remove another bunch of DM usages, includes etc. 2018-06-29 14:57:02 +02:00
a59df21ad8 Fix T55645: broken particle Use Count option for instancing objects.
There is now a manual refresh button on the panel to update the list
of objects in case it changes, and it also gets refreshed when changing
the collection or toggling the use count option.

This is a bit more manual but the previous code of refreshing the
list while evaluating the depsgraph was unreliable.

This also fixes it to take properly take into account visibility, and
to work with linked collections for which index writing was missing.
2018-06-29 14:53:02 +02:00
ece72c9ec0 Keymap: re-enable object apply transform 2018-06-29 14:12:52 +02:00
dcdde6bedb Keymap: minimal default keymap
Use 2.7x keymap preset for full keymap.

Use define to allow further adjustments.

See T55666.
2018-06-29 12:58:59 +02:00
2223d63c58 Refactor static override code to pass Main around.
Access to main database is actually rarely needed, but some custom
'apply' functions do need it (like Collections' overriding of objects or
children collections).
2018-06-29 12:48:12 +02:00
3733be8731 Cleanup: nuke G.main from BKE's particle_system.c 2018-06-29 12:48:12 +02:00
3eff6f7a5e Cleanup: some moar DM kicking, in armature edit code. 2018-06-29 12:48:12 +02:00
04f8929271 Workbench: Transparent textures
Worknemch now supports transparent textures.
As the main engine is a deferred shading only a cutoff is supported
(draw or don't draw this pixel)
2018-06-29 12:05:23 +02:00
15ebe30bc5 Workbench: remove runtime warnings
Added feature check when uploading material uniforms
2018-06-29 09:59:37 +02:00
3169160a97 Workbench: TAA optimalization
First frame of the TAA is just a regular copy of the previous buffer. so
we write directly to the final buffer and skip the taa shader. We do
init the history buffer via blit so it will be initialized for the other
iterations.
2018-06-29 09:26:58 +02:00
18d87e79e9 Merge branch 'master' into blender2.8 2018-06-29 09:25:40 +02:00
b372766816 Cleanup: trailing newlines 2018-06-29 09:23:51 +02:00
3325487530 Keymap: 2.7x macos-only additions 2018-06-29 09:19:47 +02:00
f44c9b0c93 Keymap: add 2.7x keymap
This is the keymap from 929c78e33c
before the 2.8x keymap diverged from 2.7x.

All non-modal maps have been included.
2018-06-29 09:19:40 +02:00
899d100dd4 Workbench: Use less GPU memory
When AA was enabled a new buffer was created. As the composite pass is
already done, we can reuse earlier buffers.

For the deferred rendering we reuse the color_buffer_tx and for the
forward rendering we reuse the transparect_accum_tx.
2018-06-29 08:42:56 +02:00
d34b0faa65 Workbench: Removed MaterialData UBO
Most of the times the materials differ due to the object_id. This was an
overhead and resulted in instabilities on Intel graphical cards. This
commit will revert the Material Data UBO and replace it with normal
uniform.
2018-06-29 08:27:14 +02:00
9bd0c63382 Merge branch 'master' into blender2.8 2018-06-29 08:05:38 +02:00
af36dd4664 Cleanup: trailing newlines 2018-06-29 08:02:49 +02:00
Severin
be983295ea Fix: Moving area edge could corrupt screen in very specific case
Caused by ca8f787349. This issue is in master actually. Fixing it there
would cause conflicts so won't do that unless needed ;)

Steps to recreate were:
* Split properties editor into two (default startup.blend)
* Move both properties editors to the bottom, so only their headers are visible
* Move the upper edge of the upper properties editor up and down
Although it doesn't happen everytime, you may see the edge between the timeline
and the 3D view move, while the region drawing doesn't update.

What happened is area edge snapping allowed to snap the edge outside of window
bounds (we snap to a 4px grid by default), which screen_vertices_scale
interpreted as window scaling and thus run area size updates.
2018-06-29 02:23:59 +02:00
4d39da1060 Merge branch 'master' into blender2.8 2018-06-28 23:57:00 +02:00
46dceefc35 WM: Remove Screen Cast
This feature is better handled by specialized tools.
2018-06-28 23:40:51 +02:00
Severin
4d1c5f1ec5 Change earlier fix to work with hiDPI
Referring to ca8f787349. Thought in this case the simple `+ 1` would be
correct, but we need to make the same pixel adjustment as we do in other places.
2018-06-28 21:07:30 +02:00
Severin
c7954df96c Fix: Moving area edge could make areas overlap status-bar
Simply moving the properties editor of the default startup.blend all the way to
the bottom could trigger this. Calculating limits for area edge moving would use
screen bounds instead of entire window bounds (screen + global bars).

Added assert that should help debugging further issues like this.
2018-06-28 20:54:33 +02:00
Severin
ca8f787349 Fix T55298: Failing assert when splitting areas vertically
There are more related glitches for which I have fixes. Will test them some more
and push in a followup commit.
2018-06-28 19:51:39 +02:00
William Reynish
a71d53cb15 UI: move UV selection options to left
This is consistent with the 3D view.
2018-06-28 18:31:23 +02:00
dbbea2fc22 Fix: build error with msvc
introduced by rBd2757d149bf2d9ac604da6fb7f4742ee77e68d2d
2018-06-28 09:07:10 -06:00
aacd15e8a9 Overlay: Make overlay engine rebder on top of paint modes.
This puts the wireframe on top of the weight in weight paint mode,
sculpt mode ...

Wireframe should be colored differently if the object is in paint mode
but it's not there yet.
2018-06-28 16:12:24 +02:00
8caedc27d9 Correct mistake checking version 2018-06-28 16:01:18 +02:00
e65d7665f1 Removed most calls to modifier_deformVerts_DM_deprecated()
None of those calls actually passed a DerivedMesh.
2018-06-28 16:01:02 +02:00
ed7b8e847f Merge remote-tracking branch 'origin/blender2.8' into temp-eeveelightcache
# Conflicts:
#	source/blender/gpu/GPU_texture.h
#	source/blender/gpu/intern/gpu_texture.c
2018-06-28 15:54:48 +02:00
60e2e1058d Eevee: LightCache: Write LightCache to File
This patch does a few things for it to work.
- It port some eevee's struct to DNA for them to be saved in the file.
- Readback the result of the lightcache baking and store it in the scene
  struct.

For small scenes, it's okayish to keep the data around in memory but a
better approach would be to save it to disk.

A standard reflection probe is more than 6 MB of data.
Diffuse irradiance grids are relatively small compared to this.
2018-06-28 15:53:01 +02:00
Cédric Paille
aa6247a385 Alembic: speed up export of packed UV islands.
Differential Revision: https://developer.blender.org/D3510
2018-06-28 15:46:05 +02:00
d2757d149b Make stdout unbuffered
Unbuffered stdout makes stdout and stderr better synchronised, and helps
when stepping through code in a debugger (prints are immediately
visible). We don't output much to stdout anyway, so this isn't likely to
cause any performance issues.
2018-06-28 15:32:19 +02:00
747843516f Draw relationship lines for rigid body constraints 2018-06-28 15:32:19 +02:00
ce6cc756c3 GPUTexture: Refactor to have more flexibility.
New features:
- Get mipmap level size from a texture.
- Use explicit GPUDataFormat to specify how the input (or output) data
  is formated when uploading (or reading) texture data.
- Can upload different mipmap level after base level.
2018-06-28 15:31:02 +02:00
2b4c7600b7 Workbench: Anti-aliasing refactor
- TAA is also enabled for Forward rendering
- Uses less GPU memory (removed one history buffer)
- TAA is done after the color management
- consolidated the aa code between forward and deferred rendering
(workbench_effects_aa.c)
2018-06-28 14:39:15 +02:00
daa47e5e80 Workbench: Removed unused code in cavity shader 2018-06-28 14:39:15 +02:00
d2745986c8 Static Override: add support to override items (objects/sub-collections) in Collection IDs.
Was kind of a PITA to get working, but simple tests seem to pass well...
2018-06-28 14:28:31 +02:00
3c37354c97 Static Override: fix diffing logic for ietms ID pointers case.
I.e. we can now use REPLACE operation directly on items of an RNA
collection, when those items are ID pointers.

Again, mandatory to support new Collection's objects/children override.
2018-06-28 14:28:31 +02:00
e35d956860 Static Override: RNA apply code: pass extra 'item_ptr' to apply callbacks.
This is unused currently, but is mandatory for incomming support to
Collections objects and children items override support.
2018-06-28 14:28:31 +02:00
4626ca47b9 Prevented depsgraph errors when RigidBody Constraint is incomplete 2018-06-28 14:20:11 +02:00
7ad0e8300d Fixed AttributeError when there is no object selected 2018-06-28 14:20:11 +02:00
98a0bcd425 Prevent copying too much in the Rigid Body simulation
To prevent the pointcache from being copied-on-write too (and requiring
copying back), the cache is now shared between the original and
evaluated scenes. Reading from the cache is always allowed; running the
sim and writing to the cache is only allowed when the depsgraph is
active.

Some pointers have moved from RigidBodyWorld (RBO) to
RigidBodyWorldShared (RBOS). writefile.c copies some pointers back from
RBOS to RBO so that the file can still be opened on older Blenders
without crashing on a segfault.

The RigidBodyWorldShared struct is written to the blend file, because it
refers to the PointCache ID block.

The RigidObjectShared struct is runtime-only, and thus not saved to the
blend file.

An RNA getter-function is used to hide the new 'shared' pointer. As a
result the Python API hasn't changed.

Reviewed by: campbellbarton

Differential Revision: https://developer.blender.org/D3508
2018-06-28 14:20:11 +02:00
9b050b736b Fix assert to due missing GPU blend mode. 2018-06-28 13:46:30 +02:00
89e0d9848a UI: keep some operator text in headers.
Key shortcuts and explanation about how to use the tool should go to the
status bar, but other info can in the header so it's near where the user
is working. This distinction has not been made yet for all operators.
2018-06-28 13:04:28 +02:00
af9fcb6a33 Give RigidBodyWorld constraints collection a fake user
This prevents it from disappearing when the blend file is saved.
2018-06-28 12:31:44 +02:00
2928590431 Remove flatty_dark_blueberry (now default) 2018-06-28 12:28:49 +02:00
d2851b78f0 Manipulator: regression from removing keymaps
Keymaps were used to check which tool was active.
2018-06-28 12:26:33 +02:00
fddfc416ef RNA path: add way to get both valid ptr/prop pair, and final item ptr.
This will be much useful in some cases, at least in override area it is
needed (avoids searching again for the overriden item in a collection).
2018-06-28 11:58:15 +02:00
f827ab1d0c Correct bad merge 2018-06-28 11:29:35 +02:00
de30c47513 Merge branch 'master' into blender2.8 2018-06-28 11:10:09 +02:00
f22ef1706d Fix T55662: Crash on text autocomplete
Regression from undo system upgrade.
2018-06-28 11:09:09 +02:00
3f74a5c5fd Proper fix for RNA path evaluation of collection items.
Following RNA pointer way - only return evaluated item if asked for.
2018-06-28 11:06:31 +02:00
33306cabbe RNA_access: path parsing: fix broken code for collections.
When RNA path was for a collection item, we'd falsly get NULL final
property (and wrong final RNA pointer too).

Own stupid mistake in some previous commit, iirc.
2018-06-28 11:06:31 +02:00
0bf33a1e33 Cleanup: Nuke DM out of particle edit code.
Note that this commit also fixes serious memory leaks, temp Mesh
generated out of Main from the DM were never freed here!
2018-06-28 11:06:31 +02:00
d125e777b3 Cleanup: remove some DM from editor's Object vgroup code. 2018-06-28 11:06:31 +02:00
ed0ca7258e Cleanup: more DM include removal, use BAREMESH cddata mask in constraint code. 2018-06-28 11:06:31 +02:00
Dalai Felinto
c1aaa6b24b Fix material preview for EEVEE/Cycles
The preview files had all the other collections excluded from the view layer.
Although this fix the problem, it probably means we ignored some existing
2.8 files in recent changes. Which is likely fine anyways given that 2.8 is
experimental.
2018-06-28 11:05:14 +02:00
54beb7b433 Merge branch 'blender2.8' of git.blender.org:blender into blender2.8 2018-06-28 11:00:26 +02:00
f3065ed365 Merge branch 'master' into blender2.8 2018-06-28 10:50:04 +02:00
274bde23fb CMake: enable WITH_ASSERT_ABORT by default
Assert from BLI_assert by default in debug builds
(instead of just printing a warning).

Some developers ignored this, causing errors for others.
Better debug builds cause hard error so code isn't ignored.

Disabling is still useful when bisecting or testing outdated code.
2018-06-28 10:48:06 +02:00
d5a8c0c414 UI: use two dot ellipses
Use less space for sign used when we don't have enough.
2018-06-28 10:45:39 +02:00
071ec6b397 Workbench: Fix crash editing in texture modes without uv layer
When meshes has no uv layer, but has a texture assigned there was a uv
layer allocated which was corrupt. When no uv layer is available now
there won't be a vbo created. This might impact performance as the draw
cache does not cache this result.
2018-06-28 10:40:19 +02:00
f09480b212 Hair drawing: respect the amount of layers.
Current implementation works with at most of 3 layers, but was not
checked during hair drawing leading to reading from uninitialized
memory.

This commit limits it to the number of layers that is used during
compilation of blender.
2018-06-28 10:40:19 +02:00
3f2bde5a39 Workbench: Materials Texture hash
only hash the texture if it exists. Really minor improvement
2018-06-28 10:40:19 +02:00
b01392e9ac Tools: disable fallback drag action for transform
Based on animator feedback, accidentally not clicking on the manipulator
handle had unpredictable behavior.

This functionality will be moved into the manipulator and made optional
(add an invisible fallback manipulator).
2018-06-28 10:34:41 +02:00
20880d8744 Workbench: Fix Texture drawing
textures were not always drawn as the material did not always include
the image in the hash. Not sure if this will solve all cases, but it
definitely works better with this change.
2018-06-28 09:20:46 +02:00
53e191e0a5 Merge branch 'master' into blender2.8 2018-06-28 08:50:11 +02:00
8777b33699 Fix missing blend mode in recent OpenGL refactor 2018-06-28 08:49:30 +02:00
597122d72b Cleanup: use f-strings 2018-06-28 08:43:58 +02:00
d8d245917d Cleanup: pep8 2018-06-28 08:27:03 +02:00
a18a6a1441 gl cleanup: fix wrong cast in bf_editor_transform 2018-06-27 22:47:25 -06:00
8e02106d0d GLRefactor: partially remove gl calls from source/blender/editors.
This translates the gl calls to the new GPU_ wrappers from D3501.

Given it's tedious and repetitive work, this patch does as much as it can with search + replace, the remainder of the gl calls will need to be manually dealt with on a case by case basis.

This fixes 13 of the 28 failing editors when building without opengl.

For the list of substitutions see D3502

Reviewers: brecht

Differential Revision: https://developer.blender.org/D3502
2018-06-27 19:07:23 -06:00
William Reynish
fe258fd445 UI: Center ID Blocks in Dopesheet Editor
Also move use_multi_word_filter to the View menu instead of next to every
search field, as it can be very slow in big scenes.
2018-06-28 00:49:17 +02:00
William Reynish
7a8c49ef91 UI: Center ID Blocks in Clip Editor
See T55635
2018-06-28 00:33:52 +02:00
William Reynish
ed8fca8782 UI: Center ID Blocks in Image Editor
See T55635
2018-06-28 00:33:10 +02:00
William Reynish
9f4b7bed29 UI: Center ID Blocks in Video Sequencer
Also remove Use Preview Range and Lock Frame buttons from the header
they belong to the Timeline editor now.

See T55635
2018-06-28 00:32:05 +02:00
William Reynish
3e1b755ead UI: Center ID Blocks in Node Editor
See T55635
2018-06-28 00:30:47 +02:00
William Reynish
252d1d8e22 UI: Center ID Blocks in Text Editor
See T55635
2018-06-28 00:29:04 +02:00
a009f2659f UI: keep statusbar keymap icons in same position, if there is enough space. 2018-06-28 00:13:58 +02:00
8b2297847f Merge branch 'master' into blender2.8 2018-06-28 00:13:52 +02:00
9536f67e7e Fix Cycles tests build on macOS. 2018-06-28 00:11:01 +02:00
35bfc8c748 Merge branch 'master' into blender2.8 2018-06-27 23:01:19 +02:00
b633d760a2 Cleanup: style 2018-06-27 22:32:52 +02:00
31f0c9182e Cleanup: style 2018-06-27 22:29:59 +02:00
William Reynish
609805eed3 UI: shorten labels to avoid clipping 2018-06-27 22:12:50 +02:00
cf7ff47e3e Remove empty gradient definitions in new theme
MSVC doesn't support
2018-06-27 22:12:50 +02:00
31137f772b Remove empty gradient definitions in new theme
MSVC doesn't support
2018-06-27 20:21:23 +02:00
d3b814e9ec UI: tweak status bar layout to make it less jumpy.
Keymap on the left, messages and jobs in the middle, stats on the right.
2018-06-27 19:48:54 +02:00
0e304ca8f5 UI: some renaming for more clear/consistent cursor keymaps in status bar.
There's much more work to be done here, this is just fixing some obvious ones.
2018-06-27 19:04:04 +02:00
f55f2db6bd Fix T55644: Multires ignores render subdivision when simplified
We did not tell proper render/viewport context to subsurf derived mesh
created for multires.
2018-06-27 16:35:06 +02:00
08b105654d Depsgraph: Move time dependency to animation of action
This way we guarantee that animation component on the datablock will
totally wait for action to be fully evaluated before attempting to
evaluate f-curves.

Fixes T55642: Inconsistent result on animated DoF file
2018-06-27 16:35:06 +02:00
3766b93853 Depsgraph: Add missing relation to pose init
Pose init initializes inversed object matrix, which means it does
need to have proper object transform.
2018-06-27 16:35:06 +02:00
05bcb2d5f5 Depsgraph: Fix missing relation from action to animation when it's shared 2018-06-27 16:35:06 +02:00
c3594f6469 UI: remove layout choosing menu from new window operator.
The handling of multiple window layouts within a workspace is intended to
be automatic now, this was a leftover from an earlier design.
2018-06-27 16:08:52 +02:00
fad585d6f4 UI: user fewer icons in File and Render menus.
Having an icon for nearly every menu entry can make it harder to scan.
2018-06-27 16:08:52 +02:00
eda770f884 Theme: set default theme 'Flatty Dark Blueberry'
The theme is now stored in generated C code,
which can be extracted from existing user preferences.

This theme can then be used for version patching themes
instead of duplicating values

Note that theme versioning has been removed,
since minor changes from now on won't apply well on top of 2.7x theme.

Theme colors from interface_widgets.c have been removed too.
2018-06-27 16:03:43 +02:00
66298a99e3 Theme: add 2.7x theme
Prepare for new default
2018-06-27 15:32:34 +02:00
3df82335dd Theme: Tweaks to console/text in Flatty Dark Blueberry 2018-06-27 15:04:37 +02:00
310796214f Workbench: Use different samples in AO per TAA iteration
Per iteration a different AO samples are used, so the final result is
less distorted. Will improve the quality of the image a lot when the
cavity option is turned on.
2018-06-27 14:36:01 +02:00
William Reynish
d48600fddc UI: Single-column layout for Lamp panel 2018-06-27 14:23:17 +02:00
20b8e1d8f1 Workbench: Added a quality slider for the viewport
Currently only attached to the Anti Aliasing of the solid mode of the
viewport. But eventually we could add other options here. Quality
setting can be found in the System tab of the userpref.

The slider goes from No Antialiasing (0.0 - 0.1) to FXAA (0.1 - 0.25) to
TAA8 (0.25 - 0.6) to TAA16 (0.6 - 0.8) to TAA32 (0.8 - 1.0)
2018-06-27 12:59:01 +02:00
cf2dcd57c0 Theme: Further polishing and unifying on Flatty Dark Blueberry
With feedback from @campbellbarton for better contrast in edit mode.
2018-06-27 12:20:25 +02:00
Dalai Felinto
a5ba97e58c mesh_navmesh.c removal
This was added back by mistake in a wrong merge
f1bc899146.
2018-06-27 11:40:30 +02:00
65128cde51 Cleanup: remove BKE's modifiers_bmesh.c, other DM removal/cleanup in BMesh code. 2018-06-27 10:59:52 +02:00
e878f1d00d Cleanup: nuke DM out of constraint code. 2018-06-27 10:37:57 +02:00
9c7a561883 Cleanup: remove some more DM usages... 2018-06-27 10:37:57 +02:00
c3544df207 CMake: fix linking blendont 2018-06-27 08:49:45 +02:00
6f2c9ea3e1 bf_gpu: Add GPU_state module.
This has wrappers for the most common gl* functions in the codebase, and is in preparation for D3502

Reviewers: brecht, fclem

Differential Revision: https://developer.blender.org/D3501
2018-06-26 15:17:31 -06:00
a61480c271 Merge branch 'master' into blender2.8 2018-06-26 22:56:39 +02:00
532c8ac583 Cleanup: pep8 function indentation 2018-06-26 19:58:56 +02:00
a3cd57ea8c Fix scrollbar operator showing in status bar cursor keymap. 2018-06-26 19:49:25 +02:00
e0b28306df Fix status bar wrong cursor keymap using wrong region in some cases. 2018-06-26 19:48:24 +02:00
df02675e21 UI: move modal operator text from headers to status bar.
Python API is context.workspace.status_text_set()
2018-06-26 19:45:55 +02:00
ecb56eac57 UI: Add/Update bad tooltips
Part of T51061
2018-06-26 12:29:11 -04:00
c817a89e73 Workbench: Wrong ENUM value for SINGLE color
Had to be "SINGLE", but was "SOLID" resulting in not showing the single
color option in the shader popover
2018-06-26 18:19:53 +02:00
6b0670951f Workbench: TAA quick fix for AMD cards
Seems to be that mix(a, b, 1.0) will not give you b. on nvidia this is
not a problem as a was initialized with 0.0, but on AMD it can be any
floating point number, resulting that mix(inf, b, 1.0) was still more to
inf than to b.
2018-06-26 18:14:19 +02:00
b4c01aca30 Merge branch 'master' into blender2.8 2018-06-26 17:42:33 +02:00
d5a42bce38 RigidBody: use runtime.mesh_orig instead of DEG_get_original_object 2018-06-26 17:39:17 +02:00
599e979d90 Fix bug in DNA_struct_elem_find when checking the first field
find_elem(olddata=NULL) doesn't work reliably for existence checks; it will
return NULL both when the field is found at offset 0 and when it is not
found at all.
2018-06-26 17:35:21 +02:00
0954085e1e Fix missing object/collection hiding icons on undo. 2018-06-26 17:17:05 +02:00
e69e62a90a UI: decrease status bar height. 2018-06-26 17:15:43 +02:00
cf8a059769 Workbench: Tempural Anti Aliasing
- FXAA is now also done in the workbench_forward engine.
- User can enable TAA8 in the userpref by setting their max
viewport AA to TAA8. FXAA will still be used when navigating
2018-06-26 16:35:47 +02:00
a1549065f2 Eevee: LightCache: Fix crash when baking with render result window open 2018-06-26 12:37:34 +02:00
0de33fb883 Eevee: LightCache: Make render work with no lightcache
This will only show the same thing as the viewport. It will not compute the
actual cache on the fly.
2018-06-26 12:36:54 +02:00
6364780b63 Merge remote-tracking branch 'origin/blender2.8' into temp-eeveelightcache 2018-06-26 11:43:14 +02:00
Stefan Werner
73eb1bfd55 Revert "Turned off clang warnings in third party includes."
This reverts commit d53093953f.
2018-06-26 10:26:56 +02:00
93aca278d2 Merge remote-tracking branch 'origin/blender2.8' into temp-eeveelightcache
# Conflicts:
#	source/blender/draw/engines/eevee/eevee_render.c
2018-06-25 18:32:30 +02:00
c5e7dff566 DRW: Codestyle: Add alias for accessing particular matrix in DRWMatrixState 2018-06-25 18:31:31 +02:00
922ebe960c Eevee: LightCache: Add back visibility group. 2018-06-25 18:16:36 +02:00
7f3ea60aa7 Eevee: Add back planar reflection. 2018-06-25 17:41:47 +02:00
7213006cef Fix warning 2018-06-25 17:39:09 +02:00
12d98d8a48 DRW: Change gl_context_mutex type to TicketMutex
This ensure the viewport is not locked indefinitely when rendering or
baking.
2018-06-25 11:17:15 +02:00
7ea7eae41f Eevee: Lookdev: Use own lightcache
This makes possible to have different lookdev settings per viewport without
rendering the environment constantly.
2018-06-25 00:15:30 +02:00
b28b6c62ed Merge remote-tracking branch 'origin/blender2.8' into temp-eeveelightcache 2018-06-24 21:59:11 +02:00
a498ffd4f6 Eevee: LightCache: Fix a warning, a mistake and two oversight 2018-06-24 21:40:50 +02:00
76f49c7a7b Eevee: LightCache: Fix fbos created in wrong context. 2018-06-24 17:54:53 +02:00
e50aa8dc9d Eevee: Fix wrong function order 2018-06-24 17:53:57 +02:00
077dba6ac2 Merge remote-tracking branch 'origin/blender2.8' into temp-eeveelightcache 2018-06-24 15:03:50 +02:00
025b260144 Merge remote-tracking branch 'origin/blender2.8' into temp-eeveelightcache 2018-06-23 21:12:45 +02:00
d73bdecea4 Merge remote-tracking branch 'origin/blender2.8' into temp-eeveelightcache
# Conflicts:
#	source/blender/blenloader/intern/versioning_280.c
2018-06-22 20:20:38 +02:00
c8859d8f66 Eevee: LightCache: Add UI to control visibility of the lighcache data
For the moment we use a per scene setting for that. We could move it to be
per viewport (as an overlay).
2018-06-22 20:19:48 +02:00
77fd1a6a4b Merge remote-tracking branch 'origin/blender2.8' into temp-eeveelightcache
# Conflicts:
#	source/blender/gpu/intern/gpu_texture.c
2018-06-22 17:41:15 +02:00
506f5654fe Eevee: LightCache: Fix sample selection algorithm 2018-06-22 17:39:50 +02:00
d8a7fd1006 DRW: Modify the engines code to work with latest changes 2018-06-22 17:22:22 +02:00
e05b7c1616 DRW: Refactor ObjectEngineData into DrawData
This is because we will use it to store the update flags from the depsgraph.

Use a similar system as AnimationData where the struct is inserted at a
fixed position after the ID struct.
2018-06-22 17:21:39 +02:00
e8d4930c4d Eevee: LightCache: Add fallback cache for world if no scene cache found 2018-06-22 14:00:08 +02:00
02e2428fda DRW: Add option to bypass deferred shader compilation 2018-06-22 13:57:30 +02:00
56fd8978a5 Object Mode: Remove cubemap lightprobes outline
This is because the display code now differs and the outline does not match.
This commit make them uselectable by their display shape (the sphere).

I will revisit this latter.
2018-06-21 18:47:51 +02:00
90fdb427af Eevee: LightProbes: Change/optimize the cubemap probe display 2018-06-21 18:45:47 +02:00
1cbb195f8d Object Mode: Make the LightProbe Grid samples outlines as dots
This is because this display will not always match the position of the baked
samples. Making it as dots also makes it less flickery.
2018-06-21 17:54:28 +02:00
29a834e530 Eevee: LightProbes: Add back and optimize the irradiance sample display 2018-06-21 17:51:37 +02:00
5d280a2397 Eevee: LightCache: Add back progressive rendering. 2018-06-21 16:00:21 +02:00
ce6418fc16 GPUTexture: Add GPU_texture_read
This is to get the texture content from the GPU memory.
2018-06-20 18:31:46 +02:00
873acfb124 Eevee: LightCache: Finish basic cache support.
Still missing: Multi bounce support.
2018-06-20 15:30:58 +02:00
007d3074fa Eevee: Move cache creation to main thread
This fix freeing hazard and use after free.
2018-06-20 11:59:41 +02:00
84c0446150 Merge remote-tracking branch 'origin/blender2.8' into temp-eeveelightcache 2018-06-20 11:23:17 +02:00
fbeae8ab13 Merge remote-tracking branch 'origin/blender2.8' into temp-eeveelightcache 2018-06-19 18:12:56 +02:00
43efefdbba Eevee: LightCache: Add progress bar and cancelation. 2018-06-19 18:12:36 +02:00
8713dd1621 Eevee: LightCache: More work... 2018-06-19 16:35:07 +02:00
38eb004977 Merge remote-tracking branch 'origin/blender2.8' into temp-eeveelightcache 2018-06-19 11:43:27 +02:00
de0c3f563d Eevee: LightCache: Add back world baking support. 2018-06-18 19:22:13 +02:00
51a4af4eb5 GPUTexture: Add GPU_texture_layers
It's actually used to get the depth size of the texture.
This is because GPU_texture_depth is already taken.

We need to clean up this API at some point.
2018-06-18 19:21:29 +02:00
a0f5f3116a Merge remote-tracking branch 'origin/blender2.8' into temp-eeveelightcache
# Conflicts:
#	source/blender/blenloader/intern/readblenentry.c
2018-06-18 11:20:59 +02:00
f00a590fd4 Merge remote-tracking branch 'origin/blender2.8' into temp-eeveelightcache 2018-06-15 18:02:51 +02:00
d3c645f72d Eevee: Move LightCache from ViewLayer to Scene
Also integrate it into the undo system and the depsgraph.

Green light means no cache, red means a baked light cache is used.
2018-06-15 18:02:17 +02:00
ccea4d13b3 DRW: Fix typos leading to locks and crashes. 2018-06-15 17:58:29 +02:00
99e236e4d2 Merge remote-tracking branch 'origin/blender2.8' into temp-eeveelightcache 2018-06-15 12:38:25 +02:00
ffa5468bd9 GPUTexture: Fix missing "\n" in printfs. 2018-06-14 19:11:13 +02:00
8c18f79bd3 Eevee: Remove old lightprobe implementation & start fresh. 2018-06-14 18:54:51 +02:00
44e1c5d817 Merge remote-tracking branch 'origin/blender2.8' into temp-eeveelightcache 2018-06-14 11:30:27 +02:00
60ff71cc40 Eevee: Lightcache: Add own gl context to the baking job
This is to follow the recent changes in how we handle gl context in
threads.
2018-06-13 14:19:04 +02:00
71c2768dcf Merge remote-tracking branch 'origin/blender2.8' into temp-eeveelightcache 2018-06-11 19:09:36 +02:00
312b12d172 Merge remote-tracking branch 'origin/blender2.8' into temp-eeveelightcache 2018-06-11 18:11:38 +02:00
49b0ac57c1 Eevee: Light Cache: Create Probe data and share the lightcache.
The lightcache is now can shared between viewlayers. We need this to share
the lighting data with the original viewlayer with the baking layer.

The cache is still not working.
2018-06-01 14:16:16 +02:00
d380267b61 Eevee: Light Cache: Add Operator and base implementation.
Does nothing at the moment. Just create a job and search all probes in a
view layer.

Only works if copy on write is enabled.
2018-06-01 14:16:16 +02:00
1596 changed files with 34804 additions and 19680 deletions

View File

@@ -439,7 +439,7 @@ mark_as_advanced(WITH_MEM_VALGRIND)
option(WITH_CXX_GUARDEDALLOC "Enable GuardedAlloc for C++ memory allocation tracking (only enable for development)" OFF)
mark_as_advanced(WITH_CXX_GUARDEDALLOC)
option(WITH_ASSERT_ABORT "Call abort() when raising an assertion through BLI_assert()" OFF)
option(WITH_ASSERT_ABORT "Call abort() when raising an assertion through BLI_assert()" ON)
mark_as_advanced(WITH_ASSERT_ABORT)
option(WITH_BOOST "Enable features depending on boost" ON)

View File

@@ -58,4 +58,3 @@ if(MSVC)
DEPENDEES mkdir update patch download configure build install
)
endif()

View File

@@ -216,4 +216,3 @@ if(NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw32/bin/i686-w64-mingw32-ranlib.exe")
COMMAND ${CMAKE_COMMAND} -E copy "${DOWNLOAD_DIR}/mingw/mingw32/bin/ranlib.exe" "${DOWNLOAD_DIR}/mingw/mingw32/bin/i686-w64-mingw32-ranlib.exe"
)
endif()

View File

@@ -216,4 +216,3 @@ if(NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw64/bin/x86_64-w64-mingw32-ranlib.exe")
COMMAND ${CMAKE_COMMAND} -E copy "${DOWNLOAD_DIR}/mingw/mingw64/bin/ranlib.exe" "${DOWNLOAD_DIR}/mingw/mingw64/bin/x86_64-w64-mingw32-ranlib.exe"
)
endif()

View File

@@ -37,4 +37,3 @@ endif()
if(MSVC)
set_target_properties(external_zlib_mingw PROPERTIES FOLDER Mingw)
endif()

View File

@@ -79,4 +79,3 @@ macro( select_library_configurations basename )
${basename}_LIBRARY_DEBUG
)
endmacro( select_library_configurations )

View File

@@ -93,4 +93,3 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(LLVM DEFAULT_MSG
MARK_AS_ADVANCED(
LLVM_LIBRARY
)

View File

@@ -674,7 +674,9 @@ function(SETUP_BLENDER_SORTED_LIBS)
extern_openjpeg
ge_videotex
bf_dna
bf_blenfont
bf_gpu # duplicate for blenfont
bf_blentranslation
bf_intern_audaspace
audaspace

View File

@@ -7,7 +7,7 @@
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
@@ -22,21 +22,21 @@
#
# Name:
# dna.py
#
#
# Description:
# Creates a browsable DNA output to HTML.
#
#
# Author:
# Jeroen Bakker
#
#
# Version:
# v0.1 (12-05-2009) - migration of original source code to python.
# Added code to support blender 2.5 branch
# v0.2 (25-05-2009) - integrated with BlendFileReader.py
#
#
# Input:
# blender build executable
#
#
# Output:
# dna.html
# dna.css (will only be created when not existing)
@@ -76,12 +76,12 @@ class DNACatalogHTML:
DNACatalog is a catalog of all information in the DNA1 file-block
'''
def __init__(self, catalog, bpy_module = None):
def __init__(self, catalog, bpy_module=None):
self.Catalog = catalog
self.bpy = bpy_module
def WriteToHTML(self, handle):
dna_html_template = """
<!DOCTYPE html PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd>
<html>
@@ -105,10 +105,10 @@ class DNACatalogHTML:
${structs_content}
</body>
</html>"""
header = self.Catalog.Header
bpy = self.bpy
# ${version} and ${revision}
if bpy:
version = '.'.join(map(str, bpy.app.version))
@@ -116,7 +116,7 @@ class DNACatalogHTML:
else:
version = str(header.Version)
revision = 'Unknown'
# ${bitness}
if header.PointerSize == 8:
bitness = '64 bit'
@@ -125,10 +125,10 @@ class DNACatalogHTML:
# ${endianness}
if header.LittleEndianness:
endianess= 'Little endianness'
endianess = 'Little endianness'
else:
endianess= 'Big endianness'
endianess = 'Big endianness'
# ${structs_list}
log.debug("Creating structs index")
structs_list = ''
@@ -136,7 +136,7 @@ class DNACatalogHTML:
structureIndex = 0
for structure in self.Catalog.Structs:
structs_list += list_item.format(structureIndex, structure.Type.Name)
structureIndex+=1
structureIndex += 1
# ${structs_content}
log.debug("Creating structs content")
@@ -144,20 +144,20 @@ class DNACatalogHTML:
for structure in self.Catalog.Structs:
log.debug(structure.Type.Name)
structs_content += self.Structure(structure)
d = dict(
version = version,
revision = revision,
bitness = bitness,
endianness = endianess,
structs_list = structs_list,
structs_content = structs_content
version=version,
revision=revision,
bitness=bitness,
endianness=endianess,
structs_list=structs_list,
structs_content=structs_content
)
dna_html = Template(dna_html_template).substitute(d)
dna_html = self.format(dna_html)
handle.write(dna_html)
def Structure(self, structure):
struct_table_template = """
<table><a name="${struct_name}"></a>
@@ -178,23 +178,23 @@ class DNACatalogHTML:
</table>
<label>Total size: ${size} bytes</label><br/>
<label>(<a href="#top">top</a>)</label><br/>"""
d = dict(
struct_name = structure.Type.Name,
fields = self.StructureFields(structure, None, 0),
size = str(structure.Type.Size)
struct_name=structure.Type.Name,
fields=self.StructureFields(structure, None, 0),
size=str(structure.Type.Size)
)
struct_table = Template(struct_table_template).substitute(d)
return struct_table
def StructureFields(self, structure, parentReference, offset):
fields = ''
for field in structure.Fields:
fields += self.StructureField(field, structure, parentReference, offset)
offset += field.Size(self.Catalog.Header)
return fields
def StructureField(self, field, structure, parentReference, offset):
structure_field_template = """
<tr>
@@ -205,7 +205,7 @@ class DNACatalogHTML:
<td>${offset}</td>
<td>${size}</td>
</tr>"""
if field.Type.Structure is None or field.Name.IsPointer():
# ${reference}
@@ -216,37 +216,37 @@ class DNACatalogHTML:
struct = '<a href="#{0}">{0}</a>'.format(structure.Type.Name)
else:
struct = structure.Type.Name
# ${type}
type = field.Type.Name
# ${name}
name = field.Name.Name
# ${offset}
# offset already set
# ${size}
size = field.Size(self.Catalog.Header)
d = dict(
reference = reference,
struct = struct,
type = type,
name = name,
offset = offset,
size = size
reference=reference,
struct=struct,
type=type,
name=name,
offset=offset,
size=size
)
structure_field = Template(structure_field_template).substitute(d)
elif field.Type.Structure is not None:
reference = field.Name.AsReference(parentReference)
structure_field = self.StructureFields(field.Type.Structure, reference, offset)
structure_field = self.StructureFields(field.Type.Structure, reference, offset)
return structure_field
def indent(self, input, dent, startswith = ''):
def indent(self, input, dent, startswith=''):
output = ''
if dent < 0:
for line in input.split('\n'):
@@ -257,19 +257,19 @@ class DNACatalogHTML:
output += line.lstrip() + '\n' # remove indentation completely
elif dent > 0:
for line in input.split('\n'):
output += ' '* dent + line + '\n'
output += ' ' * dent + line + '\n'
return output
def format(self, input):
diff = {
'\n<!DOCTYPE':'<!DOCTYPE',
'\n</ul>' :'</ul>',
'<a name' :'\n<a name',
'<tr>\n' :'<tr>',
'<tr>' :' <tr>',
'</th>\n' :'</th>',
'</td>\n' :'</td>',
'<tbody>\n' :'<tbody>'
'\n<!DOCTYPE': '<!DOCTYPE',
'\n</ul>': '</ul>',
'<a name': '\n<a name',
'<tr>\n': '<tr>',
'<tr>': ' <tr>',
'</th>\n': '</th>',
'</td>\n': '</td>',
'<tbody>\n': '<tbody>'
}
output = self.indent(input, 0)
for key, value in diff.items():
@@ -283,17 +283,17 @@ class DNACatalogHTML:
'''
css = """
@CHARSET "ISO-8859-1";
body {
font-family: verdana;
font-size: small;
}
div.title {
font-size: large;
text-align: center;
}
h1 {
page-break-before: always;
}
@@ -304,7 +304,7 @@ class DNACatalogHTML:
margin-right: 3%;
padding-left: 40px;
}
h1:hover{
background-color: #EBEBEB;
}
@@ -312,7 +312,7 @@ class DNACatalogHTML:
h3 {
padding-left: 40px;
}
table {
border-width: 1px;
border-style: solid;
@@ -321,21 +321,21 @@ class DNACatalogHTML:
width: 94%;
margin: 20px 3% 10px;
}
caption {
margin-bottom: 5px;
}
th {
background-color: #000000;
color:#ffffff;
padding-left:5px;
padding-right:5px;
}
tr {
}
td {
border-width: 1px;
border-style: solid;
@@ -343,12 +343,12 @@ class DNACatalogHTML:
padding-left:5px;
padding-right:5px;
}
label {
float:right;
margin-right: 3%;
}
ul.multicolumn {
list-style:none;
float:left;
@@ -361,18 +361,18 @@ class DNACatalogHTML:
width:200px;
margin-right:0px;
}
a {
color:#a000a0;
text-decoration:none;
}
a:hover {
color:#a000a0;
text-decoration:underline;
}
"""
css = self.indent(css, 0)
handle.write(css)
@@ -389,13 +389,13 @@ def usage():
print("\tdefault: % blender2.5 --background -noaudio --python BlendFileDnaExporter_25.py")
print("\twith options: % blender2.5 --background -noaudio --python BlendFileDnaExporter_25.py -- --dna-keep-blend --dna-debug\n")
######################################################
# Main
######################################################
def main():
import os, os.path
try:
@@ -408,37 +408,37 @@ def main():
else:
filename = 'dna'
dir = os.path.dirname(__file__)
Path_Blend = os.path.join(dir, filename + '.blend') # temporary blend file
Path_HTML = os.path.join(dir, filename + '.html') # output html file
Path_CSS = os.path.join(dir, 'dna.css') # output css file
Path_Blend = os.path.join(dir, filename + '.blend') # temporary blend file
Path_HTML = os.path.join(dir, filename + '.html') # output html file
Path_CSS = os.path.join(dir, 'dna.css') # output css file
# create a blend file for dna parsing
if not os.path.exists(Path_Blend):
log.info("1: write temp blend file with SDNA info")
log.info(" saving to: " + Path_Blend)
try:
bpy.ops.wm.save_as_mainfile(filepath = Path_Blend, copy = True, compress = False)
bpy.ops.wm.save_as_mainfile(filepath=Path_Blend, copy=True, compress=False)
except:
log.error("Filename {0} does not exist and can't be created... quitting".format(Path_Blend))
return
else:
log.info("1: found blend file with SDNA info")
log.info(" " + Path_Blend)
# read blend header from blend file
log.info("2: read file:")
if not dir in sys.path:
sys.path.append(dir)
import BlendFileReader
handle = BlendFileReader.openBlendFile(Path_Blend)
blendfile = BlendFileReader.BlendFile(handle)
catalog = DNACatalogHTML(blendfile.Catalog, bpy)
# close temp file
handle.close()
# deleting or not?
if '--dna-keep-blend' in sys.argv:
# keep the blend, useful for studying hexdumps
@@ -449,7 +449,7 @@ def main():
log.info("5: close and delete temp blend:")
log.info(" {0}".format(Path_Blend))
os.remove(Path_Blend)
# export dna to xhtml
log.info("6: export sdna to xhtml file: %r" % Path_HTML)
handleHTML = open(Path_HTML, "w")
@@ -466,12 +466,12 @@ def main():
if not bpy.app.background:
log.info("7: quit blender")
bpy.ops.wm.exit_blender()
except ImportError:
log.warning(" skipping, not running in Blender")
usage()
sys.exit(2)
if __name__ == '__main__':
main()

View File

@@ -7,7 +7,7 @@
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
@@ -34,6 +34,7 @@ log = logging.getLogger("BlendFileReader")
# module global routines
######################################################
def ReadString(handle, length):
'''
ReadString reads a String of given length or a zero terminating String
@@ -45,7 +46,7 @@ def ReadString(handle, length):
# length == 0 means we want a zero terminating string
result = ""
s = ReadString(handle, 1)
while s!="\0":
while s != "\0":
result += s
s = ReadString(handle, 1)
return result
@@ -57,7 +58,7 @@ def Read(type, handle, fileheader):
'''
def unpacked_bytes(type_char, size):
return struct.unpack(fileheader.StructPre + type_char, handle.read(size))[0]
if type == 'ushort':
return unpacked_bytes("H", 2) # unsigned short
elif type == 'short':
@@ -94,10 +95,10 @@ def openBlendFile(filename):
log.debug("decompressing started")
fs = gzip.open(filename, "rb")
handle = tempfile.TemporaryFile()
data = fs.read(1024*1024)
while data:
handle.write(data)
data = fs.read(1024*1024)
data = fs.read(1024 * 1024)
while data:
handle.write(data)
data = fs.read(1024 * 1024)
log.debug("decompressing finished")
fs.close()
log.debug("resetting decompressed file")
@@ -112,7 +113,7 @@ def Align(handle):
offset = handle.tell()
trim = offset % 4
if trim != 0:
handle.seek(4-trim, os.SEEK_CUR)
handle.seek(4 - trim, os.SEEK_CUR)
######################################################
@@ -121,14 +122,14 @@ def Align(handle):
class BlendFile:
'''
Reads a blendfile and store the header, all the fileblocks, and catalogue
Reads a blendfile and store the header, all the fileblocks, and catalogue
structs foound in the DNA fileblock
- BlendFile.Header (BlendFileHeader instance)
- BlendFile.Blocks (list of BlendFileBlock instances)
- BlendFile.Catalog (DNACatalog instance)
'''
def __init__(self, handle):
log.debug("initializing reading blend-file")
self.Header = BlendFileHeader(handle)
@@ -141,13 +142,13 @@ class BlendFile:
found_dna_block = True
else:
fileblock.Header.skip(handle)
self.Blocks.append(fileblock)
fileblock = BlendFileBlock(handle, self)
# appending last fileblock, "ENDB"
self.Blocks.append(fileblock)
# seems unused?
"""
def FindBlendFileBlocksWithCode(self, code):
@@ -164,27 +165,27 @@ class BlendFileHeader:
BlendFileHeader allocates the first 12 bytes of a blend file.
It contains information about the hardware architecture.
Header example: BLENDER_v254
BlendFileHeader.Magic (str)
BlendFileHeader.PointerSize (int)
BlendFileHeader.LittleEndianness (bool)
BlendFileHeader.StructPre (str) see http://docs.python.org/py3k/library/struct.html#byte-order-size-and-alignment
BlendFileHeader.Version (int)
'''
def __init__(self, handle):
log.debug("reading blend-file-header")
self.Magic = ReadString(handle, 7)
log.debug(self.Magic)
pointersize = ReadString(handle, 1)
log.debug(pointersize)
if pointersize == "-":
self.PointerSize = 8
if pointersize == "_":
self.PointerSize = 4
endianness = ReadString(handle, 1)
log.debug(endianness)
if endianness == "v":
@@ -193,11 +194,11 @@ class BlendFileHeader:
if endianness == "V":
self.LittleEndianness = False
self.StructPre = ">"
version = ReadString(handle, 3)
log.debug(version)
self.Version = int(version)
log.debug("{0} {1} {2} {3}".format(self.Magic, self.PointerSize, self.LittleEndianness, version))
@@ -206,11 +207,11 @@ class BlendFileBlock:
BlendFileBlock.File (BlendFile)
BlendFileBlock.Header (FileBlockHeader)
'''
def __init__(self, handle, blendfile):
self.File = blendfile
self.Header = FileBlockHeader(handle, blendfile.Header)
def Get(self, handle, path):
log.debug("find dna structure")
dnaIndex = self.Header.SDNAIndex
@@ -232,7 +233,7 @@ class FileBlockHeader:
Count (int)
FileOffset (= file pointer of datablock)
'''
def __init__(self, handle, fileheader):
self.Code = ReadString(handle, 4).strip()
if self.Code != "ENDB":
@@ -257,28 +258,28 @@ class FileBlockHeader:
class DNACatalog:
'''
DNACatalog is a catalog of all information in the DNA1 file-block
Header = None
Names = None
Types = None
Structs = None
'''
def __init__(self, fileheader, handle):
log.debug("building DNA catalog")
self.Names=[]
self.Types=[]
self.Structs=[]
self.Names = []
self.Types = []
self.Structs = []
self.Header = fileheader
SDNA = ReadString(handle, 4)
# names
NAME = ReadString(handle, 4)
numberOfNames = Read('uint', handle, fileheader)
log.debug("building #{0} names".format(numberOfNames))
for i in range(numberOfNames):
name = ReadString(handle,0)
name = ReadString(handle, 0)
self.Names.append(DNAName(name))
Align(handle)
@@ -287,7 +288,7 @@ class DNACatalog:
numberOfTypes = Read('uint', handle, fileheader)
log.debug("building #{0} types".format(numberOfTypes))
for i in range(numberOfTypes):
type = ReadString(handle,0)
type = ReadString(handle, 0)
self.Types.append(DNAType(type))
Align(handle)
@@ -321,24 +322,24 @@ class DNACatalog:
class DNAName:
'''
DNAName is a C-type name stored in the DNA.
Name = str
'''
def __init__(self, name):
self.Name = name
def AsReference(self, parent):
if parent is None:
result = ""
else:
result = parent+"."
result = parent + "."
result = result + self.ShortName()
return result
def ShortName(self):
result = self.Name;
result = self.Name
result = result.replace("*", "")
result = result.replace("(", "")
result = result.replace(")", "")
@@ -346,12 +347,12 @@ class DNAName:
if Index != -1:
result = result[0:Index]
return result
def IsPointer(self):
return self.Name.find("*")>-1
return self.Name.find("*") > -1
def IsMethodPointer(self):
return self.Name.find("(*")>-1
return self.Name.find("(*") > -1
def ArraySize(self):
result = 1
@@ -360,10 +361,10 @@ class DNAName:
while Index != -1:
Index2 = Temp.find("]")
result*=int(Temp[Index+1:Index2])
Temp = Temp[Index2+1:]
result *= int(Temp[Index + 1:Index2])
Temp = Temp[Index2 + 1:]
Index = Temp.find("[")
return result
@@ -375,46 +376,46 @@ class DNAType:
Size = int
Structure = DNAStructure
'''
def __init__(self, aName):
self.Name = aName
self.Structure=None
self.Structure = None
class DNAStructure:
'''
DNAType is a C-type structure stored in the DNA
Type = DNAType
Fields = [DNAField]
'''
def __init__(self, aType):
self.Type = aType
self.Type.Structure = self
self.Fields=[]
self.Fields = []
def GetField(self, header, handle, path):
splitted = path.partition(".")
name = splitted[0]
rest = splitted[2]
offset = 0;
offset = 0
for field in self.Fields:
if field.Name.ShortName() == name:
log.debug("found "+name+"@"+str(offset))
log.debug("found " + name + "@" + str(offset))
handle.seek(offset, os.SEEK_CUR)
return field.DecodeField(header, handle, rest)
else:
offset += field.Size(header)
log.debug("error did not find "+path)
log.debug("error did not find " + path)
return None
class DNAField:
'''
DNAField is a coupled DNAType and DNAName.
Type = DNAType
Name = DNAName
'''
@@ -422,25 +423,24 @@ class DNAField:
def __init__(self, aType, aName):
self.Type = aType
self.Name = aName
def Size(self, header):
if self.Name.IsPointer() or self.Name.IsMethodPointer():
return header.PointerSize*self.Name.ArraySize()
return header.PointerSize * self.Name.ArraySize()
else:
return self.Type.Size*self.Name.ArraySize()
return self.Type.Size * self.Name.ArraySize()
def DecodeField(self, header, handle, path):
if path == "":
if self.Name.IsPointer():
return Read('pointer', handle, header)
if self.Type.Name=="int":
if self.Type.Name == "int":
return Read('int', handle, header)
if self.Type.Name=="short":
if self.Type.Name == "short":
return Read('short', handle, header)
if self.Type.Name=="float":
if self.Type.Name == "float":
return Read('float', handle, header)
if self.Type.Name=="char":
if self.Type.Name == "char":
return ReadString(handle, self.Name.ArraySize())
else:
return self.Type.Structure.GetField(header, handle, path)

View File

@@ -42,6 +42,7 @@ def man_format(data):
data = data.replace("\t", " ")
return data
if len(sys.argv) != 3:
import getopt
raise getopt.GetoptError("Usage: %s <path-to-blender> <output-filename>" % sys.argv[0])

View File

@@ -15,6 +15,7 @@ font_info = {
"handler": None,
}
def init():
"""init function - runs once"""
import os

View File

@@ -10,22 +10,22 @@ bm = bmesh.new()
# Add a circle XXX, should return all geometry created, not just verts.
bmesh.ops.create_circle(
bm,
cap_ends=False,
radius=0.2,
segments=8)
bm,
cap_ends=False,
radius=0.2,
segments=8)
# Spin and deal with geometry on side 'a'
edges_start_a = bm.edges[:]
geom_start_a = bm.verts[:] + edges_start_a
ret = bmesh.ops.spin(
bm,
geom=geom_start_a,
angle=math.radians(180.0),
steps=8,
axis=(1.0, 0.0, 0.0),
cent=(0.0, 1.0, 0.0))
bm,
geom=geom_start_a,
angle=math.radians(180.0),
steps=8,
axis=(1.0, 0.0, 0.0),
cent=(0.0, 1.0, 0.0))
edges_end_a = [ele for ele in ret["geom_last"]
if isinstance(ele, bmesh.types.BMEdge)]
del ret
@@ -33,8 +33,8 @@ del ret
# Extrude and create geometry on side 'b'
ret = bmesh.ops.extrude_edge_only(
bm,
edges=edges_start_a)
bm,
edges=edges_start_a)
geom_extrude_mid = ret["geom"]
del ret
@@ -45,19 +45,19 @@ verts_extrude_b = [ele for ele in geom_extrude_mid
edges_extrude_b = [ele for ele in geom_extrude_mid
if isinstance(ele, bmesh.types.BMEdge) and ele.is_boundary]
bmesh.ops.translate(
bm,
verts=verts_extrude_b,
vec=(0.0, 0.0, 1.0))
bm,
verts=verts_extrude_b,
vec=(0.0, 0.0, 1.0))
# Create the circle on side 'b'
ret = bmesh.ops.spin(
bm,
geom=verts_extrude_b + edges_extrude_b,
angle=-math.radians(180.0),
steps=8,
axis=(1.0, 0.0, 0.0),
cent=(0.0, 1.0, 1.0))
bm,
geom=verts_extrude_b + edges_extrude_b,
angle=-math.radians(180.0),
steps=8,
axis=(1.0, 0.0, 0.0),
cent=(0.0, 1.0, 1.0))
edges_end_b = [ele for ele in ret["geom_last"]
if isinstance(ele, bmesh.types.BMEdge)]
del ret
@@ -65,30 +65,30 @@ del ret
# Bridge the resulting edge loops of both spins 'a & b'
bmesh.ops.bridge_loops(
bm,
edges=edges_end_a + edges_end_b)
bm,
edges=edges_end_a + edges_end_b)
# Now we have made a links of the chain, make a copy and rotate it
# (so this looks something like a chain)
ret = bmesh.ops.duplicate(
bm,
geom=bm.verts[:] + bm.edges[:] + bm.faces[:])
bm,
geom=bm.verts[:] + bm.edges[:] + bm.faces[:])
geom_dupe = ret["geom"]
verts_dupe = [ele for ele in geom_dupe if isinstance(ele, bmesh.types.BMVert)]
del ret
# position the new link
bmesh.ops.translate(
bm,
verts=verts_dupe,
vec=(0.0, 0.0, 2.0))
bm,
verts=verts_dupe,
vec=(0.0, 0.0, 2.0))
bmesh.ops.rotate(
bm,
verts=verts_dupe,
cent=(0.0, 1.0, 0.0),
matrix=mathutils.Matrix.Rotation(math.radians(90.0), 3, 'Z'))
bm,
verts=verts_dupe,
cent=(0.0, 1.0, 0.0),
matrix=mathutils.Matrix.Rotation(math.radians(90.0), 3, 'Z'))
# Done with creating the mesh, simply link it into the scene so we can see it

View File

@@ -17,4 +17,5 @@ from bpy.app.handlers import persistent
def load_handler(dummy):
print("Load Handler:", bpy.data.filepath)
bpy.app.handlers.load_post.append(load_handler)

View File

@@ -11,4 +11,5 @@ import bpy
def my_handler(scene):
print("Frame Change", scene.frame_current)
bpy.app.handlers.frame_change_pre.append(my_handler)

View File

@@ -54,19 +54,19 @@ translations_tuple = (
"Copyright (C) 2013 The Blender Foundation.",
"This file is distributed under the same license as the Blender package.",
"FIRST AUTHOR <EMAIL@ADDRESS>, YEAR."))),
),
),
(("Operator", "Render: Copy Settings"),
(("bpy.types.SCENE_OT_render_copy_settings",),
()),
("fr_FR", "Rendu : copier réglages",
(False, ())),
),
),
(("*", "Copy render settings from current scene to others"),
(("bpy.types.SCENE_OT_render_copy_settings",),
()),
("fr_FR", "Copier les réglages de rendu depuis la scène courante vers dautres",
(False, ())),
),
),
# ... etc, all messages from your addon.
)
@@ -81,6 +81,7 @@ for msg in translations_tuple:
# Define remaining addon (operators, UI...) here.
def register():
# Usual operator/UI/etc. registration...

View File

@@ -14,6 +14,7 @@ class MaterialSettings(bpy.types.PropertyGroup):
my_float = bpy.props.FloatProperty()
my_string = bpy.props.StringProperty()
bpy.utils.register_class(MaterialSettings)
bpy.types.Material.my_settings = \

View File

@@ -14,6 +14,7 @@ class SceneSettingItem(bpy.types.PropertyGroup):
name = bpy.props.StringProperty(name="Test Prop", default="Unknown")
value = bpy.props.IntProperty(name="Test Prop", default=22)
bpy.utils.register_class(SceneSettingItem)
bpy.types.Scene.my_settings = \

View File

@@ -14,6 +14,7 @@ import bpy
def update_func(self, context):
print("my test function", self)
bpy.types.Scene.testprop = bpy.props.FloatProperty(update=update_func)
bpy.context.scene.testprop = 11.0

View File

@@ -19,6 +19,7 @@ def get_float(self):
def set_float(self, value):
self["testprop"] = value
bpy.types.Scene.test_float = bpy.props.FloatProperty(get=get_float, set=set_float)
@@ -27,6 +28,7 @@ def get_date(self):
import datetime
return str(datetime.datetime.now())
bpy.types.Scene.test_date = bpy.props.StringProperty(get=get_date)
@@ -40,6 +42,7 @@ def get_array(self):
def set_array(self, values):
self["somebool"] = values[0] and values[1]
bpy.types.Scene.test_array = bpy.props.BoolVectorProperty(size=2, get=get_array, set=set_array)
@@ -50,7 +53,7 @@ test_items = [
("GREEN", "Green", "", 2),
("BLUE", "Blue", "", 3),
("YELLOW", "Yellow", "", 4),
]
]
def get_enum(self):
@@ -61,6 +64,7 @@ def get_enum(self):
def set_enum(self, value):
print("setting value", value)
bpy.types.Scene.test_enum = bpy.props.EnumProperty(items=test_items, get=get_enum, set=set_enum)

View File

@@ -9,7 +9,7 @@ bl_info = {
"wiki_url": "",
"tracker_url": "",
"category": "Object",
}
}
import bpy
@@ -23,17 +23,17 @@ class ExampleAddonPreferences(AddonPreferences):
bl_idname = __name__
filepath = StringProperty(
name="Example File Path",
subtype='FILE_PATH',
)
name="Example File Path",
subtype='FILE_PATH',
)
number = IntProperty(
name="Example Number",
default=4,
)
name="Example Number",
default=4,
)
boolean = BoolProperty(
name="Example Boolean",
default=False,
)
name="Example Boolean",
default=False,
)
def draw(self, context):
layout = self.layout

View File

@@ -14,4 +14,5 @@ import bpy
def menu_draw(self, context):
self.layout.operator("wm.save_homefile")
bpy.types.INFO_MT_file.append(menu_draw)

View File

@@ -32,7 +32,7 @@ class AddPresetObjectDraw(AddPresetBase, Operator):
# variable used for all preset values
preset_defines = [
"obj = bpy.context.object"
]
]
# properties to store in the preset
preset_values = [
@@ -42,7 +42,7 @@ class AddPresetObjectDraw(AddPresetBase, Operator):
"obj.show_name",
"obj.show_axis",
"obj.show_wire",
]
]
# where to store the preset
preset_subdir = "object/draw"
@@ -61,7 +61,7 @@ def panel_func(self, context):
classes = (
OBJECT_MT_draw_presets,
AddPresetObjectDraw,
)
)
def register():

View File

@@ -60,6 +60,7 @@ def menu_func(self, context):
layout.separator()
layout.operator(WM_OT_button_context_test.bl_idname)
classes = (
WM_OT_button_context_test,
WM_MT_button_context,
@@ -77,5 +78,6 @@ def unregister():
bpy.utils.unregister_class(cls)
bpy.types.WM_MT_button_context.remove(menu_func)
if __name__ == "__main__":
register()

View File

@@ -21,4 +21,5 @@ class CyclesNodeTree(bpy.types.NodeTree):
def poll(cls, context):
return context.scene.render.engine == 'CYCLES'
bpy.utils.register_class(CyclesNodeTree)

View File

@@ -42,6 +42,7 @@ class SimpleMouseOperator(bpy.types.Operator):
self.y = event.mouse_y
return self.execute(context)
bpy.utils.register_class(SimpleMouseOperator)
# Test call to the newly defined operator.

View File

@@ -42,6 +42,7 @@ def menu_func(self, context):
self.layout.operator_context = 'INVOKE_DEFAULT'
self.layout.operator(ExportSomeData.bl_idname, text="Text Export Operator")
# Register and add to the file selector
bpy.utils.register_class(ExportSomeData)
bpy.types.INFO_MT_file_export.append(menu_func)

View File

@@ -41,6 +41,7 @@ class CustomDrawOperator(bpy.types.Operator):
col.prop(self, "my_string")
bpy.utils.register_class(CustomDrawOperator)
# test call

View File

@@ -22,6 +22,7 @@ class HelloWorldOperator(bpy.types.Operator):
print("Hello World")
return {'FINISHED'}
bpy.utils.register_class(HelloWorldOperator)
# test call to the newly defined operator

View File

@@ -31,6 +31,7 @@ class MyPropertyGroup(bpy.types.PropertyGroup):
custom_1 = bpy.props.FloatProperty(name="My Float")
custom_2 = bpy.props.IntProperty(name="My Int")
bpy.utils.register_class(MyPropertyGroup)
bpy.types.Object.my_prop_grp = bpy.props.PointerProperty(type=MyPropertyGroup)

View File

@@ -10,4 +10,5 @@ import bpy
def draw(self, context):
self.layout.label("Hello World")
bpy.context.window_manager.popup_menu(draw, title="Greeting", icon='INFO')

View File

@@ -12,6 +12,7 @@ from bpy.props import PointerProperty
class MyPropGroup(bpy.types.PropertyGroup):
nested = bpy.props.FloatProperty(name="Nested", default=0.0)
# register it so its available for all bones
bpy.utils.register_class(MyPropGroup)
bpy.types.Bone.my_prop = PointerProperty(type=MyPropGroup,

View File

@@ -23,9 +23,9 @@ class OffScreenDraw(bpy.types.Operator):
@staticmethod
def handle_add(self, context):
OffScreenDraw._handle_draw = bpy.types.SpaceView3D.draw_handler_add(
self.draw_callback_px, (self, context),
'WINDOW', 'POST_PIXEL',
)
self.draw_callback_px, (self, context),
'WINDOW', 'POST_PIXEL',
)
@staticmethod
def handle_remove():
@@ -58,20 +58,20 @@ class OffScreenDraw(bpy.types.Operator):
modelview_matrix = camera.matrix_world.inverted()
projection_matrix = camera.calc_matrix_camera(
render.resolution_x,
render.resolution_y,
render.pixel_aspect_x,
render.pixel_aspect_y,
)
render.resolution_x,
render.resolution_y,
render.pixel_aspect_x,
render.pixel_aspect_y,
)
offscreen.draw_view3d(
scene,
render_layer,
context.space_data,
context.region,
projection_matrix,
modelview_matrix,
)
scene,
render_layer,
context.space_data,
context.region,
projection_matrix,
modelview_matrix,
)
@staticmethod
def _opengl_draw(context, texture, aspect_ratio, scale):

View File

@@ -73,6 +73,8 @@ def rna_info_BuildRNAInfo_cache():
if rna_info_BuildRNAInfo_cache.ret is None:
rna_info_BuildRNAInfo_cache.ret = rna_info.BuildRNAInfo()
return rna_info_BuildRNAInfo_cache.ret
rna_info_BuildRNAInfo_cache.ret = None
# --- end rna_info cache
@@ -434,7 +436,7 @@ else:
BLENDER_VERSION_DOTS = ".".join(blender_version_strings)
if BLENDER_REVISION != "Unknown":
# '2.62a SHA1' (release) or '2.62.1 SHA1' (non-release)
BLENDER_VERSION_DOTS += " " + BLENDER_REVISION
BLENDER_VERSION_DOTS += " " + BLENDER_REVISION
if is_release:
# '2_62a_release'
@@ -516,6 +518,8 @@ def escape_rst(text):
""" Escape plain text which may contain characters used by RST.
"""
return text.translate(escape_rst.trans)
escape_rst.trans = str.maketrans({
"`": "\\`",
"|": "\\|",
@@ -1018,6 +1022,7 @@ def pymodule2sphinx(basepath, module_name, module, title):
file.close()
# Changes in Blender will force errors here
context_type_map = {
"active_base": ("ObjectBase", False),

View File

@@ -21,7 +21,7 @@
# <pep8 compliant>
bpy_types_Operator_bl_property__doc__ = (
"""
"""
The name of a property to use as this operators primary property.
Currently this is only used to select the default property when
expanding an operator into a menu.

View File

@@ -29,7 +29,7 @@ You'll need to specify your user login and password, obviously.
Example usage:
./sphinx_doc_update.py --mirror ../../../docs/remote_api_backup/ --source ../.. --blender ../../../build_cmake/bin/blender --user foobar --password barfoo
./sphinx_doc_update.py --mirror ../../../docs/remote_api_backup/ --source ../.. --blender ../../../build_cmake/bin/blender --user foobar --password barfoo
"""
@@ -107,14 +107,16 @@ def main():
with tempfile.TemporaryDirectory() as tmp_dir:
# II) Generate doc source in temp dir.
doc_gen_cmd = (args.blender, "--background", "-noaudio", "--factory-startup", "--python-exit-code", "1",
"--python", "%s/doc/python_api/sphinx_doc_gen.py" % args.source_dir, "--",
"--output", tmp_dir)
doc_gen_cmd = (
args.blender, "--background", "-noaudio", "--factory-startup", "--python-exit-code", "1",
"--python", "%s/doc/python_api/sphinx_doc_gen.py" % args.source_dir, "--",
"--output", tmp_dir
)
subprocess.run(doc_gen_cmd)
# III) Get Blender version info.
getver_file = os.path.join(tmp_dir, "blendver.txt")
getver_script = (""
getver_script = (
"import sys, bpy\n"
"with open(sys.argv[-1], 'w') as f:\n"
" is_release = bpy.app.version_cycle in {'rc', 'release'}\n"
@@ -124,7 +126,8 @@ def main():
" f.write('%d.%d%s\\n' % (bpy.app.version[0], bpy.app.version[1], bpy.app.version_char)\n"
" if is_release else '%s\\n' % branch)\n"
" f.write('%d_%d%s_release' % (bpy.app.version[0], bpy.app.version[1], bpy.app.version_char)\n"
" if is_release else '%d_%d_%d' % bpy.app.version)\n")
" if is_release else '%d_%d_%d' % bpy.app.version)\n"
)
get_ver_cmd = (args.blender, "--background", "-noaudio", "--factory-startup", "--python-exit-code", "1",
"--python-expr", getver_script, "--", getver_file)
subprocess.run(get_ver_cmd)

View File

@@ -28,4 +28,3 @@ set(SRC
)
blender_add_lib(extern_rangetree "${SRC}" "${INC}" "")

View File

@@ -355,4 +355,3 @@ endif()
if(NOT WITH_BLENDER AND WITH_CYCLES_STANDALONE)
delayed_do_install(${CMAKE_BINARY_DIR}/bin)
endif()

View File

@@ -164,7 +164,7 @@ bool link_ptxas(CompilationSettings &settings)
ptx += " --verbose";
printf("%s\n", ptx.c_str());
}
int pxresult = system(ptx.c_str());
if(pxresult) {
fprintf(stderr, "Error: ptxas failed (%x)\n\n", pxresult);

View File

@@ -112,4 +112,3 @@ int main(int argc, const char **argv)
return 0;
}

View File

@@ -524,4 +524,3 @@ int main(int argc, const char **argv)
return 0;
}

View File

@@ -184,7 +184,7 @@ static bool xml_equal_string(xml_node node, const char *name, const char *value)
if(attr)
return string_iequals(attr.value(), value);
return false;
}
@@ -697,4 +697,3 @@ void xml_read_file(Scene *scene, const char *filepath)
}
CCL_NAMESPACE_END

View File

@@ -39,7 +39,7 @@ def write(node, fname):
f = open(fname, "w")
f.write(s)
class CyclesXMLSettings(bpy.types.PropertyGroup):
@classmethod
def register(cls):
@@ -53,11 +53,11 @@ class CyclesXMLSettings(bpy.types.PropertyGroup):
maxlen=256,
default='',
subtype='FILE_PATH')
@classmethod
def unregister(cls):
del bpy.types.Scene.cycles_xml
# User Interface Drawing Code
class RenderButtonsPanel():
bl_space_type = 'PROPERTIES'
@@ -74,13 +74,13 @@ class PHYSICS_PT_fluid_export(RenderButtonsPanel, bpy.types.Panel):
def draw(self, context):
layout = self.layout
cycles = context.scene.cycles_xml
#layout.prop(cycles, "filepath")
layout.operator("export_mesh.cycles_xml")
# Export Operator
class ExportCyclesXML(bpy.types.Operator, ExportHelper):
bl_idname = "export_mesh.cycles_xml"
@@ -117,23 +117,23 @@ class ExportCyclesXML(bpy.types.Operator, ExportHelper):
P += "%f %f %f " % (v.co[0], v.co[1], v.co[2])
verts_and_uvs = zip(mesh.tessfaces, mesh.tessface_uv_textures.active.data)
for f, uvf in verts_and_uvs:
vcount = len(f.vertices)
nverts += str(vcount) + " "
for v in f.vertices:
verts += str(v) + " "
uvs += str(uvf.uv1[0]) + " " + str(uvf.uv1[1]) + " "
uvs += str(uvf.uv2[0]) + " " + str(uvf.uv2[1]) + " "
uvs += str(uvf.uv3[0]) + " " + str(uvf.uv3[1]) + " "
if vcount==4:
uvs += " " + str(uvf.uv4[0]) + " " + str(uvf.uv4[1]) + " "
node = etree.Element('mesh', attrib={'nverts': nverts.strip(), 'verts': verts.strip(), 'P': P, 'UV' : uvs.strip()})
# write to file
write(node, filepath)
@@ -147,5 +147,3 @@ def unregister():
if __name__ == "__main__":
register()

View File

@@ -63,4 +63,3 @@ endif()
add_dependencies(bf_intern_cycles bf_rna)
delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${ADDON_FILES}" ${CYCLES_INSTALL_PATH})

View File

@@ -887,17 +887,17 @@ class CyclesMaterialSettings(bpy.types.PropertyGroup):
del bpy.types.Material.cycles
class CyclesLampSettings(bpy.types.PropertyGroup):
class CyclesLightSettings(bpy.types.PropertyGroup):
@classmethod
def register(cls):
bpy.types.Lamp.cycles = PointerProperty(
name="Cycles Lamp Settings",
description="Cycles lamp settings",
bpy.types.Light.cycles = PointerProperty(
name="Cycles Light Settings",
description="Cycles light settings",
type=cls,
)
cls.cast_shadow = BoolProperty(
name="Cast Shadow",
description="Lamp casts shadows",
description="Light casts shadows",
default=True,
)
cls.samples = IntProperty(
@@ -914,20 +914,20 @@ class CyclesLampSettings(bpy.types.PropertyGroup):
)
cls.use_multiple_importance_sampling = BoolProperty(
name="Multiple Importance Sample",
description="Use multiple importance sampling for the lamp, "
"reduces noise for area lamps and sharp glossy materials",
description="Use multiple importance sampling for the light, "
"reduces noise for area lights and sharp glossy materials",
default=True,
)
cls.is_portal = BoolProperty(
name="Is Portal",
description="Use this area lamp to guide sampling of the background, "
"note that this will make the lamp invisible",
description="Use this area light to guide sampling of the background, "
"note that this will make the light invisible",
default=False,
)
@classmethod
def unregister(cls):
del bpy.types.Lamp.cycles
del bpy.types.Light.cycles
class CyclesWorldSettings(bpy.types.PropertyGroup):
@@ -1460,7 +1460,7 @@ def register():
bpy.utils.register_class(CyclesRenderSettings)
bpy.utils.register_class(CyclesCameraSettings)
bpy.utils.register_class(CyclesMaterialSettings)
bpy.utils.register_class(CyclesLampSettings)
bpy.utils.register_class(CyclesLightSettings)
bpy.utils.register_class(CyclesWorldSettings)
bpy.utils.register_class(CyclesVisibilitySettings)
bpy.utils.register_class(CyclesMeshSettings)
@@ -1475,7 +1475,7 @@ def unregister():
bpy.utils.unregister_class(CyclesRenderSettings)
bpy.utils.unregister_class(CyclesCameraSettings)
bpy.utils.unregister_class(CyclesMaterialSettings)
bpy.utils.unregister_class(CyclesLampSettings)
bpy.utils.unregister_class(CyclesLightSettings)
bpy.utils.unregister_class(CyclesWorldSettings)
bpy.utils.unregister_class(CyclesMeshSettings)
bpy.utils.unregister_class(CyclesObjectSettings)

View File

@@ -17,7 +17,7 @@
# <pep8 compliant>
import bpy
from bpy_extras.node_utils import find_node_input, find_output_node
from bpy_extras.node_utils import find_node_input
from bl_operators.presets import PresetMenu
from bpy.types import (
@@ -847,7 +847,7 @@ class CYCLES_CAMERA_PT_dof_aperture(CyclesButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
layout.use_property_split = True
flow = layout.grid_flow(row_major=True, num_columns=0, even_columns=True, even_rows=False, align=False)
flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
cam = context.camera
ccam = cam.cycles
@@ -878,7 +878,7 @@ class CYCLES_CAMERA_PT_dof_viewport(CyclesButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
layout.use_property_split = True
flow = layout.grid_flow(row_major=True, num_columns=0, even_columns=True, even_rows=False, align=False)
flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
cam = context.camera
dof_options = cam.gpu_dof
@@ -1008,7 +1008,7 @@ class CYCLES_OBJECT_PT_cycles_settings(CyclesButtonsPanel, Panel):
def poll(cls, context):
ob = context.object
return (CyclesButtonsPanel.poll(context) and
ob and ((ob.type in {'MESH', 'CURVE', 'SURFACE', 'FONT', 'META', 'LAMP'}) or
ob and ((ob.type in {'MESH', 'CURVE', 'SURFACE', 'FONT', 'META', 'LIGHT'}) or
(ob.dupli_type == 'COLLECTION' and ob.dupli_group)))
def draw(self, context):
@@ -1029,7 +1029,7 @@ class CYCLES_OBJECT_PT_cycles_settings(CyclesButtonsPanel, Panel):
flow.prop(visibility, "transmission")
flow.prop(visibility, "scatter")
if ob.type != 'LAMP':
if ob.type != 'LIGHT':
flow.prop(visibility, "shadow")
row = layout.row()
@@ -1049,7 +1049,7 @@ class CYCLES_OBJECT_PT_cycles_settings(CyclesButtonsPanel, Panel):
class CYCLES_OT_use_shading_nodes(Operator):
"""Enable nodes on a material, world or lamp"""
"""Enable nodes on a material, world or light"""
bl_idname = "cycles.use_shading_nodes"
bl_label = "Use Nodes"
@@ -1063,20 +1063,20 @@ class CYCLES_OT_use_shading_nodes(Operator):
context.material.use_nodes = True
elif context.world:
context.world.use_nodes = True
elif context.lamp:
context.lamp.use_nodes = True
elif context.light:
context.light.use_nodes = True
return {'FINISHED'}
def panel_node_draw(layout, id_data, output_types, input_name):
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')
return False
ntree = id_data.node_tree
node = find_output_node(ntree, output_types)
node = ntree.get_output_node('CYCLES')
if node:
input = find_node_input(node, input_name)
if input:
@@ -1089,7 +1089,7 @@ def panel_node_draw(layout, id_data, output_types, input_name):
return True
class CYCLES_LAMP_PT_preview(CyclesButtonsPanel, Panel):
class CYCLES_LIGHT_PT_preview(CyclesButtonsPanel, Panel):
bl_label = "Preview"
bl_context = "data"
bl_options = {'DEFAULT_CLOSED'}
@@ -1097,113 +1097,107 @@ class CYCLES_LAMP_PT_preview(CyclesButtonsPanel, Panel):
@classmethod
def poll(cls, context):
return (
context.lamp and
context.light and
not (
context.lamp.type == 'AREA' and
context.lamp.cycles.is_portal
context.light.type == 'AREA' and
context.light.cycles.is_portal
) and
CyclesButtonsPanel.poll(context)
)
def draw(self, context):
self.layout.template_preview(context.lamp)
self.layout.template_preview(context.light)
class CYCLES_LAMP_PT_lamp(CyclesButtonsPanel, Panel):
bl_label = "Lamp"
class CYCLES_LIGHT_PT_light(CyclesButtonsPanel, Panel):
bl_label = "Light"
bl_context = "data"
@classmethod
def poll(cls, context):
return context.lamp and CyclesButtonsPanel.poll(context)
return context.light and CyclesButtonsPanel.poll(context)
def draw(self, context):
layout = self.layout
lamp = context.lamp
clamp = lamp.cycles
light = context.light
clamp = light.cycles
# cscene = context.scene.cycles
layout.prop(lamp, "type", expand=True)
layout.prop(light, "type", expand=True)
split = layout.split()
col = split.column(align=True)
layout.use_property_split = True
if lamp.type in {'POINT', 'SUN', 'SPOT'}:
col.prop(lamp, "shadow_soft_size", text="Size")
elif lamp.type == 'AREA':
col.prop(lamp, "shape", text="")
col = layout.column()
if light.type in {'POINT', 'SUN', 'SPOT'}:
col.prop(light, "shadow_soft_size", text="Size")
elif light.type == 'AREA':
col.prop(light, "shape", text="Shape")
sub = col.column(align=True)
if lamp.shape in {'SQUARE', 'DISK'}:
sub.prop(lamp, "size")
elif lamp.shape in {'RECTANGLE', 'ELLIPSE'}:
sub.prop(lamp, "size", text="Size X")
sub.prop(lamp, "size_y", text="Size Y")
if light.shape in {'SQUARE', 'DISK'}:
sub.prop(light, "size")
elif light.shape in {'RECTANGLE', 'ELLIPSE'}:
sub.prop(light, "size", text="Size X")
sub.prop(light, "size_y", text="Y")
if not (lamp.type == 'AREA' and clamp.is_portal):
sub = col.column(align=True)
if not (light.type == 'AREA' and clamp.is_portal):
sub = col.column()
if use_branched_path(context):
subsub = sub.row(align=True)
subsub.active = use_sample_all_lights(context)
subsub.prop(clamp, "samples")
sub.prop(clamp, "max_bounces")
col = split.column()
sub = col.column(align=True)
sub.active = not (lamp.type == 'AREA' and clamp.is_portal)
sub.active = not (light.type == 'AREA' and clamp.is_portal)
sub.prop(clamp, "cast_shadow")
sub.prop(clamp, "use_multiple_importance_sampling", text="Multiple Importance")
if lamp.type == 'AREA':
if light.type == 'AREA':
col.prop(clamp, "is_portal", text="Portal")
if lamp.type == 'HEMI':
layout.label(text="Not supported, interpreted as sun lamp")
if light.type == 'HEMI':
layout.label(text="Not supported, interpreted as sun light")
class CYCLES_LAMP_PT_nodes(CyclesButtonsPanel, Panel):
class CYCLES_LIGHT_PT_nodes(CyclesButtonsPanel, Panel):
bl_label = "Nodes"
bl_context = "data"
@classmethod
def poll(cls, context):
return context.lamp and not (context.lamp.type == 'AREA' and
context.lamp.cycles.is_portal) and \
return context.light and not (context.light.type == 'AREA' and
context.light.cycles.is_portal) and \
CyclesButtonsPanel.poll(context)
def draw(self, context):
layout = self.layout
lamp = context.lamp
if not panel_node_draw(layout, lamp, ('OUTPUT_LAMP',), 'Surface'):
layout.prop(lamp, "color")
light = context.light
if not panel_node_draw(layout, light, 'OUTPUT_LIGHT', 'Surface'):
layout.prop(light, "color")
class CYCLES_LAMP_PT_spot(CyclesButtonsPanel, Panel):
class CYCLES_LIGHT_PT_spot(CyclesButtonsPanel, Panel):
bl_label = "Spot Shape"
bl_context = "data"
@classmethod
def poll(cls, context):
lamp = context.lamp
return (lamp and lamp.type == 'SPOT') and CyclesButtonsPanel.poll(context)
light = context.light
return (light and light.type == 'SPOT') and CyclesButtonsPanel.poll(context)
def draw(self, context):
layout = self.layout
light = context.light
layout.use_property_split = True
lamp = context.lamp
split = layout.split()
col = split.column()
sub = col.column()
sub.prop(lamp, "spot_size", text="Size")
sub.prop(lamp, "spot_blend", text="Blend", slider=True)
col = split.column()
col.prop(lamp, "show_cone")
col = layout.column()
col.prop(light, "spot_size", text="Size")
col.prop(light, "spot_blend", text="Blend", slider=True)
col.prop(light, "show_cone")
class CYCLES_WORLD_PT_preview(CyclesButtonsPanel, Panel):
@@ -1232,7 +1226,7 @@ class CYCLES_WORLD_PT_surface(CyclesButtonsPanel, Panel):
world = context.world
if not panel_node_draw(layout, world, ('OUTPUT_WORLD',), 'Surface'):
if not panel_node_draw(layout, world, 'OUTPUT_WORLD', 'Surface'):
layout.prop(world, "horizon_color", text="Color")
@@ -1250,7 +1244,7 @@ class CYCLES_WORLD_PT_volume(CyclesButtonsPanel, Panel):
layout = self.layout
world = context.world
panel_node_draw(layout, world, ('OUTPUT_WORLD',), 'Volume')
panel_node_draw(layout, world, 'OUTPUT_WORLD', 'Volume')
class CYCLES_WORLD_PT_ambient_occlusion(CyclesButtonsPanel, Panel):
@@ -1431,7 +1425,7 @@ class CYCLES_MATERIAL_PT_surface(CyclesButtonsPanel, Panel):
layout = self.layout
mat = context.material
if not panel_node_draw(layout, mat, ('OUTPUT_MATERIAL', 'OUTPUT_EEVEE_MATERIAL'), 'Surface'):
if not panel_node_draw(layout, mat, 'OUTPUT_MATERIAL', 'Surface'):
layout.prop(mat, "diffuse_color")
@@ -1451,7 +1445,7 @@ class CYCLES_MATERIAL_PT_volume(CyclesButtonsPanel, Panel):
mat = context.material
# cmat = mat.cycles
panel_node_draw(layout, mat, ('OUTPUT_MATERIAL', 'OUTPUT_EEVEE_MATERIAL'), 'Volume')
panel_node_draw(layout, mat, 'OUTPUT_MATERIAL', 'Volume')
class CYCLES_MATERIAL_PT_displacement(CyclesButtonsPanel, Panel):
@@ -1467,7 +1461,7 @@ class CYCLES_MATERIAL_PT_displacement(CyclesButtonsPanel, Panel):
layout = self.layout
mat = context.material
panel_node_draw(layout, mat, ('OUTPUT_MATERIAL', 'OUTPUT_EEVEE_MATERIAL'), 'Displacement')
panel_node_draw(layout, mat, 'OUTPUT_MATERIAL', 'Displacement')
class CYCLES_MATERIAL_PT_settings(CyclesButtonsPanel, Panel):
@@ -1545,7 +1539,7 @@ class CYCLES_RENDER_PT_bake(CyclesButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
layout.use_property_split = True
layout.use_property_decorate = False # No animation.
layout.use_property_decorate = False # No animation.
scene = context.scene
cscene = scene.cycles
@@ -1574,7 +1568,7 @@ class CYCLES_RENDER_PT_bake(CyclesButtonsPanel, Panel):
if cscene.bake_type == 'NORMAL':
col.prop(cbk, "normal_space", text="Space")
sub = col.column(align=True)
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")
@@ -1596,7 +1590,7 @@ class CYCLES_RENDER_PT_bake(CyclesButtonsPanel, Panel):
elif cscene.bake_type in {'DIFFUSE', 'GLOSSY', 'TRANSMISSION', 'SUBSURFACE'}:
row = col.row(align=True)
row.use_property_split = False
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)
@@ -1615,12 +1609,12 @@ class CYCLES_RENDER_PT_bake(CyclesButtonsPanel, Panel):
sub.prop(cbk, "use_cage", text="Cage")
if cbk.use_cage:
sub.prop(cbk, "cage_extrusion", text="Extrusion")
sub.prop_search(cbk, "cage_object", scene, "objects", text="Cage Object")
sub.prop_search(cbk, "cage_object", scene, "objects", text="Cage Object")
else:
sub.prop(cbk, "cage_extrusion", text="Ray Distance")
layout.separator()
layout.separator()
layout.operator("object.bake", icon='RENDER_STILL').type = cscene.bake_type
@@ -1795,7 +1789,7 @@ def get_panels():
'DATA_PT_area',
'DATA_PT_camera_dof',
'DATA_PT_falloff_curve',
'DATA_PT_lamp',
'DATA_PT_light',
'DATA_PT_preview',
'DATA_PT_spot',
'MATERIAL_PT_context_material',
@@ -1849,10 +1843,10 @@ classes = (
CYCLES_OBJECT_PT_motion_blur,
CYCLES_OBJECT_PT_cycles_settings,
CYCLES_OT_use_shading_nodes,
CYCLES_LAMP_PT_preview,
CYCLES_LAMP_PT_lamp,
CYCLES_LAMP_PT_nodes,
CYCLES_LAMP_PT_spot,
CYCLES_LIGHT_PT_preview,
CYCLES_LIGHT_PT_light,
CYCLES_LIGHT_PT_nodes,
CYCLES_LIGHT_PT_spot,
CYCLES_WORLD_PT_preview,
CYCLES_WORLD_PT_surface,
CYCLES_WORLD_PT_volume,

View File

@@ -22,45 +22,6 @@ import math
from bpy.app.handlers import persistent
def check_is_new_shading_ntree(node_tree):
for node in node_tree.nodes:
# If material has any node with ONLY new shading system
# compatibility then it's considered a Cycles material
# and versioning code would need to perform on it.
#
# We can not check for whether NEW_SHADING in compatibility
# because some nodes could have compatibility with both old
# and new shading system and they can't be used for any
# decision here.
if node.shading_compatibility == {'NEW_SHADING'}:
return True
# If node is only compatible with old shading system
# then material can not be Cycles material and we
# can stopiterating nodes now.
if node.shading_compatibility == {'OLD_SHADING'}:
return False
return False
def check_is_new_shading_material(material):
if not material.node_tree:
return False
return check_is_new_shading_ntree(material.node_tree)
def check_is_new_shading_world(world):
if not world.node_tree:
return False
return check_is_new_shading_ntree(world.node_tree)
def check_is_new_shading_lamp(lamp):
if not lamp.node_tree:
return False
return check_is_new_shading_ntree(lamp.node_tree)
def foreach_notree_node(nodetree, callback, traversed):
if nodetree in traversed:
return
@@ -74,20 +35,20 @@ def foreach_notree_node(nodetree, callback, traversed):
def foreach_cycles_node(callback):
traversed = set()
for material in bpy.data.materials:
if check_is_new_shading_material(material):
foreach_notree_node(material.node_tree,
callback,
traversed)
if material.node_tree:
foreach_notree_node(material.node_tree,
callback,
traversed)
for world in bpy.data.worlds:
if check_is_new_shading_world(world):
foreach_notree_node(world.node_tree,
callback,
traversed)
for lamp in bpy.data.lamps:
if check_is_new_shading_world(lamp):
foreach_notree_node(lamp.node_tree,
callback,
traversed)
if world.node_tree:
foreach_notree_node(world.node_tree,
callback,
traversed)
for light in bpy.data.lights:
if light.node_tree:
foreach_notree_node(light.node_tree,
callback,
traversed)
def displacement_node_insert(material, nodetree, traversed):
@@ -128,7 +89,7 @@ def displacement_node_insert(material, nodetree, traversed):
def displacement_nodes_insert():
traversed = set()
for material in bpy.data.materials:
if check_is_new_shading_material(material):
if material.node_tree:
displacement_node_insert(material, material.node_tree, traversed)
def displacement_principled_nodes(node):
@@ -186,7 +147,7 @@ def square_roughness_node_insert(material, nodetree, traversed):
def square_roughness_nodes_insert():
traversed = set()
for material in bpy.data.materials:
if check_is_new_shading_material(material):
if material.node_tree:
square_roughness_node_insert(material, material.node_tree, traversed)
@@ -301,7 +262,7 @@ def ambient_occlusion_node_relink(material, nodetree, traversed):
def ambient_occlusion_nodes_relink():
traversed = set()
for material in bpy.data.materials:
if check_is_new_shading_material(material):
if material.node_tree:
ambient_occlusion_node_relink(material, material.node_tree, traversed)
@@ -393,12 +354,12 @@ def do_versions(self):
if not cscene.is_property_set("tile_order"):
cscene.tile_order = 'CENTER'
for lamp in bpy.data.lamps:
clamp = lamp.cycles
for light in bpy.data.lights:
clight = light.cycles
# MIS
if not clamp.is_property_set("use_multiple_importance_sampling"):
clamp.use_multiple_importance_sampling = False
if not clight.is_property_set("use_multiple_importance_sampling"):
clight.use_multiple_importance_sampling = False
for mat in bpy.data.materials:
cmat = mat.cycles

View File

@@ -124,7 +124,7 @@ static float blender_camera_focal_distance(BL::RenderEngine& b_engine,
if(!b_dof_object)
return b_camera.dof_distance();
/* for dof object, return distance along camera Z direction */
BL::Array<float, 16> b_ob_matrix;
b_engine.camera_model_matrix(b_ob, bcam->use_spherical_stereo, b_ob_matrix);
@@ -232,7 +232,7 @@ static void blender_camera_from_object(BlenderCamera *bcam,
bcam->motion_steps = object_motion_steps(b_ob, b_ob);
}
else {
/* from lamp not implemented yet */
/* from light not implemented yet */
}
}
@@ -457,6 +457,7 @@ static void blender_camera_sync(Camera *cam,
cam->matrix = blender_camera_matrix(bcam->matrix,
bcam->type,
bcam->panorama_type);
cam->motion.clear();
cam->motion.resize(bcam->motion_steps, cam->matrix);
cam->use_perspective_motion = false;
cam->shuttertime = bcam->shuttertime;
@@ -725,7 +726,7 @@ static void blender_camera_view_subset(BL::RenderEngine& b_engine,
blender_camera_viewplane(&cam_bcam, cam_bcam.full_width, cam_bcam.full_height,
&cam, &cam_aspect, &sensor_size);
/* return */
*view_box = view * (1.0f/view_aspect);
*cam_box = cam * (1.0f/cam_aspect);
@@ -894,4 +895,3 @@ BufferParams BlenderSync::get_buffer_params(BL::RenderSettings& b_render,
}
CCL_NAMESPACE_END

View File

@@ -89,7 +89,7 @@ bool BlenderSync::object_is_light(BL::Object& b_ob)
{
BL::ID b_ob_data = b_ob.data();
return (b_ob_data && b_ob_data.is_a(&RNA_Lamp));
return (b_ob_data && b_ob_data.is_a(&RNA_Light));
}
static uint object_ray_visibility(BL::Object& b_ob)
@@ -126,57 +126,57 @@ void BlenderSync::sync_light(BL::Object& b_parent,
*use_portal = true;
return;
}
BL::Lamp b_lamp(b_ob.data());
BL::Light b_light(b_ob.data());
/* type */
switch(b_lamp.type()) {
case BL::Lamp::type_POINT: {
BL::PointLamp b_point_lamp(b_lamp);
light->size = b_point_lamp.shadow_soft_size();
switch(b_light.type()) {
case BL::Light::type_POINT: {
BL::PointLight b_point_light(b_light);
light->size = b_point_light.shadow_soft_size();
light->type = LIGHT_POINT;
break;
}
case BL::Lamp::type_SPOT: {
BL::SpotLamp b_spot_lamp(b_lamp);
light->size = b_spot_lamp.shadow_soft_size();
case BL::Light::type_SPOT: {
BL::SpotLight b_spot_light(b_light);
light->size = b_spot_light.shadow_soft_size();
light->type = LIGHT_SPOT;
light->spot_angle = b_spot_lamp.spot_size();
light->spot_smooth = b_spot_lamp.spot_blend();
light->spot_angle = b_spot_light.spot_size();
light->spot_smooth = b_spot_light.spot_blend();
break;
}
case BL::Lamp::type_HEMI: {
case BL::Light::type_HEMI: {
light->type = LIGHT_DISTANT;
light->size = 0.0f;
break;
}
case BL::Lamp::type_SUN: {
BL::SunLamp b_sun_lamp(b_lamp);
light->size = b_sun_lamp.shadow_soft_size();
case BL::Light::type_SUN: {
BL::SunLight b_sun_light(b_light);
light->size = b_sun_light.shadow_soft_size();
light->type = LIGHT_DISTANT;
break;
}
case BL::Lamp::type_AREA: {
BL::AreaLamp b_area_lamp(b_lamp);
case BL::Light::type_AREA: {
BL::AreaLight b_area_light(b_light);
light->size = 1.0f;
light->axisu = transform_get_column(&tfm, 0);
light->axisv = transform_get_column(&tfm, 1);
light->sizeu = b_area_lamp.size();
switch(b_area_lamp.shape()) {
case BL::AreaLamp::shape_SQUARE:
light->sizeu = b_area_light.size();
switch(b_area_light.shape()) {
case BL::AreaLight::shape_SQUARE:
light->sizev = light->sizeu;
light->round = false;
break;
case BL::AreaLamp::shape_RECTANGLE:
light->sizev = b_area_lamp.size_y();
case BL::AreaLight::shape_RECTANGLE:
light->sizev = b_area_light.size_y();
light->round = false;
break;
case BL::AreaLamp::shape_DISK:
case BL::AreaLight::shape_DISK:
light->sizev = light->sizeu;
light->round = true;
break;
case BL::AreaLamp::shape_ELLIPSE:
light->sizev = b_area_lamp.size_y();
case BL::AreaLight::shape_ELLIPSE:
light->sizev = b_area_light.size_y();
light->round = true;
break;
}
@@ -192,22 +192,22 @@ void BlenderSync::sync_light(BL::Object& b_parent,
/* shader */
vector<Shader*> used_shaders;
find_shader(b_lamp, used_shaders, scene->default_light);
find_shader(b_light, used_shaders, scene->default_light);
light->shader = used_shaders[0];
/* shadow */
PointerRNA cscene = RNA_pointer_get(&b_scene.ptr, "cycles");
PointerRNA clamp = RNA_pointer_get(&b_lamp.ptr, "cycles");
light->cast_shadow = get_boolean(clamp, "cast_shadow");
light->use_mis = get_boolean(clamp, "use_multiple_importance_sampling");
int samples = get_int(clamp, "samples");
PointerRNA clight = RNA_pointer_get(&b_light.ptr, "cycles");
light->cast_shadow = get_boolean(clight, "cast_shadow");
light->use_mis = get_boolean(clight, "use_multiple_importance_sampling");
int samples = get_int(clight, "samples");
if(get_boolean(cscene, "use_square_samples"))
light->samples = samples * samples;
else
light->samples = samples;
light->max_bounces = get_int(clamp, "max_bounces");
light->max_bounces = get_int(clight, "max_bounces");
if(b_ob != b_ob_instance) {
light->random_id = random_id;
@@ -217,7 +217,7 @@ void BlenderSync::sync_light(BL::Object& b_parent,
}
if(light->type == LIGHT_AREA)
light->is_portal = get_boolean(clamp, "is_portal");
light->is_portal = get_boolean(clight, "is_portal");
else
light->is_portal = false;
@@ -315,7 +315,7 @@ Object *BlenderSync::sync_object(BL::Depsgraph& b_depsgraph,
/* light is handled separately */
if(object_is_light(b_ob)) {
/* don't use lamps for excluded layers used as mask layer */
/* don't use lights for excluded layers used as mask layer */
if(!motion && !((layer_flag & view_layer.holdout_layer) &&
(layer_flag & view_layer.exclude_layer)))
{
@@ -394,7 +394,7 @@ Object *BlenderSync::sync_object(BL::Depsgraph& b_depsgraph,
if(object_map.sync(&object, b_ob, b_parent, key))
object_updated = true;
/* mesh sync */
object->mesh = sync_mesh(b_depsgraph, b_ob, b_ob_instance, object_updated, hide_tris);
@@ -448,6 +448,7 @@ Object *BlenderSync::sync_object(BL::Depsgraph& b_depsgraph,
mesh->motion_steps = motion_steps;
}
object->motion.clear();
object->motion.resize(motion_steps, transform_empty());
if(motion_steps) {
@@ -542,7 +543,7 @@ static bool object_render_hide(BL::Object& b_ob,
}
parent = parent.parent();
}
hide_triangles = hide_emitter;
if(show_emitter) {
@@ -562,7 +563,7 @@ void BlenderSync::sync_objects(BL::Depsgraph& b_depsgraph, float motion_time)
{
/* layer data */
bool motion = motion_time != 0.0f;
if(!motion) {
/* prepare for sync */
light_map.pre_sync();
@@ -728,4 +729,3 @@ void BlenderSync::sync_motion(BL::RenderSettings& b_render,
}
CCL_NAMESPACE_END

View File

@@ -146,4 +146,3 @@ bool BlenderObjectCulling::test_distance(Scene *scene, float3 bb[8])
}
CCL_NAMESPACE_END

View File

@@ -68,7 +68,7 @@ bool BlenderSync::sync_dupli_particle(BL::Object& b_ob,
/* add particle */
BL::Particle b_pa = b_psys.particles[persistent_id[0]];
Particle pa;
pa.index = persistent_id[0];
pa.age = b_scene.frame_current() - b_pa.birth_time();
pa.lifetime = b_pa.lifetime();

View File

@@ -326,7 +326,7 @@ static PyObject *draw_func(PyObject * /*self*/, PyObject *args)
if(!PyArg_ParseTuple(args, "OOOO", &pysession, &pygraph, &pyv3d, &pyrv3d))
return NULL;
BlenderSession *session = (BlenderSession*)PyLong_AsVoidPtr(pysession);
if(PyLong_AsVoidPtr(pyrv3d)) {
@@ -594,7 +594,7 @@ static PyObject *osl_compile_func(PyObject * /*self*/, PyObject *args)
if(!PyArg_ParseTuple(args, "ss", &inputfile, &outputfile))
return NULL;
/* return */
if(!OSLShaderManager::osl_compile(inputfile, outputfile))
Py_RETURN_FALSE;

View File

@@ -154,7 +154,7 @@ static SocketType::Type convert_socket_type(BL::NodeSocket& b_socket)
return SocketType::STRING;
case BL::NodeSocket::type_SHADER:
return SocketType::CLOSURE;
default:
return SocketType::UNDEFINED;
}
@@ -436,7 +436,7 @@ static ShaderNode *add_node(Scene *scene,
else if(b_node.is_a(&RNA_ShaderNodeBsdfGlossy)) {
BL::ShaderNodeBsdfGlossy b_glossy_node(b_node);
GlossyBsdfNode *glossy = new GlossyBsdfNode();
switch(b_glossy_node.distribution()) {
case BL::ShaderNodeBsdfGlossy::distribution_SHARP:
glossy->distribution = CLOSURE_BSDF_REFLECTION_ID;
@@ -940,7 +940,7 @@ static ShaderInput *node_find_input_by_name(ShaderNode *node,
BL::NodeSocket& b_socket)
{
string name = b_socket.name();
if(node_use_modified_socket_name(node)) {
BL::Node::inputs_iterator b_input;
bool found = false;
@@ -1001,31 +1001,6 @@ static ShaderOutput *node_find_output_by_name(ShaderNode *node,
return node->output(name.c_str());
}
static BL::ShaderNode find_output_node(BL::ShaderNodeTree& b_ntree)
{
BL::ShaderNodeTree::nodes_iterator b_node;
BL::ShaderNode output_node(PointerRNA_NULL);
for(b_ntree.nodes.begin(b_node); b_node != b_ntree.nodes.end(); ++b_node) {
BL::ShaderNodeOutputMaterial b_output_node(*b_node);
if (b_output_node.is_a(&RNA_ShaderNodeOutputMaterial) ||
b_output_node.is_a(&RNA_ShaderNodeOutputWorld) ||
b_output_node.is_a(&RNA_ShaderNodeOutputLamp)) {
/* regular Cycles output node */
if(b_output_node.is_active_output()) {
output_node = b_output_node;
break;
}
else if(!output_node.ptr.data) {
output_node = b_output_node;
}
}
}
return output_node;
}
static void add_nodes(Scene *scene,
BL::RenderEngine& b_engine,
BL::BlendData& b_data,
@@ -1045,7 +1020,7 @@ static void add_nodes(Scene *scene,
BL::Node::outputs_iterator b_output;
/* find the node to use for output if there are multiple */
BL::ShaderNode output_node = find_output_node(b_ntree);
BL::ShaderNode output_node = b_ntree.get_output_node(BL::ShaderNodeOutputMaterial::target_CYCLES);
/* add nodes */
for(b_ntree.nodes.begin(b_node); b_node != b_ntree.nodes.end(); ++b_node) {
@@ -1068,7 +1043,7 @@ static void add_nodes(Scene *scene,
}
}
else if(b_node->is_a(&RNA_ShaderNodeGroup) || b_node->is_a(&RNA_NodeCustomGroup)) {
BL::ShaderNodeTree b_group_ntree(PointerRNA_NULL);
if(b_node->is_a(&RNA_ShaderNodeGroup))
b_group_ntree = BL::ShaderNodeTree(((BL::NodeGroup)(*b_node)).node_tree());
@@ -1110,7 +1085,7 @@ static void add_nodes(Scene *scene,
output_map[b_output->ptr.data] = proxy->outputs[0];
}
if(b_group_ntree) {
add_nodes(scene,
b_engine,
@@ -1418,45 +1393,45 @@ void BlenderSync::sync_world(BL::Depsgraph& b_depsgraph, bool update_all)
background->tag_update(scene);
}
/* Sync Lamps */
/* Sync Lights */
void BlenderSync::sync_lamps(BL::Depsgraph& b_depsgraph, bool update_all)
void BlenderSync::sync_lights(BL::Depsgraph& b_depsgraph, bool update_all)
{
shader_map.set_default(scene->default_light);
BL::Depsgraph::ids_iterator b_id;
for(b_depsgraph.ids.begin(b_id); b_id != b_depsgraph.ids.end(); ++b_id) {
if (!b_id->is_a(&RNA_Lamp)) {
if (!b_id->is_a(&RNA_Light)) {
continue;
}
BL::Lamp b_lamp(*b_id);
BL::Light b_light(*b_id);
Shader *shader;
/* test if we need to sync */
if(shader_map.sync(&shader, b_lamp) || update_all) {
if(shader_map.sync(&shader, b_light) || update_all) {
ShaderGraph *graph = new ShaderGraph();
/* create nodes */
if(b_lamp.use_nodes() && b_lamp.node_tree()) {
shader->name = b_lamp.name().c_str();
if(b_light.use_nodes() && b_light.node_tree()) {
shader->name = b_light.name().c_str();
BL::ShaderNodeTree b_ntree(b_lamp.node_tree());
BL::ShaderNodeTree b_ntree(b_light.node_tree());
add_nodes(scene, b_engine, b_data, b_depsgraph, b_scene, graph, b_ntree);
}
else {
float strength = 1.0f;
if(b_lamp.type() == BL::Lamp::type_POINT ||
b_lamp.type() == BL::Lamp::type_SPOT ||
b_lamp.type() == BL::Lamp::type_AREA)
if(b_light.type() == BL::Light::type_POINT ||
b_light.type() == BL::Light::type_SPOT ||
b_light.type() == BL::Light::type_AREA)
{
strength = 100.0f;
}
EmissionNode *emission = new EmissionNode();
emission->color = get_float3(b_lamp.color());
emission->color = get_float3(b_light.color());
emission->strength = strength;
graph->add(emission);
@@ -1484,7 +1459,7 @@ void BlenderSync::sync_shaders(BL::Depsgraph& b_depsgraph)
shader_map.pre_sync();
sync_world(b_depsgraph, auto_refresh_update);
sync_lamps(b_depsgraph, auto_refresh_update);
sync_lights(b_depsgraph, auto_refresh_update);
sync_materials(b_depsgraph, auto_refresh_update);
/* false = don't delete unused shaders, not supported */
@@ -1492,4 +1467,3 @@ void BlenderSync::sync_shaders(BL::Depsgraph& b_depsgraph)
}
CCL_NAMESPACE_END

View File

@@ -113,17 +113,17 @@ void BlenderSync::sync_recalc(BL::Depsgraph& b_depsgraph)
BL::Material b_mat(b_id);
shader_map.set_recalc(b_mat);
}
/* Lamp */
else if (b_id.is_a(&RNA_Lamp)) {
BL::Lamp b_lamp(b_id);
shader_map.set_recalc(b_lamp);
/* Light */
else if (b_id.is_a(&RNA_Light)) {
BL::Light b_light(b_id);
shader_map.set_recalc(b_light);
}
/* Object */
else if (b_id.is_a(&RNA_Object)) {
BL::Object b_ob(b_id);
const bool updated_geometry = b_update->updated_geometry();
const bool updated_geometry = !b_update->is_dirty_geometry();
if (b_update->updated_transform()) {
if (!b_update->is_dirty_transform()) {
object_map.set_recalc(b_ob);
light_map.set_recalc(b_ob);
}
@@ -292,7 +292,7 @@ void BlenderSync::sync_integrator()
integrator->mesh_light_samples = mesh_light_samples * mesh_light_samples;
integrator->subsurface_samples = subsurface_samples * subsurface_samples;
integrator->volume_samples = volume_samples * volume_samples;
}
}
else {
integrator->diffuse_samples = diffuse_samples;
integrator->glossy_samples = glossy_samples;
@@ -327,7 +327,7 @@ void BlenderSync::sync_film()
Film *film = scene->film;
Film prevfilm = *film;
film->exposure = get_float(cscene, "film_exposure");
film->filter_type = (FilterType)get_enum(cscene,
"pixel_filter_type",
@@ -580,7 +580,7 @@ SceneParams BlenderSync::get_scene_params(BL::Scene& b_scene,
params.shadingsystem = SHADINGSYSTEM_SVM;
else if(shadingsystem == 1)
params.shadingsystem = SHADINGSYSTEM_OSL;
if(background || DebugFlags().viewport_static_bvh)
params.bvh_type = SceneParams::BVH_STATIC;
else
@@ -645,7 +645,7 @@ SessionParams BlenderSync::get_session_params(BL::RenderEngine& b_engine,
/* device type */
vector<DeviceInfo>& devices = Device::available_devices();
/* device default CPU */
foreach(DeviceInfo& device, devices) {
if(device.type == DEVICE_CPU) {
@@ -720,7 +720,7 @@ SessionParams BlenderSync::get_session_params(BL::RenderEngine& b_engine,
int aa_samples = get_int(cscene, "aa_samples");
int preview_samples = get_int(cscene, "preview_samples");
int preview_aa_samples = get_int(cscene, "preview_aa_samples");
if(get_boolean(cscene, "use_square_samples")) {
aa_samples = aa_samples * aa_samples;
preview_aa_samples = preview_aa_samples * preview_aa_samples;
@@ -817,7 +817,7 @@ SessionParams BlenderSync::get_session_params(BL::RenderEngine& b_engine,
params.shadingsystem = SHADINGSYSTEM_SVM;
else if(shadingsystem == 1)
params.shadingsystem = SHADINGSYSTEM_OSL;
/* color managagement */
params.display_buffer_linear = GLEW_ARB_half_float_pixel &&
b_engine.support_display_space_shader(b_scene);
@@ -833,4 +833,3 @@ SessionParams BlenderSync::get_session_params(BL::RenderEngine& b_engine,
}
CCL_NAMESPACE_END

View File

@@ -100,7 +100,7 @@ public:
private:
/* sync */
void sync_lamps(BL::Depsgraph& b_depsgraph, bool update_all);
void sync_lights(BL::Depsgraph& b_depsgraph, bool update_all);
void sync_materials(BL::Depsgraph& b_depsgraph, bool update_all);
void sync_objects(BL::Depsgraph& b_depsgraph, float motion_time = 0.0f);
void sync_motion(BL::RenderSettings& b_render,
@@ -218,4 +218,3 @@ private:
CCL_NAMESPACE_END
#endif /* __BLENDER_SYNC_H__ */

View File

@@ -293,7 +293,7 @@ static inline int4 get_int4(const BL::Array<int, 4>& array)
return make_int4(array[0], array[1], array[2], array[3]);
}
static inline uint get_layer(const BL::Array<int, 20>& array)
static inline uint get_layer(const BL::Array<bool, 20>& array)
{
uint layer = 0;
@@ -304,8 +304,8 @@ static inline uint get_layer(const BL::Array<int, 20>& array)
return layer;
}
static inline uint get_layer(const BL::Array<int, 20>& array,
const BL::Array<int, 8>& local_array,
static inline uint get_layer(const BL::Array<bool, 20>& array,
const BL::Array<bool, 8>& local_array,
bool is_light = false,
uint view_layers = (1 << 20) - 1)
{

View File

@@ -251,4 +251,3 @@ void BVHObjectBinning::split(BVHReference* prims,
}
CCL_NAMESPACE_END

View File

@@ -206,7 +206,7 @@ void InnerNode::print(int depth) const
{
for(int i = 0; i < depth; i++)
printf(" ");
printf("inner node %p\n", (void*)this);
if(children[0])
@@ -219,9 +219,8 @@ void LeafNode::print(int depth) const
{
for(int i = 0; i < depth; i++)
printf(" ");
printf("leaf node %d to %d\n", lo, hi);
}
CCL_NAMESPACE_END

View File

@@ -201,4 +201,3 @@ void bvh_reference_sort(int start,
}
CCL_NAMESPACE_END

View File

@@ -123,7 +123,7 @@ public:
/* Use OpenSubdiv patch evaluation */
bool use_patch_evaluation;
/* Use Transparent shadows */
bool use_transparent;
@@ -307,7 +307,7 @@ public:
/* open shading language, only for CPU device */
virtual void *osl_memory() { return NULL; }
/* load/compile kernels, must be called before adding tasks */
/* load/compile kernels, must be called before adding tasks */
virtual bool load_kernels(
const DeviceRequestedFeatures& /*requested_features*/)
{ return true; }
@@ -317,7 +317,7 @@ public:
virtual void task_add(DeviceTask& task) = 0;
virtual void task_wait() = 0;
virtual void task_cancel() = 0;
/* opengl drawing */
virtual void draw_pixels(device_memory& mem, int y,
int w, int h, int width, int height,
@@ -376,4 +376,3 @@ private:
CCL_NAMESPACE_END
#endif /* __DEVICE_H__ */

View File

@@ -21,10 +21,7 @@
#ifdef WITH_OSL
/* So no context pollution happens from indirectly included windows.h */
# include "util/util_windows.h"
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wdeprecated-register"
# include <OSL/oslexec.h>
# pragma clang diagnostic pop
#endif
#include "device/device.h"
@@ -182,8 +179,8 @@ public:
KernelFunctions<void(*)(KernelGlobals *, uchar4 *, float *, float, int, int, int, int)> convert_to_byte_kernel;
KernelFunctions<void(*)(KernelGlobals *, uint4 *, float4 *, int, int, int, int, int)> shader_kernel;
KernelFunctions<void(*)(int, TilesInfo*, int, int, float*, float*, float*, float*, float*, int*, int, int)> filter_divide_shadow_kernel;
KernelFunctions<void(*)(int, TilesInfo*, int, int, int, int, float*, float*, int*, int, int)> filter_get_feature_kernel;
KernelFunctions<void(*)(int, TileInfo*, int, int, float*, float*, float*, float*, float*, int*, int, int)> filter_divide_shadow_kernel;
KernelFunctions<void(*)(int, TileInfo*, int, int, int, int, float*, float*, int*, int, int)> filter_get_feature_kernel;
KernelFunctions<void(*)(int, int, float*, float*, float*, float*, int*, int)> filter_detect_outliers_kernel;
KernelFunctions<void(*)(int, int, float*, float*, float*, float*, int*, int)> filter_combine_halves_kernel;
@@ -462,18 +459,6 @@ public:
}
};
bool denoising_set_tiles(device_ptr *buffers, DenoisingTask *task)
{
TilesInfo *tiles = (TilesInfo*) task->tiles_mem.host_pointer;
for(int i = 0; i < 9; i++) {
tiles->buffers[i] = buffers[i];
}
task->tiles_mem.copy_to_device();
return true;
}
bool denoising_non_local_means(device_ptr image_ptr, device_ptr guide_ptr, device_ptr variance_ptr, device_ptr out_ptr,
DenoisingTask *task)
{
@@ -629,7 +614,7 @@ public:
for(int y = task->rect.y; y < task->rect.w; y++) {
for(int x = task->rect.x; x < task->rect.z; x++) {
filter_divide_shadow_kernel()(task->render_buffer.samples,
task->tiles,
task->tile_info,
x, y,
(float*) a_ptr,
(float*) b_ptr,
@@ -638,7 +623,7 @@ public:
(float*) buffer_variance_ptr,
&task->rect.x,
task->render_buffer.pass_stride,
task->render_buffer.denoising_data_offset);
task->render_buffer.offset);
}
}
return true;
@@ -653,7 +638,7 @@ public:
for(int y = task->rect.y; y < task->rect.w; y++) {
for(int x = task->rect.x; x < task->rect.z; x++) {
filter_get_feature_kernel()(task->render_buffer.samples,
task->tiles,
task->tile_info,
mean_offset,
variance_offset,
x, y,
@@ -661,7 +646,7 @@ public:
(float*) variance_ptr,
&task->rect.x,
task->render_buffer.pass_stride,
task->render_buffer.denoising_data_offset);
task->render_buffer.offset);
}
}
return true;
@@ -714,7 +699,7 @@ public:
}
}
void denoise(DeviceTask &task, DenoisingTask& denoising, RenderTile &tile)
void denoise(DenoisingTask& denoising, RenderTile &tile)
{
tile.sample = tile.start_sample + tile.num_samples;
@@ -725,23 +710,11 @@ public:
denoising.functions.combine_halves = function_bind(&CPUDevice::denoising_combine_halves, this, _1, _2, _3, _4, _5, _6, &denoising);
denoising.functions.get_feature = function_bind(&CPUDevice::denoising_get_feature, this, _1, _2, _3, _4, &denoising);
denoising.functions.detect_outliers = function_bind(&CPUDevice::denoising_detect_outliers, this, _1, _2, _3, _4, &denoising);
denoising.functions.set_tiles = function_bind(&CPUDevice::denoising_set_tiles, this, _1, &denoising);
denoising.filter_area = make_int4(tile.x, tile.y, tile.w, tile.h);
denoising.render_buffer.samples = tile.sample;
RenderTile rtiles[9];
rtiles[4] = tile;
task.map_neighbor_tiles(rtiles, this);
denoising.tiles_from_rendertiles(rtiles);
denoising.init_from_devicetask(task);
denoising.run_denoising();
task.unmap_neighbor_tiles(rtiles, this);
task.update_progress(&tile, tile.w*tile.h);
denoising.run_denoising(&tile);
}
void thread_render(DeviceTask& task)
@@ -769,7 +742,7 @@ public:
}
RenderTile tile;
DenoisingTask denoising(this);
DenoisingTask denoising(this, task);
while(task.acquire_tile(this, tile)) {
if(tile.task == RenderTile::PATH_TRACE) {
@@ -782,7 +755,9 @@ public:
}
}
else if(tile.task == RenderTile::DENOISE) {
denoise(task, denoising, tile);
denoise(denoising, tile);
task.update_progress(&tile, tile.w*tile.h);
}
task.release_tile(tile);

View File

@@ -1072,6 +1072,7 @@ public:
CUarray_format_enum format;
switch(mem.data_type) {
case TYPE_UCHAR: format = CU_AD_FORMAT_UNSIGNED_INT8; break;
case TYPE_UINT16: format = CU_AD_FORMAT_UNSIGNED_INT16; break;
case TYPE_UINT: format = CU_AD_FORMAT_UNSIGNED_INT32; break;
case TYPE_INT: format = CU_AD_FORMAT_SIGNED_INT32; break;
case TYPE_FLOAT: format = CU_AD_FORMAT_FLOAT; break;
@@ -1251,18 +1252,6 @@ public:
}
}
bool denoising_set_tiles(device_ptr *buffers, DenoisingTask *task)
{
TilesInfo *tiles = (TilesInfo*) task->tiles_mem.host_pointer;
for(int i = 0; i < 9; i++) {
tiles->buffers[i] = buffers[i];
}
task->tiles_mem.copy_to_device();
return !have_error();
}
#define CUDA_GET_BLOCKSIZE(func, w, h) \
int threads_per_block; \
cuda_assert(cuFuncGetAttribute(&threads_per_block, CU_FUNC_ATTRIBUTE_MAX_THREADS_PER_BLOCK, func)); \
@@ -1534,7 +1523,7 @@ public:
task->rect.w-task->rect.y);
void *args[] = {&task->render_buffer.samples,
&task->tiles_mem.device_pointer,
&task->tile_info_mem.device_pointer,
&a_ptr,
&b_ptr,
&sample_variance_ptr,
@@ -1542,7 +1531,7 @@ public:
&buffer_variance_ptr,
&task->rect,
&task->render_buffer.pass_stride,
&task->render_buffer.denoising_data_offset};
&task->render_buffer.offset};
CUDA_LAUNCH_KERNEL(cuFilterDivideShadow, args);
cuda_assert(cuCtxSynchronize());
@@ -1568,14 +1557,14 @@ public:
task->rect.w-task->rect.y);
void *args[] = {&task->render_buffer.samples,
&task->tiles_mem.device_pointer,
&task->tile_info_mem.device_pointer,
&mean_offset,
&variance_offset,
&mean_ptr,
&variance_ptr,
&task->rect,
&task->render_buffer.pass_stride,
&task->render_buffer.denoising_data_offset};
&task->render_buffer.offset};
CUDA_LAUNCH_KERNEL(cuFilterGetFeature, args);
cuda_assert(cuCtxSynchronize());
@@ -1613,7 +1602,7 @@ public:
return !have_error();
}
void denoise(RenderTile &rtile, DenoisingTask& denoising, const DeviceTask &task)
void denoise(RenderTile &rtile, DenoisingTask& denoising)
{
denoising.functions.construct_transform = function_bind(&CUDADevice::denoising_construct_transform, this, &denoising);
denoising.functions.reconstruct = function_bind(&CUDADevice::denoising_reconstruct, this, _1, _2, _3, &denoising);
@@ -1622,21 +1611,11 @@ public:
denoising.functions.combine_halves = function_bind(&CUDADevice::denoising_combine_halves, this, _1, _2, _3, _4, _5, _6, &denoising);
denoising.functions.get_feature = function_bind(&CUDADevice::denoising_get_feature, this, _1, _2, _3, _4, &denoising);
denoising.functions.detect_outliers = function_bind(&CUDADevice::denoising_detect_outliers, this, _1, _2, _3, _4, &denoising);
denoising.functions.set_tiles = function_bind(&CUDADevice::denoising_set_tiles, this, _1, &denoising);
denoising.filter_area = make_int4(rtile.x, rtile.y, rtile.w, rtile.h);
denoising.render_buffer.samples = rtile.sample;
RenderTile rtiles[9];
rtiles[4] = rtile;
task.map_neighbor_tiles(rtiles, this);
denoising.tiles_from_rendertiles(rtiles);
denoising.init_from_devicetask(task);
denoising.run_denoising();
task.unmap_neighbor_tiles(rtiles, this);
denoising.run_denoising(&rtile);
}
void path_trace(DeviceTask& task, RenderTile& rtile, device_vector<WorkTile>& work_tiles)
@@ -2092,7 +2071,7 @@ public:
/* keep rendering tiles until done */
RenderTile tile;
DenoisingTask denoising(this);
DenoisingTask denoising(this, *task);
while(task->acquire_tile(this, tile)) {
if(tile.task == RenderTile::PATH_TRACE) {
@@ -2107,7 +2086,7 @@ public:
else if(tile.task == RenderTile::DENOISE) {
tile.sample = tile.start_sample + tile.num_samples;
denoise(tile, denoising, *task);
denoise(tile, denoising);
task->update_progress(&tile, tile.w*tile.h);
}

View File

@@ -20,12 +20,29 @@
CCL_NAMESPACE_BEGIN
DenoisingTask::DenoisingTask(Device *device)
: tiles_mem(device, "denoising tiles_mem", MEM_READ_WRITE),
DenoisingTask::DenoisingTask(Device *device, const DeviceTask &task)
: tile_info_mem(device, "denoising tile info mem", MEM_READ_WRITE),
storage(device),
buffer(device),
device(device)
{
radius = task.denoising_radius;
nlm_k_2 = powf(2.0f, lerp(-5.0f, 3.0f, task.denoising_strength));
if(task.denoising_relative_pca) {
pca_threshold = -powf(10.0f, lerp(-8.0f, 0.0f, task.denoising_feature_strength));
}
else {
pca_threshold = powf(10.0f, lerp(-5.0f, 3.0f, task.denoising_feature_strength));
}
render_buffer.pass_stride = task.pass_stride;
render_buffer.offset = task.pass_denoising_data;
target_buffer.pass_stride = task.pass_stride;
target_buffer.denoising_clean_offset = task.pass_denoising_clean;
functions.map_neighbor_tiles = function_bind(task.map_neighbor_tiles, _1, device);
functions.unmap_neighbor_tiles = function_bind(task.unmap_neighbor_tiles, _1, device);
}
DenoisingTask::~DenoisingTask()
@@ -38,170 +55,170 @@ DenoisingTask::~DenoisingTask()
storage.temporary_2.free();
storage.temporary_color.free();
buffer.mem.free();
tiles_mem.free();
tile_info_mem.free();
}
void DenoisingTask::init_from_devicetask(const DeviceTask &task)
void DenoisingTask::set_render_buffer(RenderTile *rtiles)
{
radius = task.denoising_radius;
nlm_k_2 = powf(2.0f, lerp(-5.0f, 3.0f, task.denoising_strength));
if(task.denoising_relative_pca) {
pca_threshold = -powf(10.0f, lerp(-8.0f, 0.0f, task.denoising_feature_strength));
}
else {
pca_threshold = powf(10.0f, lerp(-5.0f, 3.0f, task.denoising_feature_strength));
}
tile_info = (TileInfo*) tile_info_mem.alloc(sizeof(TileInfo)/sizeof(int));
render_buffer.pass_stride = task.pass_stride;
render_buffer.denoising_data_offset = task.pass_denoising_data;
render_buffer.denoising_clean_offset = task.pass_denoising_clean;
for(int i = 0; i < 9; i++) {
tile_info->offsets[i] = rtiles[i].offset;
tile_info->strides[i] = rtiles[i].stride;
tile_info->buffers[i] = rtiles[i].buffer;
}
tile_info->x[0] = rtiles[3].x;
tile_info->x[1] = rtiles[4].x;
tile_info->x[2] = rtiles[5].x;
tile_info->x[3] = rtiles[5].x + rtiles[5].w;
tile_info->y[0] = rtiles[1].y;
tile_info->y[1] = rtiles[4].y;
tile_info->y[2] = rtiles[7].y;
tile_info->y[3] = rtiles[7].y + rtiles[7].h;
target_buffer.offset = rtiles[9].offset;
target_buffer.stride = rtiles[9].stride;
target_buffer.ptr = rtiles[9].buffer;
tile_info_mem.copy_to_device();
}
void DenoisingTask::setup_denoising_buffer()
{
/* Expand filter_area by radius pixels and clamp the result to the extent of the neighboring tiles */
rect = rect_from_shape(filter_area.x, filter_area.y, filter_area.z, filter_area.w);
rect = rect_expand(rect, radius);
rect = rect_clip(rect, make_int4(tiles->x[0], tiles->y[0], tiles->x[3], tiles->y[3]));
}
rect = rect_clip(rect, make_int4(tile_info->x[0], tile_info->y[0], tile_info->x[3], tile_info->y[3]));
void DenoisingTask::tiles_from_rendertiles(RenderTile *rtiles)
{
tiles = (TilesInfo*) tiles_mem.alloc(sizeof(TilesInfo)/sizeof(int));
device_ptr buffers[9];
for(int i = 0; i < 9; i++) {
buffers[i] = rtiles[i].buffer;
tiles->offsets[i] = rtiles[i].offset;
tiles->strides[i] = rtiles[i].stride;
}
tiles->x[0] = rtiles[3].x;
tiles->x[1] = rtiles[4].x;
tiles->x[2] = rtiles[5].x;
tiles->x[3] = rtiles[5].x + rtiles[5].w;
tiles->y[0] = rtiles[1].y;
tiles->y[1] = rtiles[4].y;
tiles->y[2] = rtiles[7].y;
tiles->y[3] = rtiles[7].y + rtiles[7].h;
render_buffer.offset = rtiles[4].offset;
render_buffer.stride = rtiles[4].stride;
render_buffer.ptr = rtiles[4].buffer;
functions.set_tiles(buffers);
}
bool DenoisingTask::run_denoising()
{
/* Allocate denoising buffer. */
buffer.passes = 14;
buffer.width = rect.z - rect.x;
buffer.stride = align_up(buffer.width, 4);
buffer.h = rect.w - rect.y;
buffer.pass_stride = align_up(buffer.stride * buffer.h, divide_up(device->mem_sub_ptr_alignment(), sizeof(float)));
buffer.mem.alloc_to_device(buffer.pass_stride * buffer.passes, false);
int alignment_floats = divide_up(device->mem_sub_ptr_alignment(), sizeof(float));
buffer.pass_stride = align_up(buffer.stride * buffer.h, alignment_floats);
/* Pad the total size by four floats since the SIMD kernels might go a bit over the end. */
int mem_size = align_up(buffer.pass_stride * buffer.passes + 4, alignment_floats);
buffer.mem.alloc_to_device(mem_size, false);
}
void DenoisingTask::prefilter_shadowing()
{
device_ptr null_ptr = (device_ptr) 0;
/* Prefilter shadow feature. */
{
device_sub_ptr unfiltered_a (buffer.mem, 0, buffer.pass_stride);
device_sub_ptr unfiltered_b (buffer.mem, 1*buffer.pass_stride, buffer.pass_stride);
device_sub_ptr sample_var (buffer.mem, 2*buffer.pass_stride, buffer.pass_stride);
device_sub_ptr sample_var_var (buffer.mem, 3*buffer.pass_stride, buffer.pass_stride);
device_sub_ptr buffer_var (buffer.mem, 5*buffer.pass_stride, buffer.pass_stride);
device_sub_ptr filtered_var (buffer.mem, 6*buffer.pass_stride, buffer.pass_stride);
device_sub_ptr nlm_temporary_1(buffer.mem, 7*buffer.pass_stride, buffer.pass_stride);
device_sub_ptr nlm_temporary_2(buffer.mem, 8*buffer.pass_stride, buffer.pass_stride);
device_sub_ptr nlm_temporary_3(buffer.mem, 9*buffer.pass_stride, buffer.pass_stride);
device_sub_ptr unfiltered_a (buffer.mem, 0, buffer.pass_stride);
device_sub_ptr unfiltered_b (buffer.mem, 1*buffer.pass_stride, buffer.pass_stride);
device_sub_ptr sample_var (buffer.mem, 2*buffer.pass_stride, buffer.pass_stride);
device_sub_ptr sample_var_var (buffer.mem, 3*buffer.pass_stride, buffer.pass_stride);
device_sub_ptr buffer_var (buffer.mem, 5*buffer.pass_stride, buffer.pass_stride);
device_sub_ptr filtered_var (buffer.mem, 6*buffer.pass_stride, buffer.pass_stride);
device_sub_ptr nlm_temporary_1(buffer.mem, 7*buffer.pass_stride, buffer.pass_stride);
device_sub_ptr nlm_temporary_2(buffer.mem, 8*buffer.pass_stride, buffer.pass_stride);
device_sub_ptr nlm_temporary_3(buffer.mem, 9*buffer.pass_stride, buffer.pass_stride);
nlm_state.temporary_1_ptr = *nlm_temporary_1;
nlm_state.temporary_2_ptr = *nlm_temporary_2;
nlm_state.temporary_3_ptr = *nlm_temporary_3;
nlm_state.temporary_1_ptr = *nlm_temporary_1;
nlm_state.temporary_2_ptr = *nlm_temporary_2;
nlm_state.temporary_3_ptr = *nlm_temporary_3;
/* Get the A/B unfiltered passes, the combined sample variance, the estimated variance of the sample variance and the buffer variance. */
functions.divide_shadow(*unfiltered_a, *unfiltered_b, *sample_var, *sample_var_var, *buffer_var);
/* Get the A/B unfiltered passes, the combined sample variance, the estimated variance of the sample variance and the buffer variance. */
functions.divide_shadow(*unfiltered_a, *unfiltered_b, *sample_var, *sample_var_var, *buffer_var);
/* Smooth the (generally pretty noisy) buffer variance using the spatial information from the sample variance. */
nlm_state.set_parameters(6, 3, 4.0f, 1.0f);
functions.non_local_means(*buffer_var, *sample_var, *sample_var_var, *filtered_var);
/* Smooth the (generally pretty noisy) buffer variance using the spatial information from the sample variance. */
nlm_state.set_parameters(6, 3, 4.0f, 1.0f);
functions.non_local_means(*buffer_var, *sample_var, *sample_var_var, *filtered_var);
/* Reuse memory, the previous data isn't needed anymore. */
device_ptr filtered_a = *buffer_var,
filtered_b = *sample_var;
/* Use the smoothed variance to filter the two shadow half images using each other for weight calculation. */
nlm_state.set_parameters(5, 3, 1.0f, 0.25f);
functions.non_local_means(*unfiltered_a, *unfiltered_b, *filtered_var, filtered_a);
functions.non_local_means(*unfiltered_b, *unfiltered_a, *filtered_var, filtered_b);
/* Reuse memory, the previous data isn't needed anymore. */
device_ptr filtered_a = *buffer_var,
filtered_b = *sample_var;
/* Use the smoothed variance to filter the two shadow half images using each other for weight calculation. */
nlm_state.set_parameters(5, 3, 1.0f, 0.25f);
functions.non_local_means(*unfiltered_a, *unfiltered_b, *filtered_var, filtered_a);
functions.non_local_means(*unfiltered_b, *unfiltered_a, *filtered_var, filtered_b);
device_ptr residual_var = *sample_var_var;
/* Estimate the residual variance between the two filtered halves. */
functions.combine_halves(filtered_a, filtered_b, null_ptr, residual_var, 2, rect);
device_ptr residual_var = *sample_var_var;
/* Estimate the residual variance between the two filtered halves. */
functions.combine_halves(filtered_a, filtered_b, null_ptr, residual_var, 2, rect);
device_ptr final_a = *unfiltered_a,
final_b = *unfiltered_b;
/* Use the residual variance for a second filter pass. */
nlm_state.set_parameters(4, 2, 1.0f, 0.5f);
functions.non_local_means(filtered_a, filtered_b, residual_var, final_a);
functions.non_local_means(filtered_b, filtered_a, residual_var, final_b);
device_ptr final_a = *unfiltered_a,
final_b = *unfiltered_b;
/* Use the residual variance for a second filter pass. */
nlm_state.set_parameters(4, 2, 1.0f, 0.5f);
functions.non_local_means(filtered_a, filtered_b, residual_var, final_a);
functions.non_local_means(filtered_b, filtered_a, residual_var, final_b);
/* Combine the two double-filtered halves to a final shadow feature. */
device_sub_ptr shadow_pass(buffer.mem, 4*buffer.pass_stride, buffer.pass_stride);
functions.combine_halves(final_a, final_b, *shadow_pass, null_ptr, 0, rect);
/* Combine the two double-filtered halves to a final shadow feature. */
device_sub_ptr shadow_pass(buffer.mem, 4*buffer.pass_stride, buffer.pass_stride);
functions.combine_halves(final_a, final_b, *shadow_pass, null_ptr, 0, rect);
}
void DenoisingTask::prefilter_features()
{
device_sub_ptr unfiltered (buffer.mem, 8*buffer.pass_stride, buffer.pass_stride);
device_sub_ptr variance (buffer.mem, 9*buffer.pass_stride, buffer.pass_stride);
device_sub_ptr nlm_temporary_1(buffer.mem, 10*buffer.pass_stride, buffer.pass_stride);
device_sub_ptr nlm_temporary_2(buffer.mem, 11*buffer.pass_stride, buffer.pass_stride);
device_sub_ptr nlm_temporary_3(buffer.mem, 12*buffer.pass_stride, buffer.pass_stride);
nlm_state.temporary_1_ptr = *nlm_temporary_1;
nlm_state.temporary_2_ptr = *nlm_temporary_2;
nlm_state.temporary_3_ptr = *nlm_temporary_3;
int mean_from[] = { 0, 1, 2, 12, 6, 7, 8 };
int variance_from[] = { 3, 4, 5, 13, 9, 10, 11};
int pass_to[] = { 1, 2, 3, 0, 5, 6, 7};
for(int pass = 0; pass < 7; pass++) {
device_sub_ptr feature_pass(buffer.mem, pass_to[pass]*buffer.pass_stride, buffer.pass_stride);
/* Get the unfiltered pass and its variance from the RenderBuffers. */
functions.get_feature(mean_from[pass], variance_from[pass], *unfiltered, *variance);
/* Smooth the pass and store the result in the denoising buffers. */
nlm_state.set_parameters(2, 2, 1.0f, 0.25f);
functions.non_local_means(*unfiltered, *unfiltered, *variance, *feature_pass);
}
}
void DenoisingTask::prefilter_color()
{
int mean_from[] = {20, 21, 22};
int variance_from[] = {23, 24, 25};
int mean_to[] = { 8, 9, 10};
int variance_to[] = {11, 12, 13};
int num_color_passes = 3;
storage.temporary_color.alloc_to_device(3*buffer.pass_stride, false);
device_sub_ptr nlm_temporary_1(storage.temporary_color, 0*buffer.pass_stride, buffer.pass_stride);
device_sub_ptr nlm_temporary_2(storage.temporary_color, 1*buffer.pass_stride, buffer.pass_stride);
device_sub_ptr nlm_temporary_3(storage.temporary_color, 2*buffer.pass_stride, buffer.pass_stride);
nlm_state.temporary_1_ptr = *nlm_temporary_1;
nlm_state.temporary_2_ptr = *nlm_temporary_2;
nlm_state.temporary_3_ptr = *nlm_temporary_3;
for(int pass = 0; pass < num_color_passes; pass++) {
device_sub_ptr color_pass(storage.temporary_color, pass*buffer.pass_stride, buffer.pass_stride);
device_sub_ptr color_var_pass(buffer.mem, variance_to[pass]*buffer.pass_stride, buffer.pass_stride);
functions.get_feature(mean_from[pass], variance_from[pass], *color_pass, *color_var_pass);
}
/* Prefilter general features. */
{
device_sub_ptr unfiltered (buffer.mem, 8*buffer.pass_stride, buffer.pass_stride);
device_sub_ptr variance (buffer.mem, 9*buffer.pass_stride, buffer.pass_stride);
device_sub_ptr nlm_temporary_1(buffer.mem, 10*buffer.pass_stride, buffer.pass_stride);
device_sub_ptr nlm_temporary_2(buffer.mem, 11*buffer.pass_stride, buffer.pass_stride);
device_sub_ptr nlm_temporary_3(buffer.mem, 12*buffer.pass_stride, buffer.pass_stride);
device_sub_ptr depth_pass (buffer.mem, 0, buffer.pass_stride);
device_sub_ptr color_var_pass(buffer.mem, variance_to[0]*buffer.pass_stride, 3*buffer.pass_stride);
device_sub_ptr output_pass (buffer.mem, mean_to[0]*buffer.pass_stride, 3*buffer.pass_stride);
functions.detect_outliers(storage.temporary_color.device_pointer, *color_var_pass, *depth_pass, *output_pass);
nlm_state.temporary_1_ptr = *nlm_temporary_1;
nlm_state.temporary_2_ptr = *nlm_temporary_2;
nlm_state.temporary_3_ptr = *nlm_temporary_3;
int mean_from[] = { 0, 1, 2, 12, 6, 7, 8 };
int variance_from[] = { 3, 4, 5, 13, 9, 10, 11};
int pass_to[] = { 1, 2, 3, 0, 5, 6, 7};
for(int pass = 0; pass < 7; pass++) {
device_sub_ptr feature_pass(buffer.mem, pass_to[pass]*buffer.pass_stride, buffer.pass_stride);
/* Get the unfiltered pass and its variance from the RenderBuffers. */
functions.get_feature(mean_from[pass], variance_from[pass], *unfiltered, *variance);
/* Smooth the pass and store the result in the denoising buffers. */
nlm_state.set_parameters(2, 2, 1.0f, 0.25f);
functions.non_local_means(*unfiltered, *unfiltered, *variance, *feature_pass);
}
}
/* Copy color passes. */
{
int mean_from[] = {20, 21, 22};
int variance_from[] = {23, 24, 25};
int mean_to[] = { 8, 9, 10};
int variance_to[] = {11, 12, 13};
int num_color_passes = 3;
storage.temporary_color.alloc_to_device(3*buffer.pass_stride, false);
for(int pass = 0; pass < num_color_passes; pass++) {
device_sub_ptr color_pass(storage.temporary_color, pass*buffer.pass_stride, buffer.pass_stride);
device_sub_ptr color_var_pass(buffer.mem, variance_to[pass]*buffer.pass_stride, buffer.pass_stride);
functions.get_feature(mean_from[pass], variance_from[pass], *color_pass, *color_var_pass);
}
{
device_sub_ptr depth_pass (buffer.mem, 0, buffer.pass_stride);
device_sub_ptr color_var_pass(buffer.mem, variance_to[0]*buffer.pass_stride, 3*buffer.pass_stride);
device_sub_ptr output_pass (buffer.mem, mean_to[0]*buffer.pass_stride, 3*buffer.pass_stride);
functions.detect_outliers(storage.temporary_color.device_pointer, *color_var_pass, *depth_pass, *output_pass);
}
}
storage.temporary_color.free();
}
void DenoisingTask::construct_transform()
{
storage.w = filter_area.z;
storage.h = filter_area.w;
storage.transform.alloc_to_device(storage.w*storage.h*TRANSFORM_SIZE, false);
storage.rank.alloc_to_device(storage.w*storage.h, false);
functions.construct_transform();
}
void DenoisingTask::reconstruct()
{
device_only_memory<float> temporary_1(device, "Denoising NLM temporary 1");
device_only_memory<float> temporary_2(device, "Denoising NLM temporary 2");
@@ -214,21 +231,36 @@ bool DenoisingTask::run_denoising()
storage.XtWY.alloc_to_device(storage.w*storage.h*XTWY_SIZE, false);
reconstruction_state.filter_window = rect_from_shape(filter_area.x-rect.x, filter_area.y-rect.y, storage.w, storage.h);
int tile_coordinate_offset = filter_area.y*render_buffer.stride + filter_area.x;
reconstruction_state.buffer_params = make_int4(render_buffer.offset + tile_coordinate_offset,
render_buffer.stride,
render_buffer.pass_stride,
render_buffer.denoising_clean_offset);
int tile_coordinate_offset = filter_area.y*target_buffer.stride + filter_area.x;
reconstruction_state.buffer_params = make_int4(target_buffer.offset + tile_coordinate_offset,
target_buffer.stride,
target_buffer.pass_stride,
target_buffer.denoising_clean_offset);
reconstruction_state.source_w = rect.z-rect.x;
reconstruction_state.source_h = rect.w-rect.y;
{
device_sub_ptr color_ptr (buffer.mem, 8*buffer.pass_stride, 3*buffer.pass_stride);
device_sub_ptr color_var_ptr(buffer.mem, 11*buffer.pass_stride, 3*buffer.pass_stride);
functions.reconstruct(*color_ptr, *color_var_ptr, render_buffer.ptr);
}
device_sub_ptr color_ptr (buffer.mem, 8*buffer.pass_stride, 3*buffer.pass_stride);
device_sub_ptr color_var_ptr(buffer.mem, 11*buffer.pass_stride, 3*buffer.pass_stride);
functions.reconstruct(*color_ptr, *color_var_ptr, target_buffer.ptr);
}
return true;
void DenoisingTask::run_denoising(RenderTile *tile)
{
RenderTile rtiles[10];
rtiles[4] = *tile;
functions.map_neighbor_tiles(rtiles);
set_render_buffer(rtiles);
setup_denoising_buffer();
prefilter_shadowing();
prefilter_features();
prefilter_color();
construct_transform();
reconstruct();
functions.unmap_neighbor_tiles(rtiles);
}
CCL_NAMESPACE_END

View File

@@ -32,20 +32,24 @@ public:
float nlm_k_2;
float pca_threshold;
/* Pointer and parameters of the RenderBuffers. */
/* Parameters of the RenderBuffers. */
struct RenderBuffers {
int denoising_data_offset;
int denoising_clean_offset;
int pass_stride;
int offset;
int stride;
device_ptr ptr;
int pass_stride;
int samples;
} render_buffer;
TilesInfo *tiles;
device_vector<int> tiles_mem;
void tiles_from_rendertiles(RenderTile *rtiles);
/* Pointer and parameters of the target buffer. */
struct TargetBuffer {
int offset;
int stride;
int pass_stride;
int denoising_clean_offset;
device_ptr ptr;
} target_buffer;
TileInfo *tile_info;
device_vector<int> tile_info_mem;
int4 rect;
int4 filter_area;
@@ -85,7 +89,8 @@ public:
device_ptr depth_ptr,
device_ptr output_ptr
)> detect_outliers;
function<bool(device_ptr*)> set_tiles;
function<void(RenderTile *rtiles)> map_neighbor_tiles;
function<void(RenderTile *rtiles)> unmap_neighbor_tiles;
} functions;
/* Stores state of the current Reconstruction operation,
@@ -138,12 +143,10 @@ public:
{}
} storage;
DenoisingTask(Device *device);
DenoisingTask(Device *device, const DeviceTask &task);
~DenoisingTask();
void init_from_devicetask(const DeviceTask &task);
bool run_denoising();
void run_denoising(RenderTile *tile);
struct DenoiseBuffers {
int pass_stride;
@@ -160,6 +163,14 @@ public:
protected:
Device *device;
void set_render_buffer(RenderTile *rtiles);
void setup_denoising_buffer();
void prefilter_shadowing();
void prefilter_features();
void prefilter_color();
void construct_transform();
void reconstruct();
};
CCL_NAMESPACE_END

View File

@@ -41,4 +41,3 @@ string device_cuda_capabilities(void);
CCL_NAMESPACE_END
#endif /* __DEVICE_INTERN_H__ */

View File

@@ -104,6 +104,26 @@ void device_memory::device_zero()
}
}
void device_memory::swap_device(Device *new_device,
size_t new_device_size,
device_ptr new_device_ptr)
{
original_device = device;
original_device_size = device_size;
original_device_ptr = device_pointer;
device = new_device;
device_size = new_device_size;
device_pointer = new_device_ptr;
}
void device_memory::restore_device()
{
device = original_device;
device_size = original_device_size;
device_pointer = original_device_ptr;
}
/* Device Sub Ptr */
device_sub_ptr::device_sub_ptr(device_memory& mem, int offset, int size)
@@ -118,4 +138,3 @@ device_sub_ptr::~device_sub_ptr()
}
CCL_NAMESPACE_END

View File

@@ -43,6 +43,7 @@ enum MemoryType {
enum DataType {
TYPE_UNKNOWN,
TYPE_UCHAR,
TYPE_UINT16,
TYPE_UINT,
TYPE_INT,
TYPE_FLOAT,
@@ -50,13 +51,14 @@ enum DataType {
TYPE_UINT64,
};
static inline size_t datatype_size(DataType datatype)
static inline size_t datatype_size(DataType datatype)
{
switch(datatype) {
case TYPE_UNKNOWN: return 1;
case TYPE_UCHAR: return sizeof(uchar);
case TYPE_FLOAT: return sizeof(float);
case TYPE_UINT: return sizeof(uint);
case TYPE_UINT16: return sizeof(uint16_t);
case TYPE_INT: return sizeof(int);
case TYPE_HALF: return sizeof(half);
case TYPE_UINT64: return sizeof(uint64_t);
@@ -156,6 +158,16 @@ template<> struct device_type_traits<half> {
static const int num_elements = 1;
};
template<> struct device_type_traits<ushort4> {
static const DataType data_type = TYPE_UINT16;
static const int num_elements = 4;
};
template<> struct device_type_traits<uint16_t> {
static const DataType data_type = TYPE_UINT16;
static const int num_elements = 1;
};
template<> struct device_type_traits<half4> {
static const DataType data_type = TYPE_HALF;
static const int num_elements = 4;
@@ -200,6 +212,9 @@ public:
virtual ~device_memory();
void swap_device(Device *new_device, size_t new_device_size, device_ptr new_device_ptr);
void restore_device();
protected:
friend class CUDADevice;
@@ -222,6 +237,10 @@ protected:
void device_copy_to();
void device_copy_from(int y, int w, int h, int elem);
void device_zero();
device_ptr original_device_ptr;
size_t original_device_size;
Device *original_device;
};
/* Device Only Memory
@@ -478,4 +497,3 @@ protected:
CCL_NAMESPACE_END
#endif /* __DEVICE_MEMORY_H__ */

View File

@@ -285,26 +285,27 @@ public:
mem.copy_from_device(0, mem.data_size, 1);
}
Device *original_device = mem.device;
device_ptr original_ptr = mem.device_pointer;
size_t original_size = mem.device_size;
mem.device = sub_device;
mem.device_pointer = 0;
mem.device_size = 0;
mem.swap_device(sub_device, 0, 0);
mem.copy_to_device();
tiles[i].buffer = mem.device_pointer;
tiles[i].device_size = mem.device_size;
mem.device = original_device;
mem.device_pointer = original_ptr;
mem.device_size = original_size;
mem.restore_device();
}
}
}
void unmap_neighbor_tiles(Device * sub_device, RenderTile * tiles)
{
/* Copy denoised result back to the host. */
device_vector<float> &mem = tiles[9].buffers->buffer;
mem.swap_device(sub_device, tiles[9].device_size, tiles[9].buffer);
mem.copy_from_device(0, mem.data_size, 1);
mem.restore_device();
/* Copy denoised result to the original device. */
mem.copy_to_device();
for(int i = 0; i < 9; i++) {
if(!tiles[i].buffers) {
continue;
@@ -312,28 +313,9 @@ public:
device_vector<float> &mem = tiles[i].buffers->buffer;
if(mem.device != sub_device) {
Device *original_device = mem.device;
device_ptr original_ptr = mem.device_pointer;
size_t original_size = mem.device_size;
mem.device = sub_device;
mem.device_pointer = tiles[i].buffer;
/* Copy denoised tile to the host. */
if(i == 4) {
mem.copy_from_device(0, mem.data_size, 1);
}
mem.swap_device(sub_device, tiles[i].device_size, tiles[i].buffer);
sub_device->mem_free(mem);
mem.device = original_device;
mem.device_pointer = original_ptr;
mem.device_size = original_size;
/* Copy denoised tile to the original device. */
if(i == 4) {
mem.copy_to_device();
}
mem.restore_device();
}
}
}
@@ -397,4 +379,3 @@ Device *device_multi_create(DeviceInfo& info, Stats &stats, bool background)
}
CCL_NAMESPACE_END

View File

@@ -797,5 +797,3 @@ void Device::server_run()
CCL_NAMESPACE_END
#endif

View File

@@ -179,7 +179,7 @@ public:
boost::asio::write(socket,
boost::asio::buffer(archive_str),
boost::asio::transfer_all(), error);
if(error.value())
error_func->network_error(error.message());
@@ -193,7 +193,7 @@ public:
boost::asio::write(socket,
boost::asio::buffer(buffer, size),
boost::asio::transfer_all(), error);
if(error.value())
error_func->network_error(error.message());
}
@@ -467,7 +467,7 @@ private:
/* buffer and endpoint for receiving messages */
char receive_buffer[256];
boost::asio::ip::udp::endpoint receive_endpoint;
// os, version, devices, status, host name, group name, ip as far as fields go
struct ServerInfo {
string cycles_version;
@@ -489,4 +489,3 @@ CCL_NAMESPACE_END
#endif
#endif /* __DEVICE_NETWORK_H__ */

View File

@@ -137,6 +137,10 @@ void device_opencl_info(vector<DeviceInfo>& devices)
info.has_volume_decoupled = false;
info.bvh_layout_mask = BVH_LAYOUT_BVH2;
info.id = id;
/* Check OpenCL extensions */
info.has_half_images = platform_device.device_extensions.find("cl_khr_fp16") != string::npos;
devices.push_back(info);
num_devices++;
}

View File

@@ -261,7 +261,7 @@ bool DeviceSplitKernel::path_trace(DeviceTask *task,
ENQUEUE_SPLIT_KERNEL(buffer_update, global_size, local_size);
if(task->get_cancel() && cancel_time == DBL_MAX) {
/* Wait up to twice as many seconds for current samples to finish
/* Wait up to twice as many seconds for current samples to finish
* to avoid artifacts in render result from ending too soon.
*/
cancel_time = time_dt() + 2.0 * time_multiplier;
@@ -322,5 +322,3 @@ bool DeviceSplitKernel::path_trace(DeviceTask *task,
}
CCL_NAMESPACE_END

View File

@@ -131,6 +131,3 @@ public:
CCL_NAMESPACE_END
#endif /* __DEVICE_SPLIT_KERNEL_H__ */

View File

@@ -126,4 +126,3 @@ void DeviceTask::update_progress(RenderTile *rtile, int pixel_samples)
}
CCL_NAMESPACE_END

View File

@@ -86,4 +86,3 @@ protected:
CCL_NAMESPACE_END
#endif /* __DEVICE_TASK_H__ */

View File

@@ -254,4 +254,3 @@ void MemoryManager::set_kernel_arg_buffers(cl_kernel kernel, cl_uint *narg)
CCL_NAMESPACE_END
#endif /* WITH_OPENCL */

View File

@@ -104,4 +104,3 @@ public:
};
CCL_NAMESPACE_END

View File

@@ -59,19 +59,22 @@ struct OpenCLPlatformDevice {
cl_device_id device_id,
cl_device_type device_type,
const string& device_name,
const string& hardware_id)
const string& hardware_id,
const string& device_extensions)
: platform_id(platform_id),
platform_name(platform_name),
device_id(device_id),
device_type(device_type),
device_name(device_name),
hardware_id(hardware_id) {}
hardware_id(hardware_id),
device_extensions(device_extensions) {}
cl_platform_id platform_id;
string platform_name;
cl_device_id device_id;
cl_device_type device_type;
string device_name;
string hardware_id;
string device_extensions;
};
/* Contains all static OpenCL helper functions. */
@@ -130,6 +133,12 @@ public:
static string get_device_name(cl_device_id device_id);
static bool get_device_extensions(cl_device_id device_id,
string *device_extensions,
cl_int* error = NULL);
static string get_device_extensions(cl_device_id device_id);
static bool get_device_type(cl_device_id device_id,
cl_device_type *device_type,
cl_int* error = NULL);
@@ -362,7 +371,7 @@ public:
void film_convert(DeviceTask& task, device_ptr buffer, device_ptr rgba_byte, device_ptr rgba_half);
void shader(DeviceTask& task);
void denoise(RenderTile& tile, DenoisingTask& denoising, const DeviceTask& task);
void denoise(RenderTile& tile, DenoisingTask& denoising);
class OpenCLDeviceTask : public DeviceTask {
public:
@@ -436,8 +445,6 @@ protected:
device_ptr depth_ptr,
device_ptr output_ptr,
DenoisingTask *task);
bool denoising_set_tiles(device_ptr *buffers,
DenoisingTask *task);
device_ptr mem_alloc_sub_ptr(device_memory& mem, int offset, int size);
void mem_free_sub_ptr(device_ptr ptr);

View File

@@ -246,7 +246,6 @@ bool OpenCLDeviceBase::load_kernels(const DeviceRequestedFeatures& requested_fea
denoising_program.add_kernel(ustring("filter_nlm_normalize"));
denoising_program.add_kernel(ustring("filter_nlm_construct_gramian"));
denoising_program.add_kernel(ustring("filter_finalize"));
denoising_program.add_kernel(ustring("filter_set_tiles"));
vector<OpenCLProgram*> programs;
programs.push_back(&base_program);
@@ -977,13 +976,20 @@ bool OpenCLDeviceBase::denoising_divide_shadow(device_ptr a_ptr,
cl_mem sv_variance_mem = CL_MEM_PTR(sv_variance_ptr);
cl_mem buffer_variance_mem = CL_MEM_PTR(buffer_variance_ptr);
cl_mem tiles_mem = CL_MEM_PTR(task->tiles_mem.device_pointer);
cl_mem tile_info_mem = CL_MEM_PTR(task->tile_info_mem.device_pointer);
cl_kernel ckFilterDivideShadow = denoising_program(ustring("filter_divide_shadow"));
kernel_set_args(ckFilterDivideShadow, 0,
task->render_buffer.samples,
tiles_mem,
int arg_ofs = kernel_set_args(ckFilterDivideShadow, 0,
task->render_buffer.samples,
tile_info_mem);
cl_mem buffers[9];
for(int i = 0; i < 9; i++) {
buffers[i] = CL_MEM_PTR(task->tile_info->buffers[i]);
arg_ofs += kernel_set_args(ckFilterDivideShadow, arg_ofs,
buffers[i]);
}
kernel_set_args(ckFilterDivideShadow, arg_ofs,
a_mem,
b_mem,
sample_variance_mem,
@@ -991,7 +997,7 @@ bool OpenCLDeviceBase::denoising_divide_shadow(device_ptr a_ptr,
buffer_variance_mem,
task->rect,
task->render_buffer.pass_stride,
task->render_buffer.denoising_data_offset);
task->render_buffer.offset);
enqueue_kernel(ckFilterDivideShadow,
task->rect.z-task->rect.x,
task->rect.w-task->rect.y);
@@ -1008,20 +1014,27 @@ bool OpenCLDeviceBase::denoising_get_feature(int mean_offset,
cl_mem mean_mem = CL_MEM_PTR(mean_ptr);
cl_mem variance_mem = CL_MEM_PTR(variance_ptr);
cl_mem tiles_mem = CL_MEM_PTR(task->tiles_mem.device_pointer);
cl_mem tile_info_mem = CL_MEM_PTR(task->tile_info_mem.device_pointer);
cl_kernel ckFilterGetFeature = denoising_program(ustring("filter_get_feature"));
kernel_set_args(ckFilterGetFeature, 0,
task->render_buffer.samples,
tiles_mem,
int arg_ofs = kernel_set_args(ckFilterGetFeature, 0,
task->render_buffer.samples,
tile_info_mem);
cl_mem buffers[9];
for(int i = 0; i < 9; i++) {
buffers[i] = CL_MEM_PTR(task->tile_info->buffers[i]);
arg_ofs += kernel_set_args(ckFilterGetFeature, arg_ofs,
buffers[i]);
}
kernel_set_args(ckFilterGetFeature, arg_ofs,
mean_offset,
variance_offset,
mean_mem,
variance_mem,
task->rect,
task->render_buffer.pass_stride,
task->render_buffer.denoising_data_offset);
task->render_buffer.offset);
enqueue_kernel(ckFilterGetFeature,
task->rect.z-task->rect.x,
task->rect.w-task->rect.y);
@@ -1056,29 +1069,8 @@ bool OpenCLDeviceBase::denoising_detect_outliers(device_ptr image_ptr,
return true;
}
bool OpenCLDeviceBase::denoising_set_tiles(device_ptr *buffers,
DenoisingTask *task)
void OpenCLDeviceBase::denoise(RenderTile &rtile, DenoisingTask& denoising)
{
task->tiles_mem.copy_to_device();
cl_mem tiles_mem = CL_MEM_PTR(task->tiles_mem.device_pointer);
cl_kernel ckFilterSetTiles = denoising_program(ustring("filter_set_tiles"));
kernel_set_args(ckFilterSetTiles, 0, tiles_mem);
for(int i = 0; i < 9; i++) {
cl_mem buffer_mem = CL_MEM_PTR(buffers[i]);
kernel_set_args(ckFilterSetTiles, i+1, buffer_mem);
}
enqueue_kernel(ckFilterSetTiles, 1, 1);
return true;
}
void OpenCLDeviceBase::denoise(RenderTile &rtile, DenoisingTask& denoising, const DeviceTask &task)
{
denoising.functions.set_tiles = function_bind(&OpenCLDeviceBase::denoising_set_tiles, this, _1, &denoising);
denoising.functions.construct_transform = function_bind(&OpenCLDeviceBase::denoising_construct_transform, this, &denoising);
denoising.functions.reconstruct = function_bind(&OpenCLDeviceBase::denoising_reconstruct, this, _1, _2, _3, &denoising);
denoising.functions.divide_shadow = function_bind(&OpenCLDeviceBase::denoising_divide_shadow, this, _1, _2, _3, _4, _5, &denoising);
@@ -1090,16 +1082,7 @@ void OpenCLDeviceBase::denoise(RenderTile &rtile, DenoisingTask& denoising, cons
denoising.filter_area = make_int4(rtile.x, rtile.y, rtile.w, rtile.h);
denoising.render_buffer.samples = rtile.sample;
RenderTile rtiles[9];
rtiles[4] = rtile;
task.map_neighbor_tiles(rtiles, this);
denoising.tiles_from_rendertiles(rtiles);
denoising.init_from_devicetask(task);
denoising.run_denoising();
task.unmap_neighbor_tiles(rtiles, this);
denoising.run_denoising(&rtile);
}
void OpenCLDeviceBase::shader(DeviceTask& task)

View File

@@ -107,7 +107,7 @@ public:
}
else if(task->type == DeviceTask::RENDER) {
RenderTile tile;
DenoisingTask denoising(this);
DenoisingTask denoising(this, *task);
/* Keep rendering tiles until done. */
while(task->acquire_tile(this, tile)) {
@@ -141,7 +141,7 @@ public:
}
else if(tile.task == RenderTile::DENOISE) {
tile.sample = tile.start_sample + tile.num_samples;
denoise(tile, denoising, *task);
denoise(tile, denoising);
task->update_progress(&tile, tile.w*tile.h);
}

View File

@@ -129,7 +129,7 @@ public:
}
else if(task->type == DeviceTask::RENDER) {
RenderTile tile;
DenoisingTask denoising(this);
DenoisingTask denoising(this, *task);
/* Allocate buffer for kernel globals */
device_only_memory<KernelGlobalsDummy> kgbuffer(this, "kernel_globals");
@@ -159,7 +159,7 @@ public:
}
else if(tile.task == RenderTile::DENOISE) {
tile.sample = tile.start_sample + tile.num_samples;
denoise(tile, denoising, *task);
denoise(tile, denoising);
task->update_progress(&tile, tile.w*tile.h);
}

View File

@@ -831,13 +831,15 @@ void OpenCLInfo::get_usable_devices(vector<OpenCLPlatformDevice> *usable_devices
FIRST_VLOG(2) << "Adding new device "
<< readable_device_name << ".";
string hardware_id = get_hardware_id(platform_name, device_id);
string device_extensions = get_device_extensions(device_id);
usable_devices->push_back(OpenCLPlatformDevice(
platform_id,
platform_name,
device_id,
device_type,
readable_device_name,
hardware_id));
hardware_id,
device_extensions));
}
else {
FIRST_VLOG(2) << "Ignoring device " << device_name
@@ -1047,6 +1049,40 @@ string OpenCLInfo::get_device_name(cl_device_id device_id)
return device_name;
}
bool OpenCLInfo::get_device_extensions(cl_device_id device_id,
string *device_extensions,
cl_int* error)
{
char buffer[1024];
cl_int err;
if((err = clGetDeviceInfo(device_id,
CL_DEVICE_EXTENSIONS,
sizeof(buffer),
&buffer,
NULL)) != CL_SUCCESS)
{
if(error != NULL) {
*error = err;
}
*device_extensions = "";
return false;
}
if(error != NULL) {
*error = CL_SUCCESS;
}
*device_extensions = buffer;
return true;
}
string OpenCLInfo::get_device_extensions(cl_device_id device_id)
{
string device_extensions;
if(!get_device_extensions(device_id, &device_extensions)) {
return "";
}
return device_extensions;
}
bool OpenCLInfo::get_device_type(cl_device_id device_id,
cl_device_type *device_type,
cl_int* error)

View File

@@ -200,4 +200,3 @@
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.

View File

@@ -13,7 +13,7 @@ met:
distribution.
* Neither the name of Industrial Light & Magic nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
@@ -26,4 +26,3 @@ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF 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.

View File

@@ -33,4 +33,3 @@ 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.

View File

@@ -25,4 +25,3 @@ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF 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.

View File

@@ -26,4 +26,3 @@ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF 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.

View File

@@ -13,4 +13,3 @@ MIT license
Boost License
* Boost and OpenCL dynamic loading

View File

@@ -20,4 +20,3 @@ include_directories(${INC})
include_directories(SYSTEM ${INC_SYS})
cycles_add_library(cycles_graph ${SRC} ${SRC_HEADERS})

View File

@@ -496,4 +496,3 @@ void Node::hash(MD5Hash& md5)
}
CCL_NAMESPACE_END

View File

@@ -97,4 +97,3 @@ struct Node
};
CCL_NAMESPACE_END

View File

@@ -45,4 +45,3 @@ private:
};
CCL_NAMESPACE_END

View File

@@ -217,4 +217,3 @@ const NodeType *NodeType::find(ustring name)
}
CCL_NAMESPACE_END

View File

@@ -263,4 +263,3 @@ const NodeType *structname::register_type()
{ type->register_output(ustring(#name), ustring(ui_name), SocketType::ENUM); }
CCL_NAMESPACE_END

View File

@@ -458,4 +458,3 @@ xml_node xml_write_node(Node *node, xml_node xml_root)
}
CCL_NAMESPACE_END

View File

@@ -32,4 +32,3 @@ void xml_read_node(XMLReader& reader, Node *node, xml_node xml_node);
xml_node xml_write_node(Node *node, xml_node xml_root);
CCL_NAMESPACE_END

View File

@@ -287,6 +287,7 @@ set(SRC_UTIL_HEADERS
../util/util_types_uint3_impl.h
../util/util_types_uint4.h
../util/util_types_uint4_impl.h
../util/util_types_ushort4.h
../util/util_types_vector3.h
../util/util_types_vector3_impl.h
)
@@ -520,4 +521,3 @@ delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_SVM_HEADERS}" ${CYCLES_INSTAL
delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_GEOM_HEADERS}" ${CYCLES_INSTALL_PATH}/source/kernel/geom)
delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_UTIL_HEADERS}" ${CYCLES_INSTALL_PATH}/source/util)
delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_SPLIT_HEADERS}" ${CYCLES_INSTALL_PATH}/source/kernel/split)

View File

@@ -486,4 +486,3 @@ ccl_device bool bsdf_merge(ShaderClosure *a, ShaderClosure *b)
}
CCL_NAMESPACE_END

View File

@@ -117,7 +117,7 @@ ccl_device_forceinline float3 bsdf_ashikhmin_shirley_eval_reflect(
lobe = 1.0f;
}
float norm = sqrtf((n_x + 1.0f)*(n_y + 1.0f)) / (8.0f * M_PI_F);
out = NdotO * norm * lobe * pump;
*pdf = norm * lobe / HdotI;
}

View File

@@ -5,7 +5,7 @@
* All Rights Reserved.
*
* Modifications Copyright 2011, Blender Foundation.
*
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
@@ -46,7 +46,7 @@ ccl_device int bsdf_ashikhmin_velvet_setup(VelvetBsdf *bsdf)
{
float sigma = fmaxf(bsdf->sigma, 0.01f);
bsdf->invsigma2 = 1.0f/(sigma * sigma);
bsdf->type = CLOSURE_BSDF_ASHIKHMIN_VELVET_ID;
return SD_BSDF|SD_BSDF_HAS_EVAL;
@@ -159,4 +159,3 @@ ccl_device int bsdf_ashikhmin_velvet_sample(const ShaderClosure *sc, float3 Ng,
CCL_NAMESPACE_END
#endif /* __BSDF_ASHIKHMIN_VELVET_H__ */

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