Merge branch 'master' into temp_bmesh_multires
This commit is contained in:
commit
7c4eb4f8db
|
@ -1712,22 +1712,18 @@ if(WITH_PYTHON)
|
|||
endif()
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
string(APPEND CMAKE_CXX_FLAGS " /std:c++17")
|
||||
# Make MSVC properly report the value of the __cplusplus preprocessor macro
|
||||
# Available MSVC 15.7 (1914) and up, without this it reports 199711L regardless
|
||||
# of the C++ standard chosen above
|
||||
if(MSVC_VERSION GREATER 1913)
|
||||
string(APPEND CMAKE_CXX_FLAGS " /Zc:__cplusplus")
|
||||
endif()
|
||||
elseif(
|
||||
CMAKE_COMPILER_IS_GNUCC OR
|
||||
CMAKE_C_COMPILER_ID MATCHES "Clang" OR
|
||||
CMAKE_C_COMPILER_ID MATCHES "Intel"
|
||||
)
|
||||
string(APPEND CMAKE_CXX_FLAGS " -std=c++17")
|
||||
else()
|
||||
message(FATAL_ERROR "Unknown compiler ${CMAKE_C_COMPILER_ID}, can't enable C++17 build")
|
||||
# Select C++17 as the standard for C++ projects.
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
# If C++17 is not available, downgrading to an earlier standard is NOT OK.
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
# Do not enable compiler specific language extentions.
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
|
||||
# Make MSVC properly report the value of the __cplusplus preprocessor macro
|
||||
# Available MSVC 15.7 (1914) and up, without this it reports 199711L regardless
|
||||
# of the C++ standard chosen above.
|
||||
if(MSVC AND MSVC_VERSION GREATER 1913)
|
||||
string(APPEND CMAKE_CXX_FLAGS " /Zc:__cplusplus")
|
||||
endif()
|
||||
|
||||
# Visual Studio has all standards it supports available by default
|
||||
|
|
|
@ -56,6 +56,7 @@ else()
|
|||
endif()
|
||||
|
||||
include(cmake/zlib.cmake)
|
||||
include(cmake/zstd.cmake)
|
||||
include(cmake/openal.cmake)
|
||||
include(cmake/png.cmake)
|
||||
include(cmake/jpeg.cmake)
|
||||
|
|
|
@ -92,3 +92,4 @@ download_source(ISPC)
|
|||
download_source(GMP)
|
||||
download_source(POTRACE)
|
||||
download_source(HARU)
|
||||
download_source(ZSTD)
|
||||
|
|
|
@ -192,6 +192,8 @@ harvest(potrace/include potrace/include "*.h")
|
|||
harvest(potrace/lib potrace/lib "*.a")
|
||||
harvest(haru/include haru/include "*.h")
|
||||
harvest(haru/lib haru/lib "*.a")
|
||||
harvest(zstd/include zstd/include "*.h")
|
||||
harvest(zstd/lib zstd/lib "*.a")
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
harvest(libglu/lib mesa/lib "*.so*")
|
||||
|
|
|
@ -500,5 +500,11 @@ set(HARU_HASH 4f916aa49c3069b3a10850013c507460)
|
|||
set(HARU_HASH_TYPE MD5)
|
||||
set(HARU_FILE libharu-${HARU_VERSION}.tar.gz)
|
||||
|
||||
set(ZSTD_VERSION 1.5.0)
|
||||
set(ZSTD_URI https://github.com/facebook/zstd/releases/download/v${ZSTD_VERSION}/zstd-${ZSTD_VERSION}.tar.gz)
|
||||
set(ZSTD_HASH 5194fbfa781fcf45b98c5e849651aa7b3b0a008c6b72d4a0db760f3002291e94)
|
||||
set(ZSTD_HASH_TYPE SHA256)
|
||||
set(ZSTD_FILE zstd-${ZSTD_VERSION}.tar.gz)
|
||||
|
||||
set(SSE2NEON_GIT https://github.com/DLTcollab/sse2neon.git)
|
||||
set(SSE2NEON_GIT_HASH fe5ff00bb8d19b327714a3c290f3e2ce81ba3525)
|
||||
|
|
|
@ -0,0 +1,51 @@
|
|||
# ***** BEGIN GPL LICENSE BLOCK *****
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# ***** END GPL LICENSE BLOCK *****
|
||||
|
||||
set(ZSTD_EXTRA_ARGS
|
||||
-DZSTD_BUILD_PROGRAMS=OFF
|
||||
-DZSTD_BUILD_SHARED=OFF
|
||||
-DZSTD_BUILD_STATIC=ON
|
||||
-DZSTD_BUILD_TESTS=OFF
|
||||
-DZSTD_LEGACY_SUPPORT=OFF
|
||||
-DZSTD_LZ4_SUPPORT=OFF
|
||||
-DZSTD_LZMA_SUPPORT=OFF
|
||||
-DZSTD_MULTITHREAD_SUPPORT=ON
|
||||
-DZSTD_PROGRAMS_LINK_SHARED=OFF
|
||||
-DZSTD_USE_STATIC_RUNTIME=OFF
|
||||
-DZSTD_ZLIB_SUPPORT=OFF
|
||||
)
|
||||
|
||||
ExternalProject_Add(external_zstd
|
||||
URL file://${PACKAGE_DIR}/${ZSTD_FILE}
|
||||
DOWNLOAD_DIR ${DOWNLOAD_DIR}
|
||||
URL_HASH ${ZSTD_HASH_TYPE}=${ZSTD_HASH}
|
||||
PREFIX ${BUILD_DIR}/zstd
|
||||
SOURCE_SUBDIR build/cmake
|
||||
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/zstd ${DEFAULT_CMAKE_FLAGS} ${ZSTD_EXTRA_ARGS}
|
||||
INSTALL_DIR ${LIBDIR}/zstd
|
||||
)
|
||||
|
||||
if(WIN32)
|
||||
if(BUILD_MODE STREQUAL Release)
|
||||
ExternalProject_Add_Step(external_zstd after_install
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/zstd/lib/zstd_static${LIBEXT} ${HARVEST_TARGET}/zstd/lib/zstd_static${LIBEXT}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/zstd/include/ ${HARVEST_TARGET}/zstd/include/
|
||||
DEPENDEES install
|
||||
)
|
||||
endif()
|
||||
endif()
|
|
@ -8,6 +8,9 @@ IGNORE_SOURCE = (
|
|||
# specific source files
|
||||
"extern/audaspace/",
|
||||
|
||||
# Use for `WIN32` only.
|
||||
"source/creator/blender_launcher_win32.c",
|
||||
|
||||
# specific source files
|
||||
"extern/bullet2/src/BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.cpp",
|
||||
"extern/bullet2/src/BulletCollision/CollisionDispatch/btConvex2dConvex2dAlgorithm.cpp",
|
||||
|
|
|
@ -7,3 +7,4 @@ Local modifications:
|
|||
checks for functions and so are needed.
|
||||
* Added special definitions of HAVE_SNPRINTF and HAVE_LIB_GFLAGS
|
||||
in Windows' specific config.h.
|
||||
* Silenced syscall deprecation warnings on macOS >= 10.12.
|
||||
|
|
|
@ -59,7 +59,7 @@
|
|||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_SYSCALL_H) || defined(HAVE_SYS_SYSCALL_H)
|
||||
#if (defined(HAVE_SYSCALL_H) || defined(HAVE_SYS_SYSCALL_H)) && (!(defined OS_MACOSX))
|
||||
# define safe_write(fd, s, len) syscall(SYS_write, fd, s, len)
|
||||
#else
|
||||
// Not so safe, but what can you do?
|
||||
|
|
|
@ -259,7 +259,13 @@ pid_t GetTID() {
|
|||
#endif
|
||||
static bool lacks_gettid = false;
|
||||
if (!lacks_gettid) {
|
||||
#ifdef OS_MACOSX
|
||||
uint64_t tid64;
|
||||
const int error = pthread_threadid_np(NULL, &tid64);
|
||||
pid_t tid = error ? -1 : (pid_t)tid64;
|
||||
#else
|
||||
pid_t tid = syscall(__NR_gettid);
|
||||
#endif
|
||||
if (tid != -1) {
|
||||
return tid;
|
||||
}
|
||||
|
|
|
@ -49,9 +49,9 @@
|
|||
|
||||
#include "atomic_ops_utils.h"
|
||||
|
||||
#if defined(__arm__)
|
||||
/* Attempt to fix compilation error on Debian armel kernel.
|
||||
* arm7 architecture does have both 32 and 64bit atomics, however
|
||||
#if defined(__arm__) || defined(__riscv)
|
||||
/* Attempt to fix compilation error on Debian armel and RISC-V kernels.
|
||||
* Both architectures do have both 32 and 64bit atomics, however
|
||||
* its gcc doesn't have __GCC_HAVE_SYNC_COMPARE_AND_SWAP_n defined.
|
||||
*/
|
||||
# define JE_FORCE_SYNC_COMPARE_AND_SWAP_1
|
||||
|
|
|
@ -137,9 +137,9 @@ bool BlenderImageLoader::load_pixels(const ImageMetaData &metadata,
|
|||
/* Premultiply, byte images are always straight for Blender. */
|
||||
unsigned char *cp = (unsigned char *)pixels;
|
||||
for (size_t i = 0; i < num_pixels; i++, cp += channels) {
|
||||
cp[0] = (cp[0] * cp[3]) >> 8;
|
||||
cp[1] = (cp[1] * cp[3]) >> 8;
|
||||
cp[2] = (cp[2] * cp[3]) >> 8;
|
||||
cp[0] = (cp[0] * cp[3]) / 255;
|
||||
cp[1] = (cp[1] * cp[3]) / 255;
|
||||
cp[2] = (cp[2] * cp[3]) / 255;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -109,23 +109,23 @@ void BlenderSync::sync_object_motion_init(BL::Object &b_parent, BL::Object &b_ob
|
|||
}
|
||||
|
||||
Geometry *geom = object->get_geometry();
|
||||
geom->set_use_motion_blur(false);
|
||||
geom->set_motion_steps(0);
|
||||
|
||||
uint motion_steps;
|
||||
int motion_steps = 0;
|
||||
bool use_motion_blur = false;
|
||||
|
||||
if (need_motion == Scene::MOTION_BLUR) {
|
||||
motion_steps = object_motion_steps(b_parent, b_ob, Object::MAX_MOTION_STEPS);
|
||||
geom->set_motion_steps(motion_steps);
|
||||
if (motion_steps && object_use_deform_motion(b_parent, b_ob)) {
|
||||
geom->set_use_motion_blur(true);
|
||||
use_motion_blur = true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
motion_steps = 3;
|
||||
geom->set_motion_steps(motion_steps);
|
||||
}
|
||||
|
||||
geom->set_use_motion_blur(use_motion_blur);
|
||||
geom->set_motion_steps(motion_steps);
|
||||
|
||||
motion.resize(motion_steps, transform_empty());
|
||||
|
||||
if (motion_steps) {
|
||||
|
|
|
@ -404,8 +404,6 @@ void BlenderSync::sync_film(BL::SpaceView3D &b_v3d)
|
|||
|
||||
Film *film = scene->film;
|
||||
|
||||
vector<Pass> prevpasses = scene->passes;
|
||||
|
||||
if (b_v3d) {
|
||||
film->set_display_pass(update_viewport_display_passes(b_v3d, scene->passes));
|
||||
}
|
||||
|
@ -435,11 +433,6 @@ void BlenderSync::sync_film(BL::SpaceView3D &b_v3d)
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!Pass::equals(prevpasses, scene->passes)) {
|
||||
film->tag_passes_update(scene, prevpasses, false);
|
||||
film->tag_modified();
|
||||
}
|
||||
}
|
||||
|
||||
/* Render Layer */
|
||||
|
@ -749,10 +742,13 @@ vector<Pass> BlenderSync::sync_render_passes(BL::Scene &b_scene,
|
|||
DENOISING_CLEAN_ALL_PASSES);
|
||||
scene->film->set_denoising_prefiltered_pass(denoising.store_passes &&
|
||||
denoising.type == DENOISER_NLM);
|
||||
|
||||
scene->film->set_pass_alpha_threshold(b_view_layer.pass_alpha_threshold());
|
||||
scene->film->tag_passes_update(scene, passes);
|
||||
scene->integrator->tag_update(scene, Integrator::UPDATE_ALL);
|
||||
|
||||
if (!Pass::equals(passes, scene->passes)) {
|
||||
scene->film->tag_passes_update(scene, passes);
|
||||
scene->film->tag_modified();
|
||||
scene->integrator->tag_update(scene, Integrator::UPDATE_ALL);
|
||||
}
|
||||
|
||||
return passes;
|
||||
}
|
||||
|
|
|
@ -50,24 +50,29 @@ ccl_device void svm_node_vector_rotate(ShaderData *sd,
|
|||
}
|
||||
else {
|
||||
float3 axis;
|
||||
float axis_length;
|
||||
switch (type) {
|
||||
case NODE_VECTOR_ROTATE_TYPE_AXIS_X:
|
||||
axis = make_float3(1.0f, 0.0f, 0.0f);
|
||||
axis_length = 1.0f;
|
||||
break;
|
||||
case NODE_VECTOR_ROTATE_TYPE_AXIS_Y:
|
||||
axis = make_float3(0.0f, 1.0f, 0.0f);
|
||||
axis_length = 1.0f;
|
||||
break;
|
||||
case NODE_VECTOR_ROTATE_TYPE_AXIS_Z:
|
||||
axis = make_float3(0.0f, 0.0f, 1.0f);
|
||||
axis_length = 1.0f;
|
||||
break;
|
||||
default:
|
||||
axis = normalize(stack_load_float3(stack, axis_stack_offset));
|
||||
axis = stack_load_float3(stack, axis_stack_offset);
|
||||
axis_length = len(axis);
|
||||
break;
|
||||
}
|
||||
float angle = stack_load_float(stack, angle_stack_offset);
|
||||
angle = invert ? -angle : angle;
|
||||
result = (len_squared(axis) != 0.0f) ?
|
||||
rotate_around_axis(vector - center, axis, angle) + center :
|
||||
result = (axis_length != 0.0f) ?
|
||||
rotate_around_axis(vector - center, axis / axis_length, angle) + center :
|
||||
vector;
|
||||
}
|
||||
|
||||
|
|
|
@ -288,6 +288,13 @@ elseif(WITH_GHOST_X11 OR WITH_GHOST_WAYLAND)
|
|||
${dbus_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
include(CheckSymbolExists)
|
||||
set(CMAKE_REQUIRED_DEFINITIONS "-D_GNU_SOURCE")
|
||||
check_symbol_exists(memfd_create "sys/mman.h" HAVE_MEMFD_CREATE)
|
||||
if (HAVE_MEMFD_CREATE)
|
||||
add_definitions(-DHAVE_MEMFD_CREATE)
|
||||
endif()
|
||||
|
||||
list(APPEND SRC
|
||||
intern/GHOST_SystemWayland.cpp
|
||||
intern/GHOST_WindowWayland.cpp
|
||||
|
|
|
@ -52,8 +52,6 @@
|
|||
|
||||
#include <cstring>
|
||||
|
||||
#include <linux/input-event-codes.h>
|
||||
|
||||
/* selected input event code defines from 'linux/input-event-codes.h'
|
||||
* We include some of the button input event codes here, since the header is
|
||||
* only available in more recent kernel versions. The event codes are used to
|
||||
|
@ -1806,13 +1804,43 @@ GHOST_TSuccess GHOST_SystemWayland::setCustomCursorShape(uint8_t *bitmap,
|
|||
static const int32_t stride = sizex * 4; /* ARGB */
|
||||
cursor->file_buffer->size = size_t(stride * sizey);
|
||||
|
||||
#ifdef HAVE_MEMFD_CREATE
|
||||
const int fd = memfd_create("blender-cursor-custom", MFD_CLOEXEC | MFD_ALLOW_SEALING);
|
||||
fcntl(fd, F_ADD_SEALS, F_SEAL_SHRINK);
|
||||
posix_fallocate(fd, 0, int32_t(cursor->file_buffer->size));
|
||||
if (fd >= 0) {
|
||||
fcntl(fd, F_ADD_SEALS, F_SEAL_SHRINK | F_SEAL_SEAL);
|
||||
}
|
||||
#else
|
||||
char *path = getenv("XDG_RUNTIME_DIR");
|
||||
if (!path) {
|
||||
errno = ENOENT;
|
||||
return GHOST_kFailure;
|
||||
}
|
||||
|
||||
char *tmpname;
|
||||
asprintf(&tmpname, "%s/%s", path, "blender-XXXXXX");
|
||||
const int fd = mkostemp(tmpname, O_CLOEXEC);
|
||||
if (fd >= 0) {
|
||||
unlink(tmpname);
|
||||
}
|
||||
free(tmpname);
|
||||
#endif
|
||||
|
||||
if (fd < 0) {
|
||||
return GHOST_kFailure;
|
||||
}
|
||||
|
||||
if (posix_fallocate(fd, 0, int32_t(cursor->file_buffer->size)) != 0) {
|
||||
return GHOST_kFailure;
|
||||
}
|
||||
|
||||
cursor->file_buffer->data = mmap(
|
||||
nullptr, cursor->file_buffer->size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
|
||||
|
||||
if (cursor->file_buffer->data == MAP_FAILED) {
|
||||
close(fd);
|
||||
return GHOST_kFailure;
|
||||
}
|
||||
|
||||
struct wl_shm_pool *pool = wl_shm_create_pool(d->shm, fd, int32_t(cursor->file_buffer->size));
|
||||
|
||||
wl_buffer *buffer = wl_shm_pool_create_buffer(
|
||||
|
|
|
@ -29,9 +29,9 @@
|
|||
|
||||
class GHOST_SystemWayland;
|
||||
|
||||
struct output_t;
|
||||
struct window_t;
|
||||
struct wl_surface;
|
||||
struct output_t;
|
||||
|
||||
class GHOST_WindowWayland : public GHOST_Window {
|
||||
public:
|
||||
|
|
|
@ -53,14 +53,8 @@ size_t malloc_usable_size(void *ptr);
|
|||
# undef USE_MALLOC_USABLE_SIZE
|
||||
#endif
|
||||
|
||||
/* Blame Microsoft for LLP64 and no inttypes.h, quick workaround needed: */
|
||||
#if defined(WIN64)
|
||||
# define SIZET_FORMAT "%I64u"
|
||||
# define SIZET_ARG(a) ((unsigned long long)(a))
|
||||
#else
|
||||
# define SIZET_FORMAT "%lu"
|
||||
# define SIZET_ARG(a) ((unsigned long)(a))
|
||||
#endif
|
||||
#define SIZET_FORMAT "%zu"
|
||||
#define SIZET_ARG(a) ((size_t)(a))
|
||||
|
||||
#define SIZET_ALIGN_4(len) ((len + 3) & ~(size_t)3)
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ inline void sincos(double x, double* sinx, double* cosx) {
|
|||
# endif
|
||||
#endif // !__MINGW64__
|
||||
|
||||
#if (defined(WIN32) || defined(WIN64)) && !defined(__MINGW32__)
|
||||
#if (defined(_WIN32) || defined(_WIN64)) && !defined(__MINGW32__)
|
||||
inline long lround(double d) {
|
||||
return (long)(d > 0 ? d + 0.5 : ceil(d - 0.5));
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ bool RetrackRegionTracker::Track(const FloatImage& image1,
|
|||
}
|
||||
// Now track x2 and y2 backward, to get xx1 and yy1 which, if the track is
|
||||
// good, should match x1 and y1 (but may not if the track is bad).
|
||||
double xx1 = *x2, yy1 = *x2;
|
||||
double xx1 = *x2, yy1 = *y2;
|
||||
if (!tracker_->Track(image2, image1, *x2, *y2, &xx1, &yy1)) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -324,6 +324,16 @@
|
|||
# define ARCH_CPU_ARM64 1
|
||||
# define ARCH_CPU_64_BITS 1
|
||||
# define ARCH_CPU_LITTLE_ENDIAN 1
|
||||
#elif defined(__riscv) && __riscv_xlen == 32
|
||||
# define ARCH_CPU_RISCV_FAMILY 1
|
||||
# define ARCH_CPU_RISCV32 1
|
||||
# define ARCH_CPU_64_BITS 0
|
||||
# define ARCH_CPU_LITTLE_ENDIAN 1
|
||||
#elif defined(__riscv) && __riscv_xlen == 64
|
||||
# define ARCH_CPU_RISCV_FAMILY 1
|
||||
# define ARCH_CPU_RISCV64 1
|
||||
# define ARCH_CPU_64_BITS 1
|
||||
# define ARCH_CPU_LITTLE_ENDIAN 1
|
||||
#elif defined(__pnacl__) || defined(__asmjs__) || defined(__wasm__)
|
||||
# define ARCH_CPU_32_BITS 1
|
||||
# define ARCH_CPU_LITTLE_ENDIAN 1
|
||||
|
@ -381,6 +391,9 @@
|
|||
#if !defined(ARCH_CPU_PPC64_FAMILY)
|
||||
# define ARCH_CPU_PPC64_FAMILY 0
|
||||
#endif
|
||||
#if !defined(ARCH_CPU_RISCV_FAMILY)
|
||||
# define ARCH_CPU_RISCV_FAMILY 0
|
||||
#endif
|
||||
#if !defined(ARCH_CPU_S390_FAMILY)
|
||||
# define ARCH_CPU_S390_FAMILY 0
|
||||
#endif
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 1ab25ca4f208edc8fb6c3551b3050ce3ad50ad7c
|
||||
Subproject commit f3791fbfdb839860035241ba477bf8872966af93
|
|
@ -1153,11 +1153,9 @@ class RoundCapShader(StrokeShader):
|
|||
return
|
||||
# calculate the number of additional vertices to form caps
|
||||
thickness_beg = sum(stroke[0].attribute.thickness)
|
||||
caplen_beg = thickness_beg / 2.0
|
||||
nverts_beg = max(5, int(thickness_beg))
|
||||
|
||||
thickness_end = sum(stroke[-1].attribute.thickness)
|
||||
caplen_end = (thickness_end) / 2.0
|
||||
nverts_end = max(5, int(thickness_end))
|
||||
|
||||
# adjust the total number of stroke vertices
|
||||
|
@ -1169,7 +1167,7 @@ class RoundCapShader(StrokeShader):
|
|||
# reshape the cap at the beginning of the stroke
|
||||
q, attr = buffer[1]
|
||||
p, attr = buffer[0]
|
||||
direction = (p - q).normalized() * caplen_beg
|
||||
direction = (p - q).normalized() * thickness_beg
|
||||
n = 1.0 / nverts_beg
|
||||
R, L = attr.thickness
|
||||
for t, svert in zip(range(nverts_beg, 0, -1), stroke):
|
||||
|
@ -1180,7 +1178,7 @@ class RoundCapShader(StrokeShader):
|
|||
# reshape the cap at the end of the stroke
|
||||
q, attr = buffer[-2]
|
||||
p, attr = buffer[-1]
|
||||
direction = (p - q).normalized() * caplen_beg
|
||||
direction = (p - q).normalized() * thickness_end
|
||||
n = 1.0 / nverts_end
|
||||
R, L = attr.thickness
|
||||
for t, svert in zip(range(nverts_end, 0, -1), reversed(stroke)):
|
||||
|
|
|
@ -56,6 +56,17 @@ class AssetBrowserPanel:
|
|||
return SpaceAssetInfo.is_asset_browser_poll(context)
|
||||
|
||||
|
||||
class AssetBrowserSpecificCategoryPanel(AssetBrowserPanel):
|
||||
asset_categories = set() # Set of strings like 'ANIMATIONS', see `asset_category_items` in rna_space.c
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
return (
|
||||
SpaceAssetInfo.is_asset_browser_poll(context)
|
||||
and context.space_data.params.asset_category in cls.asset_categories
|
||||
)
|
||||
|
||||
|
||||
class AssetMetaDataPanel:
|
||||
bl_space_type = 'FILE_BROWSER'
|
||||
bl_region_type = 'TOOL_PROPS'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import bpy
|
||||
bpy.context.camera.sensor_width = 13.2
|
||||
bpy.context.camera.sensor_height = 8.80
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import bpy
|
||||
bpy.context.camera.sensor_width = 7.18
|
||||
bpy.context.camera.sensor_height = 5.32
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import bpy
|
||||
bpy.context.camera.sensor_width = 6.17
|
||||
bpy.context.camera.sensor_height = 4.55
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import bpy
|
||||
bpy.context.camera.sensor_width = 5.76
|
||||
bpy.context.camera.sensor_height = 4.29
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import bpy
|
||||
bpy.context.camera.sensor_width = 5.37
|
||||
bpy.context.camera.sensor_height = 4.04
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import bpy
|
||||
bpy.context.camera.sensor_width = 4.54
|
||||
bpy.context.camera.sensor_height = 3.42
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import bpy
|
||||
bpy.context.camera.sensor_width = 8.8
|
||||
bpy.context.camera.sensor_height = 6.6
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import bpy
|
||||
bpy.context.camera.sensor_width = 23.6
|
||||
bpy.context.camera.sensor_height = 15.6
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import bpy
|
||||
bpy.context.camera.sensor_width = 22.30
|
||||
bpy.context.camera.sensor_height = 14.90
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import bpy
|
||||
bpy.context.camera.sensor_width = 27.90
|
||||
bpy.context.camera.sensor_height = 18.60
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import bpy
|
||||
bpy.context.camera.sensor_width = 10.26
|
||||
bpy.context.camera.sensor_height = 7.49
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import bpy
|
||||
bpy.context.camera.sensor_width = 22
|
||||
bpy.context.camera.sensor_height = 16
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import bpy
|
||||
bpy.context.camera.sensor_width = 52.45
|
||||
bpy.context.camera.sensor_height = 23.01
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import bpy
|
||||
bpy.context.camera.sensor_width = 71.41
|
||||
bpy.context.camera.sensor_height = 52.63
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import bpy
|
||||
bpy.context.camera.sensor_width = 12.35
|
||||
bpy.context.camera.sensor_height = 7.42
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import bpy
|
||||
bpy.context.camera.sensor_width = 24.89
|
||||
bpy.context.camera.sensor_height = 18.66
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import bpy
|
||||
bpy.context.camera.sensor_width = 54.12
|
||||
bpy.context.camera.sensor_height = 25.58
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import bpy
|
||||
bpy.context.camera.sensor_width = 36.70
|
||||
bpy.context.camera.sensor_height = 25.54
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import bpy
|
||||
bpy.context.camera.sensor_width = 29.90
|
||||
bpy.context.camera.sensor_height = 15.77
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import bpy
|
||||
bpy.context.camera.sensor_width = 12.48
|
||||
bpy.context.camera.sensor_height = 7.02
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import bpy
|
||||
bpy.context.camera.sensor_width = 18.96
|
||||
bpy.context.camera.sensor_height = 10.00
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import bpy
|
||||
bpy.context.camera.sensor_width = 23.10
|
||||
bpy.context.camera.sensor_height = 12.99
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import bpy
|
||||
bpy.context.camera.sensor_width = 25.34
|
||||
bpy.context.camera.sensor_height = 14.25
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import bpy
|
||||
bpy.context.camera.sensor_width = 20.70
|
||||
bpy.context.camera.sensor_height = 13.80
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import bpy
|
||||
bpy.context.camera.sensor_width = 36
|
||||
bpy.context.camera.sensor_height = 24
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import bpy
|
||||
bpy.context.camera.sensor_width = 17.3
|
||||
bpy.context.camera.sensor_height = 13.0
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import bpy
|
||||
bpy.context.camera.sensor_width = 44
|
||||
bpy.context.camera.sensor_height = 33
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import bpy
|
||||
bpy.context.camera.sensor_width = 25.60
|
||||
bpy.context.camera.sensor_height = 13.5
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import bpy
|
||||
bpy.context.camera.sensor_width = 30.70
|
||||
bpy.context.camera.sensor_height = 15.80
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import bpy
|
||||
bpy.context.camera.sensor_width = 29.90
|
||||
bpy.context.camera.sensor_height = 15.77
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import bpy
|
||||
bpy.context.camera.sensor_width = 40.96
|
||||
bpy.context.camera.sensor_height = 21.60
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
|
|
|
@ -103,8 +103,8 @@ class Prefs(bpy.types.KeyConfigPreferences):
|
|||
v3d_tilde_action: EnumProperty(
|
||||
name="Tilde Action",
|
||||
items=(
|
||||
('OBJECT_SWITCH', "Object Switch",
|
||||
"Switch the active object under the cursor (when not in object mode)",
|
||||
('VIEW', "Navigate",
|
||||
"View operations (useful for keyboards without a numpad)",
|
||||
0),
|
||||
('GIZMO', "Gizmos",
|
||||
"Control transform gizmos",
|
||||
|
@ -113,7 +113,7 @@ class Prefs(bpy.types.KeyConfigPreferences):
|
|||
description=(
|
||||
"Action when 'Tilde' is pressed"
|
||||
),
|
||||
default='OBJECT_SWITCH',
|
||||
default='VIEW',
|
||||
update=update_fn,
|
||||
)
|
||||
|
||||
|
|
|
@ -730,6 +730,8 @@ def km_user_interface(_params):
|
|||
("anim.keyingset_button_add", {"type": 'K', "value": 'PRESS'}, None),
|
||||
("anim.keyingset_button_remove", {"type": 'K', "value": 'PRESS', "alt": True}, None),
|
||||
("ui.reset_default_button", {"type": 'BACK_SPACE', "value": 'PRESS'}, {"properties": [("all", True)]}),
|
||||
# UI lists (polls check if there's a UI list under the cursor).
|
||||
("ui.list_start_filter", {"type": 'F', "value": 'PRESS', "ctrl": True}, None),
|
||||
])
|
||||
|
||||
return keymap
|
||||
|
@ -1084,7 +1086,13 @@ def km_view3d(params):
|
|||
{"properties": [("use_all_regions", True), ("center", False)]}),
|
||||
("view3d.view_all", {"type": 'C', "value": 'PRESS', "shift": True},
|
||||
{"properties": [("center", True)]}),
|
||||
op_menu_pie("VIEW3D_MT_view_pie", {"type": 'D', "value": 'CLICK_DRAG'}),
|
||||
op_menu_pie(
|
||||
"VIEW3D_MT_view_pie" if params.v3d_tilde_action == 'VIEW' else "VIEW3D_MT_transform_gizmo_pie",
|
||||
{"type": 'ACCENT_GRAVE', "value": params.pie_value},
|
||||
),
|
||||
*(() if not params.use_pie_click_drag else
|
||||
(("view3d.navigate", {"type": 'ACCENT_GRAVE', "value": 'CLICK'}, None),)),
|
||||
("view3d.navigate", {"type": 'ACCENT_GRAVE', "value": 'PRESS', "shift": True}, None),
|
||||
("view3d.navigate", {"type": 'ACCENT_GRAVE', "value": 'PRESS', "shift": True}, None),
|
||||
# Numpad views.
|
||||
("view3d.view_camera", {"type": 'NUMPAD_0', "value": 'PRESS'}, None),
|
||||
|
@ -1328,32 +1336,6 @@ def km_view3d(params):
|
|||
op_tool_cycle("builtin.select_box", {"type": 'W', "value": 'PRESS'}),
|
||||
])
|
||||
|
||||
# Tilda key.
|
||||
if params.use_pie_click_drag:
|
||||
items.extend([
|
||||
("object.transfer_mode",
|
||||
{"type": 'ACCENT_GRAVE', "value": 'CLICK' if params.use_pie_click_drag else 'PRESS'},
|
||||
None),
|
||||
op_menu_pie(
|
||||
"VIEW3D_MT_transform_gizmo_pie",
|
||||
{"type": 'ACCENT_GRAVE', "value": 'CLICK_DRAG'},
|
||||
)
|
||||
])
|
||||
else:
|
||||
if params.v3d_tilde_action == 'OBJECT_SWITCH':
|
||||
items.append(
|
||||
("object.transfer_mode",
|
||||
{"type": 'ACCENT_GRAVE', "value": 'PRESS'},
|
||||
{"properties": [("use_eyedropper", False)]})
|
||||
)
|
||||
else:
|
||||
items.append(
|
||||
op_menu_pie(
|
||||
"VIEW3D_MT_transform_gizmo_pie",
|
||||
{"type": 'ACCENT_GRAVE', "value": 'PRESS'},
|
||||
)
|
||||
)
|
||||
|
||||
return keymap
|
||||
|
||||
|
||||
|
@ -2679,7 +2661,8 @@ def km_sequencer(params):
|
|||
{"properties": [("side", 'LEFT')]}),
|
||||
("sequencer.select_side_of_frame", {"type": 'RIGHT_BRACKET', "value": 'PRESS'},
|
||||
{"properties": [("side", 'RIGHT')]}),
|
||||
|
||||
("wm.context_toggle", {"type": 'TAB', "value": 'PRESS', "shift": True},
|
||||
{"properties": [("data_path", 'tool_settings.use_snap_sequencer')]}),
|
||||
*_template_items_context_menu("SEQUENCER_MT_context_menu", params.context_menu_event),
|
||||
])
|
||||
|
||||
|
@ -5071,6 +5054,11 @@ def km_object_non_modal(params):
|
|||
("object.origin_set", {"type": 'C', "value": 'PRESS', "shift": True, "ctrl": True, "alt": True}, None),
|
||||
])
|
||||
else:
|
||||
items.extend([
|
||||
# NOTE: this shortcut (while not temporary) is not ideal, see: T89757.
|
||||
("object.transfer_mode", {"type": 'Q', "value": 'PRESS', "alt": True}, None),
|
||||
])
|
||||
|
||||
if params.use_pie_click_drag:
|
||||
items.extend([
|
||||
("object.mode_set", {"type": 'TAB', "value": 'CLICK'},
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import bpy
|
||||
bpy.context.camera.sensor_width = 13.2
|
||||
bpy.context.camera.sensor_height = 8.80
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import bpy
|
||||
bpy.context.camera.sensor_width = 7.18
|
||||
bpy.context.camera.sensor_height = 5.32
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import bpy
|
||||
bpy.context.camera.sensor_width = 6.17
|
||||
bpy.context.camera.sensor_height = 4.55
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import bpy
|
||||
bpy.context.camera.sensor_width = 5.76
|
||||
bpy.context.camera.sensor_height = 4.29
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import bpy
|
||||
bpy.context.camera.sensor_width = 5.37
|
||||
bpy.context.camera.sensor_height = 4.04
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import bpy
|
||||
bpy.context.camera.sensor_width = 4.54
|
||||
bpy.context.camera.sensor_height = 3.42
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import bpy
|
||||
bpy.context.camera.sensor_width = 8.8
|
||||
bpy.context.camera.sensor_height = 6.6
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import bpy
|
||||
bpy.context.camera.sensor_width = 23.6
|
||||
bpy.context.camera.sensor_height = 15.6
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import bpy
|
||||
bpy.context.camera.sensor_width = 22.30
|
||||
bpy.context.camera.sensor_height = 14.90
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import bpy
|
||||
bpy.context.camera.sensor_width = 27.90
|
||||
bpy.context.camera.sensor_height = 18.60
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import bpy
|
||||
bpy.context.camera.sensor_width = 10.26
|
||||
bpy.context.camera.sensor_height = 7.49
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import bpy
|
||||
bpy.context.camera.sensor_width = 22
|
||||
bpy.context.camera.sensor_height = 16
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import bpy
|
||||
bpy.context.camera.sensor_width = 52.45
|
||||
bpy.context.camera.sensor_height = 23.01
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import bpy
|
||||
bpy.context.camera.sensor_width = 71.41
|
||||
bpy.context.camera.sensor_height = 52.63
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import bpy
|
||||
bpy.context.camera.sensor_width = 12.35
|
||||
bpy.context.camera.sensor_height = 7.42
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import bpy
|
||||
bpy.context.camera.sensor_width = 24.89
|
||||
bpy.context.camera.sensor_height = 18.66
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import bpy
|
||||
bpy.context.camera.sensor_width = 54.12
|
||||
bpy.context.camera.sensor_height = 25.58
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import bpy
|
||||
bpy.context.camera.sensor_width = 36.70
|
||||
bpy.context.camera.sensor_height = 25.54
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import bpy
|
||||
bpy.context.camera.sensor_width = 29.90
|
||||
bpy.context.camera.sensor_height = 15.77
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import bpy
|
||||
bpy.context.camera.sensor_width = 12.48
|
||||
bpy.context.camera.sensor_height = 7.02
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import bpy
|
||||
bpy.context.camera.sensor_width = 18.96
|
||||
bpy.context.camera.sensor_height = 10.00
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import bpy
|
||||
bpy.context.camera.sensor_width = 23.10
|
||||
bpy.context.camera.sensor_height = 12.99
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import bpy
|
||||
bpy.context.camera.sensor_width = 25.34
|
||||
bpy.context.camera.sensor_height = 14.25
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import bpy
|
||||
bpy.context.camera.sensor_width = 20.70
|
||||
bpy.context.camera.sensor_height = 13.80
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import bpy
|
||||
bpy.context.camera.sensor_width = 36
|
||||
bpy.context.camera.sensor_height = 24
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import bpy
|
||||
bpy.context.camera.sensor_width = 17.3
|
||||
bpy.context.camera.sensor_height = 13.0
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import bpy
|
||||
bpy.context.camera.sensor_width = 44
|
||||
bpy.context.camera.sensor_height = 33
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import bpy
|
||||
bpy.context.camera.sensor_width = 25.60
|
||||
bpy.context.camera.sensor_height = 13.5
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import bpy
|
||||
bpy.context.camera.sensor_width = 30.70
|
||||
bpy.context.camera.sensor_height = 15.80
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import bpy
|
||||
bpy.context.camera.sensor_width = 29.90
|
||||
bpy.context.camera.sensor_height = 15.77
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import bpy
|
||||
bpy.context.camera.sensor_width = 40.96
|
||||
bpy.context.camera.sensor_height = 21.60
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
||||
|
|
|
@ -18,7 +18,9 @@
|
|||
|
||||
# <pep8 compliant>
|
||||
from __future__ import annotations
|
||||
from pathlib import Path
|
||||
|
||||
import bpy
|
||||
from bpy.types import Operator
|
||||
|
||||
from bpy_extras.asset_utils import (
|
||||
|
@ -72,7 +74,88 @@ class ASSET_OT_tag_remove(Operator):
|
|||
return {'FINISHED'}
|
||||
|
||||
|
||||
class ASSET_OT_open_containing_blend_file(Operator):
|
||||
"""Open the blend file that contains the active asset"""
|
||||
|
||||
bl_idname = "asset.open_containing_blend_file"
|
||||
bl_label = "Open Blend File"
|
||||
bl_options = {'REGISTER'}
|
||||
|
||||
_process = None # Optional[subprocess.Popen]
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
asset_file_handle = getattr(context, 'asset_file_handle', None)
|
||||
asset_library = getattr(context, 'asset_library', None)
|
||||
|
||||
if not asset_library:
|
||||
cls.poll_message_set("No asset library selected")
|
||||
return False
|
||||
if not asset_file_handle:
|
||||
cls.poll_message_set("No asset selected")
|
||||
return False
|
||||
if asset_file_handle.local_id:
|
||||
cls.poll_message_set("Selected asset is contained in the current file")
|
||||
return False
|
||||
return True
|
||||
|
||||
def execute(self, context):
|
||||
asset_file_handle = context.asset_file_handle
|
||||
asset_library = context.asset_library
|
||||
|
||||
if asset_file_handle.local_id:
|
||||
self.report({'WARNING'}, "This asset is stored in the current blend file")
|
||||
return {'CANCELLED'}
|
||||
|
||||
asset_lib_path = bpy.types.AssetHandle.get_full_library_path(asset_file_handle, asset_library)
|
||||
self.open_in_new_blender(asset_lib_path)
|
||||
|
||||
wm = context.window_manager
|
||||
self._timer = wm.event_timer_add(0.1, window=context.window)
|
||||
wm.modal_handler_add(self)
|
||||
|
||||
return {'RUNNING_MODAL'}
|
||||
|
||||
def modal(self, context, event):
|
||||
if event.type != 'TIMER':
|
||||
return {'PASS_THROUGH'}
|
||||
|
||||
if self._process is None:
|
||||
self.report({'ERROR'}, "Unable to find any running process")
|
||||
self.cancel(context)
|
||||
return {'CANCELLED'}
|
||||
|
||||
returncode = self._process.poll()
|
||||
if returncode is None:
|
||||
# Process is still running.
|
||||
return {'RUNNING_MODAL'}
|
||||
|
||||
if returncode:
|
||||
self.report({'WARNING'}, "Blender subprocess exited with error code %d" % returncode)
|
||||
|
||||
# TODO(Sybren): Replace this with a generic "reload assets" operator
|
||||
# that can run outside of the Asset Browser context.
|
||||
if bpy.ops.file.refresh.poll():
|
||||
bpy.ops.file.refresh()
|
||||
if bpy.ops.asset.list_refresh.poll():
|
||||
bpy.ops.asset.list_refresh()
|
||||
|
||||
self.cancel(context)
|
||||
return {'FINISHED'}
|
||||
|
||||
def cancel(self, context):
|
||||
wm = context.window_manager
|
||||
wm.event_timer_remove(self._timer)
|
||||
|
||||
def open_in_new_blender(self, filepath):
|
||||
import subprocess
|
||||
|
||||
cli_args = [bpy.app.binary_path, str(filepath)]
|
||||
self._process = subprocess.Popen(cli_args)
|
||||
|
||||
|
||||
classes = (
|
||||
ASSET_OT_tag_add,
|
||||
ASSET_OT_tag_remove,
|
||||
ASSET_OT_open_containing_blend_file,
|
||||
)
|
||||
|
|
|
@ -108,14 +108,13 @@ class SequencerSplitMulticam(Operator):
|
|||
if s.multicam_source == camera or camera >= s.channel:
|
||||
return {'FINISHED'}
|
||||
|
||||
if not s.select:
|
||||
s.select = True
|
||||
|
||||
cfra = context.scene.frame_current
|
||||
bpy.ops.sequencer.split(frame=cfra, type='SOFT', side='RIGHT')
|
||||
for s in context.scene.sequence_editor.sequences_all:
|
||||
if s.select and s.type == 'MULTICAM' and s.frame_final_start <= cfra and cfra < s.frame_final_end:
|
||||
context.scene.sequence_editor.active_strip = s
|
||||
right_strip = s.split(frame=cfra, split_method='SOFT')
|
||||
|
||||
if right_strip:
|
||||
s.select = False
|
||||
right_strip.select = True
|
||||
context.scene.sequence_editor.active_strip = right_strip
|
||||
|
||||
context.scene.sequence_editor.active_strip.multicam_source = camera
|
||||
return {'FINISHED'}
|
||||
|
|
|
@ -117,13 +117,15 @@ def register():
|
|||
for cls in mod.classes:
|
||||
register_class(cls)
|
||||
|
||||
# space_userprefs.py
|
||||
from bpy.props import (
|
||||
EnumProperty,
|
||||
StringProperty,
|
||||
)
|
||||
from bpy.types import WindowManager
|
||||
from bpy.types import (
|
||||
WindowManager,
|
||||
)
|
||||
|
||||
# space_userprefs.py
|
||||
def addon_filter_items(_self, _context):
|
||||
import addon_utils
|
||||
|
||||
|
@ -234,3 +236,21 @@ class UI_UL_list(bpy.types.UIList):
|
|||
|
||||
|
||||
bpy.utils.register_class(UI_UL_list)
|
||||
|
||||
|
||||
class UI_MT_list_item_context_menu(bpy.types.Menu):
|
||||
"""
|
||||
UI List item context menu definition. Scripts can append/prepend this to
|
||||
add own operators to the context menu. They must check context though, so
|
||||
their items only draw in a valid context and for the correct UI list.
|
||||
"""
|
||||
|
||||
bl_label = "List Item"
|
||||
bl_idname = "UI_MT_list_item_context_menu"
|
||||
|
||||
def draw(self, context):
|
||||
# Dummy function. This type is just for scripts to append their own
|
||||
# context menu items.
|
||||
pass
|
||||
|
||||
bpy.utils.register_class(UI_MT_list_item_context_menu)
|
||||
|
|
|
@ -41,7 +41,6 @@ class MESH_MT_vertex_group_context_menu(Menu):
|
|||
).sort_type = 'BONE_HIERARCHY'
|
||||
layout.separator()
|
||||
layout.operator("object.vertex_group_copy", icon='DUPLICATE')
|
||||
layout.operator("object.vertex_group_copy_to_linked")
|
||||
layout.operator("object.vertex_group_copy_to_selected")
|
||||
layout.separator()
|
||||
layout.operator("object.vertex_group_mirror", icon='ARROW_LEFTRIGHT').use_topology = False
|
||||
|
@ -647,7 +646,7 @@ class DATA_PT_mesh_attributes(MeshButtonsPanel, Panel):
|
|||
if len(colliding_names) == 0:
|
||||
return
|
||||
|
||||
layout.label(text="Name Collisions: {}".format(", ".join(colliding_names)), icon='INFO')
|
||||
layout.label(text="Name collisions: {}".format(", ".join(colliding_names)), icon='ERROR')
|
||||
|
||||
|
||||
classes = (
|
||||
|
|
|
@ -552,6 +552,10 @@ class FILEBROWSER_MT_context_menu(Menu):
|
|||
sub.operator_context = 'EXEC_DEFAULT'
|
||||
sub.operator("file.delete", text="Delete")
|
||||
|
||||
active_asset = asset_utils.SpaceAssetInfo.get_active_asset(context)
|
||||
if active_asset:
|
||||
layout.operator("asset.open_containing_blend_file")
|
||||
|
||||
layout.separator()
|
||||
|
||||
sub = layout.row()
|
||||
|
@ -592,15 +596,28 @@ class ASSETBROWSER_PT_metadata(asset_utils.AssetBrowserPanel, Panel):
|
|||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
active_file = context.active_file
|
||||
active_asset = asset_utils.SpaceAssetInfo.get_active_asset(context)
|
||||
asset_file_handle = context.asset_file_handle
|
||||
|
||||
if not active_file or not active_asset:
|
||||
if asset_file_handle is None:
|
||||
layout.label(text="No asset selected", icon='INFO')
|
||||
return
|
||||
|
||||
# If the active file is an ID, use its name directly so renaming is possible from right here.
|
||||
layout.prop(context.id if context.id is not None else active_file, "name", text="")
|
||||
asset_library = context.asset_library
|
||||
asset_lib_path = bpy.types.AssetHandle.get_full_library_path(asset_file_handle, asset_library)
|
||||
|
||||
if asset_file_handle.local_id:
|
||||
# If the active file is an ID, use its name directly so renaming is possible from right here.
|
||||
layout.prop(asset_file_handle.local_id, "name", text="")
|
||||
row = layout.row()
|
||||
row.label(text="Source: Current File")
|
||||
else:
|
||||
layout.prop(asset_file_handle, "name", text="")
|
||||
col = layout.column(align=True) # Just to reduce margin.
|
||||
col.label(text="Source:")
|
||||
row = col.row()
|
||||
row.label(text=asset_lib_path)
|
||||
|
||||
row.operator("asset.open_containing_blend_file", text="", icon='TOOL_SETTINGS')
|
||||
|
||||
|
||||
class ASSETBROWSER_PT_metadata_preview(asset_utils.AssetMetaDataPanel, Panel):
|
||||
|
|
|
@ -516,6 +516,7 @@ geometry_node_categories = [
|
|||
NodeItem("GeometryNodeCurveStar"),
|
||||
NodeItem("GeometryNodeCurveSpiral"),
|
||||
NodeItem("GeometryNodeCurveQuadraticBezier"),
|
||||
NodeItem("GeometryNodeCurvePrimitiveQuadrilateral"),
|
||||
NodeItem("GeometryNodeCurvePrimitiveBezierSegment"),
|
||||
]),
|
||||
GeometryNodeCategory("GEO_GEOMETRY", "Geometry", items=[
|
||||
|
@ -559,6 +560,7 @@ geometry_node_categories = [
|
|||
NodeItem("GeometryNodeMeshLine"),
|
||||
NodeItem("GeometryNodeMeshUVSphere"),
|
||||
]),
|
||||
|
||||
GeometryNodeCategory("GEO_POINT", "Point", items=[
|
||||
NodeItem("GeometryNodePointDistribute"),
|
||||
NodeItem("GeometryNodePointInstance"),
|
||||
|
|
|
@ -268,6 +268,12 @@ void animsys_evaluate_action(struct PointerRNA *ptr,
|
|||
const struct AnimationEvalContext *anim_eval_context,
|
||||
bool flush_to_original);
|
||||
|
||||
/* Evaluate action, and blend the result into the current values (instead of overwriting fully). */
|
||||
void animsys_blend_in_action(struct PointerRNA *ptr,
|
||||
struct bAction *act,
|
||||
const AnimationEvalContext *anim_eval_context,
|
||||
float blend_factor);
|
||||
|
||||
/* Evaluate Action Group */
|
||||
void animsys_evaluate_action_group(struct PointerRNA *ptr,
|
||||
struct bAction *act,
|
||||
|
|
|
@ -28,7 +28,6 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
struct AnimationEvalContext;
|
||||
struct bAction;
|
||||
struct BMEditMesh;
|
||||
struct Bone;
|
||||
struct Depsgraph;
|
||||
|
@ -39,6 +38,7 @@ struct Mesh;
|
|||
struct Object;
|
||||
struct PoseTree;
|
||||
struct Scene;
|
||||
struct bAction;
|
||||
struct bArmature;
|
||||
struct bConstraint;
|
||||
struct bGPDstroke;
|
||||
|
@ -207,9 +207,18 @@ void BKE_pose_where_is_bone_tail(struct bPoseChannel *pchan);
|
|||
|
||||
/* Evaluate the action and apply it to the pose. If any pose bones are selected, only FCurves that
|
||||
* relate to those bones are evaluated. */
|
||||
void BKE_pose_apply_action(struct Object *ob,
|
||||
struct bAction *action,
|
||||
struct AnimationEvalContext *anim_eval_context);
|
||||
void BKE_pose_apply_action_selected_bones(struct Object *ob,
|
||||
struct bAction *action,
|
||||
struct AnimationEvalContext *anim_eval_context);
|
||||
/* Evaluate the action and apply it to the pose. Ignore selection state of the bones. */
|
||||
void BKE_pose_apply_action_all_bones(struct Object *ob,
|
||||
struct bAction *action,
|
||||
struct AnimationEvalContext *anim_eval_context);
|
||||
|
||||
void BKE_pose_apply_action_blend(struct Object *ob,
|
||||
struct bAction *action,
|
||||
struct AnimationEvalContext *anim_eval_context,
|
||||
float blend_factor);
|
||||
|
||||
void vec_roll_to_mat3(const float vec[3], const float roll, float r_mat[3][3]);
|
||||
void vec_roll_to_mat3_normalized(const float nor[3], const float roll, float r_mat[3][3]);
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct AssetLibraryReference;
|
||||
struct BlendDataReader;
|
||||
struct BlendWriter;
|
||||
struct ID;
|
||||
|
@ -45,6 +46,8 @@ struct AssetTagEnsureResult BKE_asset_metadata_tag_ensure(struct AssetMetaData *
|
|||
const char *name);
|
||||
void BKE_asset_metadata_tag_remove(struct AssetMetaData *asset_data, struct AssetTag *tag);
|
||||
|
||||
void BKE_asset_library_reference_init_default(struct AssetLibraryReference *library_ref);
|
||||
|
||||
struct PreviewImage *BKE_asset_metadata_preview_get_from_id(const struct AssetMetaData *asset_data,
|
||||
const struct ID *owner_id);
|
||||
|
||||
|
|
|
@ -39,13 +39,13 @@ extern "C" {
|
|||
|
||||
/* Blender file format version. */
|
||||
#define BLENDER_FILE_VERSION BLENDER_VERSION
|
||||
#define BLENDER_FILE_SUBVERSION 9
|
||||
#define BLENDER_FILE_SUBVERSION 12
|
||||
|
||||
/* Minimum Blender version that supports reading file written with the current
|
||||
* version. Older Blender versions will test this and show a warning if the file
|
||||
* was written with too new a version. */
|
||||
#define BLENDER_FILE_MIN_VERSION 290
|
||||
#define BLENDER_FILE_MIN_SUBVERSION 0
|
||||
#define BLENDER_FILE_MIN_VERSION 300
|
||||
#define BLENDER_FILE_MIN_SUBVERSION 11
|
||||
|
||||
/** User readable version string. */
|
||||
const char *BKE_blender_version_string(void);
|
||||
|
|
|
@ -23,6 +23,9 @@
|
|||
* \ingroup bke
|
||||
*/
|
||||
|
||||
/* XXX temporary, until AssetHandle is designed properly and queries can return a pointer to it. */
|
||||
#include "DNA_asset_types.h"
|
||||
|
||||
#include "DNA_listBase.h"
|
||||
#include "DNA_object_enums.h"
|
||||
#include "RNA_types.h"
|
||||
|
@ -357,6 +360,9 @@ int CTX_data_visible_gpencil_layers(const bContext *C, ListBase *list);
|
|||
int CTX_data_editable_gpencil_layers(const bContext *C, ListBase *list);
|
||||
int CTX_data_editable_gpencil_strokes(const bContext *C, ListBase *list);
|
||||
|
||||
const struct AssetLibraryReference *CTX_wm_asset_library(const bContext *C);
|
||||
struct AssetHandle CTX_wm_asset_handle(const bContext *C, bool *r_is_valid);
|
||||
|
||||
bool CTX_wm_interface_locked(const bContext *C);
|
||||
|
||||
/* Gets pointer to the dependency graph.
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue