Compare commits
115 Commits
temp-geome
...
node-edito
Author | SHA1 | Date | |
---|---|---|---|
d85adbe929 | |||
f1f53f9122 | |||
91d3a54869 | |||
542aed8d55 | |||
ee0000b8bb | |||
7f1d1b03ad | |||
abee9a85d4 | |||
![]() |
223016a408 | ||
6e6a1838ea | |||
1d3ffc93ec | |||
e517aaa136 | |||
8b8c3c34dd | |||
4f6cab176a | |||
98876d46ef | |||
7ef2b760dc | |||
c27b7df563 | |||
a496af8680 | |||
54ce344bc7 | |||
dbfde0fe70 | |||
8e43ef5f31 | |||
edaaa2afdd | |||
d2dc452333 | |||
2cd1bc3aa7 | |||
1a912462f4 | |||
bcf9c73cbc | |||
3c9c557580 | |||
c7fee64dea | |||
ca3891e83b | |||
a5114bfb85 | |||
022f8b552d | |||
14508ef100 | |||
bfaf09b5bc | |||
c2fa36999f | |||
![]() |
00073651d4 | ||
eb030204f1 | |||
![]() |
56005ef499 | ||
b6d6d8a1aa | |||
0037e08b06 | |||
b6b20c4d92 | |||
![]() |
d486ee2dbd | ||
9ba6b64efa | |||
e4ca6b93ad | |||
77d7cae266 | |||
f4e0a19d4f | |||
053082e9d8 | |||
![]() |
ddd4b2b785 | ||
e5a1cadb2f | |||
c18675b12c | |||
dba3fb9e09 | |||
3e695a27cd | |||
a1063fc6c2 | |||
b414322f26 | |||
899eefd1bb | |||
72607feb91 | |||
870bcf6e1a | |||
8b78510fc4 | |||
e0bc5c4087 | |||
1fd653dd82 | |||
d9aae38bc8 | |||
efad9bcdda | |||
b5d7fb813f | |||
bb16f96973 | |||
7197017ea9 | |||
ed6fd01ba9 | |||
826bed4349 | |||
797f6e1483 | |||
e011e4ce76 | |||
92f8a6ac21 | |||
7b8d812277 | |||
2ae4e860f6 | |||
2ef192a55b | |||
a51f8f94d5 | |||
17f72be3cb | |||
2a868d277e | |||
b60a72eaab | |||
2dcb6782e0 | |||
4d64de2853 | |||
5af7225816 | |||
925df8ef26 | |||
2ee575fc1f | |||
1f55786791 | |||
a9dfde7b49 | |||
0ea0ccc4ff | |||
81366b7d2c | |||
dc960a81d1 | |||
4f8edc8e7f | |||
b8ae30e9e3 | |||
ae28ceb9d8 | |||
05b685989b | |||
7654203cc8 | |||
2489f72d79 | |||
730a46e87d | |||
f944121700 | |||
21de669141 | |||
5b176b66da | |||
a55b73417f | |||
ea6d099082 | |||
34f99bc6be | |||
e65a0ee1e1 | |||
f186e7f47f | |||
594bdf1cc0 | |||
9be38c1fbf | |||
e1418ad7a1 | |||
f964d80b82 | |||
a967780fd7 | |||
c6ae967059 | |||
d2e9ce2a46 | |||
ab333aaac5 | |||
d8c24c165f | |||
687b653797 | |||
a5f221cc2f | |||
fa01599de7 | |||
cfbf277e37 | |||
76bfcb34fb | |||
![]() |
b67c7f89ff |
@@ -43,6 +43,12 @@ endif()
|
||||
|
||||
if(WIN32)
|
||||
set(EMBREE_BUILD_DIR ${BUILD_MODE}/)
|
||||
if(BUILD_MODE STREQUAL Debug)
|
||||
list(APPEND EMBREE_EXTRA_ARGS
|
||||
-DEMBREE_TBBMALLOC_LIBRARY_NAME=tbbmalloc_debug
|
||||
-DEMBREE_TBB_LIBRARY_NAME=tbb_debug
|
||||
)
|
||||
endif()
|
||||
else()
|
||||
set(EMBREE_BUILD_DIR)
|
||||
endif()
|
||||
|
@@ -22,6 +22,7 @@ if(WIN32)
|
||||
-DTBB_BUILD_TBBMALLOC_PROXY=On
|
||||
-DTBB_BUILD_STATIC=Off
|
||||
-DTBB_BUILD_TESTS=Off
|
||||
-DCMAKE_DEBUG_POSTFIX=_debug
|
||||
)
|
||||
set(TBB_LIBRARY tbb)
|
||||
set(TBB_STATIC_LIBRARY Off)
|
||||
@@ -55,17 +56,17 @@ if(WIN32)
|
||||
ExternalProject_Add_Step(external_tbb after_install
|
||||
# findtbb.cmake in some deps *NEEDS* to find tbb_debug.lib even if they are not going to use it
|
||||
# to make that test pass, we place a copy with the right name in the lib folder.
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbb.lib ${HARVEST_TARGET}/tbb/lib/tbb_debug.lib
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbbmalloc.lib ${HARVEST_TARGET}/tbb/lib/tbbmalloc_debug.lib
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbb.dll ${HARVEST_TARGET}/tbb/lib/tbb_debug.dll
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbbmalloc.dll ${HARVEST_TARGET}/tbb/lib/tbbmalloc_debug.dll
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbb.lib ${LIBDIR}/tbb/lib/tbb_debug.lib
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbbmalloc.lib ${LIBDIR}/tbb/lib/tbbmalloc_debug.lib
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/bin/tbb.dll ${LIBDIR}/tbb/bin/tbb_debug.dll
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/bin/tbbmalloc.dll ${LIBDIR}/tbb/bin/tbbmalloc_debug.dll
|
||||
# Normal collection of build artifacts
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbb.lib ${HARVEST_TARGET}/tbb/lib/tbb.lib
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbb.dll ${HARVEST_TARGET}/tbb/lib/tbb.dll
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/bin/tbb.dll ${HARVEST_TARGET}/tbb/bin/tbb.dll
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbbmalloc.lib ${HARVEST_TARGET}/tbb/lib/tbbmalloc.lib
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbbmalloc.dll ${HARVEST_TARGET}/tbb/lib/tbbmalloc.dll
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/bin/tbbmalloc.dll ${HARVEST_TARGET}/tbb/bin/tbbmalloc.dll
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbbmalloc_proxy.lib ${HARVEST_TARGET}/tbb/lib/tbbmalloc_proxy.lib
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbbmalloc_proxy.dll ${HARVEST_TARGET}/tbb/lib/tbbmalloc_proxy.dll
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/bin/tbbmalloc_proxy.dll ${HARVEST_TARGET}/tbb/bin/tbbmalloc_proxy.dll
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/tbb/include/ ${HARVEST_TARGET}/tbb/include/
|
||||
DEPENDEES install
|
||||
)
|
||||
@@ -76,11 +77,11 @@ if(WIN32)
|
||||
# to make that test pass, we place a copy with the right name in the lib folder.
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbb_debug.lib ${LIBDIR}/tbb/lib/tbb.lib
|
||||
# Normal collection of build artifacts
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbb_debug.lib ${HARVEST_TARGET}/tbb/lib/debug/tbb_debug.lib
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbb_debug.dll ${HARVEST_TARGET}/tbb/lib/debug/tbb_debug.dll
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbbmalloc_proxy.lib ${HARVEST_TARGET}/tbb/lib/tbbmalloc_proxy_debug.lib
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbbmalloc.dll ${HARVEST_TARGET}/tbb/lib/debug/tbbmalloc.dll
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbbmalloc_proxy.dll ${HARVEST_TARGET}/tbb/lib/debug/tbbmalloc_proxy.dll
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbb_debug.lib ${HARVEST_TARGET}/tbb/lib/tbb_debug.lib
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/bin/tbb_debug.dll ${HARVEST_TARGET}/tbb/bin/tbb_debug.dll
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbbmalloc_proxy_debug.lib ${HARVEST_TARGET}/tbb/lib/tbbmalloc_proxy_debug.lib
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/bin/tbbmalloc_debug.dll ${HARVEST_TARGET}/tbb/bin/tbbmalloc_debug.dll
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/bin/tbbmalloc_proxy_debug.dll ${HARVEST_TARGET}/tbb/bin/tbbmalloc_proxy_debug.dll
|
||||
DEPENDEES install
|
||||
)
|
||||
endif()
|
||||
|
@@ -596,14 +596,6 @@ function(SETUP_LIBDIRS)
|
||||
link_directories(${GMP_LIBPATH})
|
||||
endif()
|
||||
|
||||
if(WITH_GHOST_WAYLAND)
|
||||
link_directories(
|
||||
${wayland-client_LIBRARY_DIRS}
|
||||
${wayland-egl_LIBRARY_DIRS}
|
||||
${xkbcommon_LIBRARY_DIRS}
|
||||
${wayland-cursor_LIBRARY_DIRS})
|
||||
endif()
|
||||
|
||||
if(WIN32 AND NOT UNIX)
|
||||
link_directories(${PTHREADS_LIBPATH})
|
||||
endif()
|
||||
|
@@ -575,17 +575,17 @@ if(WITH_GHOST_WAYLAND)
|
||||
pkg_check_modules(wayland-scanner REQUIRED wayland-scanner)
|
||||
pkg_check_modules(xkbcommon REQUIRED xkbcommon)
|
||||
pkg_check_modules(wayland-cursor REQUIRED wayland-cursor)
|
||||
pkg_check_modules(dbus REQUIRED dbus-1)
|
||||
|
||||
set(WITH_GL_EGL ON)
|
||||
|
||||
if(WITH_GHOST_WAYLAND)
|
||||
list(APPEND PLATFORM_LINKLIBS
|
||||
${wayland-client_LIBRARIES}
|
||||
${wayland-egl_LIBRARIES}
|
||||
${xkbcommon_LIBRARIES}
|
||||
${wayland-cursor_LIBRARIES}
|
||||
${wayland-client_LINK_LIBRARIES}
|
||||
${wayland-egl_LINK_LIBRARIES}
|
||||
${xkbcommon_LINK_LIBRARIES}
|
||||
${wayland-cursor_LINK_LIBRARIES}
|
||||
${dbus_LINK_LIBRARIES}
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WITH_GHOST_X11)
|
||||
|
@@ -675,7 +675,7 @@ if(WITH_SYSTEM_AUDASPACE)
|
||||
endif()
|
||||
|
||||
if(WITH_TBB)
|
||||
set(TBB_LIBRARIES optimized ${LIBDIR}/tbb/lib/tbb.lib debug ${LIBDIR}/tbb/lib/debug/tbb_debug.lib)
|
||||
set(TBB_LIBRARIES optimized ${LIBDIR}/tbb/lib/tbb.lib debug ${LIBDIR}/tbb/lib/tbb_debug.lib)
|
||||
set(TBB_INCLUDE_DIR ${LIBDIR}/tbb/include)
|
||||
set(TBB_INCLUDE_DIRS ${TBB_INCLUDE_DIR})
|
||||
if(WITH_TBB_MALLOC_PROXY)
|
||||
|
@@ -15,6 +15,15 @@ if(WITH_WINDOWS_BUNDLE_CRT)
|
||||
|
||||
include(InstallRequiredSystemLibraries)
|
||||
|
||||
# ucrtbase(d).dll cannot be in the manifest, due to the way windows 10 handles
|
||||
# redirects for this dll, for details see T88813.
|
||||
foreach(lib ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS})
|
||||
string(FIND ${lib} "ucrtbase" pos)
|
||||
if(NOT pos EQUAL -1)
|
||||
list(REMOVE_ITEM CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS ${lib})
|
||||
install(FILES ${lib} DESTINATION . COMPONENT Libraries)
|
||||
endif()
|
||||
endforeach()
|
||||
# Install the CRT to the blender.crt Sub folder.
|
||||
install(FILES ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} DESTINATION ./blender.crt COMPONENT Libraries)
|
||||
|
||||
|
@@ -52,6 +52,9 @@ shader node_vector_math(string math_type = "add",
|
||||
else if (math_type == "faceforward") {
|
||||
Vector = compatible_faceforward(Vector1, Vector2, Vector3);
|
||||
}
|
||||
else if (math_type == "multiply_add") {
|
||||
Vector = Vector1 * Vector2 + Vector3;
|
||||
}
|
||||
else if (math_type == "dot_product") {
|
||||
Value = dot(Vector1, Vector2);
|
||||
}
|
||||
|
@@ -58,7 +58,8 @@ ccl_device void svm_node_vector_math(KernelGlobals *kg,
|
||||
float3 vector;
|
||||
|
||||
/* 3 Vector Operators */
|
||||
if (type == NODE_VECTOR_MATH_WRAP || type == NODE_VECTOR_MATH_FACEFORWARD) {
|
||||
if (type == NODE_VECTOR_MATH_WRAP || type == NODE_VECTOR_MATH_FACEFORWARD ||
|
||||
type == NODE_VECTOR_MATH_MULTIPLY_ADD) {
|
||||
uint4 extra_node = read_node(kg, offset);
|
||||
c = stack_load_float3(stack, extra_node.x);
|
||||
}
|
||||
|
@@ -52,6 +52,9 @@ ccl_device void svm_vector_math(float *value,
|
||||
case NODE_VECTOR_MATH_FACEFORWARD:
|
||||
*vector = faceforward(a, b, c);
|
||||
break;
|
||||
case NODE_VECTOR_MATH_MULTIPLY_ADD:
|
||||
*vector = a * b + c;
|
||||
break;
|
||||
case NODE_VECTOR_MATH_DOT_PRODUCT:
|
||||
*value = dot(a, b);
|
||||
break;
|
||||
|
@@ -341,6 +341,7 @@ typedef enum NodeVectorMathType {
|
||||
NODE_VECTOR_MATH_TANGENT,
|
||||
NODE_VECTOR_MATH_REFRACT,
|
||||
NODE_VECTOR_MATH_FACEFORWARD,
|
||||
NODE_VECTOR_MATH_MULTIPLY_ADD,
|
||||
} NodeVectorMathType;
|
||||
|
||||
typedef enum NodeClampType {
|
||||
|
@@ -6093,6 +6093,7 @@ NODE_DEFINE(VectorMathNode)
|
||||
type_enum.insert("reflect", NODE_VECTOR_MATH_REFLECT);
|
||||
type_enum.insert("refract", NODE_VECTOR_MATH_REFRACT);
|
||||
type_enum.insert("faceforward", NODE_VECTOR_MATH_FACEFORWARD);
|
||||
type_enum.insert("multiply_add", NODE_VECTOR_MATH_MULTIPLY_ADD);
|
||||
|
||||
type_enum.insert("dot_product", NODE_VECTOR_MATH_DOT_PRODUCT);
|
||||
|
||||
@@ -6165,7 +6166,8 @@ void VectorMathNode::compile(SVMCompiler &compiler)
|
||||
int vector_stack_offset = compiler.stack_assign_if_linked(vector_out);
|
||||
|
||||
/* 3 Vector Operators */
|
||||
if (math_type == NODE_VECTOR_MATH_WRAP || math_type == NODE_VECTOR_MATH_FACEFORWARD) {
|
||||
if (math_type == NODE_VECTOR_MATH_WRAP || math_type == NODE_VECTOR_MATH_FACEFORWARD ||
|
||||
math_type == NODE_VECTOR_MATH_MULTIPLY_ADD) {
|
||||
ShaderInput *vector3_in = input("Vector3");
|
||||
int vector3_stack_offset = compiler.stack_assign(vector3_in);
|
||||
compiler.add_node(
|
||||
|
@@ -282,6 +282,7 @@ elseif(WITH_GHOST_X11 OR WITH_GHOST_WAYLAND)
|
||||
${wayland-egl_INCLUDE_DIRS}
|
||||
${xkbcommon_INCLUDE_DIRS}
|
||||
${wayland-cursor_INCLUDE_DIRS}
|
||||
${dbus_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
list(APPEND SRC
|
||||
@@ -321,6 +322,11 @@ elseif(WITH_GHOST_X11 OR WITH_GHOST_WAYLAND)
|
||||
xdg-shell
|
||||
"${WAYLAND_PROTOCOLS_DIR}/stable/xdg-shell/xdg-shell.xml"
|
||||
)
|
||||
# xdg-decoration.
|
||||
generate_protocol_bindings(
|
||||
xdg-decoration
|
||||
"${WAYLAND_PROTOCOLS_DIR}/unstable/xdg-decoration/xdg-decoration-unstable-v1.xml"
|
||||
)
|
||||
# Pointer-constraints.
|
||||
generate_protocol_bindings(
|
||||
pointer-constraints
|
||||
|
@@ -40,6 +40,7 @@
|
||||
#include <unordered_map>
|
||||
#include <unordered_set>
|
||||
|
||||
#include "GHOST_WaylandCursorSettings.h"
|
||||
#include <pointer-constraints-client-protocol.h>
|
||||
#include <relative-pointer-client-protocol.h>
|
||||
#include <wayland-cursor.h>
|
||||
@@ -52,15 +53,6 @@
|
||||
|
||||
#include <cstring>
|
||||
|
||||
struct output_t {
|
||||
struct wl_output *output;
|
||||
int32_t width, height;
|
||||
int transform;
|
||||
int scale;
|
||||
std::string make;
|
||||
std::string model;
|
||||
};
|
||||
|
||||
struct buffer_t {
|
||||
void *data;
|
||||
size_t size;
|
||||
@@ -72,6 +64,12 @@ struct cursor_t {
|
||||
struct wl_buffer *buffer;
|
||||
struct wl_cursor_image image;
|
||||
struct buffer_t *file_buffer = nullptr;
|
||||
struct wl_cursor_theme *theme = nullptr;
|
||||
int size;
|
||||
std::string theme_name;
|
||||
// outputs on which the cursor is visible
|
||||
std::unordered_set<const output_t *> outputs;
|
||||
int scale = 1;
|
||||
};
|
||||
|
||||
struct data_offer_t {
|
||||
@@ -142,10 +140,14 @@ struct display_t {
|
||||
struct wl_display *display;
|
||||
struct wl_compositor *compositor = nullptr;
|
||||
struct xdg_wm_base *xdg_shell = nullptr;
|
||||
struct zxdg_decoration_manager_v1 *xdg_decoration_manager = nullptr;
|
||||
struct wl_shm *shm = nullptr;
|
||||
std::vector<output_t *> outputs;
|
||||
std::vector<input_t *> inputs;
|
||||
struct wl_cursor_theme *cursor_theme = nullptr;
|
||||
struct {
|
||||
std::string theme;
|
||||
int size;
|
||||
} cursor;
|
||||
struct wl_data_device_manager *data_device_manager = nullptr;
|
||||
struct zwp_relative_pointer_manager_v1 *relative_pointer_manager = nullptr;
|
||||
struct zwp_pointer_constraints_v1 *pointer_constraints = nullptr;
|
||||
@@ -154,6 +156,8 @@ struct display_t {
|
||||
std::vector<struct wl_egl_window *> os_egl_windows;
|
||||
};
|
||||
|
||||
static GHOST_WindowManager *window_manager = nullptr;
|
||||
|
||||
static void display_destroy(display_t *d)
|
||||
{
|
||||
if (d->data_device_manager) {
|
||||
@@ -188,6 +192,9 @@ static void display_destroy(display_t *d)
|
||||
if (input->cursor.surface) {
|
||||
wl_surface_destroy(input->cursor.surface);
|
||||
}
|
||||
if (input->cursor.theme) {
|
||||
wl_cursor_theme_destroy(input->cursor.theme);
|
||||
}
|
||||
if (input->pointer) {
|
||||
wl_pointer_destroy(input->pointer);
|
||||
}
|
||||
@@ -210,10 +217,6 @@ static void display_destroy(display_t *d)
|
||||
delete input;
|
||||
}
|
||||
|
||||
if (d->cursor_theme) {
|
||||
wl_cursor_theme_destroy(d->cursor_theme);
|
||||
}
|
||||
|
||||
if (d->shm) {
|
||||
wl_shm_destroy(d->shm);
|
||||
}
|
||||
@@ -238,6 +241,10 @@ static void display_destroy(display_t *d)
|
||||
wl_compositor_destroy(d->compositor);
|
||||
}
|
||||
|
||||
if (d->xdg_decoration_manager) {
|
||||
zxdg_decoration_manager_v1_destroy(d->xdg_decoration_manager);
|
||||
}
|
||||
|
||||
if (d->xdg_shell) {
|
||||
xdg_wm_base_destroy(d->xdg_shell);
|
||||
}
|
||||
@@ -478,7 +485,9 @@ static void dnd_events(const input_t *const input, const GHOST_TEventType event)
|
||||
static std::string read_pipe(data_offer_t *data_offer, const std::string mime_receive)
|
||||
{
|
||||
int pipefd[2];
|
||||
pipe(pipefd);
|
||||
if (pipe(pipefd) != 0) {
|
||||
return {};
|
||||
}
|
||||
wl_data_offer_receive(data_offer->id, mime_receive.c_str(), pipefd[1]);
|
||||
close(pipefd[1]);
|
||||
|
||||
@@ -513,7 +522,9 @@ static void data_source_send(void *data,
|
||||
int32_t fd)
|
||||
{
|
||||
const char *const buffer = static_cast<char *>(data);
|
||||
write(fd, buffer, strlen(buffer) + 1);
|
||||
if (write(fd, buffer, strlen(buffer) + 1) < 0) {
|
||||
GHOST_PRINT("error writing to clipboard: " << std::strerror(errno) << std::endl);
|
||||
}
|
||||
close(fd);
|
||||
}
|
||||
|
||||
@@ -789,13 +800,80 @@ static void cursor_buffer_release(void *data, struct wl_buffer *wl_buffer)
|
||||
cursor_t *cursor = static_cast<cursor_t *>(data);
|
||||
|
||||
wl_buffer_destroy(wl_buffer);
|
||||
|
||||
if (wl_buffer == cursor->buffer) {
|
||||
/* the mapped buffer was from a custom cursor */
|
||||
cursor->buffer = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
const struct wl_buffer_listener cursor_buffer_listener = {
|
||||
cursor_buffer_release,
|
||||
};
|
||||
|
||||
static GHOST_IWindow *get_window(struct wl_surface *surface)
|
||||
{
|
||||
if (!surface) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
for (GHOST_IWindow *win : window_manager->getWindows()) {
|
||||
if (surface == static_cast<const GHOST_WindowWayland *>(win)->surface()) {
|
||||
return win;
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
static bool update_cursor_scale(cursor_t &cursor, wl_shm *shm)
|
||||
{
|
||||
int scale = 0;
|
||||
for (const output_t *output : cursor.outputs) {
|
||||
if (output->scale > scale)
|
||||
scale = output->scale;
|
||||
}
|
||||
|
||||
if (scale > 0 && cursor.scale != scale) {
|
||||
cursor.scale = scale;
|
||||
wl_surface_set_buffer_scale(cursor.surface, scale);
|
||||
wl_cursor_theme_destroy(cursor.theme);
|
||||
cursor.theme = wl_cursor_theme_load(cursor.theme_name.c_str(), scale * cursor.size, shm);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static void cursor_surface_enter(void *data,
|
||||
struct wl_surface * /*wl_surface*/,
|
||||
struct wl_output *output)
|
||||
{
|
||||
input_t *input = static_cast<input_t *>(data);
|
||||
for (const output_t *reg_output : input->system->outputs()) {
|
||||
if (reg_output->output == output) {
|
||||
input->cursor.outputs.insert(reg_output);
|
||||
}
|
||||
}
|
||||
update_cursor_scale(input->cursor, input->system->shm());
|
||||
}
|
||||
|
||||
static void cursor_surface_leave(void *data,
|
||||
struct wl_surface * /*wl_surface*/,
|
||||
struct wl_output *output)
|
||||
{
|
||||
input_t *input = static_cast<input_t *>(data);
|
||||
for (const output_t *reg_output : input->system->outputs()) {
|
||||
if (reg_output->output == output) {
|
||||
input->cursor.outputs.erase(reg_output);
|
||||
}
|
||||
}
|
||||
update_cursor_scale(input->cursor, input->system->shm());
|
||||
}
|
||||
|
||||
struct wl_surface_listener cursor_surface_listener = {
|
||||
cursor_surface_enter,
|
||||
cursor_surface_leave,
|
||||
};
|
||||
|
||||
static void pointer_enter(void *data,
|
||||
struct wl_pointer * /*wl_pointer*/,
|
||||
uint32_t serial,
|
||||
@@ -803,19 +881,25 @@ static void pointer_enter(void *data,
|
||||
wl_fixed_t surface_x,
|
||||
wl_fixed_t surface_y)
|
||||
{
|
||||
if (!surface) {
|
||||
GHOST_WindowWayland *win = static_cast<GHOST_WindowWayland *>(get_window(surface));
|
||||
|
||||
if (!win) {
|
||||
return;
|
||||
}
|
||||
|
||||
win->activate();
|
||||
|
||||
input_t *input = static_cast<input_t *>(data);
|
||||
input->pointer_serial = serial;
|
||||
input->x = wl_fixed_to_int(surface_x);
|
||||
input->y = wl_fixed_to_int(surface_y);
|
||||
input->x = win->scale() * wl_fixed_to_int(surface_x);
|
||||
input->y = win->scale() * wl_fixed_to_int(surface_y);
|
||||
input->focus_pointer = surface;
|
||||
|
||||
input->system->pushEvent(
|
||||
new GHOST_EventCursor(input->system->getMilliSeconds(),
|
||||
win->setCursorShape(win->getCursorShape());
|
||||
|
||||
input->system->pushEvent(new GHOST_EventCursor(input->system->getMilliSeconds(),
|
||||
GHOST_kEventCursorMove,
|
||||
static_cast<GHOST_WindowWayland *>(wl_surface_get_user_data(surface)),
|
||||
static_cast<GHOST_WindowWayland *>(win),
|
||||
input->x,
|
||||
input->y,
|
||||
GHOST_TABLET_DATA_NONE));
|
||||
@@ -826,9 +910,14 @@ static void pointer_leave(void *data,
|
||||
uint32_t /*serial*/,
|
||||
struct wl_surface *surface)
|
||||
{
|
||||
if (surface != nullptr) {
|
||||
static_cast<input_t *>(data)->focus_pointer = nullptr;
|
||||
GHOST_IWindow *win = get_window(surface);
|
||||
|
||||
if (!win) {
|
||||
return;
|
||||
}
|
||||
|
||||
static_cast<input_t *>(data)->focus_pointer = nullptr;
|
||||
static_cast<GHOST_WindowWayland *>(win)->deactivate();
|
||||
}
|
||||
|
||||
static void pointer_motion(void *data,
|
||||
@@ -839,21 +928,20 @@ static void pointer_motion(void *data,
|
||||
{
|
||||
input_t *input = static_cast<input_t *>(data);
|
||||
|
||||
GHOST_IWindow *win = static_cast<GHOST_WindowWayland *>(
|
||||
wl_surface_get_user_data(input->focus_pointer));
|
||||
GHOST_WindowWayland *win = static_cast<GHOST_WindowWayland *>(get_window(input->focus_pointer));
|
||||
|
||||
if (!win) {
|
||||
return;
|
||||
}
|
||||
|
||||
input->x = wl_fixed_to_int(surface_x);
|
||||
input->y = wl_fixed_to_int(surface_y);
|
||||
input->x = win->scale() * wl_fixed_to_int(surface_x);
|
||||
input->y = win->scale() * wl_fixed_to_int(surface_y);
|
||||
|
||||
input->system->pushEvent(new GHOST_EventCursor(input->system->getMilliSeconds(),
|
||||
GHOST_kEventCursorMove,
|
||||
win,
|
||||
wl_fixed_to_int(surface_x),
|
||||
wl_fixed_to_int(surface_y),
|
||||
input->x,
|
||||
input->y,
|
||||
GHOST_TABLET_DATA_NONE));
|
||||
}
|
||||
|
||||
@@ -864,6 +952,14 @@ static void pointer_button(void *data,
|
||||
uint32_t button,
|
||||
uint32_t state)
|
||||
{
|
||||
input_t *input = static_cast<input_t *>(data);
|
||||
|
||||
GHOST_IWindow *win = get_window(input->focus_pointer);
|
||||
|
||||
if (!win) {
|
||||
return;
|
||||
}
|
||||
|
||||
GHOST_TEventType etype = GHOST_kEventUnknown;
|
||||
switch (state) {
|
||||
case WL_POINTER_BUTTON_STATE_RELEASED:
|
||||
@@ -887,9 +983,6 @@ static void pointer_button(void *data,
|
||||
break;
|
||||
}
|
||||
|
||||
input_t *input = static_cast<input_t *>(data);
|
||||
GHOST_IWindow *win = static_cast<GHOST_WindowWayland *>(
|
||||
wl_surface_get_user_data(input->focus_pointer));
|
||||
input->data_source->source_serial = serial;
|
||||
input->buttons.set(ebutton, state == WL_POINTER_BUTTON_STATE_PRESSED);
|
||||
input->system->pushEvent(new GHOST_EventButton(
|
||||
@@ -902,12 +995,18 @@ static void pointer_axis(void *data,
|
||||
uint32_t axis,
|
||||
wl_fixed_t value)
|
||||
{
|
||||
input_t *input = static_cast<input_t *>(data);
|
||||
|
||||
GHOST_IWindow *win = get_window(input->focus_pointer);
|
||||
|
||||
if (!win) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (axis != WL_POINTER_AXIS_VERTICAL_SCROLL) {
|
||||
return;
|
||||
}
|
||||
input_t *input = static_cast<input_t *>(data);
|
||||
GHOST_IWindow *win = static_cast<GHOST_WindowWayland *>(
|
||||
wl_surface_get_user_data(input->focus_pointer));
|
||||
|
||||
input->system->pushEvent(
|
||||
new GHOST_EventWheel(input->system->getMilliSeconds(), win, std::signbit(value) ? +1 : -1));
|
||||
}
|
||||
@@ -1137,7 +1236,12 @@ static void seat_capabilities(void *data, struct wl_seat *wl_seat, uint32_t capa
|
||||
input->cursor.visible = true;
|
||||
input->cursor.buffer = nullptr;
|
||||
input->cursor.file_buffer = new buffer_t;
|
||||
if (!get_cursor_settings(input->cursor.theme_name, input->cursor.size)) {
|
||||
input->cursor.theme_name = std::string();
|
||||
input->cursor.size = default_cursor_size;
|
||||
}
|
||||
wl_pointer_add_listener(input->pointer, &pointer_listener, data);
|
||||
wl_surface_add_listener(input->cursor.surface, &cursor_surface_listener, data);
|
||||
}
|
||||
|
||||
if (capabilities & WL_SEAT_CAPABILITY_KEYBOARD) {
|
||||
@@ -1160,8 +1264,8 @@ static void output_geometry(void *data,
|
||||
struct wl_output * /*wl_output*/,
|
||||
int32_t /*x*/,
|
||||
int32_t /*y*/,
|
||||
int32_t /*physical_width*/,
|
||||
int32_t /*physical_height*/,
|
||||
int32_t physical_width,
|
||||
int32_t physical_height,
|
||||
int32_t /*subpixel*/,
|
||||
const char *make,
|
||||
const char *model,
|
||||
@@ -1171,6 +1275,8 @@ static void output_geometry(void *data,
|
||||
output->transform = transform;
|
||||
output->make = std::string(make);
|
||||
output->model = std::string(model);
|
||||
output->width_mm = physical_width;
|
||||
output->height_mm = physical_height;
|
||||
}
|
||||
|
||||
static void output_mode(void *data,
|
||||
@@ -1181,8 +1287,8 @@ static void output_mode(void *data,
|
||||
int32_t /*refresh*/)
|
||||
{
|
||||
output_t *output = static_cast<output_t *>(data);
|
||||
output->width = width;
|
||||
output->height = height;
|
||||
output->width_pxl = width;
|
||||
output->height_pxl = height;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1227,13 +1333,17 @@ static void global_add(void *data,
|
||||
struct display_t *display = static_cast<struct display_t *>(data);
|
||||
if (!strcmp(interface, wl_compositor_interface.name)) {
|
||||
display->compositor = static_cast<wl_compositor *>(
|
||||
wl_registry_bind(wl_registry, name, &wl_compositor_interface, 1));
|
||||
wl_registry_bind(wl_registry, name, &wl_compositor_interface, 3));
|
||||
}
|
||||
else if (!strcmp(interface, xdg_wm_base_interface.name)) {
|
||||
display->xdg_shell = static_cast<xdg_wm_base *>(
|
||||
wl_registry_bind(wl_registry, name, &xdg_wm_base_interface, 1));
|
||||
xdg_wm_base_add_listener(display->xdg_shell, &shell_listener, nullptr);
|
||||
}
|
||||
else if (!strcmp(interface, zxdg_decoration_manager_v1_interface.name)) {
|
||||
display->xdg_decoration_manager = static_cast<zxdg_decoration_manager_v1 *>(
|
||||
wl_registry_bind(wl_registry, name, &zxdg_decoration_manager_v1_interface, 1));
|
||||
}
|
||||
else if (!strcmp(interface, wl_output_interface.name)) {
|
||||
output_t *output = new output_t;
|
||||
output->scale = 1;
|
||||
@@ -1335,16 +1445,6 @@ GHOST_SystemWayland::GHOST_SystemWayland() : GHOST_System(), d(new display_t)
|
||||
wl_data_device_add_listener(input->data_device, &data_device_listener, input);
|
||||
}
|
||||
}
|
||||
|
||||
const char *theme = std::getenv("XCURSOR_THEME");
|
||||
const char *size = std::getenv("XCURSOR_SIZE");
|
||||
const int sizei = size ? std::stoi(size) : default_cursor_size;
|
||||
|
||||
d->cursor_theme = wl_cursor_theme_load(theme, sizei, d->shm);
|
||||
if (!d->cursor_theme) {
|
||||
display_destroy(d);
|
||||
throw std::runtime_error("Wayland: unable to access cursor themes!");
|
||||
}
|
||||
}
|
||||
|
||||
GHOST_SystemWayland::~GHOST_SystemWayland()
|
||||
@@ -1471,8 +1571,8 @@ void GHOST_SystemWayland::getMainDisplayDimensions(GHOST_TUns32 &width, GHOST_TU
|
||||
{
|
||||
if (getNumDisplays() > 0) {
|
||||
/* We assume first output as main. */
|
||||
width = uint32_t(d->outputs[0]->width);
|
||||
height = uint32_t(d->outputs[0]->height);
|
||||
width = uint32_t(d->outputs[0]->width_pxl) / d->outputs[0]->scale;
|
||||
height = uint32_t(d->outputs[0]->height_pxl) / d->outputs[0]->scale;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1481,7 +1581,7 @@ void GHOST_SystemWayland::getAllDisplayDimensions(GHOST_TUns32 &width, GHOST_TUn
|
||||
getMainDisplayDimensions(width, height);
|
||||
}
|
||||
|
||||
GHOST_IContext *GHOST_SystemWayland::createOffscreenContext(GHOST_GLSettings glSettings)
|
||||
GHOST_IContext *GHOST_SystemWayland::createOffscreenContext(GHOST_GLSettings /*glSettings*/)
|
||||
{
|
||||
/* Create new off-screen window. */
|
||||
wl_surface *os_surface = wl_compositor_create_surface(compositor());
|
||||
@@ -1530,6 +1630,11 @@ GHOST_IWindow *GHOST_SystemWayland::createWindow(const char *title,
|
||||
const bool is_dialog,
|
||||
const GHOST_IWindow *parentWindow)
|
||||
{
|
||||
/* globally store pointer to window manager */
|
||||
if (!window_manager) {
|
||||
window_manager = getWindowManager();
|
||||
}
|
||||
|
||||
GHOST_WindowWayland *window = new GHOST_WindowWayland(
|
||||
this,
|
||||
title,
|
||||
@@ -1574,6 +1679,21 @@ xdg_wm_base *GHOST_SystemWayland::shell()
|
||||
return d->xdg_shell;
|
||||
}
|
||||
|
||||
zxdg_decoration_manager_v1 *GHOST_SystemWayland::decoration_manager()
|
||||
{
|
||||
return d->xdg_decoration_manager;
|
||||
}
|
||||
|
||||
const std::vector<output_t *> &GHOST_SystemWayland::outputs() const
|
||||
{
|
||||
return d->outputs;
|
||||
}
|
||||
|
||||
wl_shm *GHOST_SystemWayland::shm() const
|
||||
{
|
||||
return d->shm;
|
||||
}
|
||||
|
||||
void GHOST_SystemWayland::setSelection(const std::string &selection)
|
||||
{
|
||||
this->selection = selection;
|
||||
@@ -1581,23 +1701,20 @@ void GHOST_SystemWayland::setSelection(const std::string &selection)
|
||||
|
||||
static void set_cursor_buffer(input_t *input, wl_buffer *buffer)
|
||||
{
|
||||
input->cursor.visible = (buffer != nullptr);
|
||||
cursor_t *c = &input->cursor;
|
||||
|
||||
wl_surface_attach(input->cursor.surface, buffer, 0, 0);
|
||||
wl_surface_commit(input->cursor.surface);
|
||||
c->visible = (buffer != nullptr);
|
||||
|
||||
if (input->cursor.visible) {
|
||||
wl_surface_damage(input->cursor.surface,
|
||||
0,
|
||||
0,
|
||||
int32_t(input->cursor.image.width),
|
||||
int32_t(input->cursor.image.height));
|
||||
wl_surface_attach(c->surface, buffer, 0, 0);
|
||||
|
||||
wl_surface_damage(c->surface, 0, 0, int32_t(c->image.width), int32_t(c->image.height));
|
||||
wl_pointer_set_cursor(input->pointer,
|
||||
input->pointer_serial,
|
||||
input->cursor.surface,
|
||||
int32_t(input->cursor.image.hotspot_x),
|
||||
int32_t(input->cursor.image.hotspot_y));
|
||||
}
|
||||
c->visible ? c->surface : nullptr,
|
||||
int32_t(c->image.hotspot_x) / c->scale,
|
||||
int32_t(c->image.hotspot_y) / c->scale);
|
||||
|
||||
wl_surface_commit(c->surface);
|
||||
}
|
||||
|
||||
GHOST_TSuccess GHOST_SystemWayland::setCursorShape(GHOST_TStandardCursor shape)
|
||||
@@ -1608,7 +1725,15 @@ GHOST_TSuccess GHOST_SystemWayland::setCursorShape(GHOST_TStandardCursor shape)
|
||||
const std::string cursor_name = cursors.count(shape) ? cursors.at(shape) :
|
||||
cursors.at(GHOST_kStandardCursorDefault);
|
||||
|
||||
wl_cursor *cursor = wl_cursor_theme_get_cursor(d->cursor_theme, cursor_name.c_str());
|
||||
input_t *input = d->inputs[0];
|
||||
cursor_t *c = &input->cursor;
|
||||
|
||||
if (!c->theme) {
|
||||
/* The cursor surface hasn't entered an output yet. Initialize theme with scale 1. */
|
||||
c->theme = wl_cursor_theme_load(c->theme_name.c_str(), c->size, d->inputs[0]->system->shm());
|
||||
}
|
||||
|
||||
wl_cursor *cursor = wl_cursor_theme_get_cursor(c->theme, cursor_name.c_str());
|
||||
|
||||
if (!cursor) {
|
||||
GHOST_PRINT("cursor '" << cursor_name << "' does not exist" << std::endl);
|
||||
@@ -1620,11 +1745,11 @@ GHOST_TSuccess GHOST_SystemWayland::setCursorShape(GHOST_TStandardCursor shape)
|
||||
if (!buffer) {
|
||||
return GHOST_kFailure;
|
||||
}
|
||||
cursor_t *c = &d->inputs[0]->cursor;
|
||||
|
||||
c->buffer = buffer;
|
||||
c->image = *image;
|
||||
|
||||
set_cursor_buffer(d->inputs[0], buffer);
|
||||
set_cursor_buffer(input, buffer);
|
||||
|
||||
return GHOST_kSuccess;
|
||||
}
|
||||
@@ -1735,6 +1860,11 @@ GHOST_TSuccess GHOST_SystemWayland::setCursorVisibility(bool visible)
|
||||
GHOST_TSuccess GHOST_SystemWayland::setCursorGrab(const GHOST_TGrabCursorMode mode,
|
||||
wl_surface *surface)
|
||||
{
|
||||
/* ignore, if the required protocols are not supported */
|
||||
if (!d->relative_pointer_manager || !d->pointer_constraints) {
|
||||
return GHOST_kFailure;
|
||||
}
|
||||
|
||||
if (d->inputs.empty()) {
|
||||
return GHOST_kFailure;
|
||||
}
|
||||
@@ -1754,6 +1884,7 @@ GHOST_TSuccess GHOST_SystemWayland::setCursorGrab(const GHOST_TGrabCursorMode mo
|
||||
break;
|
||||
|
||||
case GHOST_kGrabNormal:
|
||||
break;
|
||||
case GHOST_kGrabWrap:
|
||||
input->relative_pointer = zwp_relative_pointer_manager_v1_get_relative_pointer(
|
||||
d->relative_pointer_manager, input->pointer);
|
||||
|
@@ -26,6 +26,7 @@
|
||||
#include "GHOST_WindowWayland.h"
|
||||
|
||||
#include <wayland-client.h>
|
||||
#include <xdg-decoration-client-protocol.h>
|
||||
#include <xdg-shell-client-protocol.h>
|
||||
|
||||
#include <string>
|
||||
@@ -34,6 +35,16 @@ class GHOST_WindowWayland;
|
||||
|
||||
struct display_t;
|
||||
|
||||
struct output_t {
|
||||
struct wl_output *output;
|
||||
int32_t width_pxl, height_pxl; // dimensions in pixel
|
||||
int32_t width_mm, height_mm; // dimensions in millimeter
|
||||
int transform;
|
||||
int scale;
|
||||
std::string make;
|
||||
std::string model;
|
||||
};
|
||||
|
||||
class GHOST_SystemWayland : public GHOST_System {
|
||||
public:
|
||||
GHOST_SystemWayland();
|
||||
@@ -84,6 +95,12 @@ class GHOST_SystemWayland : public GHOST_System {
|
||||
|
||||
xdg_wm_base *shell();
|
||||
|
||||
zxdg_decoration_manager_v1 *decoration_manager();
|
||||
|
||||
const std::vector<output_t *> &outputs() const;
|
||||
|
||||
wl_shm *shm() const;
|
||||
|
||||
void setSelection(const std::string &selection);
|
||||
|
||||
GHOST_TSuccess setCursorShape(GHOST_TStandardCursor shape);
|
||||
|
130
intern/ghost/intern/GHOST_WaylandCursorSettings.h
Normal file
130
intern/ghost/intern/GHOST_WaylandCursorSettings.h
Normal file
@@ -0,0 +1,130 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/** \file
|
||||
* \ingroup GHOST
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include <dbus/dbus.h>
|
||||
#include <string>
|
||||
|
||||
static DBusMessage *get_setting_sync(DBusConnection *const connection,
|
||||
const char *key,
|
||||
const char *value)
|
||||
{
|
||||
DBusError error;
|
||||
dbus_bool_t success;
|
||||
DBusMessage *message;
|
||||
DBusMessage *reply;
|
||||
|
||||
dbus_error_init(&error);
|
||||
|
||||
message = dbus_message_new_method_call("org.freedesktop.portal.Desktop",
|
||||
"/org/freedesktop/portal/desktop",
|
||||
"org.freedesktop.portal.Settings",
|
||||
"Read");
|
||||
|
||||
success = dbus_message_append_args(
|
||||
message, DBUS_TYPE_STRING, &key, DBUS_TYPE_STRING, &value, DBUS_TYPE_INVALID);
|
||||
|
||||
if (!success) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
reply = dbus_connection_send_with_reply_and_block(
|
||||
connection, message, DBUS_TIMEOUT_USE_DEFAULT, &error);
|
||||
|
||||
dbus_message_unref(message);
|
||||
|
||||
if (dbus_error_is_set(&error)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return reply;
|
||||
}
|
||||
|
||||
static bool parse_type(DBusMessage *const reply, const int type, void *value)
|
||||
{
|
||||
DBusMessageIter iter[3];
|
||||
|
||||
dbus_message_iter_init(reply, &iter[0]);
|
||||
if (dbus_message_iter_get_arg_type(&iter[0]) != DBUS_TYPE_VARIANT) {
|
||||
return false;
|
||||
}
|
||||
|
||||
dbus_message_iter_recurse(&iter[0], &iter[1]);
|
||||
if (dbus_message_iter_get_arg_type(&iter[1]) != DBUS_TYPE_VARIANT) {
|
||||
return false;
|
||||
}
|
||||
|
||||
dbus_message_iter_recurse(&iter[1], &iter[2]);
|
||||
if (dbus_message_iter_get_arg_type(&iter[2]) != type) {
|
||||
return false;
|
||||
}
|
||||
|
||||
dbus_message_iter_get_basic(&iter[2], value);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool get_cursor_settings(std::string &theme, int &size)
|
||||
{
|
||||
static const char name[] = "org.gnome.desktop.interface";
|
||||
static const char key_theme[] = "cursor-theme";
|
||||
static const char key_size[] = "cursor-size";
|
||||
|
||||
DBusError error;
|
||||
DBusConnection *connection;
|
||||
DBusMessage *reply;
|
||||
const char *value_theme = NULL;
|
||||
|
||||
dbus_error_init(&error);
|
||||
|
||||
connection = dbus_bus_get(DBUS_BUS_SESSION, &error);
|
||||
|
||||
if (dbus_error_is_set(&error)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
reply = get_setting_sync(connection, name, key_theme);
|
||||
if (!reply) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!parse_type(reply, DBUS_TYPE_STRING, &value_theme)) {
|
||||
dbus_message_unref(reply);
|
||||
return false;
|
||||
}
|
||||
|
||||
theme = std::string(value_theme);
|
||||
|
||||
dbus_message_unref(reply);
|
||||
|
||||
reply = get_setting_sync(connection, name, key_size);
|
||||
if (!reply) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!parse_type(reply, DBUS_TYPE_INT32, &size)) {
|
||||
dbus_message_unref(reply);
|
||||
return false;
|
||||
}
|
||||
|
||||
dbus_message_unref(reply);
|
||||
|
||||
return true;
|
||||
}
|
@@ -29,11 +29,19 @@
|
||||
|
||||
#include <wayland-egl.h>
|
||||
|
||||
static constexpr size_t base_dpi = 96;
|
||||
|
||||
struct window_t {
|
||||
GHOST_WindowWayland *w;
|
||||
wl_surface *surface;
|
||||
// outputs on which the window is currently shown on
|
||||
std::unordered_set<const output_t *> outputs;
|
||||
GHOST_TUns16 dpi = 0;
|
||||
int scale = 1;
|
||||
struct xdg_surface *xdg_surface;
|
||||
struct xdg_toplevel *xdg_toplevel;
|
||||
struct zxdg_toplevel_decoration_v1 *xdg_toplevel_decoration = nullptr;
|
||||
enum zxdg_toplevel_decoration_v1_mode decoration_mode;
|
||||
wl_egl_window *egl_window;
|
||||
int32_t pending_width, pending_height;
|
||||
bool is_maximised;
|
||||
@@ -93,17 +101,30 @@ static const xdg_toplevel_listener toplevel_listener = {
|
||||
toplevel_close,
|
||||
};
|
||||
|
||||
static void toplevel_decoration_configure(
|
||||
void *data,
|
||||
struct zxdg_toplevel_decoration_v1 * /*zxdg_toplevel_decoration_v1*/,
|
||||
uint32_t mode)
|
||||
{
|
||||
static_cast<window_t *>(data)->decoration_mode = zxdg_toplevel_decoration_v1_mode(mode);
|
||||
}
|
||||
|
||||
static const zxdg_toplevel_decoration_v1_listener toplevel_decoration_v1_listener = {
|
||||
toplevel_decoration_configure,
|
||||
};
|
||||
|
||||
static void surface_configure(void *data, xdg_surface *xdg_surface, uint32_t serial)
|
||||
{
|
||||
window_t *win = static_cast<window_t *>(data);
|
||||
|
||||
int w, h;
|
||||
wl_egl_window_get_attached_size(win->egl_window, &w, &h);
|
||||
if (win->pending_width != 0 && win->pending_height != 0 && win->pending_width != w &&
|
||||
win->pending_height != h) {
|
||||
win->width = win->pending_width;
|
||||
win->height = win->pending_height;
|
||||
wl_egl_window_resize(win->egl_window, win->pending_width, win->pending_height, 0, 0);
|
||||
if (win->xdg_surface != xdg_surface) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (win->pending_width != 0 && win->pending_height != 0) {
|
||||
win->width = win->scale * win->pending_width;
|
||||
win->height = win->scale * win->pending_height;
|
||||
wl_egl_window_resize(win->egl_window, win->width, win->height, 0, 0);
|
||||
win->pending_width = 0;
|
||||
win->pending_height = 0;
|
||||
win->w->notify_size();
|
||||
@@ -123,6 +144,52 @@ static const xdg_surface_listener surface_listener = {
|
||||
surface_configure,
|
||||
};
|
||||
|
||||
static bool update_scale(GHOST_WindowWayland *window)
|
||||
{
|
||||
int scale = 0;
|
||||
for (const output_t *output : window->outputs_active()) {
|
||||
if (output->scale > scale)
|
||||
scale = output->scale;
|
||||
}
|
||||
|
||||
if (scale > 0 && window->scale() != scale) {
|
||||
window->scale() = scale;
|
||||
// using the real DPI will cause wrong scaling of the UI
|
||||
// use a multiplier for the default DPI as workaround
|
||||
window->dpi() = scale * base_dpi;
|
||||
wl_surface_set_buffer_scale(window->surface(), scale);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static void surface_enter(void *data, struct wl_surface * /*wl_surface*/, struct wl_output *output)
|
||||
{
|
||||
GHOST_WindowWayland *w = static_cast<GHOST_WindowWayland *>(data);
|
||||
for (const output_t *reg_output : w->outputs()) {
|
||||
if (reg_output->output == output) {
|
||||
w->outputs_active().insert(reg_output);
|
||||
}
|
||||
}
|
||||
update_scale(w);
|
||||
}
|
||||
|
||||
static void surface_leave(void *data, struct wl_surface * /*wl_surface*/, struct wl_output *output)
|
||||
{
|
||||
GHOST_WindowWayland *w = static_cast<GHOST_WindowWayland *>(data);
|
||||
for (const output_t *reg_output : w->outputs()) {
|
||||
if (reg_output->output == output) {
|
||||
w->outputs_active().erase(reg_output);
|
||||
}
|
||||
}
|
||||
update_scale(w);
|
||||
}
|
||||
|
||||
struct wl_surface_listener wl_surface_listener = {
|
||||
surface_enter,
|
||||
surface_leave,
|
||||
};
|
||||
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
@@ -161,17 +228,28 @@ GHOST_WindowWayland::GHOST_WindowWayland(GHOST_SystemWayland *system,
|
||||
|
||||
/* Window surfaces. */
|
||||
w->surface = wl_compositor_create_surface(m_system->compositor());
|
||||
wl_surface_add_listener(w->surface, &wl_surface_listener, this);
|
||||
|
||||
w->egl_window = wl_egl_window_create(w->surface, int(width), int(height));
|
||||
|
||||
w->xdg_surface = xdg_wm_base_get_xdg_surface(m_system->shell(), w->surface);
|
||||
w->xdg_toplevel = xdg_surface_get_toplevel(w->xdg_surface);
|
||||
|
||||
if (m_system->decoration_manager()) {
|
||||
w->xdg_toplevel_decoration = zxdg_decoration_manager_v1_get_toplevel_decoration(
|
||||
m_system->decoration_manager(), w->xdg_toplevel);
|
||||
zxdg_toplevel_decoration_v1_add_listener(
|
||||
w->xdg_toplevel_decoration, &toplevel_decoration_v1_listener, w);
|
||||
zxdg_toplevel_decoration_v1_set_mode(w->xdg_toplevel_decoration,
|
||||
ZXDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE);
|
||||
}
|
||||
|
||||
wl_surface_set_user_data(w->surface, this);
|
||||
|
||||
xdg_surface_add_listener(w->xdg_surface, &surface_listener, w);
|
||||
xdg_toplevel_add_listener(w->xdg_toplevel, &toplevel_listener, w);
|
||||
|
||||
if (parentWindow) {
|
||||
if (parentWindow && is_dialog) {
|
||||
xdg_toplevel_set_parent(
|
||||
w->xdg_toplevel, dynamic_cast<const GHOST_WindowWayland *>(parentWindow)->w->xdg_toplevel);
|
||||
}
|
||||
@@ -192,6 +270,9 @@ GHOST_WindowWayland::GHOST_WindowWayland(GHOST_SystemWayland *system,
|
||||
if (setDrawingContextType(type) == GHOST_kFailure) {
|
||||
GHOST_PRINT("Failed to create EGL context" << std::endl);
|
||||
}
|
||||
|
||||
/* set swap interval to 0 to prevent blocking */
|
||||
setSwapInterval(0);
|
||||
}
|
||||
|
||||
GHOST_TSuccess GHOST_WindowWayland::close()
|
||||
@@ -226,6 +307,31 @@ GHOST_TSuccess GHOST_WindowWayland::notify_size()
|
||||
new GHOST_Event(m_system->getMilliSeconds(), GHOST_kEventWindowSize, this));
|
||||
}
|
||||
|
||||
wl_surface *GHOST_WindowWayland::surface() const
|
||||
{
|
||||
return w->surface;
|
||||
}
|
||||
|
||||
const std::vector<output_t *> &GHOST_WindowWayland::outputs() const
|
||||
{
|
||||
return m_system->outputs();
|
||||
}
|
||||
|
||||
std::unordered_set<const output_t *> &GHOST_WindowWayland::outputs_active()
|
||||
{
|
||||
return w->outputs;
|
||||
}
|
||||
|
||||
uint16_t &GHOST_WindowWayland::dpi()
|
||||
{
|
||||
return w->dpi;
|
||||
}
|
||||
|
||||
int &GHOST_WindowWayland::scale()
|
||||
{
|
||||
return w->scale;
|
||||
}
|
||||
|
||||
GHOST_TSuccess GHOST_WindowWayland::setWindowCursorGrab(GHOST_TGrabCursorMode mode)
|
||||
{
|
||||
return m_system->setCursorGrab(mode, w->surface);
|
||||
@@ -310,6 +416,9 @@ GHOST_WindowWayland::~GHOST_WindowWayland()
|
||||
releaseNativeHandles();
|
||||
|
||||
wl_egl_window_destroy(w->egl_window);
|
||||
if (w->xdg_toplevel_decoration) {
|
||||
zxdg_toplevel_decoration_v1_destroy(w->xdg_toplevel_decoration);
|
||||
}
|
||||
xdg_toplevel_destroy(w->xdg_toplevel);
|
||||
xdg_surface_destroy(w->xdg_surface);
|
||||
wl_surface_destroy(w->surface);
|
||||
@@ -317,6 +426,11 @@ GHOST_WindowWayland::~GHOST_WindowWayland()
|
||||
delete w;
|
||||
}
|
||||
|
||||
GHOST_TUns16 GHOST_WindowWayland::getDPIHint()
|
||||
{
|
||||
return w->dpi;
|
||||
}
|
||||
|
||||
GHOST_TSuccess GHOST_WindowWayland::setWindowCursorVisibility(bool visible)
|
||||
{
|
||||
return m_system->setCursorVisibility(visible);
|
||||
|
@@ -24,9 +24,14 @@
|
||||
|
||||
#include "GHOST_Window.h"
|
||||
|
||||
#include <unordered_set>
|
||||
#include <vector>
|
||||
|
||||
class GHOST_SystemWayland;
|
||||
|
||||
struct window_t;
|
||||
struct wl_surface;
|
||||
struct output_t;
|
||||
|
||||
class GHOST_WindowWayland : public GHOST_Window {
|
||||
public:
|
||||
@@ -47,6 +52,8 @@ class GHOST_WindowWayland : public GHOST_Window {
|
||||
|
||||
~GHOST_WindowWayland() override;
|
||||
|
||||
GHOST_TUns16 getDPIHint() override;
|
||||
|
||||
GHOST_TSuccess close();
|
||||
|
||||
GHOST_TSuccess activate();
|
||||
@@ -55,6 +62,16 @@ class GHOST_WindowWayland : public GHOST_Window {
|
||||
|
||||
GHOST_TSuccess notify_size();
|
||||
|
||||
wl_surface *surface() const;
|
||||
|
||||
const std::vector<output_t *> &outputs() const;
|
||||
|
||||
std::unordered_set<const output_t *> &outputs_active();
|
||||
|
||||
uint16_t &dpi();
|
||||
|
||||
int &scale();
|
||||
|
||||
protected:
|
||||
GHOST_TSuccess setWindowCursorGrab(GHOST_TGrabCursorMode mode) override;
|
||||
|
||||
|
Submodule release/datafiles/locale updated: 5ab29b1331...2cef4877ed
@@ -198,6 +198,7 @@ def _clean_utf8(name):
|
||||
_display_name_literals = {
|
||||
":": "_colon_",
|
||||
"+": "_plus_",
|
||||
"/": "_slash_",
|
||||
}
|
||||
|
||||
|
||||
|
@@ -560,9 +560,17 @@ class Text(bpy_types.ID):
|
||||
self.write(string)
|
||||
|
||||
def as_module(self):
|
||||
from os.path import splitext
|
||||
import bpy
|
||||
from os.path import splitext, join
|
||||
from types import ModuleType
|
||||
mod = ModuleType(splitext(self.name)[0])
|
||||
name = self.name
|
||||
mod = ModuleType(splitext(name)[0])
|
||||
# This is a fake file-path, set this since some scripts check `__file__`,
|
||||
# error messages may include this as well.
|
||||
# NOTE: the file path may be a blank string if the file hasn't been saved.
|
||||
mod.__dict__.update({
|
||||
"__file__": join(bpy.data.filepath, name),
|
||||
})
|
||||
# TODO: We could use Text.compiled (C struct member)
|
||||
# if this is called often it will be much faster.
|
||||
exec(self.as_string(), mod.__dict__)
|
||||
|
@@ -1,4 +0,0 @@
|
||||
import bpy
|
||||
bpy.context.camera.sensor_width = 6.16
|
||||
bpy.context.camera.sensor_height = 4.62
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
4
release/scripts/presets/camera/1_inch.py
Normal file
4
release/scripts/presets/camera/1_inch.py
Normal file
@@ -0,0 +1,4 @@
|
||||
import bpy
|
||||
bpy.context.camera.sensor_width = 13.2
|
||||
bpy.context.camera.sensor_height = 8.80
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
4
release/scripts/presets/camera/1_slash_1.8_inch.py
Normal file
4
release/scripts/presets/camera/1_slash_1.8_inch.py
Normal file
@@ -0,0 +1,4 @@
|
||||
import bpy
|
||||
bpy.context.camera.sensor_width = 7.18
|
||||
bpy.context.camera.sensor_height = 5.32
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
4
release/scripts/presets/camera/1_slash_2.3_inch.py
Normal file
4
release/scripts/presets/camera/1_slash_2.3_inch.py
Normal file
@@ -0,0 +1,4 @@
|
||||
import bpy
|
||||
bpy.context.camera.sensor_width = 6.17
|
||||
bpy.context.camera.sensor_height = 4.55
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
4
release/scripts/presets/camera/1_slash_2.7_inch.py
Normal file
4
release/scripts/presets/camera/1_slash_2.7_inch.py
Normal file
@@ -0,0 +1,4 @@
|
||||
import bpy
|
||||
bpy.context.camera.sensor_width = 5.37
|
||||
bpy.context.camera.sensor_height = 4.04
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
@@ -1,5 +1,4 @@
|
||||
import bpy
|
||||
bpy.context.camera.sensor_width = 4.54
|
||||
bpy.context.camera.sensor_height = 3.42
|
||||
bpy.context.camera.lens = 3.85
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
@@ -1,4 +0,0 @@
|
||||
import bpy
|
||||
bpy.context.camera.sensor_width = 9.6
|
||||
bpy.context.camera.sensor_height = 5.4
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
4
release/scripts/presets/camera/2_slash_3_inch.py
Normal file
4
release/scripts/presets/camera/2_slash_3_inch.py
Normal file
@@ -0,0 +1,4 @@
|
||||
import bpy
|
||||
bpy.context.camera.sensor_width = 8.8
|
||||
bpy.context.camera.sensor_height = 6.6
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
@@ -1,4 +0,0 @@
|
||||
import bpy
|
||||
bpy.context.camera.sensor_width = 17.31
|
||||
bpy.context.camera.sensor_height = 12.98
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
4
release/scripts/presets/camera/APS-C.py
Normal file
4
release/scripts/presets/camera/APS-C.py
Normal file
@@ -0,0 +1,4 @@
|
||||
import bpy
|
||||
bpy.context.camera.sensor_width = 23.6
|
||||
bpy.context.camera.sensor_height = 15.6
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
4
release/scripts/presets/camera/APS-C_(Canon).py
Normal file
4
release/scripts/presets/camera/APS-C_(Canon).py
Normal file
@@ -0,0 +1,4 @@
|
||||
import bpy
|
||||
bpy.context.camera.sensor_width = 22.30
|
||||
bpy.context.camera.sensor_height = 14.90
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
4
release/scripts/presets/camera/Analog_16mm.py
Normal file
4
release/scripts/presets/camera/Analog_16mm.py
Normal file
@@ -0,0 +1,4 @@
|
||||
import bpy
|
||||
bpy.context.camera.sensor_width = 10.26
|
||||
bpy.context.camera.sensor_height = 7.49
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
4
release/scripts/presets/camera/Analog_35mm.py
Normal file
4
release/scripts/presets/camera/Analog_35mm.py
Normal file
@@ -0,0 +1,4 @@
|
||||
import bpy
|
||||
bpy.context.camera.sensor_width = 22
|
||||
bpy.context.camera.sensor_height = 16
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
4
release/scripts/presets/camera/Analog_65mm.py
Normal file
4
release/scripts/presets/camera/Analog_65mm.py
Normal file
@@ -0,0 +1,4 @@
|
||||
import bpy
|
||||
bpy.context.camera.sensor_width = 52.45
|
||||
bpy.context.camera.sensor_height = 23.01
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
4
release/scripts/presets/camera/Analog_IMAX.py
Normal file
4
release/scripts/presets/camera/Analog_IMAX.py
Normal file
@@ -0,0 +1,4 @@
|
||||
import bpy
|
||||
bpy.context.camera.sensor_width = 71.41
|
||||
bpy.context.camera.sensor_height = 52.63
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
4
release/scripts/presets/camera/Analog_Super_16.py
Normal file
4
release/scripts/presets/camera/Analog_Super_16.py
Normal file
@@ -0,0 +1,4 @@
|
||||
import bpy
|
||||
bpy.context.camera.sensor_width = 12.35
|
||||
bpy.context.camera.sensor_height = 7.42
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
@@ -1,4 +0,0 @@
|
||||
import bpy
|
||||
bpy.context.camera.sensor_width = 23.760
|
||||
bpy.context.camera.sensor_height = 13.365
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
4
release/scripts/presets/camera/Arri_Alexa_65.py
Normal file
4
release/scripts/presets/camera/Arri_Alexa_65.py
Normal file
@@ -0,0 +1,4 @@
|
||||
import bpy
|
||||
bpy.context.camera.sensor_width = 54.12
|
||||
bpy.context.camera.sensor_height = 25.58
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
4
release/scripts/presets/camera/Arri_Alexa_LF.py
Normal file
4
release/scripts/presets/camera/Arri_Alexa_LF.py
Normal file
@@ -0,0 +1,4 @@
|
||||
import bpy
|
||||
bpy.context.camera.sensor_width = 36.70
|
||||
bpy.context.camera.sensor_height = 25.54
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
4
release/scripts/presets/camera/Arri_Alexa_Mini_&_SXT.py
Normal file
4
release/scripts/presets/camera/Arri_Alexa_Mini_&_SXT.py
Normal file
@@ -0,0 +1,4 @@
|
||||
import bpy
|
||||
bpy.context.camera.sensor_width = 29.90
|
||||
bpy.context.camera.sensor_height = 15.77
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
@@ -1,4 +0,0 @@
|
||||
import bpy
|
||||
bpy.context.camera.sensor_width = 15.81
|
||||
bpy.context.camera.sensor_height = 8.88
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
4
release/scripts/presets/camera/Blackmagic_Pocket_4K.py
Normal file
4
release/scripts/presets/camera/Blackmagic_Pocket_4K.py
Normal file
@@ -0,0 +1,4 @@
|
||||
import bpy
|
||||
bpy.context.camera.sensor_width = 18.96
|
||||
bpy.context.camera.sensor_height = 10.00
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
4
release/scripts/presets/camera/Blackmagic_Pocket_6k.py
Normal file
4
release/scripts/presets/camera/Blackmagic_Pocket_6k.py
Normal file
@@ -0,0 +1,4 @@
|
||||
import bpy
|
||||
bpy.context.camera.sensor_width = 23.10
|
||||
bpy.context.camera.sensor_height = 12.99
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
@@ -1,4 +0,0 @@
|
||||
import bpy
|
||||
bpy.context.camera.sensor_width = 21.12
|
||||
bpy.context.camera.sensor_height = 11.88
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
4
release/scripts/presets/camera/Blackmagic_URSA_4.6K.py
Normal file
4
release/scripts/presets/camera/Blackmagic_URSA_4.6K.py
Normal file
@@ -0,0 +1,4 @@
|
||||
import bpy
|
||||
bpy.context.camera.sensor_width = 25.34
|
||||
bpy.context.camera.sensor_height = 14.25
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
@@ -1,4 +0,0 @@
|
||||
import bpy
|
||||
bpy.context.camera.sensor_width = 32
|
||||
bpy.context.camera.sensor_height = 18
|
||||
bpy.context.camera.sensor_fit = 'AUTO'
|
@@ -1,4 +0,0 @@
|
||||
import bpy
|
||||
bpy.context.camera.sensor_width = 22.2
|
||||
bpy.context.camera.sensor_height = 14.7
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
@@ -1,4 +0,0 @@
|
||||
import bpy
|
||||
bpy.context.camera.sensor_width = 22.3
|
||||
bpy.context.camera.sensor_height = 14.9
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
@@ -1,4 +0,0 @@
|
||||
import bpy
|
||||
bpy.context.camera.sensor_width = 24.4
|
||||
bpy.context.camera.sensor_height = 13.5
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
4
release/scripts/presets/camera/Foveon_(Sigma).py
Normal file
4
release/scripts/presets/camera/Foveon_(Sigma).py
Normal file
@@ -0,0 +1,4 @@
|
||||
import bpy
|
||||
bpy.context.camera.sensor_width = 20.70
|
||||
bpy.context.camera.sensor_height = 13.80
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
@@ -1,6 +0,0 @@
|
||||
import bpy
|
||||
bpy.context.camera.sensor_width = 6.16
|
||||
bpy.context.camera.sensor_height = 4.62
|
||||
bpy.context.camera.lens = 2.77
|
||||
|
||||
bpy.context.camera.sensor_fit = 'AUTO'
|
@@ -1,6 +0,0 @@
|
||||
import bpy
|
||||
bpy.context.camera.sensor_width = 5.371
|
||||
bpy.context.camera.sensor_height = 4.035
|
||||
bpy.context.camera.lens = 2.77
|
||||
|
||||
bpy.context.camera.sensor_fit = 'AUTO'
|
4
release/scripts/presets/camera/MFT.py
Normal file
4
release/scripts/presets/camera/MFT.py
Normal file
@@ -0,0 +1,4 @@
|
||||
import bpy
|
||||
bpy.context.camera.sensor_width = 17.3
|
||||
bpy.context.camera.sensor_height = 13.0
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
@@ -0,0 +1,4 @@
|
||||
import bpy
|
||||
bpy.context.camera.sensor_width = 44
|
||||
bpy.context.camera.sensor_height = 33
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
@@ -1,5 +0,0 @@
|
||||
import bpy
|
||||
bpy.context.camera.sensor_width = 4.5
|
||||
bpy.context.camera.sensor_height = 3.37
|
||||
bpy.context.camera.lens = 3.91
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
@@ -1,4 +0,0 @@
|
||||
import bpy
|
||||
bpy.context.camera.sensor_width = 23.1
|
||||
bpy.context.camera.sensor_height = 15.4
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
@@ -1,4 +0,0 @@
|
||||
import bpy
|
||||
bpy.context.camera.sensor_width = 23.6
|
||||
bpy.context.camera.sensor_height = 15.8
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
@@ -1,4 +0,0 @@
|
||||
import bpy
|
||||
bpy.context.camera.sensor_width = 4.68
|
||||
bpy.context.camera.sensor_height = 2.633
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
@@ -1,4 +0,0 @@
|
||||
import bpy
|
||||
bpy.context.camera.sensor_width = 8.5
|
||||
bpy.context.camera.sensor_height = 4.78
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
4
release/scripts/presets/camera/RED_Dragon_5K.py
Normal file
4
release/scripts/presets/camera/RED_Dragon_5K.py
Normal file
@@ -0,0 +1,4 @@
|
||||
import bpy
|
||||
bpy.context.camera.sensor_width = 25.60
|
||||
bpy.context.camera.sensor_height = 13.5
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
4
release/scripts/presets/camera/RED_Dragon_6K.py
Normal file
4
release/scripts/presets/camera/RED_Dragon_6K.py
Normal file
@@ -0,0 +1,4 @@
|
||||
import bpy
|
||||
bpy.context.camera.sensor_width = 30.70
|
||||
bpy.context.camera.sensor_height = 15.80
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
4
release/scripts/presets/camera/RED_Helium_8K.py
Normal file
4
release/scripts/presets/camera/RED_Helium_8K.py
Normal file
@@ -0,0 +1,4 @@
|
||||
import bpy
|
||||
bpy.context.camera.sensor_width = 29.90
|
||||
bpy.context.camera.sensor_height = 15.77
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
4
release/scripts/presets/camera/RED_Monstro_8K.py
Normal file
4
release/scripts/presets/camera/RED_Monstro_8K.py
Normal file
@@ -0,0 +1,4 @@
|
||||
import bpy
|
||||
bpy.context.camera.sensor_width = 40.96
|
||||
bpy.context.camera.sensor_height = 21.60
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
@@ -1,4 +0,0 @@
|
||||
import bpy
|
||||
bpy.context.camera.sensor_width = 30.0
|
||||
bpy.context.camera.sensor_height = 15.0
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
@@ -1,4 +0,0 @@
|
||||
import bpy
|
||||
bpy.context.camera.sensor_width = 11.1
|
||||
bpy.context.camera.sensor_height = 6.24
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
@@ -1,4 +0,0 @@
|
||||
import bpy
|
||||
bpy.context.camera.sensor_width = 16.65
|
||||
bpy.context.camera.sensor_height = 9.36
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
@@ -1,4 +0,0 @@
|
||||
import bpy
|
||||
bpy.context.camera.sensor_width = 22.2
|
||||
bpy.context.camera.sensor_height = 12.6
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
@@ -1,5 +0,0 @@
|
||||
import bpy
|
||||
bpy.context.camera.sensor_width = 4.8
|
||||
bpy.context.camera.sensor_height = 3.6
|
||||
bpy.context.camera.lens = 3.70
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
@@ -1,5 +0,0 @@
|
||||
import bpy
|
||||
bpy.context.camera.sensor_width = 4.8
|
||||
bpy.context.camera.sensor_height = 3.6
|
||||
bpy.context.camera.lens = 4.20
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
@@ -1,4 +0,0 @@
|
||||
import bpy
|
||||
bpy.context.camera.sensor_width = 23.4
|
||||
bpy.context.camera.sensor_height = 15.6
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
@@ -1,4 +0,0 @@
|
||||
import bpy
|
||||
bpy.context.camera.sensor_width = 6.97
|
||||
bpy.context.camera.sensor_height = 3.92
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
@@ -1,4 +0,0 @@
|
||||
import bpy
|
||||
bpy.context.camera.sensor_width = 24.33
|
||||
bpy.context.camera.sensor_height = 12.83
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
@@ -1,4 +0,0 @@
|
||||
import bpy
|
||||
bpy.context.camera.sensor_width = 12.52
|
||||
bpy.context.camera.sensor_height = 7.41
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
@@ -1,5 +0,0 @@
|
||||
import bpy
|
||||
bpy.context.camera.sensor_width = 4.54
|
||||
bpy.context.camera.sensor_height = 3.42
|
||||
bpy.context.camera.lens = 4.10
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
@@ -1079,6 +1079,7 @@ def km_view3d(params):
|
||||
("view3d.view_all", {"type": 'C', "value": 'PRESS', "shift": True},
|
||||
{"properties": [("center", True)]}),
|
||||
op_menu_pie("VIEW3D_MT_view_pie", {"type": 'D', "value": 'CLICK_DRAG'}),
|
||||
("view3d.navigate", {"type": 'ACCENT_GRAVE', "value": 'PRESS', "shift": True}, None),
|
||||
# Numpad views.
|
||||
("view3d.view_camera", {"type": 'NUMPAD_0', "value": 'PRESS'}, None),
|
||||
("view3d.view_axis", {"type": 'NUMPAD_1', "value": 'PRESS'},
|
||||
@@ -2543,6 +2544,7 @@ def km_sequencercommon(params):
|
||||
{"properties": [("data_path", 'scene.sequence_editor.show_overlay')]}),
|
||||
("wm.context_toggle_enum", {"type": 'TAB', "value": 'PRESS', "ctrl": True},
|
||||
{"properties": [("data_path", 'space_data.view_type'), ("value_1", 'SEQUENCER'), ("value_2", 'PREVIEW')]}),
|
||||
("sequencer.refresh_all", {"type": 'R', "value": 'PRESS', "ctrl": True}, None),
|
||||
])
|
||||
|
||||
if params.select_mouse == 'LEFTMOUSE' and not params.legacy:
|
||||
@@ -2583,7 +2585,6 @@ def km_sequencer(params):
|
||||
("sequencer.reload", {"type": 'R', "value": 'PRESS', "alt": True}, None),
|
||||
("sequencer.reload", {"type": 'R', "value": 'PRESS', "shift": True, "alt": True},
|
||||
{"properties": [("adjust_length", True)]}),
|
||||
("sequencer.refresh_all", {"type": 'R', "value": 'PRESS', "ctrl": True}, None),
|
||||
("sequencer.offset_clear", {"type": 'O', "value": 'PRESS', "alt": True}, None),
|
||||
("sequencer.duplicate_move", {"type": 'D', "value": 'PRESS', "shift": True}, None),
|
||||
("sequencer.delete", {"type": 'X', "value": 'PRESS'}, None),
|
||||
|
@@ -1,9 +0,0 @@
|
||||
import bpy
|
||||
camera = bpy.context.edit_movieclip.tracking.camera
|
||||
|
||||
camera.sensor_width = 6.16
|
||||
camera.units = 'MILLIMETERS'
|
||||
camera.pixel_aspect = 1
|
||||
camera.k1 = 0.0
|
||||
camera.k2 = 0.0
|
||||
camera.k3 = 0.0
|
@@ -1,9 +0,0 @@
|
||||
import bpy
|
||||
camera = bpy.context.edit_movieclip.tracking.camera
|
||||
|
||||
camera.sensor_width = 5.76
|
||||
camera.units = 'MILLIMETERS'
|
||||
camera.pixel_aspect = 1
|
||||
camera.k1 = 0.0
|
||||
camera.k2 = 0.0
|
||||
camera.k3 = 0.0
|
4
release/scripts/presets/tracking_camera/1_inch.py
Normal file
4
release/scripts/presets/tracking_camera/1_inch.py
Normal file
@@ -0,0 +1,4 @@
|
||||
import bpy
|
||||
bpy.context.camera.sensor_width = 13.2
|
||||
bpy.context.camera.sensor_height = 8.80
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
@@ -0,0 +1,4 @@
|
||||
import bpy
|
||||
bpy.context.camera.sensor_width = 7.18
|
||||
bpy.context.camera.sensor_height = 5.32
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
@@ -0,0 +1,4 @@
|
||||
import bpy
|
||||
bpy.context.camera.sensor_width = 6.17
|
||||
bpy.context.camera.sensor_height = 4.55
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
@@ -1,6 +1,4 @@
|
||||
import bpy
|
||||
bpy.context.camera.sensor_width = 5.76
|
||||
bpy.context.camera.sensor_height = 4.29
|
||||
bpy.context.camera.lens = 2.77
|
||||
|
||||
bpy.context.camera.sensor_fit = 'AUTO'
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
@@ -0,0 +1,4 @@
|
||||
import bpy
|
||||
bpy.context.camera.sensor_width = 5.37
|
||||
bpy.context.camera.sensor_height = 4.04
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
@@ -1,5 +1,4 @@
|
||||
import bpy
|
||||
bpy.context.camera.sensor_width = 4.54
|
||||
bpy.context.camera.sensor_height = 3.42
|
||||
bpy.context.camera.lens = 4.28
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
@@ -1,9 +0,0 @@
|
||||
import bpy
|
||||
camera = bpy.context.edit_movieclip.tracking.camera
|
||||
|
||||
camera.sensor_width = 9.6
|
||||
camera.units = 'MILLIMETERS'
|
||||
camera.pixel_aspect = 1
|
||||
camera.k1 = 0.0
|
||||
camera.k2 = 0.0
|
||||
camera.k3 = 0.0
|
@@ -0,0 +1,4 @@
|
||||
import bpy
|
||||
bpy.context.camera.sensor_width = 8.8
|
||||
bpy.context.camera.sensor_height = 6.6
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
@@ -1,9 +0,0 @@
|
||||
import bpy
|
||||
camera = bpy.context.edit_movieclip.tracking.camera
|
||||
|
||||
camera.sensor_width = 17.31
|
||||
camera.units = 'MILLIMETERS'
|
||||
camera.pixel_aspect = 1
|
||||
camera.k1 = 0.0
|
||||
camera.k2 = 0.0
|
||||
camera.k3 = 0.0
|
4
release/scripts/presets/tracking_camera/APS-C.py
Normal file
4
release/scripts/presets/tracking_camera/APS-C.py
Normal file
@@ -0,0 +1,4 @@
|
||||
import bpy
|
||||
bpy.context.camera.sensor_width = 23.6
|
||||
bpy.context.camera.sensor_height = 15.6
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
4
release/scripts/presets/tracking_camera/APS-C_(Canon).py
Normal file
4
release/scripts/presets/tracking_camera/APS-C_(Canon).py
Normal file
@@ -0,0 +1,4 @@
|
||||
import bpy
|
||||
bpy.context.camera.sensor_width = 22.30
|
||||
bpy.context.camera.sensor_height = 14.90
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
4
release/scripts/presets/tracking_camera/APS-H_(Canon).py
Normal file
4
release/scripts/presets/tracking_camera/APS-H_(Canon).py
Normal file
@@ -0,0 +1,4 @@
|
||||
import bpy
|
||||
bpy.context.camera.sensor_width = 27.90
|
||||
bpy.context.camera.sensor_height = 18.60
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
4
release/scripts/presets/tracking_camera/Analog_16mm.py
Normal file
4
release/scripts/presets/tracking_camera/Analog_16mm.py
Normal file
@@ -0,0 +1,4 @@
|
||||
import bpy
|
||||
bpy.context.camera.sensor_width = 10.26
|
||||
bpy.context.camera.sensor_height = 7.49
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
4
release/scripts/presets/tracking_camera/Analog_35mm.py
Normal file
4
release/scripts/presets/tracking_camera/Analog_35mm.py
Normal file
@@ -0,0 +1,4 @@
|
||||
import bpy
|
||||
bpy.context.camera.sensor_width = 22
|
||||
bpy.context.camera.sensor_height = 16
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
4
release/scripts/presets/tracking_camera/Analog_65mm.py
Normal file
4
release/scripts/presets/tracking_camera/Analog_65mm.py
Normal file
@@ -0,0 +1,4 @@
|
||||
import bpy
|
||||
bpy.context.camera.sensor_width = 52.45
|
||||
bpy.context.camera.sensor_height = 23.01
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
4
release/scripts/presets/tracking_camera/Analog_IMAX.py
Normal file
4
release/scripts/presets/tracking_camera/Analog_IMAX.py
Normal file
@@ -0,0 +1,4 @@
|
||||
import bpy
|
||||
bpy.context.camera.sensor_width = 71.41
|
||||
bpy.context.camera.sensor_height = 52.63
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
@@ -0,0 +1,4 @@
|
||||
import bpy
|
||||
bpy.context.camera.sensor_width = 12.35
|
||||
bpy.context.camera.sensor_height = 7.42
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
@@ -0,0 +1,4 @@
|
||||
import bpy
|
||||
bpy.context.camera.sensor_width = 24.89
|
||||
bpy.context.camera.sensor_height = 18.66
|
||||
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user