Compare commits

...

555 Commits

Author SHA1 Message Date
8ae25e307e Merge branch 'blender2.8' into ui_layout_gridflow 2018-06-09 16:55:06 +02:00
ec8a20fec0 Add new GridFlow layout.
This mimics the 'spreadsheet' behavior. Columns and/or rows can have
equal sizes, or adapt to their content - but always in a grid way (i.e.
all items in a same column will always have same available width, and
all items in a same row will always have same available height).
Also, you can fill (order) the grid in a row- or column-major way.

Not used anywhere for now.

Differential: https://developer.blender.org/D2395
2018-06-09 16:54:26 +02:00
5159ce640f Cleanup: style 2018-06-09 16:39:40 +02:00
4319e9499e Some more tweaks and cleanup. 2018-06-09 16:38:20 +02:00
5979ea96a5 Deduplicate some code, new solution to the fixed-estimated-size problem.
New GridFlow code was duplicating most of already existing func to
handle passing layout settings from parent to new child, fixed.

Also, added new 'variable' flag to uiLayout, set for GridFlow and all
its children, that enforce items to always estimate their real ideal
size, and not some arbitrary large fixed value.
2018-06-09 16:17:02 +02:00
2b83d81f68 Merge branch 'blender2.8' into ui_layout_gridflow 2018-06-09 15:36:37 +02:00
70f8eaf1b7 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/editors/space_view3d/drawobject.c
2018-06-09 15:18:21 +02:00
638de72277 Cleanup: remove some G.main usages. 2018-06-09 15:17:04 +02:00
2ca8230f67 Merge branch 'master' into blender2.8 2018-06-09 14:43:01 +02:00
fb565ddb68 Cleanup: trailing space in RNA 2018-06-09 14:40:09 +02:00
56a47e58f4 Cleanup: style 2018-06-09 14:30:32 +02:00
09ce794dc8 UI: initial support for parent panels in popovers
Currently this just includes the panels, no support for collapsing yet.
2018-06-09 14:21:39 +02:00
8f40af6dcd RNA: revert object mode re-order
This was done so numbered shortcuts made sense.
Now order matches master.
2018-06-09 12:57:15 +02:00
964c5421df Merge branch 'master' into blender2.8 2018-06-09 12:56:37 +02:00
9bcced83ee GHOST/X11: Print the keycode w/ debug enabled 2018-06-09 12:53:39 +02:00
3bbef95747 Workbench: Fix xray normal not being normalized. 2018-06-09 12:44:56 +02:00
337aab59e9 Workbench: Matcaps: Fix matcap under perspective.
This fixes the problem that matcaps have when using a very larg FOV in
perspective view.

This was because it was stupidly using the normal direction which can not
aligned with the view vector under perspective.

So to workaround this problem we don't use the normal as is, but compute
how much it's facing the camera.

This changes how matcaps looks in perspective because they now always use
the full range of the matcap (which is expected).
2018-06-09 12:44:56 +02:00
a1b42b79b3 Workbench: Fix incident vector calculation.
This fixes specular in perspective view.
2018-06-09 12:44:56 +02:00
7ce81484f8 Merge branch 'master' into blender2.8 2018-06-09 12:06:33 +02:00
6f4c7f1f01 GHOST/X11: Correct non-latin kb workaround case
Harmless since this is always enabled,
only do this for easier troubleshooting when disabling the define.
2018-06-09 12:04:07 +02:00
b492a0e767 Merge branch 'master' into blender2.8 2018-06-09 11:27:22 +02:00
f3427cbc98 GHOST/X11: support accessing physical keycodes
This means we can check keys such as tilde in a generic way.
2018-06-09 11:23:41 +02:00
03f0ecca93 GHOST/X11: Map unknown us.intl key to accentgrave 2018-06-09 09:10:04 +02:00
86660aa294 Layout for materials closer to single column 2018-06-08 23:56:39 +02:00
dd2e187344 Audaspace: add support for latest ffmpeg. 2018-06-08 23:11:16 +02:00
528dc6440b Merge branch 'master' into blender2.8 2018-06-08 22:19:39 +02:00
5165d62931 WM: correct recent change to click/drag detection
fb1915d870 - caused click/drag events not to be detected.

Now check a key is a mouse or keyboard event.
2018-06-08 22:17:21 +02:00
d1ab958fd4 Merge branch 'master' into 28 2018-06-08 19:03:37 +02:00
4f2eac3b39 WM: fix panel drag event handling 2018-06-08 19:03:29 +02:00
bf77efb684 WM: fix node link & background drag 2018-06-08 19:03:29 +02:00
1857823839 WM: fix panel drag event handling 2018-06-08 18:58:41 +02:00
2dc7555522 WM: fix node link & background drag 2018-06-08 18:55:47 +02:00
Dalai Felinto
f8d7df6f16 Depsgraph: Remove no longer needed nodetree values copying on eval
Note: Depsgraph still calls the nodetree eval function that doesn't
nothing in turn. We can remove it, but it is harmless though.
2018-06-08 17:52:49 +02:00
f2fd5987d0 UI: clear properties color when empty 2018-06-08 17:30:00 +02:00
3e86bb2d0b Sculpt/Paint: move PBVH building to use evaluated mesh instead of deprecated Derivedmesh.
Pretty straightforward changes, merely mimicking dm-related code,
which was already essentially using either Mesh or BMesh data to
build the PBVH...

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

Proper fix is pending new code for subsurf/multires area.
2018-06-08 17:23:25 +02:00
1ce55693f5 UI: remove tools space type, use properties context
We've decieded to use tools context in properties editor.
2018-06-08 16:35:05 +02:00
Dalai Felinto
9d59d20957 DRW: Fix animated material not refreshing
This introduces a garbage collection system similar to gpu_texture.
2018-06-08 16:29:33 +02:00
0417f205f5 Fix crash with wertex and weight modes
Similar to recent sculpt mode.
2018-06-08 16:24:07 +02:00
Dalai Felinto
f638ad61b8 Rename: GPU_material_get_uniform_buffer > GPU_material_uniform_buffer_get 2018-06-08 16:20:34 +02:00
Dalai Felinto
856a79e1fb Rename: GPU_texture_orphans 2018-06-08 16:20:34 +02:00
cbbf8bbbb4 Workbench: XFlip Matcap per 3D View
Note: Icons are not yet updated.
2018-06-08 16:13:49 +02:00
Julian Eisel
fc85096dc8 Fix T55387: Render fullscreen from top menu crashes Blender
Would try to use data from global area for the newly created fullscreen area.
This should not happen, so instead of a global area use first area from layout.
2018-06-08 15:59:34 +02:00
4df45e18dc Alembic: replaced BLI_assert() with comment why the assert is wrong
The comment also hints at what should be fixed, instead.
2018-06-08 15:51:49 +02:00
249a41bc7c Alembic: slight clarifications 2018-06-08 15:51:49 +02:00
ba31c4d684 Alembic export: get evaluated object when exporting shape 2018-06-08 15:51:49 +02:00
2a771cbc58 Alembic: Moved a BLI_assert
The assert should only be triggered when assigning a pointer, and not
simply when checking the pointer.
2018-06-08 15:51:49 +02:00
335e030753 mesh_get_eval_final() should check ob->runtime.mesh_eval
It has nothing to do with ob->derivedFinal, which it checked before.
2018-06-08 15:51:49 +02:00
934b9e80d0 Add check in BKE_pbvh_apply_vertCos that number of deforming cos matches number of pbvh vertices.
This shall help catching issues in future.
2018-06-08 15:43:57 +02:00
06357b23a2 Fix T55404: Auto key with only-available doesn't work 2018-06-08 15:43:04 +02:00
9f2447cbd8 Code cleanup 2018-06-08 15:35:25 +02:00
70b3fb3781 Workbench: Custom StudioLight UI 2018-06-08 15:34:46 +02:00
6739bb195e Merge branch 'master' into blender2.8 2018-06-08 15:22:28 +02:00
540e85d567 GHOST/X11: Map unknown es,dk keys to accentgrave 2018-06-08 15:21:20 +02:00
0dd9a9e66a Alembic: fixed MSVC incompatibility 2018-06-08 15:09:10 +02:00
f504306671 Workbench: Default specular settings when no materials are used 2018-06-08 15:07:30 +02:00
97e7d9f90b Merge branch 'master' into blender2.8 2018-06-08 14:57:17 +02:00
d97df0d0e6 Cleanup: unused var, trailing space 2018-06-08 14:56:09 +02:00
4127aeb7a5 GHOST/X11: Map unknown de,fr keys to accentgrave
This still uses the correct string when typing text,
it just allows the key to be used in keymaps.

We should eventually add scan-code support.
2018-06-08 14:53:03 +02:00
e36ecb8a66 Alembic unit tests: fixed compiler errors
This doesn't mean the code is correct, but at least it builds.
2018-06-08 14:48:50 +02:00
94aa4d1657 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/blenkernel/BKE_sequencer.h
	source/blender/blenkernel/intern/sequencer.c
	source/blender/editors/curve/editcurve_paint.c
	source/blender/editors/gpencil/gpencil_edit.c
	source/blender/editors/gpencil/gpencil_paint.c
	source/blender/editors/gpencil/gpencil_utils.c
	source/blender/editors/include/ED_object.h
	source/blender/editors/include/ED_view3d.h
	source/blender/editors/interface/interface_eyedropper_depth.c
	source/blender/editors/render/render_opengl.c
	source/blender/editors/sculpt_paint/paint_image_proj.c
	source/blender/editors/sculpt_paint/sculpt.c
	source/blender/editors/space_view3d/drawobject.c
	source/blender/editors/space_view3d/view3d_draw.c
	source/blender/editors/space_view3d/view3d_edit.c
	source/blender/editors/space_view3d/view3d_intern.h
	source/blender/editors/space_view3d/view3d_select.c
	source/blender/editors/space_view3d/view3d_utils.c
	source/blender/editors/transform/transform_conversions.c
	source/blender/editors/transform/transform_snap.c
	source/blender/python/intern/gpu_offscreen.c
	source/blender/windowmanager/intern/wm_files.c
2018-06-08 14:38:57 +02:00
ae3e59fb61 Fix T55380: Crash when getting out of EditMode in some cases
Derived meshes are to be dead, so soon this code will be removed as well.
2018-06-08 14:38:01 +02:00
aff6cc9cf1 Workbench: Lights user pref 2018-06-08 14:30:32 +02:00
fb1915d870 Prevent wheel causing spurious click/drag events 2018-06-08 14:09:45 +02:00
33437719c1 Alembic import: fixed memory management for CoW copies of CacheFile blocks
When a CacheFile datablock is copied to an in-main datablock, it means that
the new copy should be independent of the old copy. In this case certain
properties are reset/duplicated. When it is copied to a no-main datablock,
we assume this is a copy-on-write copy that's used for evaluating things,
in which case the handle and object paths are referenced instead of
reset/ duplicated. This prevents us from re-opening the Alembic file every
time a new CoW copy is made.

The same approach is taken when freeing data (only when an in-main datablock
is freed do we actually free the data).
2018-06-08 13:52:53 +02:00
0c7fc3a961 Alembic import: assign cache_file handle to original datablock 2018-06-08 13:52:53 +02:00
7b6af843c2 Cleanup: getting rid of G.main.
Sometimes one needs a *lot* of changes for a single G.main... :/
2018-06-08 12:17:22 +02:00
c5904574cb Fix T55391: Anim render only shows scene state at current frame (no animation) 2018-06-08 12:12:52 +02:00
3926ec6aa1 Studiolight: Segment when using float based matcaps 2018-06-08 12:11:05 +02:00
1f1e26f1ab Depsgraph: Fix missing relations when camera has drivers 2018-06-08 12:04:53 +02:00
d38c7db5e1 Depsgraph: Cleanup, make conditions more clear and less indented 2018-06-08 11:57:16 +02:00
4017b48331 Depsgraph: Don't optimize out collections used by duplication system
This makes evaluated objects to point to a non-evaluated collection,
which is already really bad. What is even more worse, objects in those
collections are not evaluated either.

Proper solution would be to implement visibility flag for nodes, which
will be set to 0 for transform/geometry components, but which will be
1 for copy-on-write components.

This way we will guarantee consistency of dependency graph.

For now this change is good enough and unlocks production.

Fixes T55375: Crash when changing visibility of instanced collection
Fixes T55357: Particle geometry crash
2018-06-08 11:57:16 +02:00
378e42e119 Depsgraph: Cleanup, indentation 2018-06-08 11:57:16 +02:00
9600c7cb05 Depsgraph: Cleanup, make conditions more clear and less indented 2018-06-08 11:57:16 +02:00
691282e571 Alembic export: create render-evaluated depsgraph for exporting
Previously the context depsgraph was used, which (most likely) uses
viewport evaluation instead of render evaluation.
2018-06-08 11:53:03 +02:00
55606dbdbc CMake: disable WITH_COMPILER_ASAN for CMAKE_BUILD_TYPE Release 2018-06-08 11:45:53 +02:00
346a1d445e Cleanup: redundant check 2018-06-08 11:28:42 +02:00
0297274720 Merge branch 'master' into blender2.8 2018-06-08 10:54:51 +02:00
dff8a7db73 Fix regression in grease pencil drawing
Drag events finished drawing early.
2018-06-08 10:52:49 +02:00
b3c8ffcb3e Workbench: UI for custom studio lights/matcaps
- all known image types are supported
- BpyAPI for studiolights added
- added open user pref operator in shading menu
- possible to add multiple files in a single run

For now refreshing studio lights will free all studiolights and reinit
the whole mechanism. This can be improved by only freeing deleted, reset
updated and add new custom studiolights.

details to show currently only shows the path we perhaps want to add
other information also
2018-06-08 10:41:24 +02:00
4d16d00154 Keymap: continued testing/development (search key)
Use Accent/Grave for search, to be more convenient than F-Keys.

This sets F3 back to what it was before.
2018-06-08 10:07:41 +02:00
3d681108bf Merge branch 'master' into blender2.8 2018-06-08 08:50:13 +02:00
20367898fe Fix T55301: Transform confirm on release fails w/ MMB 2018-06-08 08:48:21 +02:00
e3fe8ce00b WM: backport event/keymap type util from 2.8 2018-06-08 08:46:31 +02:00
908b6960c0 Merge branch 'master' into blender2.8 2018-06-08 08:10:35 +02:00
a25c11fd8d Cleanup: trailing space
Remove from blender/nodes, collada, blenfont & render.
2018-06-08 08:07:48 +02:00
d352a0adc5 Merge branch 'master' into blender2.8 2018-06-08 08:02:50 +02:00
009c38df53 Fix recently added drag events closing menus 2018-06-08 08:01:43 +02:00
8b5ce6e843 Transform: fix non-3D view editmode assert 2018-06-08 06:31:40 +02:00
30cd35a37b Keymap: continued testing/development
After testing in the studio and extending the event system for
drag events, we've agreed on adjustments to the new keymap,
see: T55162

- Tab: Edit-mode toggle.
- Tab + Cursor Drag: mode switching pie menu.
- Accent/Grave: for 3D view pie menu.
- F3: Search
- 1..3, Shift-1..3: Edit mesh vertex/edge/face toggle.

Other minor changes were made, however they aren't part of the design.

- Ctrl-Shift-S: Image editor Save-As (was F3)
- Ctrl-Alt-R: Repeat history (was F3)
2018-06-07 20:46:12 +02:00
cfc4805455 Merge branch 'master' into blender2.8 2018-06-07 20:41:10 +02:00
8f49299134 WM: fix drag events applying after release 2018-06-07 20:39:17 +02:00
cfc1ddeff7 GHOST/X11: Xinput/XIM support caused double key-up
All keyboard events were sending double key events (including modifiers)
when xinput was enabled with gnome (causing much confusion!).

I cant test if XIM works,
but this isn't useful to send double events, so disabling for now.
2018-06-07 20:35:06 +02:00
Dalai Felinto
18e316bcb9 Uniform Buffer Objects: Simplification refactor
Since we are only creating this and never updating, there is no need for
the original approach with the individual data to be updated.

Note we only populate the GPU data when binding the UBO, so we can in the
future easily create the UBOs in a separate thread than the main drawing one.

Also at the moment animated materials are not working. To fix that we need
to free/tag for free the GPUMaterials in BKE_material_eval.
2018-06-07 20:34:00 +02:00
Dalai Felinto
57da454872 Uniform Buffer Object: No more dirty tagging calls/check 2018-06-07 19:42:03 +02:00
Dalai Felinto
1962ae69b1 Rename GPU_material_create_uniform_buffer > GPU_material_uniform_buffer_create 2018-06-07 19:40:47 +02:00
Dalai Felinto
56f2293a51 GLSL: No need to extract the UBO dynamic inputs 2018-06-07 19:40:08 +02:00
Dalai Felinto
e5bc37eb5e Don't tag UBO as dirty anymore otherwise it still crashes on render 2018-06-07 19:19:39 +02:00
Dalai Felinto
d17094b256 BKE_world_eval: cleanup 2018-06-07 19:16:26 +02:00
Dalai Felinto
85e2871382 No more need to tag sss as dirty for EEVEE
And for the records, this shoudn't have been added to the
GPU_material_uniform_buffer_tag_dirty function since they are unrelated.
2018-06-07 19:13:23 +02:00
d32b59fc18 Remove more printfs .... 2018-06-07 19:06:56 +02:00
630019d5f8 Alembic export: use depsgraph to get evaluated mesh/object 2018-06-07 19:01:45 +02:00
28817c82f1 Alembic export: no need to check particle's mesh_final on export
Hair writing is still not working properly, though, but at least now
samples are written at all.
2018-06-07 19:01:45 +02:00
9a873d0ab2 Alembic import: don't crash Blender when reading invalid samples 2018-06-07 19:01:45 +02:00
5852c66125 Alembic hair writer: avoid double-free 2018-06-07 19:01:45 +02:00
20d3ce57d0 Alembic export: cleaned up multiply-passed depsgraph & scene
Those can now solely be found in the ExportSettings object.
2018-06-07 19:01:45 +02:00
ef7b7efd11 Eevee: Fix hair not rendering. 2018-06-07 18:58:13 +02:00
3b556a477d Merge branch 'master' into blender2.8
Conflicts:
	source/blender/editors/sculpt_paint/paint_vertex.c
	source/blender/editors/sculpt_paint/sculpt.c
	source/blender/editors/sculpt_paint/sculpt_undo.c
2018-06-07 18:45:45 +02:00
5593baea1b Remove printfs
... it's getting late here.
2018-06-07 18:44:37 +02:00
0859492c75 Fix crash cause by SSS referencing Material Nodetree data. 2018-06-07 18:43:43 +02:00
a3773dcc4f Fix memleak with GPUhairs. 2018-06-07 18:43:10 +02:00
80dcb2ced8 Cleanup: typo, and 0 -> false for booleans. 2018-06-07 18:36:16 +02:00
00233f5f78 Wireframe: Fix edges or non manifold meshes not showing.
This will show the associated edges to the vertices but that's the only
workaround I can think of right now.
2018-06-07 18:01:36 +02:00
f9ca750bdf Wireframe: Change / Optimize the limited wireframe visibility option.
This make the limited wireframe not a performance problem anymore.

However, this does change the number of edges displayed as the threshold
is now computed per vertex instead of per edges.

For this reason we extended (internaly) the range of the slider so that the
users can hide more edge.
2018-06-07 18:01:36 +02:00
3823287179 Merge branch 'master' into blender2.8 2018-06-07 17:08:55 +02:00
d274c64d22 WM: add support for drag events
This allows for a single key to be mapped to both release and drag,
useful for pie menus to share a key with a different action.
2018-06-07 17:06:01 +02:00
8dc33a81b0 Merge branch 'master' into blender2.8 2018-06-07 16:53:31 +02:00
df4525d1d9 Fix key repeat events resetting the click timer 2018-06-07 16:52:40 +02:00
f0815b1322 Merge branch 'master' into blender2.8 2018-06-07 16:45:34 +02:00
863e395ad8 Cleanup: trailing space for windowmanager 2018-06-07 16:43:52 +02:00
fcc5d7c29e Draw: Fix crash when tryign to get procedural textures with modifier disabled
Maybe disabled modifier check should be done higher in the call hierarchy.
2018-06-07 16:40:15 +02:00
64e0ab6a00 Merge branch 'master' into blender2.8 2018-06-07 16:32:40 +02:00
86aaa3efba Fix T55126: COW problem: there is an active object even if unselectable 2018-06-07 16:31:10 +02:00
e19686a35a WM: check for release instead of not pressed
Makes reasoning about events more predictable.
2018-06-07 16:19:59 +02:00
819ad49d29 Cleanup: typo. 2018-06-07 16:02:55 +02:00
1e4722eeab Merge branch 'master' into blender2.8
Conflicts:
	source/blender/editors/transform/transform_generics.c
2018-06-07 15:41:57 +02:00
8a2db3ed21 Fix crash due to missing init of new bAnimContext bmain member in transform code.
From own previous G.main-busting commit.
2018-06-07 15:38:31 +02:00
d9d3e7778c Fix sculpt mode undo (COW update needed) 2018-06-07 15:15:54 +02:00
a3f520170c Merge branch 'master' into blender2.8 2018-06-07 14:58:57 +02:00
6242940639 Fix double free in dyntopo-sculpt mode undo 2018-06-07 14:54:09 +02:00
a16d835f7b Wireframe: Frustum cull them. 2018-06-07 14:50:01 +02:00
8366c3ecd8 Depsgraph: Ensure collections are up to date after modifications
Before that copied collection in copy-on-write were running out
of sync with original ones. This was causing crash with the
following scenario:

- Delete some objects from scene
- Add particle system to an object
- Change particle mode to Hair

Thanks Dalai for debug session! Pair programming ftw!
2018-06-07 14:41:29 +02:00
30ec94561c Depsgraph: Use more proper relations for scene relation 2018-06-07 14:41:29 +02:00
da8d33e2e3 Merge branch 'master' into blender2.8 2018-06-07 13:41:32 +02:00
5330f1c5d1 Fix sculpt assert on initialization 2018-06-07 13:39:49 +02:00
c63f804222 Armature: Fix flickering outline on planar custom bones. 2018-06-07 13:38:17 +02:00
508e34d0bf Merge branch 'master' into blender2.8
Conflicts:
	source/blender/editors/animation/anim_deps.c
	source/blender/editors/animation/keyframing.c
	source/blender/editors/animation/keyingsets.c
	source/blender/editors/armature/pose_edit.c
	source/blender/editors/armature/pose_transform.c
	source/blender/editors/gpencil/gpencil_convert.c
	source/blender/editors/include/ED_anim_api.h
	source/blender/editors/include/ED_keyframing.h
	source/blender/editors/interface/interface_anim.c
	source/blender/editors/space_action/action_edit.c
	source/blender/editors/space_graph/graph_edit.c
	source/blender/editors/space_outliner/outliner_draw.c
	source/blender/editors/transform/transform_conversions.c
	source/blender/makesrna/intern/rna_armature.c
	source/blender/makesrna/intern/rna_pose.c
	source/blender/python/intern/bpy_rna_anim.c
	source/blenderplayer/bad_level_call_stubs/stubs.c
	source/gameengine/Converter/KX_BlenderSceneConverter.cpp
2018-06-07 13:04:16 +02:00
4e014727f6 Armature: Fix missing loose edges on custom bone shapes. 2018-06-07 12:58:23 +02:00
Dalai Felinto
3126f85d26 Fix T55062: Depsgraph: Crash with COW with EEVEE viewport
We now remove the shader for every update.

So at the moment the whole point of UBO (Uniform Buffer Objects) is that they
are more efficient than individual uniforms.

Next steps is a harmless refactor to stopping UBO from referring to original
data in the UBO, and simply copying it.

It would also be interesting to make the final shader more granular as far as
the library and required functions are concerned. Even if this doesn't impact
performance, it should give us smaller easy to debug shaders
(a simple shader now has > 5k lines!).

If performance for animated values is measureable slower after this commit we
can port the shader creation CPU side to the depsgraph - localizing the tree,
hashing, lookup, ...

Additionally we can stick to update the UBO when the material changes but not
its topology. This is very trick because of localized trees. So we will only
re-visit this if profiling hints at any benefit from it.
2018-06-07 12:56:34 +02:00
b3a7a75a26 Cleanup: remove moar G.main usages.
Notes:
* Really need to address RNA setters case, end up adding way too much
G.main here these days... :/
* Added Main pointer into bAnimContext, helps a lot in anim code ;)
2018-06-07 12:48:29 +02:00
d1474371fa Fixed deadlock on viewlayer update when there are drivers
When calling the bpy.ops.poselib.apply_pose() operator from Python, Blender
would deadlock when the rig has drivers.

Similar BPy_{BEGIN,END}_ALLOW_THREADS calls were already in place in the
rna_Scene_update_tagged() function.
2018-06-07 12:37:55 +02:00
a867e63dd6 Rename "Viewport Display SSAO" sub-panel name to Screen Space Ambient Occlusion
Since it is already a sub-panel of Viewport Display anyway
2018-06-07 12:08:40 +02:00
cdbda1c3d8 GPUPass: Refactor gpupass caching system to allow fast gpumaterial creation.
This is part of the work needed to refactor the material parameters update.

Now the gpupass cache is polled before adding the gpumaterial to the
deferred compilation queue.

We store gpupasses in a single linked list grouped based on their hashes.
This is not the most efficient way but it can be improved upon later.
2018-06-07 12:02:42 +02:00
366ac88d68 Merge branch 'master' into blender2.8 2018-06-07 12:01:09 +02:00
16017178b2 Revert "Cycles: Cleanup: Don't use return on function returning void"
Not sure why exactly it is called a cleanup, the code was much more clear
and robust against possible missing return statements which are MANDATORY.

Missing return statement will:

- Cause two different BVH traversals to be run.

  Not is happening currently, but if more BVH layouts are added, it will
  become a problem.

- It is already causing assert() statements to fail, since functions are
  no longer returning when they are supposed to.

If there is any measurable reason to keep this change, let me know.
Otherwise just stick to reliable/tested/robust code.

This reverts commit ba65f7093b.
2018-06-07 11:57:57 +02:00
a54235e0c6 Particle mode: Support children drawing
The issue is that children drawing is done by object mode,
which operates with data from evaluated context. But that
data needs edit mode's cache to be properly updated first.
2018-06-07 11:31:56 +02:00
613faa0987 Draw: Don't take cache existence into account for draw type 2018-06-07 11:31:56 +02:00
72cfd5134b Draw: Use proper continue when psys is disabled 2018-06-07 11:31:56 +02:00
1aa89d9a1c Particle edit: Simplify code by benefiting from single edit context
Makes ADD brush to work.

At some point children particles draw got broken, children are not
visible for until first stroke is done. Still looking into it.
2018-06-07 11:31:56 +02:00
df0253be33 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/collada/ArmatureExporter.cpp
	source/blender/collada/ArmatureExporter.h
	source/blender/collada/DocumentExporter.cpp
	source/blender/collada/DocumentExporter.h
	source/blender/collada/SceneExporter.cpp
	source/blender/collada/SceneExporter.h
	source/blender/collada/collada.cpp
	source/blender/collada/collada.h
	source/blender/editors/armature/armature_edit.c
	source/blender/editors/armature/pose_transform.c
	source/blender/editors/include/ED_armature.h
	source/blender/editors/include/ED_object.h
	source/blender/editors/include/ED_screen.h
	source/blender/editors/io/io_collada.c
	source/blender/editors/object/object_transform.c
	source/blender/editors/screen/screen_edit.c
	source/blender/editors/screen/screen_ops.c
	source/blender/windowmanager/intern/wm.c
	source/blender/windowmanager/intern/wm_files.c
	source/blender/windowmanager/intern/wm_window.c
	source/blenderplayer/bad_level_call_stubs/stubs.c
2018-06-07 11:23:26 +02:00
54f9cd5283 Cleanup: Nuke moar G.main usages... 2018-06-07 11:11:46 +02:00
e27759152a Minor comment on possible TODO while validating paint ops for CoW... 2018-06-07 10:59:21 +02:00
e43065596b Alembic export: CoW/Depsgraph fixes 2018-06-07 10:48:52 +02:00
d88314ee5b Alembic export: port DerivedMesh → Mesh 2018-06-07 10:48:52 +02:00
5b0f96f97c Alembic import: port DerivedMesh → Mesh 2018-06-07 10:48:52 +02:00
f447411a82 Bone selection: user control contrast
Experiment: let the user be in control of the alpha channel as some rigs
are hard too see during bone selection. Especially rigs that were
designed for 2.79 wireframe mode.
2018-06-07 09:26:06 +02:00
7fb216d800 Workbench: respect the duplication visibility flag 2018-06-07 09:26:06 +02:00
2d2f23de10 Fix T55348: Renaming a marker can't cancel
Regression in a14005c070
2018-06-07 08:54:47 +02:00
a60d4f33c6 Merge branch 'master' into blender2.8 2018-06-07 08:15:11 +02:00
409cfba1a3 Python API: Initial 'imbuf' API
Support only basic operations new/load/write & resize.

Add now so we can extend as needed & more easily accept patches.
2018-06-07 08:00:13 +02:00
ba80d8440f Cleanup: style 2018-06-06 22:17:06 +02:00
1c4b04f1fd Merge branch 'master' into blender2.8 2018-06-06 19:52:20 +02:00
0e68751b8a Fix BLI_ASSERT_UNIT macro w/ non-finite numbers 2018-06-06 19:49:27 +02:00
70b705b5fe UI: NLA: Influence should be a factor (RNA) 2018-06-06 12:09:13 -04:00
4165a57a66 Fix broken auto-keying after copy/paste of poses.
That bug was also likely affecting other cases - basically it was making
auto-keying always key from evaluated ('visual') values, never base,
data values... Added a flag, in some cases we do want evaluated values
here, obviously.
2018-06-06 17:19:13 +02:00
Dalai Felinto
f818ff411a Cycles: use viewport duplicator visibility on preview 2018-06-06 16:44:51 +02:00
Dalai Felinto
04dfca5b9d Depsgraph: Expose (evaluation) mode in rna 2018-06-06 16:44:51 +02:00
Dalai Felinto
4e213d4216 Depsgraph iterator: Remove explicit mode
We can get the mode from the depsgraph itself.
2018-06-06 16:44:51 +02:00
Dalai Felinto
9a0506ea18 Fix T55350: Cycles: instanced hair with hidden emitter is invisible when rendering 2018-06-06 16:44:07 +02:00
36000e6da3 Cleanup: unused function 2018-06-06 16:36:00 +02:00
c44acc7fb8 Fix view_layer update function
This was no longer working, now this works the same way as
scene.update(), only it applied to the current view layer.

Caused crash running alembic export from Python.
2018-06-06 16:33:34 +02:00
0ee4785675 Cleanup: get rid of just-added G.main usage.
Was just added to ease merging of master, proper code now!
2018-06-06 16:32:09 +02:00
bb7202495a Merge branch 'master' into blender2.8
Conflicts:
	source/blender/collada/ArmatureExporter.cpp
	source/blender/collada/ArmatureExporter.h
	source/blender/collada/DocumentExporter.cpp
	source/blender/collada/DocumentExporter.h
	source/blender/collada/SceneExporter.cpp
	source/blender/collada/SceneExporter.h
	source/blender/collada/collada.cpp
	source/blender/collada/collada.h
	source/blender/editors/armature/armature_edit.c
	source/blender/editors/armature/editarmature_retarget.c
	source/blender/editors/armature/pose_transform.c
	source/blender/editors/include/ED_armature.h
	source/blender/editors/include/ED_object.h
	source/blender/editors/include/ED_screen.h
	source/blender/editors/io/io_collada.c
	source/blender/editors/object/object_transform.c
	source/blender/editors/screen/screen_edit.c
	source/blender/editors/screen/screen_ops.c
	source/blender/windowmanager/intern/wm.c
	source/blender/windowmanager/intern/wm_files.c
	source/blender/windowmanager/intern/wm_window.c
	source/blenderplayer/bad_level_call_stubs/stubs.c
2018-06-06 16:25:28 +02:00
19d651ca9a View3DShading popover: Naming + alignment 2018-06-06 16:17:07 +02:00
d706101559 Depsgraph: remove legacy code for dupli group updates.
This caused crashes in some cases, and should be fully handled by
the depsgraph now.
2018-06-06 16:00:25 +02:00
bb09556be5 UI: sub panel titles draw smaller and indented. 2018-06-06 16:00:25 +02:00
f55f418867 Fix incorrect double checked lock in collection object cache. 2018-06-06 16:00:25 +02:00
f884ba02a2 Merge branch 'master' into blender2.8 2018-06-06 15:58:18 +02:00
de702a4803 Alembic export: only free duplilists when not NULL 2018-06-06 15:54:03 +02:00
48e871ab1d Cleanup: Nuke moar G.main usages... 2018-06-06 15:50:24 +02:00
fcf720a135 View3D: Shading Popup
- layout so cavity options are better visible
- fixed issues showing wrong options in Material mode
- added labels + seperators
2018-06-06 15:44:00 +02:00
89042f576e LookDev: When HDRI could not be reloaded we should switch to world
Thanks for reporting sergey!
2018-06-06 15:26:09 +02:00
7fee5f5643 Fix object-dupli selection w/ COW 2018-06-06 15:24:27 +02:00
f1fd5ed74f T55333 Workbench: Cavity Shader
A cavity shader based on SSAO. Works on all workbench deferred passes.

Per 3d viewport the cavity shader options can be set as different
shading needed different options. Some global options are in the
Viewport Display of the scene like num samples and distance.

Experimental: Naming of Ridges and Valleys
2018-06-06 14:51:18 +02:00
4a52531a11 Alembic: Fix double-free of mutex
The mutex was shared between CoW copies of the CacheFile datablock, and
as a result also freed multiple times. It is now only freed when the
original datablock is freed; the CoW copies share the same mutex.
2018-06-06 14:38:17 +02:00
4c4fa3d49b Fix double-free of custom data
This causes a temporary spike in memory usage when creating a copy; the
entire copy will be removed anyway when DerivedMesh is removed.
2018-06-06 14:38:17 +02:00
3b8ae85e3d Move Time Remapping into a sub-panel 2018-06-06 14:28:35 +02:00
a8ae68aa5c Fix crash when file is saved in particle edit mode
Depsgraph is not available on file load yet.
2018-06-06 14:13:46 +02:00
2088bb0d49 UI: add particle brush to topbar 2018-06-06 14:06:45 +02:00
b58e5d4f2c Particle edit: Fix missing hair with new oarticle system added 2018-06-06 13:54:39 +02:00
1295e85de0 Particle edit: Fix crash when trying to edit particles without cache
Particles in EMITTER mode needs to have cache.
2018-06-06 13:54:39 +02:00
528cdf9b50 Fix update issue in VPaint mode.
Need to flush the changes through DEG CoW, otherwise drawing code would
not see them in some cases...
2018-06-06 12:42:01 +02:00
e3324c3a8e Depsgraph: Silence relations builder errors
Were caused by depsgraph trying to create relations between objects
which are coming from restricted collection.
2018-06-06 12:36:52 +02:00
22370929fe Depsgraph: Expand object data datablocks for drivers
Drivers can reference object data datablock directly, and if there
was no object in the scene with that datablock, blender will crash.
2018-06-06 12:36:52 +02:00
7810c60fe3 Depsgraph: Handle key->object relations from object builder 2018-06-06 12:36:51 +02:00
695747aad1 Depsgraph: Object data separation, armature 2018-06-06 12:36:51 +02:00
5a14af62d0 Depsgraph: Object data separation, geometry 2018-06-06 12:36:51 +02:00
82ec06cbfa Depsgraph: Object data separation, camera 2018-06-06 12:36:51 +02:00
ca7de1ff22 Depsgraph: Object data separation, lamp 2018-06-06 12:36:51 +02:00
1a0cb28ae2 Depsgraph: Object data separation, light probes
This is a beginning of series of commits which will clearly separate
building IDs which are used as object data from object building.

The goal is to be able to always build whatever ID. Required to make
driver targets to work reliably with copy-on-write concept.
2018-06-06 12:36:51 +02:00
180e8f8bfb Depsgraph: Remove confusing metaball logic
DATA datablock must evaluation must never depend on object it is
used for. If there is something what depends on an object, it must
be done on object level.

At least the actual callback was empty.
2018-06-06 12:36:51 +02:00
9f255db4fe Wireframe: Fix do_version. 2018-06-06 12:32:30 +02:00
7a76223f1f Ensure BKE_mesh_new_nomain_from_template() always has valid mxxx pointers
When the source mesh doesn't have the primary layers (CD_VERT for vdata,
etc.) the returned mesh also didn't have those layers, even when non-zero
elements were requested (for example requesting 4 vertices would still
result in mvert = NULL).
2018-06-06 12:27:25 +02:00
8a0e6a3143 Consolidated custom data layer initialisation
Code shared between BKE_mesh_new_nomain() and
BKE_mesh_new_nomain_from_template() is now in separate functions, instead
of copy-pasted.
2018-06-06 12:27:25 +02:00
5e180ebffc Set mesh->totface in nomain-mesh creation
The totxxx fields should match the number of elements in their respective
custom data layers.
2018-06-06 12:27:25 +02:00
c4ce4034e6 Fix T55344: linked collection instance has user count 0. 2018-06-06 11:22:17 +02:00
3e87c039ba UI: tweak for Cycles panels. 2018-06-06 11:22:17 +02:00
1d86bdf16b Cleanup: fix compiler warning. 2018-06-06 11:22:17 +02:00
03b8e4f608 Fix importing temporary screens
Apparently Blender 2.79 could save temporary screens; those should not be
converted to workspaces.
2018-06-06 11:13:11 +02:00
23db3a5ade Renamed BKE_nomain_mesh_xxx → BKE_mesh_nomain_xxx
This maintains the `BKE_mesh_` prefix for the mesh-related BKE functions.
2018-06-06 10:30:24 +02:00
783d31c3a3 DerivedMesh deprecation: Removed some functions in displist.c
Those functions were using DerivedMesh but are not called from anywhere.
As a result, they cannot be tested after porting DerivedMesh to Mesh.
2018-06-06 10:11:31 +02:00
abccde4d68 DerivedMesh deprecation: marked no-longer-in-use function
Functions that are no longer in use can be marked as such, so that later
we can easily remove them.
2018-06-06 10:11:31 +02:00
5f543915e8 Modifiers: ported curve_calc_modifiers_post() internals from DerivedMesh → Mesh
The function still returns a DerivedMesh, but internally it uses Mesh
now.
2018-06-06 10:11:31 +02:00
274453ef73 Error in recent popover keep_open option 2018-06-06 09:43:03 +02:00
a9f9236670 Merge branch 'master' into blender2.8 2018-06-06 09:39:35 +02:00
bfbd85e9d6 Fix error using freed bmain
Regression in 481cdb08ed
2018-06-06 09:36:50 +02:00
ab375079df Cleanup: rename WITH -> USE for internal defines 2018-06-06 09:29:54 +02:00
6ff89166a8 Cleanup: USE_UI_* prefix for UI defines
Otherwise there is no quick way to see where this comes from.
2018-06-06 09:27:23 +02:00
52502ad0a4 UI: WM_OT_call_panel option to keep popovers open 2018-06-06 09:24:51 +02:00
14251d4615 Workbench: Speed up fo scene with many duplis
The ObjectID pass was generating per material per dupli a specific
number for the outline what results in a GPU context switch. In spring scene
01-050 a scene with many trees (duplis) generated 28000 GPU materials.

Now only new materials are created when objectid pass is enabled. Also
added a hard limit to the number of objects for the objectid pass (255)
Basically the outline between objects will not be drawn, but it will be
very hard to detect them also.

Also fixed for XRay mode.
2018-06-06 08:50:12 +02:00
1889eec918 UI: use regular size icons for toolbar popup
Test this since the popup feels disruptive/flashing when its too large
when set smaller it looks closer to a menu w/ key-accelerators which is
the intention in this case.

It's also more likely the active tool can be placed under the cursor.
2018-06-06 08:32:25 +02:00
c1a880bc5e Fix object selection w/ COW 2018-06-06 08:20:05 +02:00
3c9e2e82fa Cleanup: style 2018-06-05 21:32:49 +02:00
851829c1fb Eevee: Improve load time.
Only generate shadow store shaders on demand and create a simpler shader
for small blur radius.
2018-06-05 21:02:57 +02:00
e394a78b4c Fix compilation issue due to last commit. 2018-06-05 19:49:12 +02:00
d5ce40a5ed Wireframe: Add slider to hide edges from coplanar faces
The default behaviour is to show the same amount of edges as 2.7.
The slider makes it possible to show all edges or even less.
2018-06-05 19:35:36 +02:00
713027b832 make.bat : move all experimental options to their own section in the help. 2018-06-05 11:29:03 -06:00
983811607d make.bat : bring the help up to date with recent additions to the build script. 2018-06-05 10:40:14 -06:00
cd58ce85c2 make.bat : check for existence of ninja before using it. 2018-06-05 10:39:39 -06:00
5e44324b79 make.bat: change the way the vs buildtools are detected.
The recent change also used the buildtools instead of the regular compiler, you now have to explicitly state what you want to use :

2017 - the standard msvc compiler
2017pre - the msvc compiler from the preview installation
2017b - the msvc compiler from the buildtools installation
2018-06-05 10:38:48 -06:00
7ff07ddd01 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/windowmanager/intern/wm_files.c
2018-06-05 17:56:18 +02:00
1628a6858e Fix crash in owmn previous commit. 2018-06-05 17:54:53 +02:00
f0d9dbae0d Merge branch 'master' into blender2.8
Conflicts:
	source/blender/blenkernel/intern/blendfile.c
	source/blender/blenloader/intern/readfile.h
	source/blender/blenloader/intern/versioning_250.c
	source/blender/blenloader/intern/versioning_260.c
	source/blender/blenloader/intern/versioning_270.c
	source/blender/blenloader/intern/versioning_legacy.c
	source/blender/editors/render/render_shading.c
	source/blender/makesrna/intern/rna_movieclip.c
	source/blender/render/intern/source/pipeline.c
	source/blender/render/intern/source/voxeldata.c
2018-06-05 17:02:50 +02:00
ce6db959c7 Moved function declarations from BKE_DerivedMesh.h to BKE_mesh_runtime.h
The function definitions still reside in DerivedMesh.c. Once we're done
porting all the DerivedMesh use to Mesh, we'll move the still-relevant
functions to mesh_runtime.c. This move is now cumbersome due to shared
statically-declared utility functions in DerivedMesh.c
2018-06-05 16:59:25 +02:00
a9ed50514c Moved function declarations from BKE_mesh.h → BKE_mesh_runtime.h 2018-06-05 16:59:18 +02:00
7436fb2ef1 Merge branch 'master' into 28 2018-06-05 16:36:13 +02:00
481cdb08ed Cleanup: use new accessors to blendfile path (Main.name). 2018-06-05 16:33:46 +02:00
1d97e948d2 Cleanup: add hleper functions to get filepath from Main.
This helps making things clearer and cleaner. Func returning filepath of
G.main is separate, so that we can easily track its usages, and
hopefully deprecate it at some point. Though that usage of G.main is
likely the less evil one, you nearly always want current blendfile path
in those cases anyway.
2018-06-05 16:33:46 +02:00
c68429bc03 Cleanup: pep8
Use 'autopep8 --ignore E721,E722' on our UI code, only minor changes.
2018-06-05 16:32:11 +02:00
d94df18550 Cleanup: doxy grouping for mesh runtime API 2018-06-05 15:55:16 +02:00
7a612c3799 LookDev: Fix crash when no world 2018-06-05 15:49:54 +02:00
60aee3943f UI: move 3D view display options into popover
- Moved Mesh Display, Mesh Analysis & Motion Tracking
  display panels to Overlays.
- Removed Item panel from sidebar (buttons available elsewhere).

Patch by @billreynish w/ edits
2018-06-05 15:35:57 +02:00
d860d23e1a make.bat: cache the vcredist directory.
When run from make.bat the environment is setup correctly and the VCToolsRedistDir environment variable exists, on later invocations of cmake this may no longer be the case and a warning was emitted about the missing runtime. we can't rely on InstallRequiredSystemLibraries.cmake here since it uses the compiler version to figure out the correct location and it doesn't know how to deal with clang.
2018-06-05 07:25:37 -06:00
2cc6e06bdb Error in last commit 2018-06-05 15:21:04 +02:00
b6d920bbd5 Depsgraph: Fix bug with broken tweak of animated node tree settings
With single editing context we can have expected and correct evaluation order
of animation and material update.
2018-06-05 15:11:34 +02:00
2891fb645b 3D View: disable manipulators & text w/o overlay
Manipulators which aren't explicitly activated via tools are now hidden.

Tool manipulators are kept because it doesn't make sense to interact
with a tool with hidden manipulators.
2018-06-05 14:54:52 +02:00
24bd483ee1 Object Modes: Flush COW on mode switching
Caused glitch w/ sculpt mode not updating.
2018-06-05 12:48:25 +02:00
09f780c1b0 Preserve unkeyed changes on undo and file open
This partially reverts 5975d6581c.

With single editing context it is more predictable what is unkeyed change is.
2018-06-05 12:35:19 +02:00
6d7327f607 Cleanup: simplify studiolight/matcap enum code, remove limit. 2018-06-05 12:23:55 +02:00
0d47a4d2fe T55291: Matcaps were reset when loading file 2018-06-05 12:21:41 +02:00
df1d319a79 Static Override: Fix order of operations issue in material slots.
*Really* not happy with that kind of constraint, but no choice for
now...
2018-06-05 12:08:18 +02:00
856d36e4b8 Static Override: progresses towards full support for material slots.
Material slots are a real pain to get working, due to all the black
magic they do to hide object vs. obdata storage of the material...

Currently hitting an order problem - we need to always set 'link' (to
object or obdata) property of the slot first, before we set its
material... *super-sigh*
2018-06-05 12:08:18 +02:00
cb42ad8c75 Fix compilation error after recent matcap changes 2018-06-05 12:02:08 +02:00
cd8613c6e7 Fix T55319: Keyframing issues
The issue was that keyframing from menu would tag object for animation
update, which was making object to loose unkeyed changes.
2018-06-05 11:56:46 +02:00
342dd5a771 Workbench: remove the soft limit for the xray_alpha 2018-06-05 11:45:22 +02:00
a3815f8777 Workbench: Matcaps T55291
- users can use their own matcaps
.config/blender/2.80/datafiles/studiolights/matcap/ folder
- upto 100 matcaps can be loaded
- color of the matcap is influenced by the color of the material/single
color etc. To show the plain matcap use single color at 1.0
- chosing a matcap is at lighting level (flat/studio/matcap)
- matcap only possible in solid mode
- also works for X-Ray mode

As the old matcaps are still in used by the clay engine I didn't remove
it yet.
2018-06-05 11:38:33 +02:00
ade710500d UI: set cursor line width 2018-06-05 11:37:30 +02:00
f1a3b68e76 Transform: avoid assert in wpaint mode 2018-06-05 11:31:17 +02:00
b9db470636 Fix stupid mistake in previous commit. 2018-06-05 11:22:43 +02:00
0be9d8db65 RNA/Override: Move override-related property flags to own variable.
We are already running out of available flags in main, generic int, and
everytime I work on static override I find new special cases that will
need new specific propflag, so...
2018-06-05 11:11:43 +02:00
99dd3b0156 Baby step towards making overridable materials for objects.
Naughty Collections RNACollection of objects is still to be tamed, but
for individual objects should work now....
2018-06-05 11:11:42 +02:00
5d628c519b Transform: improve pose trans/rot/scale guessing
Switching the mode was being done per object,
where it should first check all pose bones from all objects.

This also removes code that changes the transform mode
from within the counting function.
This was only needed on transform initialization.
2018-06-05 11:04:12 +02:00
0941b8b672 Missing from last commit 2018-06-05 10:13:55 +02:00
83db7a0070 Transform: revert use of evaluated objects
This is no longer needed.
2018-06-05 09:48:38 +02:00
1df228a416 UI: context menu for other editor types
D3458 by @billreynish w/ edits.

- Context menu for dope-sheet, graph, image & node editors.
- Add type to contenxt menu header.
- Access with W-Key.
- Change UV-editor weld key binding to Shift-W.
2018-06-05 09:18:00 +02:00
80d86f303a UI: support property split for 'prop_search' 2018-06-05 08:56:14 +02:00
88b46a6ce9 make.bat : Fix clang+asan msbuild project generation 2018-06-04 22:35:57 -06:00
Dalai Felinto
17e9870221 DRW: Fix crashes with instanced data
Problem introduced on 101c277e3d.
2018-06-04 19:17:29 +02:00
6fee105943 Cleanup: correct menu name 2018-06-04 19:09:52 +02:00
da53c3f020 Merge branch 'master' into blender2.8 2018-06-04 18:50:14 +02:00
58e8c71cbd Cleanup: strip ghost trailing space 2018-06-04 18:47:57 +02:00
f6740993f7 Cleanup: strip tests trailing space 2018-06-04 18:47:31 +02:00
c8af234f85 Fix T55325: Revert "Always get a reference point when snapping with the projected elements option enabled."
This reverts commit 0864a4c1ea.

That way it's best for retopology.
2018-06-04 13:33:19 -03:00
84becb870f Merge branch 'master' into blender2.8 2018-06-04 17:58:07 +02:00
747534af00 Particle System: move data creation into RNA update
Relying on evaluation to initialize data causes issues w/ 2.8.
2018-06-04 17:55:19 +02:00
William Reynish
2b4d2de253 UI: more subpanels for Cycles and Eevee. 2018-06-04 17:36:03 +02:00
ce5e9b599c Fix Python UI error with Eevee and hemi lamps. 2018-06-04 17:36:02 +02:00
784a3ccf79 Fix hang rendering with motion blur. 2018-06-04 17:36:02 +02:00
101c277e3d Workbench: Shadows: Fix cap being clipped by far plane.
This was the last remaining problem with shadow volumes (that I know of).

Only extrude until we hit the far plane.
2018-06-04 17:33:34 +02:00
349d416949 Tool System: refresh tools after undo 2018-06-04 16:41:03 +02:00
18e8350cd1 Cleanup: Hopefully more clear name 2018-06-04 16:22:36 +02:00
bda0175984 DRW: Fix leak from the wireframe drawing. 2018-06-04 16:04:18 +02:00
570804882d Wireframe: Lower line thickness and front color blending. 2018-06-04 16:04:18 +02:00
4b5670ac11 Cleanup: redundant headers 2018-06-04 16:03:52 +02:00
3b4c7a8c9b Weight paint: Use helper function to get original mesh
Makes it one line to get needed mesh, no code duplication. And can easily
update asserts and tighten the nuts.
2018-06-04 15:49:11 +02:00
0e8edbbc01 Add utility functions to get different "levels" of evaluated/original mesh 2018-06-04 15:48:37 +02:00
2b22a61152 Depsgraph: Only store original mesh pointer for mesh object 2018-06-04 15:24:41 +02:00
52f9023fbf Fix weight paint crash
The PBVH was referencing runtime custom data which was freed on refresh.
2018-06-04 15:18:48 +02:00
07f0046203 Fix crash when making objects to share same mesh
Make it more reliable and predictable way of getting pointer to
an original mesh which came from copy-on-write engine.

Related change: made it (hopefully) more clear name for flags.
2018-06-04 15:17:16 +02:00
1dc31f5b98 GPU: Fix missing case of new radeon on xorg.
This was causing issue with shader compilation.
2018-06-04 15:15:00 +02:00
e47e60a9b9 Workbench: Shadows: Fix the remaining fail case.
Non-manifold geom was producing inverted result when the camera was inside
the shadow volume.

When rendering non manifold geometry with the depth fail method, we need to
emit the cap as if it was the same geometry with a virtual thickness.

Another way to view it is to imagine having a set of non-manifold geometry
all facing the light.

So for every tri we emit a front cap oriented toward the light and the
back cap pointing away from it (whatever the actual orientation of the tri).

Extrusion pass stay the same as the depth pass method (double the increment
if it's a manifold edge).
2018-06-04 15:15:00 +02:00
736a84ec66 Cleanup: Use proper type for original ID pointer
Helps debugging, no need to cast in a debugger.
2018-06-04 14:14:14 +02:00
William Reynish
acb5bbf9b2 UI: use subpanels for Cycles, render, scene, object, particle, curves. 2018-06-04 13:44:23 +02:00
a46ced5076 Fix missing collection instance motion blur settings. 2018-06-04 13:41:27 +02:00
f430f14df4 Merge branch 'master' into blender2.8 2018-06-04 12:48:03 +02:00
7277f8973b Fix T55260: load Text File with Python from GUI Button results in 0 User
Let's just always ensure user_one when loading text from operator...
2018-06-04 12:46:59 +02:00
c2ff37455e Fix selecting bones
Own error w/ recent USE_OBJECT_MODE_STRICT
2018-06-04 12:39:10 +02:00
95011f6d48 Merge branch 'master' into blender2.8 2018-06-04 09:39:04 +02:00
44505b38df Cleanup: strip trailing space in editors 2018-06-04 09:31:30 +02:00
0911acb5cf Merge branch 'master' into blender2.8 2018-06-04 09:11:45 +02:00
6654e109df Cleanup: strip trailing space in GPU module 2018-06-04 09:09:12 +02:00
5b64301834 Merge branch 'master' into blender2.8 2018-06-04 09:06:14 +02:00
2d3d76693a Cleanup: newlines at EOF for Python modules 2018-06-04 08:54:40 +02:00
7719c11006 Cleanup: strip trailing space in Python module 2018-06-04 08:54:40 +02:00
854db8951b Cleanup: strip trailing space in bmesh module 2018-06-04 08:49:47 +02:00
ba65f7093b Cycles: Cleanup: Don't use return on function returning void 2018-06-04 00:07:17 +02:00
f6743fcaa4 UI: use subpanel for particle emission source, as an example. 2018-06-03 21:36:12 +02:00
d7c2b78822 UI: add subpanel support.
In the Python API, any panel becomes a subpanel by setting bl_parent_id
to the name of the parent panel. These subpanels can contain advanced or
less commonly used settings.
2018-06-03 21:30:35 +02:00
9b01e7bc27 UI: move Cycles device to Performance panel. 2018-06-03 19:01:18 +02:00
d3fe033875 Some cleanup/refactor from code review. 2018-06-03 18:25:08 +02:00
81dbf08eb4 Merge branch 'master' into blender2.8 2018-06-03 17:09:07 +02:00
38eb91c848 Cleanup: correct variable name, doxy sections 2018-06-03 17:06:13 +02:00
25ff7a4f2a DRW: Hair: Add additionnal subdivision smoothing support.
Only use catmull-rom interpolation for now. It's smoother and does not
exhibit artifacts.
2018-06-03 16:45:03 +02:00
06dd89b0ca GPUTexture: Fix memleak in orphaned texture management. 2018-06-03 16:45:03 +02:00
beca377c27 Merge branch 'blender2.8' into ui_layout_gridflow
Conflicts:
	release/scripts/startup/bl_ui/properties_texture.py
	source/blenderplayer/bad_level_call_stubs/stubs.c
2018-06-03 16:35:54 +02:00
e657a4af13 Merge branch 'master' into blender2.8 2018-06-03 15:20:11 +02:00
4c4eb1ce20 Workbench: Fix memleaks. 2018-06-03 15:26:53 +02:00
d0f7ab27a8 Wireframe: Optimization for intel GPUs.
Intel GPU take more advantage of the geometry shader than other vendors.

Using a simple geom shader approach in this case is more performant.
2018-06-03 15:26:37 +02:00
335b193336 Cleanup: add argument names to screen callbacks 2018-06-03 15:11:31 +02:00
778a19a13a DRW: Fix hair disapearing if emitter is culled. 2018-06-03 12:36:03 +02:00
32c5972653 Workbench: Rework hair support.
Now hairs are shaded properly in workbench and support texturing.

I also added a 10% random normal direction per hair to have a bit more
variation in the shading. This is hardcoded for now.
2018-06-03 12:36:03 +02:00
38bf3b8d23 Merge branch 'master' into blender2.8 2018-06-03 11:24:57 +02:00
6221180963 Cleanup: remove blockscale & handler
Replace with link_flag, currently unused,
needed for dynamic space types which is planned.
2018-06-03 11:12:50 +02:00
18a4553838 Edit menu: add Repeat Last and Repeat History 2018-06-02 23:13:03 +02:00
815b1f24fa build_environment: support for msvc2017 and newer cmake.
-expanded build_deps.cmd with 2017 support, it can't locate msvc2017 so needs to be run from developer prompt.
-Newer cmake was unhappy with openal's cmakelists.txt
-collada has warning as error on and errored out on new msvc2017 warnings.
2018-06-02 13:59:56 -06:00
04d9316cf3 UI: use single column layout for particles
Also minor changes to other panels.

Patch by @billreynish
2018-06-02 21:52:52 +02:00
c55e90da4c Cleanup: -Wswitch warning 2018-06-02 21:38:31 +02:00
2ef695fabf build_environment: fix paths in osl.diff 2018-06-02 13:18:22 -06:00
6c6c4da718 GPU: Fix texture being freed in threads without ogl context bound.
This is a dirty fix. A bit more cleaner approach would be to check if a
context is bound and delay the deletion only in this case.
Also we may want to do this orphan deletion at some other places than
wm_window_swap_buffers.
2018-06-02 21:16:40 +02:00
bc6358a580 DRW: Add uniform name recording in debug mode. 2018-06-02 21:16:40 +02:00
f25e459f8f DRW: Make the Procedural hair update part of the drawmanager.
Instead of relying on the engine integration which is redundant.
2018-06-02 21:16:40 +02:00
98e4d548a1 Eevee: Hair: Make SSR works with hairs. 2018-06-02 21:16:40 +02:00
119423b252 Eevee: Cleanup unused Ghash 2018-06-02 21:16:40 +02:00
8ace49dedc Eevee: Add shadow support for hairs. 2018-06-02 21:16:40 +02:00
1de73fc6c3 Eevee: Hair: Make hairs visible even if the show emitter option is disabled. 2018-06-02 21:16:40 +02:00
08a2c5f224 Eevee: Add support for hair random property.
Do note that it does not match cycles implementation.

Also we could precompute the hash per strand before rendering but that would
suggest it's not per engine specific.

If we make the random value internal to blender then it won't be a matter
because other renderers will have access to the same value.
2018-06-02 21:16:40 +02:00
4430bd3644 Eevee: CodeStyle: Fix naming and confusion about the hairs vectors. 2018-06-02 21:16:40 +02:00
Dalai Felinto
0736460dfb Merge remote-tracking branch 'origin/master' into blender2.8 2018-06-02 20:34:25 +02:00
Dalai Felinto
fec317de8d --debug-gpu-shader: Dump GLSL shaders to disk
This is really convenient for development. Either for profiling the
generated shaders or to check if the generated code is correct.

It writes the shaders to the temporary blender session folder.

(ported over from blender2.8)
2018-06-02 20:29:27 +02:00
53c9fbef60 Merge branch 'master' into ui_layout_gridflow 2018-06-02 18:34:07 +02:00
6de656b4f2 transform_snap_object: Do not use occlusion test when X-Ray is enabled. 2018-06-02 13:11:51 -03:00
58efa7d686 Fix inaccuracy of SCREEN_OT_area_split when snap to midpoint and adjacent.
By default when moving a edge of the screen it always snaps to an invisible grid with unit of 4 pixels.
This was also affecting the snap to the midpoint and adjacent.
The solution was to make the snap to areagrid optional and use values of `origmin` and `origsize` that match the transformations in screen_edit.c.
2018-06-02 12:19:49 -03:00
0de0cee9a2 Fix crash running in background mode 2018-06-02 14:53:07 +02:00
9cd2e4fa3f Cleanup: quiet warnings w/o Python 2018-06-02 13:10:27 +02:00
b608133075 Fix crash if no tool is set 2018-06-02 13:10:15 +02:00
a08a8aa928 Merge branch 'master' into blender2.8 2018-06-02 13:09:12 +02:00
c140f11946 Cleanup: warning 2018-06-02 11:58:01 +02:00
Dalai Felinto
bb8770b976 Fix UI for camera data
The fix bit is the split.

But since we are using col.separator() left and right we need this as well.
I still don't think the separators are the way to go, yet may as well be
consistent with the current design in place, thus the extra separator here too.
2018-06-02 11:22:44 +02:00
8433ed76b2 UI: re-order navigate manipulator
Looked as if size applied to navigation too.
2018-06-01 22:37:27 +02:00
d18cd768bb UI: use single column properties for object data
patch by @billreynish w/ minor edits
2018-06-01 19:26:07 +02:00
bfe1d0e0dc Merge branch 'master' into blender2.8 2018-06-01 18:26:42 +02:00
75fc1c3507 Cleanup: trailing whitespace (comment blocks)
Strip unindented comment blocks - mainly headers to avoid conflicts.
2018-06-01 18:19:39 +02:00
297bf7235b Cleanup: whitespace 2018-06-01 18:10:43 +02:00
c0dd355926 Modifiers: ported applying modifier from DerivedMesh → Mesh 2018-06-01 17:35:26 +02:00
4fccb8a023 Boolean modifier: fixed crash when applying the modifier 2018-06-01 17:35:26 +02:00
e44743736f Merge branch 'master' into blender2.8
Conflicts:
	source/blender/editors/io/io_collada.c
	source/blender/editors/object/object_bake.c
	source/blender/editors/object/object_edit.c
	source/blender/editors/render/render_internal.c
	source/blender/makesrna/intern/rna_object_api.c
	source/blenderplayer/bad_level_call_stubs/stubs.c
2018-06-01 17:26:36 +02:00
e4a727626e X-Ray: Added a slider for the alpha
- will not render when set to 0.0 for speed reasons. so when user sets
transparency to hide everything the bigger passes will be skipped.
2018-06-01 17:15:35 +02:00
56dc2bf0c5 Workbench: Updated the internal light to have a bit of back lighting 2018-06-01 17:15:35 +02:00
9e09900a30 Fix wrong colors for workbench World Background option. 2018-06-01 17:14:06 +02:00
William Reynish
15e5dbc2c3 UI: tweaks to viewport shading and overlay panel layouts. 2018-06-01 17:14:06 +02:00
0706b410bd UI: use same "Viewport Display" name for scene/object/material panels. 2018-06-01 17:14:06 +02:00
eef18d39cb Fix broken set collection offset from cursor operator. 2018-06-01 17:14:06 +02:00
051e186d5c Cleanup: some more G.main removal from editor code. 2018-06-01 17:08:38 +02:00
b3be71e07a Mesh Batch Cache: Fix memory leak. 2018-06-01 17:07:45 +02:00
72a360827b T54991: Restore support for Motion Path drawing in 2.8
This commit restores support for Motion Path drawing in 2.8 (as it wasn't ported over
to the new draw engines earlier, and the existing space_view3d/drawanimviz.c code was
removed during the Blender Internal removal).

Notes:
* Motion Paths are now implemented as an overlay (enabled by default).
  Therefore, you can turn all of them on/off from the "Overlays" popover

* By and large, we have kept the same draw style as was used in 2.7
  Further changes can happen later following further design work.

* One change from 2.7 is that thicker lines are used by default (2px vs 1px)


Todo's:
* There are some bad-level calls introduced here (i.e. the actgroup_to_keylist() stuff).
  These were introduced to optimise drawing performance (by avoiding full keyframes -> keylist
  conversion step on each drawcall). Instead, this has been moved to the calculation step
  (in blenkernel).  Soon, there will be some cleanups/improvements with those functions,
  so until then, we'll keep the bad level calls.


Credits:
* Clément Foucault (fclem) - Draw Engine magic + Shader Conversion/Optimisation
* Joshua Leung (Aligorith) - COW fixes, UI integration, etc.


Revision History:
See "tmp-b28-motionpath_drawing" branch (rBa12ab5b2ef49ccacae091ccb54d72de0d63f990d)
2018-06-01 16:38:21 +02:00
44a8070db3 Cleanup: fix incorrect contributor information. 2018-06-01 15:47:00 +02:00
06c4106d03 Fix for fix, indentation was accidental 2018-06-01 15:42:00 +02:00
75b2729488 Fix missing braces 2018-06-01 15:37:53 +02:00
50afc430fd Update Flatty themes with the new pulldown background and minor tweaks. 2018-06-01 15:32:46 +02:00
Vuk Gardašević
27881e9948 Fix Add menu issue when there are no collections to instance
Differential Revision: https://developer.blender.org/D3453
2018-06-01 15:27:18 +02:00
13ca63d2ad Draw background on pulldown widgets if the header is transparent.
Since the viewport header now supports transparency, text on pulldowns
can be hard to read if their color matches the viewport content.

Background is drawn using the 'inner' theme color, that was unused until now.
2018-06-01 15:11:38 +02:00
3b05034935 Fix broken logic in make static override operators for Collections.
Was pretty sure I already fixed that some weeks ago... but look like it
was not committed or somehow lost...
2018-06-01 14:31:29 +02:00
ddf2a58282 Mesh: Replace DM for mesh w/ wpaint vertex picking 2018-06-01 14:29:22 +02:00
82b8fd8eaf UI: don't show XYZ text w/ direction buttons 2018-06-01 14:10:43 +02:00
32c12d057f Cleanup: rename vars 2018-06-01 14:01:46 +02:00
be8016908d Mesh: Replace DM for mesh -> curve conversion 2018-06-01 14:01:44 +02:00
4faf9bfbe9 Mesh versions of DerivedMesh access API calls
Add mesh_get_eval_final & mesh_get_eval_deform

Note: these will eventually need to be renamed & moved into BKE.
2018-06-01 13:58:53 +02:00
b85d5b6d52 Cleanup: quiet warning, don't set unused alpha 2018-06-01 13:58:53 +02:00
83a41ccd0a LookDev: make sure lookdev balls are still visible after 'N' 2018-06-01 12:52:10 +02:00
cfdadc7d61 Edit Mode: Fix Edit Object renderability with multi objects edit. 2018-06-01 12:28:32 +02:00
4eb47c303d Fix: raytrace_mirror does not exist anymore
Eevee default material settings were not showing.
2018-06-01 12:14:08 +02:00
0c18024a8d Fix error 2018-06-01 12:04:24 +02:00
c771bbc27e Code cleanup: Compiler warning 2018-06-01 12:01:31 +02:00
01c75c3765 Math: optimizations for 4x4x matrix inverse, multiplications.
In some heavy rigs matrix inverse can be 10% of computation time. This
reduces it to 2% by using Eigen's optimized 4x4 matrix inverse and SSE
matrix multiplication.
2018-06-01 12:00:11 +02:00
719e782f2c Modifiers: tiny optimizations for mesh deform, lattice, kdop. 2018-06-01 12:00:11 +02:00
bcbee4b9a3 Fix missing animation updates when the proxy object is not visible.
The relation was inverted here, for a long time already. The reason is
unclear and in principle it should work fine in the right direction.
2018-06-01 12:00:11 +02:00
1bc801e020 Fix use of uninitialized value in depsgraph. 2018-06-01 12:00:11 +02:00
14c55a5828 Cleanup: long lines 2018-06-01 11:59:15 +02:00
Dalai Felinto
e35dab0fec Fix building for workbench in windows (BLI_INLINE) 2018-06-01 11:55:50 +02:00
0bddf5315f Fix T55282: Modifiers: Removed unnecessary object evaluation 2018-06-01 11:50:53 +02:00
8f24d404fe Removed old mention of CDDerivedMesh 2018-06-01 11:50:53 +02:00
e614a8290c Fix/Workaround T55272: Sculpt/VPaint removes mesh 2018-06-01 11:49:10 +02:00
e8142ad7dc Cleanup: quiet warnings 2018-06-01 11:49:10 +02:00
4683091369 Object Mode: Display loose edges if overlays are enables.
This fix T55280 Loose edges not visible in object mode
2018-06-01 11:36:01 +02:00
d5a359b1d4 Fix: overlays are reset when selection is being performed
/me hits myself in the head. In selection code the flags were not tested
but set directly.
2018-06-01 11:31:30 +02:00
c450966e95 Workbench: Material specific settings for the specular
- Uses the roughness setting of the basic eevee material
- renamed gloss_mir to roughness
- set default of roughness to 0.25
- renamed ray_mirror to metallic
- cleaned up material rna (BI mirror struct)
- use BLINN phong model
- normalize incoming/outgoing specular light
- when using camera oriented studiolight, the SolidLight will be used
for specular highlights
- EXPERIMENT: when in world oriented studiolight only the shadow direction will be used.
- change the settings of the internal light to make scenes more
readable
2018-06-01 11:01:55 +02:00
3b2d3a3cd1 Fix crash switching sculpt/vpaint -> edit mode 2018-06-01 10:34:00 +02:00
7bdc67f5f3 Fix broken 'make single user' operator UI.
Texture option was removed, since BI engine removal...
2018-06-01 10:27:27 +02:00
fe09aa602a 3D View: hide orbit navigation in camera view
Typically for camera views it's nicer not to overlay large widgets,
only include the button to exit camera view.
2018-06-01 10:17:07 +02:00
c338ac9454 Modifiers: ported Soft Body DerivedMesh → Mesh
The simulation doesn't seem to update properly yet.
2018-06-01 10:04:46 +02:00
3cefb27830 Partial Revert of COW/Camera manipulator changes
d64fbe9456 3e26b84397
2018-06-01 09:48:40 +02:00
266fc1c1ff Revert "COW Fix: Lamp manipulators"
This reverts commit 33e45658eb.

No longer needed.
2018-06-01 09:25:24 +02:00
5736157b5e 3D View: respect text option for edit-mode info 2018-06-01 09:22:08 +02:00
a6395cebb7 Error in last commit 2018-06-01 08:31:32 +02:00
c87cfcc8de 3D View: make text overlay optional 2018-06-01 08:26:55 +02:00
63785a889c 3D View: support world background color 2018-06-01 08:16:24 +02:00
35efa1d3d3 Add 'Toggle Header' to header context menu.
Also disable collapsing the header by dragging it up/down. This prevents
accidentally hiding the header when resizing areas.
2018-06-01 02:55:16 +02:00
Dalai Felinto
a63b55f642 Cycles UI: Show pause button only when in rendered mode 2018-05-31 23:58:49 +02:00
Dalai Felinto
a4bb1a5881 Fix render engine info region when overlap and header on bottom
Note there is some talk about changing the position of this (which would be strange in the image editor by the way,
since there we use the bottom for the result of the current pixel when dragging the mouse).

However first I wanted to fix this regardless.
2018-05-31 23:58:48 +02:00
995fa1f4c0 UI: new tool properties space type
This currently shows panels that were in the 2.79 3D view toolbar
which are now popovers.

In some cases it's useful for these to stay open.
This commit adds a space type to do this.

Note this is currently empty in object mode.
2018-05-31 21:45:26 +02:00
14dee6d7a5 UI: support drawing panels from multiple contexts 2018-05-31 21:42:02 +02:00
7c75c2db4f Add Asan support for clang on windows.
This will currently only work for the RelWithDebInfo configuration since asan
does not support the debug crt. for source line information in the reports,
you need a copy of llvm-symbolizer in the blender folder or set the
ASAN_SYMBOLIZER_PATH environment variable to point to it. Currently (as of
6.0.0) llvm-symbolizer does not ship with the binary clang/llvm distribution.

Reviewers: campbellbarton

Differential Revision: https://developer.blender.org/D3446
2018-05-31 11:50:30 -06:00
Dalai Felinto
e51cbce646 Cleanup: Fix indentation 2018-05-31 19:19:27 +02:00
bf4ce5755f Overlay: Add Wireframe overlay.
This overlay is showing mesh topology. It is usable with transparency
even if the mesh order can mess up with the expected result (some object
more prominent than others).

Edge thickness and alpha values are hardcoded for now but can easily be
added to theme or object settings.
2018-05-31 19:09:20 +02:00
712885c30e DRW: Add wireframe buffer texture generation for wireframe drawing.
Only OB_MESH is supported for now.

Creates a simple index buffer with negative indices if the edges is not a
real edge.

Also create the buffer texture representation of this buffer along with the
pos_in_order buffer texture.
2018-05-31 19:09:20 +02:00
f43e3d0b6b DRW: Fix DRW_shgroup_call_procedural_* vertex count. 2018-05-31 19:09:20 +02:00
494470ba23 GPUTexture: Expose GPU_texture_create_buffer and add GL_R32I support. 2018-05-31 19:09:20 +02:00
8789490f96 LoopTri: Fix example code.
For real guys! Test your example code!
2018-05-31 19:09:20 +02:00
71c904433c DRW: Fix stick bones memory leak. 2018-05-31 19:09:20 +02:00
2feed9bdef Fix Collada building... 2018-05-31 18:37:33 +02:00
f71efafe8f Merge branch 'master' into blender2.8
Conflicts:
	source/blender/editors/sculpt_paint/paint_image.c
	source/blender/editors/space_image/image_edit.c
	source/blender/editors/space_image/image_ops.c
	source/blender/makesrna/intern/rna_material.c
	source/blender/makesrna/intern/rna_sculpt_paint.c
	source/blender/makesrna/intern/rna_space.c
	source/blenderplayer/bad_level_call_stubs/stubs.c
2018-05-31 18:35:14 +02:00
cfea9c261c Cleanup: Remove G.main from some editor files. 2018-05-31 18:23:20 +02:00
df22cd9ce1 Depsgraph: Fixes to prevent object duplicate to jump
This includes:

- Skip OB_RECALC_TIME tag from object duplicate operator
  not sure why it is needed: even if original object was
  animated, duplicating it will copy evaluated values.

- Don't tag whole ID for update when updating it after
  relations rebuilt. Use the same trickery to detect
  whether animation is to be re-evaluated or not as is
  done for update flag=0.

- Don't tag datablocks which are expanded for update
  of copy-on-write.

- Avoid flush along relation from copy-on-write
  operation in action. This will not invalidate any
  pointers in the copied datablock since we don't
  reference anything in the action.
2018-05-31 18:07:55 +02:00
3352dd3a3f Depsgraph: Remove unused flags
They are no longer needed after the active depsgraph concept is here.
2018-05-31 18:07:55 +02:00
126e6c8e1d Transform: Read all data from original objects
This is now guaranteed to be in sync with evaluated state for an active
dependency graph.

Solves issue with duplicating animated object.
2018-05-31 18:07:55 +02:00
59a516913e Depsgraph: Copy evaluated data to original datablock
Only do it for active dependency graph.

Currently covers animation, drivers, object and pose channel matricies.
2018-05-31 18:07:55 +02:00
b5b1f9d11c Depsgraph: Consider depsgraphs used by workspace as active
Will cause some bad behavior when object is shared across multiple
visible view layers with different overrides. Accept it for now,
and possibly force single view layer later.
2018-05-31 18:07:55 +02:00
7a4b0ff358 Depsgraph: Begin concept of active dependency graph
When active dependency graph is evaluated, it will apply animation,
drivers and scalar evaluation data (such as object matrix) to an
original datablock. This way operators and tools can easily read
data from original datablock.

This will simplify porting them to copy-on-write, and solve issues
when some operator will allocate new datablock based on original one,
and will want to read data from it.
2018-05-31 18:07:55 +02:00
d4daf9c00d Depsgraph: Forbid update flush to go from copy-on-write to animation 2018-05-31 18:07:55 +02:00
cd702db338 Animation: Pass dependency graph to animation system
This way we allow animation system to make decisions based on which
context dependency graph is coming from, and whether it belongs to
an active edit window or not.
2018-05-31 18:07:55 +02:00
48ea2131aa Sequencer: Make dependency graph part of sequencer context
Currently unused, but will be needed soon to deal with active edit
window context.
2018-05-31 18:07:55 +02:00
cb614107d3 UI: fix own error switching fake space types 2018-05-31 18:00:17 +02:00
5a82aee9e6 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/alembic/intern/abc_exporter.cc
	source/blender/blenkernel/BKE_mball.h
	source/blender/blenkernel/intern/depsgraph.c
	source/blender/blenkernel/intern/mball.c
	source/blender/editors/object/object_add.c
	source/blender/render/intern/source/convertblender.c
2018-05-31 16:57:39 +02:00
8d53e8cd02 UI: hide user preferences from space menu
See T54744
2018-05-31 16:46:24 +02:00
da11e33b26 Cleanup: remove G.main from BKE mball code. 2018-05-31 16:44:05 +02:00
361b3eb88e Cleanup: warning 2018-05-31 16:36:24 +02:00
eb1feb9f4a Merge branch 'master' into blender2.8
Conflicts:
	source/blender/editors/object/object_add.c
	source/blender/editors/object/object_select.c
	source/blender/editors/space_outliner/outliner_edit.c
2018-05-31 16:21:47 +02:00
0b396bc15b Minor tweaks to labels 2018-05-31 16:05:47 +02:00
16100f8261 Cleanup: get rid of last G.main usages in BKE library code. 2018-05-31 16:04:04 +02:00
b809340960 Merge branch 'master' into blender2.8
Conflicts:
	intern/cycles/blender/blender_curves.cpp
	source/blender/blenkernel/BKE_particle.h
	source/blender/blenkernel/intern/modifier.c
	source/blender/blenkernel/intern/object_update.c
	source/blender/blenkernel/intern/particle_system.c
	source/blender/editors/object/object_modifier.c
	source/blender/editors/physics/physics_fluid.c
	source/blender/makesrna/intern/rna_particle.c
	source/blender/modifiers/intern/MOD_particlesystem.c
2018-05-31 15:37:15 +02:00
b53d358261 Cleanup: remove G.main from BKE modifier. 2018-05-31 15:24:30 +02:00
3248ac5e83 Cleanup: Remove unused variable 2018-05-31 15:02:12 +02:00
Dalai Felinto
25e5ec245c Support Move / Link to collection in the outliner as well 2018-05-31 14:52:05 +02:00
Dalai Felinto
d0af8edcd1 Outliner: Expose collections editors poll in ED_outliner.h 2018-05-31 14:52:05 +02:00
Dalai Felinto
eaad4caa56 Link to Collection - Add shortcut (Shift + M) 2018-05-31 14:52:05 +02:00
54e92bbd29 Fix: View All in Action Editor zoomed in far enough to enter "crazy mode" with a single keyframe
Now, when there's just a single keyframe, pressing HomeKey will instead
just center the view instead of trying to do "frame range" + margin.
2018-05-31 14:51:28 +02:00
4e96bff938 Update CoW when adding/removing pose in pose library 2018-05-31 13:53:40 +02:00
f56a9fbad5 Depsgraph: Remove the "disable-copy-on-write" option completely
After discussion with Sergey and Dalai, we have decided to remove
this option completely. We're getting to the point where it is almost
impossible to really use 2.8 without COW, and keeping the old option
running ends up diverting dev resources away towards tracking down
and fixing problems with a parallel system that will be going away.
2018-05-31 13:43:00 +02:00
9b4e56c091 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/blenkernel/BKE_camera.h
	source/blender/blenkernel/BKE_dynamicpaint.h
	source/blender/blenkernel/BKE_object.h
	source/blender/blenkernel/intern/camera.c
	source/blender/blenkernel/intern/dynamicpaint.c
	source/blender/blenkernel/intern/object.c
	source/blender/blenkernel/intern/smoke.c
	source/blender/editors/object/object_transform.c
	source/blender/editors/physics/dynamicpaint_ops.c
	source/blender/editors/space_view3d/view3d_edit.c
	source/blender/editors/space_view3d/view3d_view.c
	source/blender/modifiers/intern/MOD_dynamicpaint.c
	source/blenderplayer/bad_level_call_stubs/stubs.c
2018-05-31 12:57:24 +02:00
d41bf6b8e8 Edit last commit
Better check if the property is set in case others want to use this
property w/o SKIP_SAVE set.
2018-05-31 12:54:44 +02:00
46508430f8 Fix tool-system re-using last space type
Even though the regression is somehow caused by 03a80facfc
this value shouldn't be reused so apply an unrelated fix.
2018-05-31 12:51:47 +02:00
28369f725c Cleanup: remove G.main from BKE object
Had to add some G.main to modifiers, but in 2.8 we do not need that
anymore, so it's not that bad! ;)
2018-05-31 12:27:47 +02:00
23e375a281 Revert "Tag COW when applying pose from pose library"
This reverts commit 24b03729ae5ba4561ace8cbfb2d56cdbde781589; committed
too soon.
2018-05-31 12:00:18 +02:00
24b03729ae Tag COW when applying pose from pose library
Related to T55232
2018-05-31 11:59:04 +02:00
9948e26e14 Fix depsgrah copying and evaluating hidden collections. 2018-05-31 11:43:29 +02:00
1e6108e972 OpenColorIO: cache multiple shaders instead of just one.
Fixes constant shader and texture rebuilding when doing animation playback
with multiple editors that use different view transforms.
2018-05-31 11:21:19 +02:00
46cfa605c3 Cleanup: Reduce indentation level 2018-05-31 11:17:57 +02:00
17f458ff32 Merge branch 'master' into blender2.8 2018-05-31 11:08:02 +02:00
24d1829243 Cleanup: nuke G.main out of BKE PackedFile code. 2018-05-31 11:07:14 +02:00
fcfe1963a6 Fix depsgraph copying and evaluating hidden objects. 2018-05-31 10:37:13 +02:00
5cbad89637 Cleanup: unused defines 2018-05-31 10:15:48 +02:00
12ab59a2d6 Merge branch 'master' into blender2.8 2018-05-31 10:03:15 +02:00
84a9647f22 Cleanup: use doxy sections for space types
Also use struct names in enum/define comments.
2018-05-31 09:49:58 +02:00
d9324b61d5 Cleanup: return types in stubs 2018-05-31 09:49:44 +02:00
e4afccf388 Depsgraph: optimization of driver evaluation with many drivers. 2018-05-31 09:46:21 +02:00
e910765ad0 WM: Use tool-system for setting brushes
This sets the tool instead of the brush, with cycling support.
2018-05-31 09:04:15 +02:00
81bf9a41e1 Tool System: Utility to set the tool by name
Wrapper for the Python operator.
2018-05-31 09:02:43 +02:00
Hristo Gueorguiev
6c0705009e Fix OpenCL compilation error - BPT without SSS. 2018-05-31 00:08:56 +02:00
fbd614f1fa Workbench: Highlights
Made the highlights darker (using the defaults of blender 2.7
- sharpness = 50
- spec color = 0.025 (I bumped it to 0.1)
- added a log2 to the frontal camera light to reveal more details of the
mesh
2018-05-30 22:19:10 +02:00
16d3f4db4c Tool System: optionally cycle tools in a group
Add the ability for key bindings to set a tool-group,
which cycles to the next tool when the tool is already active.
2018-05-30 22:17:37 +02:00
264a4a8f97 RNA: add tool index access
Needed for changing the active tool from Python.
2018-05-30 22:16:13 +02:00
84e5c981dc UI: toolbars now redraw on tool change 2018-05-30 22:16:13 +02:00
f5f25b843e Removed Object color from workbench. Added Highlights to FLAT shading. 2018-05-30 20:34:29 +02:00
eb0fcd4574 Generic Viewport Panel for Materials
Is enabled for all render engines as workbench will be rendering
SOLID/Texture modes and uses these settings.
2018-05-30 19:57:51 +02:00
1f693aefca Cleanup: style/whitespace
Also use 'uint'.
2018-05-30 19:49:33 +02:00
61fc9fcffa Cleanup: redundant check 2018-05-30 19:49:33 +02:00
0b6603d9b6 Fix selection randomly failing with border render.
We no longer user scissor for 3D viewport drawing, and some selection
code assumed it still. This also cleans up unnecessary scissor test
switching, we only have it temporarily enabled now.
2018-05-30 19:34:12 +02:00
c0f42a7526 make.bat: fix support for building with just the build tools installed. 2018-05-30 11:11:35 -06:00
c86437cc83 Fix Cycles UI script error with denoising. 2018-05-30 18:22:00 +02:00
cce16df10f Fix Cycles viewport render stuck with curve objects.
We should solve this better by making the depsgraph convert all curves to
meshes, for now ensure we don't to depsgraph tags during export.
2018-05-30 18:17:49 +02:00
17ce968c59 Depsgraph API: renaming, more granular update information.
* depsgraph.ids: all evaluated datablocks in the depsgraph
* depsgraph.objects: all evaluated objects in the depsgraph
* depsgraph.object_instances: all object instances to display or render
* depsgraph.updates: list of updates to datablocks
2018-05-30 18:17:49 +02:00
08862b8246 Render API: rename some API functions back to earlier names.
Their purpose is the same, no reason to break API compatibility here.
2018-05-30 18:17:49 +02:00
85ce4d957c UI: use split property layout for some panels
Object, render, scene properties now use split-property layout,
also cycles interface.

Patch by @billreynish w/ minor edits.
2018-05-30 18:00:11 +02:00
9fabe3ef53 Cleanup: quiet warning 2018-05-30 17:38:07 +02:00
efd0333a9c UI: fix property split w/ color buttons & empty text 2018-05-30 17:29:20 +02:00
1272936773 Tweak for previous commit: Just group all bone properties under the bone name
After more testing, I realised that bendy bone properties should also be grouped,
but probably all other per-bone settings too. Now, just group all of them, since
it's easier for everyone this way.
2018-05-30 17:05:37 +02:00
7661f8a65b Modifiers: Bring back custom data referencing logic
Brings dependency graph evaluation time to similar time than 2.79
for file reported in T55228.
2018-05-30 17:00:47 +02:00
41fac4fa76 Modifiers: Make input of modifier stack referencing copied CD layers
The idea is to allow modifier stack to reference custom data layers
from copied version of mesh datablock.
2018-05-30 17:00:47 +02:00
25d4d43491 Modifiers: Restore duplication of referenced layers
Was no reason to remove those calls, it was always a plan to bring
referenced layers back eventually.
2018-05-30 17:00:47 +02:00
cdfa517760 Insert Keyframe: Change default behaviour for how F-Curves get grouped
For many years, animators have been complaining about how keyframing a (transform)
property directly would leave them ungrouped, while keyframing them using a Keying Set
would put them into a group based on the name of the keyingset.

This commit attempts to improve (unify + make consistent) the default behaviour:
* All object transforms now get added to an "Object Transforms" group,
  regardless of whether they were added individually via buttons or keyingset
* All bone transforms now get added to a group corresponding to the name of the bone
  instead of only the ones added via keyingset
2018-05-30 16:46:12 +02:00
23b455a891 Cleanup: Reuse existing scene pointer 2018-05-30 16:46:11 +02:00
92e3b3839b Merge branch 'master' into blender2.8
Conflicts:
	source/blender/editors/space_outliner/outliner_intern.h
2018-05-30 16:32:49 +02:00
10a2562bc5 Fix missing movieclip ID type in allowed ones for Outliner... 2018-05-30 16:14:55 +02:00
f1f1c32849 Object Modes: don't de-select others when activating 2018-05-30 15:51:49 +02:00
Dalai Felinto
5b8fe8324b Fix render info not working with overlap regions 2018-05-30 15:45:40 +02:00
38957c1838 Object Modes: stay in object mode when setting active
When activating an object from the 3D view or outliner,
keep the newly selected object in object mode.
2018-05-30 15:33:05 +02:00
5954a5c465 Object Modes: pose support for generic mode exit 2018-05-30 15:33:05 +02:00
375c1eab65 Cleanup: RNA naming, use highlight as suffux
This is whats done already elsewhere.
2018-05-30 15:33:05 +02:00
d0d2fc9819 Cleanup: whitespace 2018-05-30 15:26:57 +02:00
30fb455977 Initial 'fix' for Sculpt & COW - shallow copy sculpt data into COWed object.
Still a lot to fix here, right now you can get sculpt drawing updating
when you come from Edit mode, not from Object mode... Go figure...
2018-05-30 15:15:35 +02:00
35a6d9ec55 ID copy: Add flag which allows custom data to reference original datablock 2018-05-30 15:07:59 +02:00
acaf46db0e Workbench: Specular Highlights
Added specular highlights for:
 - Solid studio shading
 - Texture studio shading
2018-05-30 14:42:07 +02:00
29f9a19708 Modifier stack: Avoid roundtrip from mesh to DM back to mesh
Saves quite a bit of CPU ticks per mesh update, giving measurable
speedup for file from T55228.

Memory usage goes up a it, most likely due to evaluated mesh having
more custom data layers than corresponding DM does.
2018-05-30 14:29:05 +02:00
da16cb1511 Eevee: Keep track on whether orco was allocated or not
If it's coming from vertex data, we must not free that pointer.
2018-05-30 14:29:05 +02:00
f03953ae06 Object Mode: Add Texture space visualization. 2018-05-30 14:27:40 +02:00
ccb7f1d4f1 Fix T55256: Animation Noise modifier does not update on value change
Animation needs tagging in depsgraph (for animation refresh), instead of only
tagging AnimData->recalc
2018-05-30 14:22:25 +02:00
26f42a1928 Fix: Toggling "mute" toggle in animation editors didn't work with copy-on-write
Tested on Autumn run cycle by muting master bone animation - when working, the
dog should run forwards when the master bone animation is being muted.
2018-05-30 14:22:25 +02:00
5c17dbd991 Fix missing Cycles 3D viewport updates when editing materials, lamps.
This introduces a new depsgraph API for getting updated datablocks,
rather than getting it from bpy.data.

* depsgraph.ids_updated gives a list of all datablocks in the depsgraph
  which have been updated.
* depsgraph.id_type_updated('TYPE') is true if any datablock of the given
  type has been added, removed or modified.

More API updates are coming to properly handle multiple depsgraphs and
finer update granularity, but this should make Cycles work again.
2018-05-30 14:07:23 +02:00
8ed723745e Fix unnecessary Cycles render updates when selecting objects. 2018-05-30 14:07:22 +02:00
292125bfd3 Fix broken meshdeform modifier after recent cleanup. 2018-05-30 14:02:28 +02:00
9c2db1455f Keymap: group paint modes, reorder enum
Menu now matches the keymap.
2018-05-30 13:47:24 +02:00
eb24c9a1e1 Keymap: Pose/Weight-Paint modes now co-exist
Use the same key for pose & weight paint mode (instead of texture paint)

This makes more sense since pose/weight paint modes
are often used in combination.
2018-05-30 12:56:38 +02:00
03ec3a6141 Cleanup: remove '.' 2018-05-30 12:56:38 +02:00
48ceeead10 DRW: Instance Data: Replace with static allocation that can be referenced.
This mean you can store data used for drawing inside the object engine
data.

Also fixes T55243 Crash in ASAN debug builds due to use-after-free memory in draw code - instances issue?
2018-05-30 12:25:20 +02:00
10c0bba28e Eevee: Hair: Fix hair strip view Position. 2018-05-30 12:25:20 +02:00
7e8fd563c6 DRW: Add compile option to disable deferred compilation.
This maybe usefull for debugging.
2018-05-30 12:25:20 +02:00
93de6ca2db DRW: Instance selection id: use Batch buffers instead of DRWInstanceData
This is motivated by the refactor of DRWInstanceData to be actual non
contiguous mempools.
2018-05-30 12:25:20 +02:00
0488b728eb Eevee: Add support for the Hair info node.
Only the random output is not supported for the moment.
2018-05-30 12:25:20 +02:00
10f6450ef2 Eevee: Add support for new Hair geometry system.
This now can shade actual poly strips that mimics cylinders.
This makes hair coverage exact compared to the line method and result in
smoother fading hair.

This does make the sampling a bit more exact but needs more samples to
converge properly.
2018-05-30 12:25:20 +02:00
501c0b1df8 GPUMaterial: Add support for hair vertex color, uvs and orco. 2018-05-30 12:25:20 +02:00
328f8dc21c DRW: Add new GPU hair system.
This new system use transform feedback to compute subdivided hair points
position. For now no smoothing is done between input points.

This new system decouple the strands data (uv, mcol) with the points
position, requiring less update work if only simulation is running.

In the future, we can have compute shader do the work of the feedback
transform pass since it's really what it's meant to. Also we could generate
the child particles during this pass, releasing some CPU time.

draw_hair.c has been created to handle all of the Shading group creations
as well as subdivision shaders.

We store one final batch per settings combination because multiple viewport
or render could use the same particle system with a different subdivision
count or hair shape type.
2018-05-30 12:25:20 +02:00
2faef3473c Cycles: Use new internal hair shape properties.
The do_version actually copy the existing custom properties to the internal
ones, because theses properties are straight port from cycles.
2018-05-30 12:25:20 +02:00
e0e3038b1e Hair Particles: DNA: Add properties for new GPU hairs.
Hair Particles shape properties are ported from cycles. Thoses properties
have the same defaults and have a do_version of their own. Cycles will use
theses properties instead of its custom ones.

Some realtime engine specific settings are also added to scene->r because
it's much easier to control as global values.

Bumping Version number so cycles can do its own do_version on top of the
default settings.
2018-05-30 12:25:20 +02:00
ec6da3d72e DRW: Add new per drawcall option to bypass culling. 2018-05-30 12:25:20 +02:00
201952aed2 GPUTexture: Add support for GL_RGBA16 texture format. 2018-05-30 12:25:20 +02:00
3bc0cb08b8 DRW: Add DRW_CALL_PROCEDURAL DRWCall type.
This mimics the behaviour of DRW_shgroup_empty_tri_batch_create and will
replace it eventually.

The advantage is that it's compatible with transform feedback.
2018-05-30 12:25:20 +02:00
7b9a0ed8c4 BLI: Utils: Add Macro that compute the number of digits in integers type.
Usefull if you want to create char chains to contains hashes of a certain
type.
2018-05-30 12:25:20 +02:00
08d325805f Keymap: add back sculpt keys
Shouldn't have been removed in recent keymap edits.
2018-05-30 12:18:26 +02:00
72f4ac99c7 Cleanup/fix wrong modifiers targets handling in COW context.
Modifiers stack only get COW/evaluated IDs, so no need to go auery again
DEG for those. Further more, now unified handling of EditBMesh case (was
done on case-by-case basis in a few modifiers, not all for some reason).

We are still missing the ability to get final and cage deformed meshes
when in Edit mode though, this is to be defined/implemented in depsgraph.
2018-05-30 12:04:06 +02:00
e55c1a9b5a Depsgraph: Add TODO about backing up evaluated state of ID 2018-05-30 12:02:32 +02:00
edc1e65809 Add deformed evaluated mesh to object
This is a first step to have correspondence of legacy derivedDeform
within a new formulation. Only base ground for now to support file
reading, copy-on-write remapping and such.
2018-05-30 11:49:45 +02:00
6afa0a7a50 Fix T55253: Camera lens can't be edited after keyframing it
Bring back animation channel exception for tag flag=0.
2018-05-30 11:26:19 +02:00
9abbf73d3f Cleanup: Wrap object runtime eval members into own struct 2018-05-30 11:11:03 +02:00
a01244cade Outliner: support toggling non-active edit/pose mode objects
Support switching non-active objects in/out of a mode from the outliner.

- This allows users to change which objects are in a mode w/o
  having to exit the mode and change seleciton.
- Changing the mode of the active object applies to all other objects.
- By convention setting a mode selects, removing de-selects,
  this is done for convenience so switching to a mode from object mode
  maintains the set of objects in the current mode.

See: T55246
2018-05-30 10:29:41 +02:00
47a8d3b880 UI: Show outliner icon highlight w/ non-active edit-mode objects 2018-05-30 10:29:41 +02:00
e054b7f251 BKE_object: Add BKE_object_data_is_in_editmode 2018-05-30 10:29:41 +02:00
01f9e13c30 Cleanup: use 'e' prefix for enum types 2018-05-30 10:29:41 +02:00
d709705203 Cleanup: Naming, match policy with rest of copy-on-write design 2018-05-30 10:24:54 +02:00
301a27187c Cleanup: More typed allocation type enum usage
Majority of the code is EOL, but still handy for debug purposes.
2018-05-30 10:22:28 +02:00
b54cc68365 Cleanup: Use typed allocation type enum in custom data API 2018-05-30 10:20:22 +02:00
0ed2e254bb Use enum for custom data allocation type
Allows to easily see human readable value in debugger.
2018-05-30 10:17:09 +02:00
cb22caa8c7 Merge branch 'master' into blender2.8 2018-05-30 08:49:34 +02:00
18c12803bd Edit Mode: add success return value
Also remove fix for T6614, since BKE_object_obdata_is_libdata
no longer checks proxy.
2018-05-30 08:41:06 +02:00
0e0502cbdf Merge branch 'master' into blender2.8 2018-05-30 07:34:22 +02:00
2c03d6a12b DNA: add OB_DATA_SUPPORT_EDITMODE macro 2018-05-30 07:31:35 +02:00
9992079d59 EEVEE: LookDev, reset camera settings 2018-05-29 22:02:36 +02:00
36e6d44c90 Fix last commit. 2018-05-29 15:58:56 -03:00
00dc1c08aa Fix T55223: Crash when changing lattice resolution. 2018-05-29 15:39:44 -03:00
f8908f0d43 Correct last commit
Left unneeded code in space_context_cycle_invoke
2018-05-29 18:18:36 +02:00
e9cd2fb23b Keymap: partially implement changes from T55162
- Use Tab key for search.
- Number keys switch modes.
- The number of the current mode can open a submode menu
  (currently only works for edit-mode)
- Ctrl-Tab, Ctrl-Shift-Tab - cycle workspaces.
2018-05-29 17:52:27 +02:00
341dbce1b7 Painfully enhanced columns/rows computation to make best use of available space.
Now layout will use less columns than possible, if it does not increase
number of rows. Allows to fill more evenly available space.

Also fixed some quirks and corner-cases issues.
2016-12-03 15:09:25 +01:00
c1db8d6983 Fix logical error, in our current UI height is not really adaptative, so we want max to work with heights, not average ones.
Also, add another experimental example of gridflow layout usage (needed
some hacks/tweaks to low-level UI code, by default our buttons tend to
get way to much width than actually needed!).
2016-12-03 15:09:25 +01:00
ffb515410c Factorize gridflow computation code. 2016-12-03 15:09:25 +01:00
658a7cb46f Fix gridflow layout logic, and building with bplayer.
Also add the 'modulo' option for columns number (i.e. set number
automatically, but only allow multiples of given number).

Notes: changes to properties_data_mesh.py are just for testing
obviously, will be reverted for final patch!
2016-12-03 15:09:25 +01:00
51be9ff07a Add gridflow layout RNA API 2016-12-03 15:09:25 +01:00
2de27897f3 Initial (and theorical) code for grid flow layout.
Needs RNA API, and... testing! :P
2016-12-03 15:09:25 +01:00
1676 changed files with 78306 additions and 31301 deletions

View File

@@ -523,9 +523,7 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
-fsanitize=enum \
-fsanitize=float-cast-overflow \
-fsanitize=float-divide-by-zero \
-fsanitize=leak \
-fsanitize=nonnull-attribute \
-fsanitize=object-size \
-fsanitize=returns-nonnull-attribute \
-fsanitize=signed-integer-overflow \
-fsanitize=undefined \
@@ -533,6 +531,9 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
-fno-sanitize=alignment \
")
if(NOT MSVC) # not all sanitizers are supported with clang-cl, these two however are very vocal about it
set(_asan_defaults "${_asan_defaults} -fsanitize=leak -fsanitize=object-size" )
endif()
set(COMPILER_ASAN_CFLAGS "${_asan_defaults}" CACHE STRING "C flags for address sanitizer")
mark_as_advanced(COMPILER_ASAN_CFLAGS)
set(COMPILER_ASAN_CXXFLAGS "${_asan_defaults}" CACHE STRING "C++ flags for address sanitizer")
@@ -540,9 +541,15 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
unset(_asan_defaults)
if(NOT MSVC)
find_library(COMPILER_ASAN_LIBRARY asan ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES})
else()
find_library( COMPILER_ASAN_LIBRARY NAMES clang_rt.asan-x86_64
PATHS [HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\LLVM\\LLVM;]/lib/clang/7.0.0/lib/windows
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\LLVM\\LLVM;]/lib/clang/6.0.0/lib/windows
)
endif()
mark_as_advanced(COMPILER_ASAN_LIBRARY)
endif()
endif()
@@ -810,14 +817,20 @@ set(PLATFORM_LINKLIBS "")
set(PLATFORM_LINKFLAGS "")
set(PLATFORM_LINKFLAGS_DEBUG "")
if(WITH_COMPILER_ASAN)
if (NOT CMAKE_BUILD_TYPE MATCHES "Release")
if(WITH_COMPILER_ASAN)
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${COMPILER_ASAN_CFLAGS}")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} ${COMPILER_ASAN_CFLAGS}")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${COMPILER_ASAN_CXXFLAGS}")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${COMPILER_ASAN_CXXFLAGS}")
set(PLATFORM_LINKFLAGS_DEBUG "${COMPILER_ASAN_LIBRARY}")
if(MSVC)
set(COMPILER_ASAN_LINKER_FLAGS "/FUNCTIONPADMIN:6")
endif()
set(PLATFORM_LINKLIBS "${PLATFORM_LINKLIBS};${COMPILER_ASAN_LIBRARY}")
set(PLATFORM_LINKFLAGS "${COMPILER_ASAN_LIBRARY} ${COMPILER_ASAN_LINKER_FLAGS}")
set(PLATFORM_LINKFLAGS_DEBUG "${COMPILER_ASAN_LIBRARY} ${COMPILER_ASAN_LINKER_FLAGS}")
endif()
endif()
#-----------------------------------------------------------------------------

View File

@@ -39,5 +39,6 @@ if(BUILD_MODE STREQUAL Release)
PREFIX ${BUILD_DIR}/openal
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openal ${DEFAULT_CMAKE_FLAGS} ${OPENAL_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/openal
PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/openal/src/external_openal < ${PATCH_DIR}/openal.diff
)
endif()

View File

@@ -56,24 +56,27 @@ if(WIN32)
# For OIIO and OSL
set(COMMON_DEFINES /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS)
# TODO FIXME highly MSVC specific
if(WITH_OPTIMIZED_DEBUG)
set(BLENDER_CMAKE_C_FLAGS_DEBUG "/MTd /O2 /Ob2 /DNDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
else()
set(BLENDER_CMAKE_C_FLAGS_DEBUG "/MTd /Zi /Ob0 /Od /RTC1 /D_DEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
if(MSVC_VERSION GREATER 1909)
set(COMMON_MSVC_FLAGS "/Wv:18") #some deps with warnings as error aren't quite ready for dealing with the new 2017 warnings.
endif()
set(BLENDER_CMAKE_C_FLAGS_MINSIZEREL "/MT /O1 /Ob1 /D NDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(BLENDER_CMAKE_C_FLAGS_RELEASE "/MT /O2 /Ob2 /DNDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(BLENDER_CMAKE_C_FLAGS_RELWITHDEBINFO "/MT /Zi /O2 /Ob1 /D NDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
if(WITH_OPTIMIZED_DEBUG)
set(BLENDER_CMAKE_CXX_FLAGS_DEBUG "/MTd /O2 /Ob2 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(BLENDER_CMAKE_C_FLAGS_DEBUG "/MTd ${COMMON_MSVC_FLAGS} /O2 /Ob2 /DNDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
else()
set(BLENDER_CMAKE_CXX_FLAGS_DEBUG "/D_DEBUG /D PLATFORM_WINDOWS /MTd /Zi /Ob0 /Od /RTC1 /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(BLENDER_CMAKE_C_FLAGS_DEBUG "/MTd ${COMMON_MSVC_FLAGS} /Zi /Ob0 /Od /RTC1 /D_DEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
endif()
set(BLENDER_CMAKE_CXX_FLAGS_MINSIZEREL "/MT /O1 /Ob1 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(BLENDER_CMAKE_CXX_FLAGS_RELEASE "/MT /O2 /Ob2 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(BLENDER_CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MT /Zi /O2 /Ob1 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(BLENDER_CMAKE_C_FLAGS_MINSIZEREL "/MT ${COMMON_MSVC_FLAGS} /O1 /Ob1 /D NDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(BLENDER_CMAKE_C_FLAGS_RELEASE "/MT ${COMMON_MSVC_FLAGS} /O2 /Ob2 /DNDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(BLENDER_CMAKE_C_FLAGS_RELWITHDEBINFO "/MT ${COMMON_MSVC_FLAGS} /Zi /O2 /Ob1 /D NDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
if(WITH_OPTIMIZED_DEBUG)
set(BLENDER_CMAKE_CXX_FLAGS_DEBUG "/MTd ${COMMON_MSVC_FLAGS} /O2 /Ob2 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
else()
set(BLENDER_CMAKE_CXX_FLAGS_DEBUG "/D_DEBUG /D PLATFORM_WINDOWS /MTd ${COMMON_MSVC_FLAGS} /Zi /Ob0 /Od /RTC1 /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
endif()
set(BLENDER_CMAKE_CXX_FLAGS_MINSIZEREL "/MT /${COMMON_MSVC_FLAGS} /O1 /Ob1 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(BLENDER_CMAKE_CXX_FLAGS_RELEASE "/MT ${COMMON_MSVC_FLAGS} /O2 /Ob2 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(BLENDER_CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MT ${COMMON_MSVC_FLAGS} /Zi /O2 /Ob1 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(PLATFORM_FLAGS)
set(PLATFORM_CXX_FLAGS)

View File

@@ -0,0 +1,13 @@
diff -Naur external_openal_original/CMakeLists.txt external_openal/CMakeLists.txt
--- external_openal_original/CMakeLists.txt 2016-01-24 20:12:39 -0700
+++ external_openal/CMakeLists.txt 2018-06-02 12:16:52 -0600
@@ -885,7 +885,8 @@
OPTION(ALSOFT_REQUIRE_MMDEVAPI "Require MMDevApi backend" OFF)
IF(HAVE_WINDOWS_H)
# Check MMSystem backend
- CHECK_INCLUDE_FILES("windows.h;mmsystem.h" HAVE_MMSYSTEM_H -D_WIN32_WINNT=0x0502)
+ set(CMAKE_REQUIRED_FLAGS "-D_WIN32_WINNT=0x0502")
+ CHECK_INCLUDE_FILES("windows.h;mmsystem.h" HAVE_MMSYSTEM_H)
IF(HAVE_MMSYSTEM_H)
CHECK_SHARED_FUNCTION_EXISTS(waveOutOpen "windows.h;mmsystem.h" winmm "" HAVE_LIBWINMM)
IF(HAVE_LIBWINMM)

View File

@@ -10,8 +10,8 @@ diff -Naur osl/src/external_osl/src/cmake/flexbison.cmake osl_bak/src/external_o
MAIN_DEPENDENCY ${flexsrc}
DEPENDS ${${compiler_headers}}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} )
--- a/src/include/OSL/oslconfig.h 2016-10-31 16:48:19 -0600
+++ b/src/include/OSL/oslconfig.h 2018-05-27 11:18:08 -0600
--- osl/src/external_osl/src/include/OSL/oslconfig.h 2016-10-31 16:48:19 -0600
+++ osl/src/external_osl/src/include/OSL/oslconfig.h 2018-05-27 11:18:08 -0600
@@ -44,12 +44,18 @@
// same if another packages is compiling against OSL and using these headers
// (OSL may be C++11 but the client package may be older, or vice versa --

View File

@@ -14,10 +14,18 @@ if NOT "%1" == "" (
set BuildDir=VS14
goto par2
)
if "%1" == "2017" (
echo "Building for VS2017"
set VSVER=15.0
set VSVER_SHORT=15
set BuildDir=VS15
goto par2
)
)
:usage
Echo Usage build_deps 2013/2015 x64/x86
Echo Usage build_deps 2013/2015/2017 x64/x86
goto exit
:par2
if NOT "%2" == "" (
@@ -31,6 +39,10 @@ if NOT "%2" == "" (
if "%1" == "2015" (
set CMAKE_BUILDER=Visual Studio 14 2015
)
if "%1" == "2017" (
set CMAKE_BUILDER=Visual Studio 15 2017
)
goto start
)
if "%2" == "x64" (
@@ -43,6 +55,10 @@ if NOT "%2" == "" (
if "%1" == "2015" (
set CMAKE_BUILDER=Visual Studio 14 2015 Win64
)
if "%1" == "2017" (
set CMAKE_BUILDER=Visual Studio 15 2017 Win64
)
goto start
)
)

View File

@@ -32,6 +32,7 @@ macro(BLENDER_SRC_GTEST_EX NAME SRC EXTRA_LIBS DO_ADD_TEST)
${EXTRA_LIBS}
${PLATFORM_LINKLIBS}
bf_testing_main
bf_intern_eigen
bf_intern_guardedalloc
extern_gtest
extern_gmock

View File

@@ -352,6 +352,11 @@ function(SETUP_LIBDIRS)
endif()
endfunction()
macro(setup_platform_linker_flags)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${PLATFORM_LINKFLAGS}")
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} ${PLATFORM_LINKFLAGS_DEBUG}")
endmacro()
function(setup_liblinks
target
)

View File

@@ -31,7 +31,8 @@ endif()
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
set(MSVC_CLANG On)
set(MSVC_REDIST_DIR $ENV{VCToolsRedistDir})
set(VC_TOOLS_DIR $ENV{VCToolsRedistDir} CACHE STRING "Location of the msvc redistributables")
set(MSVC_REDIST_DIR ${VC_TOOLS_DIR})
if (DEFINED MSVC_REDIST_DIR)
file(TO_CMAKE_PATH ${MSVC_REDIST_DIR} MSVC_REDIST_DIR)
else()
@@ -149,7 +150,7 @@ set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} /MT")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /MT")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} /MT")
set(PLATFORM_LINKFLAGS "/SUBSYSTEM:CONSOLE /STACK:2097152 /INCREMENTAL:NO ")
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} /SUBSYSTEM:CONSOLE /STACK:2097152 /INCREMENTAL:NO ")
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} /NODEFAULTLIB:msvcrt.lib /NODEFAULTLIB:msvcmrt.lib /NODEFAULTLIB:msvcurt.lib /NODEFAULTLIB:msvcrtd.lib ")
# Ignore meaningless for us linker warnings.
@@ -162,7 +163,7 @@ else()
set(PLATFORM_LINKFLAGS "/MACHINE:IX86 /LARGEADDRESSAWARE ${PLATFORM_LINKFLAGS}")
endif()
set(PLATFORM_LINKFLAGS_DEBUG "/IGNORE:4099 /NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:libc.lib")
set(PLATFORM_LINKFLAGS_DEBUG "${PLATFORM_LINKFLAGS_DEBUG} /IGNORE:4099 /NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:libc.lib")
if(NOT DEFINED LIBDIR)

View File

@@ -1,5 +1,3 @@
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -G "Visual Studio %BUILD_VS_VER% %BUILD_VS_YEAR%%WINDOWS_ARCH%" %TESTS_CMAKE_ARGS%
if "%BUILD_ARCH%"=="x64" (
set MSBUILD_PLATFORM=x64
) else if "%BUILD_ARCH%"=="x86" (
@@ -11,8 +9,17 @@ if "%BUILD_ARCH%"=="x64" (
)
if "%WITH_CLANG%"=="1" (
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -T"LLVM-vs2017"
set CLANG_CMAKE_ARGS=-T"LLVM-vs2017"
if "%WITH_ASAN%"=="1" (
set ASAN_CMAKE_ARGS=-DWITH_COMPILER_ASAN=On
)
) else (
if "%WITH_ASAN%"=="1" (
echo ASAN is only supported with clang.
exit /b 1
)
)
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -G "Visual Studio %BUILD_VS_VER% %BUILD_VS_YEAR%%WINDOWS_ARCH%" %TESTS_CMAKE_ARGS% %CLANG_CMAKE_ARGS% %ASAN_CMAKE_ARGS%
if NOT EXIST %BUILD_DIR%\nul (
mkdir %BUILD_DIR%

View File

@@ -1,3 +1,9 @@
ninja --version 1>NUL 2>&1
if %ERRORLEVEL% NEQ 0 (
echo "Ninja not detected in the path"
exit /b 1
)
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -G "Ninja" %TESTS_CMAKE_ARGS% -DCMAKE_BUILD_TYPE=%BUILD_TYPE%
if "%WITH_CLANG%" == "1" (
@@ -27,6 +33,16 @@ set LLVM_DIR=
rem build and tested against 2017 15.7
set CFLAGS=-m64 -fmsc-version=1914
set CXXFLAGS=-m64 -fmsc-version=1914
if "%WITH_ASAN%"=="1" (
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -DWITH_COMPILER_ASAN=On
)
)
if "%WITH_ASAN%"=="1" (
if "%WITH_CLANG%" == "" (
echo ASAN is only supported with clang.
exit /b 1
)
)
if NOT "%verbose%" == "" (

View File

@@ -12,6 +12,11 @@ if not exist "%vs_where%" (
goto FAIL
)
)
if NOT "%verbose%" == "" (
echo "%vs_where%" -latest %VSWHERE_ARGS% -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64`
)
for /f "usebackq tokens=1* delims=: " %%i in (`"%vs_where%" -latest %VSWHERE_ARGS% -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64`) do (
if /i "%%i"=="installationPath" set VS_InstallDir=%%j
)

View File

@@ -42,6 +42,8 @@ if NOT "%1" == "" (
) else if "%1" == "release" (
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -C"%BLENDER_DIR%\build_files\cmake\config\blender_release.cmake"
set TARGET=Release
) else if "%1" == "asan" (
set WITH_ASAN=1
) else if "%1" == "x86" (
set BUILD_ARCH=x86
) else if "%1" == "x64" (
@@ -51,6 +53,10 @@ if NOT "%1" == "" (
) else if "%1" == "2017pre" (
set BUILD_VS_YEAR=2017
set VSWHERE_ARGS=-prerelease
set BUILD_VS_YEAR=2017
) else if "%1" == "2017b" (
set BUILD_VS_YEAR=2017
set VSWHERE_ARGS=-products Microsoft.VisualStudio.Product.BuildTools
) else if "%1" == "2015" (
set BUILD_VS_YEAR=2015
) else if "%1" == "2013" (

View File

@@ -22,3 +22,6 @@ set BUILD_SHOW_HASHES=
set SHOW_HELP=
set BUILD_WITH_NINJA=
set WITH_CLANG=
set WITH_ASAN=
set CLANG_CMAKE_ARGS=
set ASAN_CMAKE_ARGS=

View File

@@ -23,7 +23,13 @@ echo - buildir [newdir] ^(override default build folder^)
echo - x86 ^(override host auto-detect and build 32 bit code^)
echo - x64 ^(override host auto-detect and build 64 bit code^)
echo - 2013 ^(build with visual studio 2013^)
echo - 2015 ^(build with visual studio 2015^) [EXPERIMENTAL]
echo - 2017 ^(build with visual studio 2017^) [EXPERIMENTAL]
echo - 2017pre ^(build with visual studio 2017 pre-release^) [EXPERIMENTAL]
echo.
echo Experimental options
echo - 2015 ^(build with visual studio 2015^)
echo - 2017 ^(build with visual studio 2017^)
echo - 2017pre ^(build with visual studio 2017 pre-release^)
echo - 2017b ^(build with visual studio 2017 Build Tools^)
echo - clang ^(enable building with clang^)
echo - asan ^(enable asan when building with clang^)
echo - ninja ^(enable building with ninja instead of msbuild^)
echo.

View File

@@ -23,7 +23,9 @@ AUD_NAMESPACE_BEGIN
FFMPEG::FFMPEG()
{
#if LIBAVCODEC_VERSION_MAJOR < 58
av_register_all();
#endif
}
void FFMPEG::registerPlugin()

View File

@@ -22,37 +22,37 @@
extern "C" {
#include <libavcodec/avcodec.h>
#include <libavformat/avio.h>
#include <libavutil/avutil.h>
}
AUD_NAMESPACE_BEGIN
#if LIBAVCODEC_VERSION_MAJOR < 58
#define FFMPEG_OLD_CODE
#endif
int FFMPEGReader::decode(AVPacket& packet, Buffer& buffer)
{
AVFrame* frame = nullptr;
int buf_size = buffer.getSize();
int buf_pos = 0;
#ifdef FFMPEG_OLD_CODE
int got_frame;
int read_length;
uint8_t* orig_data = packet.data;
int orig_size = packet.size;
int buf_size = buffer.getSize();
int buf_pos = 0;
while(packet.size > 0)
{
got_frame = 0;
if(!frame)
frame = av_frame_alloc();
else
av_frame_unref(frame);
read_length = avcodec_decode_audio4(m_codecCtx, frame, &got_frame, &packet);
read_length = avcodec_decode_audio4(m_codecCtx, m_frame, &got_frame, &packet);
if(read_length < 0)
break;
if(got_frame)
{
int data_size = av_samples_get_buffer_size(nullptr, m_codecCtx->channels, frame->nb_samples, m_codecCtx->sample_fmt, 1);
int data_size = av_samples_get_buffer_size(nullptr, m_codecCtx->channels, m_frame->nb_samples, m_codecCtx->sample_fmt, 1);
if(buf_size - buf_pos < data_size)
{
@@ -62,18 +62,18 @@ int FFMPEGReader::decode(AVPacket& packet, Buffer& buffer)
if(m_tointerleave)
{
int single_size = data_size / m_codecCtx->channels / frame->nb_samples;
int single_size = data_size / m_codecCtx->channels / m_frame->nb_samples;
for(int channel = 0; channel < m_codecCtx->channels; channel++)
{
for(int i = 0; i < frame->nb_samples; i++)
for(int i = 0; i < m_frame->nb_samples; i++)
{
std::memcpy(((data_t*)buffer.getBuffer()) + buf_pos + ((m_codecCtx->channels * i) + channel) * single_size,
frame->data[channel] + i * single_size, single_size);
m_frame->data[channel] + i * single_size, single_size);
}
}
}
else
std::memcpy(((data_t*)buffer.getBuffer()) + buf_pos, frame->data[0], data_size);
std::memcpy(((data_t*)buffer.getBuffer()) + buf_pos, m_frame->data[0], data_size);
buf_pos += data_size;
}
@@ -83,7 +83,42 @@ int FFMPEGReader::decode(AVPacket& packet, Buffer& buffer)
packet.data = orig_data;
packet.size = orig_size;
av_free(frame);
#else
avcodec_send_packet(m_codecCtx, &packet);
while(true)
{
auto ret = avcodec_receive_frame(m_codecCtx, m_frame);
if(ret != 0)
break;
int data_size = av_samples_get_buffer_size(nullptr, m_codecCtx->channels, m_frame->nb_samples, m_codecCtx->sample_fmt, 1);
if(buf_size - buf_pos < data_size)
{
buffer.resize(buf_size + data_size, true);
buf_size += data_size;
}
if(m_tointerleave)
{
int single_size = data_size / m_codecCtx->channels / m_frame->nb_samples;
for(int channel = 0; channel < m_codecCtx->channels; channel++)
{
for(int i = 0; i < m_frame->nb_samples; i++)
{
std::memcpy(((data_t*)buffer.getBuffer()) + buf_pos + ((m_codecCtx->channels * i) + channel) * single_size,
m_frame->data[channel] + i * single_size, single_size);
}
}
}
else
std::memcpy(((data_t*)buffer.getBuffer()) + buf_pos, m_frame->data[0], data_size);
buf_pos += data_size;
}
#endif
return buf_pos;
}
@@ -101,7 +136,11 @@ void FFMPEGReader::init()
for(unsigned int i = 0; i < m_formatCtx->nb_streams; i++)
{
#ifdef FFMPEG_OLD_CODE
if((m_formatCtx->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO)
#else
if((m_formatCtx->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_AUDIO)
#endif
&& (m_stream < 0))
{
m_stream=i;
@@ -112,12 +151,34 @@ void FFMPEGReader::init()
if(m_stream == -1)
AUD_THROW(FileException, "File couldn't be read, no audio stream found by ffmpeg.");
m_codecCtx = m_formatCtx->streams[m_stream]->codec;
// get a decoder and open it
AVCodec* aCodec = avcodec_find_decoder(m_codecCtx->codec_id);
#ifndef FFMPEG_OLD_CODE
AVCodec* aCodec = avcodec_find_decoder(m_formatCtx->streams[m_stream]->codecpar->codec_id);
if(!aCodec)
AUD_THROW(FileException, "File couldn't be read, no decoder found with ffmpeg.");
#endif
m_frame = av_frame_alloc();
if(!m_frame)
AUD_THROW(FileException, "File couldn't be read, ffmpeg frame couldn't be allocated.");
#ifdef FFMPEG_OLD_CODE
m_codecCtx = m_formatCtx->streams[m_stream]->codec;
AVCodec* aCodec = avcodec_find_decoder(m_codecCtx->codec_id);
#else
m_codecCtx = avcodec_alloc_context3(aCodec);
#endif
if(!m_codecCtx)
AUD_THROW(FileException, "File couldn't be read, ffmpeg context couldn't be allocated.");
#ifndef FFMPEG_OLD_CODE
if(avcodec_parameters_to_context(m_codecCtx, m_formatCtx->streams[m_stream]->codecpar) < 0)
AUD_THROW(FileException, "File couldn't be read, ffmpeg decoder parameters couldn't be copied to decoder context.");
#endif
if(avcodec_open2(m_codecCtx, aCodec, nullptr) < 0)
AUD_THROW(FileException, "File couldn't be read, ffmpeg codec couldn't be opened.");
@@ -157,6 +218,8 @@ void FFMPEGReader::init()
FFMPEGReader::FFMPEGReader(std::string filename) :
m_pkgbuf(),
m_formatCtx(nullptr),
m_codecCtx(nullptr),
m_frame(nullptr),
m_aviocontext(nullptr),
m_membuf(nullptr)
{
@@ -177,12 +240,14 @@ FFMPEGReader::FFMPEGReader(std::string filename) :
FFMPEGReader::FFMPEGReader(std::shared_ptr<Buffer> buffer) :
m_pkgbuf(),
m_codecCtx(nullptr),
m_frame(nullptr),
m_membuffer(buffer),
m_membufferpos(0)
{
m_membuf = reinterpret_cast<data_t*>(av_malloc(FF_MIN_BUFFER_SIZE + FF_INPUT_BUFFER_PADDING_SIZE));
m_membuf = reinterpret_cast<data_t*>(av_malloc(AV_INPUT_BUFFER_MIN_SIZE + AV_INPUT_BUFFER_PADDING_SIZE));
m_aviocontext = avio_alloc_context(m_membuf, FF_MIN_BUFFER_SIZE, 0, this, read_packet, nullptr, seek_packet);
m_aviocontext = avio_alloc_context(m_membuf, AV_INPUT_BUFFER_MIN_SIZE, 0, this, read_packet, nullptr, seek_packet);
if(!m_aviocontext)
{
@@ -212,7 +277,14 @@ FFMPEGReader::FFMPEGReader(std::shared_ptr<Buffer> buffer) :
FFMPEGReader::~FFMPEGReader()
{
if(m_frame)
av_frame_free(&m_frame);
#ifdef FFMPEG_OLD_CODE
avcodec_close(m_codecCtx);
#else
if(m_codecCtx)
avcodec_free_context(&m_codecCtx);
#endif
avformat_close_input(&m_formatCtx);
}
@@ -312,7 +384,7 @@ void FFMPEGReader::seek(int position)
}
}
}
av_free_packet(&packet);
av_packet_unref(&packet);
}
}
else
@@ -343,7 +415,7 @@ Specs FFMPEGReader::getSpecs() const
void FFMPEGReader::read(int& length, bool& eos, sample_t* buffer)
{
// read packages and decode them
AVPacket packet;
AVPacket packet = {};
int data_size = 0;
int pkgbuf_pos;
int left = length;
@@ -359,7 +431,7 @@ void FFMPEGReader::read(int& length, bool& eos, sample_t* buffer)
data_size = std::min(pkgbuf_pos, left * sample_size);
m_convert((data_t*) buf, (data_t*) m_pkgbuf.getBuffer(), data_size / AUD_FORMAT_SIZE(m_specs.format));
buf += data_size / AUD_FORMAT_SIZE(m_specs.format);
left -= data_size/sample_size;
left -= data_size / sample_size;
}
// for each frame read as long as there isn't enough data already
@@ -375,9 +447,9 @@ void FFMPEGReader::read(int& length, bool& eos, sample_t* buffer)
data_size = std::min(pkgbuf_pos, left * sample_size);
m_convert((data_t*) buf, (data_t*) m_pkgbuf.getBuffer(), data_size / AUD_FORMAT_SIZE(m_specs.format));
buf += data_size / AUD_FORMAT_SIZE(m_specs.format);
left -= data_size/sample_size;
left -= data_size / sample_size;
}
av_free_packet(&packet);
av_packet_unref(&packet);
}
// read more data than necessary?
if(pkgbuf_pos > data_size)

View File

@@ -79,6 +79,11 @@ private:
*/
AVCodecContext* m_codecCtx;
/**
* The AVFrame structure for using ffmpeg.
*/
AVFrame* m_frame;
/**
* The AVIOContext to read the data from.
*/

View File

@@ -27,6 +27,10 @@ extern "C" {
AUD_NAMESPACE_BEGIN
#if LIBAVCODEC_VERSION_MAJOR < 58
#define FFMPEG_OLD_CODE
#endif
void FFMPEGWriter::encode()
{
sample_t* data = m_input_buffer.getBuffer();
@@ -58,82 +62,106 @@ void FFMPEGWriter::encode()
if(m_input_size)
m_convert(reinterpret_cast<data_t*>(data), reinterpret_cast<data_t*>(data), m_input_samples * m_specs.channels);
AVPacket packet;
#ifdef FFMPEG_OLD_CODE
m_packet->data = nullptr;
m_packet->size = 0;
packet.data = nullptr;
packet.size = 0;
av_init_packet(m_packet);
av_init_packet(&packet);
AVFrame* frame = av_frame_alloc();
av_frame_unref(frame);
av_frame_unref(m_frame);
int got_packet;
#endif
frame->nb_samples = m_input_samples;
frame->format = m_codecCtx->sample_fmt;
frame->channel_layout = m_codecCtx->channel_layout;
m_frame->nb_samples = m_input_samples;
m_frame->format = m_codecCtx->sample_fmt;
m_frame->channel_layout = m_codecCtx->channel_layout;
if(avcodec_fill_audio_frame(frame, m_specs.channels, m_codecCtx->sample_fmt, reinterpret_cast<data_t*>(data), m_input_buffer.getSize(), 0) < 0)
if(avcodec_fill_audio_frame(m_frame, m_specs.channels, m_codecCtx->sample_fmt, reinterpret_cast<data_t*>(data), m_input_buffer.getSize(), 0) < 0)
AUD_THROW(FileException, "File couldn't be written, filling the audio frame failed with ffmpeg.");
AVRational sample_time = { 1, static_cast<int>(m_specs.rate) };
frame->pts = av_rescale_q(m_position - m_input_samples, m_codecCtx->time_base, sample_time);
m_frame->pts = av_rescale_q(m_position - m_input_samples, m_codecCtx->time_base, sample_time);
if(avcodec_encode_audio2(m_codecCtx, &packet, frame, &got_packet))
#ifdef FFMPEG_OLD_CODE
if(avcodec_encode_audio2(m_codecCtx, m_packet, m_frame, &got_packet))
{
av_frame_free(&frame);
AUD_THROW(FileException, "File couldn't be written, audio encoding failed with ffmpeg.");
}
if(got_packet)
{
packet.flags |= AV_PKT_FLAG_KEY;
packet.stream_index = m_stream->index;
if(av_write_frame(m_formatCtx, &packet) < 0)
m_packet->flags |= AV_PKT_FLAG_KEY;
m_packet->stream_index = m_stream->index;
if(av_write_frame(m_formatCtx, m_packet) < 0)
{
av_free_packet(&packet);
av_frame_free(&frame);
av_free_packet(m_packet);
AUD_THROW(FileException, "Frame couldn't be writen to the file with ffmpeg.");
}
av_free_packet(&packet);
av_free_packet(m_packet);
}
#else
if(avcodec_send_frame(m_codecCtx, m_frame) < 0)
AUD_THROW(FileException, "File couldn't be written, audio encoding failed with ffmpeg.");
av_frame_free(&frame);
while(avcodec_receive_packet(m_codecCtx, m_packet) == 0)
{
m_packet->stream_index = m_stream->index;
if(av_write_frame(m_formatCtx, m_packet) < 0)
AUD_THROW(FileException, "Frame couldn't be writen to the file with ffmpeg.");
}
#endif
}
void FFMPEGWriter::close()
{
#ifdef FFMPEG_OLD_CODE
int got_packet = true;
while(got_packet)
{
AVPacket packet;
m_packet->data = nullptr;
m_packet->size = 0;
packet.data = nullptr;
packet.size = 0;
av_init_packet(m_packet);
av_init_packet(&packet);
if(avcodec_encode_audio2(m_codecCtx, &packet, nullptr, &got_packet))
if(avcodec_encode_audio2(m_codecCtx, m_packet, nullptr, &got_packet))
AUD_THROW(FileException, "File end couldn't be written, audio encoding failed with ffmpeg.");
if(got_packet)
{
packet.flags |= AV_PKT_FLAG_KEY;
packet.stream_index = m_stream->index;
if(av_write_frame(m_formatCtx, &packet))
m_packet->flags |= AV_PKT_FLAG_KEY;
m_packet->stream_index = m_stream->index;
if(av_write_frame(m_formatCtx, m_packet))
{
av_free_packet(&packet);
av_free_packet(m_packet);
AUD_THROW(FileException, "Final frames couldn't be writen to the file with ffmpeg.");
}
av_free_packet(&packet);
av_free_packet(m_packet);
}
}
#else
if(avcodec_send_frame(m_codecCtx, nullptr) < 0)
AUD_THROW(FileException, "File couldn't be written, audio encoding failed with ffmpeg.");
while(avcodec_receive_packet(m_codecCtx, m_packet) == 0)
{
m_packet->stream_index = m_stream->index;
if(av_write_frame(m_formatCtx, m_packet) < 0)
AUD_THROW(FileException, "Frame couldn't be writen to the file with ffmpeg.");
}
#endif
}
FFMPEGWriter::FFMPEGWriter(std::string filename, DeviceSpecs specs, Container format, Codec codec, unsigned int bitrate) :
m_position(0),
m_specs(specs),
m_formatCtx(nullptr),
m_codecCtx(nullptr),
m_stream(nullptr),
m_packet(nullptr),
m_frame(nullptr),
m_input_samples(0),
m_deinterleave(false)
{
@@ -142,75 +170,105 @@ FFMPEGWriter::FFMPEGWriter(std::string filename, DeviceSpecs specs, Container fo
if(avformat_alloc_output_context2(&m_formatCtx, nullptr, formats[format], filename.c_str()) < 0)
AUD_THROW(FileException, "File couldn't be written, format couldn't be found with ffmpeg.");
m_outputFmt = m_formatCtx->oformat;
AVOutputFormat* outputFmt = m_formatCtx->oformat;
if(!m_outputFmt) {
if(!outputFmt) {
avformat_free_context(m_formatCtx);
AUD_THROW(FileException, "File couldn't be written, output format couldn't be found with ffmpeg.");
}
m_outputFmt->audio_codec = AV_CODEC_ID_NONE;
outputFmt->audio_codec = AV_CODEC_ID_NONE;
switch(codec)
{
case CODEC_AAC:
m_outputFmt->audio_codec = AV_CODEC_ID_AAC;
outputFmt->audio_codec = AV_CODEC_ID_AAC;
break;
case CODEC_AC3:
m_outputFmt->audio_codec = AV_CODEC_ID_AC3;
outputFmt->audio_codec = AV_CODEC_ID_AC3;
break;
case CODEC_FLAC:
m_outputFmt->audio_codec = AV_CODEC_ID_FLAC;
outputFmt->audio_codec = AV_CODEC_ID_FLAC;
break;
case CODEC_MP2:
m_outputFmt->audio_codec = AV_CODEC_ID_MP2;
outputFmt->audio_codec = AV_CODEC_ID_MP2;
break;
case CODEC_MP3:
m_outputFmt->audio_codec = AV_CODEC_ID_MP3;
outputFmt->audio_codec = AV_CODEC_ID_MP3;
break;
case CODEC_OPUS:
m_outputFmt->audio_codec = AV_CODEC_ID_OPUS;
outputFmt->audio_codec = AV_CODEC_ID_OPUS;
break;
case CODEC_PCM:
switch(specs.format)
{
case FORMAT_U8:
m_outputFmt->audio_codec = AV_CODEC_ID_PCM_U8;
outputFmt->audio_codec = AV_CODEC_ID_PCM_U8;
break;
case FORMAT_S16:
m_outputFmt->audio_codec = AV_CODEC_ID_PCM_S16LE;
outputFmt->audio_codec = AV_CODEC_ID_PCM_S16LE;
break;
case FORMAT_S24:
m_outputFmt->audio_codec = AV_CODEC_ID_PCM_S24LE;
outputFmt->audio_codec = AV_CODEC_ID_PCM_S24LE;
break;
case FORMAT_S32:
m_outputFmt->audio_codec = AV_CODEC_ID_PCM_S32LE;
outputFmt->audio_codec = AV_CODEC_ID_PCM_S32LE;
break;
case FORMAT_FLOAT32:
m_outputFmt->audio_codec = AV_CODEC_ID_PCM_F32LE;
outputFmt->audio_codec = AV_CODEC_ID_PCM_F32LE;
break;
case FORMAT_FLOAT64:
m_outputFmt->audio_codec = AV_CODEC_ID_PCM_F64LE;
outputFmt->audio_codec = AV_CODEC_ID_PCM_F64LE;
break;
default:
m_outputFmt->audio_codec = AV_CODEC_ID_NONE;
outputFmt->audio_codec = AV_CODEC_ID_NONE;
break;
}
break;
case CODEC_VORBIS:
m_outputFmt->audio_codec = AV_CODEC_ID_VORBIS;
outputFmt->audio_codec = AV_CODEC_ID_VORBIS;
break;
default:
m_outputFmt->audio_codec = AV_CODEC_ID_NONE;
outputFmt->audio_codec = AV_CODEC_ID_NONE;
break;
}
uint64_t channel_layout = 0;
switch(m_specs.channels)
{
case CHANNELS_MONO:
channel_layout = AV_CH_LAYOUT_MONO;
break;
case CHANNELS_STEREO:
channel_layout = AV_CH_LAYOUT_STEREO;
break;
case CHANNELS_STEREO_LFE:
channel_layout = AV_CH_LAYOUT_2POINT1;
break;
case CHANNELS_SURROUND4:
channel_layout = AV_CH_LAYOUT_QUAD;
break;
case CHANNELS_SURROUND5:
channel_layout = AV_CH_LAYOUT_5POINT0_BACK;
break;
case CHANNELS_SURROUND51:
channel_layout = AV_CH_LAYOUT_5POINT1_BACK;
break;
case CHANNELS_SURROUND61:
channel_layout = AV_CH_LAYOUT_6POINT1_BACK;
break;
case CHANNELS_SURROUND71:
channel_layout = AV_CH_LAYOUT_7POINT1;
break;
}
try
{
if(m_outputFmt->audio_codec == AV_CODEC_ID_NONE)
if(outputFmt->audio_codec == AV_CODEC_ID_NONE)
AUD_THROW(FileException, "File couldn't be written, audio codec not found with ffmpeg.");
AVCodec* codec = avcodec_find_encoder(m_outputFmt->audio_codec);
AVCodec* codec = avcodec_find_encoder(outputFmt->audio_codec);
if(!codec)
AUD_THROW(FileException, "File couldn't be written, audio encoder couldn't be found with ffmpeg.");
@@ -220,7 +278,14 @@ FFMPEGWriter::FFMPEGWriter(std::string filename, DeviceSpecs specs, Container fo
m_stream->id = m_formatCtx->nb_streams - 1;
#ifdef FFMPEG_OLD_CODE
m_codecCtx = m_stream->codec;
#else
m_codecCtx = avcodec_alloc_context3(codec);
#endif
if(!m_codecCtx)
AUD_THROW(FileException, "File couldn't be written, context creation failed with ffmpeg.");
switch(m_specs.format)
{
@@ -247,7 +312,7 @@ FFMPEGWriter::FFMPEGWriter(std::string filename, DeviceSpecs specs, Container fo
}
if(m_formatCtx->oformat->flags & AVFMT_GLOBALHEADER)
m_codecCtx->flags |= CODEC_FLAG_GLOBAL_HEADER;
m_codecCtx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
bool format_supported = false;
@@ -328,9 +393,13 @@ FFMPEGWriter::FFMPEGWriter(std::string filename, DeviceSpecs specs, Container fo
m_specs.rate = m_codecCtx->sample_rate;
m_codecCtx->codec_id = m_outputFmt->audio_codec;
#ifdef FFMPEG_OLD_CODE
m_codecCtx->codec_id = outputFmt->audio_codec;
#endif
m_codecCtx->codec_type = AVMEDIA_TYPE_AUDIO;
m_codecCtx->bit_rate = bitrate;
m_codecCtx->channel_layout = channel_layout;
m_codecCtx->channels = m_specs.channels;
m_stream->time_base.num = m_codecCtx->time_base.num = 1;
m_stream->time_base.den = m_codecCtx->time_base.den = m_codecCtx->sample_rate;
@@ -338,6 +407,11 @@ FFMPEGWriter::FFMPEGWriter(std::string filename, DeviceSpecs specs, Container fo
if(avcodec_open2(m_codecCtx, codec, nullptr) < 0)
AUD_THROW(FileException, "File couldn't be written, encoder couldn't be opened with ffmpeg.");
#ifndef FFMPEG_OLD_CODE
if(avcodec_parameters_from_context(m_stream->codecpar, m_codecCtx) < 0)
AUD_THROW(FileException, "File couldn't be written, codec parameters couldn't be copied to the context.");
#endif
int samplesize = std::max(int(AUD_SAMPLE_SIZE(m_specs)), AUD_DEVICE_SAMPLE_SIZE(m_specs));
if((m_input_size = m_codecCtx->frame_size))
@@ -346,13 +420,26 @@ FFMPEGWriter::FFMPEGWriter(std::string filename, DeviceSpecs specs, Container fo
if(avio_open(&m_formatCtx->pb, filename.c_str(), AVIO_FLAG_WRITE))
AUD_THROW(FileException, "File couldn't be written, file opening failed with ffmpeg.");
avformat_write_header(m_formatCtx, nullptr);
if(avformat_write_header(m_formatCtx, nullptr) < 0)
AUD_THROW(FileException, "File couldn't be written, writing the header failed.");
}
catch(Exception&)
{
#ifndef FFMPEG_OLD_CODE
if(m_codecCtx)
avcodec_free_context(&m_codecCtx);
#endif
avformat_free_context(m_formatCtx);
throw;
}
#ifdef FFMPEG_OLD_CODE
m_packet = new AVPacket({});
#else
m_packet = av_packet_alloc();
#endif
m_frame = av_frame_alloc();
}
FFMPEGWriter::~FFMPEGWriter()
@@ -365,9 +452,26 @@ FFMPEGWriter::~FFMPEGWriter()
av_write_trailer(m_formatCtx);
avcodec_close(m_codecCtx);
if(m_frame)
av_frame_free(&m_frame);
avio_close(m_formatCtx->pb);
if(m_packet)
{
#ifdef FFMPEG_OLD_CODE
delete m_packet;
#else
av_packet_free(&m_packet);
#endif
}
#ifdef FFMPEG_OLD_CODE
avcodec_close(m_codecCtx);
#else
if(m_codecCtx)
avcodec_free_context(&m_codecCtx);
#endif
avio_closep(&m_formatCtx->pb);
avformat_free_context(m_formatCtx);
}

View File

@@ -65,16 +65,21 @@ private:
*/
AVCodecContext* m_codecCtx;
/**
* The AVOutputFormat structure for using ffmpeg.
*/
AVOutputFormat* m_outputFmt;
/**
* The AVStream structure for using ffmpeg.
*/
AVStream* m_stream;
/**
* The AVPacket structure for using ffmpeg.
*/
AVPacket* m_packet;
/**
* The AVFrame structure for using ffmpeg.
*/
AVFrame* m_frame;
/**
* The input buffer for the format converted data before encoding.
*/

View File

@@ -78,7 +78,7 @@ class CyclesRender(bpy.types.RenderEngine):
engine.reset(self, data, depsgraph)
def render_to_image(self, depsgraph):
def render(self, depsgraph):
engine.render(self, depsgraph)
def bake(self, depsgraph, obj, pass_type, pass_filter, object_id, pixel_array, num_pixels, depth, result):
@@ -93,7 +93,7 @@ class CyclesRender(bpy.types.RenderEngine):
engine.reset(self, context.blend_data, context.depsgraph)
engine.sync(self, context.depsgraph, context.blend_data)
def render_to_view(self, context):
def view_draw(self, context):
engine.draw(self, context.depsgraph, context.region, context.space_data, context.region_data)
def update_script_node(self, node):

View File

@@ -1154,7 +1154,7 @@ class CyclesCurveRenderSettings(bpy.types.PropertyGroup):
default='THICK',
)
cls.cull_backfacing = BoolProperty(
name="Cull back-faces",
name="Cull Back-faces",
description="Do not test the back-face of each strand",
default=True,
)
@@ -1330,49 +1330,6 @@ class CyclesRenderLayerSettings(bpy.types.PropertyGroup):
del bpy.types.ViewLayer.cycles
class CyclesCurveSettings(bpy.types.PropertyGroup):
@classmethod
def register(cls):
bpy.types.ParticleSettings.cycles = PointerProperty(
name="Cycles Hair Settings",
description="Cycles hair settings",
type=cls,
)
cls.radius_scale = FloatProperty(
name="Radius Scaling",
description="Multiplier of width properties",
min=0.0, max=1000.0,
default=0.01,
)
cls.root_width = FloatProperty(
name="Root Size",
description="Strand's width at root",
min=0.0, max=1000.0,
default=1.0,
)
cls.tip_width = FloatProperty(
name="Tip Multiplier",
description="Strand's width at tip",
min=0.0, max=1000.0,
default=0.0,
)
cls.shape = FloatProperty(
name="Strand Shape",
description="Strand shape parameter",
min=-1.0, max=1.0,
default=0.0,
)
cls.use_closetip = BoolProperty(
name="Close tip",
description="Set tip radius to zero",
default=True,
)
@classmethod
def unregister(cls):
del bpy.types.ParticleSettings.cycles
class CyclesDeviceSettings(bpy.types.PropertyGroup):
@classmethod
def register(cls):
@@ -1503,7 +1460,6 @@ def register():
bpy.utils.register_class(CyclesMeshSettings)
bpy.utils.register_class(CyclesObjectSettings)
bpy.utils.register_class(CyclesCurveRenderSettings)
bpy.utils.register_class(CyclesCurveSettings)
bpy.utils.register_class(CyclesDeviceSettings)
bpy.utils.register_class(CyclesPreferences)
bpy.utils.register_class(CyclesRenderLayerSettings)
@@ -1519,7 +1475,6 @@ def unregister():
bpy.utils.unregister_class(CyclesObjectSettings)
bpy.utils.unregister_class(CyclesVisibilitySettings)
bpy.utils.unregister_class(CyclesCurveRenderSettings)
bpy.utils.unregister_class(CyclesCurveSettings)
bpy.utils.unregister_class(CyclesDeviceSettings)
bpy.utils.unregister_class(CyclesPreferences)
bpy.utils.unregister_class(CyclesRenderLayerSettings)

File diff suppressed because it is too large Load Diff

View File

@@ -433,3 +433,14 @@ def do_versions(self):
(bpy.data.version >= (2, 80, 0) and bpy.data.version <= (2, 80, 4)):
# Switch to squared roughness convention
square_roughness_nodes_insert()
if bpy.data.version <= (2, 80, 15):
# Copy cycles hair settings to internal settings
for part in bpy.data.particles:
cpart = part.get("cycles", None)
if cpart:
part.shape = cpart.get("shape", 0.0)
part.root_radius = cpart.get("root_width", 1.0)
part.tip_radius = cpart.get("tip_width", 0.0)
part.radius_scale = cpart.get("radius_scale", 0.01)
part.use_close_tip = cpart.get("use_closetip", True)

View File

@@ -149,18 +149,16 @@ static bool ObtainCacheParticleData(Mesh *mesh,
if(b_part.kink() == BL::ParticleSettings::kink_SPIRAL)
ren_step += b_part.kink_extra_steps();
PointerRNA cpsys = RNA_pointer_get(&b_part.ptr, "cycles");
CData->psys_firstcurve.push_back_slow(curvenum);
CData->psys_curvenum.push_back_slow(totcurves);
CData->psys_shader.push_back_slow(shader);
float radius = get_float(cpsys, "radius_scale") * 0.5f;
float radius = b_part.radius_scale() * 0.5f;
CData->psys_rootradius.push_back_slow(radius * get_float(cpsys, "root_width"));
CData->psys_tipradius.push_back_slow(radius * get_float(cpsys, "tip_width"));
CData->psys_shape.push_back_slow(get_float(cpsys, "shape"));
CData->psys_closetip.push_back_slow(get_boolean(cpsys, "use_closetip"));
CData->psys_rootradius.push_back_slow(radius * b_part.root_radius());
CData->psys_tipradius.push_back_slow(radius * b_part.tip_radius());
CData->psys_shape.push_back_slow(b_part.shape());
CData->psys_closetip.push_back_slow(b_part.use_close_tip());
int pa_no = 0;
if(!(b_part.child_type() == 0) && totchild != 0)

View File

@@ -1173,7 +1173,7 @@ Mesh *BlenderSync::sync_mesh(BL::Depsgraph& b_depsgraph,
* freed data from the blender side.
*/
if(preview && b_ob.type() != BL::Object::type_MESH)
b_ob.update_from_editmode();
b_ob.update_from_editmode(b_data);
bool need_undeformed = mesh->need_attribute(scene, ATTR_STD_GENERATED);

View File

@@ -278,25 +278,25 @@ void BlenderSync::sync_background_light(bool use_portal)
/* Object */
Object *BlenderSync::sync_object(BL::Depsgraph& b_depsgraph,
BL::Depsgraph::duplis_iterator& b_dupli_iter,
BL::DepsgraphObjectInstance& b_instance,
uint layer_flag,
float motion_time,
bool hide_tris,
BlenderObjectCulling& culling,
bool *use_portal)
{
const bool is_instance = b_dupli_iter->is_instance();
BL::Object b_ob = b_dupli_iter->object();
BL::Object b_parent = is_instance ? b_dupli_iter->parent()
: b_dupli_iter->object();
BL::Object b_ob_instance = is_instance ? b_dupli_iter->instance_object()
const bool is_instance = b_instance.is_instance();
BL::Object b_ob = b_instance.object();
BL::Object b_parent = is_instance ? b_instance.parent()
: b_instance.object();
BL::Object b_ob_instance = is_instance ? b_instance.instance_object()
: b_ob;
const bool motion = motion_time != 0.0f;
/*const*/ Transform tfm = get_transform(b_ob.matrix_world());
int *persistent_id = NULL;
BL::Array<int, OBJECT_PERSISTENT_ID_SIZE> persistent_id_array;
if(is_instance) {
persistent_id_array = b_dupli_iter->persistent_id();
persistent_id_array = b_instance.persistent_id();
persistent_id = persistent_id_array.data;
}
@@ -310,7 +310,7 @@ Object *BlenderSync::sync_object(BL::Depsgraph& b_depsgraph,
persistent_id,
b_ob,
b_ob_instance,
is_instance ? b_dupli_iter->random_id() : 0,
is_instance ? b_instance.random_id() : 0,
tfm,
use_portal);
}
@@ -448,12 +448,12 @@ Object *BlenderSync::sync_object(BL::Depsgraph& b_depsgraph,
/* dupli texture coordinates and random_id */
if(is_instance) {
object->dupli_generated = 0.5f*get_float3(b_dupli_iter->orco()) - make_float3(0.5f, 0.5f, 0.5f);
object->dupli_uv = get_float2(b_dupli_iter->uv());
object->random_id = b_dupli_iter->random_id();
object->dupli_generated = 0.5f*get_float3(b_instance.orco()) - make_float3(0.5f, 0.5f, 0.5f);
object->dupli_uv = get_float2(b_instance.uv());
object->random_id = b_instance.random_id();
/* Sync possible particle data. */
sync_dupli_particle(b_ob, *b_dupli_iter, object);
sync_dupli_particle(b_ob, b_instance, object);
}
else {
object->dupli_generated = make_float3(0.0f, 0.0f, 0.0f);
@@ -482,7 +482,8 @@ static bool object_render_hide_original(BL::Object::type_enum ob_type,
static bool object_render_hide(BL::Object& b_ob,
bool top_level,
bool parent_hide,
bool& hide_triangles)
bool& hide_triangles,
BL::Depsgraph::mode_enum depsgraph_mode)
{
/* check if we should render or hide particle emitter */
BL::Object::particle_systems_iterator b_psys;
@@ -501,11 +502,16 @@ static bool object_render_hide(BL::Object& b_ob,
has_particles = true;
}
/* Both mode_PREVIEW and mode_VIEWPORT are treated the same here.*/
const bool show_duplicator = depsgraph_mode == BL::Depsgraph::mode_RENDER
? b_ob.show_duplicator_for_render()
: b_ob.show_duplicator_for_viewport();
if(has_particles) {
show_emitter = b_ob.show_duplicator_for_render();
show_emitter = show_duplicator;
hide_emitter = !show_emitter;
} else if(b_ob.is_duplicator()) {
if(top_level || b_ob.show_duplicator_for_render()) {
if(top_level || show_duplicator) {
hide_as_dupli_parent = true;
}
}
@@ -563,12 +569,15 @@ void BlenderSync::sync_objects(BL::Depsgraph& b_depsgraph, float motion_time)
bool cancel = false;
bool use_portal = false;
BL::Depsgraph::duplis_iterator b_dupli_iter;
for(b_depsgraph.duplis.begin(b_dupli_iter);
b_dupli_iter != b_depsgraph.duplis.end() && !cancel;
++b_dupli_iter)
BL::Depsgraph::mode_enum depsgraph_mode = b_depsgraph.mode();
BL::Depsgraph::object_instances_iterator b_instance_iter;
for(b_depsgraph.object_instances.begin(b_instance_iter);
b_instance_iter != b_depsgraph.object_instances.end() && !cancel;
++b_instance_iter)
{
BL::Object b_ob = b_dupli_iter->object();
BL::DepsgraphObjectInstance b_instance = *b_instance_iter;
BL::Object b_ob = b_instance.object();
if(!b_ob.is_visible()) {
continue;
}
@@ -581,10 +590,10 @@ void BlenderSync::sync_objects(BL::Depsgraph& b_depsgraph, float motion_time)
/* test if object needs to be hidden */
bool hide_tris;
if(!object_render_hide(b_ob, true, true, hide_tris)) {
if(!object_render_hide(b_ob, true, true, hide_tris, depsgraph_mode)) {
/* object itself */
sync_object(b_depsgraph,
b_dupli_iter,
b_instance,
~(0), /* until we get rid of layers */
motion_time,
hide_tris,

View File

@@ -28,11 +28,11 @@ CCL_NAMESPACE_BEGIN
/* Utilities */
bool BlenderSync::sync_dupli_particle(BL::Object& b_ob,
BL::DepsgraphIter& b_dup,
BL::DepsgraphObjectInstance& b_instance,
Object *object)
{
/* test if this dupli was generated from a particle sytem */
BL::ParticleSystem b_psys = b_dup.particle_system();
BL::ParticleSystem b_psys = b_instance.particle_system();
if(!b_psys)
return false;
@@ -43,7 +43,7 @@ bool BlenderSync::sync_dupli_particle(BL::Object& b_ob,
return false;
/* don't handle child particles yet */
BL::Array<int, OBJECT_PERSISTENT_ID_SIZE> persistent_id = b_dup.persistent_id();
BL::Array<int, OBJECT_PERSISTENT_ID_SIZE> persistent_id = b_instance.persistent_id();
if(persistent_id[0] >= b_psys.particles.length())
return false;
@@ -53,7 +53,7 @@ bool BlenderSync::sync_dupli_particle(BL::Object& b_ob,
ParticleSystem *psys;
bool first_use = !particle_system_map.is_used(key);
bool need_update = particle_system_map.sync(&psys, b_ob, b_dup.object(), key);
bool need_update = particle_system_map.sync(&psys, b_ob, b_instance.object(), key);
/* no update needed? */
if(!need_update && !object->mesh->need_update && !scene->object_manager->need_update)

View File

@@ -773,7 +773,7 @@ void BlenderSession::synchronize(BL::Depsgraph& b_depsgraph_)
/* copy recalc flags, outside of mutex so we can decide to do the real
* synchronization at a later time to not block on running updates */
sync->sync_recalc();
sync->sync_recalc(b_depsgraph_);
/* don't do synchronization if on pause */
if(session_pause) {

View File

@@ -659,7 +659,9 @@ static ShaderNode *add_node(Scene *scene,
image->animated = b_image_node.image_user().use_auto_refresh();
image->use_alpha = b_image.use_alpha();
/* TODO: restore */
/* TODO(sergey): Does not work properly when we change builtin type. */
#if 0
if(b_image.is_updated()) {
scene->image_manager->tag_reload_image(
image->filename.string(),
@@ -668,6 +670,7 @@ static ShaderNode *add_node(Scene *scene,
get_image_extension(b_image_node),
image->use_alpha);
}
#endif
}
image->color_space = (NodeImageColorSpace)b_image_node.color_space();
image->projection = (NodeImageProjection)b_image_node.projection();
@@ -707,7 +710,9 @@ static ShaderNode *add_node(Scene *scene,
env->animated = b_env_node.image_user().use_auto_refresh();
env->use_alpha = b_image.use_alpha();
/* TODO: restore */
/* TODO(sergey): Does not work properly when we change builtin type. */
#if 0
if(b_image.is_updated()) {
scene->image_manager->tag_reload_image(
env->filename.string(),
@@ -716,6 +721,7 @@ static ShaderNode *add_node(Scene *scene,
EXTENSION_REPEAT,
env->use_alpha);
}
#endif
}
env->color_space = (NodeImageColorSpace)b_env_node.color_space();
env->interpolation = get_image_interpolation(b_env_node);
@@ -1238,33 +1244,32 @@ void BlenderSync::sync_materials(BL::Depsgraph& b_depsgraph, bool update_all)
TaskPool pool;
set<Shader*> updated_shaders;
/* material loop */
BL::BlendData::materials_iterator b_mat_orig;
for(b_data.materials.begin(b_mat_orig);
b_mat_orig != b_data.materials.end();
++b_mat_orig)
{
/* TODO(sergey): Iterate over evaluated data rather than using mapping. */
BL::Material b_mat_(b_depsgraph.id_eval_get(*b_mat_orig));
BL::Material *b_mat = &b_mat_;
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_Material)) {
continue;
}
BL::Material b_mat(*b_id);
Shader *shader;
/* test if we need to sync */
if(shader_map.sync(&shader, *b_mat) || update_all) {
if(shader_map.sync(&shader, b_mat) || shader->need_sync_object || update_all) {
ShaderGraph *graph = new ShaderGraph();
shader->name = b_mat->name().c_str();
shader->pass_id = b_mat->pass_index();
shader->name = b_mat.name().c_str();
shader->pass_id = b_mat.pass_index();
shader->need_sync_object = false;
/* create nodes */
if(b_mat->use_nodes() && b_mat->node_tree()) {
BL::ShaderNodeTree b_ntree(b_mat->node_tree());
if(b_mat.use_nodes() && b_mat.node_tree()) {
BL::ShaderNodeTree b_ntree(b_mat.node_tree());
add_nodes(scene, b_engine, b_data, b_depsgraph, b_scene, graph, b_ntree);
}
else {
DiffuseBsdfNode *diffuse = new DiffuseBsdfNode();
diffuse->color = get_float3(b_mat->diffuse_color());
diffuse->color = get_float3(b_mat.diffuse_color());
graph->add(diffuse);
ShaderNode *out = graph->output();
@@ -1272,7 +1277,7 @@ void BlenderSync::sync_materials(BL::Depsgraph& b_depsgraph, bool update_all)
}
/* settings */
PointerRNA cmat = RNA_pointer_get(&b_mat->ptr, "cycles");
PointerRNA cmat = RNA_pointer_get(&b_mat.ptr, "cycles");
shader->use_mis = get_boolean(cmat, "sample_as_light");
shader->use_transparent_shadow = get_boolean(cmat, "use_transparent_shadow");
shader->heterogeneous_volume = !get_boolean(cmat, "homogeneous_volume");
@@ -1412,41 +1417,39 @@ void BlenderSync::sync_lamps(BL::Depsgraph& b_depsgraph, bool update_all)
{
shader_map.set_default(scene->default_light);
/* lamp loop */
BL::BlendData::lamps_iterator b_lamp_orig;
for(b_data.lamps.begin(b_lamp_orig);
b_lamp_orig != b_data.lamps.end();
++b_lamp_orig)
{
/* TODO(sergey): Iterate over evaluated data rather than using mapping. */
BL::Lamp b_lamp_(b_depsgraph.id_eval_get(*b_lamp_orig));
BL::Lamp *b_lamp = &b_lamp_;
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)) {
continue;
}
BL::Lamp b_lamp(*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_lamp) || 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_lamp.use_nodes() && b_lamp.node_tree()) {
shader->name = b_lamp.name().c_str();
BL::ShaderNodeTree b_ntree(b_lamp->node_tree());
BL::ShaderNodeTree b_ntree(b_lamp.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_lamp.type() == BL::Lamp::type_POINT ||
b_lamp.type() == BL::Lamp::type_SPOT ||
b_lamp.type() == BL::Lamp::type_AREA)
{
strength = 100.0f;
}
EmissionNode *emission = new EmissionNode();
emission->color = get_float3(b_lamp->color());
emission->color = get_float3(b_lamp.color());
emission->strength = strength;
graph->add(emission);

View File

@@ -76,31 +76,12 @@ BlenderSync::~BlenderSync()
/* Sync */
bool BlenderSync::sync_recalc()
void BlenderSync::sync_recalc(BL::Depsgraph& b_depsgraph)
{
/* sync recalc flags from blender to cycles. actual update is done separate,
* so we can do it later on if doing it immediate is not suitable */
BL::BlendData::materials_iterator b_mat;
bool has_updated_objects = b_data.objects.is_updated();
for(b_data.materials.begin(b_mat); b_mat != b_data.materials.end(); ++b_mat) {
if(b_mat->is_updated() || (b_mat->node_tree() && b_mat->node_tree().is_updated())) {
shader_map.set_recalc(*b_mat);
}
else {
Shader *shader = shader_map.find(*b_mat);
if(has_updated_objects && shader != NULL && shader->has_object_dependency) {
shader_map.set_recalc(*b_mat);
}
}
}
BL::BlendData::lamps_iterator b_lamp;
for(b_data.lamps.begin(b_lamp); b_lamp != b_data.lamps.end(); ++b_lamp)
if(b_lamp->is_updated() || (b_lamp->node_tree() && b_lamp->node_tree().is_updated()))
shader_map.set_recalc(*b_lamp);
/* Sync recalc flags from blender to cycles. Actual update is done separate,
* so we can do it later on if doing it immediate is not suitable. */
bool has_updated_objects = b_depsgraph.id_type_updated(BL::DriverTarget::id_type_OBJECT);
bool dicing_prop_changed = false;
if(experimental) {
@@ -122,70 +103,77 @@ bool BlenderSync::sync_recalc()
}
}
BL::BlendData::objects_iterator b_ob;
/* Iterate over all IDs in this depsgraph. */
BL::Depsgraph::updates_iterator b_update;
for(b_depsgraph.updates.begin(b_update); b_update != b_depsgraph.updates.end(); ++b_update) {
BL::ID b_id(b_update->id());
for(b_data.objects.begin(b_ob); b_ob != b_data.objects.end(); ++b_ob) {
if(b_ob->is_updated()) {
object_map.set_recalc(*b_ob);
light_map.set_recalc(*b_ob);
/* Material */
if (b_id.is_a(&RNA_Material)) {
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);
}
/* Object */
else if (b_id.is_a(&RNA_Object)) {
BL::Object b_ob(b_id);
const bool updated_geometry = b_update->updated_geometry();
if (b_update->updated_transform()) {
object_map.set_recalc(b_ob);
light_map.set_recalc(b_ob);
}
if(object_is_mesh(*b_ob)) {
if(b_ob->is_updated_data() || b_ob->data().is_updated() ||
(dicing_prop_changed && object_subdivision_type(*b_ob, preview, experimental) != Mesh::SUBDIVISION_NONE))
if(object_is_mesh(b_ob)) {
if(updated_geometry ||
(dicing_prop_changed && object_subdivision_type(b_ob, preview, experimental) != Mesh::SUBDIVISION_NONE))
{
BL::ID key = BKE_object_is_modified(*b_ob)? *b_ob: b_ob->data();
BL::ID key = BKE_object_is_modified(b_ob)? b_ob: b_ob.data();
mesh_map.set_recalc(key);
}
}
else if(object_is_light(*b_ob)) {
if(b_ob->is_updated_data() || b_ob->data().is_updated())
light_map.set_recalc(*b_ob);
else if(object_is_light(b_ob)) {
if(updated_geometry) {
light_map.set_recalc(b_ob);
}
}
if(b_ob->is_updated_data()) {
if(updated_geometry) {
BL::Object::particle_systems_iterator b_psys;
for(b_ob->particle_systems.begin(b_psys); b_psys != b_ob->particle_systems.end(); ++b_psys)
particle_system_map.set_recalc(*b_ob);
for(b_ob.particle_systems.begin(b_psys); b_psys != b_ob.particle_systems.end(); ++b_psys)
particle_system_map.set_recalc(b_ob);
}
}
BL::BlendData::meshes_iterator b_mesh;
for(b_data.meshes.begin(b_mesh); b_mesh != b_data.meshes.end(); ++b_mesh) {
if(b_mesh->is_updated()) {
mesh_map.set_recalc(*b_mesh);
/* Mesh */
else if (b_id.is_a(&RNA_Mesh)) {
BL::Mesh b_mesh(b_id);
mesh_map.set_recalc(b_mesh);
}
}
BL::BlendData::worlds_iterator b_world;
for(b_data.worlds.begin(b_world); b_world != b_data.worlds.end(); ++b_world) {
if(world_map == b_world->ptr.data) {
if(b_world->is_updated() ||
(b_world->node_tree() && b_world->node_tree().is_updated()))
{
world_recalc = true;
}
else if(b_world->node_tree() && b_world->use_nodes()) {
Shader *shader = scene->default_background;
if(has_updated_objects && shader->has_object_dependency) {
/* World */
else if (b_id.is_a(&RNA_World)) {
BL::World b_world(b_id);
if(world_map == b_world.ptr.data) {
world_recalc = true;
}
}
}
/* Updates shader with object dependency if objects changed. */
if (has_updated_objects) {
if(scene->default_background->has_object_dependency) {
world_recalc = true;
}
bool recalc =
shader_map.has_recalc() ||
object_map.has_recalc() ||
light_map.has_recalc() ||
mesh_map.has_recalc() ||
particle_system_map.has_recalc() ||
BlendDataObjects_is_updated_get(&b_data.ptr) ||
world_recalc;
return recalc;
foreach(Shader *shader, scene->shaders) {
if (shader->has_object_dependency) {
shader->need_sync_object = true;
}
}
}
}
void BlenderSync::sync_data(BL::RenderSettings& b_render,

View File

@@ -59,7 +59,7 @@ public:
~BlenderSync();
/* sync */
bool sync_recalc();
void sync_recalc(BL::Depsgraph& b_depsgraph);
void sync_data(BL::RenderSettings& b_render,
BL::Depsgraph& b_depsgraph,
BL::SpaceView3D& b_v3d,
@@ -126,7 +126,7 @@ private:
bool motion,
int motion_step = 0);
Object *sync_object(BL::Depsgraph& b_depsgraph,
BL::Depsgraph::duplis_iterator& b_dupli_iter,
BL::DepsgraphObjectInstance& b_instance,
uint layer_flag,
float motion_time,
bool hide_tris,
@@ -151,7 +151,7 @@ private:
/* particles */
bool sync_dupli_particle(BL::Object& b_ob,
BL::DepsgraphIter& b_dup,
BL::DepsgraphObjectInstance& b_instance,
Object *object);
/* Images. */

View File

@@ -59,12 +59,15 @@ ccl_device_inline void kernel_split_path_end(KernelGlobals *kg, int ray_index)
ccl_global char *ray_state = kernel_split_state.ray_state;
#ifdef __BRANCHED_PATH__
# ifdef __SUBSURFACE__
ccl_addr_space SubsurfaceIndirectRays *ss_indirect = &kernel_split_state.ss_rays[ray_index];
if(ss_indirect->num_rays) {
ASSIGN_RAY_STATE(ray_state, ray_index, RAY_UPDATE_BUFFER);
}
else if(IS_FLAG(ray_state, ray_index, RAY_BRANCHED_INDIRECT_SHARED)) {
else
# endif /* __SUBSURFACE__ */
if(IS_FLAG(ray_state, ray_index, RAY_BRANCHED_INDIRECT_SHARED)) {
int orig_ray = kernel_split_state.branched_state[ray_index].original_ray;
PathRadiance *L = &kernel_split_state.path_radiance[ray_index];

View File

@@ -202,6 +202,7 @@ Shader::Shader()
need_update = true;
need_update_mesh = true;
need_sync_object = false;
}
Shader::~Shader()

View File

@@ -99,6 +99,7 @@ public:
/* synchronization */
bool need_update;
bool need_update_mesh;
bool need_sync_object;
/* If the shader has only volume components, the surface is assumed to
* be transparent.

View File

@@ -36,10 +36,12 @@ set(SRC
intern/eigenvalues.cc
intern/linear_solver.cc
intern/matrix.cc
intern/svd.cc
intern/eigenvalues.h
intern/linear_solver.h
intern/matrix.h
intern/svd.h
)

View File

@@ -29,6 +29,7 @@
#include "intern/eigenvalues.h"
#include "intern/linear_solver.h"
#include "intern/matrix.h"
#include "intern/svd.h"
#endif /* __EIGEN_C_API_H__ */

View File

@@ -0,0 +1,55 @@
/*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* 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.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* The Original Code is Copyright (C) 2018 Blender Foundation.
* All rights reserved.
*
* Contributor(s): Blender Foundation
*
* ***** END GPL LICENSE BLOCK *****
*/
#ifndef __EIGEN3_MATRIX_C_API_CC__
#define __EIGEN3_MATRIX_C_API_CC__
/* Eigen gives annoying huge amount of warnings here, silence them! */
#if defined(__GNUC__) && !defined(__clang__)
# pragma GCC diagnostic ignored "-Wlogical-op"
#endif
#ifdef __EIGEN3_MATRIX_C_API_CC__ /* quiet warning */
#endif
#include <Eigen/Core>
#include <Eigen/Dense>
#include "matrix.h"
using Eigen::Map;
using Eigen::Matrix4f;
bool EIG_invert_m4_m4(float inverse[4][4], const float matrix[4][4])
{
Map<Matrix4f> M = Map<Matrix4f>((float*)matrix);
Matrix4f R;
bool invertible = true;
M.computeInverseWithCheck(R, invertible, 0.0f);
memcpy(inverse, R.data(), sizeof(float)*4*4);
return invertible;
}
#endif /* __EIGEN3_MATRIX_C_API_CC__ */

View File

@@ -0,0 +1,40 @@
/*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* 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.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* The Original Code is Copyright (C) 2015 Blender Foundation.
* All rights reserved.
*
* Contributor(s): Blender Foundation,
* Bastien Montagne
*
* ***** END GPL LICENSE BLOCK *****
*/
#ifndef __EIGEN3_MATRIX_C_API_H__
#define __EIGEN3_MATRIX_C_API_H__
#ifdef __cplusplus
extern "C" {
#endif
bool EIG_invert_m4_m4(float inverse[4][4], const float matrix[4][4]);
#ifdef __cplusplus
}
#endif
#endif /* __EIGEN3_MATRIX_C_API_H__ */

View File

@@ -37,6 +37,7 @@
#include <Eigen/Core>
#include <Eigen/SVD>
#include <Eigen/Dense>
#include "svd.h"
@@ -51,6 +52,8 @@ using Eigen::MatrixXf;
using Eigen::VectorXf;
using Eigen::Map;
using Eigen::Matrix4f;
void EIG_svd_square_matrix(const int size, const float *matrix, float *r_U, float *r_S, float *r_V)
{
/* Since our matrix is squared, we can use thinU/V. */

View File

@@ -101,7 +101,12 @@
* See T47228 and D1746 */
#define USE_NON_LATIN_KB_WORKAROUND
static GHOST_TKey convertXKey(KeySym key);
static GHOST_TKey ghost_key_from_keysym(
const KeySym key);
static GHOST_TKey ghost_key_from_keycode(
const XkbDescPtr xkb_descr, const KeyCode keycode);
static GHOST_TKey ghost_key_from_keysym_or_keycode(
const KeySym key, const XkbDescPtr xkb_descr, const KeyCode keycode);
/* these are for copy and select copy */
static char *txt_cut_buffer = NULL;
@@ -117,6 +122,7 @@ GHOST_SystemX11::
GHOST_SystemX11(
)
: GHOST_System(),
m_xkb_descr(NULL),
m_start_time(0)
{
XInitThreads();
@@ -192,6 +198,11 @@ GHOST_SystemX11(
use_xkb = XkbQueryExtension(m_display, &xkb_opcode, &xkb_event, &xkb_error, &xkb_major, &xkb_minor);
if (use_xkb) {
XkbSetDetectableAutoRepeat(m_display, true, NULL);
m_xkb_descr = XkbGetMap(m_display, 0, XkbUseCoreKbd);
if (m_xkb_descr) {
XkbGetNames(m_display, XkbKeyNamesMask, m_xkb_descr);
}
}
#ifdef WITH_XWAYLAND_HACK
@@ -249,6 +260,10 @@ GHOST_SystemX11::
XCloseDevice(m_display, m_xtablet.EraserDevice);
#endif /* WITH_X11_XINPUT */
if (m_xkb_descr) {
XkbFreeNames(m_xkb_descr, XkbKeyNamesMask, false);
}
XCloseDisplay(m_display);
}
@@ -669,10 +684,8 @@ processEvents(
}
/* dispatch event to XIM server */
if ((XFilterEvent(&xevent, (Window)NULL) == True) && (xevent.type != KeyRelease)) {
/* do nothing now, the event is consumed by XIM.
* however, KeyRelease event should be processed
* here, otherwise modifiers remain activated. */
if ((XFilterEvent(&xevent, (Window)NULL) == True)) {
/* do nothing now, the event is consumed by XIM. */
continue;
}
#endif
@@ -726,7 +739,7 @@ processEvents(
getMilliSeconds(),
GHOST_kEventKeyDown,
window,
convertXKey(modifiers[i]),
ghost_key_from_keysym(modifiers[i]),
'\0',
NULL));
}
@@ -956,7 +969,6 @@ GHOST_SystemX11::processEvent(XEvent *xe)
{
XKeyEvent *xke = &(xe->xkey);
KeySym key_sym;
KeySym key_sym_str;
char ascii;
#if defined(WITH_X11_XINPUT) && defined(X_HAVE_UTF8_STRING)
/* utf8_array[] is initial buffer used for Xutf8LookupString().
@@ -983,7 +995,7 @@ GHOST_SystemX11::processEvent(XEvent *xe)
* is unmodified (or anyone swapping the keys with xmodmap).
*
* - XLookupKeysym seems to always use first defined keymap (see T47228), which generates
* keycodes unusable by convertXKey for non-latin-compatible keymaps.
* keycodes unusable by ghost_key_from_keysym for non-latin-compatible keymaps.
*
* To address this, we:
*
@@ -1001,6 +1013,7 @@ GHOST_SystemX11::processEvent(XEvent *xe)
*
* [1] http://cgit.freedesktop.org/xorg/lib/libX11/tree/src/KeyBind.c
*/
KeySym key_sym_str;
/* Mode_switch 'modifier' is AltGr - when this one or Shift are enabled, we do not want to apply
* that 'forced number' hack. */
const unsigned int mode_switch_mask = XkbKeysymToModifiers(xke->display, XK_Mode_switch);
@@ -1021,7 +1034,7 @@ GHOST_SystemX11::processEvent(XEvent *xe)
/* Only allow a limited set of keys from XLookupKeysym, all others we take from XLookupString,
* unless it gives unknown key... */
gkey = convertXKey(key_sym);
gkey = ghost_key_from_keysym_or_keycode(key_sym, m_xkb_descr, xke->keycode);
switch (gkey) {
case GHOST_kKeyRightAlt:
case GHOST_kKeyLeftAlt:
@@ -1058,11 +1071,13 @@ GHOST_SystemX11::processEvent(XEvent *xe)
case GHOST_kKeyNumpadSlash:
break;
default:
GHOST_TKey gkey_str = convertXKey(key_sym_str);
{
GHOST_TKey gkey_str = ghost_key_from_keysym(key_sym_str);
if (gkey_str != GHOST_kKeyUnknown) {
gkey = gkey_str;
}
}
}
#else
/* In keyboards like latin ones,
* numbers needs a 'Shift' to be accessed but key_sym
@@ -1083,7 +1098,7 @@ GHOST_SystemX11::processEvent(XEvent *xe)
key_sym = XLookupKeysym(xke, 0);
}
gkey = convertXKey(key_sym);
gkey = ghost_key_from_keysym_or_keycode(key_sym, m_xkb_descr, xke->keycode);
if (!XLookupString(xke, &ascii, 1, NULL, NULL)) {
ascii = '\0';
@@ -1732,10 +1747,22 @@ generateWindowExposeEvents()
return anyProcessed;
}
static GHOST_TKey
ghost_key_from_keysym_or_keycode(const KeySym keysym, XkbDescPtr xkb_descr, const KeyCode keycode)
{
GHOST_TKey type = ghost_key_from_keysym(keysym);
if (type == GHOST_kKeyUnknown) {
if (xkb_descr) {
type = ghost_key_from_keycode(xkb_descr, keycode);
}
}
return type;
}
#define GXMAP(k, x, y) case x: k = y; break
static GHOST_TKey
convertXKey(KeySym key)
ghost_key_from_keysym(const KeySym key)
{
GHOST_TKey type;
@@ -1844,6 +1871,9 @@ convertXKey(KeySym key)
#endif
#endif
default:
#ifdef GHOST_DEBUG
printf("%s: unknown key: %lu / 0x%lx\n", __func__, key, key);
#endif
type = GHOST_kKeyUnknown;
break;
}
@@ -1854,6 +1884,33 @@ convertXKey(KeySym key)
#undef GXMAP
#define MAKE_ID(a, b, c, d) ((int)(d) << 24 | (int)(c) << 16 | (b) << 8 | (a))
static GHOST_TKey
ghost_key_from_keycode(const XkbDescPtr xkb_descr, const KeyCode keycode)
{
GHOST_ASSERT(XkbKeyNameLength == 4, "Name length is invalid!");
if (keycode >= xkb_descr->min_key_code && keycode <= xkb_descr->max_key_code) {
const char *id_str = xkb_descr->names->keys[keycode].name;
const uint32_t id = MAKE_ID(id_str[0], id_str[1], id_str[2], id_str[3]);
switch (id) {
case MAKE_ID('T', 'L', 'D', 'E'):
return GHOST_kKeyAccentGrave;
#ifdef GHOST_DEBUG
default:
printf("%s unhandled keycode: %.*s\n", __func__, XkbKeyNameLength, id_str);
break;
#endif
}
}
else {
GHOST_ASSERT(false, "KeyCode out of range!");
}
return GHOST_kKeyUnknown;
}
#undef MAKE_ID
/* from xclip.c xcout() v0.11 */
#define XCLIB_XCOUT_NONE 0 /* no context */

View File

@@ -34,6 +34,7 @@
#define __GHOST_SYSTEMX11_H__
#include <X11/Xlib.h>
#include <X11/XKBlib.h> /* allow detectable autorepeate */
#include "GHOST_System.h"
#include "../GHOST_Types.h"
@@ -373,6 +374,10 @@ public:
private:
Display *m_display;
/* Use for scancode lookups. */
XkbDescRec *m_xkb_descr;
#if defined(WITH_X11_XINPUT) && defined(X_HAVE_UTF8_STRING)
XIM m_xim;
#endif

View File

@@ -59,13 +59,19 @@ using namespace OCIO_NAMESPACE;
#include "ocio_impl.h"
static const int LUT3D_EDGE_SIZE = 64;
static const int SHADER_CACHE_SIZE = 4;
extern "C" char datatoc_gpu_shader_display_transform_glsl[];
extern "C" char datatoc_gpu_shader_display_transform_vertex_glsl[];
/* **** OpenGL drawing routines using GLSL for color space transform ***** */
typedef struct OCIO_GLSLDrawState {
typedef struct OCIO_GLSLShader {
/* Cache ID */
std::string lut3dCacheID;
std::string shaderCacheID;
/* LUT */
bool lut3d_texture_allocated; /* boolean flag indicating whether
* lut texture is allocated
*/
@@ -75,25 +81,29 @@ typedef struct OCIO_GLSLDrawState {
float *lut3d; /* 3D LUT table */
bool dither_used;
/* Dither */
bool use_dither;
bool curve_mapping_used;
/* Curve Mapping */
bool use_curve_mapping;
bool curve_mapping_texture_allocated;
bool curve_mapping_texture_valid;
GLuint curve_mapping_texture;
size_t curve_mapping_cache_id;
bool predivide_used;
/* Cache */
std::string lut3dcacheid;
std::string shadercacheid;
/* Alpha Predivide */
bool use_predivide;
/* GLSL stuff */
GLuint ocio_shader;
GLuint vert_shader;
GLuint program;
Gwn_ShaderInterface *shader_interface;
} GLSLDrawState;
typedef struct OCIO_GLSLDrawState {
/* Shader Cache */
OCIO_GLSLShader *shader_cache[SHADER_CACHE_SIZE];
/* Previous OpenGL state. */
GLint last_texture, last_texture_unit;
@@ -150,33 +160,24 @@ static GLuint linkShaders(GLuint ocio_shader, GLuint vert_shader)
static OCIO_GLSLDrawState *allocateOpenGLState(void)
{
OCIO_GLSLDrawState *state;
/* Allocate memory for state. */
state = (OCIO_GLSLDrawState *) MEM_callocN(sizeof(OCIO_GLSLDrawState),
return (OCIO_GLSLDrawState *) MEM_callocN(sizeof(OCIO_GLSLDrawState),
"OCIO OpenGL State struct");
/* Call constructors on new memory. */
new (&state->lut3dcacheid) std::string("");
new (&state->shadercacheid) std::string("");
return state;
}
/* Ensure LUT texture and array are allocated */
static bool ensureLUT3DAllocated(OCIO_GLSLDrawState *state)
static bool ensureLUT3DAllocated(OCIO_GLSLShader *shader)
{
int num_3d_entries = 3 * LUT3D_EDGE_SIZE * LUT3D_EDGE_SIZE * LUT3D_EDGE_SIZE;
if (state->lut3d_texture_allocated)
return state->lut3d_texture_valid;
if (shader->lut3d_texture_allocated)
return shader->lut3d_texture_valid;
glGenTextures(1, &state->lut3d_texture);
glGenTextures(1, &shader->lut3d_texture);
state->lut3d = (float *) MEM_callocN(sizeof(float) * num_3d_entries, "OCIO GPU 3D LUT");
shader->lut3d = (float *) MEM_callocN(sizeof(float) * num_3d_entries, "OCIO GPU 3D LUT");
glActiveTexture(GL_TEXTURE1);
glBindTexture(GL_TEXTURE_3D, state->lut3d_texture);
glBindTexture(GL_TEXTURE_3D, shader->lut3d_texture);
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
@@ -188,27 +189,27 @@ static bool ensureLUT3DAllocated(OCIO_GLSLDrawState *state)
glTexImage3D(GL_TEXTURE_3D, 0, GL_RGB16F_ARB,
LUT3D_EDGE_SIZE, LUT3D_EDGE_SIZE, LUT3D_EDGE_SIZE,
0, GL_RGB, GL_FLOAT, state->lut3d);
0, GL_RGB, GL_FLOAT, shader->lut3d);
state->lut3d_texture_allocated = true;
shader->lut3d_texture_allocated = true;
/* GL_RGB16F_ARB could be not supported at some drivers
* in this case we could not use GLSL display
*/
state->lut3d_texture_valid = glGetError() == GL_NO_ERROR;
shader->lut3d_texture_valid = glGetError() == GL_NO_ERROR;
return state->lut3d_texture_valid;
return shader->lut3d_texture_valid;
}
static bool ensureCurveMappingAllocated(OCIO_GLSLDrawState *state, OCIO_CurveMappingSettings *curve_mapping_settings)
static bool ensureCurveMappingAllocated(OCIO_GLSLShader *shader, OCIO_CurveMappingSettings *curve_mapping_settings)
{
if (state->curve_mapping_texture_allocated)
return state->curve_mapping_texture_valid;
if (shader->curve_mapping_texture_allocated)
return shader->curve_mapping_texture_valid;
glGenTextures(1, &state->curve_mapping_texture);
glGenTextures(1, &shader->curve_mapping_texture);
glActiveTexture(GL_TEXTURE2);
glBindTexture(GL_TEXTURE_1D, state->curve_mapping_texture);
glBindTexture(GL_TEXTURE_1D, shader->curve_mapping_texture);
glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
@@ -221,16 +222,51 @@ static bool ensureCurveMappingAllocated(OCIO_GLSLDrawState *state, OCIO_CurveMap
glTexImage1D(GL_TEXTURE_1D, 0, GL_RGBA16F, curve_mapping_settings->lut_size,
0, GL_RGBA, GL_FLOAT, curve_mapping_settings->lut);
state->curve_mapping_texture_allocated = true;
shader->curve_mapping_texture_allocated = true;
/* GL_RGB16F_ARB could be not supported at some drivers
* in this case we could not use GLSL display
*/
state->curve_mapping_texture_valid = glGetError() == GL_NO_ERROR;
shader->curve_mapping_texture_valid = glGetError() == GL_NO_ERROR;
return state->curve_mapping_texture_valid;
return shader->curve_mapping_texture_valid;
}
static void freeGLSLShader(OCIO_GLSLShader *shader)
{
if (shader->curve_mapping_texture_allocated) {
glDeleteTextures(1, &shader->curve_mapping_texture);
}
if (shader->lut3d_texture_allocated) {
glDeleteTextures(1, &shader->lut3d_texture);
}
if (shader->lut3d) {
MEM_freeN(shader->lut3d);
}
if (shader->program) {
glDeleteProgram(shader->program);
}
if (shader->shader_interface) {
GWN_shaderinterface_discard(shader->shader_interface);
}
if (shader->ocio_shader) {
glDeleteShader(shader->ocio_shader);
}
using std::string;
shader->lut3dCacheID.~string();
shader->shaderCacheID.~string();
MEM_freeN(shader);
}
/* Detect if we can support GLSL drawing */
bool OCIOImpl::supportGLSLDraw()
{
@@ -265,85 +301,95 @@ bool OCIOImpl::setupGLSLDraw(OCIO_GLSLDrawState **state_r, OCIO_ConstProcessorRc
glGetIntegerv(GL_TEXTURE_BINDING_2D, &state->last_texture);
glGetIntegerv(GL_ACTIVE_TEXTURE, &state->last_texture_unit);
if (!ensureLUT3DAllocated(state)) {
glActiveTexture(state->last_texture_unit);
glBindTexture(GL_TEXTURE_2D, state->last_texture);
return false;
}
if (use_curve_mapping) {
if (!ensureCurveMappingAllocated(state, curve_mapping_settings)) {
glActiveTexture(state->last_texture_unit);
glBindTexture(GL_TEXTURE_2D, state->last_texture);
return false;
}
}
else {
if (state->curve_mapping_texture_allocated) {
glDeleteTextures(1, &state->curve_mapping_texture);
state->curve_mapping_texture_allocated = false;
}
}
/* Step 1: Create a GPU Shader Description */
/* Compute cache IDs. */
GpuShaderDesc shaderDesc;
shaderDesc.setLanguage(GPU_LANGUAGE_GLSL_1_3);
shaderDesc.setFunctionName("OCIODisplay");
shaderDesc.setLut3DEdgeLen(LUT3D_EDGE_SIZE);
if (use_curve_mapping) {
if (state->curve_mapping_cache_id != curve_mapping_settings->cache_id) {
glActiveTexture(GL_TEXTURE2);
glBindTexture(GL_TEXTURE_1D, state->curve_mapping_texture);
glTexSubImage1D(GL_TEXTURE_1D, 0, 0, curve_mapping_settings->lut_size,
GL_RGBA, GL_FLOAT, curve_mapping_settings->lut);
std::string lut3dCacheID = ocio_processor->getGpuLut3DCacheID(shaderDesc);
std::string shaderCacheID = ocio_processor->getGpuShaderTextCacheID(shaderDesc);
/* Find matching cached shader. */
OCIO_GLSLShader *shader = NULL;
for (int i = 0; i < SHADER_CACHE_SIZE; i++) {
OCIO_GLSLShader *cached_shader = state->shader_cache[i];
if (cached_shader == NULL) {
continue;
}
if (cached_shader->lut3dCacheID == lut3dCacheID &&
cached_shader->shaderCacheID == shaderCacheID &&
cached_shader->use_predivide == use_predivide &&
cached_shader->use_curve_mapping == use_curve_mapping &&
cached_shader->use_dither == use_dither)
{
/* LRU cache, so move to front. */
for (int j = i; j > 0; j--) {
state->shader_cache[j] = state->shader_cache[j - 1];
}
state->shader_cache[0] = cached_shader;
shader = cached_shader;
break;
}
}
/* Step 2: Compute the 3D LUT */
std::string lut3dCacheID = ocio_processor->getGpuLut3DCacheID(shaderDesc);
if (lut3dCacheID != state->lut3dcacheid) {
state->lut3dcacheid = lut3dCacheID;
ocio_processor->getGpuLut3D(state->lut3d, shaderDesc);
if (shader == NULL) {
/* LRU cache, shift other items back so we can insert at the front. */
OCIO_GLSLShader *last_shader = state->shader_cache[SHADER_CACHE_SIZE - 1];
if (last_shader) {
freeGLSLShader(last_shader);
}
for (int j = SHADER_CACHE_SIZE - 1; j > 0; j--) {
state->shader_cache[j] = state->shader_cache[j - 1];
}
/* Allocate memory for shader. */
shader = (OCIO_GLSLShader *) MEM_callocN(sizeof(OCIO_GLSLShader),
"OCIO GLSL Shader");
state->shader_cache[0] = shader;
new (&shader->lut3dCacheID) std::string();
new (&shader->shaderCacheID) std::string();
shader->lut3dCacheID = lut3dCacheID;
shader->shaderCacheID = shaderCacheID;
shader->use_curve_mapping = use_curve_mapping;
shader->use_dither = use_dither;
shader->use_predivide = use_predivide;
bool valid = true;
/* Compute 3D LUT. */
if (valid && ensureLUT3DAllocated(shader)) {
ocio_processor->getGpuLut3D(shader->lut3d, shaderDesc);
glActiveTexture(GL_TEXTURE1);
glBindTexture(GL_TEXTURE_3D, state->lut3d_texture);
glBindTexture(GL_TEXTURE_3D, shader->lut3d_texture);
glTexSubImage3D(GL_TEXTURE_3D, 0, 0, 0, 0,
LUT3D_EDGE_SIZE, LUT3D_EDGE_SIZE, LUT3D_EDGE_SIZE,
GL_RGB, GL_FLOAT, state->lut3d);
GL_RGB, GL_FLOAT, shader->lut3d);
}
else {
valid = false;
}
/* Step 3: Compute the Shader */
std::string shaderCacheID = ocio_processor->getGpuShaderTextCacheID(shaderDesc);
if (state->program == 0 ||
shaderCacheID != state->shadercacheid ||
use_predivide != state->predivide_used ||
use_curve_mapping != state->curve_mapping_used ||
use_dither != state->dither_used)
{
state->shadercacheid = shaderCacheID;
if (state->program) {
glDeleteProgram(state->program);
}
if (state->ocio_shader) {
glDeleteShader(state->ocio_shader);
}
if (state->vert_shader) {
glDeleteShader(state->vert_shader);
/* Allocate curve mapping texture. */
if (valid && use_curve_mapping) {
if (!ensureCurveMappingAllocated(shader, curve_mapping_settings)) {
valid = false;
}
}
if (valid) {
/* Vertex shader */
std::ostringstream osv;
osv << "#version 330\n";
osv << datatoc_gpu_shader_display_transform_vertex_glsl;
state->vert_shader = compileShaderText(GL_VERTEX_SHADER, osv.str().c_str());
shader->vert_shader = compileShaderText(GL_VERTEX_SHADER, osv.str().c_str());
/* Fragment shader */
std::ostringstream os;
@@ -369,31 +415,40 @@ bool OCIOImpl::setupGLSLDraw(OCIO_GLSLDrawState **state_r, OCIO_ConstProcessorRc
os << ocio_processor->getGpuShaderText(shaderDesc) << "\n";
os << datatoc_gpu_shader_display_transform_glsl;
state->ocio_shader = compileShaderText(GL_FRAGMENT_SHADER, os.str().c_str());
shader->ocio_shader = compileShaderText(GL_FRAGMENT_SHADER, os.str().c_str());
if (state->ocio_shader && state->vert_shader) {
state->program = linkShaders(state->ocio_shader, state->vert_shader);
/* Program */
if (shader->ocio_shader && shader->vert_shader) {
shader->program = linkShaders(shader->ocio_shader, shader->vert_shader);
}
if (state->program) {
if (state->shader_interface) {
GWN_shaderinterface_discard(state->shader_interface);
if (shader->program) {
if (shader->shader_interface) {
GWN_shaderinterface_discard(shader->shader_interface);
}
shader->shader_interface = GWN_shaderinterface_create(shader->program);
}
}
state->shader_interface = GWN_shaderinterface_create(state->program);
}
state->curve_mapping_used = use_curve_mapping;
state->dither_used = use_dither;
state->predivide_used = use_predivide;
/* Update curve mapping texture. */
if (use_curve_mapping && shader->curve_mapping_texture_allocated) {
if (shader->curve_mapping_cache_id != curve_mapping_settings->cache_id) {
glActiveTexture(GL_TEXTURE2);
glBindTexture(GL_TEXTURE_1D, shader->curve_mapping_texture);
glTexSubImage1D(GL_TEXTURE_1D, 0, 0, curve_mapping_settings->lut_size,
GL_RGBA, GL_FLOAT, curve_mapping_settings->lut);
}
}
if (state->program) {
/* Bind Shader. */
if (shader->program) {
glActiveTexture(GL_TEXTURE1);
glBindTexture(GL_TEXTURE_3D, state->lut3d_texture);
glBindTexture(GL_TEXTURE_3D, shader->lut3d_texture);
if (use_curve_mapping) {
glActiveTexture(GL_TEXTURE2);
glBindTexture(GL_TEXTURE_1D, state->curve_mapping_texture);
glBindTexture(GL_TEXTURE_1D, shader->curve_mapping_texture);
}
glActiveTexture(GL_TEXTURE0);
@@ -409,7 +464,7 @@ bool OCIOImpl::setupGLSLDraw(OCIO_GLSLDrawState **state_r, OCIO_ConstProcessorRc
Gwn_VertFormat *format = immVertexFormat();
GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
GWN_vertformat_attr_add(format, "texCoord", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
immBindProgram(state->program, state->shader_interface);
immBindProgram(shader->program, shader->shader_interface);
immUniform1i("image_texture", 0);
immUniform1i("lut3d_texture", 1);
@@ -453,27 +508,13 @@ void OCIOImpl::finishGLSLDraw(OCIO_GLSLDrawState *state)
immUnbindProgram();
}
void OCIOImpl::freeGLState(struct OCIO_GLSLDrawState *state)
void OCIOImpl::freeGLState(OCIO_GLSLDrawState *state)
{
using std::string;
if (state->lut3d_texture_allocated)
glDeleteTextures(1, &state->lut3d_texture);
if (state->lut3d)
MEM_freeN(state->lut3d);
if (state->program)
glDeleteProgram(state->program);
if (state->shader_interface)
GWN_shaderinterface_discard(state->shader_interface);
if (state->ocio_shader)
glDeleteShader(state->ocio_shader);
state->lut3dcacheid.~string();
state->shadercacheid.~string();
for (int i = 0; i < SHADER_CACHE_SIZE; i++) {
if (state->shader_cache[i]) {
freeGLSLShader(state->shader_cache[i]);
}
}
MEM_freeN(state);
}

View File

@@ -0,0 +1,3 @@
These matcap images are licensed as GNU GPL 2 or later, like the rest of Blender's code.
Thanks to Kent Trammell, Aidy Burrows, John Herreno , Terry Wallwork and David Silverman for making the pictures.

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View File

@@ -153,8 +153,10 @@ def get_transform_generators_base_info(data):
# no path in this case
path = ""
# data on ID-blocks directly should get grouped by the KeyingSet
grouping = None
# transform data on ID-blocks directly should get grouped under a
# hardcoded label ("Object Transforms") so that they get grouped
# consistently when keyframed directly
grouping = "Object Transforms"
else:
# get the path to the ID-block
path = data.path_from_id()

View File

@@ -160,8 +160,8 @@
</ThemeWidgetColors>
</wcol_menu>
<wcol_pulldown>
<ThemeWidgetColors outline="#000000"
inner="#29282eff"
<ThemeWidgetColors outline="#29282e"
inner="#29282e99"
inner_sel="#505158ff"
item="#ffffffff"
text="#eeeeee"
@@ -936,18 +936,18 @@
</ThemeUserPreferences>
</user_preferences>
<console>
<ThemeConsole line_output="#6080ff"
<ThemeConsole line_output="#b3c2ff"
line_input="#ffffff"
line_info="#00aa00"
line_error="#dc6060"
cursor="#dc6060"
line_info="#47b347"
line_error="#de6f6f"
cursor="#de5959"
select="#ffffff30">
<space>
<ThemeSpaceGeneric back="#2f3035"
title="#ffffff"
text="#ffffff"
text_hi="#ffffff"
header="#29282eff"
header="#2f3035ff"
header_text="#eeeeee"
header_text_hi="#ffffff"
button="#2f303599"

View File

@@ -161,7 +161,7 @@
</wcol_menu>
<wcol_pulldown>
<ThemeWidgetColors outline="#000000"
inner="#3f3f3fff"
inner="#e6e6e699"
inner_sel="#5680c2ff"
item="#ffffffff"
text="#000000"
@@ -169,7 +169,7 @@
show_shaded="FALSE"
shadetop="25"
shadedown="-20"
roundness="0.4">
roundness="0.3">
</ThemeWidgetColors>
</wcol_pulldown>
<wcol_menu_back>

View File

@@ -865,7 +865,7 @@ class TransformsToDeltasAnim(Operator):
class DupliOffsetFromCursor(Operator):
"""Set offset used for DupliGroup based on cursor position"""
"""Set offset used for collection instances based on cursor position"""
bl_idname = "object.dupli_offset_from_cursor"
bl_label = "Set Offset From Cursor"
bl_options = {'INTERNAL', 'UNDO'}
@@ -876,9 +876,9 @@ class DupliOffsetFromCursor(Operator):
def execute(self, context):
scene = context.scene
group = context.group
collection = context.collection
group.dupli_offset = scene.cursor_location
collection.dupli_offset = scene.cursor_location
return {'FINISHED'}

View File

@@ -19,13 +19,17 @@
# <pep8 compliant>
import bpy
from bpy.types import Operator
from bpy.types import (
Operator,
OperatorFileListElement
)
from bpy.props import (
BoolProperty,
EnumProperty,
FloatProperty,
IntProperty,
StringProperty,
CollectionProperty,
)
from bpy.app.translations import pgettext_tip as tip_
@@ -55,6 +59,15 @@ rna_relative_prop = BoolProperty(
default=False,
)
rna_space_type_prop = EnumProperty(
name="Type",
items=tuple(
(e.identifier, e.name, "", e. value)
for e in bpy.types.Space.bl_rna.properties["type"].enum_items
),
default='EMPTY',
)
def context_path_validate(context, data_path):
try:
@@ -2335,21 +2348,29 @@ class WM_OT_tool_set_by_name(Operator):
name="Text",
description="Display name of the tool",
)
space_type = EnumProperty(
name="Type",
items=tuple(
(e.identifier, e.name, "", e. value)
for e in bpy.types.Space.bl_rna.properties["type"].enum_items
),
default='EMPTY',
cycle = BoolProperty(
name="Cycle",
description="Cycle through tools in this group",
default=False,
options={'SKIP_SAVE'},
)
space_type = rna_space_type_prop
def execute(self, context):
from bl_ui.space_toolsystem_common import activate_by_name
from bl_ui.space_toolsystem_common import (
activate_by_name,
activate_by_name_or_cycle,
)
if self.properties.is_property_set("space_type"):
space_type = self.space_type
if space_type == 'EMPTY':
else:
space_type = context.space_data.type
if activate_by_name(context, space_type, self.name):
fn = activate_by_name_or_cycle if self.cycle else activate_by_name
if fn(context, space_type, self.name):
return {'FINISHED'}
else:
self.report({'WARNING'}, f"Tool {self.name!r} not found.")
@@ -2369,9 +2390,7 @@ class WM_OT_toolbar(Operator):
cls = ToolSelectPanelHelper._tool_class_from_space_type(space_type)
if cls is None:
# self.report({'WARNING'}, f"Toolbar not found for {space_type!r}")
# Passthrough to running search directly.
bpy.ops.wm.search_menu('INVOKE_DEFAULT')
self.report({'WARNING'}, f"Toolbar not found for {space_type!r}")
return {'CANCELLED'}
wm = context.window_manager
@@ -2379,15 +2398,126 @@ class WM_OT_toolbar(Operator):
def draw_menu(popover, context):
layout = popover.layout
cls.draw_cls(layout, context, detect_layout=False)
layout.operator_context = 'INVOKE_DEFAULT'
layout.operator("wm.search_menu")
cls.draw_cls(layout, context, detect_layout=False, scale_y=1.0)
wm.popover(draw_menu, keymap=keymap)
return {'FINISHED'}
# Studio Light operations
class WM_OT_studiolight_install(Operator):
"""Install a user defined studio light"""
bl_idname = "wm.studiolight_install"
bl_label = "Install Custom Studio Light"
files = CollectionProperty(
name="File Path",
type=OperatorFileListElement,
)
directory = StringProperty(
subtype='DIR_PATH',
)
filter_folder = BoolProperty(
name="Filter folders",
default=True,
options={'HIDDEN'},
)
filter_glob = StringProperty(
default="*.png;*.jpg;*.hdr;*.exr",
options={'HIDDEN'},
)
orientation = EnumProperty(
items=(
("MATCAP", "MatCap", ""),
("WORLD", "World", ""),
("CAMERA", "Camera", ""),
)
)
def execute(self, context):
import traceback
import shutil
import pathlib
userpref = context.user_preferences
filepaths = [pathlib.Path(self.directory, e.name) for e in self.files]
path_studiolights = bpy.utils.user_resource('DATAFILES')
if not path_studiolights:
self.report({'ERROR'}, "Failed to get Studio Light path")
return {'CANCELLED'}
path_studiolights = pathlib.Path(path_studiolights, "studiolights", self.orientation.lower())
if not path_studiolights.exists():
try:
path_studiolights.mkdir(parents=True, exist_ok=True)
except:
traceback.print_exc()
for filepath in filepaths:
shutil.copy(str(filepath), str(path_studiolights))
userpref.studio_lights_refresh()
# print message
msg = (
tip_("StudioLight Installed %r into %r") %
(", ".join(str(x.name) for x in self.files), str(path_studiolights))
)
print(msg)
self.report({'INFO'}, msg)
return {'FINISHED'}
def invoke(self, context, event):
wm = context.window_manager
wm.fileselect_add(self)
return {'RUNNING_MODAL'}
class WM_OT_studiolight_uninstall(Operator):
bl_idname = 'wm.studiolight_uninstall'
bl_label = "Uninstall Studio Light"
index = bpy.props.IntProperty()
def execute(self, context):
import pathlib
userpref = context.user_preferences
for studio_light in userpref.studio_lights:
if studio_light.index == self.index:
path = pathlib.Path(studio_light.path)
if path.exists():
path.unlink()
userpref.studio_lights_refresh()
return {'FINISHED'}
return {'CANCELLED'}
class WM_OT_studiolight_expand(Operator):
bl_idname = "wm.studiolight_expand"
bl_label = "Expand Studio Light"
index = bpy.props.IntProperty()
def execute(self, context):
userpref = context.user_preferences
for studio_light in userpref.studio_lights:
if studio_light.index == self.index:
studio_light.show_expanded = not studio_light.show_expanded
break
return {'FINISHED'}
class WM_OT_studiolight_userpref_show(Operator):
"""Show light user preferences"""
bl_idname = "wm.studiolight_userpref_show"
bl_label = ""
bl_options = {'INTERNAL'}
def execute(self, context):
context.user_preferences.active_section = 'LIGHTS'
bpy.ops.screen.userpref_show('INVOKE_DEFAULT')
return {'FINISHED'}
classes = (
BRUSH_OT_active_index_set,
WM_OT_addon_disable,
@@ -2442,6 +2572,10 @@ classes = (
WM_OT_owner_disable,
WM_OT_owner_enable,
WM_OT_url_open,
WM_OT_studiolight_expand,
WM_OT_studiolight_install,
WM_OT_studiolight_uninstall,
WM_OT_studiolight_userpref_show,
WM_OT_tool_set_by_name,
WM_OT_toolbar,
)

View File

@@ -88,7 +88,7 @@ _modules = [
"space_userpref",
"space_view3d",
"space_view3d_toolbar",
]
]
import bpy
@@ -167,6 +167,8 @@ def unregister():
# Define a default UIList, when a list does not need any custom drawing...
# Keep in sync with its #defined name in UI_interface.h
class UI_UL_list(bpy.types.UIList):
# These are common filtering or ordering operations (same as the default C ones!).
@staticmethod

View File

@@ -37,27 +37,26 @@ class MotionPathButtonsPanel:
mps = avs.motion_path
# Display Range
layout.row().prop(mps, "type", expand=True)
layout.use_property_split = True
layout.row().prop(mps, "type")
split = layout.split()
col = layout.column()
col = split.column()
col.label(text="Display Range:")
sub = col.column(align=True)
if mps.type == 'CURRENT_FRAME':
sub.prop(mps, "frame_before", text="Before")
sub.prop(mps, "frame_before", text="Frame Range Before")
sub.prop(mps, "frame_after", text="After")
elif mps.type == 'RANGE':
sub.prop(mps, "frame_start", text="Start")
sub.prop(mps, "frame_start", text="Frame Range Start")
sub.prop(mps, "frame_end", text="End")
sub.prop(mps, "frame_step", text="Step")
col = split.column()
col = layout.column(align=True)
if bones:
col.label(text="Cache for Bone:")
else:
col.label(text="Cache:")
col.label(text="Cache")
if mpath:
sub = col.column(align=True)
@@ -81,17 +80,15 @@ class MotionPathButtonsPanel:
sub.operator("object.paths_calculate", text="Calculate...", icon='OBJECT_DATA')
# Display Settings
split = layout.split()
col = split.column()
col.label(text="Show:")
layout.label(text="Display")
col = layout.column()
col.prop(mps, "show_frame_numbers", text="Frame Numbers")
if mpath is not None:
col.prop(mpath, "lines", text="Lines")
col.prop(mpath, "line_thickness", text="Thickness")
col = split.column()
col.label("")
col.prop(mps, "show_keyframe_highlight", text="Keyframes")
sub = col.column()
sub.enabled = mps.show_keyframe_highlight
@@ -101,11 +98,11 @@ class MotionPathButtonsPanel:
# Customize path
if mpath is not None:
row = layout.row(align=True)
row.prop(mpath, "use_custom_color", text="", toggle=True, icon='COLOR')
sub = row.row(align=True)
col.prop(mpath, "use_custom_color", text="Custom Color")
sub = col.column()
sub.enabled = mpath.use_custom_color
sub.prop(mpath, "color", text="")
sub.prop(mpath, "color")
# FIXME: this panel still needs to be ported so that it will work correctly with animviz

View File

@@ -941,6 +941,7 @@ class BONE_PT_constraints(ConstraintButtonsPanel, Panel):
for con in context.pose_bone.constraints:
self.draw_constraint(context, con)
classes = (
OBJECT_PT_constraints,
BONE_PT_constraints,

View File

@@ -77,15 +77,13 @@ class DATA_PT_display(ArmatureButtonsPanel, Panel):
layout.row().prop(arm, "draw_type", expand=True)
split = layout.split()
layout.use_property_split = True
col = split.column()
col = layout.column()
col.prop(arm, "show_names", text="Names")
col.prop(arm, "show_axes", text="Axes")
col.prop(arm, "show_bone_custom_shapes", text="Shapes")
col = split.column()
col.prop(arm, "show_group_colors", text="Colors")
col.prop(arm, "show_group_colors", text="Group Colors")
if ob:
col.prop(ob, "show_x_ray", text="X-Ray")
col.prop(arm, "use_deform_delay", text="Delay Refresh")
@@ -149,7 +147,8 @@ class DATA_PT_bone_groups(ArmatureButtonsPanel, Panel):
sub = row.row(align=True)
sub.operator("pose.group_assign", text="Assign")
sub.operator("pose.group_unassign", text="Remove") # row.operator("pose.bone_group_remove_from", text="Remove")
# row.operator("pose.bone_group_remove_from", text="Remove")
sub.operator("pose.group_unassign", text="Remove")
sub = row.row(align=True)
sub.operator("pose.group_select", text="Select")
@@ -196,7 +195,11 @@ class DATA_PT_pose_library(ArmatureButtonsPanel, Panel):
if pose_marker_active is not None:
col.operator("poselib.pose_remove", icon='ZOOMOUT', text="")
col.operator("poselib.apply_pose", icon='ZOOM_SELECTED', text="").pose_index = poselib.pose_markers.active_index
col.operator(
"poselib.apply_pose",
icon='ZOOM_SELECTED',
text="",
).pose_index = poselib.pose_markers.active_index
col.operator("poselib.action_sanitize", icon='HELP', text="") # XXX: put in menu?
@@ -216,21 +219,19 @@ class DATA_PT_ghost(ArmatureButtonsPanel, Panel):
layout.row().prop(arm, "ghost_type", expand=True)
split = layout.split()
layout.use_property_split = True
col = split.column(align=True)
col = layout.column(align=True)
if arm.ghost_type == 'RANGE':
col.prop(arm, "ghost_frame_start", text="Start")
col.prop(arm, "ghost_frame_start", text="Frame Start")
col.prop(arm, "ghost_frame_end", text="End")
col.prop(arm, "ghost_size", text="Step")
elif arm.ghost_type == 'CURRENT_FRAME':
col.prop(arm, "ghost_step", text="Range")
col.prop(arm, "ghost_step", text="Frame Range")
col.prop(arm, "ghost_size", text="Step")
col = split.column()
col.label(text="Display:")
col.prop(arm, "show_only_ghost_selected", text="Selected Only")
col.prop(arm, "show_only_ghost_selected", text="Display Selected Only")
class DATA_PT_iksolver_itasc(ArmatureButtonsPanel, Panel):
@@ -244,6 +245,7 @@ class DATA_PT_iksolver_itasc(ArmatureButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
layout.use_property_split = True
ob = context.object
itasc = ob.pose.ik_param
@@ -251,34 +253,37 @@ class DATA_PT_iksolver_itasc(ArmatureButtonsPanel, Panel):
layout.prop(ob.pose, "ik_solver")
if itasc:
layout.use_property_split = False
layout.row().prop(itasc, "mode", expand=True)
layout.use_property_split = True
simulation = (itasc.mode == 'SIMULATION')
if simulation:
layout.label(text="Reiteration:")
layout.row().prop(itasc, "reiteration_method", expand=True)
layout.prop(itasc, "reiteration_method", expand=False)
row = layout.row()
row.active = not simulation or itasc.reiteration_method != 'NEVER'
row.prop(itasc, "precision")
row.prop(itasc, "iterations")
col = layout.column()
col.active = not simulation or itasc.reiteration_method != 'NEVER'
col.prop(itasc, "precision")
col.prop(itasc, "iterations")
if simulation:
layout.prop(itasc, "use_auto_step")
row = layout.row()
col = layout.column(align=True)
if itasc.use_auto_step:
row.prop(itasc, "step_min", text="Min")
row.prop(itasc, "step_max", text="Max")
col.prop(itasc, "step_min", text="Steps Min")
col.prop(itasc, "step_max", text="Max")
else:
row.prop(itasc, "step_count")
col.prop(itasc, "step_count", text="Steps")
layout.prop(itasc, "solver")
if simulation:
layout.prop(itasc, "feedback")
layout.prop(itasc, "velocity_max")
if itasc.solver == 'DLS':
row = layout.row()
row.prop(itasc, "damping_max", text="Damp", slider=True)
row.prop(itasc, "damping_epsilon", text="Eps", slider=True)
col = layout.column()
col.separator()
col.prop(itasc, "damping_max", text="Damping Max", slider=True)
col.prop(itasc, "damping_epsilon", text="Damping Epsilon", slider=True)
from .properties_animviz import (
MotionPathButtonsPanel,

View File

@@ -62,88 +62,63 @@ class BONE_PT_transform(BoneButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
layout.use_property_split = True
ob = context.object
bone = context.bone
col = layout.column()
if bone and ob:
pchan = ob.pose.bones[bone.name]
row = layout.row()
col = row.column()
col.prop(pchan, "location")
col.active = not (bone.parent and bone.use_connect)
col = row.column()
sub = col.row(align=True)
sub.prop(pchan, "location")
sub.prop(pchan, "lock_location", text="")
col = layout.column()
if pchan.rotation_mode == 'QUATERNION':
col.prop(pchan, "rotation_quaternion", text="Rotation")
sub = col.row(align=True)
sub.prop(pchan, "rotation_quaternion", text="Rotation")
subsub = sub.column(align=True)
subsub.prop(pchan, "lock_rotation_w", text="")
subsub.prop(pchan, "lock_rotation", text="")
elif pchan.rotation_mode == 'AXIS_ANGLE':
#col.label(text="Rotation")
# col.label(text="Rotation")
#col.prop(pchan, "rotation_angle", text="Angle")
#col.prop(pchan, "rotation_axis", text="Axis")
col.prop(pchan, "rotation_axis_angle", text="Rotation")
sub = col.row(align=True)
sub.prop(pchan, "rotation_axis_angle", text="Rotation")
subsub = sub.column(align=True)
subsub.prop(pchan, "lock_rotation_w", text="")
subsub.prop(pchan, "lock_rotation", text="")
else:
col.prop(pchan, "rotation_euler", text="Rotation")
sub = col.row(align=True)
sub.prop(pchan, "rotation_euler", text="Rotation")
sub.prop(pchan, "lock_rotation", text="")
row.column().prop(pchan, "scale")
col = layout.column()
sub = col.row(align=True)
sub.prop(pchan, "scale")
sub.prop(pchan, "lock_scale", text="")
layout.prop(pchan, "rotation_mode")
col = layout.column()
col.prop(pchan, "rotation_mode")
elif context.edit_bone:
bone = context.edit_bone
row = layout.row()
row.column().prop(bone, "head")
row.column().prop(bone, "tail")
col = layout.column()
col.prop(bone, "head")
col.prop(bone, "tail")
col = row.column()
sub = col.column(align=True)
sub.label(text="Roll:")
sub.prop(bone, "roll", text="")
sub.label()
sub.prop(bone, "lock")
col = layout.column()
col.prop(bone, "roll")
col.prop(bone, "lock")
class BONE_PT_transform_locks(BoneButtonsPanel, Panel):
bl_label = "Transform Locks"
bl_options = {'DEFAULT_CLOSED'}
@classmethod
def poll(cls, context):
ob = context.object
return ob and ob.mode == 'POSE' and context.bone
def draw(self, context):
layout = self.layout
ob = context.object
bone = context.bone
pchan = ob.pose.bones[bone.name]
split = layout.split(percentage=0.1)
col = split.column(align=True)
col.label(text="")
col.label(text="X:")
col.label(text="Y:")
col.label(text="Z:")
col = split.column()
col.active = not (bone.parent and bone.use_connect)
col.prop(pchan, "lock_location", text="Location")
col = split.column()
col.prop(pchan, "lock_rotation", text="Rotation")
col = split.column()
col.prop(pchan, "lock_scale", text="Scale")
if pchan.rotation_mode in {'QUATERNION', 'AXIS_ANGLE'}:
row = layout.row()
row.prop(pchan, "lock_rotations_4d", text="Lock Rotation")
sub = row.row()
sub.active = pchan.lock_rotations_4d
sub.prop(pchan, "lock_rotation_w", text="W")
col = layout.column()
col.prop(bone, "tail_radius")
col.prop(bone, "envelope_distance")
class BONE_PT_curved(BoneButtonsPanel, Panel):
@@ -166,54 +141,52 @@ class BONE_PT_curved(BoneButtonsPanel, Panel):
bbone = bone
layout = self.layout
layout.use_property_split = True
layout.prop(bone, "bbone_segments", text="Segments")
col = layout.column()
col.active = bone.bbone_segments > 1
row = col.row()
sub = row.column(align=True)
sub.label(text="Curve XY Offsets:")
sub.prop(bbone, "bbone_curveinx", text="In X")
sub.prop(bbone, "bbone_curveoutx", text="Out X")
sub.prop(bbone, "bbone_curveiny", text="In Y")
sub.prop(bbone, "bbone_curveouty", text="Out Y")
col = layout.column(align=True)
col.prop(bbone, "bbone_curveinx", text="Curve In X")
col.prop(bbone, "bbone_curveiny", text="In Y")
sub = row.column(align=True)
sub.label("Roll:")
sub.prop(bbone, "bbone_rollin", text="In")
sub.prop(bbone, "bbone_rollout", text="Out")
sub.prop(bone, "use_endroll_as_inroll")
col = layout.column(align=True)
col.prop(bbone, "bbone_curveoutx", text="Curve Out X")
col.prop(bbone, "bbone_curveouty", text="Out Y")
row = col.row()
sub = row.column(align=True)
sub.label(text="Scale:")
sub.prop(bbone, "bbone_scalein", text="In")
sub.prop(bbone, "bbone_scaleout", text="Out")
col = layout.column(align=True)
col.prop(bbone, "bbone_rollin", text="Roll In")
col.prop(bbone, "bbone_rollout", text="Out")
col.prop(bone, "use_endroll_as_inroll")
sub = row.column(align=True)
sub.label("Easing:")
sub.prop(bbone, "bbone_easein", text="In")
sub.prop(bbone, "bbone_easeout", text="Out")
col = layout.column(align=True)
col.prop(bbone, "bbone_scalein", text="Scale In")
col.prop(bbone, "bbone_scaleout", text="Out")
col = layout.column(align=True)
col.prop(bbone, "bbone_easein", text="Ease In")
col.prop(bbone, "bbone_easeout", text="Out")
if pchan:
layout.separator()
col = layout.column()
col.use_property_split = False
col.prop(pchan, "use_bbone_custom_handles")
row = col.row()
row.active = pchan.use_bbone_custom_handles
col = layout.column(align=True)
col.active = pchan.use_bbone_custom_handles
col.use_property_split = True
sub = row.column(align=True)
sub.label(text="In:")
sub.prop_search(pchan, "bbone_custom_handle_start", ob.pose, "bones", text="")
sub.prop(pchan, "use_bbone_relative_start_handle", text="Relative")
sub = col.column()
sub.prop_search(pchan, "bbone_custom_handle_start", ob.pose, "bones", text="Custom Handle Start")
sub.prop_search(pchan, "bbone_custom_handle_end", ob.pose, "bones", text="End")
sub = row.column(align=True)
sub.label(text="Out:")
sub.prop_search(pchan, "bbone_custom_handle_end", ob.pose, "bones", text="")
sub.prop(pchan, "use_bbone_relative_end_handle", text="Relative")
sub = col.column(align=True)
sub.prop(pchan, "use_bbone_relative_start_handle", text="Relative Handle Start")
sub.prop(pchan, "use_bbone_relative_end_handle", text="End")
class BONE_PT_relations(BoneButtonsPanel, Panel):
@@ -221,6 +194,7 @@ class BONE_PT_relations(BoneButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
layout.use_property_split = True
ob = context.object
bone = context.bone
@@ -232,26 +206,22 @@ class BONE_PT_relations(BoneButtonsPanel, Panel):
elif bone is None:
bone = context.edit_bone
split = layout.split()
col = split.column()
col.label(text="Layers:")
col = layout.column()
col.use_property_split = False
col.prop(bone, "layers", text="")
col.use_property_split = True
col = layout.column()
col.separator()
if ob and pchan:
col.label(text="Bone Group:")
col.prop_search(pchan, "bone_group", ob.pose, "bone_groups", text="")
col.label(text="Object Children:")
col.prop(bone, "use_relative_parent")
col = split.column()
col.label(text="Parent:")
if context.bone:
col.prop(bone, "parent", text="")
col.prop(bone, "parent")
else:
col.prop_search(bone, "parent", arm, "edit_bones", text="")
col.prop_search(bone, "parent", arm, "edit_bones")
if ob and pchan:
col.prop(bone, "use_relative_parent")
col.prop_search(pchan, "bone_group", ob.pose, "bone_groups", text="Bone Group")
sub = col.column()
sub.active = (bone.parent is not None)
@@ -274,6 +244,7 @@ class BONE_PT_display(BoneButtonsPanel, Panel):
# note. this works ok in edit-mode but isn't
# all that useful so disabling for now.
layout = self.layout
layout.use_property_split = True
ob = context.object
bone = context.bone
@@ -285,23 +256,20 @@ class BONE_PT_display(BoneButtonsPanel, Panel):
bone = context.edit_bone
if bone:
split = layout.split()
col = split.column()
col = layout.column()
col.prop(bone, "hide", text="Hide")
sub = col.column()
sub.active = bool(pchan and pchan.custom_shape)
sub.prop(bone, "show_wire", text="Wireframe")
if pchan:
col = split.column()
col.label(text="Custom Shape:")
col.prop(pchan, "custom_shape", text="")
col = layout.column()
col.prop(pchan, "custom_shape")
if pchan.custom_shape:
col.prop(pchan, "use_custom_shape_bone_size", text="Bone Size")
col.prop(pchan, "custom_shape_scale", text="Scale")
col.prop_search(pchan, "custom_shape_transform", ob.pose, "bones", text="At")
col.prop_search(pchan, "custom_shape_transform", ob.pose, "bones")
class BONE_PT_inverse_kinematics(BoneButtonsPanel, Panel):
@@ -315,80 +283,82 @@ class BONE_PT_inverse_kinematics(BoneButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
layout.use_property_split = True
ob = context.object
bone = context.bone
pchan = ob.pose.bones[bone.name]
row = layout.row()
active = pchan.is_in_ik_chain
split = layout.split(percentage=0.25)
split.prop(pchan, "lock_ik_x", text="X")
split.active = active
row = split.row()
row.prop(pchan, "ik_stiffness_x", text="Stiffness", slider=True)
row.active = pchan.lock_ik_x is False and active
col = layout.column()
col.prop(pchan, "ik_stretch", slider=True)
col.active = active
split = layout.split(percentage=0.25)
sub = split.row()
layout.separator()
sub.prop(pchan, "use_ik_limit_x", text="Limit")
col = layout.column(align=True)
col.prop(pchan, "lock_ik_x", text="Lock IK X")
col.prop(pchan, "lock_ik_y", text="Y")
col.prop(pchan, "lock_ik_z", text="Z")
col = layout.column(align=True)
sub = col.column(align=True)
sub.active = pchan.lock_ik_x is False and active
sub = split.row(align=True)
sub.prop(pchan, "ik_min_x", text="")
sub.prop(pchan, "ik_max_x", text="")
sub.active = pchan.lock_ik_x is False and pchan.use_ik_limit_x and active
split = layout.split(percentage=0.25)
split.prop(pchan, "lock_ik_y", text="Y")
split.active = active
row = split.row()
row.prop(pchan, "ik_stiffness_y", text="Stiffness", slider=True)
row.active = pchan.lock_ik_y is False and active
split = layout.split(percentage=0.25)
sub = split.row()
sub.prop(pchan, "use_ik_limit_y", text="Limit")
sub.prop(pchan, "ik_stiffness_x", text="Stiffness X", slider=True)
sub = col.column(align=True)
sub.active = pchan.lock_ik_y is False and active
sub.prop(pchan, "ik_stiffness_y", text="Y", slider=True)
sub = col.column(align=True)
sub.active = pchan.lock_ik_z is False and active
sub.prop(pchan, "ik_stiffness_z", text="Z", slider=True)
sub = split.row(align=True)
sub.prop(pchan, "ik_min_y", text="")
sub.prop(pchan, "ik_max_y", text="")
col = layout.column(align=True)
sub = col.column()
sub.active = pchan.lock_ik_x is False and active
sub.prop(pchan, "use_ik_limit_x", text="Limit X")
sub = col.column(align=True)
sub.active = pchan.lock_ik_x is False and pchan.use_ik_limit_x and active
sub.prop(pchan, "ik_min_x", text="Min")
sub.prop(pchan, "ik_max_x", text="Max")
col.separator()
sub = col.column()
sub.active = pchan.lock_ik_y is False and active
sub.prop(pchan, "use_ik_limit_y", text="Limit Y")
sub = col.column(align=True)
sub.active = pchan.lock_ik_y is False and pchan.use_ik_limit_y and active
sub.prop(pchan, "ik_min_y", text="Min")
sub.prop(pchan, "ik_max_y", text="Max")
split = layout.split(percentage=0.25)
split.prop(pchan, "lock_ik_z", text="Z")
split.active = active
sub = split.row()
sub.prop(pchan, "ik_stiffness_z", text="Stiffness", slider=True)
col.separator()
sub = col.column()
sub.active = pchan.lock_ik_z is False and active
sub.prop(pchan, "use_ik_limit_z", text="Limit Z")
split = layout.split(percentage=0.25)
sub = split.row()
sub.prop(pchan, "use_ik_limit_z", text="Limit")
sub.active = pchan.lock_ik_z is False and active
sub = split.row(align=True)
sub.prop(pchan, "ik_min_z", text="")
sub.prop(pchan, "ik_max_z", text="")
sub = col.column(align=True)
sub.active = pchan.lock_ik_z is False and pchan.use_ik_limit_z and active
sub.prop(pchan, "ik_min_z", text="Min")
sub.prop(pchan, "ik_max_z", text="Max")
split = layout.split(percentage=0.25)
split.label(text="Stretch:")
sub = split.row()
sub.prop(pchan, "ik_stretch", text="", slider=True)
sub.active = active
col.separator()
if ob.pose.ik_solver == 'ITASC':
split = layout.split()
col = split.column()
col = layout.column()
col.prop(pchan, "use_ik_rotation_control", text="Control Rotation")
col.active = active
col = split.column()
col.prop(pchan, "ik_rotation_weight", text="Weight", slider=True)
col = layout.column()
col.prop(pchan, "ik_rotation_weight", text="IK Rotation Weight", slider=True)
col.active = active
# not supported yet
#row = layout.row()
@@ -410,6 +380,7 @@ class BONE_PT_deform(BoneButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
layout.use_property_split = True
bone = context.bone
@@ -418,17 +389,15 @@ class BONE_PT_deform(BoneButtonsPanel, Panel):
layout.active = bone.use_deform
row = layout.row()
col = layout.column()
col.prop(bone, "envelope_distance", text="Envelope Distance")
col.prop(bone, "envelope_weight", text="Envelope Weight")
col.prop(bone, "use_envelope_multiply", text="Envelope Multiply")
col = row.column(align=True)
col.label(text="Envelope:")
col.prop(bone, "envelope_distance", text="Distance")
col.prop(bone, "envelope_weight", text="Weight")
col.prop(bone, "use_envelope_multiply", text="Multiply")
col.separator()
col = row.column(align=True)
col.label(text="Envelope Radius:")
col.prop(bone, "head_radius", text="Head")
col = layout.column(align=True)
col.prop(bone, "head_radius", text="Radius Head")
col.prop(bone, "tail_radius", text="Tail")
@@ -448,7 +417,6 @@ class BONE_PT_custom_props(BoneButtonsPanel, PropertyPanel, Panel):
classes = (
BONE_PT_context_bone,
BONE_PT_transform,
BONE_PT_transform_locks,
BONE_PT_curved,
BONE_PT_relations,
BONE_PT_display,

View File

@@ -76,21 +76,22 @@ class DATA_PT_lens(CameraButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
layout.use_property_split = True
cam = context.camera
layout.row().prop(cam, "type", expand=True)
layout.prop(cam, "type")
split = layout.split()
col = layout.column()
col.separator()
col = split.column()
if cam.type == 'PERSP':
row = col.row()
col = layout.column()
if cam.lens_unit == 'MILLIMETERS':
row.prop(cam, "lens")
col.prop(cam, "lens")
elif cam.lens_unit == 'FOV':
row.prop(cam, "angle")
row.prop(cam, "lens_unit", text="")
col.prop(cam, "lens_unit")
elif cam.type == 'ORTHO':
col.prop(cam, "ortho_scale")
@@ -99,40 +100,37 @@ class DATA_PT_lens(CameraButtonsPanel, Panel):
engine = context.engine
if engine == 'CYCLES':
ccam = cam.cycles
col.prop(ccam, "panorama_type", text="Type")
col.prop(ccam, "panorama_type")
if ccam.panorama_type == 'FISHEYE_EQUIDISTANT':
col.prop(ccam, "fisheye_fov")
elif ccam.panorama_type == 'FISHEYE_EQUISOLID':
row = layout.row()
row.prop(ccam, "fisheye_lens", text="Lens")
row.prop(ccam, "fisheye_fov")
col.prop(ccam, "fisheye_lens", text="Lens")
col.prop(ccam, "fisheye_fov")
elif ccam.panorama_type == 'EQUIRECTANGULAR':
row = layout.row()
sub = row.column(align=True)
sub.prop(ccam, "latitude_min")
sub.prop(ccam, "latitude_max")
sub = row.column(align=True)
sub.prop(ccam, "longitude_min")
sub.prop(ccam, "longitude_max")
sub = col.column(align=True)
sub.prop(ccam, "latitude_min", text="Latitute Min")
sub.prop(ccam, "latitude_max", text="Max")
sub = col.column(align=True)
sub.prop(ccam, "longitude_min", text="Longiture Min")
sub.prop(ccam, "longitude_max", text="Max")
elif engine in {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}:
row = col.row()
if cam.lens_unit == 'MILLIMETERS':
row.prop(cam, "lens")
col.prop(cam, "lens")
elif cam.lens_unit == 'FOV':
row.prop(cam, "angle")
row.prop(cam, "lens_unit", text="")
col.prop(cam, "angle")
col.prop(cam, "lens_unit")
split = layout.split()
col = layout.column()
col.separator()
col = split.column(align=True)
col.label(text="Shift:")
col.prop(cam, "shift_x", text="X")
col.prop(cam, "shift_y", text="Y")
sub = col.column(align=True)
sub.prop(cam, "shift_x", text="Shift X")
sub.prop(cam, "shift_y", text="Y")
col = split.column(align=True)
col.label(text="Clipping:")
col.prop(cam, "clip_start", text="Start")
col.prop(cam, "clip_end", text="End")
col.separator()
sub = col.column(align=True)
sub.prop(cam, "clip_start", text="Clip Start")
sub.prop(cam, "clip_end", text="End")
class DATA_PT_camera_stereoscopy(CameraButtonsPanel, Panel):
@@ -147,6 +145,8 @@ class DATA_PT_camera_stereoscopy(CameraButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
layout.use_property_split = True
render = context.scene.render
st = context.camera.stereo
cam = context.camera
@@ -154,9 +154,9 @@ class DATA_PT_camera_stereoscopy(CameraButtonsPanel, Panel):
is_spherical_stereo = cam.type != 'ORTHO' and render.use_spherical_stereo
use_spherical_stereo = is_spherical_stereo and st.use_spherical_stereo
col = layout.column()
col.row().prop(st, "convergence_mode", expand=True)
layout.prop(st, "convergence_mode")
col = layout.column()
sub = col.column()
sub.active = st.convergence_mode != 'PARALLEL'
sub.prop(st, "convergence_distance")
@@ -165,20 +165,20 @@ class DATA_PT_camera_stereoscopy(CameraButtonsPanel, Panel):
if is_spherical_stereo:
col.separator()
row = col.row()
row.prop(st, "use_spherical_stereo")
sub = row.row()
col.prop(st, "use_spherical_stereo")
sub = col.column()
sub.active = st.use_spherical_stereo
sub.prop(st, "use_pole_merge")
row = col.row(align=True)
row.active = st.use_pole_merge
row.prop(st, "pole_merge_angle_from")
row.prop(st, "pole_merge_angle_to")
col.label(text="Pivot:")
row = col.row()
row.active = not use_spherical_stereo
row.prop(st, "pivot", expand=True)
sub = col.column(align=True)
sub.active = st.use_pole_merge
sub.prop(st, "pole_merge_angle_from", text="Pole Merge Angle Start")
sub.prop(st, "pole_merge_angle_to", text="End")
col = layout.column()
col.active = not use_spherical_stereo
col.separator()
col.prop(st, "pivot")
class DATA_PT_camera(CameraButtonsPanel, Panel):
@@ -196,57 +196,55 @@ class DATA_PT_camera(CameraButtonsPanel, Panel):
row.operator("camera.preset_add", text="", icon='ZOOMIN')
row.operator("camera.preset_add", text="", icon='ZOOMOUT').remove_active = True
layout.label(text="Sensor:")
layout.use_property_split = True
split = layout.split()
col = layout.column()
col.prop(cam, "sensor_fit")
col = split.column(align=True)
if cam.sensor_fit == 'AUTO':
col.prop(cam, "sensor_width", text="Size")
col.prop(cam, "sensor_width")
else:
sub = col.column(align=True)
sub.active = cam.sensor_fit == 'HORIZONTAL'
sub.prop(cam, "sensor_width", text="Width")
sub = col.column(align=True)
sub.active = cam.sensor_fit == 'VERTICAL'
sub.prop(cam, "sensor_height", text="Height")
col = split.column(align=True)
col.prop(cam, "sensor_fit", text="")
class DATA_PT_camera_dof(CameraButtonsPanel, Panel):
bl_label = "Depth of Field"
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
def draw(self, context):
layout = self.layout
layout.use_property_split = True
cam = context.camera
dof_options = cam.gpu_dof
split = layout.split()
col = split.column()
col.label(text="Focus:")
col.prop(cam, "dof_object", text="")
col = layout.column()
col.prop(cam, "dof_object", text="Focus on Object")
sub = col.column()
sub.active = (cam.dof_object is None)
sub.prop(cam, "dof_distance", text="Distance")
sub.prop(cam, "dof_distance", text="Focus Distance")
col.separator()
if context.engine == 'BLENDER_EEVEE':
col = split.column(align=True)
col.label("Aperture:")
col = layout.column()
col.label("Aperture")
engine = context.engine
sub = col.column(align=True)
sub.prop(dof_options, "fstop")
sub.prop(dof_options, "blades")
sub.prop(dof_options, "rotation")
sub.prop(dof_options, "ratio")
col.prop(dof_options, "fstop")
col.prop(dof_options, "blades")
col.prop(dof_options, "rotation")
col.prop(dof_options, "ratio")
else:
hq_support = dof_options.is_hq_supported
col = split.column(align=True)
col.label("Viewport:")
col = layout.column()
col.label("Viewport")
sub = col.column()
sub.active = hq_support
sub.prop(dof_options, "use_high_quality")
@@ -358,24 +356,21 @@ class DATA_PT_camera_background_image(CameraButtonsPanel, Panel):
class DATA_PT_camera_display(CameraButtonsPanel, Panel):
bl_label = "Display"
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
def draw(self, context):
layout = self.layout
layout.use_property_split = True
cam = context.camera
split = layout.split()
split.label()
split.prop_menu_enum(cam, "show_guide")
col = split.column()
col.prop(cam, "show_limits", text="Limits")
col.prop(cam, "show_mist", text="Mist")
col = layout.column(align=True)
col.prop(cam, "show_sensor", text="Sensor")
col.prop(cam, "show_name", text="Name")
col = split.column()
col.prop_menu_enum(cam, "show_guide")
col.separator()
col.prop(cam, "draw_size", text="Size")
col.separator()
@@ -384,6 +379,13 @@ class DATA_PT_camera_display(CameraButtonsPanel, Panel):
sub.active = cam.show_passepartout
sub.prop(cam, "passepartout_alpha", text="Alpha", slider=True)
col.separator()
col.prop(cam, "show_limits", text="Limits")
col.prop(cam, "show_mist", text="Mist")
col.prop(cam, "show_sensor", text="Sensor")
col.prop(cam, "show_name", text="Name")
class DATA_PT_camera_safe_areas(CameraButtonsPanel, Panel):
bl_label = "Safe Areas"
@@ -413,27 +415,30 @@ def draw_display_safe_settings(layout, safe_data, settings):
show_safe_areas = settings.show_safe_areas
show_safe_center = settings.show_safe_center
split = layout.split()
layout.use_property_split = True
col = split.column()
row = col.row(align=True)
row = layout.row(align=True)
row.menu("SAFE_AREAS_MT_presets", text=bpy.types.SAFE_AREAS_MT_presets.bl_label)
row.operator("safe_areas.preset_add", text="", icon='ZOOMIN')
row.operator("safe_areas.preset_add", text="", icon='ZOOMOUT').remove_active = True
col = split.column()
layout.separator()
col = layout.column()
col.active = show_safe_areas
sub = col.column()
sub.prop(safe_data, "title", slider=True)
sub.prop(safe_data, "action", slider=True)
col.separator()
col.prop(settings, "show_safe_center", text="Center-Cut Safe Areas")
split = layout.split()
col = split.column()
col.active = show_safe_areas
col.prop(safe_data, "title", slider=True)
col.prop(safe_data, "action", slider=True)
col = split.column()
col.active = show_safe_areas and show_safe_center
col.prop(safe_data, "title_center", slider=True)
col.prop(safe_data, "action_center", slider=True)
sub = col.column()
sub.active = show_safe_areas and show_safe_center
sub.prop(safe_data, "title_center", slider=True)
sub.prop(safe_data, "action_center", slider=True)
classes = (
@@ -445,8 +450,8 @@ classes = (
DATA_PT_camera_stereoscopy,
DATA_PT_camera_dof,
DATA_PT_camera_display,
DATA_PT_camera_background_image,
DATA_PT_camera_safe_areas,
DATA_PT_camera_background_image,
DATA_PT_custom_props_camera,
)

View File

@@ -93,43 +93,42 @@ class DATA_PT_shape_curve(CurveButtonsPanel, Panel):
row = layout.row()
row.prop(curve, "dimensions", expand=True)
split = layout.split()
layout.use_property_split = True
col = layout.column()
sub = col.column(align=True)
sub.prop(curve, "resolution_u", text="Resolution Preview U")
if is_surf:
sub.prop(curve, "resolution_v", text="V")
col = split.column()
col.label(text="Resolution:")
sub = col.column(align=True)
sub.prop(curve, "resolution_u", text="Preview U")
sub.prop(curve, "render_resolution_u", text="Render U")
if is_surf:
sub.prop(curve, "render_resolution_v", text="V")
col.separator()
if is_curve:
col.label(text="Twisting:")
col.prop(curve, "twist_mode", text="")
col.prop(curve, "twist_mode")
col.prop(curve, "twist_smooth", text="Smooth")
elif is_text:
col.label(text="Display:")
col.prop(curve, "use_fast_edit", text="Fast Editing")
col = split.column()
if is_surf:
sub = col.column()
sub.label(text="")
sub = col.column(align=True)
sub.prop(curve, "resolution_v", text="Preview V")
sub.prop(curve, "render_resolution_v", text="Render V")
if is_curve or is_text:
col.label(text="Fill:")
col = layout.column()
col.separator()
sub = col.column()
sub.active = (curve.dimensions == '2D' or (curve.bevel_object is None and curve.dimensions == '3D'))
sub.prop(curve, "fill_mode", text="")
sub.prop(curve, "fill_mode")
col.prop(curve, "use_fill_deform")
if is_curve:
col.label(text="Path/Curve-Deform:")
col = layout.column()
col.separator()
sub = col.column()
subsub = sub.row()
subsub.prop(curve, "use_radius")
subsub.prop(curve, "use_stretch")
sub.prop(curve, "use_radius")
sub.prop(curve, "use_stretch")
sub.prop(curve, "use_deform_bounds")
@@ -140,16 +139,17 @@ class DATA_PT_curve_texture_space(CurveButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
layout.use_property_split = True
curve = context.curve
row = layout.row()
row.prop(curve, "use_auto_texspace")
row.prop(curve, "use_uv_as_generated")
col = layout.column()
col.prop(curve, "use_uv_as_generated")
col.prop(curve, "use_auto_texspace")
row = layout.row()
row.column().prop(curve, "texspace_location", text="Location")
row.column().prop(curve, "texspace_size", text="Size")
col = layout.column()
col.prop(curve, "texspace_location")
col.prop(curve, "texspace_size")
layout.operator("curve.match_texture_space")
@@ -163,49 +163,65 @@ class DATA_PT_geometry_curve(CurveButtonsPanelCurve, Panel):
def draw(self, context):
layout = self.layout
layout.use_property_split = True
curve = context.curve
split = layout.split()
col = split.column()
col.label(text="Modification:")
col = layout.column()
col.prop(curve, "offset")
col.prop(curve, "extrude")
col.label(text="Taper Object:")
col.prop(curve, "taper_object", text="")
col = split.column()
col.label(text="Bevel:")
col.prop(curve, "bevel_depth", text="Depth")
col.prop(curve, "bevel_resolution", text="Resolution")
col.label(text="Bevel Object:")
col.prop(curve, "bevel_object", text="")
sub = col.column()
sub.active = (curve.bevel_object is None)
sub.prop(curve, "extrude")
col.prop(curve, "taper_object")
sub = col.column()
sub.active = curve.taper_object is not None
sub.prop(curve, "use_map_taper")
class DATA_PT_geometry_curve_bevel(CurveButtonsPanelCurve, Panel):
bl_label = "Bevel"
bl_parent_id = "DATA_PT_geometry_curve"
@classmethod
def poll(cls, context):
return (type(context.curve) in {Curve, TextCurve})
def draw(self, context):
layout = self.layout
layout.use_property_split = True
curve = context.curve
col = layout.column()
sub = col.column()
sub.active = (curve.bevel_object is None)
sub.prop(curve, "bevel_depth", text="Depth")
sub.prop(curve, "bevel_resolution", text="Resolution")
col.prop(curve, "bevel_object", text="Object")
sub = col.column()
sub.active = curve.bevel_object is not None
sub.prop(curve, "use_fill_caps")
if type(curve) is not TextCurve:
col = layout.column(align=True)
row = col.row()
row.label(text="Bevel Factor:")
col = layout.column()
col.active = (
(curve.bevel_depth > 0.0) or
(curve.extrude > 0.0) or
(curve.bevel_object is not None))
row = col.row(align=True)
row.prop(curve, "bevel_factor_mapping_start", text="")
row.prop(curve, "bevel_factor_start", text="Start")
row = col.row(align=True)
row.prop(curve, "bevel_factor_mapping_end", text="")
row.prop(curve, "bevel_factor_end", text="End")
(curve.bevel_object is not None)
)
sub = col.column(align=True)
sub.prop(curve, "bevel_factor_start", text="Bevel Start")
sub.prop(curve, "bevel_factor_end", text="End")
row = layout.row()
sub = row.row()
sub.active = curve.taper_object is not None
sub.prop(curve, "use_map_taper")
sub = row.row()
sub.active = curve.bevel_object is not None
sub.prop(curve, "use_fill_caps")
sub = col.column(align=True)
sub.prop(curve, "bevel_factor_mapping_start", text="Bevel Mapping Start")
sub.prop(curve, "bevel_factor_mapping_end", text="End")
class DATA_PT_pathanim(CurveButtonsPanelCurve, Panel):
@@ -218,6 +234,7 @@ class DATA_PT_pathanim(CurveButtonsPanelCurve, Panel):
def draw(self, context):
layout = self.layout
layout.use_property_split = True
curve = context.curve
@@ -228,8 +245,9 @@ class DATA_PT_pathanim(CurveButtonsPanelCurve, Panel):
col.prop(curve, "eval_time")
# these are for paths only
row = layout.row()
row.prop(curve, "use_path_follow")
col.separator()
col.prop(curve, "use_path_follow")
class DATA_PT_active_spline(CurveButtonsPanelActive, Panel):
@@ -237,65 +255,64 @@ class DATA_PT_active_spline(CurveButtonsPanelActive, Panel):
def draw(self, context):
layout = self.layout
layout.use_property_split = True
curve = context.curve
act_spline = curve.splines.active
is_surf = type(curve) is SurfaceCurve
is_poly = (act_spline.type == 'POLY')
split = layout.split()
col = layout.column()
if is_poly:
# These settings are below but its easier to have
# polys set aside since they use so few settings
row = layout.row()
row.label(text="Cyclic:")
row.prop(act_spline, "use_cyclic_u", text="U")
layout.prop(act_spline, "use_smooth")
col.prop(act_spline, "use_cyclic_u")
col.prop(act_spline, "use_smooth")
else:
col = split.column()
col.label(text="Cyclic:")
if act_spline.type == 'NURBS':
col.label(text="Bezier:")
col.label(text="Endpoint:")
col.label(text="Order:")
col.label(text="Resolution:")
col = split.column()
col.prop(act_spline, "use_cyclic_u", text="U")
sub = col.column(align=True)
sub.prop(act_spline, "use_cyclic_u")
if is_surf:
sub.prop(act_spline, "use_cyclic_v", text="V")
if act_spline.type == 'NURBS':
sub = col.column()
sub = col.column(align=True)
# sub.active = (not act_spline.use_cyclic_u)
sub.prop(act_spline, "use_bezier_u", text="U")
sub.prop(act_spline, "use_endpoint_u", text="U")
sub = col.column()
sub.prop(act_spline, "order_u", text="U")
col.prop(act_spline, "resolution_u", text="U")
sub.prop(act_spline, "use_bezier_u", text="Bezier U")
if is_surf:
col = split.column()
col.prop(act_spline, "use_cyclic_v", text="V")
subsub = sub.column()
subsub.active = (not act_spline.use_cyclic_v)
subsub.prop(act_spline, "use_bezier_v", text="V")
# its a surface, assume its a nurbs
sub = col.column()
sub.active = (not act_spline.use_cyclic_v)
sub.prop(act_spline, "use_bezier_v", text="V")
sub.prop(act_spline, "use_endpoint_v", text="V")
sub = col.column()
sub = col.column(align=True)
sub.prop(act_spline, "use_endpoint_u", text="Endpoint U")
if is_surf:
subsub = sub.column()
subsub.active = (not act_spline.use_cyclic_v)
subsub.prop(act_spline, "use_endpoint_v", text="V")
sub = col.column(align=True)
sub.prop(act_spline, "order_u", text="Order U")
if is_surf:
sub.prop(act_spline, "order_v", text="V")
sub = col.column(align=True)
sub.prop(act_spline, "resolution_u", text="Resolution U")
if is_surf:
sub.prop(act_spline, "resolution_v", text="V")
if act_spline.type == 'BEZIER':
col = layout.column()
col.label(text="Interpolation:")
col.separator()
sub = col.column()
sub.active = (curve.dimensions == '3D')
sub.prop(act_spline, "tilt_interpolation", text="Tilt")
sub.prop(act_spline, "tilt_interpolation", text="Interpolation Tilt")
col.prop(act_spline, "radius_interpolation", text="Radius")
@@ -324,42 +341,46 @@ class DATA_PT_font(CurveButtonsPanelText, Panel):
row.label(text="Bold & Italic")
row.template_ID(text, "font_bold_italic", open="font.open", unlink="font.unlink")
# layout.prop(text, "font")
layout.separator()
split = layout.split()
row = layout.row(align=True)
row.prop(char, "use_bold", toggle=True)
row.prop(char, "use_italic", toggle=True)
row.prop(char, "use_underline", toggle=True)
row.prop(char, "use_small_caps", toggle=True)
class DATA_PT_font_transform(CurveButtonsPanelText, Panel):
bl_label = "Transform"
bl_parent_id = "DATA_PT_font"
def draw(self, context):
layout = self.layout
text = context.curve
char = context.curve.edit_format
layout.use_property_split = True
col = layout.column()
col.separator()
col = split.column()
col.prop(text, "size", text="Size")
col = split.column()
col.prop(text, "shear")
split = layout.split()
col.separator()
col = split.column()
col.label(text="Object Font:")
col.prop(text, "family", text="")
col.prop(text, "family")
col.prop(text, "follow_curve")
col = split.column()
col.label(text="Text on Curve:")
col.prop(text, "follow_curve", text="")
col.separator()
split = layout.split()
col = split.column()
sub = col.column(align=True)
sub.label(text="Underline:")
sub.prop(text, "underline_position", text="Position")
sub.prop(text, "underline_height", text="Thickness")
sub.prop(text, "underline_position", text="Underline Position")
sub.prop(text, "underline_height", text="Underline Thickness")
col = split.column()
col.label(text="Character:")
col.prop(char, "use_bold")
col.prop(char, "use_italic")
col.prop(char, "use_underline")
row = layout.row()
row.prop(text, "small_caps_scale", text="Small Caps")
row.prop(char, "use_small_caps")
col.prop(text, "small_caps_scale", text="Small Caps Scale")
class DATA_PT_paragraph(CurveButtonsPanelText, Panel):
@@ -370,23 +391,40 @@ class DATA_PT_paragraph(CurveButtonsPanelText, Panel):
text = context.curve
layout.label(text="Horizontal Alignment:")
layout.row().prop(text, "align_x", expand=True)
layout.label(text="Vertical Alignment:")
class DATA_PT_paragraph_alignment(CurveButtonsPanelText, Panel):
bl_parent_id = "DATA_PT_paragraph"
bl_label = "Alignment"
def draw(self, context):
layout = self.layout
layout.use_property_split = False
text = context.curve
layout.row().prop(text, "align_x", expand=True)
layout.row().prop(text, "align_y", expand=True)
split = layout.split()
col = split.column(align=True)
col.label(text="Spacing:")
col.prop(text, "space_character", text="Letter")
col.prop(text, "space_word", text="Word")
col.prop(text, "space_line", text="Line")
class DATA_PT_paragraph_spacing(CurveButtonsPanelText, Panel):
bl_parent_id = "DATA_PT_paragraph"
bl_label = "Spacing"
col = split.column(align=True)
col.label(text="Offset:")
col.prop(text, "offset_x", text="X")
def draw(self, context):
layout = self.layout
layout.use_property_split = True
text = context.curve
col = layout.column(align=True)
col.prop(text, "space_character", text="Character Spacing")
col.prop(text, "space_word", text="Word Spacing")
col.prop(text, "space_line", text="Line Spacing")
layout.separator()
col = layout.column(align=True)
col.prop(text, "offset_x", text="Offset X")
col.prop(text, "offset_y", text="Y")
@@ -398,10 +436,7 @@ class DATA_PT_text_boxes(CurveButtonsPanelText, Panel):
text = context.curve
split = layout.split()
col = split.column()
col.operator("font.textbox_add", icon='ZOOMIN')
col = split.column()
layout.operator("font.textbox_add", icon='ZOOMIN')
for i, box in enumerate(text.text_boxes):
@@ -409,19 +444,16 @@ class DATA_PT_text_boxes(CurveButtonsPanelText, Panel):
row = boxy.row()
split = row.split()
col = row.column()
col.use_property_split = True
col = split.column(align=True)
sub = col.column(align=True)
sub.prop(box, "width", text="Size X")
sub.prop(box, "height", text="Y")
col.label(text="Dimensions:")
col.prop(box, "width", text="Width")
col.prop(box, "height", text="Height")
col = split.column(align=True)
col.label(text="Offset:")
col.prop(box, "x", text="X")
col.prop(box, "y", text="Y")
sub = col.column(align=True)
sub.prop(box, "x", text="Offset X")
sub.prop(box, "y", text="Y")
row.operator("font.textbox_remove", text="", icon='X', emboss=False).index = i
@@ -437,10 +469,14 @@ classes = (
DATA_PT_shape_curve,
DATA_PT_curve_texture_space,
DATA_PT_geometry_curve,
DATA_PT_geometry_curve_bevel,
DATA_PT_pathanim,
DATA_PT_active_spline,
DATA_PT_font,
DATA_PT_font_transform,
DATA_PT_paragraph,
DATA_PT_paragraph_alignment,
DATA_PT_paragraph_spacing,
DATA_PT_text_boxes,
DATA_PT_custom_props_curve,
)

View File

@@ -36,10 +36,11 @@ class DATA_PT_empty(DataButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
layout.use_property_split = True
ob = context.object
layout.prop(ob, "empty_draw_type", text="Display")
layout.prop(ob, "empty_draw_type", text="Display As")
if ob.empty_draw_type == 'IMAGE':
layout.template_ID(ob, "data", open="image.open", unlink="object.unlink_data")
@@ -49,9 +50,11 @@ class DATA_PT_empty(DataButtonsPanel, Panel):
row = layout.row(align=True)
layout.prop(ob, "color", text="Transparency", index=3, slider=True)
row = layout.row(align=True)
row.prop(ob, "empty_image_offset", text="Offset X", index=0)
row.prop(ob, "empty_image_offset", text="Offset Y", index=1)
col = layout.col(align=True)
col.prop(ob, "empty_image_offset", text="Offset X", index=0)
col.prop(ob, "empty_image_offset", text="Y", index=1)
layout.separator()
layout.prop(ob, "empty_draw_size", text="Size")

View File

@@ -80,27 +80,27 @@ class DATA_PT_lamp(DataButtonsPanel, Panel):
layout.row().prop(lamp, "type", expand=True)
split = layout.split()
layout.use_property_split = True
col = split.column()
sub = col.column()
sub.prop(lamp, "color", text="")
sub.prop(lamp, "energy")
col = col.column()
col.prop(lamp, "color")
col.prop(lamp, "energy")
if lamp.type in {'POINT', 'SPOT'}:
sub.label(text="Falloff:")
sub.prop(lamp, "falloff_type", text="")
sub.prop(lamp, "distance")
sub.prop(lamp, "shadow_soft_size", text="Radius")
col = col.column()
col.label(text="Falloff")
col.prop(lamp, "falloff_type")
col.prop(lamp, "distance")
col.prop(lamp, "shadow_soft_size")
if lamp.falloff_type == 'LINEAR_QUADRATIC_WEIGHTED':
col.label(text="Attenuation Factors:")
sub = col.column(align=True)
sub.prop(lamp, "linear_attenuation", slider=True, text="Linear")
sub.prop(lamp, "quadratic_attenuation", slider=True, text="Quadratic")
elif lamp.falloff_type == 'INVERSE_COEFFICIENTS':
col.label(text="Inverse Coefficients:")
col.label(text="Inverse Coefficients")
sub = col.column(align=True)
sub.prop(lamp, "constant_coefficient", text="Constant")
sub.prop(lamp, "linear_coefficient", text="Linear")
@@ -119,31 +119,31 @@ class DATA_PT_EEVEE_lamp(DataButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
lamp = context.lamp
layout.row().prop(lamp, "type", expand=True)
split = layout.split()
layout.use_property_split = True
col = split.column()
sub = col.column()
sub.prop(lamp, "color", text="")
sub.prop(lamp, "energy")
col = layout.column()
col.prop(lamp, "color")
col.prop(lamp, "energy")
col.prop(lamp, "specular_factor", text="Specular")
col.separator()
if lamp.type in {'POINT', 'SPOT', 'SUN'}:
sub.prop(lamp, "shadow_soft_size", text="Radius")
col.prop(lamp, "shadow_soft_size", text="Radius")
elif lamp.type == 'AREA':
sub = sub.column(align=True)
sub.prop(lamp, "shape", text="")
col.prop(lamp, "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")
col = split.column()
col.prop(lamp, "specular_factor", text="Specular")
sub.prop(lamp, "size_y", text="Y")
class DATA_PT_EEVEE_shadow(DataButtonsPanel, Panel):
@@ -162,49 +162,81 @@ class DATA_PT_EEVEE_shadow(DataButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
layout.use_property_split = True
lamp = context.lamp
split = layout.split()
split.active = lamp.use_shadow
layout.active = lamp.use_shadow
sub = split.column()
col = sub.column(align=True)
col.prop(lamp, "shadow_buffer_clip_start", text="Clip Start")
col.prop(lamp, "shadow_buffer_clip_end", text="Clip End")
col = sub.column()
col.prop(lamp, "shadow_buffer_soft", text="Soft")
col = layout.column()
sub = col.column(align=True)
sub.prop(lamp, "shadow_buffer_clip_start", text="Clip Start")
sub.prop(lamp, "shadow_buffer_clip_end", text="End")
col.prop(lamp, "shadow_buffer_soft", text="Softness")
col.separator()
col = split.column(align=True)
col.prop(lamp, "shadow_buffer_bias", text="Bias")
col.prop(lamp, "shadow_buffer_exp", text="Exponent")
col.prop(lamp, "shadow_buffer_bleed_bias", text="Bleed Bias")
if lamp.type == 'SUN':
class DATA_PT_EEVEE_shadow_cascaded_shadow_map(DataButtonsPanel, Panel):
bl_label = "Cascaded Shadow Map"
bl_parent_id = "DATA_PT_EEVEE_shadow"
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_EEVEE'}
@classmethod
def poll(cls, context):
lamp = context.lamp
engine = context.engine
return (lamp and lamp.type == 'SUN') and (engine in cls.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
lamp = context.lamp
layout.use_property_split = True
col = layout.column()
col.active = lamp.use_shadow
col.label("Cascaded Shadow Map:")
split = col.split()
col.prop(lamp, "shadow_cascade_count", text="Count")
col.prop(lamp, "shadow_cascade_fade", text="Fade")
sub = split.column()
sub.prop(lamp, "shadow_cascade_count", text="Count")
sub.prop(lamp, "shadow_cascade_fade", text="Fade")
col.prop(lamp, "shadow_cascade_max_distance", text="Max Distance")
col.prop(lamp, "shadow_cascade_exponent", text="Distribution")
sub = split.column()
sub.prop(lamp, "shadow_cascade_max_distance", text="Max Distance")
sub.prop(lamp, "shadow_cascade_exponent", text="Distribution")
layout.separator()
class DATA_PT_EEVEE_shadow_contact(DataButtonsPanel, Panel):
bl_label = "Contact Shadows"
bl_parent_id = "DATA_PT_EEVEE_shadow"
COMPAT_ENGINES = {'BLENDER_EEVEE'}
@classmethod
def poll(cls, context):
lamp = context.lamp
engine = context.engine
return (lamp and lamp.type in {'POINT', 'SUN', 'SPOT', 'AREA'}) and (engine in cls.COMPAT_ENGINES)
def draw_header(self, context):
lamp = context.lamp
layout = self.layout
layout.active = lamp.use_shadow
layout.prop(lamp, "use_contact_shadow", text="")
def draw(self, context):
layout = self.layout
lamp = context.lamp
layout.use_property_split = True
col = layout.column()
col.active = lamp.use_shadow and lamp.use_contact_shadow
layout.prop(lamp, "use_contact_shadow")
split = layout.split()
split.active = lamp.use_contact_shadow
col = split.column()
col.prop(lamp, "contact_shadow_distance", text="Distance")
col.prop(lamp, "contact_shadow_soft_size", text="Soft")
col = split.column()
col.prop(lamp, "contact_shadow_soft_size", text="Softness")
col.prop(lamp, "contact_shadow_bias", text="Bias")
col.prop(lamp, "contact_shadow_thickness", text="Thickness")
@@ -272,6 +304,7 @@ class DATA_PT_spot(DataButtonsPanel, Panel):
class DATA_PT_spot(DataButtonsPanel, Panel):
bl_label = "Spot Shape"
bl_parent_id = "DATA_PT_EEVEE_lamp"
COMPAT_ENGINES = {'BLENDER_EEVEE'}
@classmethod
@@ -282,16 +315,15 @@ class DATA_PT_spot(DataButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
layout.use_property_split = True
lamp = context.lamp
split = layout.split()
col = layout.column()
col.prop(lamp, "spot_size", text="Size")
col.prop(lamp, "spot_blend", text="Blend", slider=True)
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")
@@ -326,6 +358,8 @@ classes = (
DATA_PT_lamp,
DATA_PT_EEVEE_lamp,
DATA_PT_EEVEE_shadow,
DATA_PT_EEVEE_shadow_contact,
DATA_PT_EEVEE_shadow_cascaded_shadow_map,
DATA_PT_area,
DATA_PT_spot,
DATA_PT_falloff_curve,

View File

@@ -57,24 +57,31 @@ class DATA_PT_lattice(DataButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
layout.use_property_split = True
lat = context.lattice
row = layout.row()
row.prop(lat, "points_u")
row.prop(lat, "interpolation_type_u", text="")
col = layout.column()
row = layout.row()
row.prop(lat, "points_v")
row.prop(lat, "interpolation_type_v", text="")
sub = col.column(align=True)
sub.prop(lat, "points_u", text="Resolution U")
sub.prop(lat, "points_v", text="V")
sub.prop(lat, "points_w", text="W")
row = layout.row()
row.prop(lat, "points_w")
row.prop(lat, "interpolation_type_w", text="")
col.separator()
row = layout.row()
row.prop(lat, "use_outside")
row.prop_search(lat, "vertex_group", context.object, "vertex_groups", text="")
sub = col.column(align=True)
sub.prop(lat, "interpolation_type_u", text="Interpolation U")
sub.prop(lat, "interpolation_type_v", text="V")
sub.prop(lat, "interpolation_type_w", text="W")
col.separator()
col.prop(lat, "use_outside")
col.separator()
col.prop_search(lat, "vertex_group", context.object, "vertex_groups")
class DATA_PT_custom_props_lattice(DataButtonsPanel, PropertyPanel, Panel):

View File

@@ -56,34 +56,32 @@ class DATA_PT_lightprobe(DataButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
layout.use_property_split = True
ob = context.object
probe = context.lightprobe
split = layout.split()
# layout.prop(probe, "type")
if probe.type == 'GRID':
col = split.column(align=True)
col.label("Influence:")
col = layout.column()
col.prop(probe, "influence_distance", "Distance")
col.prop(probe, "falloff")
col.prop(probe, "intensity")
col.separator()
col.label("Resolution:")
col.prop(probe, "grid_resolution_x", text="X")
col.prop(probe, "grid_resolution_x", text="Resolution X")
col.prop(probe, "grid_resolution_y", text="Y")
col.prop(probe, "grid_resolution_z", text="Z")
elif probe.type == 'PLANAR':
col = split.column(align=True)
col.label("Influence:")
col = layout.column()
col.prop(probe, "influence_distance", "Distance")
col.prop(probe, "falloff")
else:
col = split.column(align=True)
col.label("Influence:")
col.prop(probe, "influence_type", text="")
col = layout.column()
col.prop(probe, "influence_type")
if probe.influence_type == 'ELIPSOID':
col.prop(probe, "influence_distance", "Radius")
@@ -93,27 +91,24 @@ class DATA_PT_lightprobe(DataButtonsPanel, Panel):
col.prop(probe, "falloff")
col.prop(probe, "intensity")
col = split.column(align=True)
col.label("Clipping:")
col.prop(probe, "clip_start", text="Start")
col = layout.column()
sub = col.column()
sub.prop(probe, "clip_start", text="Clipping Start")
if probe.type != "PLANAR":
col.prop(probe, "clip_end", text="End")
sub.prop(probe, "clip_end", text="End")
if probe.type == 'GRID':
col.separator()
col.label("Visibility:")
col.label("Visibility")
col.prop(probe, "visibility_buffer_bias", "Bias")
col.prop(probe, "visibility_bleed_bias", "Bleed Bias")
col.prop(probe, "visibility_blur", "Blur")
col.separator()
col.label("Visibility Collection:")
row = col.row(align=True)
row.prop(probe, "visibility_collection", text="")
row.prop(probe, "visibility_collection")
row.prop(probe, "invert_visibility_collection", text="", icon='ARROW_LEFTRIGHT')
@@ -132,14 +127,14 @@ class DATA_PT_lightprobe_parallax(DataButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
layout.use_property_split = True
probe = context.lightprobe
col = layout.column()
col.active = probe.use_custom_parallax
row = col.row()
row.prop(probe, "parallax_type", expand=True)
col.prop(probe, "parallax_type")
if probe.parallax_type == 'ELIPSOID':
col.prop(probe, "parallax_distance", "Radius")
@@ -153,31 +148,28 @@ class DATA_PT_lightprobe_display(DataButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
layout.use_property_split = True
ob = context.object
probe = context.lightprobe
row = layout.row()
row.prop(probe, "show_data")
col = layout.column()
if probe.type != "PLANAR":
row.prop(probe, "data_draw_size", text="Size")
col.prop(probe, "data_draw_size", text="Size")
else:
row.prop(ob, "empty_draw_size", text="Arrow Size")
col.prop(ob, "empty_draw_size", text="Arrow Size")
split = layout.split()
col.prop(probe, "show_data")
if probe.type in {'GRID', 'CUBEMAP'}:
col = split.column()
col.prop(probe, "show_influence")
col = split.column()
col.prop(probe, "show_clip")
if probe.type == 'CUBEMAP':
col = split.column()
col.active = probe.use_custom_parallax
col.prop(probe, "show_parallax")
sub = col.column()
sub.active = probe.use_custom_parallax
sub.prop(probe, "show_parallax")
classes = (

View File

@@ -158,19 +158,18 @@ class DATA_PT_normals(MeshButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
layout.use_property_split = True
mesh = context.mesh
split = layout.split()
col = layout.column()
col.prop(mesh, "show_double_sided")
col = split.column()
col.prop(mesh, "use_auto_smooth")
sub = col.column()
sub.active = mesh.use_auto_smooth and not mesh.has_custom_normals
sub.prop(mesh, "auto_smooth_angle", text="Angle")
split.prop(mesh, "show_double_sided")
class DATA_PT_texture_space(MeshButtonsPanel, Panel):
bl_label = "Texture Space"
@@ -179,6 +178,7 @@ class DATA_PT_texture_space(MeshButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
layout.use_property_split = True
mesh = context.mesh
@@ -187,9 +187,9 @@ class DATA_PT_texture_space(MeshButtonsPanel, Panel):
layout.separator()
layout.prop(mesh, "use_auto_texspace")
row = layout.row()
row.column().prop(mesh, "texspace_location", text="Location")
row.column().prop(mesh, "texspace_size", text="Size")
layout.prop(mesh, "texspace_location", text="Location")
layout.prop(mesh, "texspace_size", text="Size")
class DATA_PT_vertex_groups(MeshButtonsPanel, Panel):
@@ -225,6 +225,34 @@ class DATA_PT_vertex_groups(MeshButtonsPanel, Panel):
col.operator("object.vertex_group_move", icon='TRIA_UP', text="").direction = 'UP'
col.operator("object.vertex_group_move", icon='TRIA_DOWN', text="").direction = 'DOWN'
box = layout.box()
box.label(text="Row, auto, col_tweak 2")
gflow = box.grid_flow(row_major=True, num_columns=0, even_columns=False, even_rows=False, align=False)
for vg in ob.vertex_groups:
gflow.prop(vg, "name", text="")
gflow.prop(vg, "lock_weight")
box = layout.box()
box.label(text="Col, auto, col_tweak 2")
gflow = box.grid_flow(row_major=False, num_columns=0, even_columns=False, even_rows=False, align=False)
for vg in ob.vertex_groups:
gflow.prop(vg, "name", text="")
gflow.prop(vg, "lock_weight")
box = layout.box()
box.label(text="Row, auto % 2, col_tweak 2")
gflow = box.grid_flow(row_major=True, num_columns=-2, even_columns=False, even_rows=False, align=False)
for vg in ob.vertex_groups:
gflow.prop(vg, "name", text="")
gflow.prop(vg, "lock_weight")
box = layout.box()
box.label(text="Col, auto % 2, col_tweak 2")
gflow = box.grid_flow(row_major=False, num_columns=-2, even_columns=False, even_rows=False, align=False)
for vg in ob.vertex_groups:
gflow.prop(vg, "name", text="")
gflow.prop(vg, "lock_weight")
if ob.vertex_groups and (ob.mode == 'EDIT' or (ob.mode == 'WEIGHT_PAINT' and ob.type == 'MESH' and ob.data.use_paint_mask_vertex)):
row = layout.row()
@@ -280,6 +308,7 @@ class DATA_PT_face_maps(MeshButtonsPanel, Panel):
sub.operator("object.face_map_select", text="Select")
sub.operator("object.face_map_deselect", text="Deselect")
class DATA_PT_shape_keys(MeshButtonsPanel, Panel):
bl_label = "Shape Keys"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}

View File

@@ -54,23 +54,18 @@ class DATA_PT_metaball(DataButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
layout.use_property_split = True
mball = context.meta_ball
split = layout.split()
col = split.column()
col = layout.column()
col.label(text="Resolution:")
sub = col.column(align=True)
sub.prop(mball, "resolution", text="View")
sub.prop(mball, "resolution", text="Resolution View")
sub.prop(mball, "render_resolution", text="Render")
col = split.column()
col.label(text="Settings:")
col.prop(mball, "threshold", text="Threshold")
layout.label(text="Update:")
layout.row().prop(mball, "update_method", expand=True)
col.prop(mball, "update_method")
class DATA_PT_mball_texture_space(DataButtonsPanel, Panel):
@@ -80,14 +75,15 @@ class DATA_PT_mball_texture_space(DataButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
layout.use_property_split = True
mball = context.meta_ball
layout.prop(mball, "use_auto_texspace")
row = layout.row()
row.column().prop(mball, "texspace_location", text="Location")
row.column().prop(mball, "texspace_size", text="Size")
col = layout.column()
col.prop(mball, "texspace_location")
col.prop(mball, "texspace_size")
class DATA_PT_metaball_element(DataButtonsPanel, Panel):
@@ -99,35 +95,33 @@ class DATA_PT_metaball_element(DataButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
layout.use_property_split = True
metaelem = context.meta_ball.elements.active
layout.prop(metaelem, "type")
col = layout.column()
split = layout.split()
col.prop(metaelem, "type")
col.separator()
col = split.column(align=True)
col.label(text="Settings:")
col.prop(metaelem, "stiffness", text="Stiffness")
col.prop(metaelem, "use_negative", text="Negative")
col.prop(metaelem, "hide", text="Hide")
col = split.column(align=True)
sub = col.column(align=True)
if metaelem.type in {'CUBE', 'ELLIPSOID'}:
col.label(text="Size:")
col.prop(metaelem, "size_x", text="X")
col.prop(metaelem, "size_y", text="Y")
col.prop(metaelem, "size_z", text="Z")
sub.prop(metaelem, "size_x", text="Size X")
sub.prop(metaelem, "size_y", text="Y")
sub.prop(metaelem, "size_z", text="Z")
elif metaelem.type == 'TUBE':
col.label(text="Size:")
col.prop(metaelem, "size_x", text="X")
sub.prop(metaelem, "size_x", text="Size X")
elif metaelem.type == 'PLANE':
col.label(text="Size:")
col.prop(metaelem, "size_x", text="X")
col.prop(metaelem, "size_y", text="Y")
sub.prop(metaelem, "size_x", text="Size X")
sub.prop(metaelem, "size_y", text="Y")
class DATA_PT_custom_props_metaball(DataButtonsPanel, PropertyPanel, Panel):

View File

@@ -168,7 +168,6 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
if bpy.app.debug:
layout.prop(md, "debug_options")
def BUILD(self, layout, ob, md):
split = layout.split()
@@ -328,8 +327,10 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
row.prop(md, "delimit")
layout_info = layout
layout_info.label(text=iface_("Face Count: {:,}".format(md.face_count)),
translate=False)
layout_info.label(
text=iface_("Face Count: {:,}".format(md.face_count)),
translate=False,
)
def DISPLACE(self, layout, ob, md):
has_texture = (md.texture is not None)

View File

@@ -62,14 +62,16 @@ class DATA_PT_speaker(DataButtonsPanel, Panel):
speaker = context.speaker
split = layout.split(percentage=0.75)
layout.template_ID(speaker, "sound", open="sound.open_mono")
split.template_ID(speaker, "sound", open="sound.open_mono")
split.prop(speaker, "muted")
layout.use_property_split = True
row = layout.row()
row.prop(speaker, "volume")
row.prop(speaker, "pitch")
layout.prop(speaker, "muted")
col = layout.column()
col.active = not speaker.muted
col.prop(speaker, "volume", slider=True)
col.prop(speaker, "pitch")
class DATA_PT_distance(DataButtonsPanel, Panel):
@@ -79,20 +81,20 @@ class DATA_PT_distance(DataButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
layout.use_property_split = True
speaker = context.speaker
layout.active = not speaker.muted
split = layout.split()
col = split.column()
col.label("Volume:")
col.prop(speaker, "volume_min", text="Minimum")
col.prop(speaker, "volume_max", text="Maximum")
col = layout.column()
sub = col.column(align=True)
sub.prop(speaker, "volume_min", slider=True, text="Volume Min")
sub.prop(speaker, "volume_max", slider=True, text="Max")
col.prop(speaker, "attenuation")
col = split.column()
col.label("Distance:")
col.prop(speaker, "distance_max", text="Maximum")
col.prop(speaker, "distance_reference", text="Reference")
col.separator()
col.prop(speaker, "distance_max", text="Max Distance")
col.prop(speaker, "distance_reference", text="Distance Reference")
class DATA_PT_cone(DataButtonsPanel, Panel):
@@ -102,18 +104,20 @@ class DATA_PT_cone(DataButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
layout.use_property_split = True
speaker = context.speaker
layout.active = not speaker.muted
split = layout.split()
col = layout.column()
col = split.column()
col.label("Angle:")
col.prop(speaker, "cone_angle_outer", text="Outer")
col.prop(speaker, "cone_angle_inner", text="Inner")
sub = col.column(align=True)
sub.prop(speaker, "cone_angle_outer", text="Angle Outer")
sub.prop(speaker, "cone_angle_inner", text="Inner")
col = split.column()
col.label("Volume:")
col.prop(speaker, "cone_volume_outer", text="Outer")
col.separator()
col.prop(speaker, "cone_volume_outer", slider=True)
class DATA_PT_custom_props_speaker(DataButtonsPanel, PropertyPanel, Panel):

View File

@@ -20,7 +20,7 @@
import bpy
from bpy.types import (
Panel,
)
)
from rna_prop_ui import PropertyPanel
@@ -85,7 +85,6 @@ class WORKSPACE_PT_owner_ids(WorkSpaceButtonsPanel, Panel):
row.label(module_name)
class WORKSPACE_PT_custom_props(WorkSpaceButtonsPanel, PropertyPanel, Panel):
_context_path = "workspace"
_property_type = bpy.types.WorkSpace
@@ -100,4 +99,3 @@ if __name__ == "__main__": # only for live edit.
from bpy.utils import register_class
for cls in classes:
register_class(cls)

View File

@@ -629,7 +629,7 @@ class VIEWLAYER_PT_freestyle_linestyle(ViewLayerFreestyleEditorButtonsPanel, Pan
row = layout.row(align=True)
row.prop(linestyle, "panel", expand=True)
if linestyle.panel == 'STROKES':
## Chaining
# Chaining
layout.prop(linestyle, "use_chaining", text="Chaining:")
split = layout.split(align=True)
split.active = linestyle.use_chaining
@@ -643,7 +643,7 @@ class VIEWLAYER_PT_freestyle_linestyle(ViewLayerFreestyleEditorButtonsPanel, Pan
col = split.column()
col.prop(linestyle, "use_same_object")
## Splitting
# Splitting
layout.label(text="Splitting:")
split = layout.split(align=True)
# First column
@@ -679,7 +679,7 @@ class VIEWLAYER_PT_freestyle_linestyle(ViewLayerFreestyleEditorButtonsPanel, Pan
sub.prop(linestyle, "split_dash3", text="D3")
sub.prop(linestyle, "split_gap3", text="G3")
## Sorting
# Sorting
layout.prop(linestyle, "use_sorting", text="Sorting:")
col = layout.column()
col.active = linestyle.use_sorting
@@ -693,7 +693,7 @@ class VIEWLAYER_PT_freestyle_linestyle(ViewLayerFreestyleEditorButtonsPanel, Pan
row = col.row(align=True)
row.prop(linestyle, "sort_order", expand=True)
## Selection
# Selection
layout.label(text="Selection:")
split = layout.split(align=True)
# First column
@@ -716,12 +716,12 @@ class VIEWLAYER_PT_freestyle_linestyle(ViewLayerFreestyleEditorButtonsPanel, Pan
sub.active = linestyle.use_chain_count
sub.prop(linestyle, "chain_count")
## Caps
# Caps
layout.label(text="Caps:")
row = layout.row(align=True)
row.prop(linestyle, "caps", expand=True)
## Dashed lines
# Dashed lines
layout.prop(linestyle, "use_dashed_line", text="Dashed Line:")
row = layout.row(align=True)
row.active = linestyle.use_dashed_line
@@ -788,7 +788,8 @@ class VIEWLAYER_PT_freestyle_linestyle(ViewLayerFreestyleEditorButtonsPanel, Pan
props = row.operator(
"wm.properties_context_change",
text="Go to Linestyle Textures Properties",
icon='TEXTURE')
icon='TEXTURE',
)
props.context = 'TEXTURE'
elif linestyle.panel == 'MISC':

View File

@@ -242,7 +242,6 @@ class GreasePencilStrokeEditPanel:
if is_3d_view:
layout.separator()
layout.separator()
col = layout.column(align=True)
col.operator("gpencil.stroke_subdivide", text="Subdivide")

View File

@@ -43,8 +43,8 @@ class MASK_UL_layers(UIList):
class MASK_PT_mask:
# subclasses must define...
#~ bl_space_type = 'CLIP_EDITOR'
#~ bl_region_type = 'UI'
# ~ bl_space_type = 'CLIP_EDITOR'
# ~ bl_region_type = 'UI'
bl_label = "Mask Settings"
bl_options = {'DEFAULT_CLOSED'}
@@ -66,8 +66,8 @@ class MASK_PT_mask:
class MASK_PT_layers:
# subclasses must define...
#~ bl_space_type = 'CLIP_EDITOR'
#~ bl_region_type = 'UI'
# ~ bl_space_type = 'CLIP_EDITOR'
# ~ bl_region_type = 'UI'
bl_label = "Mask Layers"
@classmethod
@@ -114,8 +114,8 @@ class MASK_PT_layers:
class MASK_PT_spline:
# subclasses must define...
#~ bl_space_type = 'CLIP_EDITOR'
#~ bl_region_type = 'UI'
# ~ bl_space_type = 'CLIP_EDITOR'
# ~ bl_region_type = 'UI'
bl_label = "Active Spline"
@classmethod
@@ -148,8 +148,8 @@ class MASK_PT_spline:
class MASK_PT_point:
# subclasses must define...
#~ bl_space_type = 'CLIP_EDITOR'
#~ bl_region_type = 'UI'
# ~ bl_space_type = 'CLIP_EDITOR'
# ~ bl_region_type = 'UI'
bl_label = "Active Point"
@classmethod
@@ -203,8 +203,8 @@ class MASK_PT_point:
class MASK_PT_display:
# subclasses must define...
#~ bl_space_type = 'CLIP_EDITOR'
#~ bl_region_type = 'UI'
# ~ bl_space_type = 'CLIP_EDITOR'
# ~ bl_region_type = 'UI'
bl_label = "Mask Display"
bl_options = {'DEFAULT_CLOSED'}
@@ -229,8 +229,8 @@ class MASK_PT_display:
class MASK_PT_transforms:
# subclasses must define...
#~ bl_space_type = 'CLIP_EDITOR'
#~ bl_region_type = 'TOOLS'
# ~ bl_space_type = 'CLIP_EDITOR'
# ~ bl_region_type = 'TOOLS'
bl_label = "Transforms"
bl_category = "Mask"
bl_options = {'DEFAULT_CLOSED'}
@@ -253,8 +253,8 @@ class MASK_PT_transforms:
class MASK_PT_tools:
# subclasses must define...
#~ bl_space_type = 'CLIP_EDITOR'
#~ bl_region_type = 'TOOLS'
# ~ bl_space_type = 'CLIP_EDITOR'
# ~ bl_region_type = 'TOOLS'
bl_label = "Mask Tools"
bl_category = "Mask"
@@ -291,8 +291,8 @@ class MASK_PT_tools:
class MASK_PT_add:
# subclasses must define...
#~ bl_space_type = 'CLIP_EDITOR'
#~ bl_region_type = 'TOOLS'
# ~ bl_space_type = 'CLIP_EDITOR'
# ~ bl_region_type = 'TOOLS'
bl_label = "Add"
bl_category = "Mask"

View File

@@ -23,6 +23,7 @@ from rna_prop_ui import PropertyPanel
from bpy.app.translations import pgettext_iface as iface_
from bpy_extras.node_utils import find_node_input, find_output_node
class MATERIAL_MT_specials(Menu):
bl_label = "Material Specials"
@@ -172,11 +173,11 @@ class EEVEE_MATERIAL_PT_surface(MaterialButtonsPanel, Panel):
if mat.use_nodes:
panel_node_draw(layout, mat.node_tree, ('OUTPUT_EEVEE_MATERIAL', 'OUTPUT_MATERIAL'))
else:
raym = mat.raytrace_mirror
layout.use_property_split = True
layout.prop(mat, "diffuse_color", text="Base Color")
layout.prop(raym, "reflect_factor", text="Metallic")
layout.prop(mat, "metallic")
layout.prop(mat, "specular_intensity", text="Specular")
layout.prop(raym, "gloss_factor", text="Roughness")
layout.prop(mat, "roughness")
class EEVEE_MATERIAL_PT_options(MaterialButtonsPanel, Panel):
@@ -191,6 +192,7 @@ class EEVEE_MATERIAL_PT_options(MaterialButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
layout.use_property_split = True
mat = context.material
@@ -215,6 +217,27 @@ class EEVEE_MATERIAL_PT_options(MaterialButtonsPanel, Panel):
row.prop(mat, "use_sss_translucency")
class MATERIAL_PT_viewport(MaterialButtonsPanel, Panel):
bl_label = "Viewport Display"
bl_context = "material"
bl_options = {'DEFAULT_CLOSED'}
@classmethod
def poll(cls, context):
return context.material
def draw(self, context):
mat = context.material
layout = self.layout
layout.use_property_split = True
col = layout.column()
col.prop(mat, "diffuse_color")
col.prop(mat, "specular_color")
col.prop(mat, "roughness")
classes = (
MATERIAL_MT_specials,
MATERIAL_UL_matslots,
@@ -223,8 +246,10 @@ classes = (
EEVEE_MATERIAL_PT_context_material,
EEVEE_MATERIAL_PT_surface,
EEVEE_MATERIAL_PT_options,
MATERIAL_PT_viewport,
)
if __name__ == "__main__": # only for live edit.
from bpy.utils import register_class
for cls in classes:

View File

@@ -48,129 +48,108 @@ class OBJECT_PT_transform(ObjectButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
layout.use_property_split = True
col = layout.column()
ob = context.object
row = layout.row()
sub = col.row(align=True)
sub.prop(ob, "location")
sub.prop(ob, "lock_location", text="")
row.column().prop(ob, "location")
if ob.rotation_mode == 'QUATERNION':
row.column().prop(ob, "rotation_quaternion", text="Rotation")
sub = col.row(align=True)
sub.prop(ob, "rotation_quaternion", text="Rotation")
subsub = sub.column(align=True)
subsub.prop(ob, "lock_rotation_w", text="")
subsub.prop(ob, "lock_rotation", text="")
elif ob.rotation_mode == 'AXIS_ANGLE':
#row.column().label(text="Rotation")
# row.column().label(text="Rotation")
#row.column().prop(pchan, "rotation_angle", text="Angle")
#row.column().prop(pchan, "rotation_axis", text="Axis")
row.column().prop(ob, "rotation_axis_angle", text="Rotation")
sub = col.row(align=True)
sub.prop(ob, "rotation_axis_angle", text="Rotation")
subsub = sub.column(align=True)
subsub.prop(ob, "lock_rotation_w", text="")
subsub.prop(ob, "lock_rotation", text="")
else:
row.column().prop(ob, "rotation_euler", text="Rotation")
sub = col.row(align=True)
sub.prop(ob, "rotation_euler", text="Rotation")
sub.prop(ob, "lock_rotation", text="")
row.column().prop(ob, "scale")
sub = col.row(align=True)
sub.prop(ob, "scale")
sub.prop(ob, "lock_scale", text="")
layout.prop(ob, "rotation_mode")
col.prop(ob, "rotation_mode")
class OBJECT_PT_delta_transform(ObjectButtonsPanel, Panel):
bl_label = "Delta Transform"
bl_parent_id = "OBJECT_PT_transform"
bl_options = {'DEFAULT_CLOSED'}
def draw(self, context):
layout = self.layout
layout.use_property_split = True
ob = context.object
row = layout.row()
col = layout.column()
row.column().prop(ob, "delta_location")
col.column().prop(ob, "delta_location")
if ob.rotation_mode == 'QUATERNION':
row.column().prop(ob, "delta_rotation_quaternion", text="Rotation")
col.column().prop(ob, "delta_rotation_quaternion", text="Rotation")
elif ob.rotation_mode == 'AXIS_ANGLE':
#row.column().label(text="Rotation")
# row.column().label(text="Rotation")
#row.column().prop(pchan, "delta_rotation_angle", text="Angle")
#row.column().prop(pchan, "delta_rotation_axis", text="Axis")
#row.column().prop(ob, "delta_rotation_axis_angle", text="Rotation")
row.column().label(text="Not for Axis-Angle")
col.column().label(text="Not for Axis-Angle")
else:
row.column().prop(ob, "delta_rotation_euler", text="Delta Rotation")
col.column().prop(ob, "delta_rotation_euler", text="Delta Rotation")
row.column().prop(ob, "delta_scale")
class OBJECT_PT_transform_locks(ObjectButtonsPanel, Panel):
bl_label = "Transform Locks"
bl_options = {'DEFAULT_CLOSED'}
def draw(self, context):
layout = self.layout
ob = context.object
split = layout.split(percentage=0.1)
col = split.column(align=True)
col.label(text="")
col.label(text="X:")
col.label(text="Y:")
col.label(text="Z:")
split.column().prop(ob, "lock_location", text="Location")
split.column().prop(ob, "lock_rotation", text="Rotation")
split.column().prop(ob, "lock_scale", text="Scale")
if ob.rotation_mode in {'QUATERNION', 'AXIS_ANGLE'}:
row = layout.row()
row.prop(ob, "lock_rotations_4d", text="Lock Rotation")
sub = row.row()
sub.active = ob.lock_rotations_4d
sub.prop(ob, "lock_rotation_w", text="W")
col.column().prop(ob, "delta_scale")
class OBJECT_PT_relations(ObjectButtonsPanel, Panel):
bl_label = "Relations"
def draw(self, context):
layout = self.layout
ob = context.object
split = layout.split()
col = split.column()
col.prop(ob, "pass_index")
col = split.column()
col.label(text="Parent:")
col.prop(ob, "parent", text="")
sub = col.column()
sub.prop(ob, "parent_type", text="")
parent = ob.parent
if parent and ob.parent_type == 'BONE' and parent.type == 'ARMATURE':
sub.prop_search(ob, "parent_bone", parent.data, "bones", text="")
sub.active = (parent is not None)
class OBJECT_PT_relations_extras(ObjectButtonsPanel, Panel):
bl_label = "Relations Extras"
bl_options = {'DEFAULT_CLOSED'}
def draw(self, context):
layout = self.layout
layout.use_property_split = True
ob = context.object
split = layout.split()
col = layout.column()
col = split.column()
col.label(text="Tracking Axes:")
col.prop(ob, "track_axis", text="Axis")
col.prop(ob, "parent")
sub = col.column()
sub.prop(ob, "parent_type")
parent = ob.parent
if parent and ob.parent_type == 'BONE' and parent.type == 'ARMATURE':
sub.prop_search(ob, "parent_bone", parent.data, "bones")
sub.active = (parent is not None)
col = col.column()
col.active = (ob.parent is not None)
col.prop(ob, "use_slow_parent")
sub = col.column()
sub.active = (ob.use_slow_parent)
sub.prop(ob, "slow_parent_offset", text="Offset")
col.separator()
col = layout.column()
col.prop(ob, "track_axis", text="Tracking Axis")
col.prop(ob, "up_axis", text="Up Axis")
col = split.column()
col.prop(ob, "use_slow_parent")
row = col.row()
row.active = ((ob.parent is not None) and (ob.use_slow_parent))
row.prop(ob, "slow_parent_offset", text="Offset")
col.separator()
col.prop(ob, "pass_index")
class COLLECTION_MT_specials(Menu):
@@ -221,10 +200,12 @@ class OBJECT_PT_collections(ObjectButtonsPanel, Panel):
class OBJECT_PT_display(ObjectButtonsPanel, Panel):
bl_label = "Display"
bl_label = "Viewport Display"
bl_options = {'DEFAULT_CLOSED'}
def draw(self, context):
layout = self.layout
layout.use_property_split = True
obj = context.object
obj_type = obj.type
@@ -233,9 +214,7 @@ class OBJECT_PT_display(ObjectButtonsPanel, Panel):
is_empty_image = (obj_type == 'EMPTY' and obj.empty_draw_type == 'IMAGE')
is_dupli = (obj.dupli_type != 'NONE')
split = layout.split()
col = split.column()
col = layout.column(align=True)
col.prop(obj, "show_name", text="Name")
col.prop(obj, "show_axis", text="Axis")
# Makes no sense for cameras, armatures, etc.!
@@ -245,48 +224,39 @@ class OBJECT_PT_display(ObjectButtonsPanel, Panel):
if obj_type == 'MESH' or is_dupli:
col.prop(obj, "show_all_edges")
col = split.column()
row = col.row()
row.prop(obj, "show_bounds", text="Bounds")
sub = row.row()
sub.active = obj.show_bounds
sub.prop(obj, "draw_bounds_type", text="")
col = layout.column()
col.prop(obj, "show_bounds", text="Bounds")
col = layout.column()
col.active = obj.show_bounds
col.prop(obj, "draw_bounds_type")
col = layout.column()
if is_geometry:
col.prop(obj, "show_texture_space", text="Texture Space")
col.prop(obj.display, "show_shadows")
col.prop(obj.display, "show_shadows", text="Shadow")
col.prop(obj, "show_x_ray", text="X-Ray")
if obj_type == 'MESH' or is_empty_image:
col.prop(obj, "show_transparent", text="Transparency")
# if obj_type == 'MESH' or is_empty_image:
# col.prop(obj, "show_transparent", text="Transparency")
split = layout.split()
col = split.column()
col = layout.column()
if is_wire:
# wire objects only use the max. draw type for duplis
col.active = is_dupli
col.label(text="Maximum Dupli Draw Type:")
else:
col.label(text="Maximum Draw Type:")
col.prop(obj, "draw_type", text="")
col = split.column()
if is_geometry or is_empty_image:
# Only useful with object having faces/materials...
col.label(text="Object Color:")
col.prop(obj, "color", text="")
col.prop(
obj, "draw_type",
text="Maximum Dupli Draw Type" if is_wire else "Maximum Dupli Draw Type",
)
col = layout.column()
col.active = bool(is_dupli or obj.particle_systems)
col.label(text="Duplicator Visibility:")
row = col.row(align=True)
row.prop(obj, "show_duplicator_for_viewport", text="Viewport")
row.prop(obj, "show_duplicator_for_render", text="Render")
if is_geometry or is_empty_image:
# Only useful with object having faces/materials...
col.prop(obj, "color")
class OBJECT_PT_duplication(ObjectButtonsPanel, Panel):
bl_label = "Duplication"
bl_options = {'DEFAULT_CLOSED'}
def draw(self, context):
layout = self.layout
@@ -295,14 +265,15 @@ class OBJECT_PT_duplication(ObjectButtonsPanel, Panel):
layout.row().prop(ob, "dupli_type", expand=True)
if ob.dupli_type == 'FRAMES':
split = layout.split()
layout.use_property_split = True
col = split.column(align=True)
if ob.dupli_type == 'FRAMES':
col = layout.column(align=True)
col.prop(ob, "dupli_frames_start", text="Start")
col.prop(ob, "dupli_frames_end", text="End")
col = split.column(align=True)
col = layout.column(align=True)
col.prop(ob, "dupli_frames_on", text="On")
col.prop(ob, "dupli_frames_off", text="Off")
@@ -312,15 +283,22 @@ class OBJECT_PT_duplication(ObjectButtonsPanel, Panel):
layout.prop(ob, "use_dupli_vertices_rotation", text="Rotation")
elif ob.dupli_type == 'FACES':
row = layout.row()
row.prop(ob, "use_dupli_faces_scale", text="Scale")
sub = row.row()
col = layout.column()
col.prop(ob, "use_dupli_faces_scale", text="Scale")
sub = col.column()
sub.active = ob.use_dupli_faces_scale
sub.prop(ob, "dupli_faces_scale", text="Inherit Scale")
elif ob.dupli_type == 'COLLECTION':
layout.prop(ob, "dupli_group", text="Collection")
if ob.dupli_type != 'NONE' or len(ob.particle_systems):
layout.separator()
col = layout.column(align=True)
col.prop(ob, "show_duplicator_for_viewport")
col.prop(ob, "show_duplicator_for_render")
from .properties_animviz import (
MotionPathButtonsPanel,
@@ -370,9 +348,7 @@ classes = (
OBJECT_PT_context_object,
OBJECT_PT_transform,
OBJECT_PT_delta_transform,
OBJECT_PT_transform_locks,
OBJECT_PT_relations,
OBJECT_PT_relations_extras,
COLLECTION_MT_specials,
OBJECT_PT_collections,
OBJECT_PT_display,

File diff suppressed because it is too large Load Diff

View File

@@ -257,6 +257,7 @@ class PHYSICS_PT_cloth_field_weights(PhysicButtonsPanel, Panel):
cloth = context.cloth.settings
effector_weights_ui(self, context, cloth.effector_weights, 'CLOTH')
classes = (
CLOTH_MT_presets,
PHYSICS_PT_cloth,

View File

@@ -117,7 +117,7 @@ class PHYSICS_PT_rigid_body_dynamics(PHYSICS_PT_rigidbody_panel, Panel):
rbo = ob.rigid_body
#col = layout.column(align=1)
#col.label(text="Activation:")
# col.label(text="Activation:")
# XXX: settings such as activate on collison/etc.
split = layout.split()

View File

@@ -67,12 +67,13 @@ class RENDER_PT_context(Panel):
def draw(self, context):
layout = self.layout
layout.use_property_split = True
scene = context.scene
rd = scene.render
if rd.has_multiple_engines:
layout.prop(rd, "engine", text="")
layout.prop(rd, "engine", text="Render Engine")
class RENDER_PT_dimensions(RenderButtonsPanel, Panel):
@@ -125,6 +126,7 @@ class RENDER_PT_dimensions(RenderButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
layout.use_property_split = True
scene = context.scene
rd = scene.render
@@ -134,41 +136,47 @@ class RENDER_PT_dimensions(RenderButtonsPanel, Panel):
row.operator("render.preset_add", text="", icon='ZOOMIN')
row.operator("render.preset_add", text="", icon='ZOOMOUT').remove_active = True
split = layout.split()
col = layout.column(align=True)
col.prop(rd, "resolution_x", text="Resolution X")
col.prop(rd, "resolution_y", text="Y")
col.prop(rd, "resolution_percentage", text="%")
col = split.column()
col = layout.column(align=True)
col.prop(rd, "pixel_aspect_x", text="Aspect X")
col.prop(rd, "pixel_aspect_y", text="Y")
col = layout.column(align=True)
col.prop(rd, "use_border", text="Border")
sub = col.column(align=True)
sub.label(text="Resolution:")
sub.prop(rd, "resolution_x", text="X")
sub.prop(rd, "resolution_y", text="Y")
sub.prop(rd, "resolution_percentage", text="")
sub.label(text="Aspect Ratio:")
sub.prop(rd, "pixel_aspect_x", text="X")
sub.prop(rd, "pixel_aspect_y", text="Y")
row = col.row()
row.prop(rd, "use_border", text="Border")
sub = row.row()
sub.active = rd.use_border
sub.prop(rd, "use_crop_to_border", text="Crop")
col = split.column()
sub = col.column(align=True)
sub.label(text="Frame Range:")
sub.prop(scene, "frame_start")
sub.prop(scene, "frame_end")
sub.prop(scene, "frame_step")
col = layout.column(align=True)
col.prop(scene, "frame_start", text="Frame Start")
col.prop(scene, "frame_end", text="End")
col.prop(scene, "frame_step", text="Step")
sub.label(text="Frame Rate:")
col = layout.split(percentage=0.5)
col.alignment = 'RIGHT'
col.label(text="Frame Rate")
self.draw_framerate(col, rd)
self.draw_framerate(sub, rd)
subrow = sub.row(align=True)
subrow.label(text="Time Remapping:")
subrow = sub.row(align=True)
subrow.prop(rd, "frame_map_old", text="Old")
subrow.prop(rd, "frame_map_new", text="New")
class RENDER_PT_frame_remapping(RenderButtonsPanel, Panel):
bl_label = "Time Remapping"
bl_parent_id = "RENDER_PT_dimensions"
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
def draw(self, context):
layout = self.layout
layout.use_property_split = True
rd = context.scene.render
col = layout.column(align=True)
col.prop(rd, "frame_map_old", text="Old")
col.prop(rd, "frame_map_new", text="New")
class RENDER_PT_post_processing(RenderButtonsPanel, Panel):
@@ -178,16 +186,15 @@ class RENDER_PT_post_processing(RenderButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
layout.use_property_split = True
rd = context.scene.render
split = layout.split()
col = split.column()
col = layout.column(align=True)
col.prop(rd, "use_compositing")
col.prop(rd, "use_sequencer")
split.prop(rd, "dither_intensity", text="Dither", slider=True)
col.prop(rd, "dither_intensity", text="Dither", slider=True)
class RENDER_PT_stamp(RenderButtonsPanel, Panel):
@@ -197,24 +204,13 @@ class RENDER_PT_stamp(RenderButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
layout.use_property_split = False
rd = context.scene.render
layout.prop(rd, "use_stamp")
col = layout.column()
col.active = rd.use_stamp
row = col.row()
row.prop(rd, "stamp_font_size", text="Font Size")
row.prop(rd, "use_stamp_labels", text="Draw Labels")
row = col.row()
row.column().prop(rd, "stamp_foreground", slider=True)
row.column().prop(rd, "stamp_background", slider=True)
layout.label("Enabled Metadata")
split = layout.split()
col = split.column()
col = split.column(align=True)
col.prop(rd, "use_stamp_time", text="Time")
col.prop(rd, "use_stamp_date", text="Date")
col.prop(rd, "use_stamp_render_time", text="RenderTime")
@@ -222,7 +218,7 @@ class RENDER_PT_stamp(RenderButtonsPanel, Panel):
col.prop(rd, "use_stamp_scene", text="Scene")
col.prop(rd, "use_stamp_memory", text="Memory")
col = split.column()
col = split.column(align=True)
col.prop(rd, "use_stamp_camera", text="Camera")
col.prop(rd, "use_stamp_lens", text="Lens")
col.prop(rd, "use_stamp_filename", text="Filename")
@@ -230,14 +226,40 @@ class RENDER_PT_stamp(RenderButtonsPanel, Panel):
col.prop(rd, "use_stamp_marker", text="Marker")
col.prop(rd, "use_stamp_sequencer_strip", text="Seq. Strip")
row = layout.split(percentage=0.2)
if rd.use_sequencer:
col.prop(rd, "use_stamp_strip_meta", text="Sequence Strip")
row = layout.split(percentage=0.3)
row.prop(rd, "use_stamp_note", text="Note")
sub = row.row()
sub.active = rd.use_stamp_note
sub.prop(rd, "stamp_note_text", text="")
if rd.use_sequencer:
layout.label("Sequencer:")
layout.prop(rd, "use_stamp_strip_meta")
class RENDER_PT_stamp_burn(RenderButtonsPanel, Panel):
bl_label = "Burn Into Image"
bl_parent_id = "RENDER_PT_stamp"
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
def draw_header(self, context):
rd = context.scene.render
self.layout.prop(rd, "use_stamp", text="")
def draw(self, context):
layout = self.layout
rd = context.scene.render
layout.use_property_split = True
col = layout.column()
col.active = rd.use_stamp
col.prop(rd, "stamp_font_size", text="Font Size")
col.prop(rd, "use_stamp_labels", text="Draw Labels")
col.column().prop(rd, "stamp_foreground", slider=True)
col.column().prop(rd, "stamp_background", slider=True)
class RENDER_PT_output(RenderButtonsPanel, Panel):
@@ -246,6 +268,7 @@ class RENDER_PT_output(RenderButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
layout.use_property_split = False
rd = context.scene.render
image_settings = rd.image_settings
@@ -253,17 +276,17 @@ class RENDER_PT_output(RenderButtonsPanel, Panel):
layout.prop(rd, "filepath", text="")
split = layout.split()
layout.use_property_split = True
col = split.column()
col.active = not rd.is_movie_format
col.prop(rd, "use_overwrite")
col.prop(rd, "use_placeholder")
col = split.column()
col = layout.column(align=True)
sub = col.column(align=True)
sub.active = not rd.is_movie_format
sub.prop(rd, "use_overwrite")
sub.prop(rd, "use_placeholder")
col.prop(rd, "use_file_extension")
col.prop(rd, "use_render_cache")
layout.use_property_split = False
layout.template_image_settings(image_settings, color_management=False)
if rd.use_multiview:
layout.template_image_views(image_settings)
@@ -447,6 +470,7 @@ class RENDER_PT_eevee_ambient_occlusion(RenderButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
layout.use_property_split = True
scene = context.scene
props = scene.eevee
@@ -475,6 +499,7 @@ class RENDER_PT_eevee_motion_blur(RenderButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
layout.use_property_split = True
scene = context.scene
props = scene.eevee
@@ -500,6 +525,7 @@ class RENDER_PT_eevee_depth_of_field(RenderButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
layout.use_property_split = True
scene = context.scene
props = scene.eevee
@@ -525,6 +551,8 @@ class RENDER_PT_eevee_bloom(RenderButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
layout.use_property_split = True
scene = context.scene
props = scene.eevee
@@ -554,20 +582,32 @@ class RENDER_PT_eevee_volumetric(RenderButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
layout.use_property_split = True
scene = context.scene
props = scene.eevee
layout.active = props.use_volumetric
col = layout.column()
col.prop(props, "volumetric_start")
col.prop(props, "volumetric_end")
sub = col.column(align=True)
sub.prop(props, "volumetric_start")
sub.prop(props, "volumetric_end")
col.prop(props, "volumetric_tile_size")
col.separator()
col.prop(props, "volumetric_samples")
col.prop(props, "volumetric_sample_distribution")
sub.prop(props, "volumetric_sample_distribution")
col.separator()
col.prop(props, "use_volumetric_lights")
col.prop(props, "volumetric_light_clamp")
sub = col.column()
sub.active = props.use_volumetric_lights
sub.prop(props, "volumetric_light_clamp", text="Light Clamping")
col.separator()
col.prop(props, "use_volumetric_shadows")
col.prop(props, "volumetric_shadow_samples")
sub = col.column()
sub.active = props.use_volumetric_shadows
sub.prop(props, "volumetric_shadow_samples", text="Shadow Samples")
col.separator()
col.prop(props, "use_volumetric_colored_transmittance")
@@ -587,9 +627,13 @@ class RENDER_PT_eevee_subsurface_scattering(RenderButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
layout.use_property_split = True
scene = context.scene
props = scene.eevee
layout.active = props.use_sss
col = layout.column()
col.prop(props, "sss_samples")
col.prop(props, "sss_jitter_threshold")
@@ -612,12 +656,14 @@ class RENDER_PT_eevee_screen_space_reflections(RenderButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
layout.use_property_split = True
scene = context.scene
props = scene.eevee
col = layout.column()
col.active = props.use_ssr
col.prop(props, "use_ssr_refraction")
col.prop(props, "use_ssr_refraction", text="Refraction")
col.prop(props, "use_ssr_halfres")
col.prop(props, "ssr_quality")
col.prop(props, "ssr_max_roughness")
@@ -637,6 +683,8 @@ class RENDER_PT_eevee_shadows(RenderButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
layout.use_property_split = True
scene = context.scene
props = scene.eevee
@@ -658,6 +706,8 @@ class RENDER_PT_eevee_sampling(RenderButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
layout.use_property_split = True
scene = context.scene
props = scene.eevee
@@ -678,6 +728,8 @@ class RENDER_PT_eevee_indirect_lighting(RenderButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
layout.use_property_split = True
scene = context.scene
props = scene.eevee
@@ -698,30 +750,52 @@ class RENDER_PT_eevee_film(RenderButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
layout.use_property_split = True
scene = context.scene
rd = scene.render
split = layout.split()
col = split.column()
col = layout.column()
col.prop(rd, "filter_size")
col = split.column()
col.prop(rd, "alpha_mode", text="Alpha")
class RENDER_PT_hair(RenderButtonsPanel, Panel):
bl_label = "Hair"
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_EEVEE'}
@classmethod
def poll(cls, context):
return (context.engine in cls.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
scene = context.scene
rd = scene.render
row = layout.row()
row.prop(rd, "hair_type", expand=True)
layout.use_property_split = True
layout.prop(rd, "hair_subdiv")
classes = (
RENDER_MT_presets,
RENDER_MT_ffmpeg_presets,
RENDER_MT_framerate_presets,
RENDER_PT_context,
RENDER_PT_dimensions,
RENDER_PT_frame_remapping,
RENDER_PT_post_processing,
RENDER_PT_stamp,
RENDER_PT_output,
RENDER_PT_encoding,
RENDER_PT_stamp,
RENDER_PT_stamp_burn,
RENDER_UL_renderviews,
RENDER_PT_stereoscopy,
RENDER_PT_hair,
RENDER_PT_clay_settings,
RENDER_PT_eevee_sampling,
RENDER_PT_eevee_film,

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