1
1

Compare commits

...

64 Commits

Author SHA1 Message Date
Colin Basnett
9e3bca4d1b Fix T97497: NLA strip names are now properly contained within the strip bounds
Very easy fix, the bug seemed to be a result of a typo on the right-most margin.

Old: {F13013777}

New: {F13013782}

Maniphest Tasks: T97497

Differential Revision: https://developer.blender.org/D14711
2022-04-21 11:09:06 +02:00
b56eaea794 Fix Empty "Only Axis Aligned" viewing angle depends on object scale
This was projecting the unnormalized z scale axis onto the plane defined
by the view vector. If object scale was very small, this made the empty
still visible at viewing angles far from the object axis.

Now use the normalized z scale axis to make this work the same at all
object scales.

Fixes T97004.

Maniphest Tasks: T97004

Differential Revision: https://developer.blender.org/D14557
2022-04-21 11:09:06 +02:00
af9ecb888e Fix T97465: Moving compositor BG image cannot be cancelled
This was possible with the gizmo, but no using the operator (e.g. from
the sidebar).

Now store original offsets and reset to these on calcel (ESC or RMB).

Maniphest Tasks: T97465

Differential Revision: https://developer.blender.org/D14704
2022-04-21 11:09:06 +02:00
27213905d6 Sculpt: fix missing null pointer check
in workbench_engine.c
2022-04-21 11:09:06 +02:00
e36092fa8b Fix T95932: Auto-close text breaks outliner drag-n-drop
Text inserted via TEXT_OT_insert would always have auto-close
logic applies which interfered any insertion of literal strings
containing brackets.

Now auto-closing brackets is restricted to characters read from
events from the operators invoke functions.
2022-04-21 11:09:06 +02:00
34059fbdf3 Cleanup: clang format 2022-04-21 11:09:06 +02:00
39f777b1f3 Cleanup: fix various warnings after recent commit 2022-04-21 11:09:06 +02:00
315602b71f Vertex paint: Fix debug compile error and a
few warnings.
2022-04-21 11:09:06 +02:00
d6c513b154 Fix T97185: Data transfer modifier doesn't display
individual layers.

A few RNA property strings were misspelled.
2022-04-21 11:09:06 +02:00
4e142230e1 Fix T97469: Sculpt colors crash in multiresolution or dynamic topology modes.
Sculpt paint tools now pop up an error message if
dynamic topology or multires are enabled.

Implementation notes:

* SCULPT_vertex_colors_poll is now a static function in sculpt_ops.c.
  It is now used solely by the legacy color attribute conversion
  operators (SCULPT_OT_vertex_to_loop_colors and SCULPT_OT_loop_to_vertex_colors)
  and should be deleted when they are.
* There is a new method, SCULPT_handles_colors_report, that returns true if
  the sculpt session can handle color attributes; otherwise it returns false
  and displays an error message to the user.
2022-04-21 11:09:06 +02:00
63cd62f44b Commit D14179: Revamp Vertex Paint With C++
- Verrtex paint mode has been refactored into C++ templates.
  It now works with both byte and float colors and point
  & corner attribute domains.
- There is a new API for mixing colors (also based
  on C++ templates).  Unlike the existing APIs byte
  and float colors are interpolated identically.
  Interpolation does happen in a squared rgb space,
  this may be changed in the future.
- Vertex paint now uses the sculpt undo system.

Reviewed By: Brecht Van Lommel.

Differential Revision: https://developer.blender.org/D14179
Ref D14179
2022-04-21 11:09:06 +02:00
Jon Denning
81de1e7d4d Text Editor: add Python 3.10 soft keywords to builtinfunc list
Python 3.10 has added "soft keywords" [0] to their list of identifiers.
This patch adds these soft keywords to the list of builtin functions
that the text editor searches for when highlighting Python code.

The only soft keywords that Python 3.10 current has are: `match`,
`case`, and `_`, but more will likely be added in future versions.

Currently, the `_` soft keyword is ignored from highlighting. It is a
wildcard matching pattern when used with `case` (similar to `default`
for `switch`es in C/C++), but `_` is far more often used in other
contexts where highlighting the `_` might seem strange. For example,
ignoring elements when unpacking tuples (`_, g, _, a = color`).

This patch also updates the commented Python code for creating the list
of keywords, for convenience.

Before:

{F13012878}

After:

{F13012880}

Example from PEP-636 [1]

Note: These soft keywords are only reserved under specific contexts.
However, in order for the text editor to know when the keywords are used
in the appropriate contexts, the text editor would need a full-blown
Python grammar [2] parser. So, for now, these keywords are simply added
in along with the other keywords in order to highlight them in the text
editor.

[0]: https://docs.python.org/3/reference/lexical_analysis.html#soft-keywords
[1]: https://peps.python.org/pep-0636/#matching-specific-values
[2]: https://docs.python.org/3/reference/grammar.html

Ref D14707
2022-04-21 11:09:06 +02:00
8fb03c9e27 Cleanup: explicitly disable autopep8 for rna_manual_reference
Currently the "exclude" option for autopep8 isn't as reliable as it
should be since passing in absolute paths to autopep8 causes
the paths not to match. See: D14686 for details.

So explicitly disable autopep8 in this generated file (the generator
has already been updated).

Also use spaces for indentation otherwise autopep8 re-indents them.
This seems like a bug in autopep8 since it's changing lines with
autopep8 disabled. Use a workaround instead of looking into a fix since
it's simpler for all our Python files to use spaces instead of tabs and
there isn't much benefit mixing indentation for scripts.
2022-04-21 11:09:06 +02:00
f5aafba836 Fix typo in previous commit 2022-04-21 11:09:06 +02:00
d65a9adaf3 Cleanup: VSE effect relationship checking
Use `SEQ_relation_is_effect_of_strip` for checking effect-input
relationship where this is applicable.
2022-04-21 11:09:06 +02:00
Shrey Aggarwal
54df4699c3 Fix T70844: Incorrect snappping of strips when effects attached
Sometimes, when moving strip with 2 input effect attached and causing
strip overlap, this overlap is resolved incorrectly - too big offset
is applied. This is because effects are not taken into consideration
when "shuffeling" to resolve overlap.

To fix usual cases (transitions), overlap between strip and it's effect
is considered to be impossible.

There are edge cases, but these would be much more complicated to
implement and could have negative impact on performance.

Reviewed By: ISS

Differential Revision: https://developer.blender.org/D14578
2022-04-21 11:09:06 +02:00
ok what
587f77c45d VSE: Add frame selected operator for preview
This operator moves the view to show the selected visible strips.

Reviewed By: ISS

Differential Revision: https://developer.blender.org/D14222
2022-04-21 11:09:06 +02:00
1912c3e151 Fix T97254: VSE channel mute does mute sound
Add missing RNA update function
2022-04-21 11:09:06 +02:00
851dff6ee9 Fix T97356: Crash when adding adjustment layer strip
Crash was caused by incorrectly assuming, that rendered strip is meta
when editing code in bulk, but this wasn't true and strip had no
channels initialized, which caused crash on NULL dereference.

Correct approach is to find list of channels where on same level as
rendered strip, similar to how `SEQ_get_seqbase_by_seq` function works
for list of strips.
2022-04-21 11:09:06 +02:00
cd8e9d5c1e GL: Change array macro to not conflict with opensubdiv variable names
Fix T97449 GPU subdivision: Crash on adding subdivision surface modifier
2022-04-21 11:09:06 +02:00
52d1cc75de Revert "Fix GPU subdivision: Crash on adding subdivision surface modifier"
The fix does not fix the case of shaders comming from the OpenSubdiv API.

This reverts commit f5191b8760.
2022-04-21 11:09:06 +02:00
d55ac32732 Revert "Fix Cycles HIP assuming warp size 32"
This reverts commit 390b9f1305. It seems to
break things on Linux for unknown reasons, so leave it out for now. A solution
to this will be required for Vega cards though.
2022-04-21 11:09:06 +02:00
4b31ca6390 LibOverride: Make 'custom bone shape' and 'bbone custom handle' non-overridable.
There is not much point in having those editable in overrides, and since
those are pointers, their value always differs from ref linked ID vs.
local override one, generating 'noise' in Outliner's override property
view.
2022-04-21 11:09:06 +02:00
Jung Jaeyun
3a29ff1136 UI: Add option to create color attribute directly from canvas selector.
Added + and - buttons to create and delete color attributes from canvas selector.

{T97345}

{F13006374}

Reviewed By: jbakker, Ethan1080

Maniphest Tasks: T97345

Differential Revision: https://developer.blender.org/D14672
2022-04-21 11:09:06 +02:00
44e3e541f6 Build: updates for Blender to build against new 3.2 libraries
Building against the existing 3.1 libraries should continue to work, until
the precompiled libraries are committed for all platforms.

* Enable WebP by default.
* Update Windows for new library file names.
* Automatically clear outdated CMake cache variables when upgrading to new
  libraries.
* Fix static library linking order issues on Linux for OpenEXR and OpenVDB.

Implemented by Ray Molenkamp, Sybren Stüvel and Brecht Van Lommel.

Ref T95206
2022-04-21 11:09:06 +02:00
dbd2993230 Build: upgrade many library dependencies to new versions for Blender 3.2
This only updates the build system, precompiled libraries for the various
platforms will be committed over the coming week.

New:
fmt 8.0.0
level_zero v1.7.15
pystring v1.1.3
robinmap v0.6.2
webp 1.2.2

Updated:
alembic 1.8.3
blosc 1.21.1
boost 1.78.0
embree 3.13.3
ffmpeg 5.0
fftw 3.3.10
flac 1.3.4
imath 3.1.4
ispc v1.17.0
jpeg 2.1.3
ogg 1.3.5
oidn 1.4.3
openal 1.21.1
opencolorio 2.1.1
openexr 3.1.4
openimageio v2.3.13.0
openjpeg 2.4.0
opensubdiv v3_4_4
openvdb 9.0.0
osl 1.11.17.0
sdl 2.0.20
tbb 2020_u3
tiff 4.3.0
usd 22.03
vorbis 1.3.7
vpx 1.11.0
x264 35fe20d1b
zlib 1.2.12

Implemented by Ray Molenkamp, Sybren Stüvel and Brecht Van Lommel.

Ref T95206
2022-04-21 11:09:06 +02:00
67303b59f4 Cleanup: Remove redundant types from custom data masks
Colors and byte colors are already included in `CD_MASK_PROP_ALL`.
2022-04-21 11:09:06 +02:00
eef047c14e Cleanup: Rename CD_MLOOPCOL to CD_PROP_BYTE_COLOR
The "PROP" in the name reflects its generic status, and removing
"LOOP" makes sense because it is no longer associated with just
mesh face corners. In general the goal is to remove extra semantic
meaning from the custom data types.
2022-04-21 11:09:06 +02:00
a2c8b9950b PBVH: Pass Mesh to extract internals.
More mesh data is required when extracting the UV seams. This is an
API change for to support this future enhancement.
2022-04-21 11:09:06 +02:00
87d7b326a2 Fix T94775: Buggy liboverride default apply code for items insertion in RNA collections.
For some reason, the rework of liboverride handling of Collection items
insertion (rB33c5e7bcd5e5) completely missed to update accordingly the
default liboverride apply code...

Many thanks to Wayde Moss (@GuiltyGhost) for the investigation and
proposed solution.
2022-04-21 11:09:06 +02:00
b3806b3bd6 Fix (unreported) huge liboverride slow-down due to non-disabled UV layer props.
Was revealed by yesterday's fix (rB6f56bd4083f9).
2022-04-21 11:09:06 +02:00
4644cb4920 Fix compilation without OpenVDB 2022-04-21 11:09:06 +02:00
8c7c9373e9 Cleanup: remove unused curves toolsetting 2022-04-21 11:09:06 +02:00
bff100b5a0 Fix GPU subdivision: Crash on adding subdivision surface modifier
This was caused by the use of a reserved keyword macro that is not
directly used but causes an error on some compiler.

Change the occurences to not match the macros.
2022-04-21 11:09:06 +02:00
d95495a9cc Cleanup: run autopep8 on tests/performance/benchmark
This file was skipped by source/tools/utils/autopep8_clean.py
since it doesn't have a .py extension, running the autopep8 tool
recursively detects Python scripts without extensions.
2022-04-21 11:09:06 +02:00
33e1916b62 Cleanup: re-run autopep8 with E401 enabled
Put imports on their own line which was almost always the case already.
2022-04-21 11:09:06 +02:00
c8eeb011bc Cleanup: run autopep8 on release/scripts/presets 2022-04-21 11:09:06 +02:00
4ce0f68936 Cleanup: use autopep8 on release/lts 2022-04-21 11:09:06 +02:00
880306cc13 Cleanup: run autopep8 on release/scripts/freestyle 2022-04-21 11:09:06 +02:00
0a65c4811a Cleanup: run autopep8 on intern/cycles/
Disable autopep8 for the block that yields passes in list_render_passes,
for better readability.
2022-04-21 11:09:06 +02:00
812901b281 Cleanup: run autopep8 with max-line-length=120 (missed a file) 2022-04-21 11:09:06 +02:00
7c52504914 Cleanup: run autopep8 with max-line-length=120 2022-04-21 11:09:06 +02:00
4ee293dd38 Cleanup: use autopep8 for bl_i18n_utils.settings
Disable autopep8 for some regex blocks that use indentation
to signify regex grouping.
2022-04-21 11:09:06 +02:00
9eca10d0c2 Cleanup: run autopep8 on release/scripts/modules/ 2022-04-21 11:09:06 +02:00
f36e139702 Cleanup: run autopep8 on release/scripts/templates_py 2022-04-21 11:09:06 +02:00
802c84b743 Cleanup: run autopep8 on doc/ 2022-04-21 11:09:06 +02:00
d976763988 Cleanup: run autopep8 on build_files/
Replace multiple hashes with over-lines for make_source_archive.py.
2022-04-21 11:09:06 +02:00
edb9759b2d PyAPI: improve deprecation warning for bpy.ops context override
- Increase the stack level so the reported line number references
  script authors code (not Blender's wrapper function).
- Include the operator name and poll/call usage in the warning.
2022-04-21 11:09:06 +02:00
d3e2bc9fcb Fix crash passing no arguments to Context.temp_override 2022-04-21 11:09:06 +02:00
f0862773b4 Docs: update examples to use Context.temp_override 2022-04-21 11:09:06 +02:00
fbbfecba23 PyAPI: temporary context override support
Support a way to temporarily override the context from Python.

- Added method `Context.temp_override` context manager.
- Special support for windowing variables "window", "area" and "region",
  other context members such as "active_object".
- Nesting context overrides is supported.
- Previous windowing members are restored when the context exists unless
  they have been removed.
- Overriding context members by passing a dictionary into operators in
  `bpy.ops` has been deprecated and warns when used.

This allows the window in a newly loaded file to be used, see: T92464

Reviewed by: mont29

Ref D13126
2022-04-21 11:09:05 +02:00
5cdd42384c PyAPI: utility functions for parsing typed RNA arguments
These functions can be used with PyArg_ParseTupleAndKeywords
(and related functions) to take typed RNA arguments without
having to extract and type-check them separately.

No functional changes, extracted from D13126.
2022-04-21 11:09:05 +02:00
8618a0f4b8 Cleanup: spelling in comments 2022-04-21 11:09:05 +02:00
943294cab8 Cleanup: clang-format 2022-04-21 11:09:05 +02:00
31822accee Cleanup: unused argument warning 2022-04-21 11:09:05 +02:00
Nate Rupsis
cc1c7499a2 UI: Fix typo in Apply Parent Inverse tooltip
There's a small typo in the tool tip for applying the Parent Inverse. This patch fixes that typo

old:
{F13010751}

new:
{F13010749}

Reviewed By: Blendify

Maniphest Tasks: T97437

Differential Revision: https://developer.blender.org/D14693
2022-04-21 11:09:05 +02:00
756d3808d1 Mesh: Avoid unnecessary normal calculation and dirty tags
This is mostly a cleanup to avoid hardcoding the eager calculation of
normals it isn't necessary, by reducing calls to `BKE_mesh_calc_normals`
and by removing calls to `BKE_mesh_normals_tag_dirty` when the mesh
is newly created and already has dirty normals anyway. This reduces
boilerplate code and makes the "dirty by default" state more clear.
Any regressions from this commit should be easy to fix, though the
lazy calculation is solid enough that none are expected.
2022-04-21 11:09:05 +02:00
e1aa076ee8 Cleanup: Don't recalculate normals in versioning code
Normals are not read from files anymore, calculating them in versioning
is unnecessary and wasteful.
2022-04-21 11:09:05 +02:00
cc30445f5d Fix: Incorrect info message in set material node
The node does have support for curves since c4f7f59c65.
2022-04-21 11:09:05 +02:00
08c1fe7d2c Fix: Assert when sculpting empty curves 2022-04-21 11:09:05 +02:00
ec8f5b0a3a GPUMaterial: Use GPU_MAT_CREATED as a default 2022-04-20 14:50:39 +02:00
351d37c62d GPUMaterial: Rework the deferred compilation to not use double locks
This uses refcounter instead of double thread mutexes. This should be
more robust and avoir use after free situation.

Also remove redundant structures and the use of scene as the job owner.
2022-04-20 14:35:07 +02:00
51ef2169f5 Revert "DRW: Simplify shader deferred compilation"
This reverts commit de3b10abb6.
2022-04-20 14:33:17 +02:00
de3b10abb6 DRW: Simplify shader deferred compilation
Previous method consisted on using another thread and another GL context
to compile in a non blocking way. However this proved to not be a huge
gain and was even making some implementation buggy.

Trying to revert back to a more simplistic approach where we only compile
a handfull of shaders per redraw untill we empty a time budget for shader
compilation.

This approach provides more updates during the compilation process and
avoids all the complexity added by the threading system.
This might be a downside because interleaving many redraw with
compilations could theoreticaly lead to longer wait time until scene wide
compilation is finished. But this still has to be measured.
2022-04-19 19:04:58 +02:00
291 changed files with 7751 additions and 5874 deletions

View File

@@ -284,7 +284,7 @@ option(WITH_IMAGE_TIFF "Enable LibTIFF Support" ON)
option(WITH_IMAGE_DDS "Enable DDS Image Support" ON)
option(WITH_IMAGE_CINEON "Enable CINEON and DPX Image Support" ON)
option(WITH_IMAGE_HDR "Enable HDR Image Support" ON)
option(WITH_IMAGE_WEBP "Enable WebP Image Support" OFF)
option(WITH_IMAGE_WEBP "Enable WebP Image Support" ON)
# Audio/Video format support
option(WITH_CODEC_AVI "Enable Blenders own AVI file support (raw/jpeg)" ON)
@@ -302,7 +302,7 @@ option(WITH_USD "Enable Universal Scene Description (USD) Suppor
option(WITH_OPENCOLLADA "Enable OpenCollada Support (http://www.opencollada.org)" ON)
# Sound output
option(WITH_SDL "Enable SDL for sound and joystick support" ON)
option(WITH_SDL "Enable SDL for sound" ON)
option(WITH_OPENAL "Enable OpenAL Support (http://www.openal.org)" ON)
if(APPLE)
option(WITH_COREAUDIO "Enable CoreAudio for audio support on macOS" ON)

View File

@@ -29,8 +29,9 @@ cmake_minimum_required(VERSION 3.5)
include(ExternalProject)
include(cmake/check_software.cmake)
include(cmake/options.cmake)
include(cmake/versions.cmake)
include(cmake/options.cmake)
include(cmake/boost_build_options.cmake)
include(cmake/download.cmake)
if(ENABLE_MINGW64)
@@ -46,6 +47,7 @@ include(cmake/png.cmake)
include(cmake/jpeg.cmake)
include(cmake/blosc.cmake)
include(cmake/pthreads.cmake)
include(cmake/imath.cmake)
include(cmake/openexr.cmake)
include(cmake/brotli.cmake)
include(cmake/freetype.cmake)
@@ -75,7 +77,6 @@ endif()
include(cmake/osl.cmake)
include(cmake/tbb.cmake)
include(cmake/openvdb.cmake)
include(cmake/nanovdb.cmake)
include(cmake/python.cmake)
option(USE_PIP_NUMPY "Install NumPy using pip wheel instead of building from source" OFF)
if(APPLE AND ("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "x86_64"))
@@ -94,12 +95,15 @@ include(cmake/pugixml.cmake)
include(cmake/ispc.cmake)
include(cmake/openimagedenoise.cmake)
include(cmake/embree.cmake)
include(cmake/fmt.cmake)
include(cmake/robinmap.cmake)
if(NOT APPLE)
include(cmake/xr_openxr.cmake)
endif()
# OpenColorIO and dependencies.
include(cmake/expat.cmake)
include(cmake/pystring.cmake)
include(cmake/yamlcpp.cmake)
include(cmake/opencolorio.cmake)
@@ -107,8 +111,9 @@ if(BLENDER_PLATFORM_ARM)
include(cmake/sse2neon.cmake)
endif()
if(WITH_WEBP)
include(cmake/webp.cmake)
include(cmake/webp.cmake)
if(NOT APPLE)
include(cmake/level-zero.cmake)
endif()
if(NOT WIN32 OR ENABLE_MINGW64)

View File

@@ -1,30 +1,16 @@
# SPDX-License-Identifier: GPL-2.0-or-later
set(ALEMBIC_EXTRA_ARGS
-DBUILDSTATIC=ON
-DLINKSTATIC=ON
-DILMBASE_ROOT=${LIBDIR}/openexr
-DALEMBIC_ILMBASE_INCLUDE_DIRECTORY=${LIBDIR}/openexr/include/OpenEXR
-DALEMBIC_ILMBASE_HALF_LIB=${LIBDIR}/openexr/lib/${LIBPREFIX}Half${OPENEXR_VERSION_POSTFIX}${LIBEXT}
-DALEMBIC_ILMBASE_IMATH_LIB=${LIBDIR}/openexr/lib/${LIBPREFIX}Imath${OPENEXR_VERSION_POSTFIX}${LIBEXT}
-DALEMBIC_ILMBASE_ILMTHREAD_LIB=${LIBDIR}/openexr/lib/${LIBPREFIX}IlmThread${OPENEXR_VERSION_POSTFIX}${LIBEXT}
-DALEMBIC_ILMBASE_IEX_LIB=${LIBDIR}/openexr/lib/${LIBPREFIX}Iex${OPENEXR_VERSION_POSTFIX}${LIBEXT}
-DALEMBIC_ILMBASE_IEXMATH_LIB=${LIBDIR}/openexr/lib/${LIBPREFIX}IexMath${OPENEXR_VERSION_POSTFIX}${LIBEXT}
-DUSE_PYILMBASE=0
-DUSE_PYALEMBIC=0
-DUSE_ARNOLD=0
-DUSE_MAYA=0
-DUSE_PRMAN=0
-DUSE_HDF5=Off
-DUSE_STATIC_HDF5=Off
-DUSE_TESTS=Off
-DALEMBIC_NO_OPENGL=1
-DImath_ROOT=${LIBDIR}/imath
-DUSE_PYALEMBIC=OFF
-DUSE_ARNOLD=OFF
-DUSE_MAYA=OFF
-DUSE_PRMAN=OFF
-DUSE_HDF5=OFF
-DUSE_TESTS=OFF
-DUSE_BINARIES=ON
-DALEMBIC_ILMBASE_LINK_STATIC=On
-DALEMBIC_ILMBASE_LINK_STATIC=OFF
-DALEMBIC_SHARED_LIBS=OFF
-DGLUT_INCLUDE_DIR=""
-DZLIB_LIBRARY=${LIBDIR}/zlib/lib/${ZLIB_LIBRARY}
-DZLIB_INCLUDE_DIR=${LIBDIR}/zlib/include/
)
ExternalProject_Add(external_alembic
@@ -55,6 +41,5 @@ endif()
add_dependencies(
external_alembic
external_zlib
external_openexr
)

View File

@@ -24,7 +24,6 @@ ExternalProject_Add(external_blosc
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${BLOSC_HASH_TYPE}=${BLOSC_HASH}
PREFIX ${BUILD_DIR}/blosc
PATCH_COMMAND ${PATCH_CMD} --verbose -p 1 -N -d ${BUILD_DIR}/blosc/src/external_blosc < ${PATCH_DIR}/blosc.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/blosc ${DEFAULT_CMAKE_FLAGS} ${BLOSC_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/blosc
)

View File

@@ -1,22 +1,6 @@
# SPDX-License-Identifier: GPL-2.0-or-later
set(BOOST_ADDRESS_MODEL 64)
if(BLENDER_PLATFORM_ARM)
set(BOOST_ARCHITECTURE arm)
else()
set(BOOST_ARCHITECTURE x86)
endif()
if(WIN32)
if(MSVC_VERSION GREATER_EQUAL 1920) # 2019
set(BOOST_TOOLSET toolset=msvc-14.2)
set(BOOST_COMPILER_STRING -vc142)
else() # 2017
set(BOOST_TOOLSET toolset=msvc-14.1)
set(BOOST_COMPILER_STRING -vc141)
endif()
set(BOOST_CONFIGURE_COMMAND bootstrap.bat)
set(BOOST_BUILD_COMMAND b2)
set(BOOST_BUILD_OPTIONS runtime-link=shared )
@@ -36,11 +20,6 @@ else()
set(BOOST_BUILD_COMMAND ./b2)
set(BOOST_BUILD_OPTIONS cxxflags=${PLATFORM_CXXFLAGS} --disable-icu boost.locale.icu=off)
set(BOOST_PATCH_COMMAND echo .)
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
set(BOOST_ADDRESS_MODEL 64)
else()
set(BOOST_ADDRESS_MODEL 32)
endif()
endif()
if(WITH_BOOST_PYTHON)

View File

@@ -0,0 +1,30 @@
# SPDX-License-Identifier: GPL-2.0-or-later
set(BOOST_ADDRESS_MODEL 64)
if(BLENDER_PLATFORM_ARM)
set(BOOST_ARCHITECTURE arm)
else()
set(BOOST_ARCHITECTURE x86)
endif()
if(WIN32)
if(MSVC_VERSION GREATER_EQUAL 1920) # 2019
set(BOOST_TOOLSET toolset=msvc-14.2)
set(BOOST_COMPILER_STRING -vc142)
else() # 2017
set(BOOST_TOOLSET toolset=msvc-14.1)
set(BOOST_COMPILER_STRING -vc141)
endif()
endif()
set(DEFAULT_BOOST_FLAGS
-DBoost_COMPILER:STRING=${BOOST_COMPILER_STRING}
-DBoost_USE_MULTITHREADED=ON
-DBoost_USE_STATIC_LIBS=ON
-DBoost_USE_STATIC_RUNTIME=OFF
-DBOOST_ROOT=${LIBDIR}/boost
-DBoost_NO_SYSTEM_PATHS=ON
-DBoost_NO_BOOST_CMAKE=ON
-DBoost_ADDITIONAL_VERSIONS=${BOOST_VERSION_SHORT}
-DBOOST_LIBRARYDIR=${LIBDIR}/boost/lib/
)

View File

@@ -71,9 +71,7 @@ download_source(FFMPEG)
download_source(FFTW)
download_source(ICONV)
download_source(SNDFILE)
if(WITH_WEBP)
download_source(WEBP)
endif()
download_source(WEBP)
download_source(SPNAV)
download_source(JEMALLOC)
download_source(XML2)
@@ -102,3 +100,8 @@ download_source(HARU)
download_source(ZSTD)
download_source(FLEX)
download_source(BROTLI)
download_source(FMT)
download_source(ROBINMAP)
download_source(IMATH)
download_source(PYSTRING)
download_source(LEVEL_ZERO)

View File

@@ -17,6 +17,16 @@ set(EMBREE_EXTRA_ARGS
-DTBB_STATIC_LIB=${TBB_STATIC_LIBRARY}
)
if(BLENDER_PLATFORM_ARM)
set(EMBREE_EXTRA_ARGS
${EMBREE_EXTRA_ARGS}
-DEMBREE_MAX_ISA=NEON)
else()
set(EMBREE_EXTRA_ARGS
${EMBREE_EXTRA_ARGS}
-DEMBREE_MAX_ISA=AVX2)
endif()
if(TBB_STATIC_LIBRARY)
set(EMBREE_EXTRA_ARGS
${EMBREE_EXTRA_ARGS}
@@ -37,26 +47,15 @@ else()
set(EMBREE_BUILD_DIR)
endif()
if(BLENDER_PLATFORM_ARM)
ExternalProject_Add(external_embree
GIT_REPOSITORY ${EMBREE_ARM_GIT}
GIT_TAG "blender-arm"
DOWNLOAD_DIR ${DOWNLOAD_DIR}
PREFIX ${BUILD_DIR}/embree
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/embree ${DEFAULT_CMAKE_FLAGS} ${EMBREE_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/embree
)
else()
ExternalProject_Add(external_embree
URL file://${PACKAGE_DIR}/${EMBREE_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${EMBREE_HASH_TYPE}=${EMBREE_HASH}
PREFIX ${BUILD_DIR}/embree
PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/embree/src/external_embree < ${PATCH_DIR}/embree.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/embree ${DEFAULT_CMAKE_FLAGS} ${EMBREE_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/embree
)
endif()
ExternalProject_Add(external_embree
URL file://${PACKAGE_DIR}/${EMBREE_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${EMBREE_HASH_TYPE}=${EMBREE_HASH}
PREFIX ${BUILD_DIR}/embree
PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/embree/src/external_embree < ${PATCH_DIR}/embree.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/embree ${DEFAULT_CMAKE_FLAGS} ${EMBREE_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/embree
)
add_dependencies(
external_embree

View File

@@ -0,0 +1,14 @@
# SPDX-License-Identifier: GPL-2.0-or-later
set(FMT_EXTRA_ARGS
-DFMT_TEST=Off
)
ExternalProject_Add(external_fmt
URL file://${PACKAGE_DIR}/${FMT_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${FMT_HASH_TYPE}=${FMT_HASH}
PREFIX ${BUILD_DIR}/fmt
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/fmt ${DEFAULT_CMAKE_FLAGS} ${FMT_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/fmt
)

View File

@@ -14,8 +14,8 @@ if(WIN32)
if(BUILD_MODE STREQUAL Release)
add_custom_target(Harvest_Release_Results
COMMAND # jpeg rename libfile + copy include
${CMAKE_COMMAND} -E copy ${LIBDIR}/jpg/lib/jpeg-static.lib ${HARVEST_TARGET}/jpeg/lib/libjpeg.lib &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/jpg/include/ ${HARVEST_TARGET}/jpeg/include/ &&
${CMAKE_COMMAND} -E copy ${LIBDIR}/jpeg/lib/jpeg-static.lib ${HARVEST_TARGET}/jpeg/lib/libjpeg.lib &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/jpeg/include/ ${HARVEST_TARGET}/jpeg/include/ &&
# png
${CMAKE_COMMAND} -E copy ${LIBDIR}/png/lib/libpng16_static.lib ${HARVEST_TARGET}/png/lib/libpng.lib &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/png/include/ ${HARVEST_TARGET}/png/include/ &&
@@ -67,6 +67,8 @@ harvest(brotli/include brotli/include "*.h")
harvest(brotli/lib brotli/lib "*.a")
harvest(boost/include boost/include "*")
harvest(boost/lib boost/lib "*.a")
harvest(imath/include imath/include "*.h")
harvest(imath/lib imath/lib "*.a")
harvest(ffmpeg/include ffmpeg/include "*.h")
harvest(ffmpeg/lib ffmpeg/lib "*.a")
harvest(fftw3/include fftw3/include "*.h")
@@ -80,9 +82,13 @@ harvest(gmp/include gmp/include "*.h")
harvest(gmp/lib gmp/lib "*.a")
harvest(jemalloc/include jemalloc/include "*.h")
harvest(jemalloc/lib jemalloc/lib "*.a")
harvest(jpg/include jpeg/include "*.h")
harvest(jpg/lib jpeg/lib "libjpeg.a")
harvest(jpeg/include jpeg/include "*.h")
harvest(jpeg/lib jpeg/lib "libjpeg.a")
harvest(lame/lib ffmpeg/lib "*.a")
if(NOT APPLE)
harvest(level-zero/include/level_zero level-zero/include/level_zero "*.h")
harvest(level-zero/lib level-zero/lib "*.a")
endif()
harvest(llvm/bin llvm/bin "clang-format")
if(BUILD_CLANG_TOOLS)
harvest(llvm/bin llvm/bin "clang-tidy")
@@ -135,7 +141,7 @@ harvest(openimagedenoise/include openimagedenoise/include "*")
harvest(openimagedenoise/lib openimagedenoise/lib "*.a")
harvest(embree/include embree/include "*.h")
harvest(embree/lib embree/lib "*.a")
harvest(openjpeg/include/openjpeg-2.3 openjpeg/include "*.h")
harvest(openjpeg/include/openjpeg-${OPENJPEG_SHORT_VERSION} openjpeg/include "*.h")
harvest(openjpeg/lib openjpeg/lib "*.a")
harvest(opensubdiv/include opensubdiv/include "*.h")
harvest(opensubdiv/lib opensubdiv/lib "*.a")
@@ -169,9 +175,10 @@ harvest(tiff/lib tiff/lib "*.a")
harvest(vorbis/lib ffmpeg/lib "*.a")
harvest(opus/lib ffmpeg/lib "*.a")
harvest(vpx/lib ffmpeg/lib "*.a")
harvest(webp/lib ffmpeg/lib "*.a")
harvest(x264/lib ffmpeg/lib "*.a")
harvest(xvidcore/lib ffmpeg/lib "*.a")
harvest(webp/lib webp/lib "*.a")
harvest(webp/include webp/include "*.h")
harvest(usd/include usd/include "*.h")
harvest(usd/lib/usd usd/lib/usd "*")
harvest(usd/plugin usd/plugin "*")

View File

@@ -0,0 +1,24 @@
# SPDX-License-Identifier: GPL-2.0-or-later
set(IMATH_EXTRA_ARGS
-DBUILD_SHARED_LIBS=OFF
-DBUILD_TESTING=OFF
-DIMATH_LIB_SUFFIX=${OPENEXR_VERSION_BUILD_POSTFIX}
)
ExternalProject_Add(external_imath
URL file://${PACKAGE_DIR}/${IMATH_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${IMATH_HASH_TYPE}=${IMATH_HASH}
PREFIX ${BUILD_DIR}/imath
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/imath ${DEFAULT_CMAKE_FLAGS} ${IMATH_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/imath
)
if(WIN32)
ExternalProject_Add_Step(external_imath after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/imath/lib ${HARVEST_TARGET}/imath/lib
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/imath/include ${HARVEST_TARGET}/imath/include
DEPENDEES install
)
endif()

View File

@@ -2,44 +2,52 @@
if(WIN32)
# cmake for windows
set(JPEG_EXTRA_ARGS -DNASM=${NASM_PATH} -DWITH_JPEG8=ON -DCMAKE_DEBUG_POSTFIX=d -DWITH_CRT_DLL=On)
set(JPEG_EXTRA_ARGS
-DNASM=${NASM_PATH}
-DWITH_JPEG8=ON
-DCMAKE_DEBUG_POSTFIX=d
-DWITH_CRT_DLL=On
-DENABLE_SHARED=OFF
-DENABLE_STATIC=ON
)
ExternalProject_Add(external_jpeg
URL file://${PACKAGE_DIR}/${JPEG_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${JPEG_HASH_TYPE}=${JPEG_HASH}
PREFIX ${BUILD_DIR}/jpg
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/jpg ${DEFAULT_CMAKE_FLAGS} ${JPEG_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/jpg
PREFIX ${BUILD_DIR}/jpeg
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/jpeg ${DEFAULT_CMAKE_FLAGS} ${JPEG_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/jpeg
)
if(BUILD_MODE STREQUAL Debug)
ExternalProject_Add_Step(external_jpeg after_install
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/jpg/lib/jpegd${LIBEXT} ${LIBDIR}/jpg/lib/jpeg${LIBEXT}
DEPENDEES install
)
endif()
if(BUILD_MODE STREQUAL Release)
set(JPEG_LIBRARY jpeg-static${LIBEXT})
else()
set(JPEG_LIBRARY jpeg-staticd${LIBEXT})
endif()
if(BUILD_MODE STREQUAL Release)
ExternalProject_Add_Step(external_jpeg after_install
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/jpeg/lib/${JPEG_LIBRARY} ${LIBDIR}/jpeg/lib/jpeg${LIBEXT}
DEPENDEES install
)
endif()
else(WIN32)
# cmake for unix
set(JPEG_EXTRA_ARGS
-DWITH_JPEG8=ON
-DENABLE_STATIC=ON
-DENABLE_SHARED=OFF
-DCMAKE_INSTALL_LIBDIR=${LIBDIR}/jpg/lib)
-DCMAKE_INSTALL_LIBDIR=${LIBDIR}/jpeg/lib)
ExternalProject_Add(external_jpeg
URL file://${PACKAGE_DIR}/${JPEG_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${JPEG_HASH_TYPE}=${JPEG_HASH}
PREFIX ${BUILD_DIR}/jpg
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/jpg ${DEFAULT_CMAKE_FLAGS} ${JPEG_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/jpg
PREFIX ${BUILD_DIR}/jpeg
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/jpeg ${DEFAULT_CMAKE_FLAGS} ${JPEG_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/jpeg
)
set(JPEG_LIBRARY libjpeg${LIBEXT})

View File

@@ -0,0 +1,21 @@
# SPDX-License-Identifier: GPL-2.0-or-later
set(LEVEL_ZERO_EXTRA_ARGS
)
ExternalProject_Add(external_level-zero
URL file://${PACKAGE_DIR}/${LEVEL_ZERO_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${LEVEL_ZERO_HASH_TYPE}=${LEVEL_ZERO_HASH}
PREFIX ${BUILD_DIR}/level-zero
PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/level-zero/src/external_level-zero < ${PATCH_DIR}/level-zero.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/level-zero ${DEFAULT_CMAKE_FLAGS} ${LEVEL_ZERO_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/level-zero
)
if(BUILD_MODE STREQUAL Release AND WIN32)
ExternalProject_Add_Step(external_level-zero after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/level-zero ${HARVEST_TARGET}/level-zero
DEPENDEES install
)
endif()

View File

@@ -1,39 +0,0 @@
# SPDX-License-Identifier: GPL-2.0-or-later
set(NANOVDB_EXTRA_ARGS
# NanoVDB is header-only, so only need the install target
-DNANOVDB_BUILD_UNITTESTS=OFF
-DNANOVDB_BUILD_EXAMPLES=OFF
-DNANOVDB_BUILD_BENCHMARK=OFF
-DNANOVDB_BUILD_DOCS=OFF
-DNANOVDB_BUILD_TOOLS=OFF
-DNANOVDB_CUDA_KEEP_PTX=OFF
# Do not need to include any of the dependencies because of this
-DNANOVDB_USE_OPENVDB=OFF
-DNANOVDB_USE_OPENGL=OFF
-DNANOVDB_USE_OPENCL=OFF
-DNANOVDB_USE_CUDA=OFF
-DNANOVDB_USE_TBB=OFF
-DNANOVDB_USE_BLOSC=OFF
-DNANOVDB_USE_ZLIB=OFF
-DNANOVDB_USE_OPTIX=OFF
-DNANOVDB_ALLOW_FETCHCONTENT=OFF
)
ExternalProject_Add(nanovdb
URL file://${PACKAGE_DIR}/${NANOVDB_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${NANOVDB_HASH_TYPE}=${NANOVDB_HASH}
PREFIX ${BUILD_DIR}/nanovdb
SOURCE_SUBDIR nanovdb
PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/nanovdb/src/nanovdb < ${PATCH_DIR}/nanovdb.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/nanovdb ${DEFAULT_CMAKE_FLAGS} ${NANOVDB_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/nanovdb
)
if(WIN32)
ExternalProject_Add_Step(nanovdb after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/nanovdb/nanovdb ${HARVEST_TARGET}/nanovdb/include/nanovdb
DEPENDEES install
)
endif()

View File

@@ -11,13 +11,12 @@ set(OPENCOLORIO_EXTRA_ARGS
-DOCIO_BUILD_GPU_TESTS=OFF
-DOCIO_USE_SSE=ON
# Manually build ext packages except for pystring, which does not have
# a CMake or autotools build system that we can easily use.
-DOCIO_INSTALL_EXT_PACKAGES=MISSING
-DHalf_ROOT=${LIBDIR}/openexr
-DHalf_STATIC_LIBRARY=ON
-DOCIO_INSTALL_EXT_PACKAGES=NONE
-Dexpat_ROOT=${LIBDIR}/expat
-Dyaml-cpp_ROOT=${LIBDIR}/yamlcpp
-Dpystring_ROOT=${LIBDIR}/pystring
-DImath_ROOT=${LIBDIR}/imath
)
if(BLENDER_PLATFORM_ARM)
@@ -30,7 +29,9 @@ endif()
if(WIN32)
set(OPENCOLORIO_EXTRA_ARGS
${OPENCOLORIO_EXTRA_ARGS}
-DOCIO_INLINES_HIDDEN=OFF
-Dexpat_LIBRARY=${LIBDIR}/expat/lib/libexpatMD
-Dyaml-cpp_LIBRARY=${LIBDIR}/expat/lib/libyaml-cppmd.lib
-DImath_LIBRARY=${LIBDIR}/imath/lib/imath${OPENEXR_VERSION_POSTFIX}
)
else()
set(OPENCOLORIO_EXTRA_ARGS
@@ -62,7 +63,7 @@ if(WIN32)
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/opencolorio/lib ${HARVEST_TARGET}/opencolorio/lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/yamlcpp/lib/libyaml-cppmd.lib ${HARVEST_TARGET}/opencolorio/lib/libyaml-cpp.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/expat/lib/libexpatMD.lib ${HARVEST_TARGET}/opencolorio/lib/libexpatMD.lib
COMMAND ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/opencolorio/src/external_opencolorio-build/ext/dist/lib/pystring.lib ${HARVEST_TARGET}/opencolorio/lib/pystring.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/pystring/lib/pystring.lib ${HARVEST_TARGET}/opencolorio/lib/pystring.lib
DEPENDEES install
)
endif()
@@ -71,7 +72,7 @@ if(WIN32)
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/opencolorio/lib/Opencolorio.lib ${HARVEST_TARGET}/opencolorio/lib/OpencolorIO_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/yamlcpp/lib/libyaml-cppmdd.lib ${HARVEST_TARGET}/opencolorio/lib/libyaml-cpp_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/expat/lib/libexpatdMD.lib ${HARVEST_TARGET}/opencolorio/lib/libexpatdMD.lib
COMMAND ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/opencolorio/src/external_opencolorio-build/ext/dist/lib/pystring.lib ${HARVEST_TARGET}/opencolorio/lib/pystring_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/pystring/lib/pystring.lib ${HARVEST_TARGET}/opencolorio/lib/pystring_d.lib
DEPENDEES install
)
endif()
@@ -79,7 +80,7 @@ else()
ExternalProject_Add_Step(external_opencolorio after_install
COMMAND cp ${LIBDIR}/yamlcpp/lib/libyaml-cpp.a ${LIBDIR}/opencolorio/lib/
COMMAND cp ${LIBDIR}/expat/lib/libexpat.a ${LIBDIR}/opencolorio/lib/
COMMAND cp ${BUILD_DIR}/opencolorio/src/external_opencolorio-build/ext/dist/lib/libpystring.a ${LIBDIR}/opencolorio/lib/
COMMAND cp ${LIBDIR}/pystring/lib/libpystring.a ${LIBDIR}/opencolorio/lib/
DEPENDEES install
)
endif()

View File

@@ -16,12 +16,10 @@ set(OPENEXR_EXTRA_ARGS
-DZLIB_INCLUDE_DIR=${LIBDIR}/zlib/include/
-DBUILD_TESTING=OFF
-DOPENEXR_BUILD_BOTH_STATIC_SHARED=OFF
-DILMBASE_BUILD_BOTH_STATIC_SHARED=OFF
-DBUILD_SHARED_LIBS=OFF
-DOPENEXR_BUILD_UTILS=OFF
-DPYILMBASE_ENABLE=OFF
-DOPENEXR_VIEWERS_ENABLE=OFF
-DILMBASE_LIB_SUFFIX=${OPENEXR_VERSION_BUILD_POSTFIX}
-DOPENEXR_INSTALL_TOOLS=OFF
-DOPENEXR_INSTALL_EXAMPLES=OFF
-DImath_DIR=${LIBDIR}/imath/lib/cmake/Imath
-DOPENEXR_LIB_SUFFIX=${OPENEXR_VERSION_BUILD_POSTFIX}
)

View File

@@ -8,6 +8,7 @@ set(OIDN_EXTRA_ARGS
-DOIDN_STATIC_LIB=ON
-DOIDN_STATIC_RUNTIME=OFF
-DISPC_EXECUTABLE=${LIBDIR}/ispc/bin/ispc
-DOIDN_FILTER_RTLIGHTMAP=OFF
)
if(WIN32)

View File

@@ -23,35 +23,20 @@ else()
set(OIIO_SIMD_FLAGS)
endif()
if(WITH_WEBP)
set(WEBP_ARGS
-DWEBP_INCLUDE_DIR=${LIBDIR}/webp/include
-DWEBP_LIBRARY=${LIBDIR}/webp/lib/${LIBPREFIX}webp${LIBEXT}
)
set(WEBP_DEP external_webp)
endif()
if(MSVC)
set(OPENJPEG_FLAGS
-DOpenJpeg_ROOT=${LIBDIR}/openjpeg_msvc
-DOpenJPEG_ROOT=${LIBDIR}/openjpeg_msvc
)
else()
set(OPENJPEG_FLAGS
-DOpenJpeg_ROOT=${LIBDIR}/openjpeg
-DOpenJPEG_ROOT=${LIBDIR}/openjpeg
)
endif()
set(OPENIMAGEIO_EXTRA_ARGS
-DBUILD_SHARED_LIBS=OFF
${OPENIMAGEIO_LINKSTATIC}
-DBoost_COMPILER:STRING=${BOOST_COMPILER_STRING}
-DBoost_USE_MULTITHREADED=ON
-DBoost_USE_STATIC_LIBS=ON
-DBoost_USE_STATIC_RUNTIME=OFF
-DBOOST_ROOT=${LIBDIR}/boost
-DBOOST_LIBRARYDIR=${LIBDIR}/boost/lib/
-DBoost_NO_SYSTEM_PATHS=ON
-DBoost_NO_BOOST_CMAKE=ON
${DEFAULT_BOOST_FLAGS}
-DUSE_LIBSQUISH=OFF
-DUSE_QT5=OFF
-DUSE_NUKE=OFF
@@ -62,7 +47,6 @@ set(OPENIMAGEIO_EXTRA_ARGS
-DUSE_LIBHEIF=OFF
-DUSE_OPENGL=OFF
-DUSE_TBB=OFF
-DUSE_FIELD3D=OFF
-DUSE_QT=OFF
-DUSE_PYTHON=OFF
-DUSE_GIF=OFF
@@ -73,7 +57,7 @@ set(OPENIMAGEIO_EXTRA_ARGS
-DUSE_FREETYPE=OFF
-DUSE_LIBRAW=OFF
-DUSE_OPENCOLORIO=OFF
-DUSE_WEBP=${WITH_WEBP}
-DUSE_WEBP=ON
-DOIIO_BUILD_TOOLS=${OIIO_TOOLS}
-DOIIO_BUILD_TESTS=OFF
-DBUILD_TESTING=OFF
@@ -83,14 +67,9 @@ set(OPENIMAGEIO_EXTRA_ARGS
-DPNG_PNG_INCLUDE_DIR=${LIBDIR}/png/include
-DTIFF_LIBRARY=${LIBDIR}/tiff/lib/${LIBPREFIX}tiff${LIBEXT}
-DTIFF_INCLUDE_DIR=${LIBDIR}/tiff/include
-DJPEG_LIBRARY=${LIBDIR}/jpg/lib/${JPEG_LIBRARY}
-DJPEG_INCLUDE_DIR=${LIBDIR}/jpg/include
-DJPEG_LIBRARY=${LIBDIR}/jpeg/lib/${JPEG_LIBRARY}
-DJPEG_INCLUDE_DIR=${LIBDIR}/jpeg/include
${OPENJPEG_FLAGS}
-DOpenEXR_USE_STATIC_LIBS=On
-DILMBASE_INCLUDE_DIR=${LIBDIR}/openexr/include/
-DOPENEXR_INCLUDE_DIR=${LIBDIR}/openexr/include/
-DOPENEXR_HALF_LIBRARY=${LIBDIR}/openexr/lib/${LIBPREFIX}Half${OPENEXR_VERSION_POSTFIX}${LIBEXT}
-DOPENEXR_IMATH_LIBRARY=${LIBDIR}/openexr/lib/${LIBPREFIX}Imath${OPENEXR_VERSION_POSTFIX}${LIBEXT}
-DOPENEXR_ILMTHREAD_LIBRARY=${LIBDIR}/openexr/lib/${LIBPREFIX}IlmThread${OPENEXR_VERSION_POSTFIX}${LIBEXT}
-DOPENEXR_IEX_LIBRARY=${LIBDIR}/openexr/lib/${LIBPREFIX}Iex${OPENEXR_VERSION_POSTFIX}${LIBEXT}
-DOPENEXR_ILMIMF_LIBRARY=${LIBDIR}/openexr/lib/${LIBPREFIX}IlmImf${OPENEXR_VERSION_POSTFIX}${LIBEXT}
@@ -98,8 +77,14 @@ set(OPENIMAGEIO_EXTRA_ARGS
-DUSE_EXTERNAL_PUGIXML=ON
-DPUGIXML_LIBRARY=${LIBDIR}/pugixml/lib/${LIBPREFIX}pugixml${LIBEXT}
-DPUGIXML_INCLUDE_DIR=${LIBDIR}/pugixml/include/
${WEBP_FLAGS}
-DBUILD_MISSING_ROBINMAP=OFF
-DBUILD_MISSING_FMT=OFF
-DFMT_INCLUDE_DIR=${LIBDIR}/fmt/include/
-DRobinmap_ROOT=${LIBDIR}/robinmap
-DWebP_ROOT=${LIBDIR}/webp
${OIIO_SIMD_FLAGS}
-DOpenEXR_ROOT=${LIBDIR}/openexr
-DImath_ROOT=${LIBDIR}/imath
)
ExternalProject_Add(external_openimageio
@@ -117,12 +102,15 @@ add_dependencies(
external_png
external_zlib
external_openexr
external_imath
external_jpeg
external_boost
external_tiff
external_pugixml
external_fmt
external_robinmap
external_openjpeg${OPENJPEG_POSTFIX}
${WEBP_DEP}
external_webp
)
if(WIN32)
@@ -137,8 +125,8 @@ if(WIN32)
endif()
if(BUILD_MODE STREQUAL Debug)
ExternalProject_Add_Step(external_openimageio after_install
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openimageio/lib/OpenImageIO.lib ${HARVEST_TARGET}/openimageio/lib/OpenImageIO_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openimageio/lib/OpenImageIO_Util.lib ${HARVEST_TARGET}/openimageio/lib/OpenImageIO_Util_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openimageio/lib/OpenImageIO_d.lib ${HARVEST_TARGET}/openimageio/lib/OpenImageIO_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openimageio/lib/OpenImageIO_Util_d.lib ${HARVEST_TARGET}/openimageio/lib/OpenImageIO_Util_d.lib
DEPENDEES install
)
endif()

View File

@@ -3,20 +3,24 @@
# Note the encoder/decoder may use png/tiff/lcms system libraries, but the
# library itself does not depend on them, so should give no problems.
set(OPENJPEG_EXTRA_ARGS -DBUILD_SHARED_LIBS=OFF)
if(WIN32)
set(OPENJPEG_EXTRA_ARGS -G "MSYS Makefiles" -DBUILD_PKGCONFIG_FILES=On)
else()
set(OPENJPEG_EXTRA_ARGS ${DEFAULT_CMAKE_FLAGS})
endif()
set(OPENJPEG_EXTRA_ARGS
${OPENJPEG_EXTRA_ARGS}
-DBUILD_SHARED_LIBS=OFF
-DBUILD_CODEC=OFF
)
ExternalProject_Add(external_openjpeg
URL file://${PACKAGE_DIR}/${OPENJPEG_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${OPENJPEG_HASH_TYPE}=${OPENJPEG_HASH}
PREFIX ${BUILD_DIR}/openjpeg
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/openjpeg/src/external_openjpeg-build && ${CMAKE_COMMAND} ${OPENJPEG_EXTRA_ARGS} -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openjpeg -DBUILD_SHARED_LIBS=Off -DBUILD_THIRDPARTY=OFF ${BUILD_DIR}/openjpeg/src/external_openjpeg
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/openjpeg/src/external_openjpeg-build && ${CMAKE_COMMAND} ${OPENJPEG_EXTRA_ARGS} -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openjpeg ${BUILD_DIR}/openjpeg/src/external_openjpeg
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/openjpeg/src/external_openjpeg-build/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/openjpeg/src/external_openjpeg-build/ && make install
INSTALL_DIR ${LIBDIR}/openjpeg

View File

@@ -1,15 +1,25 @@
# SPDX-License-Identifier: GPL-2.0-or-later
set(OPENSUBDIV_EXTRA_ARGS
-DNO_LIB=OFF
-DNO_EXAMPLES=ON
-DNO_TUTORIALS=ON
-DNO_REGRESSION=ON
-DNO_PYTHON=ON
-DNO_MAYA=ON
-DNO_PTEX=ON
-DNO_DOC=ON
-DNO_CLEW=OFF
-DNO_OMP=ON
-DNO_TBB=OFF
-DNO_CUDA=ON
-DNO_OPENCL=OFF
-DNO_TUTORIALS=ON
-DNO_CLEW=OFF
-DNO_OPENGL=OFF
-DNO_METAL=OFF
-DNO_DX=ON
-DNO_TESTS=ON
-DNO_GLTESTS=ON
-DNO_GLEW=OFF
-DNO_GLFW=OFF
-DNO_GLFW_X11=ON
-DGLEW_INCLUDE_DIR=${LIBDIR}/glew/include
-DGLEW_LIBRARY=${LIBDIR}/glew/lib/libGLEW${LIBEXT}
-DGLFW_INCLUDE_DIR=${LIBDIR}/glfw/include
@@ -26,22 +36,11 @@ if(WIN32)
-DCUEW_INCLUDE_DIR=${LIBDIR}/cuew/include
-DCUEW_LIBRARY=${LIBDIR}/cuew/lib/cuew${LIBEXT}
)
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
set(OPENSUBDIV_EXTRA_ARGS
${OPENSUBDIV_EXTRA_ARGS}
-DNO_CUDA=OFF
)
else()
set(OPENSUBDIV_EXTRA_ARGS
${OPENSUBDIV_EXTRA_ARGS}
-DNO_CUDA=ON
)
endif()
else()
set(OPENSUBDIV_EXTRA_ARGS
${OPENSUBDIV_EXTRA_ARGS}
-DNO_CUDA=ON
-DTBB_INCLUDE_DIR=${LIBDIR}/tbb/include
-DTBB_tbb_LIBRARY=${LIBDIR}/tbb/lib/${LIBPREFIX}tbb_static${LIBEXT}
-DCUEW_INCLUDE_DIR=${LIBDIR}/cuew/include
-DCLEW_INCLUDE_DIR=${LIBDIR}/clew/include/CL
-DCLEW_LIBRARY=${LIBDIR}/clew/lib/static/${LIBPREFIX}clew${LIBEXT}

View File

@@ -13,6 +13,7 @@ else()
endif()
set(OPENVDB_EXTRA_ARGS
${DEFAULT_BOOST_FLAGS}
-DBoost_COMPILER:STRING=${BOOST_COMPILER_STRING}
-DBoost_USE_MULTITHREADED=ON
-DBoost_USE_STATIC_LIBS=ON
@@ -24,22 +25,20 @@ set(OPENVDB_EXTRA_ARGS
-DZLIB_INCLUDE_DIR=${LIBDIR}/zlib/include/
-DBlosc_INCLUDE_DIR=${LIBDIR}/blosc/include/
-DBlosc_LIBRARY=${LIBDIR}/blosc/lib/libblosc${BLOSC_POST}${LIBEXT}
-DOPENVDB_ENABLE_3_ABI_COMPATIBLE=OFF
-DOPENVDB_BUILD_UNITTESTS=Off
-DOPENVDB_BUILD_PYTHON_MODULE=Off
-DBlosc_LIBRARY_RELEASE=${LIBDIR}/blosc/lib/libblosc${BLOSC_POST}${LIBEXT}
-DBlosc_LIBRARY_DEBUG=${LIBDIR}/blosc/lib/libblosc${BLOSC_POST}${LIBEXT}
-DOPENVDB_BUILD_UNITTESTS=OFF
-DOPENVDB_BUILD_PYTHON_MODULE=OFF
-DOPENVDB_BUILD_NANOVDB=ON
-DNANOVDB_BUILD_TOOLS=OFF
-DBlosc_ROOT=${LIBDIR}/blosc/
-DTBB_ROOT=${LIBDIR}/tbb/
-DOpenEXR_ROOT=${LIBDIR}/openexr
-DIlmBase_ROOT=${LIBDIR}/openexr
-DOPENEXR_LIBRARYDIR=${LIBDIR}/openexr/lib
# All libs live in openexr, even the ilmbase ones
-DILMBASE_LIBRARYDIR=${LIBDIR}/openexr/lib
-DOPENVDB_CORE_SHARED=${OPENVDB_SHARED}
-DOPENVDB_CORE_STATIC=${OPENVDB_STATIC}
-DOPENVDB_BUILD_BINARIES=Off
-DOPENVDB_BUILD_BINARIES=OFF
-DCMAKE_DEBUG_POSTFIX=_d
-DILMBASE_USE_STATIC_LIBS=On
-DOPENEXR_USE_STATIC_LIBS=On
-DBLOSC_USE_STATIC_LIBS=ON
-DUSE_NANOVDB=ON
)
if(WIN32)
@@ -48,15 +47,6 @@ if(WIN32)
# needs to link pthreads due to it being a blosc dependency
set(OPENVDB_EXTRA_ARGS ${OPENVDB_EXTRA_ARGS}
-DCMAKE_CXX_STANDARD_LIBRARIES="${LIBDIR}/pthreads/lib/pthreadVC3.lib"
-DUSE_EXR=On
)
else()
# OpenVDB can't find the _static libraries automatically.
set(OPENVDB_EXTRA_ARGS ${OPENVDB_EXTRA_ARGS}
-DTbb_LIBRARIES=${LIBDIR}/tbb/lib/${LIBPREFIX}tbb_static${LIBEXT}
-DTbb_tbb_LIBRARY=${LIBDIR}/tbb/lib/${LIBPREFIX}tbb_static${LIBEXT}
-DTbb_tbbmalloc_LIBRARY=${LIBDIR}/tbb/lib/${LIBPREFIX}tbbmalloc_static${LIBEXT}
-DTbb_tbbmalloc_proxy_LIBRARY=${LIBDIR}/tbb/lib/${LIBPREFIX}tbbmalloc_proxy_static${LIBEXT}
)
endif()
@@ -74,7 +64,6 @@ add_dependencies(
openvdb
external_tbb
external_boost
external_openexr
external_zlib
external_blosc
)
@@ -82,7 +71,7 @@ add_dependencies(
if(WIN32)
if(BUILD_MODE STREQUAL Release)
ExternalProject_Add_Step(openvdb after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/openvdb/include/openvdb ${HARVEST_TARGET}/openvdb/include/openvdb
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/openvdb/include ${HARVEST_TARGET}/openvdb/include
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openvdb/lib/openvdb.lib ${HARVEST_TARGET}/openvdb/lib/openvdb.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openvdb/bin/openvdb.dll ${HARVEST_TARGET}/openvdb/bin/openvdb.dll
DEPENDEES install

View File

@@ -3,7 +3,6 @@
if(WIN32)
option(ENABLE_MINGW64 "Enable building of ffmpeg/iconv/libsndfile/fftw3 by installing mingw64" ON)
endif()
option(WITH_WEBP "Enable building of oiio with webp support" OFF)
option(WITH_BOOST_PYTHON "Enable building of boost with python support" OFF)
cmake_host_system_information(RESULT NUM_CORES QUERY NUMBER_OF_LOGICAL_CORES)
set(MAKE_THREADS ${NUM_CORES} CACHE STRING "Number of threads to run make with")
@@ -42,29 +41,29 @@ if(WIN32)
set(LIBPREFIX "")
# For OIIO and OSL
set(COMMON_DEFINES /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS)
set(COMMON_DEFINES /DPSAPI_VERSION=2 /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()
string(APPEND COMMON_MSVC_FLAGS " /bigobj")
if(WITH_OPTIMIZED_DEBUG)
set(BLENDER_CMAKE_C_FLAGS_DEBUG "/MDd ${COMMON_MSVC_FLAGS} /O2 /Ob2 /DNDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(BLENDER_CMAKE_C_FLAGS_DEBUG "/MDd ${COMMON_MSVC_FLAGS} /O2 /Ob2 /DNDEBUG /DPSAPI_VERSION=2 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
else()
set(BLENDER_CMAKE_C_FLAGS_DEBUG "/MDd ${COMMON_MSVC_FLAGS} /Zi /Ob0 /Od /RTC1 /D_DEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(BLENDER_CMAKE_C_FLAGS_DEBUG "/MDd ${COMMON_MSVC_FLAGS} /Zi /Ob0 /Od /RTC1 /D_DEBUG /DPSAPI_VERSION=2 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
endif()
set(BLENDER_CMAKE_C_FLAGS_MINSIZEREL "/MD ${COMMON_MSVC_FLAGS} /O1 /Ob1 /D NDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(BLENDER_CMAKE_C_FLAGS_RELEASE "/MD ${COMMON_MSVC_FLAGS} /O2 /Ob2 /DNDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(BLENDER_CMAKE_C_FLAGS_RELWITHDEBINFO "/MD ${COMMON_MSVC_FLAGS} /Zi /O2 /Ob1 /D NDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(BLENDER_CMAKE_C_FLAGS_MINSIZEREL "/MD ${COMMON_MSVC_FLAGS} /O1 /Ob1 /D NDEBUG /DPSAPI_VERSION=2 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(BLENDER_CMAKE_C_FLAGS_RELEASE "/MD ${COMMON_MSVC_FLAGS} /O2 /Ob2 /DNDEBUG /DPSAPI_VERSION=2 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(BLENDER_CMAKE_C_FLAGS_RELWITHDEBINFO "/MD ${COMMON_MSVC_FLAGS} /Zi /O2 /Ob1 /D NDEBUG /DPSAPI_VERSION=2 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
if(WITH_OPTIMIZED_DEBUG)
set(BLENDER_CMAKE_CXX_FLAGS_DEBUG "/MDd ${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_DEBUG "/MDd ${COMMON_MSVC_FLAGS} /O2 /Ob2 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=2 /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")
set(BLENDER_CMAKE_CXX_FLAGS_DEBUG "/D_DEBUG /D PLATFORM_WINDOWS /MTd ${COMMON_MSVC_FLAGS} /Zi /Ob0 /Od /RTC1 /DPSAPI_VERSION=2 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
endif()
set(BLENDER_CMAKE_CXX_FLAGS_MINSIZEREL "/MD /${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 "/MD ${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 "/MD ${COMMON_MSVC_FLAGS} /Zi /O2 /Ob1 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(BLENDER_CMAKE_CXX_FLAGS_MINSIZEREL "/MD /${COMMON_MSVC_FLAGS} /O1 /Ob1 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=2 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(BLENDER_CMAKE_CXX_FLAGS_RELEASE "/MD ${COMMON_MSVC_FLAGS} /O2 /Ob2 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=2 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(BLENDER_CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MD ${COMMON_MSVC_FLAGS} /Zi /O2 /Ob1 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=2 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(PLATFORM_FLAGS)
set(PLATFORM_CXX_FLAGS)

View File

@@ -3,33 +3,15 @@
if(WIN32)
set(OSL_CMAKE_CXX_STANDARD_LIBRARIES "kernel32${LIBEXT} user32${LIBEXT} gdi32${LIBEXT} winspool${LIBEXT} shell32${LIBEXT} ole32${LIBEXT} oleaut32${LIBEXT} uuid${LIBEXT} comdlg32${LIBEXT} advapi32${LIBEXT} psapi${LIBEXT}")
set(OSL_FLEX_BISON -DFLEX_EXECUTABLE=${LIBDIR}/flexbison/win_flex.exe -DBISON_EXECUTABLE=${LIBDIR}/flexbison/win_bison.exe)
set(OSL_SIMD_FLAGS -DOIIO_NOSIMD=1 -DOIIO_SIMD=sse2)
else()
set(OSL_CMAKE_CXX_STANDARD_LIBRARIES)
set(OSL_FLEX_BISON)
set(OSL_OPENIMAGEIO_LIBRARY "${LIBDIR}/openimageio/lib/${LIBPREFIX}OpenImageIO${LIBEXT};${LIBDIR}/openimageio/lib/${LIBPREFIX}OpenImageIO_Util${LIBEXT};${LIBDIR}/png/lib/${LIBPREFIX}png16${LIBEXT};${LIBDIR}/jpg/lib/${LIBPREFIX}jpeg${LIBEXT};${LIBDIR}/tiff/lib/${LIBPREFIX}tiff${LIBEXT};${LIBDIR}/openexr/lib/${LIBPREFIX}IlmImf${OPENEXR_VERSION_POSTFIX}${LIBEXT}")
set(OSL_OPENIMAGEIO_LIBRARY "${LIBDIR}/openimageio/lib/${LIBPREFIX}OpenImageIO${LIBEXT};${LIBDIR}/openimageio/lib/${LIBPREFIX}OpenImageIO_Util${LIBEXT};${LIBDIR}/png/lib/${LIBPREFIX}png16${LIBEXT};${LIBDIR}/jpeg/lib/${LIBPREFIX}jpeg${LIBEXT};${LIBDIR}/tiff/lib/${LIBPREFIX}tiff${LIBEXT};${LIBDIR}/openexr/lib/${LIBPREFIX}IlmImf${OPENEXR_VERSION_POSTFIX}${LIBEXT}")
endif()
set(OSL_ILMBASE_CUSTOM_LIBRARIES "${LIBDIR}/openexr/lib/Imath${OPENEXR_VERSION_POSTFIX}.lib^^${LIBDIR}/openexr/lib/Half{OPENEXR_VERSION_POSTFIX}.lib^^${LIBDIR}/openexr/lib/IlmThread${OPENEXR_VERSION_POSTFIX}.lib^^${LIBDIR}/openexr/lib/Iex${OPENEXR_VERSION_POSTFIX}.lib")
set(OSL_EXTRA_ARGS
-DBoost_COMPILER:STRING=${BOOST_COMPILER_STRING}
-DBoost_USE_MULTITHREADED=ON
-DBoost_USE_STATIC_LIBS=ON
-DBoost_USE_STATIC_RUNTIME=OFF
-DBOOST_ROOT=${LIBDIR}/boost
-DBOOST_LIBRARYDIR=${LIBDIR}/boost/lib/
-DBoost_NO_SYSTEM_PATHS=ON
-DBoost_NO_BOOST_CMAKE=ON
${DEFAULT_BOOST_FLAGS}
-DOpenEXR_ROOT=${LIBDIR}/openexr/
-DIlmBase_ROOT=${LIBDIR}/openexr/
-DILMBASE_INCLUDE_DIR=${LIBDIR}/openexr/include/
-DOPENEXR_HALF_LIBRARY=${LIBDIR}/openexr/lib/${LIBPREFIX}Half${OPENEXR_VERSION_POSTFIX}${LIBEXT}
-DOPENEXR_IMATH_LIBRARY=${LIBDIR}/openexr/lib/${LIBPREFIX}Imath${OPENEXR_VERSION_POSTFIX}${LIBEXT}
-DOPENEXR_ILMTHREAD_LIBRARY=${LIBDIR}/openexr/lib/${LIBPREFIX}IlmThread${OPENEXR_VERSION_POSTFIX}${LIBEXT}
-DOPENEXR_IEX_LIBRARY=${LIBDIR}/openexr/lib/${LIBPREFIX}Iex${OPENEXR_VERSION_POSTFIX}${LIBEXT}
-DOPENEXR_INCLUDE_DIR=${LIBDIR}/openexr/include/
-DOPENEXR_ILMIMF_LIBRARY=${LIBDIR}/openexr/lib/${LIBPREFIX}IlmImf${OPENEXR_VERSION_POSTFIX}${LIBEXT}
-DOpenImageIO_ROOT=${LIBDIR}/openimageio/
-DOSL_BUILD_TESTS=OFF
-DOSL_BUILD_MATERIALX=OFF
@@ -49,10 +31,10 @@ set(OSL_EXTRA_ARGS
-DUSE_QT=OFF
-DUSE_Qt5=OFF
-DINSTALL_DOCS=OFF
${OSL_SIMD_FLAGS}
-Dpugixml_ROOT=${LIBDIR}/pugixml
-DUSE_PYTHON=OFF
-DCMAKE_CXX_STANDARD=14
-DImath_ROOT=${LIBDIR}/imath
)
ExternalProject_Add(external_osl

View File

@@ -0,0 +1,22 @@
# SPDX-License-Identifier: GPL-2.0-or-later
set(PYSTRING_EXTRA_ARGS
)
ExternalProject_Add(external_pystring
URL file://${PACKAGE_DIR}/${PYSTRING_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${PYSTRING_HASH_TYPE}=${PYSTRING_HASH}
PREFIX ${BUILD_DIR}/pystring
PATCH_COMMAND ${CMAKE_COMMAND} -E copy ${PATCH_DIR}/cmakelists_pystring.txt ${BUILD_DIR}/pystring/src/external_pystring/CMakeLists.txt
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/pystring ${DEFAULT_CMAKE_FLAGS} ${PYSTRING_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/pystring
)
if(WIN32)
ExternalProject_Add_Step(external_pystring after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/pystring/lib ${HARVEST_TARGET}/pystring/lib
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/pystring/include ${HARVEST_TARGET}/pystring/include
DEPENDEES install
)
endif()

View File

@@ -0,0 +1,22 @@
# SPDX-License-Identifier: GPL-2.0-or-later
set(ROBINMAP_EXTRA_ARGS
)
ExternalProject_Add(external_robinmap
URL file://${PACKAGE_DIR}/${ROBINMAP_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${ROBINMAP_HASH_TYPE}=${ROBINMAP_HASH}
PREFIX ${BUILD_DIR}/robinmap
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/robinmap ${DEFAULT_CMAKE_FLAGS} ${ROBINMAP_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/robinmap
)
if(WIN32)
if(BUILD_MODE STREQUAL Release)
ExternalProject_Add_Step(external_robinmap after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/zstd/include/ ${HARVEST_TARGET}/zstd/include/
DEPENDEES install
)
endif()
endif()

View File

@@ -1,11 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
if(WITH_WEBP)
set(WITH_TIFF_WEBP ON)
else()
set(WITH_TIFF_WEBP OFF)
endif()
set(TIFF_EXTRA_ARGS
-DZLIB_LIBRARY=${LIBDIR}/zlib/lib/${ZLIB_LIBRARY}
-DZLIB_INCLUDE_DIR=${LIBDIR}/zlib/include
@@ -14,7 +8,7 @@ set(TIFF_EXTRA_ARGS
-Dlzma=OFF
-Djbig=OFF
-Dzstd=OFF
-Dwebp=${WITH_TIFF_WEBP}
-Dwebp=OFF
)
ExternalProject_Add(external_tiff

View File

@@ -1,39 +1,59 @@
# SPDX-License-Identifier: GPL-2.0-or-later
if(WIN32)
# OIIO and OSL are statically linked for us, but USD doesn't know
set(USD_CXX_FLAGS "${CMAKE_CXX_FLAGS} /DOIIO_STATIC_DEFINE /DOSL_STATIC_DEFINE")
if(BUILD_MODE STREQUAL Debug)
# USD does not look for debug libs, nor does it link them
# when building static, so this is just to keep find_package happy
# if we ever link dynamically on windows util will need to be linked as well.
set(USD_OIIO_CMAKE_DEFINES "-DOIIO_LIBRARIES=${LIBDIR}/openimageio/lib/OpenImageIO_d${LIBEXT}")
endif()
set(USD_PLATFORM_FLAGS
${USD_OIIO_CMAKE_DEFINES}
-DCMAKE_CXX_FLAGS=${USD_CXX_FLAGS}
)
endif()
set(USD_EXTRA_ARGS
-DBoost_COMPILER:STRING=${BOOST_COMPILER_STRING}
-DBoost_USE_MULTITHREADED=ON
-DBoost_USE_STATIC_LIBS=ON
-DBoost_USE_STATIC_RUNTIME=OFF
-DBOOST_ROOT=${LIBDIR}/boost
-DBoost_NO_SYSTEM_PATHS=ON
-DBoost_NO_BOOST_CMAKE=ON
${DEFAULT_BOOST_FLAGS}
${USD_PLATFORM_FLAGS}
# This is a preventative measure that avoids possible conflicts when add-ons
# try to load another USD library into the same process space.
-DPXR_SET_INTERNAL_NAMESPACE=usdBlender
-DOPENSUBDIV_ROOT_DIR=${LIBDIR}/opensubdiv
-DOpenImageIO_ROOT=${LIBDIR}/openimageio
-DOPENEXR_LIBRARIES=${LIBDIR}/imath/lib/imath${OPENEXR_VERSION_POSTFIX}${LIBEXT}
-DOPENEXR_INCLUDE_DIR=${LIBDIR}/imath/include
-DOSL_ROOT=${LIBDIR}/osl
-DPXR_ENABLE_PYTHON_SUPPORT=OFF
-DPXR_BUILD_IMAGING=ON
-DPXR_BUILD_TESTS=OFF
-DPXR_BUILD_EXAMPLES=OFF
-DPXR_BUILD_TUTORIALS=OFF
-DPXR_ENABLE_HDF5_SUPPORT=OFF
-DPXR_ENABLE_MATERIALX_SUPPORT=OFF
-DPXR_ENABLE_OPENVDB_SUPPORT=OFF
-DPYTHON_EXECUTABLE=${PYTHON_BINARY}
-DPXR_BUILD_MONOLITHIC=ON
-DPXR_ENABLE_OSL_SUPPORT=ON
-DPXR_BUILD_OPENIMAGEIO_PLUGIN=ON
# USD 22.03 does not support OCIO 2.x
# Tracking ticket https://github.com/PixarAnimationStudios/USD/issues/1386
-DPXR_BUILD_OPENCOLORIO_PLUGIN=OFF
-DPXR_ENABLE_PTEX_SUPPORT=OFF
-DPXR_BUILD_USD_TOOLS=OFF
-DCMAKE_DEBUG_POSTFIX=_d
-DBUILD_SHARED_LIBS=Off
# USD is hellbound on making a shared lib, unless you point this variable to a valid cmake file
# doesn't have to make sense, but as long as it points somewhere valid it will skip the shared lib.
-DPXR_MONOLITHIC_IMPORT=${BUILD_DIR}/usd/src/external_usd/cmake/defaults/Version.cmake
-DTBB_INCLUDE_DIRS=${LIBDIR}/tbb/include
-DTBB_LIBRARIES=${LIBDIR}/tbb/lib/${LIBPREFIX}${TBB_LIBRARY}${LIBEXT}
-DTbb_TBB_LIBRARY=${LIBDIR}/tbb/lib/${LIBPREFIX}${TBB_LIBRARY}${LIBEXT}
# USD wants the tbb debug lib set even when you are doing a release build
# Otherwise it will error out during the cmake configure phase.
-DTBB_LIBRARIES_DEBUG=${LIBDIR}/tbb/lib/${LIBPREFIX}${TBB_LIBRARY}${LIBEXT}
# This is a preventative measure that avoids possible conflicts when add-ons
# try to load another USD library into the same process space.
-DPXR_SET_INTERNAL_NAMESPACE=usdBlender
-DPXR_ENABLE_PYTHON_SUPPORT=OFF
-DPXR_BUILD_IMAGING=OFF
-DPXR_BUILD_TESTS=OFF
-DBUILD_SHARED_LIBS=OFF
-DPYTHON_EXECUTABLE=${PYTHON_BINARY}
-DPXR_BUILD_MONOLITHIC=ON
# The PXR_BUILD_USD_TOOLS argument is patched-in by usd.diff. An upstream pull request
# can be found at https://github.com/PixarAnimationStudios/USD/pull/1048.
-DPXR_BUILD_USD_TOOLS=OFF
-DCMAKE_DEBUG_POSTFIX=_d
# USD is hellbound on making a shared lib, unless you point this variable to a valid cmake file
# doesn't have to make sense, but as long as it points somewhere valid it will skip the shared lib.
-DPXR_MONOLITHIC_IMPORT=${BUILD_DIR}/usd/src/external_usd/cmake/defaults/Version.cmake
)
ExternalProject_Add(external_usd
@@ -50,37 +70,33 @@ add_dependencies(
external_usd
external_tbb
external_boost
external_openimageio
external_opensubdiv
external_osl
)
# Since USD 21.11 the libraries are prefixed with "usd_", i.e. "libusd_m.a" became "libusd_usd_m.a".
# See https://github.com/PixarAnimationStudios/USD/blob/release/CHANGELOG.md#2111---2021-11-01
if (USD_VERSION VERSION_LESS 21.11)
set(PXR_LIB_PREFIX "")
else()
set(PXR_LIB_PREFIX "usd_")
if(NOT WIN32)
if (USD_VERSION VERSION_LESS 21.11)
set(PXR_LIB_PREFIX "")
else()
set(PXR_LIB_PREFIX "usd_")
endif()
endif()
if(WIN32)
# USD currently demands python be available at build time
# and then proceeds not to use it, but still checks that the
# version of the interpreter it is not going to use is atleast 2.7
# so we need this dep currently since there is no system python
# on windows.
add_dependencies(
external_usd
external_python
)
if(BUILD_MODE STREQUAL Release)
ExternalProject_Add_Step(external_usd after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/usd/ ${HARVEST_TARGET}/usd
COMMAND ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/usd/src/external_usd-build/pxr/Release/${PXR_LIB_PREFIX}usd_m.lib ${HARVEST_TARGET}/usd/lib/lib${PXR_LIB_PREFIX}usd_m.lib
COMMAND ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/usd/src/external_usd-build/pxr/Release/usd_usd_m.lib ${HARVEST_TARGET}/usd/lib/usd_usd_m.lib
DEPENDEES install
)
endif()
if(BUILD_MODE STREQUAL Debug)
ExternalProject_Add_Step(external_usd after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/usd/lib ${HARVEST_TARGET}/usd/lib
COMMAND ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/usd/src/external_usd-build/pxr/Debug/${PXR_LIB_PREFIX}usd_m_d.lib ${HARVEST_TARGET}/usd/lib/lib${PXR_LIB_PREFIX}usd_m_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/usd/src/external_usd-build/pxr/Debug/usd_usd_m_d.lib ${HARVEST_TARGET}/usd/lib/usd_usd_m_d.lib
DEPENDEES install
)
endif()

View File

@@ -1,14 +1,14 @@
# SPDX-License-Identifier: GPL-2.0-or-later
set(ZLIB_VERSION 1.2.11)
set(ZLIB_VERSION 1.2.12)
set(ZLIB_URI https://zlib.net/zlib-${ZLIB_VERSION}.tar.gz)
set(ZLIB_HASH 1c9f62f0778697a09d36121ead88e08e)
set(ZLIB_HASH 5fc414a9726be31427b440b434d05f78)
set(ZLIB_HASH_TYPE MD5)
set(ZLIB_FILE zlib-${ZLIB_VERSION}.tar.gz)
set(OPENAL_VERSION 1.20.1)
set(OPENAL_VERSION 1.21.1)
set(OPENAL_URI http://openal-soft.org/openal-releases/openal-soft-${OPENAL_VERSION}.tar.bz2)
set(OPENAL_HASH 556695068ce8375b89986083d810fd35)
set(OPENAL_HASH a936806ebd8de417b0ffd8cf3f48f456)
set(OPENAL_HASH_TYPE MD5)
set(OPENAL_FILE openal-soft-${OPENAL_VERSION}.tar.bz2)
@@ -18,24 +18,24 @@ set(PNG_HASH 505e70834d35383537b6491e7ae8641f1a4bed1876dbfe361201fc80868d88ca)
set(PNG_HASH_TYPE SHA256)
set(PNG_FILE libpng-${PNG_VERSION}.tar.xz)
set(JPEG_VERSION 2.0.4)
set(JPEG_VERSION 2.1.3)
set(JPEG_URI https://github.com/libjpeg-turbo/libjpeg-turbo/archive/${JPEG_VERSION}.tar.gz)
set(JPEG_HASH 44c43e4a9fb352f47090804529317c88)
set(JPEG_HASH 627b980fad0573e08e4c3b80b290fc91)
set(JPEG_HASH_TYPE MD5)
set(JPEG_FILE libjpeg-turbo-${JPEG_VERSION}.tar.gz)
set(BOOST_VERSION 1.73.0)
set(BOOST_VERSION_NODOTS 1_73_0)
set(BOOST_VERSION_NODOTS_SHORT 1_73)
set(BOOST_VERSION 1.78.0)
set(BOOST_VERSION_SHORT 1.78)
set(BOOST_VERSION_NODOTS 1_78_0)
set(BOOST_VERSION_NODOTS_SHORT 1_78)
set(BOOST_URI https://boostorg.jfrog.io/artifactory/main/release/${BOOST_VERSION}/source/boost_${BOOST_VERSION_NODOTS}.tar.gz)
set(BOOST_HASH 4036cd27ef7548b8d29c30ea10956196)
set(BOOST_HASH c2f6428ac52b0e5a3c9b2e1d8cc832b5)
set(BOOST_HASH_TYPE MD5)
set(BOOST_FILE boost_${BOOST_VERSION_NODOTS}.tar.gz)
# Using old version as recommended by OpenVDB build documentation.
set(BLOSC_VERSION 1.5.0)
set(BLOSC_VERSION 1.21.1)
set(BLOSC_URI https://github.com/Blosc/c-blosc/archive/v${BLOSC_VERSION}.tar.gz)
set(BLOSC_HASH 6e4a49c8c06f05aa543f3312cfce3d55)
set(BLOSC_HASH 134b55813b1dca57019d2a2dc1f7a923)
set(BLOSC_HASH_TYPE MD5)
set(BLOSC_FILE blosc-${BLOSC_VERSION}.tar.gz)
@@ -45,12 +45,19 @@ set(PTHREADS_HASH f3bf81bb395840b3446197bcf4ecd653)
set(PTHREADS_HASH_TYPE MD5)
set(PTHREADS_FILE pthreads4w-code-${PTHREADS_VERSION}.zip)
set(OPENEXR_VERSION 2.5.5)
set(OPENEXR_VERSION 3.1.4)
set(OPENEXR_URI https://github.com/AcademySoftwareFoundation/openexr/archive/v${OPENEXR_VERSION}.tar.gz)
set(OPENEXR_HASH 85e8a979092c9055d10ed103062d31a0)
set(OPENEXR_HASH e990be1ff765797bc2d93a8060e1c1f2)
set(OPENEXR_HASH_TYPE MD5)
set(OPENEXR_FILE openexr-${OPENEXR_VERSION}.tar.gz)
set(IMATH_VERSION 3.1.4)
set(IMATH_URI https://github.com/AcademySoftwareFoundation/Imath/archive/v${OPENEXR_VERSION}.tar.gz)
set(IMATH_HASH fddf14ec73e12c34e74c3c175e311a3f)
set(IMATH_HASH_TYPE MD5)
set(IMATH_FILE imath-${IMATH_VERSION}.tar.gz)
if(WIN32)
# Openexr started appending _d on its own so now
# we need to tell the build the postfix is _s while
@@ -85,9 +92,9 @@ set(FREEGLUT_HASH 90c3ca4dd9d51cf32276bc5344ec9754)
set(FREEGLUT_HASH_TYPE MD5)
set(FREEGLUT_FILE freeglut-${FREEGLUT_VERSION}.tar.gz)
set(ALEMBIC_VERSION 1.7.16)
set(ALEMBIC_VERSION 1.8.3)
set(ALEMBIC_URI https://github.com/alembic/alembic/archive/${ALEMBIC_VERSION}.tar.gz)
set(ALEMBIC_HASH effcc86e42fe6605588e3de57bde6677)
set(ALEMBIC_HASH 2cd8d6e5a3ac4a014e24a4b04f4fadf9)
set(ALEMBIC_HASH_TYPE MD5)
set(ALEMBIC_FILE alembic-${ALEMBIC_VERSION}.tar.gz)
@@ -112,15 +119,15 @@ set(CUEW_HASH 86760d62978ebfd96cd93f5aa1abaf4a)
set(CUEW_HASH_TYPE MD5)
set(CUEW_FILE cuew-${CUEW_GIT_UID}.zip)
set(OPENSUBDIV_VERSION v3_4_3)
set(OPENSUBDIV_VERSION v3_4_4)
set(OPENSUBDIV_URI https://github.com/PixarAnimationStudios/OpenSubdiv/archive/${OPENSUBDIV_VERSION}.tar.gz)
set(OPENSUBDIV_HASH 7bbfa275d021fb829e521df749160edb)
set(OPENSUBDIV_HASH 39ecc5caf0abebc943d1ce131855e76e)
set(OPENSUBDIV_HASH_TYPE MD5)
set(OPENSUBDIV_FILE opensubdiv-${OPENSUBDIV_VERSION}.tar.gz)
set(SDL_VERSION 2.0.12)
set(SDL_VERSION 2.0.20)
set(SDL_URI https://www.libsdl.org/release/SDL2-${SDL_VERSION}.tar.gz)
set(SDL_HASH 783b6f2df8ff02b19bb5ce492b99c8ff)
set(SDL_HASH a53acc02e1cca98c4123229069b67c9e)
set(SDL_HASH_TYPE MD5)
set(SDL_FILE SDL2-${SDL_VERSION}.tar.gz)
@@ -130,9 +137,9 @@ set(OPENCOLLADA_HASH ee7dae874019fea7be11613d07567493)
set(OPENCOLLADA_HASH_TYPE MD5)
set(OPENCOLLADA_FILE opencollada-${OPENCOLLADA_VERSION}.tar.gz)
set(OPENCOLORIO_VERSION 2.0.0)
set(OPENCOLORIO_VERSION 2.1.1)
set(OPENCOLORIO_URI https://github.com/AcademySoftwareFoundation/OpenColorIO/archive/v${OPENCOLORIO_VERSION}.tar.gz)
set(OPENCOLORIO_HASH 1a2e3478b6cd9a1549f24e1b2205e3f0)
set(OPENCOLORIO_HASH 604f562e073f23d88ce89ed4f7f709ba)
set(OPENCOLORIO_HASH_TYPE MD5)
set(OPENCOLORIO_FILE OpenColorIO-${OPENCOLORIO_VERSION}.tar.gz)
@@ -155,21 +162,37 @@ set(OPENMP_URI https://github.com/llvm/llvm-project/releases/download/llvmorg-${
set(OPENMP_HASH_TYPE MD5)
set(OPENMP_FILE openmp-${OPENMP_VERSION}.src.tar.xz)
set(OPENIMAGEIO_VERSION 2.2.15.1)
set(OPENIMAGEIO_URI https://github.com/OpenImageIO/oiio/archive/Release-${OPENIMAGEIO_VERSION}.tar.gz)
set(OPENIMAGEIO_HASH 3db5c5f0b3dc91597c75e5df09eb9072)
set(OPENIMAGEIO_VERSION v2.3.13.0)
set(OPENIMAGEIO_URI https://github.com/OpenImageIO/oiio/archive/refs/tags/${OPENIMAGEIO_VERSION}.tar.gz)
set(OPENIMAGEIO_HASH de45fb38501c4581062b522b53b6141c)
set(OPENIMAGEIO_HASH_TYPE MD5)
set(OPENIMAGEIO_FILE OpenImageIO-${OPENIMAGEIO_VERSION}.tar.gz)
set(TIFF_VERSION 4.1.0)
# 8.0.0 is currently oiio's preferred vesion although never versions may be available.
# the preferred version can be found in oiio's externalpackages.cmake
set(FMT_VERSION 8.0.0)
set(FMT_URI https://github.com/fmtlib/fmt/archive/refs/tags/${FMT_VERSION}.tar.gz)
set(FMT_HASH 7bce0e9e022e586b178b150002e7c2339994e3c2bbe44027e9abb0d60f9cce83)
set(FMT_HASH_TYPE SHA256)
set(FMT_FILE fmt-${FMT_VERSION}.tar.gz)
# 0.6.2 is currently oiio's preferred vesion although never versions may be available.
# the preferred version can be found in oiio's externalpackages.cmake
set(ROBINMAP_VERSION v0.6.2)
set(ROBINMAP_URI https://github.com/Tessil/robin-map/archive/refs/tags/${ROBINMAP_VERSION}.tar.gz)
set(ROBINMAP_HASH c08ec4b1bf1c85eb0d6432244a6a89862229da1cb834f3f90fba8dc35d8c8ef1)
set(ROBINMAP_HASH_TYPE SHA256)
set(ROBINMAP_FILE robinmap-${ROBINMAP_VERSION}.tar.gz)
set(TIFF_VERSION 4.3.0)
set(TIFF_URI http://download.osgeo.org/libtiff/tiff-${TIFF_VERSION}.tar.gz)
set(TIFF_HASH 2165e7aba557463acc0664e71a3ed424)
set(TIFF_HASH 0a2e4744d1426a8fc8211c0cdbc3a1b3)
set(TIFF_HASH_TYPE MD5)
set(TIFF_FILE tiff-${TIFF_VERSION}.tar.gz)
set(OSL_VERSION 1.11.14.1)
set(OSL_VERSION 1.11.17.0)
set(OSL_URI https://github.com/imageworks/OpenShadingLanguage/archive/Release-${OSL_VERSION}.tar.gz)
set(OSL_HASH 1abd7ce40481771a9fa937f19595d2f2)
set(OSL_HASH 63265472ce14548839ace2e21e401544)
set(OSL_HASH_TYPE MD5)
set(OSL_FILE OpenShadingLanguage-${OSL_VERSION}.tar.gz)
@@ -181,24 +204,18 @@ set(PYTHON_HASH 14e8c22458ed7779a1957b26cde01db9)
set(PYTHON_HASH_TYPE MD5)
set(PYTHON_FILE Python-${PYTHON_VERSION}.tar.xz)
set(TBB_VERSION 2020_U2)
set(TBB_VERSION 2020_U3)
set(TBB_URI https://github.com/oneapi-src/oneTBB/archive/${TBB_VERSION}.tar.gz)
set(TBB_HASH 1b711ae956524855088df3bbf5ec65dc)
set(TBB_HASH 55ec8df6eae5ed6364a47f0e671e460c)
set(TBB_HASH_TYPE MD5)
set(TBB_FILE oneTBB-${TBB_VERSION}.tar.gz)
set(OPENVDB_VERSION 8.0.1)
set(OPENVDB_VERSION 9.0.0)
set(OPENVDB_URI https://github.com/AcademySoftwareFoundation/openvdb/archive/v${OPENVDB_VERSION}.tar.gz)
set(OPENVDB_HASH 01b490be16cc0e15c690f9a153c21461)
set(OPENVDB_HASH 684ce40c2f74f3a0c9cac530e1c7b07e)
set(OPENVDB_HASH_TYPE MD5)
set(OPENVDB_FILE openvdb-${OPENVDB_VERSION}.tar.gz)
set(NANOVDB_GIT_UID dc37d8a631922e7bef46712947dc19b755f3e841)
set(NANOVDB_URI https://github.com/AcademySoftwareFoundation/openvdb/archive/${NANOVDB_GIT_UID}.tar.gz)
set(NANOVDB_HASH e7b9e863ec2f3b04ead171dec2322807)
set(NANOVDB_HASH_TYPE MD5)
set(NANOVDB_FILE nano-vdb-${NANOVDB_GIT_UID}.tar.gz)
set(IDNA_VERSION 3.3)
set(CHARSET_NORMALIZER_VERSION 2.0.10)
set(URLLIB3_VERSION 1.26.8)
@@ -222,15 +239,15 @@ set(LAME_HASH 83e260acbe4389b54fe08e0bdbf7cddb)
set(LAME_HASH_TYPE MD5)
set(LAME_FILE lame-${LAME_VERSION}.tar.gz)
set(OGG_VERSION 1.3.4)
set(OGG_VERSION 1.3.5)
set(OGG_URI http://downloads.xiph.org/releases/ogg/libogg-${OGG_VERSION}.tar.gz)
set(OGG_HASH fe5670640bd49e828d64d2879c31cb4dde9758681bb664f9bdbf159a01b0c76e)
set(OGG_HASH 0eb4b4b9420a0f51db142ba3f9c64b333f826532dc0f48c6410ae51f4799b664)
set(OGG_HASH_TYPE SHA256)
set(OGG_FILE libogg-${OGG_VERSION}.tar.gz)
set(VORBIS_VERSION 1.3.6)
set(VORBIS_VERSION 1.3.7)
set(VORBIS_URI http://downloads.xiph.org/releases/vorbis/libvorbis-${VORBIS_VERSION}.tar.gz)
set(VORBIS_HASH 6ed40e0241089a42c48604dc00e362beee00036af2d8b3f46338031c9e0351cb)
set(VORBIS_HASH 0e982409a9c3fc82ee06e08205b1355e5c6aa4c36bca58146ef399621b0ce5ab)
set(VORBIS_HASH_TYPE SHA256)
set(VORBIS_FILE libvorbis-${VORBIS_VERSION}.tar.gz)
@@ -240,15 +257,15 @@ set(THEORA_HASH b6ae1ee2fa3d42ac489287d3ec34c5885730b1296f0801ae577a35193d3affbc
set(THEORA_HASH_TYPE SHA256)
set(THEORA_FILE libtheora-${THEORA_VERSION}.tar.bz2)
set(FLAC_VERSION 1.3.3)
set(FLAC_VERSION 1.3.4)
set(FLAC_URI http://downloads.xiph.org/releases/flac/flac-${FLAC_VERSION}.tar.xz)
set(FLAC_HASH 213e82bd716c9de6db2f98bcadbc4c24c7e2efe8c75939a1a84e28539c4e1748)
set(FLAC_HASH 8ff0607e75a322dd7cd6ec48f4f225471404ae2730d0ea945127b1355155e737 )
set(FLAC_HASH_TYPE SHA256)
set(FLAC_FILE flac-${FLAC_VERSION}.tar.xz)
set(VPX_VERSION 1.8.2)
set(VPX_VERSION 1.11.0)
set(VPX_URI https://github.com/webmproject/libvpx/archive/v${VPX_VERSION}/libvpx-v${VPX_VERSION}.tar.gz)
set(VPX_HASH 8735d9fcd1a781ae6917f28f239a8aa358ce4864ba113ea18af4bb2dc8b474ac)
set(VPX_HASH 965e51c91ad9851e2337aebcc0f517440c637c506f3a03948062e3d5ea129a83)
set(VPX_HASH_TYPE SHA256)
set(VPX_FILE libvpx-v${VPX_VERSION}.tar.gz)
@@ -258,9 +275,9 @@ set(OPUS_HASH 65b58e1e25b2a114157014736a3d9dfeaad8d41be1c8179866f144a2fb44ff9d)
set(OPUS_HASH_TYPE SHA256)
set(OPUS_FILE opus-${OPUS_VERSION}.tar.gz)
set(X264_VERSION 33f9e1474613f59392be5ab6a7e7abf60fa63622)
set(X264_VERSION 35fe20d1ba49918ec739a5b068c208ca82f977f7)
set(X264_URI https://code.videolan.org/videolan/x264/-/archive/${X264_VERSION}/x264-${X264_VERSION}.tar.gz)
set(X264_HASH 5456450ee1ae02cd2328be3157367a232a0ab73315e8c8f80dab80469524f525)
set(X264_HASH bb4f7da03936b5a030ed5827133b58eb3f701d7e5dce32cca4ba6df93797d42e)
set(X264_HASH_TYPE SHA256)
set(X264_FILE x264-${X264_VERSION}.tar.gz)
@@ -270,22 +287,22 @@ set(XVIDCORE_HASH abbdcbd39555691dd1c9b4d08f0a031376a3b211652c0d8b3b8aa9be1303ce
set(XVIDCORE_HASH_TYPE SHA256)
set(XVIDCORE_FILE xvidcore-${XVIDCORE_VERSION}.tar.gz)
set(OPENJPEG_VERSION 2.3.1)
set(OPENJPEG_SHORT_VERSION 2.3)
set(OPENJPEG_VERSION 2.4.0)
set(OPENJPEG_SHORT_VERSION 2.4)
set(OPENJPEG_URI https://github.com/uclouvain/openjpeg/archive/v${OPENJPEG_VERSION}.tar.gz)
set(OPENJPEG_HASH 63f5a4713ecafc86de51bfad89cc07bb788e9bba24ebbf0c4ca637621aadb6a9)
set(OPENJPEG_HASH 8702ba68b442657f11aaeb2b338443ca8d5fb95b0d845757968a7be31ef7f16d)
set(OPENJPEG_HASH_TYPE SHA256)
set(OPENJPEG_FILE openjpeg-v${OPENJPEG_VERSION}.tar.gz)
set(FFMPEG_VERSION 4.4)
set(FFMPEG_VERSION 5.0)
set(FFMPEG_URI http://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.bz2)
set(FFMPEG_HASH 42093549751b582cf0f338a21a3664f52e0a9fbe0d238d3c992005e493607d0e)
set(FFMPEG_HASH c0130b8db2c763430fd1c6905288d61bc44ee0548ad5fcd2dfd650b88432bed9)
set(FFMPEG_HASH_TYPE SHA256)
set(FFMPEG_FILE ffmpeg-${FFMPEG_VERSION}.tar.bz2)
set(FFTW_VERSION 3.3.8)
set(FFTW_VERSION 3.3.10)
set(FFTW_URI http://www.fftw.org/fftw-${FFTW_VERSION}.tar.gz)
set(FFTW_HASH 8aac833c943d8e90d51b697b27d4384d)
set(FFTW_HASH 8ccbf6a5ea78a16dbc3e1306e234cc5c)
set(FFTW_HASH_TYPE MD5)
set(FFTW_FILE fftw-${FFTW_VERSION}.tar.gz)
@@ -301,9 +318,9 @@ set(SNDFILE_HASH 646b5f98ce89ac60cdb060fcd398247c)
set(SNDFILE_HASH_TYPE MD5)
set(SNDFILE_FILE libsndfile-${SNDFILE_VERSION}.tar.gz)
set(WEBP_VERSION 0.6.1)
set(WEBP_VERSION 1.2.2)
set(WEBP_URI https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-${WEBP_VERSION}.tar.gz)
set(WEBP_HASH b49ce9c3e3e9acae4d91bca44bb85a72)
set(WEBP_HASH b5e2e414a8adee4c25fe56b18dd9c549)
set(WEBP_HASH_TYPE MD5)
set(WEBP_FILE libwebp-${WEBP_VERSION}.tar.gz)
@@ -338,9 +355,15 @@ set(YAMLCPP_HASH b45bf1089a382e81f6b661062c10d0c2)
set(YAMLCPP_HASH_TYPE MD5)
set(YAMLCPP_FILE yaml-cpp-${YAMLCPP_VERSION}.tar.gz)
set(EXPAT_VERSION 2_2_10)
set(PYSTRING_VERSION v1.1.3)
set(PYSTRING_URI https://codeload.github.com/imageworks/pystring/tar.gz/refs/tags/${PYSTRING_VERSION})
set(PYSTRING_HASH f2c68786b359f5e4e62bed53bc4fb86d)
set(PYSTRING_HASH_TYPE MD5)
set(PYSTRING_FILE pystring-${PYSTRING_VERSION}.tar.gz)
set(EXPAT_VERSION 2_4_4)
set(EXPAT_URI https://github.com/libexpat/libexpat/archive/R_${EXPAT_VERSION}.tar.gz)
set(EXPAT_HASH 7ca5f09959fcb9a57618368deb627b9f)
set(EXPAT_HASH 2d3e81dee94b452369dc6394ff0f8f98)
set(EXPAT_HASH_TYPE MD5)
set(EXPAT_FILE libexpat-${EXPAT_VERSION}.tar.gz)
@@ -405,22 +428,21 @@ set(SQLITE_HASH fb558c49ee21a837713c4f1e7e413309aabdd9c7)
set(SQLITE_HASH_TYPE SHA1)
set(SQLITE_FILE sqlite-src-3240000.zip)
set(EMBREE_VERSION 3.10.0)
set(EMBREE_VERSION 3.13.3)
set(EMBREE_URI https://github.com/embree/embree/archive/v${EMBREE_VERSION}.zip)
set(EMBREE_HASH 4bbe29e7eaa46417efc75fc5f1e8eb87)
set(EMBREE_HASH f62766ba54e48a2f327c3a22596e7133)
set(EMBREE_HASH_TYPE MD5)
set(EMBREE_FILE embree-v${EMBREE_VERSION}.zip)
set(EMBREE_ARM_GIT https://github.com/brechtvl/embree.git)
set(USD_VERSION 21.02)
set(USD_VERSION 22.03)
set(USD_URI https://github.com/PixarAnimationStudios/USD/archive/v${USD_VERSION}.tar.gz)
set(USD_HASH 1dd1e2092d085ed393c1f7c450a4155a)
set(USD_HASH e0e441a05057692a83124a1195b09eed)
set(USD_HASH_TYPE MD5)
set(USD_FILE usd-v${USD_VERSION}.tar.gz)
set(OIDN_VERSION 1.4.1)
set(OIDN_VERSION 1.4.3)
set(OIDN_URI https://github.com/OpenImageDenoise/oidn/releases/download/v${OIDN_VERSION}/oidn-${OIDN_VERSION}.src.tar.gz)
set(OIDN_HASH df4007b0ab93b1c41cdf223b075d01c0)
set(OIDN_HASH 027093eaf5e8b4e45835b991137b38e6)
set(OIDN_HASH_TYPE MD5)
set(OIDN_FILE oidn-${OIDN_VERSION}.src.tar.gz)
@@ -454,9 +476,9 @@ set(WL_PROTOCOLS_URI https://gitlab.freedesktop.org/wayland/wayland-protocols/-/
set(WL_PROTOCOLS_HASH af5ca07e13517cdbab33504492cef54a)
set(WL_PROTOCOLS_HASH_TYPE MD5)
set(ISPC_VERSION v1.16.0)
set(ISPC_VERSION v1.17.0)
set(ISPC_URI https://github.com/ispc/ispc/archive/${ISPC_VERSION}.tar.gz)
set(ISPC_HASH 2e3abedbc0ea9aaec17d6562c632454d)
set(ISPC_HASH 4f476a3109332a77fe839a9014c60ca9)
set(ISPC_HASH_TYPE MD5)
set(ISPC_FILE ispc-${ISPC_VERSION}.tar.gz)
@@ -492,3 +514,9 @@ set(BROTLI_URI https://github.com/google/brotli/archive/refs/tags/${BROTLI_VERSI
set(BROTLI_HASH f9e8d81d0405ba66d181529af42a3354f838c939095ff99930da6aa9cdf6fe46)
set(BROTLI_HASH_TYPE SHA256)
set(BROTLI_FILE brotli-${BROTLI_VERSION}.tar.gz)
set(LEVEL_ZERO_VERSION v1.7.15)
set(LEVEL_ZERO_URI https://github.com/oneapi-src/level-zero/archive/refs/tags/${LEVEL_ZERO_VERSION}.tar.gz)
set(LEVEL_ZERO_HASH c39bb05a8e5898aa6c444e1704105b93d3f1888b9c333f8e7e73825ffbfb2617)
set(LEVEL_ZERO_HASH_TYPE SHA256)
set(LEVEL_ZERO_FILE level-zero-${LEVEL_ZERO_VERSION}.tar.gz)

View File

@@ -4,9 +4,15 @@
# library itself does not depend on them, so should give no problems.
set(WEBP_EXTRA_ARGS
-DWEBP_HAVE_SSE2=ON
-DWEBP_HAVE_SSE41=OFF
-DWEBP_HAVE_AVX2=OFF
-DWEBP_BUILD_ANIM_UTILS=OFF
-DWEBP_BUILD_CWEBP=OFF
-DWEBP_BUILD_DWEBP=OFF
-DWEBP_BUILD_GIF2WEBP=OFF
-DWEBP_BUILD_IMG2WEBP=OFF
-DWEBP_BUILD_VWEBP=OFF
-DWEBP_BUILD_WEBPINFO=OFF
-DWEBP_BUILD_WEBPMUX=OFF
-DWEBP_BUILD_EXTRAS=OFF
)
if(WIN32)

View File

@@ -0,0 +1,32 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright Contributors to the OpenColorIO Project.
project(pystring)
cmake_minimum_required(VERSION 3.10)
set(HEADERS
pystring.h
)
set(SOURCES
pystring.cpp
)
add_library(${PROJECT_NAME} STATIC ${HEADERS} ${SOURCES})
if(UNIX)
set(pystring_CXX_FLAGS "${pystring_CXX_FLAGS} -fPIC")
endif()
set_target_properties(${PROJECT_NAME} PROPERTIES
COMPILE_FLAGS "${PLATFORM_COMPILE_FLAGS} ${pystring_CXX_FLAGS}"
PUBLIC_HEADER "${HEADERS}"
)
install(TARGETS ${PROJECT_NAME}
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
PUBLIC_HEADER DESTINATION include/pystring
)

View File

@@ -12,3 +12,19 @@ diff -Naur orig/common/sys/platform.h external_embree/common/sys/platform.h
#else
#define dll_export __attribute__ ((visibility ("default")))
#define dll_import
diff --git orig/common/tasking/CMakeLists.txt external_embree/common/tasking/CMakeLists.txt
--- orig/common/tasking/CMakeLists.txt
+++ external_embree/common/tasking/CMakeLists.txt
@@ -27,7 +27,11 @@
else()
# If not found try getting older TBB via module (FindTBB.cmake)
unset(TBB_DIR CACHE)
- find_package(TBB 4.1 REQUIRED tbb)
+ if (TBB_STATIC_LIB)
+ find_package(TBB 4.1 REQUIRED tbb_static)
+ else()
+ find_package(TBB 4.1 REQUIRED tbb)
+ endif()
if (TBB_FOUND)
TARGET_LINK_LIBRARIES(tasking PUBLIC TBB)
TARGET_INCLUDE_DIRECTORIES(tasking PUBLIC "${TBB_INCLUDE_DIRS}")

View File

@@ -1,43 +1,6 @@
diff -Naur external_ispc/CMakeLists.txt external_ispc_fixed/CMakeLists.txt
--- external_ispc/CMakeLists.txt 2020-04-23 17:29:06 -0600
+++ external_ispc_fixed/CMakeLists.txt 2020-05-05 09:01:09 -0600
@@ -389,7 +389,7 @@
# Link against Clang libraries
foreach(clangLib ${CLANG_LIBRARY_LIST})
- find_library(${clangLib}Path NAMES ${clangLib} HINTS ${LLVM_LIBRARY_DIRS})
+ find_library(${clangLib}Path NAMES ${clangLib} HINTS ${LLVM_LIBRARY_DIRS} ${CLANG_LIBRARY_DIR})
list(APPEND CLANG_LIBRARY_FULL_PATH_LIST ${${clangLib}Path})
endforeach()
target_link_libraries(${PROJECT_NAME} ${CLANG_LIBRARY_FULL_PATH_LIST})
diff -Naur orig/CMakeLists.txt external_ispc/CMakeLists.txt
--- orig/CMakeLists.txt 2020-05-05 09:19:11 -0600
+++ external_ispc/CMakeLists.txt 2020-05-05 09:26:44 -0600
@@ -333,7 +333,7 @@
# Include directories
target_include_directories(${PROJECT_NAME} PRIVATE
- ${LLVM_INCLUDE_DIRS}
+ ${LLVM_INCLUDE_DIRS} ${CLANG_INCLUDE_DIRS}
${GENX_DEPS_DIR}/include
${CMAKE_CURRENT_SOURCE_DIR}/src
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR})
diff -Naur orig/cmake/GenerateBuiltins.cmake.txt external_ispc/cmake/GenerateBuiltins.cmake.txt
+++ orig/cmake/GenerateBuiltins.cmake 2020-05-25 13:32:40.830803821 +0200
+++ external_ispc/cmake/GenerateBuiltins.cmake 2020-05-25 13:32:40.830803821 +0200
@@ -97,6 +97,8 @@
if ("${bit}" STREQUAL "32" AND ${arch} STREQUAL "x86")
set(target_arch "i686")
+ # Blender: disable 32bit due to build issues on Linux and being unnecessary.
+ set(SKIP ON)
elseif ("${bit}" STREQUAL "64" AND ${arch} STREQUAL "x86")
set(target_arch "x86_64")
elseif ("${bit}" STREQUAL "32" AND ${arch} STREQUAL "arm")
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 46a8db8..f53beef 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
diff -Naur ispc-1.17.0.org/CMakeLists.txt ispc-1.17.0/CMakeLists.txt
--- ispc-1.17.0.org/CMakeLists.txt 2022-01-15 01:35:15 -0700
+++ ispc-1.17.0/CMakeLists.txt 2022-02-12 12:44:24 -0700
@@ -36,8 +36,12 @@
cmake_minimum_required(VERSION 3.13)
@@ -53,7 +16,25 @@ index 46a8db8..f53beef 100644
endif()
set(PROJECT_NAME ispc)
@@ -412,6 +416,29 @@ else()
@@ -443,7 +447,7 @@
# Include directories
target_include_directories(${PROJECT_NAME} PRIVATE
- ${LLVM_INCLUDE_DIRS}
+ ${LLVM_INCLUDE_DIRS} ${CLANG_INCLUDE_DIRS}
${XE_DEPS_DIR}/include
${CMAKE_CURRENT_SOURCE_DIR}/src
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR})
@@ -507,7 +511,7 @@
# Link against Clang libraries
foreach(clangLib ${CLANG_LIBRARY_LIST})
- find_library(${clangLib}Path NAMES ${clangLib} HINTS ${LLVM_LIBRARY_DIRS})
+ find_library(${clangLib}Path NAMES ${clangLib} HINTS ${LLVM_LIBRARY_DIRS} ${CLANG_LIBRARY_DIR})
list(APPEND CLANG_LIBRARY_FULL_PATH_LIST ${${clangLib}Path})
endforeach()
target_link_libraries(${PROJECT_NAME} ${CLANG_LIBRARY_FULL_PATH_LIST})
@@ -546,6 +550,29 @@
endif()
endif()
@@ -83,3 +64,15 @@ index 46a8db8..f53beef 100644
# Build target for utility checking host ISA
if (ISPC_INCLUDE_UTILS)
add_executable(check_isa "")
diff -Naur ispc-1.17.0.org/cmake/GenerateBuiltins.cmake ispc-1.17.0/cmake/GenerateBuiltins.cmake
--- ispc-1.17.0.org/cmake/GenerateBuiltins.cmake 2022-01-15 01:35:15 -0700
+++ ispc-1.17.0/cmake/GenerateBuiltins.cmake 2022-02-12 12:44:24 -0700
@@ -124,6 +124,8 @@
if ("${bit}" STREQUAL "32" AND ${arch} STREQUAL "x86")
set(target_arch "i686")
+ # Blender: disable 32bit due to build issues on Linux and being unnecessary.
+ set(SKIP ON)
elseif ("${bit}" STREQUAL "64" AND ${arch} STREQUAL "x86")
set(target_arch "x86_64")
elseif ("${bit}" STREQUAL "32" AND ${arch} STREQUAL "arm")

View File

@@ -0,0 +1,13 @@
diff -Naur external_levelzero_org/CMakeLists.txt external_levelzero/CMakeLists.txt
--- external_levelzero_org/CMakeLists.txt 2022-03-07 13:22:11 -0700
+++ external_levelzero/CMakeLists.txt 2022-03-29 13:22:15 -0600
@@ -77,9 +77,6 @@
#enabling Control Flow Guard
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /guard:cf")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /guard:cf")
- # enable Spectre Mitigation
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Qspectre")
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Qspectre")
endif()
#CXX compiler support

View File

@@ -1,35 +1,16 @@
diff -Naur openvdb-8.0.0/cmake/FindIlmBase.cmake openvdb/cmake/FindIlmBase.cmake
--- openvdb-8.0.0/cmake/FindIlmBase.cmake 2020-12-24 10:13:14 -0700
+++ openvdb/cmake/FindIlmBase.cmake 2021-02-05 12:07:49 -0700
@@ -217,6 +217,12 @@
set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib")
endif()
list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES "${_IlmBase_Version_Suffix}.lib")
+ list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES
+ "_s.lib"
+ )
+ list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES
+ "_s_d.lib"
+ )
else()
if(ILMBASE_USE_STATIC_LIBS)
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
diff -Naur openvdb-8.0.0/cmake/FindOpenEXR.cmake openvdb/cmake/FindOpenEXR.cmake
--- openvdb-8.0.0/cmake/FindOpenEXR.cmake 2020-12-24 10:13:14 -0700
+++ openvdb/cmake/FindOpenEXR.cmake 2021-02-05 12:23:39 -0700
@@ -210,6 +210,12 @@
set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib")
endif()
list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES "${_OpenEXR_Version_Suffix}.lib")
+ list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES
+ "_s.lib"
+ )
+ list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES
+ "_s_d.lib"
+ )
else()
if(OPENEXR_USE_STATIC_LIBS)
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
diff -ur openvdb-9.0.0/cmake/FindTBB.cmake openvdb/cmake/FindTBB.cmake
--- openvdb-9.0.0/cmake/FindTBB.cmake 2021-10-30 03:55:40.000000000 +0100
+++ openvdb/cmake/FindTBB.cmake 2022-03-31 11:33:15.592329750 +0100
@@ -252,7 +252,8 @@
set(_TBB_LIB_NAME "${_TBB_LIB_NAME}${TBB_DEBUG_SUFFIX}")
endif()
- find_library(Tbb_${COMPONENT}_LIBRARY_${BUILD_TYPE} ${_TBB_LIB_NAME}
+ find_library(Tbb_${COMPONENT}_LIBRARY_${BUILD_TYPE}
+ NAMES ${_TBB_LIB_NAME} ${_TBB_LIB_NAME}_static
${_FIND_TBB_ADDITIONAL_OPTIONS}
PATHS ${_TBB_LIBRARYDIR_SEARCH_DIRS}
PATH_SUFFIXES ${CMAKE_INSTALL_LIBDIR} lib64 lib
diff -Naur openvdb-8.0.0/openvdb/openvdb/CMakeLists.txt openvdb/openvdb/openvdb/CMakeLists.txt
--- openvdb-8.0.0/openvdb/openvdb/CMakeLists.txt 2020-12-24 10:13:14 -0700
+++ openvdb/openvdb/openvdb/CMakeLists.txt 2021-02-05 11:18:33 -0700

View File

@@ -48,25 +48,6 @@ diff -Naur org/CMakeLists.txt external_osl/CMakeLists.txt
set (OSL_NO_DEFAULT_TEXTURESYSTEM OFF CACHE BOOL "Do not use create a raw OIIO::TextureSystem")
if (OSL_NO_DEFAULT_TEXTURESYSTEM)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 990f50d69..46ef7351d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -252,11 +252,9 @@ install (EXPORT OSL_EXPORTED_TARGETS
FILE ${OSL_TARGETS_EXPORT_NAME}
NAMESPACE ${PROJECT_NAME}::)
-
-
-
-osl_add_all_tests()
-
+if (${PROJECT_NAME}_BUILD_TESTS AND NOT ${PROJECT_NAME}_IS_SUBPROJECT)
+ osl_add_all_tests()
+endif ()
if (NOT ${PROJECT_NAME}_IS_SUBPROJECT)
include (packaging)
diff -Naur external_osl_orig/src/cmake/externalpackages.cmake external_osl/src/cmake/externalpackages.cmake
--- external_osl_orig/src/cmake/externalpackages.cmake 2021-06-01 13:44:18 -0600
+++ external_osl/src/cmake/externalpackages.cmake 2021-06-28 07:44:32 -0600

View File

@@ -10,225 +10,18 @@ diff -x .git -ur usd.orig/cmake/defaults/Packages.cmake external_usd/cmake/defau
add_definitions(${TBB_DEFINITIONS})
# --math
diff -Naur external_usd_base/cmake/macros/Public.cmake external_usd/cmake/macros/Public.cmake
--- external_usd_base/cmake/macros/Public.cmake 2019-10-24 14:39:53 -0600
+++ external_usd/cmake/macros/Public.cmake 2020-01-11 13:33:29 -0700
@@ -996,6 +996,12 @@
foreach(lib ${PXR_OBJECT_LIBS})
string(TOUPPER ${lib} uppercaseName)
list(APPEND exports "${uppercaseName}_EXPORTS=1")
+ # When building for blender, we do NOT want to export all symbols on windows.
+ # This is a dirty hack, but USD makes it impossible to do the right thing
+ # with the default options exposed.
+ if (WIN32)
+ list(APPEND exports "PXR_STATIC=1")
+ endif()
endforeach()
foreach(lib ${PXR_OBJECT_LIBS})
set(objects "${objects};\$<TARGET_OBJECTS:${lib}>")
diff -ru USD-20.11/pxr/base/tf/pxrLZ4/lz4.cpp external_usd/pxr/base/tf/pxrLZ4/lz4.cpp
--- USD-20.11/pxr/base/tf/pxrLZ4/lz4.cpp 2020-10-14 19:25:19.000000000 +0100
+++ external_usd/pxr/base/tf/pxrLZ4/lz4.cpp 2021-02-09 09:28:51.496190085 +0000
@@ -614,6 +614,15 @@
/*-************************************
* Internal Definitions used in Tests
**************************************/
+
+/*******************************************************************
+ * Disabled in Blender. The BLOSC library also exposes these
+ * functions, and this causes 'duplicate symbol' linker errors.
+ *
+ * This problem has been reported upstream at
+ * https://github.com/PixarAnimationStudios/USD/issues/1447
+ *
+ *******************************************************************
#if defined (__cplusplus)
extern "C" {
#endif
@@ -627,6 +636,7 @@
#if defined (__cplusplus)
}
#endif
+********************************************************************/
/*-******************************
* Compression functions
From 442d087962f762deeb8b6e49a0955753fcf9aeb9 Mon Sep 17 00:00:00 2001
From: Tsahi Zidenberg <tsahee@amazon.com>
Date: Sun, 15 Nov 2020 15:18:24 +0000
Subject: [PATCH 1/2] stackTrace: support aarch64/linux
diff -Naur usd_orig/cmake/defaults/msvcdefaults.cmake external_usd/cmake/defaults/msvcdefaults.cmake
--- usd_orig/cmake/defaults/msvcdefaults.cmake 2022-02-18 14:49:09 -0700
+++ external_usd/cmake/defaults/msvcdefaults.cmake 2022-03-14 11:41:50 -0600
@@ -120,9 +120,6 @@
# for all translation units.
set(_PXR_CXX_FLAGS "${_PXR_CXX_FLAGS} /bigobj")
-# Enable PDB generation.
-set(_PXR_CXX_FLAGS "${_PXR_CXX_FLAGS} /Zi")
-
# Enable multiprocessor builds.
set(_PXR_CXX_FLAGS "${_PXR_CXX_FLAGS} /MP")
set(_PXR_CXX_FLAGS "${_PXR_CXX_FLAGS} /Gm-")
stacktrace calls syscall directly via assembler. Create compatible
aarch64 code.
---
pxr/base/arch/stackTrace.cpp | 30 ++++++++++++++++++++++++------
1 file changed, 24 insertions(+), 6 deletions(-)
diff --git a/pxr/base/arch/stackTrace.cpp b/pxr/base/arch/stackTrace.cpp
index dcc1dfd46..c11aabeb1 100644
--- a/pxr/base/arch/stackTrace.cpp
+++ b/pxr/base/arch/stackTrace.cpp
@@ -583,7 +583,6 @@ nonLockingLinux__execve (const char *file,
char *const argv[],
char *const envp[])
{
-#if defined(ARCH_BITS_64)
/*
* We make a direct system call here, because we can't find an
* execve which corresponds with the non-locking fork we call
@@ -594,7 +593,27 @@ nonLockingLinux__execve (const char *file,
* hangs in a threaded app. (We use the non-locking fork to get
* around problems with forking when we have had memory
* corruption.) whew.
- *
+ */
+
+ unsigned long result;
+
+#if defined (__aarch64__)
+ {
+ register long __file_result asm ("x0") = (long)file;
+ register char* const* __argv asm ("x1") = argv;
+ register char* const* __envp asm ("x2") = envp;
+ register long __num_execve asm ("x8") = 221;
+ __asm__ __volatile__ (
+ "svc 0"
+ : "=r" (__file_result)
+ : "r"(__num_execve), "r" (__file_result), "r" (__argv), "r" (__envp)
+ : "memory"
+ );
+ result = __file_result;
+ }
+#elif defined(ARCH_CPU_INTEL) && defined(ARCH_BITS_64)
+
+ /*
* %rdi, %rsi, %rdx, %rcx, %r8, %r9 are args 0-5
* syscall clobbers %rcx and %r11
*
@@ -603,7 +622,6 @@ nonLockingLinux__execve (const char *file,
* constraints to gcc.
*/
- unsigned long result;
__asm__ __volatile__ (
"mov %0, %%rdi \n\t"
"mov %%rcx, %%rsi \n\t"
@@ -614,6 +632,9 @@ nonLockingLinux__execve (const char *file,
: "0" (file), "c" (argv), "d" (envp)
: "memory", "cc", "r11"
);
+#else
+#error Unknown architecture
+#endif
if (result >= 0xfffffffffffff000) {
errno = -result;
@@ -621,9 +642,6 @@ nonLockingLinux__execve (const char *file,
}
return result;
-#else
-#error Unknown architecture
-#endif
}
#endif
From a1dffe02519bb3c6ccbbe8c6c58304da5db98995 Mon Sep 17 00:00:00 2001
From: Tsahi Zidenberg <tsahee@amazon.com>
Date: Sun, 15 Nov 2020 15:22:52 +0000
Subject: [PATCH 2/2] timing: support aarch64/linux
The aarch64 arch-timer is directly accessible to userspace via two
registers:
CNTVCT_EL0 - holds the current counter value
CNTFRQ_EL0 - holds the counter frequency (in Hz)
---
pxr/base/arch/timing.cpp | 6 ++++++
pxr/base/arch/timing.h | 6 +++++-
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/pxr/base/arch/timing.cpp b/pxr/base/arch/timing.cpp
index 27ad58fed..9022950c1 100644
--- a/pxr/base/arch/timing.cpp
+++ b/pxr/base/arch/timing.cpp
@@ -59,6 +59,11 @@ ARCH_HIDDEN
void
Arch_InitTickTimer()
{
+#ifdef __aarch64__
+ uint64_t counter_hz;
+ __asm __volatile("mrs %0, CNTFRQ_EL0" : "=&r" (counter_hz));
+ Arch_NanosecondsPerTick = double(1e9) / double(counter_hz);
+#else
// NOTE: Normally ifstream would be cleaner, but it causes crashes when
// used in conjunction with DSOs and the Intel Compiler.
FILE *in;
@@ -135,6 +140,7 @@ Arch_InitTickTimer()
}
Arch_NanosecondsPerTick = double(1e9) / double(cpuHz);
+#endif
}
#elif defined(ARCH_OS_WINDOWS)
diff --git a/pxr/base/arch/timing.h b/pxr/base/arch/timing.h
index 67ec0d15f..6dc3e85a0 100644
--- a/pxr/base/arch/timing.h
+++ b/pxr/base/arch/timing.h
@@ -36,7 +36,7 @@
/// \addtogroup group_arch_SystemFunctions
///@{
-#if defined(ARCH_OS_LINUX)
+#if defined(ARCH_OS_LINUX) && defined(ARCH_CPU_INTEL)
#include <x86intrin.h>
#elif defined(ARCH_OS_DARWIN)
#include <mach/mach_time.h>
@@ -69,6 +69,10 @@ ArchGetTickTime()
#elif defined(ARCH_CPU_INTEL)
// On Intel we'll use the rdtsc instruction.
return __rdtsc();
+#elif defined (__aarch64__)
+ uint64_t result;
+ __asm __volatile("mrs %0, CNTVCT_EL0" : "=&r" (result));
+ return result;
#else
#error Unknown architecture.
#endif
diff --git a/pxr/base/arch/demangle.cpp b/pxr/base/arch/demangle.cpp
index 67ec0d15f..6dc3e85a0 100644
--- a/pxr/base/arch/demangle.cpp
+++ b/pxr/base/arch/demangle.cpp
@@ -36,6 +36,7 @@
#if (ARCH_COMPILER_GCC_MAJOR == 3 && ARCH_COMPILER_GCC_MINOR >= 1) || \
ARCH_COMPILER_GCC_MAJOR > 3 || defined(ARCH_COMPILER_CLANG)
#define _AT_LEAST_GCC_THREE_ONE_OR_CLANG
+#include <cxxabi.h>
#endif
PXR_NAMESPACE_OPEN_SCOPE
@@ -138,7 +139,6 @@
#endif
#if defined(_AT_LEAST_GCC_THREE_ONE_OR_CLANG)
-#include <cxxabi.h>
/*
* This routine doesn't work when you get to gcc3.4.
diff --git a/pxr/base/work/singularTask.h b/pxr/base/work/singularTask.h
index 67ec0d15f..6dc3e85a0 100644
--- a/pxr/base/work/singularTask.h
+++ b/pxr/base/work/singularTask.h
@@ -120,7 +120,7 @@
// case we go again to ensure the task can do whatever it
// was awakened to do. Once we successfully take the count
// to zero, we stop.
- size_t old = count;
+ std::size_t old = count;
do { _fn(); } while (
!count.compare_exchange_strong(old, 0));
});

View File

@@ -46,6 +46,15 @@ if "%3" == "debug" set CMAKE_DEBUG_OPTIONS=-DWITH_OPTIMIZED_DEBUG=Off
set dobuild=1
if "%4" == "nobuild" set dobuild=0
REM If Python is be available certain deps may try to
REM to use this over the version we build, to prevent that
REM make sure python is NOT in the path
for %%X in (python.exe) do (set PYTHON=%%~$PATH:X)
if EXIST "%PYTHON%" (
echo PYTHON found at %PYTHON% dependencies cannot be build with python available in the path
goto exit
)
set SOURCE_DIR=%~dp0\..
set BUILD_DIR=%cd%\build
set HARVEST_DIR=%BUILD_DIR%\output
@@ -99,7 +108,7 @@ cmake -G "%CMAKE_BUILDER%" %CMAKE_BUILD_ARCH% -Thost=x64 %SOURCE_DIR% -DPACKAGE
echo %DATE% %TIME% : Release Configuration done >> %StatusFile%
if "%dobuild%" == "1" (
msbuild /m "ll.vcxproj" /p:Configuration=Release /fl /flp:logfile=BlenderDeps_llvm.log;Verbosity=normal
msbuild /m "BlenderDependencies.sln" /p:Configuration=Release /fl /flp:logfile=BlenderDeps.log;Verbosity=minimal /verbosity:minimal
msbuild /maxcpucount:1 /m "BlenderDependencies.sln" /p:Configuration=Release /fl /flp:logfile=BlenderDeps.log;Verbosity=minimal /verbosity:minimal
echo %DATE% %TIME% : Release Build done >> %StatusFile%
cmake --build . --target Harvest_Release_Results > Harvest_Release.txt
)
@@ -112,7 +121,7 @@ cmake -G "%CMAKE_BUILDER%" %CMAKE_BUILD_ARCH% -Thost=x64 %SOURCE_DIR% -DPACKAGE_
echo %DATE% %TIME% : Debug Configuration done >> %StatusFile%
if "%dobuild%" == "1" (
msbuild /m "ll.vcxproj" /p:Configuration=Debug /fl /flp:logfile=BlenderDeps_llvm.log;;Verbosity=normal
msbuild /m "BlenderDependencies.sln" /p:Configuration=Debug /verbosity:n /fl /flp:logfile=BlenderDeps.log;;Verbosity=normal
msbuild /maxcpucount:1 /m "BlenderDependencies.sln" /p:Configuration=Debug /verbosity:n /fl /flp:logfile=BlenderDeps.log;;Verbosity=normal
echo %DATE% %TIME% : Debug Build done >> %StatusFile%
cmake --build . --target Harvest_Debug_Results> Harvest_Debug.txt
)

View File

@@ -85,9 +85,9 @@ STRING(REGEX REPLACE "([0-9]+)[.]([0-9]+).*" "\\1_\\2" _openexr_libs_ver ${OPENE
IF(OPENEXR_VERSION VERSION_GREATER_EQUAL "3.0.0")
SET(_openexr_FIND_COMPONENTS
Iex
IlmThread
OpenEXR
OpenEXRCore
IlmThread
)
ELSE()
SET(_openexr_FIND_COMPONENTS

View File

@@ -202,9 +202,9 @@ def parm_size(node_child):
# NOT PERFECT CODE, EXTRACT SIZE FROM TOKENS
if len(tokens) >= 3: # foo [ 1 ]
if ((tokens[-3].kind == TokenKind.PUNCTUATION and tokens[-3].spelling == "[") and
(tokens[-2].kind == TokenKind.LITERAL and tokens[-2].spelling.isdigit()) and
(tokens[-1].kind == TokenKind.PUNCTUATION and tokens[-1].spelling == "]")):
if ((tokens[-3].kind == TokenKind.PUNCTUATION and tokens[-3].spelling == "[") and
(tokens[-2].kind == TokenKind.LITERAL and tokens[-2].spelling.isdigit()) and
(tokens[-1].kind == TokenKind.PUNCTUATION and tokens[-1].spelling == "]")):
# ---
return int(tokens[-2].spelling)
return -1

View File

@@ -30,6 +30,7 @@ set(WITH_IMAGE_HDR ON CACHE BOOL "" FORCE)
set(WITH_IMAGE_OPENEXR ON CACHE BOOL "" FORCE)
set(WITH_IMAGE_OPENJPEG ON CACHE BOOL "" FORCE)
set(WITH_IMAGE_TIFF ON CACHE BOOL "" FORCE)
set(WITH_IMAGE_WEBP ON CACHE BOOL "" FORCE)
set(WITH_INPUT_NDOF ON CACHE BOOL "" FORCE)
set(WITH_INPUT_IME ON CACHE BOOL "" FORCE)
set(WITH_INTERNATIONAL ON CACHE BOOL "" FORCE)

View File

@@ -34,6 +34,7 @@ set(WITH_IMAGE_HDR OFF CACHE BOOL "" FORCE)
set(WITH_IMAGE_OPENEXR OFF CACHE BOOL "" FORCE)
set(WITH_IMAGE_OPENJPEG OFF CACHE BOOL "" FORCE)
set(WITH_IMAGE_TIFF OFF CACHE BOOL "" FORCE)
set(WITH_IMAGE_WEBP OFF CACHE BOOL "" FORCE)
set(WITH_INPUT_NDOF OFF CACHE BOOL "" FORCE)
set(WITH_INTERNATIONAL OFF CACHE BOOL "" FORCE)
set(WITH_JACK OFF CACHE BOOL "" FORCE)

View File

@@ -31,6 +31,7 @@ set(WITH_IMAGE_HDR ON CACHE BOOL "" FORCE)
set(WITH_IMAGE_OPENEXR ON CACHE BOOL "" FORCE)
set(WITH_IMAGE_OPENJPEG ON CACHE BOOL "" FORCE)
set(WITH_IMAGE_TIFF ON CACHE BOOL "" FORCE)
set(WITH_IMAGE_WEBP ON CACHE BOOL "" FORCE)
set(WITH_INPUT_NDOF ON CACHE BOOL "" FORCE)
set(WITH_INPUT_IME ON CACHE BOOL "" FORCE)
set(WITH_INTERNATIONAL ON CACHE BOOL "" FORCE)

View File

@@ -71,6 +71,7 @@ set(CMAKE_PREFIX_PATH ${LIB_SUBDIRS})
# Find precompiled libraries, and avoid system or user-installed ones.
if(EXISTS ${LIBDIR})
include(platform_old_libs_update)
without_system_libs_begin()
endif()

View File

@@ -0,0 +1,37 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright 2022 Blender Foundation. All rights reserved.
# Auto update existing CMake caches for new libraries
function(unset_cache_variables pattern)
get_cmake_property(_cache_variables CACHE_VARIABLES)
foreach (_cache_variable ${_cache_variables})
if("${_cache_variable}" MATCHES "${pattern}")
unset(${_cache_variable} CACHE)
endif()
endforeach()
endfunction()
# Detect update from 3.1 to 3.2 libs.
if(UNIX AND
DEFINED OPENEXR_VERSION AND
OPENEXR_VERSION VERSION_LESS "3.0.0" AND
EXISTS ${LIBDIR}/imath)
message(STATUS "Auto updating CMake configuration for Blender 3.2 libraries")
unset_cache_variables("^OPENIMAGEIO")
unset_cache_variables("^OPENEXR")
unset_cache_variables("^IMATH")
unset_cache_variables("^PNG")
unset_cache_variables("^USD")
unset_cache_variables("^WEBP")
endif()
# Automatically set WebP on/off depending if libraries are available.
if(EXISTS ${LIBDIR}/webp)
if(WITH_OPENIMAGEIO)
set(WITH_IMAGE_WEBP ON CACHE BOOL "" FORCE)
endif()
else()
set(WITH_IMAGE_WEBP OFF)
endif()

View File

@@ -45,6 +45,9 @@ if(EXISTS ${LIBDIR})
# which is a part of OpenCollada. They have different ABI, and we
# do need to use the official one.
set(CMAKE_PREFIX_PATH ${LIBDIR}/zlib ${LIB_SUBDIRS})
include(platform_old_libs_update)
set(WITH_STATIC_LIBS ON)
# OpenMP usually can't be statically linked into shared libraries,
# due to not being compiled with position independent code.
@@ -373,6 +376,7 @@ if(WITH_IMAGE_WEBP)
find_package_wrapper(WebP)
if(NOT WEBP_FOUND)
set(WITH_IMAGE_WEBP OFF)
message(WARNING "WebP not found, disabling WITH_IMAGE_WEBP")
endif()
endif()
@@ -394,6 +398,9 @@ if(WITH_OPENIMAGEIO)
if(WITH_IMAGE_OPENEXR)
list(APPEND OPENIMAGEIO_LIBRARIES "${OPENEXR_LIBRARIES}")
endif()
if(WITH_IMAGE_WEBP)
list(APPEND OPENIMAGEIO_LIBRARIES "${WEBP_LIBRARIES}")
endif()
if(NOT OPENIMAGEIO_FOUND)
set(WITH_OPENIMAGEIO OFF)

View File

@@ -262,6 +262,8 @@ if(NOT EXISTS "${LIBDIR}/")
message(FATAL_ERROR "\n\nWindows requires pre-compiled libs at: '${LIBDIR}'. Please run `make update` in the blender source folder to obtain them.")
endif()
include(platform_old_libs_update)
if(CMAKE_GENERATOR MATCHES "^Visual Studio.+" AND # Only supported in the VS IDE
MSVC_VERSION GREATER_EQUAL 1924 AND # Supported for 16.4+
WITH_CLANG_TIDY # And Clang Tidy needs to be on
@@ -343,13 +345,18 @@ if(WITH_FFTW3)
set(FFTW3_LIBPATH ${FFTW3}/lib)
endif()
windows_find_package(WebP)
if(NOT WEBP_FOUND)
if(EXISTS ${LIBDIR}/webp)
set(WEBP_INCLUDE_DIRS ${LIBDIR}/webp/include)
set(WEBP_ROOT_DIR ${LIBDIR}/webp)
set(WEBP_LIBRARIES ${LIBDIR}/webp/lib/webp.lib ${LIBDIR}/webp/lib/webpdemux.lib ${LIBDIR}/webp/lib/webpmux.lib)
set(WEBP_FOUND ON)
if(WITH_IMAGE_WEBP)
windows_find_package(WebP)
if(NOT WEBP_FOUND)
if(EXISTS ${LIBDIR}/webp)
set(WEBP_INCLUDE_DIRS ${LIBDIR}/webp/include)
set(WEBP_ROOT_DIR ${LIBDIR}/webp)
set(WEBP_LIBRARIES ${LIBDIR}/webp/lib/webp.lib ${LIBDIR}/webp/lib/webpdemux.lib ${LIBDIR}/webp/lib/webpmux.lib)
set(WEBP_FOUND ON)
else()
message(STATUS "WITH_IMAGE_WEBP is ON but WEBP libraries are not found, setting WITH_IMAGE_WEBP=OFF")
set(WITH_IMAGE_WEBP OFF)
endif()
endif()
endif()
@@ -414,27 +421,60 @@ if(WITH_CODEC_FFMPEG)
endif()
if(WITH_IMAGE_OPENEXR)
windows_find_package(OpenEXR REQUIRED)
# Imath and OpenEXR have a single combined build option and include and library variables
# used by the rest of the build system.
set(IMATH_ROOT_DIR ${LIBDIR}/imath)
set(IMATH_VERSION "3.14")
windows_find_package(IMATH REQUIRED)
if(NOT IMATH_FOUND)
set(IMATH ${LIBDIR}/imath)
set(IMATH_INCLUDE_DIR ${IMATH}/include)
set(IMATH_INCLUDE_DIRS ${IMATH_INCLUDE_DIR} ${IMATH}/include/Imath)
set(IMATH_LIBPATH ${IMATH}/lib)
set(IMATH_LIBRARIES
optimized ${IMATH_LIBPATH}/Imath_s.lib
debug ${IMATH_LIBPATH}/Imath_s_d.lib
)
endif()
set(OPENEXR_ROOT_DIR ${LIBDIR}/openexr)
set(OPENEXR_VERSION "3.14")
windows_find_package(OPENEXR REQUIRED)
if(NOT OpenEXR_FOUND)
set(OPENEXR_ROOT_DIR ${LIBDIR}/openexr)
set(OPENEXR_VERSION "2.1")
warn_hardcoded_paths(OpenEXR)
set(OPENEXR ${LIBDIR}/openexr)
set(OPENEXR_INCLUDE_DIR ${OPENEXR}/include)
set(OPENEXR_INCLUDE_DIRS ${OPENEXR_INCLUDE_DIR} ${OPENEXR}/include/OpenEXR)
set(OPENEXR_INCLUDE_DIRS ${OPENEXR_INCLUDE_DIR} ${IMATH_INCLUDE_DIRS} ${OPENEXR}/include/OpenEXR)
set(OPENEXR_LIBPATH ${OPENEXR}/lib)
set(OPENEXR_LIBRARIES
optimized ${OPENEXR_LIBPATH}/Iex_s.lib
optimized ${OPENEXR_LIBPATH}/Half_s.lib
optimized ${OPENEXR_LIBPATH}/IlmImf_s.lib
optimized ${OPENEXR_LIBPATH}/Imath_s.lib
optimized ${OPENEXR_LIBPATH}/IlmThread_s.lib
debug ${OPENEXR_LIBPATH}/Iex_s_d.lib
debug ${OPENEXR_LIBPATH}/Half_s_d.lib
debug ${OPENEXR_LIBPATH}/IlmImf_s_d.lib
debug ${OPENEXR_LIBPATH}/Imath_s_d.lib
debug ${OPENEXR_LIBPATH}/IlmThread_s_d.lib
)
# Check if the 3.x library name exists
# if not assume this is a 2.x library folder
if(EXISTS "${OPENEXR_LIBPATH}/OpenEXR_s.lib")
set(OPENEXR_LIBRARIES
optimized ${OPENEXR_LIBPATH}/Iex_s.lib
optimized ${OPENEXR_LIBPATH}/IlmThread_s.lib
optimized ${OPENEXR_LIBPATH}/OpenEXR_s.lib
optimized ${OPENEXR_LIBPATH}/OpenEXRCore_s.lib
optimized ${OPENEXR_LIBPATH}/OpenEXRUtil_s.lib
debug ${OPENEXR_LIBPATH}/Iex_s_d.lib
debug ${OPENEXR_LIBPATH}/IlmThread_s_d.lib
debug ${OPENEXR_LIBPATH}/OpenEXR_s_d.lib
debug ${OPENEXR_LIBPATH}/OpenEXRCore_s_d.lib
debug ${OPENEXR_LIBPATH}/OpenEXRUtil_s_d.lib
${IMATH_LIBRARIES}
)
else()
set(OPENEXR_LIBRARIES
optimized ${OPENEXR_LIBPATH}/Iex_s.lib
optimized ${OPENEXR_LIBPATH}/Half_s.lib
optimized ${OPENEXR_LIBPATH}/IlmImf_s.lib
optimized ${OPENEXR_LIBPATH}/Imath_s.lib
optimized ${OPENEXR_LIBPATH}/IlmThread_s.lib
debug ${OPENEXR_LIBPATH}/Iex_s_d.lib
debug ${OPENEXR_LIBPATH}/Half_s_d.lib
debug ${OPENEXR_LIBPATH}/IlmImf_s_d.lib
debug ${OPENEXR_LIBPATH}/Imath_s_d.lib
debug ${OPENEXR_LIBPATH}/IlmThread_s_d.lib
)
endif()
endif()
endif()
@@ -500,8 +540,14 @@ if(WITH_BOOST)
if(NOT BOOST_VERSION)
message(FATAL_ERROR "Unable to determine Boost version")
endif()
set(BOOST_POSTFIX "vc141-mt-x64-${BOOST_VERSION}.lib")
set(BOOST_DEBUG_POSTFIX "vc141-mt-gd-x64-${BOOST_VERSION}.lib")
set(BOOST_POSTFIX "vc142-mt-x64-${BOOST_VERSION}.lib")
set(BOOST_DEBUG_POSTFIX "vc142-mt-gd-x64-${BOOST_VERSION}.lib")
if(NOT EXISTS ${BOOST_LIBPATH}/libboost_date_time-${BOOST_POSTFIX})
# If the new library names do not exist fall back to the old ones
# to ease the transition period between the libs.
set(BOOST_POSTFIX "vc141-mt-x64-${BOOST_VERSION}.lib")
set(BOOST_DEBUG_POSTFIX "vc141-mt-gd-x64-${BOOST_VERSION}.lib")
endif()
set(BOOST_LIBRARIES
optimized ${BOOST_LIBPATH}/libboost_date_time-${BOOST_POSTFIX}
optimized ${BOOST_LIBPATH}/libboost_filesystem-${BOOST_POSTFIX}
@@ -545,7 +591,6 @@ if(WITH_OPENIMAGEIO)
set(OIIO_DEBUG debug ${OPENIMAGEIO_LIBPATH}/OpenImageIO_d.lib debug ${OPENIMAGEIO_LIBPATH}/OpenImageIO_Util_d.lib)
set(OPENIMAGEIO_LIBRARIES ${OIIO_OPTIMIZED} ${OIIO_DEBUG})
endif()
set(OPENIMAGEIO_DEFINITIONS "-DUSE_TBB=0")
set(OPENIMAGEIO_IDIFF "${OPENIMAGEIO}/bin/idiff.exe")
add_definitions(-DOIIO_STATIC_DEFINE)
@@ -575,6 +620,7 @@ if(WITH_LLVM)
message(WARNING "LLVM debug libs not present on this system. Using release libs for debug builds.")
set(LLVM_LIBRARY ${LLVM_LIBRARY_OPTIMIZED})
endif()
endif()
if(WITH_OPENCOLORIO)
@@ -594,7 +640,6 @@ if(WITH_OPENCOLORIO)
debug ${OPENCOLORIO_LIBPATH}/pystring_d.lib
)
endif()
set(OPENCOLORIO_DEFINITIONS "-DOpenColorIO_SKIP_IMPORTS")
endif()
@@ -604,17 +649,24 @@ if(WITH_OPENVDB)
set(OPENVDB ${LIBDIR}/openVDB)
set(OPENVDB_LIBPATH ${OPENVDB}/lib)
set(OPENVDB_INCLUDE_DIRS ${OPENVDB}/include)
set(OPENVDB_LIBRARIES optimized ${OPENVDB_LIBPATH}/openvdb.lib debug ${OPENVDB_LIBPATH}/openvdb_d.lib)
set(OPENVDB_LIBRARIES optimized ${OPENVDB_LIBPATH}/openvdb.lib debug ${OPENVDB_LIBPATH}/openvdb_d.lib )
endif()
set(OPENVDB_DEFINITIONS -DNOMINMAX -D_USE_MATH_DEFINES)
endif()
if(WITH_NANOVDB)
set(NANOVDB ${LIBDIR}/nanoVDB)
set(NANOVDB ${LIBDIR}/openvdb)
set(NANOVDB_INCLUDE_DIR ${NANOVDB}/include)
if(NOT EXISTS "${NANOVDB_INCLUDE_DIR}/nanovdb")
# When not found, could be an older lib folder with where nanovdb
# had its own lib folder, to ease the transition period, fall back
# to that copy if the copy in openvdb is not found.
set(NANOVDB ${LIBDIR}/nanoVDB)
set(NANOVDB_INCLUDE_DIR ${NANOVDB}/include)
endif()
endif()
if(WITH_OPENIMAGEDENOISE)
set(OPENIMAGEDENOISE ${LIBDIR}/OpenImageDenoise)
set(OPENIMAGEDENOISE_LIBPATH ${LIBDIR}/OpenImageDenoise/lib)
@@ -640,7 +692,12 @@ endif()
if(WITH_IMAGE_OPENJPEG)
set(OPENJPEG ${LIBDIR}/openjpeg)
set(OPENJPEG_INCLUDE_DIRS ${OPENJPEG}/include/openjpeg-2.3)
set(OPENJPEG_INCLUDE_DIRS ${OPENJPEG}/include/openjpeg-2.4)
if(NOT EXISTS "${OPENJPEG_INCLUDE_DIRS}")
# when not found, could be an older lib folder with openjpeg 2.3
# to ease the transition period, fall back if 2.4 is not found.
set(OPENJPEG_INCLUDE_DIRS ${OPENJPEG}/include/openjpeg-2.3)
endif()
set(OPENJPEG_LIBRARIES ${OPENJPEG}/lib/openjp2.lib)
endif()
@@ -783,9 +840,16 @@ if(WITH_USD)
windows_find_package(USD)
if(NOT USD_FOUND)
set(USD_INCLUDE_DIRS ${LIBDIR}/usd/include)
set(USD_RELEASE_LIB ${LIBDIR}/usd/lib/libusd_m.lib)
set(USD_DEBUG_LIB ${LIBDIR}/usd/lib/libusd_m_d.lib)
set(USD_RELEASE_LIB ${LIBDIR}/usd/lib/usd_usd_m.lib)
set(USD_DEBUG_LIB ${LIBDIR}/usd/lib/usd_usd_m_d.lib)
set(USD_LIBRARY_DIR ${LIBDIR}/usd/lib)
# Older USD had different filenames, if the new ones are
# not found see if the older ones exist, to ease the
# transition period while landing libs.
if(NOT EXISTS "${USD_RELEASE_LIB}")
set(USD_RELEASE_LIB ${LIBDIR}/usd/lib/libusd_m.lib)
set(USD_DEBUG_LIB ${LIBDIR}/usd/lib/libusd_m_d.lib)
endif()
set(USD_LIBRARIES
debug ${USD_DEBUG_LIB}
optimized ${USD_RELEASE_LIB}

View File

@@ -114,12 +114,11 @@ def makefile_log() -> List[str]:
print("Can't execute process")
sys.exit(1)
while process.poll():
time.sleep(1)
# We know this is always true based on the input arguments to `Popen`.
stdout: IO[bytes] = process.stdout # type: ignore
stdout: IO[bytes] = process.stdout # type: ignore
out = stdout.read()
stdout.close()
@@ -210,7 +209,7 @@ def build_defines_as_source() -> str:
)
# We know this is always true based on the input arguments to `Popen`.
stdout: IO[bytes] = process.stdout # type: ignore
stdout: IO[bytes] = process.stdout # type: ignore
return cast(str, stdout.read().strip().decode('ascii'))
@@ -228,7 +227,7 @@ def build_defines_as_args() -> List[str]:
def queue_processes(
process_funcs: Sequence[Tuple[Callable[..., subprocess.Popen[Any]], Tuple[Any, ...]]],
*,
job_total: int =-1,
job_total: int = -1,
sleep: float = 0.1,
) -> None:
""" Takes a list of function arg pairs, each function must return a process

View File

@@ -143,8 +143,8 @@ def packages_path(current_directory: Path, cli_args: Any) -> Optional[Path]:
return Path(relpath)
### Manifest creation
# -----------------------------------------------------------------------------
# Manifest creation
def create_manifest(
@@ -195,7 +195,8 @@ def packages_to_manifest(outfile: TextIO, packages_dir: Path) -> None:
print(path, file=outfile)
### Higher-level functions
# -----------------------------------------------------------------------------
# Higher-level functions
def create_tarball(
@@ -249,7 +250,8 @@ def cleanup(manifest: Path) -> None:
print("OK")
## Low-level commands
# -----------------------------------------------------------------------------
# Low-level commands
def git_ls_files(directory: Path = Path(".")) -> Iterable[Path]:
@@ -265,7 +267,7 @@ def git_ls_files(directory: Path = Path(".")) -> Iterable[Path]:
yield path
def git_command(*cli_args: Union[bytes, str, Path] ) -> Iterable[str]:
def git_command(*cli_args: Union[bytes, str, Path]) -> Iterable[str]:
"""Generator, yields lines of output from a Git command."""
command = ("git", *cli_args)

View File

@@ -129,6 +129,7 @@ def svn_update(args, release_version):
call(svn_non_interactive + ["switch", svn_url + dirname, dirpath], exit_on_error=False)
call(svn_non_interactive + ["update", dirpath])
# Test if git repo can be updated.
def git_update_skip(args, check_remote_exists=True):
if make_utils.command_missing(args.git_command):

View File

@@ -47,8 +47,10 @@ def check_output(cmd, exit_on_error=True):
def git_branch_exists(git_command, branch):
return call([git_command, "rev-parse", "--verify", branch], exit_on_error=False, silent=True) == 0 or \
call([git_command, "rev-parse", "--verify", "remotes/origin/" + branch], exit_on_error=False, silent=True) == 0
return (
call([git_command, "rev-parse", "--verify", branch], exit_on_error=False, silent=True) == 0 or
call([git_command, "rev-parse", "--verify", "remotes/origin/" + branch], exit_on_error=False, silent=True) == 0
)
def git_branch(git_command):

View File

@@ -378,7 +378,8 @@ def usage():
def main():
import os, os.path
import os
import os.path
try:
bpy = __import__('bpy')

View File

@@ -103,10 +103,10 @@ blender \- a full-featured 3D application''')
.PP
.B blender
is a full-featured 3D application. It supports the entirety of the 3D pipeline - '''
'''modeling, rigging, animation, simulation, rendering, compositing, motion tracking, and video editing.
'''modeling, rigging, animation, simulation, rendering, compositing, motion tracking, and video editing.
Use Blender to create 3D images and animations, films and commercials, content for games, '''
r'''architectural and industrial visualizations, and scientific visualizations.
r'''architectural and industrial visualizations, and scientific visualizations.
https://www.blender.org''')

View File

@@ -11,6 +11,7 @@ import queue
execution_queue = queue.Queue()
# This function can safely be called in another thread.
# The function will be executed when the timer runs the next time.
def run_in_main_thread(function):

View File

@@ -9,7 +9,7 @@ operator in the different part of the user interface.
The context overrides are passed as a dictionary, with keys matching the context
member names in bpy.context.
For example to override ``bpy.context.active_object``,
you would pass ``{'active_object': object}``.
you would pass ``{'active_object': object}`` to :class:`bpy.types.Context.temp_override`.
.. note::
@@ -17,8 +17,10 @@ you would pass ``{'active_object': object}``.
(otherwise, you'll have to find and gather all needed data yourself).
"""
# remove all objects in scene rather than the selected ones
# Remove all objects in scene rather than the selected ones.
import bpy
override = bpy.context.copy()
override['selected_objects'] = list(bpy.context.scene.objects)
bpy.ops.object.delete(override)
from bpy import context
override = context.copy()
override["selected_objects"] = list(context.scene.objects)
with context.temp_override(**override):
bpy.ops.object.delete()

View File

@@ -1,17 +1,16 @@
"""
It is also possible to run an operator in a particular part of the user
interface. For this we need to pass the window, screen, area and sometimes
a region.
interface. For this we need to pass the window, area and sometimes a region.
"""
# maximize 3d view in all windows
# Maximize 3d view in all windows.
import bpy
from bpy import context
for window in bpy.context.window_manager.windows:
for window in context.window_manager.windows:
screen = window.screen
for area in screen.areas:
if area.type == 'VIEW_3D':
override = {'window': window, 'screen': screen, 'area': area}
bpy.ops.screen.screen_full_area(override)
with context.temp_override(window=window, area=area):
bpy.ops.screen.screen_full_area()
break

View File

@@ -33,6 +33,11 @@ There are 3 optional positional arguments (documented in detail below).
bpy.ops.test.operator(override_context, execution_context, undo)
- override_context - ``dict`` type.
.. deprecated:: 3.2
:class:`bpy.types.Context.temp_override` should be used instead of this argument.
- execution_context - ``str`` (enum).
- undo - ``bool`` type.

View File

@@ -4,6 +4,7 @@ the middle of updating the armature without having to update dependencies
after each change, by manually carrying updated matrices in a recursive walk.
"""
def set_pose_matrices(obj, matrix_map):
"Assign pose space matrices of all bones at once, ignoring constraints."
@@ -11,7 +12,7 @@ def set_pose_matrices(obj, matrix_map):
if pbone.name in matrix_map:
matrix = matrix_map[pbone.name]
## Instead of:
# # Instead of:
# pbone.matrix = matrix
# bpy.context.view_layer.update()

View File

@@ -0,0 +1,19 @@
"""
Overriding the context can be used to temporarily activate another ``window`` / ``area`` & ``region``,
as well as other members such as the ``active_object`` or ``bone``.
Notes:
- When overriding window, area and regions: the arguments must be consistent,
so any region argument that's passed in must be contained by the current area or the area passed in.
The same goes for the area needing to be contained in the current window.
- Temporary context overrides may be nested, when this is done, members will be added to the existing overrides.
- Context members are restored outside the scope of the context.
The only exception to this is when the data is no longer available.
In the event windowing data was removed (for example), the state of the context is left as-is.
While this isn't likely to happen, explicit window operation such as closing windows or loading a new file
remove the windowing data that was set before the temporary context was created.
"""

View File

@@ -0,0 +1,15 @@
"""
Overriding the context can be useful to set the context after loading files
(which would otherwise by None). For example:
"""
import bpy
from bpy import context
# Reload the current file and select all.
bpy.ops.wm.open_mainfile(filepath=bpy.data.filepath)
window = context.window_manager.windows[0]
with context.temp_override(window=window):
bpy.ops.mesh.primitive_uv_sphere_add()
# The context override is needed so it's possible to set edit-mode.
bpy.ops.object.mode_set(mode='EDIT')

View File

@@ -0,0 +1,16 @@
"""
This example shows how it's possible to add an object to the scene in another window.
"""
import bpy
from bpy import context
win_active = context.window
win_other = None
for win_iter in context.window_manager.windows:
if win_iter != win_active:
win_other = win_iter
break
# Add cube in the other window.
with context.temp_override(window=win_other):
bpy.ops.mesh.primitive_cube_add()

View File

@@ -42,10 +42,12 @@ class SimpleMouseOperator(bpy.types.Operator):
self.y = event.mouse_y
return self.execute(context)
# Only needed if you want to add into a dynamic menu
# Only needed if you want to add into a dynamic menu.
def menu_func(self, context):
self.layout.operator(SimpleMouseOperator.bl_idname, text="Simple Mouse Operator")
# Register and add to the view menu (required to also use F3 search "Simple Mouse Operator" for quick access)
bpy.utils.register_class(SimpleMouseOperator)
bpy.types.VIEW3D_MT_view.append(menu_func)

View File

@@ -37,7 +37,7 @@ class ExportSomeData(bpy.types.Operator):
return {'RUNNING_MODAL'}
# Only needed if you want to add into a dynamic menu
# Only needed if you want to add into a dynamic menu.
def menu_func(self, context):
self.layout.operator_context = 'INVOKE_DEFAULT'
self.layout.operator(ExportSomeData.bl_idname, text="Text Export Operator")

View File

@@ -27,7 +27,8 @@ class DialogOperator(bpy.types.Operator):
wm = context.window_manager
return wm.invoke_props_dialog(self)
# Only needed if you want to add into a dynamic menu
# Only needed if you want to add into a dynamic menu.
def menu_func(self, context):
self.layout.operator(DialogOperator.bl_idname, text="Dialog Operator")

View File

@@ -41,11 +41,13 @@ class CustomDrawOperator(bpy.types.Operator):
col.prop(self, "my_string")
# Only needed if you want to add into a dynamic menu
# Only needed if you want to add into a dynamic menu.
def menu_func(self, context):
self.layout.operator(CustomDrawOperator.bl_idname, text="Custom Draw Operator")
# Register and add to the object menu (required to also use F3 search "Custom Draw Operator" for quick access)
# Register and add to the object menu (required to also use F3 search "Custom Draw Operator" for quick access).
bpy.utils.register_class(CustomDrawOperator)
bpy.types.VIEW3D_MT_object.append(menu_func)

View File

@@ -55,11 +55,13 @@ class ModalOperator(bpy.types.Operator):
context.window_manager.modal_handler_add(self)
return {'RUNNING_MODAL'}
# Only needed if you want to add into a dynamic menu
# Only needed if you want to add into a dynamic menu.
def menu_func(self, context):
self.layout.operator(ModalOperator.bl_idname, text="Modal Operator")
# Register and add to the object menu (required to also use F3 search "Modal Operator" for quick access)
# Register and add to the object menu (required to also use F3 search "Modal Operator" for quick access).
bpy.utils.register_class(ModalOperator)
bpy.types.VIEW3D_MT_object.append(menu_func)

View File

@@ -31,10 +31,12 @@ class SearchEnumOperator(bpy.types.Operator):
context.window_manager.invoke_search_popup(self)
return {'RUNNING_MODAL'}
# Only needed if you want to add into a dynamic menu
# Only needed if you want to add into a dynamic menu.
def menu_func(self, context):
self.layout.operator(SearchEnumOperator.bl_idname, text="Search Enum Operator")
# Register and add to the object menu (required to also use F3 search "Search Enum Operator" for quick access)
bpy.utils.register_class(SearchEnumOperator)
bpy.types.VIEW3D_MT_object.append(menu_func)

View File

@@ -22,13 +22,15 @@ class HelloWorldOperator(bpy.types.Operator):
print("Hello World")
return {'FINISHED'}
# Only needed if you want to add into a dynamic menu
# Only needed if you want to add into a dynamic menu.
def menu_func(self, context):
self.layout.operator(HelloWorldOperator.bl_idname, text="Hello World Operator")
# Register and add to the view menu (required to also use F3 search "Hello World Operator" for quick access)
# Register and add to the view menu (required to also use F3 search "Hello World Operator" for quick access).
bpy.utils.register_class(HelloWorldOperator)
bpy.types.VIEW3D_MT_view.append(menu_func)
# test call to the newly defined operator
# Test call to the newly defined operator.
bpy.ops.wm.hello_world()

View File

@@ -409,7 +409,9 @@ BLENDER_VERSION_DOTS = "%d.%d" % (bpy.app.version[0], bpy.app.version[1])
if BLENDER_REVISION != "Unknown":
# SHA1 Git hash
BLENDER_VERSION_HASH = BLENDER_REVISION
BLENDER_VERSION_HASH_HTML_LINK = "<a href=https://developer.blender.org/rB%s>%s</a>" % (BLENDER_VERSION_HASH, BLENDER_VERSION_HASH)
BLENDER_VERSION_HASH_HTML_LINK = "<a href=https://developer.blender.org/rB%s>%s</a>" % (
BLENDER_VERSION_HASH, BLENDER_VERSION_HASH,
)
BLENDER_VERSION_DATE = time.strftime("%d/%m/%Y", time.localtime(BLENDER_REVISION_TIMESTAMP))
else:
# Fallback: Should not be used
@@ -1241,7 +1243,9 @@ def pycontext2sphinx(basepath):
try:
member_type, is_seq = context_type_map[member]
except KeyError:
raise SystemExit("Error: context key %r not found in context_type_map; update %s" % (member, __file__)) from None
raise SystemExit(
"Error: context key %r not found in context_type_map; update %s" %
(member, __file__)) from None
fw(" :type: %s :class:`bpy.types.%s`\n\n" % ("sequence of " if is_seq else "", member_type))
i += 1

View File

@@ -259,3 +259,10 @@ set(LIB
)
blender_add_lib(extern_mantaflow "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")
# The VDB libs above are only added to as INTERFACE libs by blender_add_lib,
# meaning extern_mantaflow itself actually does not have a dependency on the
# openvdb libraries, and CMAKE is free to link the vdb libs before
# extern_mantaflow causing linker errors on linux. By explicitly declaring
# a dependency here, cmake will do the right thing.
target_link_libraries(extern_mantaflow PRIVATE ${OPENVDB_LIBRARIES})

View File

@@ -10,6 +10,7 @@ import bpy
from bpy_extras.io_utils import ExportHelper
from bpy.props import PointerProperty, StringProperty
def strip(root):
root.text = None
root.tail = None
@@ -17,6 +18,7 @@ def strip(root):
for elem in root:
strip(elem)
def write(node, fname):
strip(node)
@@ -26,25 +28,31 @@ def write(node, fname):
f = open(fname, "w")
f.write(s)
class CyclesXMLSettings(bpy.types.PropertyGroup):
@classmethod
def register(cls):
bpy.types.Scene.cycles_xml = PointerProperty(
type=cls,
name="Cycles XML export Settings",
description="Cycles XML export settings")
type=cls,
name="Cycles XML export Settings",
description="Cycles XML export settings",
)
cls.filepath = StringProperty(
name='Filepath',
description='Filepath for the .xml file',
maxlen=256,
default='',
subtype='FILE_PATH')
name='Filepath',
description='Filepath for the .xml file',
maxlen=256,
default='',
subtype='FILE_PATH',
)
@classmethod
def unregister(cls):
del bpy.types.Scene.cycles_xml
# User Interface Drawing Code
# User Interface Drawing Code.
class RenderButtonsPanel():
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
@@ -114,22 +122,31 @@ class ExportCyclesXML(bpy.types.Operator, ExportHelper):
uvs += str(uvf.uv1[0]) + " " + str(uvf.uv1[1]) + " "
uvs += str(uvf.uv2[0]) + " " + str(uvf.uv2[1]) + " "
uvs += str(uvf.uv3[0]) + " " + str(uvf.uv3[1]) + " "
if vcount==4:
if vcount == 4:
uvs += " " + str(uvf.uv4[0]) + " " + str(uvf.uv4[1]) + " "
node = etree.Element('mesh', attrib={'nverts': nverts.strip(), 'verts': verts.strip(), 'P': P, 'UV' : uvs.strip()})
node = etree.Element(
'mesh',
attrib={
'nverts': nverts.strip(),
'verts': verts.strip(),
'P': P,
'UV': uvs.strip(),
})
# write to file
write(node, filepath)
return {'FINISHED'}
def register():
bpy.utils.register_module(__name__)
def unregister():
bpy.utils.unregister_module(__name__)
if __name__ == "__main__":
register()

View File

@@ -4,11 +4,14 @@
# <pep8 compliant>
# Fit to match default projective camera with focal_length 50 and sensor_width 36.
default_fisheye_polynomial = [-1.1735143712967577e-05,
-0.019988736953434998,
-3.3525322965709175e-06,
3.099275275886036e-06,
-2.6064646454854524e-08]
default_fisheye_polynomial = [
-1.1735143712967577e-05,
-0.019988736953434998,
-3.3525322965709175e-06,
3.099275275886036e-06,
-2.6064646454854524e-08,
]
# Utilities to generate lens polynomials to match built-in camera types, only here
# for reference at the moment, not used by the code.
@@ -51,7 +54,9 @@ def fisheye_lens_polynomial_from_equidistant(fov=180, sensor_width=36, sensor_he
return [0, -np.radians(fov) / sensor_width, 0, 0, 0]
def fisheye_lens_polynomial_from_distorted_projective_polynomial(k1, k2, k3, focal_length=50, sensor_width=36, sensor_height=None):
def fisheye_lens_polynomial_from_distorted_projective_polynomial(
k1, k2, k3, focal_length=50, sensor_width=36, sensor_height=None,
):
import numpy as np
rr = create_grid(sensor_height, sensor_width)
r2 = (rr / focal_length) ** 2
@@ -61,7 +66,10 @@ def fisheye_lens_polynomial_from_distorted_projective_polynomial(k1, k2, k3, foc
polynomial = np.polyfit(rr.flat, (-np.arctan(rr / focal_length * r_coeff)).flat, 4)
return list(reversed(polynomial))
def fisheye_lens_polynomial_from_distorted_projective_divisions(k1, k2, focal_length=50, sensor_width=36, sensor_height=None):
def fisheye_lens_polynomial_from_distorted_projective_divisions(
k1, k2, focal_length=50, sensor_width=36, sensor_height=None,
):
import numpy as np
rr = create_grid(sensor_height, sensor_width)
r2 = (rr / focal_length) ** 2

View File

@@ -98,6 +98,7 @@ def render_frame_finish(engine):
import _cycles
_cycles.render_frame_finish(engine.session)
def draw(engine, depsgraph, space_image):
if not engine.session:
return
@@ -168,6 +169,9 @@ def list_render_passes(scene, srl):
# Combined pass.
yield ("Combined", "RGBA", 'COLOR')
# Keep alignment for readability.
# autopep8: off
# Data passes.
if srl.use_pass_z: yield ("Depth", "Z", 'VALUE')
if srl.use_pass_mist: yield ("Mist", "Z", 'VALUE')
@@ -195,9 +199,11 @@ def list_render_passes(scene, srl):
if srl.use_pass_shadow: yield ("Shadow", "RGB", 'COLOR')
if srl.use_pass_ambient_occlusion: yield ("AO", "RGB", 'COLOR')
if crl.use_pass_shadow_catcher: yield ("Shadow Catcher", "RGB", 'COLOR')
# autopep8: on
# Debug passes.
if crl.pass_debug_sample_count: yield ("Debug Sample Count", "X", 'VALUE')
if crl.pass_debug_sample_count:
yield ("Debug Sample Count", "X", 'VALUE')
# Cryptomatte passes.
crypto_depth = (srl.pass_cryptomatte_depth + 1) // 2
@@ -217,9 +223,9 @@ def list_render_passes(scene, srl):
if crl.use_pass_shadow_catcher:
yield ("Noisy Shadow Catcher", "RGBA", 'COLOR')
if crl.denoising_store_passes:
yield ("Denoising Normal", "XYZ", 'VECTOR')
yield ("Denoising Albedo", "RGB", 'COLOR')
yield ("Denoising Depth", "Z", 'VALUE')
yield ("Denoising Normal", "XYZ", 'VECTOR')
yield ("Denoising Albedo", "RGB", 'COLOR')
yield ("Denoising Depth", "Z", 'VALUE')
# Custom AOV passes.
for aov in srl.aovs:

View File

@@ -34,8 +34,8 @@ class CYCLES_OT_use_shading_nodes(Operator):
class CYCLES_OT_denoise_animation(Operator):
"Denoise rendered animation sequence using current scene and view " \
"layer settings. Requires denoising data passes and output to " \
"OpenEXR multilayer files"
"layer settings. Requires denoising data passes and output to " \
"OpenEXR multilayer files"
bl_idname = "cycles.denoise_animation"
bl_label = "Denoise Animation"
@@ -117,7 +117,7 @@ class CYCLES_OT_denoise_animation(Operator):
class CYCLES_OT_merge_images(Operator):
"Combine OpenEXR multilayer images rendered with different sample " \
"ranges into one image with reduced noise"
"ranges into one image with reduced noise"
bl_idname = "cycles.merge_images"
bl_label = "Merge Images"

View File

@@ -85,6 +85,7 @@ class AddPresetViewportSampling(AddPresetBase, Operator):
preset_subdir = "cycles/viewport_sampling"
classes = (
AddPresetIntegrator,
AddPresetSampling,

View File

@@ -83,7 +83,8 @@ enum_sampling_pattern = (
enum_volume_sampling = (
('DISTANCE', "Distance", "Use distance sampling, best for dense volumes with lights far away"),
('EQUIANGULAR', "Equiangular", "Use equiangular sampling, best for volumes with low density with light inside or near the volume"),
('MULTIPLE_IMPORTANCE', "Multiple Importance", "Combine distance and equi-angular sampling for volumes where neither method is ideal"),
('MULTIPLE_IMPORTANCE', "Multiple Importance",
"Combine distance and equi-angular sampling for volumes where neither method is ideal"),
)
enum_volume_interpolation = (
@@ -181,7 +182,12 @@ def enum_preview_denoiser(self, context):
oidn_items = enum_openimagedenoise_denoiser(self, context)
if len(optix_items) or len(oidn_items):
items = [('AUTO', "Automatic", "Use the fastest available denoiser for viewport rendering (OptiX if available, OpenImageDenoise otherwise)", 0)]
items = [
('AUTO',
"Automatic",
("Use the fastest available denoiser for viewport rendering "
"(OptiX if available, OpenImageDenoise otherwise)"),
0)]
else:
items = [('AUTO', "None", "Blender was compiled without a viewport denoiser", 0)]
@@ -210,11 +216,14 @@ enum_denoising_prefilter = (
)
enum_direct_light_sampling_type = (
('MULTIPLE_IMPORTANCE_SAMPLING', "Multiple Importance Sampling", "Multiple importance sampling is used to combine direct light contributions from next-event estimation and forward path tracing", 0),
('MULTIPLE_IMPORTANCE_SAMPLING', "Multiple Importance Sampling",
"Multiple importance sampling is used to combine direct light contributions from next-event estimation and forward path tracing", 0),
('FORWARD_PATH_TRACING', "Forward Path Tracing", "Direct light contributions are only sampled using forward path tracing", 1),
('NEXT_EVENT_ESTIMATION', "Next-Event Estimation", "Direct light contributions are only sampled using next-event estimation", 2),
('NEXT_EVENT_ESTIMATION', "Next-Event Estimation",
"Direct light contributions are only sampled using next-event estimation", 2),
)
def update_render_passes(self, context):
view_layer = context.view_layer
view_layer.update_render_passes()
@@ -262,7 +271,7 @@ class CyclesRenderSettings(bpy.types.PropertyGroup):
description="Denoise the image with the selected denoiser. "
"For denoising the image after rendering",
items=enum_denoiser,
default=4, # Use integer to avoid error in builds without OpenImageDenoise.
default=4, # Use integer to avoid error in builds without OpenImageDenoise.
update=update_render_passes,
)
denoising_prefilter: EnumProperty(
@@ -1547,7 +1556,6 @@ class CyclesPreferences(bpy.types.AddonPreferences):
row.use_property_split = True
row.prop(self, "use_metalrt")
def draw(self, context):
self.draw_impl(self.layout, context)

View File

@@ -14,6 +14,7 @@ from bl_ui.properties_grease_pencil_common import GreasePencilSimplifyPanel
from bl_ui.properties_render import draw_curves_settings
from bl_ui.properties_view_layer import ViewLayerCryptomattePanel, ViewLayerAOVPanel, ViewLayerLightgroupsPanel
class CyclesPresetPanel(PresetPanel, Panel):
COMPAT_ENGINES = {'CYCLES'}
preset_operator = "script.execute_preset"
@@ -25,16 +26,19 @@ class CyclesPresetPanel(PresetPanel, Panel):
render = context.scene.render
render.filter_size = render.filter_size
class CYCLES_PT_sampling_presets(CyclesPresetPanel):
bl_label = "Sampling Presets"
preset_subdir = "cycles/sampling"
preset_add_operator = "render.cycles_sampling_preset_add"
class CYCLES_PT_viewport_sampling_presets(CyclesPresetPanel):
bl_label = "Viewport Sampling Presets"
preset_subdir = "cycles/viewport_sampling"
preset_add_operator = "render.cycles_viewport_sampling_preset_add"
class CYCLES_PT_integrator_presets(CyclesPresetPanel):
bl_label = "Integrator Presets"
preset_subdir = "cycles/integrator"
@@ -90,6 +94,7 @@ def use_metal(context):
return (get_device_type(context) == 'METAL' and cscene.device == 'GPU')
def use_cuda(context):
cscene = context.scene.cycles
@@ -101,11 +106,13 @@ def use_hip(context):
return (get_device_type(context) == 'HIP' and cscene.device == 'GPU')
def use_optix(context):
cscene = context.scene.cycles
return (get_device_type(context) == 'OPTIX' and cscene.device == 'GPU')
def use_multi_device(context):
cscene = context.scene.cycles
if cscene.device != 'GPU':
@@ -133,7 +140,6 @@ def get_effective_preview_denoiser(context):
return 'OIDN'
class CYCLES_RENDER_PT_sampling(CyclesButtonsPanel, Panel):
bl_label = "Sampling"
@@ -353,6 +359,7 @@ class CYCLES_RENDER_PT_curves(CyclesButtonsPanel, Panel):
if ccscene.shape == 'RIBBONS':
col.prop(ccscene, "subdivisions", text="Curve Subdivisions")
class CYCLES_RENDER_PT_curves_viewport_display(CyclesButtonsPanel, Panel):
bl_label = "Viewport Display"
bl_parent_id = "CYCLES_RENDER_PT_curves"
@@ -361,6 +368,7 @@ class CYCLES_RENDER_PT_curves_viewport_display(CyclesButtonsPanel, Panel):
def draw(self, context):
draw_curves_settings(self, context)
class CYCLES_RENDER_PT_volumes(CyclesButtonsPanel, Panel):
bl_label = "Volumes"
bl_options = {'DEFAULT_CLOSED'}
@@ -478,10 +486,10 @@ class CYCLES_RENDER_PT_light_paths_fast_gi(CyclesButtonsPanel, Panel):
col.prop(cscene, "fast_gi_method", text="Method")
if world:
light = world.light_settings
col = layout.column(align=True)
col.prop(light, "ao_factor", text="AO Factor")
col.prop(light, "distance", text="AO Distance")
light = world.light_settings
col = layout.column(align=True)
col.prop(light, "ao_factor", text="AO Factor")
col.prop(light, "distance", text="AO Distance")
if cscene.fast_gi_method == 'REPLACE':
col = layout.column(align=True)
@@ -1034,7 +1042,8 @@ class CYCLES_OBJECT_PT_motion_blur(CyclesButtonsPanel, Panel):
def poll(cls, context):
ob = context.object
if CyclesButtonsPanel.poll(context) and ob:
if ob.type in {'MESH', 'CURVE', 'CURVE', 'SURFACE', 'FONT', 'META', 'CAMERA', 'CURVES', 'POINTCLOUD', 'VOLUME'}:
if ob.type in {'MESH', 'CURVE', 'CURVE', 'SURFACE', 'FONT',
'META', 'CAMERA', 'CURVES', 'POINTCLOUD', 'VOLUME'}:
return True
if ob.instance_type == 'COLLECTION' and ob.instance_collection:
return True
@@ -1446,7 +1455,14 @@ class CYCLES_WORLD_PT_surface(CyclesButtonsPanel, Panel):
row.use_property_decorate = False
sub = row.column(align=True)
sub.prop_search(world, "lightgroup", view_layer, "lightgroups", text="Light Group", results_are_suggestions=True)
sub.prop_search(
world,
"lightgroup",
view_layer,
"lightgroups",
text="Light Group",
results_are_suggestions=True,
)
sub = row.column(align=True)
sub.active = bool(world.lightgroup) and not any(lg.name == world.lightgroup for lg in view_layer.lightgroups)
@@ -1572,7 +1588,6 @@ class CYCLES_WORLD_PT_settings_surface(CyclesButtonsPanel, Panel):
sub.prop(cworld, "is_caustics_light", text="Shadow Caustics")
class CYCLES_WORLD_PT_settings_volume(CyclesButtonsPanel, Panel):
bl_label = "Volume"
bl_parent_id = "CYCLES_WORLD_PT_settings"
@@ -1894,6 +1909,7 @@ class CYCLES_RENDER_PT_bake_output(CyclesButtonsPanel, Panel):
if cbk.target == 'IMAGE_TEXTURES':
layout.prop(cbk, "use_clear", text="Clear Image")
class CYCLES_RENDER_PT_bake_output_margin(CyclesButtonsPanel, Panel):
bl_label = "Margin"
bl_context = "render"
@@ -1932,7 +1948,6 @@ class CYCLES_RENDER_PT_bake_output_margin(CyclesButtonsPanel, Panel):
layout.prop(cbk, "margin", text="Size")
class CYCLES_RENDER_PT_debug(CyclesDebugButtonsPanel, Panel):
bl_label = "Debug"
bl_context = "render"

View File

@@ -72,7 +72,7 @@ def do_versions(self):
# Device might not currently be available so this can fail
try:
if system.legacy_compute_device_type == 1:
prop.compute_device_type = 'NONE' # Was OpenCL
prop.compute_device_type = 'NONE' # Was OpenCL
elif system.legacy_compute_device_type == 2:
prop.compute_device_type = 'CUDA'
else:
@@ -181,24 +181,24 @@ def do_versions(self):
if version <= (2, 92, 4):
if scene.render.engine == 'CYCLES':
for view_layer in scene.view_layers:
cview_layer = view_layer.cycles
view_layer.use_pass_cryptomatte_object = cview_layer.get("use_pass_crypto_object", False)
view_layer.use_pass_cryptomatte_material = cview_layer.get("use_pass_crypto_material", False)
view_layer.use_pass_cryptomatte_asset = cview_layer.get("use_pass_crypto_asset", False)
view_layer.pass_cryptomatte_depth = cview_layer.get("pass_crypto_depth", 6)
for view_layer in scene.view_layers:
cview_layer = view_layer.cycles
view_layer.use_pass_cryptomatte_object = cview_layer.get("use_pass_crypto_object", False)
view_layer.use_pass_cryptomatte_material = cview_layer.get("use_pass_crypto_material", False)
view_layer.use_pass_cryptomatte_asset = cview_layer.get("use_pass_crypto_asset", False)
view_layer.pass_cryptomatte_depth = cview_layer.get("pass_crypto_depth", 6)
if version <= (2, 93, 7):
if scene.render.engine == 'CYCLES':
for view_layer in scene.view_layers:
cview_layer = view_layer.cycles
for caov in cview_layer.get("aovs", []):
aov_name = caov.get("name", "AOV")
if aov_name in view_layer.aovs:
continue
baov = view_layer.aovs.add()
baov.name = caov.get("name", "AOV")
baov.type = "COLOR" if caov.get("type", 1) == 1 else "VALUE"
for view_layer in scene.view_layers:
cview_layer = view_layer.cycles
for caov in cview_layer.get("aovs", []):
aov_name = caov.get("name", "AOV")
if aov_name in view_layer.aovs:
continue
baov = view_layer.aovs.add()
baov.name = caov.get("name", "AOV")
baov.type = "COLOR" if caov.get("type", 1) == 1 else "VALUE"
if version <= (2, 93, 16):
cscene = scene.cycles

View File

@@ -62,7 +62,7 @@ typedef unsigned long long uint64_t;
#define ccl_gpu_block_idx_x (blockIdx.x)
#define ccl_gpu_grid_dim_x (gridDim.x)
#define ccl_gpu_warp_size (warpSize)
#define ccl_gpu_thread_mask(thread_warp) uint64_t(0xFFFFFFFFFFFFFFFF >> (64 - thread_warp))
#define ccl_gpu_thread_mask(thread_warp) uint(0xFFFFFFFF >> (ccl_gpu_warp_size - thread_warp))
#define ccl_gpu_global_id_x() (ccl_gpu_block_idx_x * ccl_gpu_block_dim_x + ccl_gpu_thread_idx_x)
#define ccl_gpu_global_size_x() (ccl_gpu_grid_dim_x * ccl_gpu_block_dim_x)

View File

@@ -64,12 +64,12 @@ struct ToNanoOp {
}
};
# endif
#endif
VDBImageLoader::VDBImageLoader(openvdb::GridBase::ConstPtr grid_, const string &grid_name)
: grid_name(grid_name), grid(grid_)
{
}
#endif
VDBImageLoader::VDBImageLoader(const string &grid_name) : grid_name(grid_name)
{

View File

@@ -17,7 +17,9 @@ CCL_NAMESPACE_BEGIN
class VDBImageLoader : public ImageLoader {
public:
#ifdef WITH_OPENVDB
VDBImageLoader(openvdb::GridBase::ConstPtr grid_, const string &grid_name);
#endif
VDBImageLoader(const string &grid_name);
~VDBImageLoader();

View File

@@ -496,7 +496,7 @@ void ObjectManager::device_update_object_transform(UpdateObjectTransformState *s
kobject.dupli_generated[2] = ob->dupli_generated[2];
kobject.numkeys = (geom->geometry_type == Geometry::HAIR) ?
static_cast<Hair *>(geom)->get_curve_keys().size() :
(geom->geometry_type == Geometry::POINTCLOUD) ?
(geom->geometry_type == Geometry::POINTCLOUD) ?
static_cast<PointCloud *>(geom)->num_points() :
0;
kobject.dupli_uv[0] = ob->dupli_uv[0];

View File

@@ -116,7 +116,11 @@ GHOST_Wintab *GHOST_Wintab::loadWintab(HWND hwnd)
}
int sanityQueueSize = queueSizeGet(hctx.get());
WINTAB_PRINTF("HCTX %p %s queueSize: %d, queueSizeGet: %d\n", hctx.get(), __func__, queueSize, sanityQueueSize);
WINTAB_PRINTF("HCTX %p %s queueSize: %d, queueSizeGet: %d\n",
hctx.get(),
__func__,
queueSize,
sanityQueueSize);
WINTAB_PRINTF("Loaded Wintab context %p\n", hctx.get());
@@ -274,7 +278,11 @@ void GHOST_Wintab::updateCursorInfo()
else {
m_maxAzimuth = m_maxAltitude = 0;
}
WINTAB_PRINTF("HCTX %p %s maxAzimuth: %d, maxAltitude: %d\n", m_context.get(), __func__, m_maxAzimuth, m_maxAltitude);
WINTAB_PRINTF("HCTX %p %s maxAzimuth: %d, maxAltitude: %d\n",
m_context.get(),
__func__,
m_maxAzimuth,
m_maxAltitude);
}
void GHOST_Wintab::processInfoChange(LPARAM lParam)
@@ -531,10 +539,10 @@ void GHOST_Wintab::printContextDebugInfo()
/* Print system information. */
printf("left: %d, top: %d, width: %d, height: %d\n",
::GetSystemMetrics(SM_XVIRTUALSCREEN),
::GetSystemMetrics(SM_YVIRTUALSCREEN),
::GetSystemMetrics(SM_CXVIRTUALSCREEN),
::GetSystemMetrics(SM_CYVIRTUALSCREEN));
::GetSystemMetrics(SM_XVIRTUALSCREEN),
::GetSystemMetrics(SM_YVIRTUALSCREEN),
::GetSystemMetrics(SM_CXVIRTUALSCREEN),
::GetSystemMetrics(SM_CYVIRTUALSCREEN));
auto printContextRanges = [](LOGCONTEXT &lc) {
printf("lcInOrgX: %d, lcInOrgY: %d, lcInExtX: %d, lcInExtY: %d\n",
@@ -576,7 +584,7 @@ void GHOST_Wintab::printContextDebugInfo()
m_fpInfo(WTI_DEFSYSCTX, CTX_SYSEXTY, &lc.lcSysExtY);
printf("WTI_DEFSYSCTX CTX_*\n");
printContextRanges(lc);
for (unsigned int i = 0; i < m_numDevices; i++) {
/* Print individual device system context. */
m_fpInfo(WTI_DSCTXS + i, 0, &lc);
@@ -604,13 +612,13 @@ void GHOST_Wintab::printContextDebugInfo()
m_fpInfo(WTI_DEVICES + i, DVC_X, &axis_x);
m_fpInfo(WTI_DEVICES + i, DVC_Y, &axis_y);
printf("WTI_DEVICES %u axis_x org: %d, axis_y org: %d axis_x ext: %d, axis_y ext: %d\n",
i,
axis_x.axMin,
axis_y.axMin,
axis_x.axMax - axis_x.axMin + 1,
axis_y.axMax - axis_y.axMin + 1);
i,
axis_x.axMin,
axis_y.axMin,
axis_x.axMax - axis_x.axMin + 1,
axis_y.axMax - axis_y.axMin + 1);
}
/* Other stuff while we have a logcontext. */
/* Other stuff while we have a log-context. */
printf("sysmode %d\n", lc.lcSysMode);
}
}

View File

@@ -18,6 +18,7 @@ class Version:
Version class that extracts the major, minor and build from
a version string
"""
def __init__(self, version: str):
self.version = version
v = version.split(".")
@@ -28,6 +29,7 @@ class Version:
def __str__(self) -> str:
return self.version
def get_download_file_names(version: Version):
yield f"blender-{version}-linux-x64.tar.xz"
yield f"blender-{version}-macos-x64.dmg"

View File

@@ -30,8 +30,9 @@ class ReleaseLogLine:
backend.
* url: (str) url of the ticket task or commit.
"""
def __init__(self, line: str):
self.line=line
self.line = line
items = line.split("|")
self.task_id = None
self.commit_id = None
@@ -54,10 +55,10 @@ class ReleaseLogLine:
self.title = ""
self.url = f"https://developer.blender.org/{self.ref}"
def __format_as_html(self)-> str:
def __format_as_html(self) -> str:
return f" <li>{self.title} [<a href=\"{self.url}\">{self.ref}</a>]</li>"
def __format_as_text(self) ->str:
def __format_as_text(self) -> str:
return f"* {self.title} [{self.ref}]"
def __format_as_steam(self) -> str:
@@ -110,7 +111,7 @@ def extract_release_notes(version: str, task_id: int):
description = task["description"]
lines = description.split("\n")
start_index = lines.index(f"## Blender {version} ##")
lines = lines[start_index+1:]
lines = lines[start_index + 1:]
for line in lines:
if not line.strip():
continue
@@ -125,7 +126,7 @@ def extract_release_notes(version: str, task_id: int):
log_line.title = format_title(issue_task.title)
yield log_line
elif log_line.commit_id:
commits = phab.diffusion.commit.search(constraints={"identifiers":[log_line.commit_id]})
commits = phab.diffusion.commit.search(constraints={"identifiers": [log_line.commit_id]})
commit = commits.data[0]
commit_message = commit['fields']['message']
commit_title = commit_message.split("\n")[0]

View File

@@ -91,7 +91,7 @@ __all__ = (
"pyViewMapGradientNormF0D",
"pyViewMapGradientNormF1D",
"pyViewMapGradientVectorF0D",
)
)
# module members
@@ -147,7 +147,7 @@ from _freestyle import (
VertexOrientation3DF0D,
ZDiscontinuityF0D,
ZDiscontinuityF1D,
)
)
# constructs for function definition in Python
from freestyle.types import (
@@ -157,7 +157,7 @@ from freestyle.types import (
UnaryFunction0DMaterial,
UnaryFunction0DVec2f,
UnaryFunction1DDouble,
)
)
from freestyle.utils import ContextFunctions as CF
from freestyle.utils import integrate
@@ -176,6 +176,7 @@ class CurveMaterialF0D(UnaryFunction0DMaterial):
Notes: expects instances of CurvePoint to be iterated over
can return None if no fedge can be found
"""
def __call__(self, inter):
fe = inter.object.fedge
if fe is None:
@@ -203,6 +204,7 @@ class pyCurvilinearLengthF0D(UnaryFunction0DDouble):
class pyDensityAnisotropyF0D(UnaryFunction0DDouble):
"""Estimates the anisotropy of density."""
def __init__(self, level):
UnaryFunction0DDouble.__init__(self)
self.IsoDensity = ReadCompleteViewMapPixelF0D(level)
@@ -233,6 +235,7 @@ class pyViewMapGradientVectorF0D(UnaryFunction0DVec2f):
:arg level: the level at which to compute the gradient
:type level: int
"""
def __init__(self, level):
UnaryFunction0DVec2f.__init__(self)
self._l = level
@@ -241,9 +244,9 @@ class pyViewMapGradientVectorF0D(UnaryFunction0DVec2f):
def __call__(self, iter):
p = iter.object.point_2d
gx = CF.read_complete_view_map_pixel(self._l, int(p.x + self._step), int(p.y)) - \
CF.read_complete_view_map_pixel(self._l, int(p.x), int(p.y))
CF.read_complete_view_map_pixel(self._l, int(p.x), int(p.y))
gy = CF.read_complete_view_map_pixel(self._l, int(p.x), int(p.y + self._step)) - \
CF.read_complete_view_map_pixel(self._l, int(p.x), int(p.y))
CF.read_complete_view_map_pixel(self._l, int(p.x), int(p.y))
return Vector((gx, gy))
@@ -256,9 +259,9 @@ class pyViewMapGradientNormF0D(UnaryFunction0DDouble):
def __call__(self, iter):
p = iter.object.point_2d
gx = CF.read_complete_view_map_pixel(self._l, int(p.x + self._step), int(p.y)) - \
CF.read_complete_view_map_pixel(self._l, int(p.x), int(p.y))
CF.read_complete_view_map_pixel(self._l, int(p.x), int(p.y))
gy = CF.read_complete_view_map_pixel(self._l, int(p.x), int(p.y + self._step)) - \
CF.read_complete_view_map_pixel(self._l, int(p.x), int(p.y))
CF.read_complete_view_map_pixel(self._l, int(p.x), int(p.y))
return Vector((gx, gy)).length
# -- Functions for 1D elements (curves) -- #
@@ -286,7 +289,10 @@ class pyDensityAnisotropyF1D(UnaryFunction1DDouble):
self._sampling = sampling
def __call__(self, inter):
v = integrate(self._func, inter.points_begin(self._sampling), inter.points_end(self._sampling), self._integration)
v = integrate(
self._func, inter.points_begin(
self._sampling), inter.points_end(
self._sampling), self._integration)
return v
@@ -298,5 +304,8 @@ class pyViewMapGradientNormF1D(UnaryFunction1DDouble):
self._sampling = sampling
def __call__(self, inter):
v = integrate(self._func, inter.points_begin(self._sampling), inter.points_end(self._sampling), self._integration)
v = integrate(
self._func, inter.points_begin(
self._sampling), inter.points_end(
self._sampling), self._integration)
return v

View File

@@ -71,7 +71,7 @@ __all__ = (
"pyTimeColorShader",
"pyTipRemoverShader",
"pyZDependingThicknessShader",
)
)
# module members
@@ -94,7 +94,7 @@ from _freestyle import (
StrokeTextureStepShader,
ThicknessNoiseShader,
TipRemoverShader,
)
)
# constructs for shader definition in Python
from freestyle.types import (
@@ -105,7 +105,7 @@ from freestyle.types import (
StrokeShader,
StrokeVertexIterator,
StrokeVertex,
)
)
from freestyle.functions import (
Curvature2DAngleF0D,
DensityF0D,
@@ -114,18 +114,18 @@ from freestyle.functions import (
Normal2DF0D,
Orientation2DF1D,
ZDiscontinuityF0D,
)
)
from freestyle.predicates import (
pyVertexNatureUP0D,
pyUEqualsUP0D,
)
)
from freestyle.utils import (
bound,
BoundingBox,
pairwise,
phase_to_direction,
)
)
from freestyle.utils import ContextFunctions as CF
@@ -145,6 +145,7 @@ class pyDepthDiscontinuityThicknessShader(StrokeShader):
Assigns a thickness to the stroke based on the stroke's distance
to the camera (Z-value).
"""
def __init__(self, min, max):
StrokeShader.__init__(self)
self.a = max - min
@@ -163,6 +164,7 @@ class pyConstantThicknessShader(StrokeShader):
"""
Assigns a constant thickness along the stroke.
"""
def __init__(self, thickness):
StrokeShader.__init__(self)
self._thickness = thickness / 2.0
@@ -176,6 +178,7 @@ class pyFXSVaryingThicknessWithDensityShader(StrokeShader):
"""
Assigns thickness to a stroke based on the density of the diffuse map.
"""
def __init__(self, wsize, threshold_min, threshold_max, thicknessMin, thicknessMax):
StrokeShader.__init__(self)
self._func = DensityF0D(wsize)
@@ -200,6 +203,7 @@ class pyIncreasingThicknessShader(StrokeShader):
"""
Increasingly thickens the stroke.
"""
def __init__(self, thicknessMin, thicknessMax):
StrokeShader.__init__(self)
self._thicknessMin = thicknessMin
@@ -221,6 +225,7 @@ class pyConstrainedIncreasingThicknessShader(StrokeShader):
Increasingly thickens the stroke, constrained by a ratio of the
stroke's length.
"""
def __init__(self, thicknessMin, thicknessMax, ratio):
StrokeShader.__init__(self)
self._thicknessMin = thicknessMin
@@ -248,6 +253,7 @@ class pyDecreasingThicknessShader(StrokeShader):
"""
Inverse of pyIncreasingThicknessShader, decreasingly thickens the stroke.
"""
def __init__(self, thicknessMin, thicknessMax):
StrokeShader.__init__(self)
self._thicknessMin = thicknessMin
@@ -269,6 +275,7 @@ class pyNonLinearVaryingThicknessShader(StrokeShader):
"""
Assigns thickness to a stroke based on an exponential function.
"""
def __init__(self, thicknessExtremity, thicknessMiddle, exponent):
self._thicknessMin = thicknessMiddle
self._thicknessMax = thicknessExtremity
@@ -288,6 +295,7 @@ class pySLERPThicknessShader(StrokeShader):
"""
Assigns thickness to a stroke based on spherical linear interpolation.
"""
def __init__(self, thicknessMin, thicknessMax, omega=1.2):
StrokeShader.__init__(self)
self._thicknessMin = thicknessMin
@@ -302,9 +310,9 @@ class pySLERPThicknessShader(StrokeShader):
for i, svert in enumerate(stroke):
c = i / n
if i < (n * 0.5):
t = sin((1-c) * omega) / sinhyp * self._thicknessMin + sin(c * omega) / sinhyp * maxT
t = sin((1 - c) * omega) / sinhyp * self._thicknessMin + sin(c * omega) / sinhyp * maxT
else:
t = sin((1-c) * omega) / sinhyp * maxT + sin(c * omega) / sinhyp * self._thicknessMin
t = sin((1 - c) * omega) / sinhyp * maxT + sin(c * omega) / sinhyp * self._thicknessMin
svert.attribute.thickness = (t / 2.0, t / 2.0)
@@ -312,6 +320,7 @@ class pyTVertexThickenerShader(StrokeShader):
"""
Thickens TVertices (visual intersections between two edges).
"""
def __init__(self, a=1.5, n=3):
StrokeShader.__init__(self)
self._a = a
@@ -342,6 +351,7 @@ class pyImportance2DThicknessShader(StrokeShader):
the thickness is inverted, so the vertices closest to the
specified point have the lowest thickness.
"""
def __init__(self, x, y, w, kmin, kmax):
StrokeShader.__init__(self)
self._origin = Vector((x, y))
@@ -352,16 +362,17 @@ class pyImportance2DThicknessShader(StrokeShader):
for svert in stroke:
d = (svert.point_2d - self._origin).length
k = (self._kmin if (d > self._w) else
(self._kmax * (self._w-d) + self._kmin * d) / self._w)
(self._kmax * (self._w - d) + self._kmin * d) / self._w)
(tr, tl) = svert.attribute.thickness
svert.attribute.thickness = (k*tr/2.0, k*tl/2.0)
svert.attribute.thickness = (k * tr / 2.0, k * tl / 2.0)
class pyImportance3DThicknessShader(StrokeShader):
"""
Assigns thickness based on distance to a given point in 3D space.
"""
def __init__(self, x, y, z, w, kmin, kmax):
StrokeShader.__init__(self)
self._origin = Vector((x, y, z))
@@ -372,10 +383,10 @@ class pyImportance3DThicknessShader(StrokeShader):
for svert in stroke:
d = (svert.point_3d - self._origin).length
k = (self._kmin if (d > self._w) else
(self._kmax * (self._w-d) + self._kmin * d) / self._w)
(self._kmax * (self._w - d) + self._kmin * d) / self._w)
(tr, tl) = svert.attribute.thickness
svert.attribute.thickness = (k*tr/2.0, k*tl/2.0)
svert.attribute.thickness = (k * tr / 2.0, k * tl / 2.0)
class pyZDependingThicknessShader(StrokeShader):
@@ -383,6 +394,7 @@ class pyZDependingThicknessShader(StrokeShader):
Assigns thickness based on an object's local Z depth (point
closest to camera is 1, point furthest from camera is zero).
"""
def __init__(self, min, max):
StrokeShader.__init__(self)
self.__min = min
@@ -408,10 +420,12 @@ class pyConstantColorShader(StrokeShader):
"""
Assigns a constant color to the stroke.
"""
def __init__(self,r,g,b, a = 1):
def __init__(self, r, g, b, a=1):
StrokeShader.__init__(self)
self._color = (r, g, b)
self._a = a
def shade(self, stroke):
for svert in stroke:
svert.attribute.color = self._color
@@ -422,10 +436,11 @@ class pyIncreasingColorShader(StrokeShader):
"""
Fades from one color to another along the stroke.
"""
def __init__(self,r1,g1,b1,a1, r2,g2,b2,a2):
def __init__(self, r1, g1, b1, a1, r2, g2, b2, a2):
StrokeShader.__init__(self)
# use 4d vector to simplify math
self._c1 = Vector((r1, g1 ,b1, a1))
self._c1 = Vector((r1, g1, b1, a1))
self._c2 = Vector((r2, g2, b2, a2))
def shade(self, stroke):
@@ -442,10 +457,11 @@ class pyInterpolateColorShader(StrokeShader):
"""
Fades from one color to another and back.
"""
def __init__(self,r1,g1,b1,a1, r2,g2,b2,a2):
def __init__(self, r1, g1, b1, a1, r2, g2, b2, a2):
StrokeShader.__init__(self)
# use 4d vector to simplify math
self._c1 = Vector((r1, g1 ,b1, a1))
self._c1 = Vector((r1, g1, b1, a1))
self._c2 = Vector((r2, g2, b2, a2))
def shade(self, stroke):
@@ -461,10 +477,12 @@ class pyModulateAlphaShader(StrokeShader):
"""
Limits the stroke's alpha between a min and max value.
"""
def __init__(self, min=0, max=1):
StrokeShader.__init__(self)
self.__min = min
self.__max = max
def shade(self, stroke):
for svert in stroke:
alpha = svert.attribute.alpha
@@ -476,6 +494,7 @@ class pyMaterialColorShader(StrokeShader):
"""
Assigns the color of the underlying material to the stroke.
"""
def __init__(self, threshold=50):
StrokeShader.__init__(self)
self._threshold = threshold
@@ -504,7 +523,7 @@ class pyMaterialColorShader(StrokeShader):
u = 4.0 * X / (X + 15.0 * Y + 3.0 * Z)
v = 9.0 * Y / (X + 15.0 * Y + 3.0 * Z)
L= 116. * pow((Y/Yn),(1./3.)) - 16
L = 116. * pow((Y / Yn), (1. / 3.)) - 16
U = 13. * L * (u - un)
V = 13. * L * (v - vn)
@@ -512,16 +531,16 @@ class pyMaterialColorShader(StrokeShader):
L /= 1.3
U += 10.
else:
L = L + 2.5 * (100-L) * 0.2
L = L + 2.5 * (100 - L) * 0.2
U /= 3.0
V /= 3.0
u = U / (13.0 * L) + un
v = V / (13.0 * L) + vn
Y = Yn * pow(((L+16.)/116.), 3.)
X = -9. * Y * u / ((u - 4.)* v - u * v)
Z = (9. * Y - 15*v*Y - v*X) /( 3. * v)
Y = Yn * pow(((L + 16.) / 116.), 3.)
X = -9. * Y * u / ((u - 4.) * v - u * v)
Z = (9. * Y - 15 * v * Y - v * X) / (3. * v)
r = 3.240479 * X - 1.53715 * Y - 0.498535 * Z
g = -0.969256 * X + 1.875991 * Y + 0.041556 * Z
@@ -538,6 +557,7 @@ class pyRandomColorShader(StrokeShader):
"""
Assigns a color to the stroke based on given seed.
"""
def __init__(self, s=1):
StrokeShader.__init__(self)
random.seed = s
@@ -555,6 +575,7 @@ class py2DCurvatureColorShader(StrokeShader):
Assigns a color (grayscale) to the stroke based on the curvature.
A higher curvature will yield a brighter color.
"""
def shade(self, stroke):
func = Curvature2DAngleF0D()
it = Interface0DIterator(stroke)
@@ -571,9 +592,11 @@ class pyTimeColorShader(StrokeShader):
Assigns a grayscale value that increases for every vertex.
The brightness will increase along the stroke.
"""
def __init__(self, step=0.01):
StrokeShader.__init__(self)
self._step = step
def shade(self, stroke):
for i, svert in enumerate(stroke):
c = i * self._step
@@ -588,6 +611,7 @@ class pySamplingShader(StrokeShader):
Resamples the stroke, which gives the stroke the amount of
vertices specified.
"""
def __init__(self, sampling):
StrokeShader.__init__(self)
self._sampling = sampling
@@ -601,6 +625,7 @@ class pyBackboneStretcherShader(StrokeShader):
"""
Stretches the stroke's backbone by a given length (in pixels).
"""
def __init__(self, l):
StrokeShader.__init__(self)
self._l = l
@@ -610,7 +635,7 @@ class pyBackboneStretcherShader(StrokeShader):
v0, vn = stroke[0], stroke[-1]
p0, pn = v0.point, vn.point
# get the direction
d1 = (p0 - stroke[ 1].point).normalized()
d1 = (p0 - stroke[1].point).normalized()
dn = (pn - stroke[-2].point).normalized()
v0.point += d1 * self._l
vn.point += dn * self._l
@@ -623,15 +648,17 @@ class pyLengthDependingBackboneStretcherShader(StrokeShader):
NOTE: you'll probably want an l somewhere between (0.5 - 0). A value that
is too high may yield unexpected results.
"""
def __init__(self, l):
StrokeShader.__init__(self)
self._l = l
def shade(self, stroke):
# get start and end points
v0, vn = stroke[0], stroke[-1]
p0, pn = v0.point, vn.point
# get the direction
d1 = (p0 - stroke[ 1].point).normalized()
d1 = (p0 - stroke[1].point).normalized()
dn = (pn - stroke[-2].point).normalized()
v0.point += d1 * self._l * stroke.length_2d
vn.point += dn * self._l * stroke.length_2d
@@ -662,6 +689,7 @@ class pyBackboneStretcherNoCuspShader(StrokeShader):
"""
Stretches the stroke's backbone, excluding cusp vertices (end junctions).
"""
def __init__(self, l):
StrokeShader.__init__(self)
self._l = l
@@ -689,6 +717,7 @@ class pyDiffusion2Shader(StrokeShader):
point. The offset is scaled by the 2D curvature (i.e. how quickly
the stroke curve is) at the point.
"""
def __init__(self, lambda1, nbIter):
StrokeShader.__init__(self)
self._lambda = lambda1
@@ -697,7 +726,7 @@ class pyDiffusion2Shader(StrokeShader):
self._curvatureInfo = Curvature2DAngleF0D()
def shade(self, stroke):
for i in range (1, self._nbIter):
for i in range(1, self._nbIter):
it = Interface0DIterator(stroke)
for svert in it:
svert.point += self._normalInfo(it) * self._lambda * self._curvatureInfo(it)
@@ -708,6 +737,7 @@ class pyTipRemoverShader(StrokeShader):
"""
Removes the tips of the stroke.
"""
def __init__(self, l):
StrokeShader.__init__(self)
self._l = l
@@ -716,7 +746,7 @@ class pyTipRemoverShader(StrokeShader):
def check_vertex(v, length):
# Returns True if the given strokevertex is less than self._l away
# from the stroke's tip and therefore should be removed.
return (v.curvilinear_abscissa < length or v.stroke_length-v.curvilinear_abscissa < length)
return (v.curvilinear_abscissa < length or v.stroke_length - v.curvilinear_abscissa < length)
def shade(self, stroke):
n = len(stroke)
@@ -747,6 +777,7 @@ class pyTVertexRemoverShader(StrokeShader):
"""
Removes t-vertices from the stroke.
"""
def shade(self, stroke):
if len(stroke) < 4:
return
@@ -764,6 +795,7 @@ class pyHLRShader(StrokeShader):
Controls visibility based upon the quantitative invisibility (QI)
based on hidden line removal (HLR).
"""
def shade(self, stroke):
if len(stroke) < 4:
return
@@ -779,6 +811,7 @@ class pySinusDisplacementShader(StrokeShader):
"""
Displaces the stroke in the shape of a sine wave.
"""
def __init__(self, f, a):
StrokeShader.__init__(self)
self._f = f
@@ -801,6 +834,7 @@ class pyPerlinNoise1DShader(StrokeShader):
that lines with the same length and sampling interval will be
identically distorded.
"""
def __init__(self, freq=10, amp=10, oct=4, seed=-1):
StrokeShader.__init__(self)
self.__noise = Noise(seed)
@@ -824,6 +858,7 @@ class pyPerlinNoise2DShader(StrokeShader):
More information on the noise shaders can be found at:
freestyleintegration.wordpress.com/2011/09/25/development-updates-on-september-25/
"""
def __init__(self, freq=10, amp=10, oct=4, seed=-1):
StrokeShader.__init__(self)
self.__noise = Noise(seed)
@@ -842,6 +877,7 @@ class pyBluePrintCirclesShader(StrokeShader):
"""
Draws the silhouette of the object as a circle.
"""
def __init__(self, turns=1, random_radius=3, random_center=5):
StrokeShader.__init__(self)
self.__turns = turns
@@ -939,7 +975,7 @@ class pyBluePrintEllipsesShader(StrokeShader):
class pyBluePrintSquaresShader(StrokeShader):
def __init__(self, turns=1, bb_len=10, bb_rand=0):
StrokeShader.__init__(self)
self.__turns = turns # does not have any effect atm
self.__turns = turns # does not have any effect atm
self.__bb_len = bb_len
self.__bb_rand = bb_rand
@@ -968,7 +1004,7 @@ class pyBluePrintSquaresShader(StrokeShader):
Vector((p_min.x - bb_len, p_max.y)),
Vector((p_min.x, p_max.y + bb_len)),
Vector((p_min.x, p_min.y - bb_len)),
)
)
# add randomization to the points (if needed)
if self.__bb_rand:
@@ -983,12 +1019,11 @@ class pyBluePrintSquaresShader(StrokeShader):
Vector((randint(-R, R), randint(-r, r))),
Vector((randint(-r, r), randint(-R, R))),
Vector((randint(-r, r), randint(-R, R))),
)
)
# combine both tuples
points = tuple(p + rand for (p, rand) in zip(points, randomization_mat))
# subtract even from uneven; result is length four tuple of vectors
it = iter(points)
old_vecs = tuple(next(it) - current for current in it)
@@ -1026,6 +1061,7 @@ class pyBluePrintDirectedSquaresShader(StrokeShader):
"""
Replaces the stroke with a directed square.
"""
def __init__(self, turns=1, bb_len=10, mult=1):
StrokeShader.__init__(self)
self.__mult = mult
@@ -1055,12 +1091,15 @@ class pyBluePrintDirectedSquaresShader(StrokeShader):
lambda1, lambda2 = max(1e-12, lambda1), max(1e-12, lambda2)
theta = atan(2 * p_var_xy / (p_var.x - p_var.y)) / 2
# Keep alignment for readability.
# autopep8: off
if p_var.y > p_var.x:
e1 = Vector((cos(theta + pi / 2), sin(theta + pi / 2))) * sqrt(lambda1) * self.__mult
e2 = Vector((cos(theta + pi ), sin(theta + pi ))) * sqrt(lambda2) * self.__mult
else:
e1 = Vector((cos(theta), sin(theta))) * sqrt(lambda1) * self.__mult
e2 = Vector((cos(theta + pi / 2), sin(theta + pi / 2))) * sqrt(lambda2) * self.__mult
# autopep8: on
# partition the stroke
num_segments = len(stroke) // self.__turns
@@ -1075,14 +1114,14 @@ class pyBluePrintDirectedSquaresShader(StrokeShader):
p_mean - e1 * bb_len1 + e2,
p_mean + e1 + e2 * bb_len2,
p_mean + e1 * bb_len1 - e2,
)
)
old_vecs = (
e2 * bb_len2 * 2,
e1 * bb_len1 * 2,
-e2 * bb_len2 * 2,
-e1 * bb_len1 * 2,
)
-e2 * bb_len2 * 2,
-e1 * bb_len1 * 2,
)
it = iter(stroke)
verticesToRemove = list()

View File

@@ -10,11 +10,11 @@ from freestyle.predicates import (
NotUP1D,
QuantitativeInvisibilityUP1D,
TrueUP1D,
)
)
from freestyle.shaders import (
BackboneStretcherShader,
ConstantColorShader,
)
)
from freestyle.types import Operators
@@ -23,5 +23,5 @@ Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(QuantitativeInv
shaders_list = [
ConstantColorShader(0.5, 0.5, 0.5),
BackboneStretcherShader(20),
]
]
Operators.create(TrueUP1D(), shaders_list)

View File

@@ -14,11 +14,11 @@ from freestyle.predicates import (
TrueUP1D,
pyHigherLengthUP1D,
pyParameterUP0D,
)
)
from freestyle.shaders import (
ConstantThicknessShader,
IncreasingColorShader,
)
)
from freestyle.types import Operators
@@ -29,5 +29,5 @@ Operators.recursive_split(func, pyParameterUP0D(0.4, 0.6), NotUP1D(pyHigherLengt
shaders_list = [
ConstantThicknessShader(10),
IncreasingColorShader(1, 0, 0, 1, 0, 1, 0, 1),
]
]
Operators.create(TrueUP1D(), shaders_list)

View File

@@ -192,6 +192,8 @@ PYGETTEXT_CONTEXTS_DEFSRC = os.path.join("source", "blender", "blentranslation",
# XXX Not full-proof, but should be enough here!
PYGETTEXT_CONTEXTS = "#define\\s+(BLT_I18NCONTEXT_[A-Z_0-9]+)\\s+\"([^\"]*)\""
# autopep8: off
# Keywords' regex.
# XXX Most unfortunately, we can't use named backreferences inside character sets,
# which makes the regexes even more twisty... :/
@@ -256,6 +258,9 @@ PYGETTEXT_KEYWORDS = (() +
for it in ("BLT_I18N_MSGID_MULTI_CTXT",))
)
# autopep8: on
# Check printf mismatches between msgid and msgstr.
CHECK_PRINTF_FORMAT = (
r"(?!<%)(?:%%)*%" # Beginning, with handling for crazy things like '%%%%%s'
@@ -605,7 +610,10 @@ class I18nSettings:
def to_json(self):
# Only save the diff from default i18n_settings!
glob = globals()
export_dict = {uid: val for uid, val in self.__dict__.items() if _check_valid_data(uid, val) and glob.get(uid) != val}
export_dict = {
uid: val for uid, val in self.__dict__.items()
if _check_valid_data(uid, val) and glob.get(uid) != val
}
return json.dumps(export_dict)
def load(self, fname, reset=False):

View File

@@ -61,7 +61,7 @@ def language_menu(args, settings):
po_to_uid = {os.path.basename(po_path_branch): uid
for can_use, uid, _num_id, _name, _isocode, po_path_branch
in utils_i18n.list_po_dir(settings.BRANCHES_DIR, settings)
in utils_i18n.list_po_dir(settings.BRANCHES_DIR, settings)
if can_use}
for po_dir in os.listdir(settings.BRANCHES_DIR):
po_dir = os.path.join(settings.BRANCHES_DIR, po_dir)

View File

@@ -80,7 +80,7 @@ def do_previews(do_objects, do_collections, do_scenes, do_data_intern):
backup_camera, backup_camera_data = [None] * 2
camera_data = bpy.data.cameras.new("TEMP_preview_render_camera")
camera = bpy.data.objects.new("TEMP_preview_render_camera", camera_data)
camera.rotation_euler = Euler((1.1635528802871704, 0.0, 0.7853981852531433), 'XYZ') # (66.67, 0.0, 45.0)
camera.rotation_euler = Euler((1.1635528802871704, 0.0, 0.7853981852531433), 'XYZ') # (66.67, 0, 45)
scene.camera = camera
scene.collection.objects.link(camera)
# TODO: add light if none found in scene?
@@ -100,11 +100,11 @@ def do_previews(do_objects, do_collections, do_scenes, do_data_intern):
scene.world = world
camera.rotation_euler = Euler((1.1635528802871704, 0.0, 0.7853981852531433), 'XYZ') # (66.67, 0.0, 45.0)
camera.rotation_euler = Euler((1.1635528802871704, 0.0, 0.7853981852531433), 'XYZ') # (66.67, 0, 45)
scene.camera = camera
scene.collection.objects.link(camera)
light.rotation_euler = Euler((0.7853981852531433, 0.0, 1.7453292608261108), 'XYZ') # (45.0, 0.0, 100.0)
light.rotation_euler = Euler((0.7853981852531433, 0.0, 1.7453292608261108), 'XYZ') # (45, 0, 100)
light_data.falloff_type = 'CONSTANT'
light_data.spot_size = 1.0471975803375244 # 60
scene.collection.objects.link(light)

File diff suppressed because it is too large Load Diff

View File

@@ -204,6 +204,7 @@ def draw(layout, context, context_member, property_type, *, use_edit=True):
# Add some spacing, so the right side of the buttons line up with layouts with decorators.
operator_row.label(text="", icon='BLANK1')
class PropertyPanel:
"""
The subclass should have its own poll function

View File

@@ -319,6 +319,7 @@ class Prefs(bpy.types.KeyConfigPreferences):
col.label(text="File Browser")
col.row().prop(self, "use_file_single_click")
blender_default = bpy.utils.execfile(os.path.join(DIRNAME, "keymap_data", "blender_default.py"))

View File

@@ -10,6 +10,7 @@ import bpy
DIRNAME, FILENAME = os.path.split(__file__)
IDNAME = os.path.splitext(FILENAME)[0]
def update_fn(_self, _context):
load()
@@ -33,5 +34,6 @@ def load():
keyconfig_init_from_data(kc, keyconfig_data)
if __name__ == "__main__":
load()

View File

@@ -19,6 +19,7 @@ __all__ = (
# ------------------------------------------------------------------------------
# Configurable Parameters
class Params:
__slots__ = (
"apple",
@@ -604,18 +605,18 @@ def km_window(params):
{"type": k, "value": 'PRESS', "shift": True},
{"properties": [("space_type", t)]})
for k, t in (
('F1', 'FILE_BROWSER'),
('F2', 'CLIP_EDITOR'),
('F3', 'NODE_EDITOR'),
('F4', 'CONSOLE'),
('F5', 'VIEW_3D'),
('F6', 'GRAPH_EDITOR'),
('F7', 'PROPERTIES'),
('F8', 'SEQUENCE_EDITOR'),
('F9', 'OUTLINER'),
('F10', 'IMAGE_EDITOR'),
('F11', 'TEXT_EDITOR'),
('F12', 'DOPESHEET_EDITOR'),
('F1', 'FILE_BROWSER'),
('F2', 'CLIP_EDITOR'),
('F3', 'NODE_EDITOR'),
('F4', 'CONSOLE'),
('F5', 'VIEW_3D'),
('F6', 'GRAPH_EDITOR'),
('F7', 'PROPERTIES'),
('F8', 'SEQUENCE_EDITOR'),
('F9', 'OUTLINER'),
('F10', 'IMAGE_EDITOR'),
('F11', 'TEXT_EDITOR'),
('F12', 'DOPESHEET_EDITOR'),
)
),
@@ -2959,6 +2960,7 @@ def km_sequencerpreview(params):
("sequencer.select_box", {"type": 'B', "value": 'PRESS'}, None),
# View.
("sequencer.view_selected", {"type": 'NUMPAD_PERIOD', "value": 'PRESS'}, None),
("sequencer.view_all_preview", {"type": 'HOME', "value": 'PRESS'}, None),
("sequencer.view_all_preview", {"type": 'NDOF_BUTTON_FIT', "value": 'PRESS'}, None),
("sequencer.view_ghost_border", {"type": 'O', "value": 'PRESS'}, None),
@@ -7168,7 +7170,7 @@ def km_3d_view_tool_edit_curve_pen(params):
("curve.pen", {"type": params.tool_mouse, "value": 'PRESS', "ctrl": True},
{"properties": [("insert_point", True), ("delete_point", True)]}),
("curve.pen", {"type": params.tool_mouse, "value": 'DOUBLE_CLICK'},
{"properties": [("toggle_vector", True), ("cycle_handle_type", True),]}),
{"properties": [("toggle_vector", True), ("cycle_handle_type", True), ]}),
]},
)
@@ -7433,7 +7435,8 @@ def km_3d_view_tool_paint_gpencil_line(params):
("gpencil.primitive_line", {"type": 'LEFTMOUSE', "value": 'PRESS', "alt": True},
{"properties": [("wait_for_input", False)]}),
# Lasso select
("gpencil.select_lasso", {"type": params.action_mouse, "value": 'CLICK_DRAG', "ctrl": True, "alt": True}, None),
("gpencil.select_lasso", {"type": params.action_mouse,
"value": 'CLICK_DRAG', "ctrl": True, "alt": True}, None),
]},
)
@@ -7448,7 +7451,8 @@ def km_3d_view_tool_paint_gpencil_polyline(params):
("gpencil.primitive_polyline", {"type": 'LEFTMOUSE', "value": 'PRESS', "shift": True},
{"properties": [("wait_for_input", False)]}),
# Lasso select
("gpencil.select_lasso", {"type": params.action_mouse, "value": 'CLICK_DRAG', "ctrl": True, "alt": True}, None),
("gpencil.select_lasso", {"type": params.action_mouse,
"value": 'CLICK_DRAG', "ctrl": True, "alt": True}, None),
]},
)
@@ -7465,7 +7469,8 @@ def km_3d_view_tool_paint_gpencil_box(params):
("gpencil.primitive_box", {"type": 'LEFTMOUSE', "value": 'PRESS', "alt": True},
{"properties": [("wait_for_input", False)]}),
# Lasso select
("gpencil.select_lasso", {"type": params.action_mouse, "value": 'CLICK_DRAG', "ctrl": True, "alt": True}, None),
("gpencil.select_lasso", {"type": params.action_mouse,
"value": 'CLICK_DRAG', "ctrl": True, "alt": True}, None),
]},
)
@@ -7482,7 +7487,8 @@ def km_3d_view_tool_paint_gpencil_circle(params):
("gpencil.primitive_circle", {"type": 'LEFTMOUSE', "value": 'PRESS', "alt": True},
{"properties": [("wait_for_input", False)]}),
# Lasso select
("gpencil.select_lasso", {"type": params.action_mouse, "value": 'CLICK_DRAG', "ctrl": True, "alt": True}, None),
("gpencil.select_lasso", {"type": params.action_mouse,
"value": 'CLICK_DRAG', "ctrl": True, "alt": True}, None),
]},
)
@@ -7499,7 +7505,8 @@ def km_3d_view_tool_paint_gpencil_arc(params):
("gpencil.primitive_curve", {"type": 'LEFTMOUSE', "value": 'PRESS', "alt": True},
{"properties": [("type", 'ARC'), ("wait_for_input", False)]}),
# Lasso select
("gpencil.select_lasso", {"type": params.action_mouse, "value": 'CLICK_DRAG', "ctrl": True, "alt": True}, None),
("gpencil.select_lasso", {"type": params.action_mouse,
"value": 'CLICK_DRAG', "ctrl": True, "alt": True}, None),
]},
)
@@ -7512,7 +7519,8 @@ def km_3d_view_tool_paint_gpencil_curve(params):
("gpencil.primitive_curve", params.tool_maybe_tweak_event,
{"properties": [("type", 'CURVE'), ("wait_for_input", False)]}),
# Lasso select
("gpencil.select_lasso", {"type": params.action_mouse, "value": 'CLICK_DRAG', "ctrl": True, "alt": True}, None),
("gpencil.select_lasso", {"type": params.action_mouse,
"value": 'CLICK_DRAG', "ctrl": True, "alt": True}, None),
]},
)
@@ -7524,7 +7532,8 @@ def km_3d_view_tool_paint_gpencil_cutter(params):
{"items": [
("gpencil.stroke_cutter", {"type": params.tool_mouse, "value": 'PRESS'}, None),
# Lasso select
("gpencil.select_lasso", {"type": params.action_mouse, "value": 'CLICK_DRAG', "ctrl": True, "alt": True}, None),
("gpencil.select_lasso", {"type": params.action_mouse,
"value": 'CLICK_DRAG', "ctrl": True, "alt": True}, None),
]},
)

View File

@@ -67,12 +67,14 @@ def _template_items_context_menu(menu, key_args_primary):
for kmi_args in (key_args_primary, {"type": 'APP', "value": 'PRESS'})
]
def _template_items_context_panel(menu, key_args_primary):
return [
op_panel(menu, kmi_args)
for kmi_args in (key_args_primary, {"type": 'APP', "value": 'PRESS'})
]
def _template_items_object_subdivision_set():
return [
("object.subdivision_set",
@@ -116,6 +118,7 @@ def _template_items_basic_tools(*, connected=False):
op_tool_cycle("builtin.cursor", {"type": 'C', "value": 'PRESS'}),
]
def _template_items_tool_select(params, operator, *, extend):
return [
(operator, {"type": 'LEFTMOUSE', "value": 'PRESS'},
@@ -436,7 +439,8 @@ def km_property_editor(params):
("object.modifier_remove", {"type": 'DEL', "value": 'PRESS'}, {"properties": [("report", True)]}),
("object.modifier_copy", {"type": 'D', "value": 'PRESS', "ctrl": True}, None),
# Grease pencil modifier panels
("object.gpencil_modifier_remove", {"type": 'BACK_SPACE', "value": 'PRESS'}, {"properties": [("report", True)]}),
("object.gpencil_modifier_remove", {"type": 'BACK_SPACE',
"value": 'PRESS'}, {"properties": [("report", True)]}),
("object.gpencil_modifier_remove", {"type": 'DEL', "value": 'PRESS'}, {"properties": [("report", True)]}),
("object.gpencil_modifier_copy", {"type": 'D', "value": 'PRESS', "ctrl": True}, None),
# ShaderFX panels
@@ -517,7 +521,8 @@ def km_outliner(params):
("outliner.show_one_level", {"type": 'NUMPAD_MINUS', "value": 'PRESS'},
{"properties": [("open", False)]}),
("outliner.select_all", {"type": 'A', "value": 'PRESS', "ctrl": True}, {"properties": [("action", 'SELECT')]}),
("outliner.select_all", {"type": 'A', "value": 'PRESS', "ctrl": True, "shift": True}, {"properties": [("action", 'DESELECT')]}),
("outliner.select_all", {"type": 'A', "value": 'PRESS', "ctrl": True,
"shift": True}, {"properties": [("action", 'DESELECT')]}),
("outliner.select_all", {"type": 'I', "value": 'PRESS', "ctrl": True}, {"properties": [("action", 'INVERT')]}),
("outliner.keyingset_add_selected", {"type": 'K', "value": 'PRESS'}, None),
("outliner.keyingset_remove_selected", {"type": 'K', "value": 'PRESS', "alt": True}, None),
@@ -577,7 +582,8 @@ def km_uv_editor(params):
("uv.select_more", {"type": 'UP_ARROW', "value": 'PRESS', "repeat": True}, None),
("uv.select_less", {"type": 'DOWN_ARROW', "value": 'PRESS', "repeat": True}, None),
("uv.select_all", {"type": 'A', "value": 'PRESS', "ctrl": True}, {"properties": [("action", 'SELECT')]}),
("uv.select_all", {"type": 'A', "value": 'PRESS', "ctrl": True, "shift": True}, {"properties": [("action", 'DESELECT')]}),
("uv.select_all", {"type": 'A', "value": 'PRESS', "ctrl": True,
"shift": True}, {"properties": [("action", 'DESELECT')]}),
("uv.select_all", {"type": 'I', "value": 'PRESS', "ctrl": True}, {"properties": [("action", 'INVERT')]}),
("uv.hide", {"type": 'H', "value": 'PRESS', "ctrl": True},
{"properties": [("unselected", False)]}),
@@ -621,6 +627,7 @@ def km_view3d_generic(_params):
return keymap
# 3D View: main region.
def km_view3d(params):
items = []
@@ -722,7 +729,7 @@ def km_view3d(params):
*((operator,
{"type": 'LEFTMOUSE', "value": 'CLICK', **{m: True for m in mods}},
{"properties": [(c, True) for c in props]},
) for operator, props, mods in (
) for operator, props, mods in (
("view3d.select", ("deselect_all",), ()),
("view3d.select", ("toggle",), ("shift",)),
("view3d.select", ("center", "object"), ("ctrl",)),
@@ -768,7 +775,8 @@ def km_mask_editing(params):
("mask.select", {"type": 'LEFTMOUSE', "value": 'PRESS', "shift": True},
{"properties": [("extend", False), ("deselect", False), ("toggle", True)]}),
("mask.select_all", {"type": 'A', "value": 'PRESS', "ctrl": True}, {"properties": [("action", 'SELECT')]}),
("mask.select_all", {"type": 'A', "value": 'PRESS', "ctrl": True, "shift": True}, {"properties": [("action", 'DESELECT')]}),
("mask.select_all", {"type": 'A', "value": 'PRESS', "ctrl": True,
"shift": True}, {"properties": [("action", 'DESELECT')]}),
("mask.select_all", {"type": 'I', "value": 'PRESS', "ctrl": True}, {"properties": [("action", 'INVERT')]}),
("mask.select_linked", {"type": 'L', "value": 'PRESS', "ctrl": True}, None),
("mask.select_linked_pick", {"type": 'L', "value": 'PRESS'},
@@ -832,7 +840,8 @@ def km_markers(params):
{"properties": [("extend", True), ("camera", True)]}),
("marker.select_box", {"type": 'Q', "value": 'PRESS'}, None),
("marker.select_all", {"type": 'A', "value": 'PRESS', "ctrl": True}, {"properties": [("action", 'SELECT')]}),
("marker.select_all", {"type": 'A', "value": 'PRESS', "ctrl": True, "shift": True}, {"properties": [("action", 'DESELECT')]}),
("marker.select_all", {"type": 'A', "value": 'PRESS', "ctrl": True,
"shift": True}, {"properties": [("action", 'DESELECT')]}),
("marker.select_all", {"type": 'I', "value": 'PRESS', "ctrl": True}, {"properties": [("action", 'INVERT')]}),
("marker.delete", {"type": 'BACK_SPACE', "value": 'PRESS'}, None),
("marker.delete", {"type": 'DEL', "value": 'PRESS'}, None),
@@ -895,18 +904,19 @@ def km_graph_editor(params):
("graph.select_leftright", {"type": 'RIGHT_BRACKET', "value": 'PRESS'},
{"properties": [("mode", 'RIGHT'), ("extend", False)]}),
("graph.select_all", {"type": 'A', "value": 'PRESS', "ctrl": True}, {"properties": [("action", 'SELECT')]}),
("graph.select_all", {"type": 'A', "value": 'PRESS', "ctrl": True, "shift": True}, {"properties": [("action", 'DESELECT')]}),
("graph.select_all", {"type": 'A', "value": 'PRESS', "ctrl": True,
"shift": True}, {"properties": [("action", 'DESELECT')]}),
("graph.select_all", {"type": 'I', "value": 'PRESS', "ctrl": True}, {"properties": [("action", 'INVERT')]}),
("graph.select_box", {"type": 'Q', "value": 'PRESS'},
{"properties": [("axis_range", False)]}),
("graph.select_box", {"type": 'Q', "value": 'PRESS', "alt": True},
{"properties": [("axis_range", True)]}),
("graph.select_box", {"type": 'LEFTMOUSE', "value": 'CLICK_DRAG'},
{"properties":[("tweak", True), ("axis_range", False), ("mode", 'SET')]}),
{"properties": [("tweak", True), ("axis_range", False), ("mode", 'SET')]}),
("graph.select_box", {"type": 'LEFTMOUSE', "value": 'CLICK_DRAG', "shift": True},
{"properties":[("tweak", True), ("axis_range", False), ("mode", 'ADD')]}),
{"properties": [("tweak", True), ("axis_range", False), ("mode", 'ADD')]}),
("graph.select_box", {"type": 'LEFTMOUSE', "value": 'CLICK_DRAG', "ctrl": True},
{"properties":[("tweak", True), ("axis_range", False), ("mode", 'SUB')]}),
{"properties": [("tweak", True), ("axis_range", False), ("mode", 'SUB')]}),
("graph.select_more", {"type": 'UP_ARROW', "value": 'PRESS', "repeat": True}, None),
("graph.select_less", {"type": 'DOWN_ARROW', "value": 'PRESS', "repeat": True}, None),
("graph.select_linked", {"type": 'RIGHT_BRACKET', "value": 'PRESS'}, None),
@@ -1121,7 +1131,8 @@ def km_node_editor(params):
("node.delete_reconnect", {"type": 'BACK_SPACE', "value": 'PRESS', "ctrl": True}, None),
("node.delete_reconnect", {"type": 'DEL', "value": 'PRESS', "ctrl": True}, None),
("node.select_all", {"type": 'A', "value": 'PRESS', "ctrl": True}, {"properties": [("action", 'SELECT')]}),
("node.select_all", {"type": 'A', "value": 'PRESS', "ctrl": True, "shift": True}, {"properties": [("action", 'DESELECT')]}),
("node.select_all", {"type": 'A', "value": 'PRESS', "ctrl": True,
"shift": True}, {"properties": [("action", 'DESELECT')]}),
("node.select_all", {"type": 'I', "value": 'PRESS', "ctrl": True}, {"properties": [("action", 'INVERT')]}),
("node.select_linked_to", {"type": 'LEFT_BRACKET', "value": 'PRESS', "shift": True}, None),
("node.select_linked_from", {"type": 'RIGHT_BRACKET', "value": 'PRESS'}, None),
@@ -1260,7 +1271,7 @@ def km_file_browser_main(params):
{"properties": [("open", False), ("deselect_all", True)]}),
("file.select", {"type": 'LEFTMOUSE', "value": 'CLICK', "ctrl": True},
{"properties": [("extend", True), ("open", False)]}),
("file.select", {"type": 'LEFTMOUSE', "value": 'CLICK', "shift": True,},
("file.select", {"type": 'LEFTMOUSE', "value": 'CLICK', "shift": True, },
{"properties": [("extend", True), ("fill", True), ("open", False)]}),
("file.select", {"type": 'RIGHTMOUSE', "value": 'CLICK', "shift": True},
{"properties": [("extend", True), ("open", False)]}),
@@ -1379,18 +1390,19 @@ def km_dopesheet(params):
("action.select_leftright", {"type": 'RIGHT_BRACKET', "value": 'PRESS'},
{"properties": [("mode", 'RIGHT'), ("extend", False)]}),
("action.select_all", {"type": 'A', "value": 'PRESS', "ctrl": True}, {"properties": [("action", 'SELECT')]}),
("action.select_all", {"type": 'A', "value": 'PRESS', "ctrl": True, "shift": True}, {"properties": [("action", 'DESELECT')]}),
("action.select_all", {"type": 'A', "value": 'PRESS', "ctrl": True,
"shift": True}, {"properties": [("action", 'DESELECT')]}),
("action.select_all", {"type": 'I', "value": 'PRESS', "ctrl": True}, {"properties": [("action", 'INVERT')]}),
("action.select_box", {"type": 'Q', "value": 'PRESS'},
{"properties": [("axis_range", False)]}),
("action.select_box", {"type": 'Q', "value": 'PRESS', "alt": True},
{"properties": [("axis_range", True)]}),
("action.select_box", {"type": 'LEFTMOUSE', "value": 'CLICK_DRAG'},
{"properties":[("tweak", True), ("axis_range", False), ("wait_for_input", False), ("mode", 'SET')]}),
{"properties": [("tweak", True), ("axis_range", False), ("wait_for_input", False), ("mode", 'SET')]}),
("action.select_box", {"type": 'LEFTMOUSE', "value": 'CLICK_DRAG', "shift": True},
{"properties":[("tweak", True), ("axis_range", False), ("wait_for_input", False), ("mode", 'ADD')]}),
{"properties": [("tweak", True), ("axis_range", False), ("wait_for_input", False), ("mode", 'ADD')]}),
("action.select_box", {"type": 'LEFTMOUSE', "value": 'CLICK_DRAG', "ctrl": True},
{"properties":[("tweak", True), ("axis_range", False), ("wait_for_input", False), ("mode", 'SUB')]}),
{"properties": [("tweak", True), ("axis_range", False), ("wait_for_input", False), ("mode", 'SUB')]}),
("action.select_column", {"type": 'K', "value": 'PRESS'},
{"properties": [("mode", 'KEYS')]}),
("action.select_column", {"type": 'K', "value": 'PRESS', "ctrl": True},
@@ -1505,18 +1517,19 @@ def km_nla_editor(params):
("nla.select_leftright", {"type": 'RIGHT_BRACKET', "value": 'PRESS'},
{"properties": [("mode", 'RIGHT'), ("extend", False)]}),
("nla.select_all", {"type": 'A', "value": 'PRESS', "ctrl": True}, {"properties": [("action", 'SELECT')]}),
("nla.select_all", {"type": 'A', "value": 'PRESS', "ctrl": True, "shift": True}, {"properties": [("action", 'DESELECT')]}),
("nla.select_all", {"type": 'A', "value": 'PRESS', "ctrl": True,
"shift": True}, {"properties": [("action", 'DESELECT')]}),
("nla.select_all", {"type": 'I', "value": 'PRESS', "ctrl": True}, {"properties": [("action", 'INVERT')]}),
("nla.select_box", {"type": 'Q', "value": 'PRESS'},
{"properties": [("axis_range", False)]}),
("nla.select_box", {"type": 'Q', "value": 'PRESS', "alt": True},
{"properties": [("axis_range", True)]}),
("nla.select_box", {"type": 'LEFTMOUSE', "value": 'CLICK_DRAG'},
{"properties":[("tweak", True), ("mode", 'SET')]}),
{"properties": [("tweak", True), ("mode", 'SET')]}),
("nla.select_box", {"type": 'LEFTMOUSE', "value": 'CLICK_DRAG', "shift": True},
{"properties":[("tweak", True), ("mode", 'ADD')]}),
{"properties": [("tweak", True), ("mode", 'ADD')]}),
("nla.select_box", {"type": 'LEFTMOUSE', "value": 'CLICK_DRAG', "ctrl": True},
{"properties":[("tweak", True), ("mode", 'SUB')]}),
{"properties": [("tweak", True), ("mode", 'SUB')]}),
("nla.view_all", {"type": 'A', "value": 'PRESS'}, None),
("nla.view_all", {"type": 'NDOF_BUTTON_FIT', "value": 'PRESS'}, None),
("nla.view_selected", {"type": 'F', "value": 'PRESS'}, None),
@@ -1739,7 +1752,8 @@ def km_sequencer(params):
("wm.search_menu", {"type": 'TAB', "value": 'PRESS'}, None),
*_template_items_animation(),
("sequencer.select_all", {"type": 'A', "value": 'PRESS', "ctrl": True}, {"properties": [("action", 'SELECT')]}),
("sequencer.select_all", {"type": 'A', "value": 'PRESS', "ctrl": True, "shift": True}, {"properties": [("action", 'DESELECT')]}),
("sequencer.select_all", {"type": 'A', "value": 'PRESS', "ctrl": True,
"shift": True}, {"properties": [("action", 'DESELECT')]}),
("sequencer.select_all", {"type": 'I', "value": 'PRESS', "ctrl": True}, {"properties": [("action", 'INVERT')]}),
("sequencer.split", {"type": 'B', "value": 'PRESS', "ctrl": True},
{"properties": [("type", 'SOFT')]}),
@@ -1816,11 +1830,11 @@ def km_sequencer(params):
{"properties": [("extend", True)]}),
("sequencer.select_linked", {"type": 'RIGHT_BRACKET', "value": 'PRESS', "ctrl": True}, None),
("sequencer.select_box", {"type": 'LEFTMOUSE', "value": 'CLICK_DRAG'},
{"properties":[("tweak", True), ("mode", 'SET')]}),
{"properties": [("tweak", True), ("mode", 'SET')]}),
("sequencer.select_box", {"type": 'LEFTMOUSE', "value": 'CLICK_DRAG', "shift": True},
{"properties":[("tweak", True), ("mode", 'ADD')]}),
{"properties": [("tweak", True), ("mode", 'ADD')]}),
("sequencer.select_box", {"type": 'LEFTMOUSE', "value": 'CLICK_DRAG', "ctrl": True},
{"properties":[("tweak", True), ("mode", 'SUB')]}),
{"properties": [("tweak", True), ("mode", 'SUB')]}),
("sequencer.select_grouped", {"type": 'G', "value": 'PRESS', "shift": True}, None),
("sequencer.slip", {"type": 'R', "value": 'PRESS'}, None),
("wm.context_set_int", {"type": 'O', "value": 'PRESS'},
@@ -1852,6 +1866,7 @@ def km_sequencerpreview(params):
("wm.search_menu", {"type": 'TAB', "value": 'PRESS'}, None),
("sequencer.view_all_preview", {"type": 'A', "value": 'PRESS'}, None),
("sequencer.view_all_preview", {"type": 'NDOF_BUTTON_FIT', "value": 'PRESS'}, None),
("sequencer.view_selected", {"type": 'F', "value": 'PRESS'}, None),
("sequencer.view_ghost_border", {"type": 'O', "value": 'PRESS'}, None),
("sequencer.view_zoom_ratio", {"type": 'NUMPAD_1', "value": 'PRESS'},
{"properties": [("ratio", 1.0)]}),
@@ -1873,7 +1888,7 @@ def km_sequencer_channels(params):
# Rename.
("sequencer.rename_channel", {"type": 'LEFTMOUSE', "value": 'PRESS', "ctrl": True}, None),
("sequencer.rename_channel", {"type": 'LEFTMOUSE', "value": 'DOUBLE_CLICK'}, None),
])
])
return keymap
@@ -2032,7 +2047,8 @@ def km_clip_editor(params):
{"properties": [("extend", True)]}),
("clip.select_box", {"type": 'Q', "value": 'PRESS'}, None),
("clip.select_all", {"type": 'A', "value": 'PRESS', "ctrl": True}, {"properties": [("action", 'SELECT')]}),
("clip.select_all", {"type": 'A', "value": 'PRESS', "ctrl": True, "shift": True}, {"properties": [("action", 'DESELECT')]}),
("clip.select_all", {"type": 'A', "value": 'PRESS', "ctrl": True,
"shift": True}, {"properties": [("action", 'DESELECT')]}),
("clip.select_all", {"type": 'I', "value": 'PRESS', "ctrl": True}, {"properties": [("action", 'INVERT')]}),
op_menu("CLIP_MT_select_grouped", {"type": 'G', "value": 'PRESS', "shift": True}),
("clip.add_marker_slide", {"type": 'LEFTMOUSE', "value": 'PRESS', "ctrl": True}, None),
@@ -2146,6 +2162,7 @@ def km_clip_dopesheet_editor(_params):
return keymap
def km_spreadsheet_generic(_params):
items = []
keymap = (
@@ -2213,7 +2230,6 @@ def km_animation_channels(params):
{"items": items},
)
items.extend([
# Click select.
("anim.channels_click", {"type": 'LEFTMOUSE', "value": 'PRESS'}, None),
@@ -2231,13 +2247,16 @@ def km_animation_channels(params):
# Find (setting the name filter).
("anim.channels_select_filter", {"type": 'F', "value": 'PRESS', "ctrl": True}, None),
# Selection.
("anim.channels_select_all", {"type": 'A', "value": 'PRESS', "ctrl": True}, {"properties": [("action", 'SELECT')]}),
("anim.channels_select_all", {"type": 'A', "value": 'PRESS', "ctrl": True, "shift": True}, {"properties": [("action", 'DESELECT')]}),
("anim.channels_select_all", {"type": 'I', "value": 'PRESS', "ctrl": True}, {"properties": [("action", 'INVERT')]}),
("anim.channels_select_all", {"type": 'A', "value": 'PRESS',
"ctrl": True}, {"properties": [("action", 'SELECT')]}),
("anim.channels_select_all", {"type": 'A', "value": 'PRESS',
"ctrl": True, "shift": True}, {"properties": [("action", 'DESELECT')]}),
("anim.channels_select_all", {"type": 'I', "value": 'PRESS',
"ctrl": True}, {"properties": [("action", 'INVERT')]}),
("anim.channels_select_box", {"type": 'LEFTMOUSE', "value": 'CLICK_DRAG'}, None),
("anim.channels_select_box", {"type": 'LEFTMOUSE', "value": 'CLICK_DRAG', "shift": True,},
("anim.channels_select_box", {"type": 'LEFTMOUSE', "value": 'CLICK_DRAG', "shift": True, },
{"properties": [("extend", True)]}),
("anim.channels_select_box", {"type": 'LEFTMOUSE', "value": 'CLICK_DRAG', "ctrl": True,},
("anim.channels_select_box", {"type": 'LEFTMOUSE', "value": 'CLICK_DRAG', "ctrl": True, },
{"properties": [("deselect", True)]}),
# Delete.
("anim.channels_delete", {"type": 'BACK_SPACE', "value": 'PRESS'}, None),
@@ -2300,7 +2319,8 @@ def _grease_pencil_selection(params):
{"properties": [("extend", True), ("toggle", True)]}),
# Select all
("gpencil.select_all", {"type": 'A', "value": 'PRESS', "ctrl": True}, {"properties": [("action", 'SELECT')]}),
("gpencil.select_all", {"type": 'A', "value": 'PRESS', "ctrl": True, "shift": True}, {"properties": [("action", 'DESELECT')]}),
("gpencil.select_all", {"type": 'A', "value": 'PRESS', "ctrl": True,
"shift": True}, {"properties": [("action", 'DESELECT')]}),
("gpencil.select_all", {"type": 'I', "value": 'PRESS', "ctrl": True}, {"properties": [("action", 'INVERT')]}),
# Select linked
("gpencil.select_linked", {"type": 'RIGHT_BRACKET', "value": 'PRESS'}, None),
@@ -2385,7 +2405,6 @@ def km_grease_pencil_stroke_edit_mode(params):
op_tool_cycle("builtin.bend", {"type": 'B', "value": 'PRESS', "ctrl": True}),
])
return keymap
@@ -2764,7 +2783,8 @@ def km_grease_pencil_stroke_weight_mode(params):
("wm.radial_control", {"type": 'S', "value": 'PRESS'},
{"properties": [("data_path_primary", 'tool_settings.gpencil_weight_paint.brush.size')]}),
# Context menu
*_template_items_context_panel("VIEW3D_PT_gpencil_weight_context_menu", {"type": 'RIGHTMOUSE', "value": 'PRESS'}),
*_template_items_context_panel("VIEW3D_PT_gpencil_weight_context_menu",
{"type": 'RIGHTMOUSE', "value": 'PRESS'}),
])
return keymap
@@ -2813,6 +2833,7 @@ def km_grease_pencil_stroke_vertex_mode(params):
return keymap
def km_grease_pencil_stroke_vertex_draw(params):
items = []
keymap = (
@@ -2928,6 +2949,7 @@ def km_grease_pencil_stroke_vertex_replace(params):
return keymap
def km_face_mask(params):
items = []
keymap = (
@@ -2937,9 +2959,12 @@ def km_face_mask(params):
)
items.extend([
("paint.face_select_all", {"type": 'A', "value": 'PRESS', "ctrl": True}, {"properties": [("action", 'SELECT')]}),
("paint.face_select_all", {"type": 'A', "value": 'PRESS', "ctrl": True, "shift": True}, {"properties": [("action", 'DESELECT')]}),
("paint.face_select_all", {"type": 'I', "value": 'PRESS', "ctrl": True}, {"properties": [("action", 'INVERT')]}),
("paint.face_select_all", {"type": 'A', "value": 'PRESS',
"ctrl": True}, {"properties": [("action", 'SELECT')]}),
("paint.face_select_all", {"type": 'A', "value": 'PRESS', "ctrl": True,
"shift": True}, {"properties": [("action", 'DESELECT')]}),
("paint.face_select_all", {"type": 'I', "value": 'PRESS',
"ctrl": True}, {"properties": [("action", 'INVERT')]}),
("paint.face_select_hide", {"type": 'H', "value": 'PRESS', "ctrl": True},
{"properties": [("unselected", False)]}),
("paint.face_select_hide", {"type": 'H', "value": 'PRESS', "shift": True},
@@ -2995,7 +3020,8 @@ def km_pose(params):
("pose.paste", {"type": 'V', "value": 'PRESS', "shift": True, "ctrl": True},
{"properties": [("flipped", True)]}),
("pose.select_all", {"type": 'A', "value": 'PRESS', "ctrl": True}, {"properties": [("action", 'SELECT')]}),
("pose.select_all", {"type": 'A', "value": 'PRESS', "ctrl": True, "shift": True}, {"properties": [("action", 'DESELECT')]}),
("pose.select_all", {"type": 'A', "value": 'PRESS', "ctrl": True,
"shift": True}, {"properties": [("action", 'DESELECT')]}),
("pose.select_all", {"type": 'I', "value": 'PRESS', "ctrl": True}, {"properties": [("action", 'INVERT')]}),
("pose.select_parent", {"type": 'UP_ARROW', "value": 'PRESS', "ctrl": True}, None),
("pose.select_hierarchy", {"type": 'UP_ARROW', "value": 'PRESS', "repeat": True},
@@ -3030,7 +3056,6 @@ def km_pose(params):
op_tool_cycle("builtin.measure", {"type": 'M', "value": 'PRESS'}),
])
return keymap
@@ -3044,9 +3069,10 @@ def km_object_mode(params):
items.extend([
*_template_items_animation(),
#Selection
# Selection
("object.select_all", {"type": 'A', "value": 'PRESS', "ctrl": True}, {"properties": [("action", 'SELECT')]}),
("object.select_all", {"type": 'A', "value": 'PRESS', "ctrl": True, "shift": True}, {"properties": [("action", 'DESELECT')]}),
("object.select_all", {"type": 'A', "value": 'PRESS', "ctrl": True,
"shift": True}, {"properties": [("action", 'DESELECT')]}),
("object.select_all", {"type": 'I', "value": 'PRESS', "ctrl": True}, {"properties": [("action", 'INVERT')]}),
("object.select_more", {"type": 'UP_ARROW', "value": 'PRESS', "repeat": True}, None),
("object.select_less", {"type": 'DOWN_ARROW', "value": 'PRESS', "repeat": True}, None),
@@ -3148,10 +3174,10 @@ def km_curve(params):
{"items": items},
)
items.extend([
("curve.select_all", {"type": 'A', "value": 'PRESS', "ctrl": True}, {"properties": [("action", 'SELECT')]}),
("curve.select_all", {"type": 'A', "value": 'PRESS', "ctrl": True, "shift": True}, {"properties": [("action", 'DESELECT')]}),
("curve.select_all", {"type": 'A', "value": 'PRESS', "ctrl": True,
"shift": True}, {"properties": [("action", 'DESELECT')]}),
("curve.select_all", {"type": 'I', "value": 'PRESS', "ctrl": True}, {"properties": [("action", 'INVERT')]}),
("curve.select_row", {"type": 'R', "value": 'PRESS', "shift": True}, None),
("curve.select_more", {"type": 'UP_ARROW', "value": 'PRESS', "repeat": True}, None),
@@ -3271,7 +3297,8 @@ def km_image_paint(params):
("wm.context_toggle", {"type": 'S', "value": 'PRESS', "shift": True},
{"properties": [("data_path", 'tool_settings.image_paint.brush.use_smooth_stroke')]}),
op_menu("VIEW3D_MT_angle_control", {"type": 'R', "value": 'PRESS'}),
*_template_items_context_panel("VIEW3D_PT_paint_texture_context_menu", {"type": 'RIGHTMOUSE', "value": 'PRESS'}),
*_template_items_context_panel("VIEW3D_PT_paint_texture_context_menu",
{"type": 'RIGHTMOUSE', "value": 'PRESS'}),
# Tools
("paint.brush_select", {"type": 'D', "value": 'PRESS'},
{"properties": [("image_tool", 'DRAW')]}),
@@ -3356,7 +3383,7 @@ def km_weight_paint(params):
*_template_items_context_panel("VIEW3D_PT_paint_weight_context_menu", {"type": 'RIGHTMOUSE', "value": 'PRESS'}),
# Bone selection for combined weight paint + pose mode.
("view3d.select", {"type": 'LEFTMOUSE', "value": 'PRESS', "ctrl": True}, None),
# Tools
# Tools
("paint.brush_select", {"type": 'D', "value": 'PRESS'},
{"properties": [("weight_tool", 'DRAW')]}),
("paint.brush_select", {"type": 'B', "value": 'PRESS'},
@@ -3504,7 +3531,8 @@ def km_mesh(params):
{"properties": [("use_fill", False)]}),
("mesh.select_all", {"type": 'A', "value": 'PRESS', "ctrl": True}, {"properties": [("action", 'SELECT')]}),
("mesh.select_all", {"type": 'A', "value": 'PRESS', "ctrl": True, "shift": True}, {"properties": [("action", 'DESELECT')]}),
("mesh.select_all", {"type": 'A', "value": 'PRESS', "ctrl": True,
"shift": True}, {"properties": [("action", 'DESELECT')]}),
("mesh.select_all", {"type": 'I', "value": 'PRESS', "ctrl": True}, {"properties": [("action", 'INVERT')]}),
("mesh.select_more", {"type": 'UP_ARROW', "value": 'PRESS', "repeat": True}, None),
("mesh.select_less", {"type": 'DOWN_ARROW', "value": 'PRESS', "repeat": True}, None),
@@ -3528,7 +3556,7 @@ def km_mesh(params):
{"properties": [("data_path", 'tool_settings.use_proportional_edit')]}),
# Menus.
*_template_items_context_menu("VIEW3D_MT_edit_mesh_context_menu", {"type": 'RIGHTMOUSE', "value": 'PRESS'}),
#Tools
# Tools
*_template_items_basic_tools(),
op_tool_cycle("builtin.bevel", {"type": 'B', "value": 'PRESS', "ctrl": True}),
op_tool_cycle("builtin.inset_faces", {"type": 'I', "value": 'PRESS'}),
@@ -3562,7 +3590,8 @@ def km_armature(params):
("armature.parent_clear", {"type": 'P', "value": 'PRESS', "shift": True}, None),
# Selection.
("armature.select_all", {"type": 'A', "value": 'PRESS', "ctrl": True}, {"properties": [("action", 'SELECT')]}),
("armature.select_all", {"type": 'A', "value": 'PRESS', "ctrl": True, "shift": True}, {"properties": [("action", 'DESELECT')]}),
("armature.select_all", {"type": 'A', "value": 'PRESS', "ctrl": True,
"shift": True}, {"properties": [("action", 'DESELECT')]}),
("armature.select_all", {"type": 'I', "value": 'PRESS', "ctrl": True}, {"properties": [("action", 'INVERT')]}),
("armature.select_hierarchy", {"type": 'LEFT_BRACKET', "value": 'PRESS'},
@@ -3610,7 +3639,6 @@ def km_metaball(params):
{"items": items},
)
items.extend([
("mball.reveal_metaelems", {"type": 'H', "value": 'PRESS', "alt": True}, None),
("mball.hide_metaelems", {"type": 'H', "value": 'PRESS', "ctrl": True},
@@ -3621,7 +3649,8 @@ def km_metaball(params):
("mball.delete_metaelems", {"type": 'DEL', "value": 'PRESS'}, None),
("mball.duplicate_move", {"type": 'D', "value": 'PRESS', "ctrl": True}, None),
("mball.select_all", {"type": 'A', "value": 'PRESS', "ctrl": True}, {"properties": [("action", 'SELECT')]}),
("mball.select_all", {"type": 'A', "value": 'PRESS', "ctrl": True, "shift": True}, {"properties": [("action", 'DESELECT')]}),
("mball.select_all", {"type": 'A', "value": 'PRESS', "ctrl": True,
"shift": True}, {"properties": [("action", 'DESELECT')]}),
("mball.select_all", {"type": 'I', "value": 'PRESS', "ctrl": True}, {"properties": [("action", 'INVERT')]}),
("mball.select_similar", {"type": 'G', "value": 'PRESS', "shift": True}, None),
*_template_items_context_menu("VIEW3D_MT_edit_metaball_context_menu", {"type": 'RIGHTMOUSE', "value": 'PRESS'}),
@@ -3645,7 +3674,8 @@ def km_lattice(params):
items.extend([
("lattice.select_all", {"type": 'A', "value": 'PRESS', "ctrl": True}, {"properties": [("action", 'SELECT')]}),
("lattice.select_all", {"type": 'A', "value": 'PRESS', "ctrl": True, "shift": True}, {"properties": [("action", 'DESELECT')]}),
("lattice.select_all", {"type": 'A', "value": 'PRESS', "ctrl": True,
"shift": True}, {"properties": [("action", 'DESELECT')]}),
("lattice.select_all", {"type": 'I', "value": 'PRESS', "ctrl": True}, {"properties": [("action", 'INVERT')]}),
("lattice.select_more", {"type": 'UP_ARROW', "value": 'PRESS', "repeat": True}, None),
("lattice.select_less", {"type": 'DOWN_ARROW', "value": 'PRESS', "repeat": True}, None),
@@ -3653,7 +3683,7 @@ def km_lattice(params):
*_template_items_context_menu("VIEW3D_MT_edit_lattice_context_menu", {"type": 'RIGHTMOUSE', "value": 'PRESS'}),
("wm.context_toggle", {"type": 'B', "value": 'PRESS'},
{"properties": [("data_path", 'tool_settings.use_proportional_edit')]}),
# Tools
# Tools
op_tool_cycle("builtin.select_box", {"type": 'Q', "value": 'PRESS'}),
op_tool_cycle("builtin.move", {"type": 'W', "value": 'PRESS'}),
op_tool_cycle("builtin.rotate", {"type": 'E', "value": 'PRESS'}),
@@ -3676,7 +3706,8 @@ def km_particle(params):
items.extend([
("particle.select_all", {"type": 'A', "value": 'PRESS', "ctrl": True}, {"properties": [("action", 'SELECT')]}),
("particle.select_all", {"type": 'A', "value": 'PRESS', "ctrl": True, "shift": True}, {"properties": [("action", 'DESELECT')]}),
("particle.select_all", {"type": 'A', "value": 'PRESS', "ctrl": True,
"shift": True}, {"properties": [("action", 'DESELECT')]}),
("particle.select_all", {"type": 'I', "value": 'PRESS', "ctrl": True}, {"properties": [("action", 'INVERT')]}),
("particle.select_more", {"type": 'UP_ARROW', "value": 'PRESS', "repeat": True}, None),
("particle.select_less", {"type": 'DOWN_ARROW', "value": 'PRESS', "repeat": True}, None),
@@ -3793,7 +3824,6 @@ def km_font(params):
*_template_items_context_menu("VIEW3D_MT_edit_font_context_menu", {"type": 'RIGHTMOUSE', "value": 'PRESS'}),
])
return keymap
@@ -3806,35 +3836,35 @@ def km_object_non_modal(params):
)
items.extend([
("object.mode_set",{"type": 'ONE', "value": 'PRESS'},
("object.mode_set", {"type": 'ONE', "value": 'PRESS'},
{"properties": [("mode", 'PAINT_GPENCIL')]}),
("object.mode_set",{"type": 'THREE', "value": 'PRESS'},
("object.mode_set", {"type": 'THREE', "value": 'PRESS'},
{"properties": [("mode", 'POSE')]}),
("object.mode_set_with_submode",{"type": 'ONE', "value": 'PRESS'},
("object.mode_set_with_submode", {"type": 'ONE', "value": 'PRESS'},
{"properties": [("mode", 'EDIT'), ("mesh_select_mode", {'VERT'})]}),
("object.mode_set_with_submode",{"type": 'TWO', "value": 'PRESS'},
("object.mode_set_with_submode", {"type": 'TWO', "value": 'PRESS'},
{"properties": [("mode", 'EDIT'), ("mesh_select_mode", {'EDGE'})]}),
("object.mode_set_with_submode",{"type": 'THREE', "value": 'PRESS'},
("object.mode_set_with_submode", {"type": 'THREE', "value": 'PRESS'},
{"properties": [("mode", 'EDIT'), ("mesh_select_mode", {'FACE'})]}),
("object.mode_set",{"type": 'ONE', "value": 'PRESS'},
("object.mode_set", {"type": 'ONE', "value": 'PRESS'},
{"properties": [("mode", 'EDIT')]}),
("object.mode_set",{"type": 'FOUR', "value": 'PRESS'},
("object.mode_set", {"type": 'FOUR', "value": 'PRESS'},
{"properties": [("mode", 'OBJECT')]}),
("object.mode_set",{"type": 'FIVE', "value": 'PRESS'},
("object.mode_set", {"type": 'FIVE', "value": 'PRESS'},
{"properties": [("mode", 'SCULPT')]}),
("object.mode_set",{"type": 'SIX', "value": 'PRESS'},
("object.mode_set", {"type": 'SIX', "value": 'PRESS'},
{"properties": [("mode", 'VERTEX_PAINT')]}),
("object.mode_set",{"type": 'SEVEN', "value": 'PRESS'},
("object.mode_set", {"type": 'SEVEN', "value": 'PRESS'},
{"properties": [("mode", 'WEIGHT_PAINT')]}),
("object.mode_set",{"type": 'EIGHT', "value": 'PRESS'},
("object.mode_set", {"type": 'EIGHT', "value": 'PRESS'},
{"properties": [("mode", 'TEXTURE_PAINT')]}),
("object.mode_set",{"type": 'TWO', "value": 'PRESS'},
("object.mode_set", {"type": 'TWO', "value": 'PRESS'},
{"properties": [("mode", 'EDIT_GPENCIL')]}),
("object.mode_set",{"type": 'FIVE', "value": 'PRESS'},
("object.mode_set", {"type": 'FIVE', "value": 'PRESS'},
{"properties": [("mode", 'SCULPT_GPENCIL')]}),
("object.mode_set",{"type": 'SIX', "value": 'PRESS'},
("object.mode_set", {"type": 'SIX', "value": 'PRESS'},
{"properties": [("mode", 'VERTEX_GPENCIL')]}),
("object.mode_set",{"type": 'SEVEN', "value": 'PRESS'},
("object.mode_set", {"type": 'SEVEN', "value": 'PRESS'},
{"properties": [("mode", 'WEIGHT_GPENCIL')]}),
])
@@ -4052,7 +4082,7 @@ def km_generic_gizmo_maybe_drag(params):
{"space_type": 'EMPTY', "region_type": 'WINDOW'},
{"items":
_template_items_gizmo_tweak_value_drag()
},
},
)
return keymap

View File

@@ -429,9 +429,14 @@ class SEQUENCER_MT_view(Menu):
layout.separator()
layout.operator_context = 'INVOKE_REGION_WIN'
if st.view_type == 'PREVIEW':
# See above (T32595)
layout.operator_context = 'INVOKE_REGION_PREVIEW'
layout.operator("sequencer.view_selected", text="Frame Selected")
if is_sequencer_view:
layout.operator_context = 'INVOKE_REGION_WIN'
layout.operator("sequencer.view_selected", text="Frame Selected")
layout.operator("sequencer.view_all")
layout.operator("view2d.zoom_border", text="Zoom")

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