Initial Grease Pencil 3.0 stage #106848
|
@ -24,23 +24,17 @@ SET(_embree_SEARCH_DIRS
|
||||||
FIND_PATH(EMBREE_INCLUDE_DIR
|
FIND_PATH(EMBREE_INCLUDE_DIR
|
||||||
NAMES
|
NAMES
|
||||||
embree4/rtcore.h
|
embree4/rtcore.h
|
||||||
|
embree3/rtcore.h
|
||||||
HINTS
|
HINTS
|
||||||
${_embree_SEARCH_DIRS}
|
${_embree_SEARCH_DIRS}
|
||||||
PATH_SUFFIXES
|
PATH_SUFFIXES
|
||||||
include
|
include
|
||||||
)
|
)
|
||||||
IF(EMBREE_INCLUDE_DIR)
|
|
||||||
|
IF(EXISTS ${EMBREE_INCLUDE_DIR}/embree4/rtcore_config.h)
|
||||||
SET(EMBREE_MAJOR_VERSION 4)
|
SET(EMBREE_MAJOR_VERSION 4)
|
||||||
ELSE()
|
ELSE()
|
||||||
SET(EMBREE_MAJOR_VERSION 3)
|
SET(EMBREE_MAJOR_VERSION 3)
|
||||||
FIND_PATH(EMBREE_INCLUDE_DIR
|
|
||||||
NAMES
|
|
||||||
embree3/rtcore.h
|
|
||||||
HINTS
|
|
||||||
${_embree_SEARCH_DIRS}
|
|
||||||
PATH_SUFFIXES
|
|
||||||
include
|
|
||||||
)
|
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
IF(EMBREE_INCLUDE_DIR)
|
IF(EMBREE_INCLUDE_DIR)
|
||||||
|
|
|
@ -127,7 +127,7 @@ typedef uint32_t cuuint32_t;
|
||||||
typedef uint64_t cuuint64_t;
|
typedef uint64_t cuuint64_t;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__x86_64) || defined(AMD64) || defined(_M_AMD64) || defined (__aarch64__)
|
#if defined(__x86_64) || defined(AMD64) || defined(_M_AMD64) || defined (__aarch64__) || defined(__ppc64__) || defined(__PPC64__)
|
||||||
typedef unsigned long long CUdeviceptr;
|
typedef unsigned long long CUdeviceptr;
|
||||||
#else
|
#else
|
||||||
typedef unsigned int CUdeviceptr;
|
typedef unsigned int CUdeviceptr;
|
||||||
|
|
|
@ -84,7 +84,7 @@ typedef uint32_t hipuint32_t;
|
||||||
typedef uint64_t hipuint64_t;
|
typedef uint64_t hipuint64_t;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__x86_64) || defined(AMD64) || defined(_M_AMD64) || defined (__aarch64__)
|
#if defined(__x86_64) || defined(AMD64) || defined(_M_AMD64) || defined (__aarch64__) || defined(__ppc64__) || defined(__PPC64__)
|
||||||
typedef unsigned long long hipDeviceptr_t;
|
typedef unsigned long long hipDeviceptr_t;
|
||||||
#else
|
#else
|
||||||
typedef unsigned int hipDeviceptr_t;
|
typedef unsigned int hipDeviceptr_t;
|
||||||
|
|
|
@ -403,7 +403,7 @@ class CyclesRenderSettings(bpy.types.PropertyGroup):
|
||||||
|
|
||||||
time_limit: FloatProperty(
|
time_limit: FloatProperty(
|
||||||
name="Time Limit",
|
name="Time Limit",
|
||||||
description="Limit the render time (excluding synchronization time)."
|
description="Limit the render time (excluding synchronization time). "
|
||||||
"Zero disables the limit",
|
"Zero disables the limit",
|
||||||
min=0.0,
|
min=0.0,
|
||||||
default=0.0,
|
default=0.0,
|
||||||
|
|
|
@ -370,9 +370,11 @@ bool LightTree::should_split(LightTreeEmitter *emitters,
|
||||||
int &split_dim)
|
int &split_dim)
|
||||||
{
|
{
|
||||||
const int num_emitters = end - start;
|
const int num_emitters = end - start;
|
||||||
if (num_emitters == 1) {
|
if (num_emitters < 2) {
|
||||||
/* Do not try to split if there is only one emitter. */
|
if (num_emitters) {
|
||||||
measure = (emitters + start)->measure;
|
/* Do not try to split if there is only one emitter. */
|
||||||
|
measure = (emitters + start)->measure;
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -155,6 +155,14 @@ typedef struct wmRegionMessageSubscribeParams {
|
||||||
struct ARegion *region;
|
struct ARegion *region;
|
||||||
} wmRegionMessageSubscribeParams;
|
} wmRegionMessageSubscribeParams;
|
||||||
|
|
||||||
|
typedef struct RegionPollParams {
|
||||||
|
const struct bScreen *screen;
|
||||||
|
const struct ScrArea *area;
|
||||||
|
const struct ARegion *region;
|
||||||
|
|
||||||
|
/* For now only WM context members here, could add the scene or even #bContext if needed. */
|
||||||
|
} RegionPollParams;
|
||||||
|
|
||||||
typedef struct ARegionType {
|
typedef struct ARegionType {
|
||||||
struct ARegionType *next, *prev;
|
struct ARegionType *next, *prev;
|
||||||
|
|
||||||
|
@ -164,6 +172,13 @@ typedef struct ARegionType {
|
||||||
void (*init)(struct wmWindowManager *wm, struct ARegion *region);
|
void (*init)(struct wmWindowManager *wm, struct ARegion *region);
|
||||||
/* exit is called when the region is hidden or removed */
|
/* exit is called when the region is hidden or removed */
|
||||||
void (*exit)(struct wmWindowManager *wm, struct ARegion *region);
|
void (*exit)(struct wmWindowManager *wm, struct ARegion *region);
|
||||||
|
/**
|
||||||
|
* Optional callback to decide whether the region should be treated as existing given the
|
||||||
|
* current context. When returning false, the region will be kept in storage, but is not
|
||||||
|
* available to the user in any way. Callbacks can assume that context has the owning area and
|
||||||
|
* space-data set.
|
||||||
|
*/
|
||||||
|
bool (*poll)(const RegionPollParams *params);
|
||||||
/* draw entirely, view changes should be handled here */
|
/* draw entirely, view changes should be handled here */
|
||||||
void (*draw)(const struct bContext *C, struct ARegion *region);
|
void (*draw)(const struct bContext *C, struct ARegion *region);
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1745,19 +1745,19 @@ void BKE_mesh_legacy_convert_uvs_to_generic(Mesh *mesh)
|
||||||
|
|
||||||
/* Store layer names since they will be removed, used to set the active status of new layers.
|
/* Store layer names since they will be removed, used to set the active status of new layers.
|
||||||
* Use intermediate #StringRef because the names can be null. */
|
* Use intermediate #StringRef because the names can be null. */
|
||||||
const std::string active_uv = StringRef(
|
|
||||||
CustomData_get_active_layer_name(&mesh->ldata, CD_MLOOPUV));
|
|
||||||
const std::string default_uv = StringRef(
|
|
||||||
CustomData_get_render_layer_name(&mesh->ldata, CD_MLOOPUV));
|
|
||||||
|
|
||||||
Vector<std::string> uv_layers_to_convert;
|
Array<std::string> uv_names(CustomData_number_of_layers(&mesh->ldata, CD_MLOOPUV));
|
||||||
for (const int uv_layer_i : IndexRange(CustomData_number_of_layers(&mesh->ldata, CD_MLOOPUV))) {
|
for (const int i : uv_names.index_range()) {
|
||||||
uv_layers_to_convert.append(CustomData_get_layer_name(&mesh->ldata, CD_MLOOPUV, uv_layer_i));
|
uv_names[i] = CustomData_get_layer_name(&mesh->ldata, CD_MLOOPUV, i);
|
||||||
}
|
}
|
||||||
|
const int active_name_i = uv_names.as_span().first_index_try(
|
||||||
|
StringRef(CustomData_get_active_layer_name(&mesh->ldata, CD_MLOOPUV)));
|
||||||
|
const int default_name_i = uv_names.as_span().first_index_try(
|
||||||
|
StringRef(CustomData_get_render_layer_name(&mesh->ldata, CD_MLOOPUV)));
|
||||||
|
|
||||||
for (const StringRefNull name : uv_layers_to_convert) {
|
for (const int i : uv_names.index_range()) {
|
||||||
const MLoopUV *mloopuv = static_cast<const MLoopUV *>(
|
const MLoopUV *mloopuv = static_cast<const MLoopUV *>(
|
||||||
CustomData_get_layer_named(&mesh->ldata, CD_MLOOPUV, name.c_str()));
|
CustomData_get_layer_named(&mesh->ldata, CD_MLOOPUV, uv_names[i].c_str()));
|
||||||
const uint32_t needed_boolean_attributes = threading::parallel_reduce(
|
const uint32_t needed_boolean_attributes = threading::parallel_reduce(
|
||||||
IndexRange(mesh->totloop),
|
IndexRange(mesh->totloop),
|
||||||
4096,
|
4096,
|
||||||
|
@ -1808,41 +1808,52 @@ void BKE_mesh_legacy_convert_uvs_to_generic(Mesh *mesh)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
CustomData_free_layer_named(&mesh->ldata, name.c_str(), mesh->totloop);
|
CustomData_free_layer_named(&mesh->ldata, uv_names[i].c_str(), mesh->totloop);
|
||||||
|
|
||||||
|
char new_name[MAX_CUSTOMDATA_LAYER_NAME];
|
||||||
|
BKE_id_attribute_calc_unique_name(&mesh->id, uv_names[i].c_str(), new_name);
|
||||||
|
uv_names[i] = new_name;
|
||||||
|
|
||||||
CustomData_add_layer_named_with_data(
|
CustomData_add_layer_named_with_data(
|
||||||
&mesh->ldata, CD_PROP_FLOAT2, coords, mesh->totloop, name.c_str());
|
&mesh->ldata, CD_PROP_FLOAT2, coords, mesh->totloop, new_name);
|
||||||
char buffer[MAX_CUSTOMDATA_LAYER_NAME];
|
char buffer[MAX_CUSTOMDATA_LAYER_NAME];
|
||||||
if (vert_selection) {
|
if (vert_selection) {
|
||||||
CustomData_add_layer_named_with_data(&mesh->ldata,
|
CustomData_add_layer_named_with_data(&mesh->ldata,
|
||||||
CD_PROP_BOOL,
|
CD_PROP_BOOL,
|
||||||
vert_selection,
|
vert_selection,
|
||||||
mesh->totloop,
|
mesh->totloop,
|
||||||
BKE_uv_map_vert_select_name_get(name.c_str(), buffer));
|
BKE_uv_map_vert_select_name_get(new_name, buffer));
|
||||||
}
|
}
|
||||||
if (edge_selection) {
|
if (edge_selection) {
|
||||||
CustomData_add_layer_named_with_data(&mesh->ldata,
|
CustomData_add_layer_named_with_data(&mesh->ldata,
|
||||||
CD_PROP_BOOL,
|
CD_PROP_BOOL,
|
||||||
edge_selection,
|
edge_selection,
|
||||||
mesh->totloop,
|
mesh->totloop,
|
||||||
BKE_uv_map_edge_select_name_get(name.c_str(), buffer));
|
BKE_uv_map_edge_select_name_get(new_name, buffer));
|
||||||
}
|
}
|
||||||
if (pin) {
|
if (pin) {
|
||||||
CustomData_add_layer_named_with_data(&mesh->ldata,
|
CustomData_add_layer_named_with_data(&mesh->ldata,
|
||||||
CD_PROP_BOOL,
|
CD_PROP_BOOL,
|
||||||
pin,
|
pin,
|
||||||
mesh->totloop,
|
mesh->totloop,
|
||||||
BKE_uv_map_pin_name_get(name.c_str(), buffer));
|
BKE_uv_map_pin_name_get(new_name, buffer));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CustomData_set_layer_active_index(
|
if (active_name_i != -1) {
|
||||||
&mesh->ldata,
|
CustomData_set_layer_active_index(
|
||||||
CD_PROP_FLOAT2,
|
&mesh->ldata,
|
||||||
CustomData_get_named_layer_index(&mesh->ldata, CD_PROP_FLOAT2, active_uv.c_str()));
|
CD_PROP_FLOAT2,
|
||||||
CustomData_set_layer_render_index(
|
CustomData_get_named_layer_index(
|
||||||
&mesh->ldata,
|
&mesh->ldata, CD_PROP_FLOAT2, uv_names[active_name_i].c_str()));
|
||||||
CD_PROP_FLOAT2,
|
}
|
||||||
CustomData_get_named_layer_index(&mesh->ldata, CD_PROP_FLOAT2, default_uv.c_str()));
|
if (default_name_i != -1) {
|
||||||
|
CustomData_set_layer_render_index(
|
||||||
|
&mesh->ldata,
|
||||||
|
CD_PROP_FLOAT2,
|
||||||
|
CustomData_get_named_layer_index(
|
||||||
|
&mesh->ldata, CD_PROP_FLOAT2, uv_names[default_name_i].c_str()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** \name Selection Attribute and Legacy Flag Conversion
|
/** \name Selection Attribute and Legacy Flag Conversion
|
||||||
|
|
|
@ -925,7 +925,7 @@ void ntreeBlendReadLib(BlendLibReader *reader, bNodeTree *ntree)
|
||||||
LISTBASE_FOREACH (bNode *, node, &ntree->nodes) {
|
LISTBASE_FOREACH (bNode *, node, &ntree->nodes) {
|
||||||
/* Don't update node groups here because they may depend on other node groups which are not
|
/* Don't update node groups here because they may depend on other node groups which are not
|
||||||
* fully versioned yet and don't have `typeinfo` pointers set. */
|
* fully versioned yet and don't have `typeinfo` pointers set. */
|
||||||
if (node->type != NODE_GROUP) {
|
if (!node->is_group()) {
|
||||||
node_verify_sockets(ntree, node, false);
|
node_verify_sockets(ntree, node, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1203,7 +1203,8 @@ static void direct_link_region(BlendDataReader *reader, ARegion *region, int spa
|
||||||
BLO_read_list(reader, ®ion->ui_lists);
|
BLO_read_list(reader, ®ion->ui_lists);
|
||||||
|
|
||||||
/* The area's search filter is runtime only, so we need to clear the active flag on read. */
|
/* The area's search filter is runtime only, so we need to clear the active flag on read. */
|
||||||
region->flag &= ~RGN_FLAG_SEARCH_FILTER_ACTIVE;
|
/* Clear runtime flags (e.g. search filter is runtime only). */
|
||||||
|
region->flag &= ~(RGN_FLAG_SEARCH_FILTER_ACTIVE | RGN_FLAG_POLL_FAILED);
|
||||||
|
|
||||||
LISTBASE_FOREACH (uiList *, ui_list, ®ion->ui_lists) {
|
LISTBASE_FOREACH (uiList *, ui_list, ®ion->ui_lists) {
|
||||||
ui_list->type = NULL;
|
ui_list->type = NULL;
|
||||||
|
|
|
@ -72,6 +72,8 @@
|
||||||
|
|
||||||
#include "readfile.h"
|
#include "readfile.h"
|
||||||
|
|
||||||
|
#include "versioning_common.h"
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
/* Make preferences read-only, use versioning_userdef.c. */
|
/* Make preferences read-only, use versioning_userdef.c. */
|
||||||
|
@ -100,16 +102,16 @@ static void area_add_header_region(ScrArea *area, ListBase *lb)
|
||||||
region->v2d.flag = (V2D_PIXELOFS_X | V2D_PIXELOFS_Y);
|
region->v2d.flag = (V2D_PIXELOFS_X | V2D_PIXELOFS_Y);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void sequencer_init_preview_region(ARegion *region)
|
void sequencer_init_preview_region(ARegion *region)
|
||||||
{
|
{
|
||||||
/* XXX a bit ugly still, copied from space_sequencer */
|
/* XXX a bit ugly still, copied from space_sequencer */
|
||||||
/* NOTE: if you change values here, also change them in space_sequencer.c, sequencer_new */
|
/* NOTE: if you change values here, also change them in space_sequencer.c, sequencer_new */
|
||||||
region->regiontype = RGN_TYPE_PREVIEW;
|
region->regiontype = RGN_TYPE_PREVIEW;
|
||||||
region->alignment = RGN_ALIGN_TOP;
|
region->alignment = RGN_ALIGN_TOP;
|
||||||
region->flag |= RGN_FLAG_HIDDEN;
|
region->flag &= ~RGN_FLAG_HIDDEN;
|
||||||
region->v2d.keepzoom = V2D_KEEPASPECT | V2D_KEEPZOOM;
|
region->v2d.keepzoom = V2D_KEEPASPECT | V2D_KEEPZOOM | V2D_LIMITZOOM;
|
||||||
region->v2d.minzoom = 0.00001f;
|
region->v2d.minzoom = 0.001f;
|
||||||
region->v2d.maxzoom = 100000.0f;
|
region->v2d.maxzoom = 1000.0f;
|
||||||
region->v2d.tot.xmin = -960.0f; /* 1920 width centered */
|
region->v2d.tot.xmin = -960.0f; /* 1920 width centered */
|
||||||
region->v2d.tot.ymin = -540.0f; /* 1080 height centered */
|
region->v2d.tot.ymin = -540.0f; /* 1080 height centered */
|
||||||
region->v2d.tot.xmax = 960.0f;
|
region->v2d.tot.xmax = 960.0f;
|
||||||
|
|
|
@ -2223,6 +2223,78 @@ static void version_fix_image_format_copy(Main *bmain, ImageFormatData *format)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Some editors would manually manage visibility of regions, or lazy create them based on
|
||||||
|
* context. Ensure they are always there now, and use the new #ARegionType.poll().
|
||||||
|
*/
|
||||||
|
static void version_ensure_missing_regions(ScrArea *area, SpaceLink *sl)
|
||||||
|
{
|
||||||
|
ListBase *regionbase = (sl == area->spacedata.first) ? &area->regionbase : &sl->regionbase;
|
||||||
|
|
||||||
|
switch (sl->spacetype) {
|
||||||
|
case SPACE_FILE: {
|
||||||
|
if (ARegion *ui_region = do_versions_add_region_if_not_found(
|
||||||
|
regionbase, RGN_TYPE_UI, "versioning: UI region for file", RGN_TYPE_TOOLS)) {
|
||||||
|
ui_region->alignment = RGN_ALIGN_TOP;
|
||||||
|
ui_region->flag |= RGN_FLAG_DYNAMIC_SIZE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ARegion *exec_region = do_versions_add_region_if_not_found(
|
||||||
|
regionbase, RGN_TYPE_EXECUTE, "versioning: execute region for file", RGN_TYPE_UI)) {
|
||||||
|
exec_region->alignment = RGN_ALIGN_BOTTOM;
|
||||||
|
exec_region->flag = RGN_FLAG_DYNAMIC_SIZE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ARegion *tool_props_region = do_versions_add_region_if_not_found(
|
||||||
|
regionbase,
|
||||||
|
RGN_TYPE_TOOL_PROPS,
|
||||||
|
"versioning: tool props region for file",
|
||||||
|
RGN_TYPE_EXECUTE)) {
|
||||||
|
tool_props_region->alignment = RGN_ALIGN_RIGHT;
|
||||||
|
tool_props_region->flag = RGN_FLAG_HIDDEN;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case SPACE_CLIP: {
|
||||||
|
ARegion *region;
|
||||||
|
|
||||||
|
region = do_versions_ensure_region(
|
||||||
|
regionbase, RGN_TYPE_UI, "versioning: properties region for clip", RGN_TYPE_HEADER);
|
||||||
|
region->alignment = RGN_ALIGN_RIGHT;
|
||||||
|
region->flag &= ~RGN_FLAG_HIDDEN;
|
||||||
|
|
||||||
|
region = do_versions_ensure_region(
|
||||||
|
regionbase, RGN_TYPE_CHANNELS, "versioning: channels region for clip", RGN_TYPE_UI);
|
||||||
|
region->alignment = RGN_ALIGN_LEFT;
|
||||||
|
region->flag &= ~RGN_FLAG_HIDDEN;
|
||||||
|
region->v2d.scroll = V2D_SCROLL_BOTTOM;
|
||||||
|
region->v2d.flag = V2D_VIEWSYNC_AREA_VERTICAL;
|
||||||
|
|
||||||
|
region = do_versions_ensure_region(
|
||||||
|
regionbase, RGN_TYPE_PREVIEW, "versioning: preview region for clip", RGN_TYPE_WINDOW);
|
||||||
|
region->flag &= ~RGN_FLAG_HIDDEN;
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case SPACE_SEQ: {
|
||||||
|
ARegion *region;
|
||||||
|
|
||||||
|
do_versions_ensure_region(regionbase,
|
||||||
|
RGN_TYPE_CHANNELS,
|
||||||
|
"versioning: channels region for sequencer",
|
||||||
|
RGN_TYPE_TOOLS);
|
||||||
|
|
||||||
|
region = do_versions_ensure_region(regionbase,
|
||||||
|
RGN_TYPE_PREVIEW,
|
||||||
|
"versioning: preview region for sequencer",
|
||||||
|
RGN_TYPE_CHANNELS);
|
||||||
|
sequencer_init_preview_region(region);
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* NOLINTNEXTLINE: readability-function-size */
|
/* NOLINTNEXTLINE: readability-function-size */
|
||||||
void blo_do_versions_300(FileData *fd, Library * /*lib*/, Main *bmain)
|
void blo_do_versions_300(FileData *fd, Library * /*lib*/, Main *bmain)
|
||||||
{
|
{
|
||||||
|
@ -4190,5 +4262,35 @@ void blo_do_versions_300(FileData *fd, Library * /*lib*/, Main *bmain)
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
/* Keep this block, even when empty. */
|
/* Keep this block, even when empty. */
|
||||||
|
|
||||||
|
/* Some regions used to be added/removed dynamically. Ensure they are always there, there is a
|
||||||
|
* `ARegionType.poll()` now. */
|
||||||
|
LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
|
||||||
|
LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
|
||||||
|
LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
|
||||||
|
version_ensure_missing_regions(area, sl);
|
||||||
|
|
||||||
|
/* Ensure expected region state. Previously this was modified to hide/unhide regions. */
|
||||||
|
|
||||||
|
const ListBase *regionbase = (sl == area->spacedata.first) ? &area->regionbase :
|
||||||
|
&sl->regionbase;
|
||||||
|
if (sl->spacetype == SPACE_SEQ) {
|
||||||
|
ARegion *region_main = BKE_region_find_in_listbase_by_type(regionbase,
|
||||||
|
RGN_TYPE_WINDOW);
|
||||||
|
region_main->flag &= ~RGN_FLAG_HIDDEN;
|
||||||
|
region_main->alignment = RGN_ALIGN_NONE;
|
||||||
|
|
||||||
|
ARegion *region_preview = BKE_region_find_in_listbase_by_type(regionbase,
|
||||||
|
RGN_TYPE_PREVIEW);
|
||||||
|
region_preview->flag &= ~RGN_FLAG_HIDDEN;
|
||||||
|
region_preview->alignment = RGN_ALIGN_NONE;
|
||||||
|
|
||||||
|
ARegion *region_channels = BKE_region_find_in_listbase_by_type(regionbase,
|
||||||
|
RGN_TYPE_CHANNELS);
|
||||||
|
region_channels->alignment = RGN_ALIGN_LEFT;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,7 @@ using blender::StringRef;
|
||||||
|
|
||||||
ARegion *do_versions_add_region_if_not_found(ListBase *regionbase,
|
ARegion *do_versions_add_region_if_not_found(ListBase *regionbase,
|
||||||
int region_type,
|
int region_type,
|
||||||
const char *name,
|
const char *allocname,
|
||||||
int link_after_region_type)
|
int link_after_region_type)
|
||||||
{
|
{
|
||||||
ARegion *link_after_region = nullptr;
|
ARegion *link_after_region = nullptr;
|
||||||
|
@ -45,7 +45,28 @@ ARegion *do_versions_add_region_if_not_found(ListBase *regionbase,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ARegion *new_region = static_cast<ARegion *>(MEM_callocN(sizeof(ARegion), name));
|
ARegion *new_region = static_cast<ARegion *>(MEM_callocN(sizeof(ARegion), allocname));
|
||||||
|
new_region->regiontype = region_type;
|
||||||
|
BLI_insertlinkafter(regionbase, link_after_region, new_region);
|
||||||
|
return new_region;
|
||||||
|
}
|
||||||
|
|
||||||
|
ARegion *do_versions_ensure_region(ListBase *regionbase,
|
||||||
|
int region_type,
|
||||||
|
const char *allocname,
|
||||||
|
int link_after_region_type)
|
||||||
|
{
|
||||||
|
ARegion *link_after_region = nullptr;
|
||||||
|
LISTBASE_FOREACH (ARegion *, region, regionbase) {
|
||||||
|
if (region->regiontype == region_type) {
|
||||||
|
return region;
|
||||||
|
}
|
||||||
|
if (region->regiontype == link_after_region_type) {
|
||||||
|
link_after_region = region;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ARegion *new_region = MEM_cnew<ARegion>(allocname);
|
||||||
new_region->regiontype = region_type;
|
new_region->regiontype = region_type;
|
||||||
BLI_insertlinkafter(regionbase, link_after_region, new_region);
|
BLI_insertlinkafter(regionbase, link_after_region, new_region);
|
||||||
return new_region;
|
return new_region;
|
||||||
|
|
|
@ -19,10 +19,24 @@ struct bNodeTree;
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a region of type \a region_type exists in \a regionbase. Otherwise add it after the
|
||||||
|
* first region of type \a link_after_region_type.
|
||||||
|
* \returns null if a region of the given type already existed, otherwise the newly added region.
|
||||||
|
*/
|
||||||
struct ARegion *do_versions_add_region_if_not_found(struct ListBase *regionbase,
|
struct ARegion *do_versions_add_region_if_not_found(struct ListBase *regionbase,
|
||||||
int region_type,
|
int region_type,
|
||||||
const char *name,
|
const char *allocname,
|
||||||
int link_after_region_type);
|
int link_after_region_type);
|
||||||
|
/**
|
||||||
|
* Check if a region of type \a region_type exists in \a regionbase. Otherwise add it after the
|
||||||
|
* first region of type \a link_after_region_type.
|
||||||
|
* \returns either a new, or already existing region.
|
||||||
|
*/
|
||||||
|
ARegion *do_versions_ensure_region(ListBase *regionbase,
|
||||||
|
int region_type,
|
||||||
|
const char *allocname,
|
||||||
|
int link_after_region_type);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Rename if the ID doesn't exist.
|
* Rename if the ID doesn't exist.
|
||||||
|
@ -94,6 +108,8 @@ struct bNodeSocket *version_node_add_socket_if_not_exist(struct bNodeTree *ntree
|
||||||
void version_socket_update_is_used(bNodeTree *ntree);
|
void version_socket_update_is_used(bNodeTree *ntree);
|
||||||
ARegion *do_versions_add_region(int regiontype, const char *name);
|
ARegion *do_versions_add_region(int regiontype, const char *name);
|
||||||
|
|
||||||
|
void sequencer_init_preview_region(ARegion *region);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -292,7 +292,8 @@ void ED_screen_draw_edges(struct wmWindow *win);
|
||||||
* for file read and first use, for scaling window, area moves.
|
* for file read and first use, for scaling window, area moves.
|
||||||
*/
|
*/
|
||||||
void ED_screen_refresh(struct wmWindowManager *wm, struct wmWindow *win);
|
void ED_screen_refresh(struct wmWindowManager *wm, struct wmWindow *win);
|
||||||
void ED_screen_ensure_updated(struct wmWindowManager *wm,
|
void ED_screen_ensure_updated(struct bContext *C,
|
||||||
|
struct wmWindowManager *wm,
|
||||||
struct wmWindow *win,
|
struct wmWindow *win,
|
||||||
struct bScreen *screen);
|
struct bScreen *screen);
|
||||||
void ED_screen_do_listen(struct bContext *C, const struct wmNotifier *note);
|
void ED_screen_do_listen(struct bContext *C, const struct wmNotifier *note);
|
||||||
|
|
|
@ -8339,7 +8339,7 @@ static void button_activate_state(bContext *C, uiBut *but, uiHandleButtonState s
|
||||||
*/
|
*/
|
||||||
if (state != BUTTON_STATE_TEXT_EDITING) {
|
if (state != BUTTON_STATE_TEXT_EDITING) {
|
||||||
WM_report(RPT_INFO,
|
WM_report(RPT_INFO,
|
||||||
"Can't edit driven number value, see graph editor for the driver setup.");
|
"Can't edit driven number value, see driver editor for the driver setup.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -465,7 +465,7 @@ void WM_OT_collada_export(wmOperatorType *ot)
|
||||||
"apply_modifiers",
|
"apply_modifiers",
|
||||||
0,
|
0,
|
||||||
"Apply Modifiers",
|
"Apply Modifiers",
|
||||||
"Apply modifiers to exported mesh (non destructive))");
|
"Apply modifiers to exported mesh (non destructive)");
|
||||||
|
|
||||||
RNA_def_int(ot->srna,
|
RNA_def_int(ot->srna,
|
||||||
"export_mesh_type",
|
"export_mesh_type",
|
||||||
|
|
|
@ -1461,7 +1461,7 @@ void OBJECT_OT_select_random(wmOperatorType *ot)
|
||||||
{
|
{
|
||||||
/* identifiers */
|
/* identifiers */
|
||||||
ot->name = "Select Random";
|
ot->name = "Select Random";
|
||||||
ot->description = "Set select on random visible objects";
|
ot->description = "Select or deselect random visible objects";
|
||||||
ot->idname = "OBJECT_OT_select_random";
|
ot->idname = "OBJECT_OT_select_random";
|
||||||
|
|
||||||
/* api callbacks */
|
/* api callbacks */
|
||||||
|
|
|
@ -318,7 +318,7 @@ static void region_draw_azones(ScrArea *area, ARegion *region)
|
||||||
area_draw_azone(az->x1, az->y1, az->x2, az->y2);
|
area_draw_azone(az->x1, az->y1, az->x2, az->y2);
|
||||||
}
|
}
|
||||||
else if (az->type == AZONE_REGION) {
|
else if (az->type == AZONE_REGION) {
|
||||||
if (az->region) {
|
if (az->region && !(az->region->flag & RGN_FLAG_POLL_FAILED)) {
|
||||||
/* only display tab or icons when the region is hidden */
|
/* only display tab or icons when the region is hidden */
|
||||||
if (az->region->flag & (RGN_FLAG_HIDDEN | RGN_FLAG_TOO_SMALL)) {
|
if (az->region->flag & (RGN_FLAG_HIDDEN | RGN_FLAG_TOO_SMALL)) {
|
||||||
region_draw_azone_tab_arrow(area, region, az);
|
region_draw_azone_tab_arrow(area, region, az);
|
||||||
|
@ -1005,6 +1005,10 @@ static void region_azone_tab_plus(ScrArea *area, AZone *az, ARegion *region)
|
||||||
|
|
||||||
static bool region_azone_edge_poll(const ARegion *region, const bool is_fullscreen)
|
static bool region_azone_edge_poll(const ARegion *region, const bool is_fullscreen)
|
||||||
{
|
{
|
||||||
|
if (region->flag & RGN_FLAG_POLL_FAILED) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
const bool is_hidden = (region->flag & (RGN_FLAG_HIDDEN | RGN_FLAG_TOO_SMALL));
|
const bool is_hidden = (region->flag & (RGN_FLAG_HIDDEN | RGN_FLAG_TOO_SMALL));
|
||||||
|
|
||||||
if (is_hidden && is_fullscreen) {
|
if (is_hidden && is_fullscreen) {
|
||||||
|
@ -1163,7 +1167,7 @@ static void region_overlap_fix(ScrArea *area, ARegion *region)
|
||||||
int align1 = 0;
|
int align1 = 0;
|
||||||
const int align = RGN_ALIGN_ENUM_FROM_MASK(region->alignment);
|
const int align = RGN_ALIGN_ENUM_FROM_MASK(region->alignment);
|
||||||
for (region_iter = region->prev; region_iter; region_iter = region_iter->prev) {
|
for (region_iter = region->prev; region_iter; region_iter = region_iter->prev) {
|
||||||
if (region_iter->flag & RGN_FLAG_HIDDEN) {
|
if (region_iter->flag & (RGN_FLAG_POLL_FAILED | RGN_FLAG_HIDDEN)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1208,7 +1212,7 @@ static void region_overlap_fix(ScrArea *area, ARegion *region)
|
||||||
/* At this point, 'region' is in its final position and still open.
|
/* At this point, 'region' is in its final position and still open.
|
||||||
* Make a final check it does not overlap any previous 'other side' region. */
|
* Make a final check it does not overlap any previous 'other side' region. */
|
||||||
for (region_iter = region->prev; region_iter; region_iter = region_iter->prev) {
|
for (region_iter = region->prev; region_iter; region_iter = region_iter->prev) {
|
||||||
if (region_iter->flag & RGN_FLAG_HIDDEN) {
|
if (region_iter->flag & (RGN_FLAG_POLL_FAILED | RGN_FLAG_HIDDEN)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (ELEM(region_iter->alignment, RGN_ALIGN_FLOAT)) {
|
if (ELEM(region_iter->alignment, RGN_ALIGN_FLOAT)) {
|
||||||
|
@ -1326,7 +1330,7 @@ static void region_rect_recursive(
|
||||||
(region->sizey > 1 ? region->sizey + 0.5f : region->type->prefsizey);
|
(region->sizey > 1 ? region->sizey + 0.5f : region->type->prefsizey);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (region->flag & RGN_FLAG_HIDDEN) {
|
if (region->flag & (RGN_FLAG_POLL_FAILED | RGN_FLAG_HIDDEN)) {
|
||||||
/* hidden is user flag */
|
/* hidden is user flag */
|
||||||
}
|
}
|
||||||
else if (alignment == RGN_ALIGN_FLOAT) {
|
else if (alignment == RGN_ALIGN_FLOAT) {
|
||||||
|
@ -1627,7 +1631,8 @@ static void area_calc_totrct(ScrArea *area, const rcti *window_rect)
|
||||||
/* used for area initialize below */
|
/* used for area initialize below */
|
||||||
static void region_subwindow(ARegion *region)
|
static void region_subwindow(ARegion *region)
|
||||||
{
|
{
|
||||||
bool hidden = (region->flag & (RGN_FLAG_HIDDEN | RGN_FLAG_TOO_SMALL)) != 0;
|
bool hidden = (region->flag & (RGN_FLAG_POLL_FAILED | RGN_FLAG_HIDDEN | RGN_FLAG_TOO_SMALL)) !=
|
||||||
|
0;
|
||||||
|
|
||||||
if ((region->alignment & RGN_SPLIT_PREV) && region->prev) {
|
if ((region->alignment & RGN_SPLIT_PREV) && region->prev) {
|
||||||
hidden = hidden || (region->prev->flag & (RGN_FLAG_HIDDEN | RGN_FLAG_TOO_SMALL));
|
hidden = hidden || (region->prev->flag & (RGN_FLAG_HIDDEN | RGN_FLAG_TOO_SMALL));
|
||||||
|
@ -2072,7 +2077,7 @@ void ED_region_cursor_set(wmWindow *win, ScrArea *area, ARegion *region)
|
||||||
|
|
||||||
void ED_region_visibility_change_update(bContext *C, ScrArea *area, ARegion *region)
|
void ED_region_visibility_change_update(bContext *C, ScrArea *area, ARegion *region)
|
||||||
{
|
{
|
||||||
if (region->flag & RGN_FLAG_HIDDEN) {
|
if (region->flag & (RGN_FLAG_HIDDEN | RGN_FLAG_POLL_FAILED)) {
|
||||||
WM_event_remove_handlers(C, ®ion->handlers);
|
WM_event_remove_handlers(C, ®ion->handlers);
|
||||||
/* Needed to close any open pop-overs which would otherwise remain open,
|
/* Needed to close any open pop-overs which would otherwise remain open,
|
||||||
* crashing on attempting to refresh. See: #93410.
|
* crashing on attempting to refresh. See: #93410.
|
||||||
|
@ -2182,6 +2187,10 @@ static void region_align_info_from_area(ScrArea *area, RegionTypeAlignInfo *r_al
|
||||||
}
|
}
|
||||||
|
|
||||||
LISTBASE_FOREACH (ARegion *, region, &area->regionbase) {
|
LISTBASE_FOREACH (ARegion *, region, &area->regionbase) {
|
||||||
|
if (region->flag & RGN_FLAG_POLL_FAILED) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
const int index = region->regiontype;
|
const int index = region->regiontype;
|
||||||
if (uint(index) < RGN_TYPE_NUM) {
|
if (uint(index) < RGN_TYPE_NUM) {
|
||||||
r_align_info->by_type[index].alignment = RGN_ALIGN_ENUM_FROM_MASK(region->alignment);
|
r_align_info->by_type[index].alignment = RGN_ALIGN_ENUM_FROM_MASK(region->alignment);
|
||||||
|
|
|
@ -713,8 +713,52 @@ void ED_screens_init(Main *bmain, wmWindowManager *wm)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ED_screen_ensure_updated(wmWindowManager *wm, wmWindow *win, bScreen *screen)
|
static bool region_poll(const bScreen *screen, const ScrArea *area, const ARegion *region)
|
||||||
{
|
{
|
||||||
|
if (!region->type || !region->type->poll) {
|
||||||
|
/* Show region by default. */
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
RegionPollParams params = {0};
|
||||||
|
params.screen = screen;
|
||||||
|
params.area = area;
|
||||||
|
params.region = region;
|
||||||
|
|
||||||
|
return region->type->poll(¶ms);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void screen_regions_poll(bContext *C, const wmWindow *win, bScreen *screen)
|
||||||
|
{
|
||||||
|
bool any_changed = false;
|
||||||
|
ED_screen_areas_iter (win, screen, area) {
|
||||||
|
LISTBASE_FOREACH (ARegion *, region, &area->regionbase) {
|
||||||
|
const int old_region_flag = region->flag;
|
||||||
|
|
||||||
|
region->flag &= ~RGN_FLAG_POLL_FAILED;
|
||||||
|
|
||||||
|
if (region_poll(screen, area, region) == false) {
|
||||||
|
region->flag |= RGN_FLAG_POLL_FAILED;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (old_region_flag != region->flag) {
|
||||||
|
any_changed = true;
|
||||||
|
|
||||||
|
/* Enforce complete re-init. */
|
||||||
|
region->v2d.flag &= ~V2D_IS_INIT;
|
||||||
|
ED_region_visibility_change_update(C, area, region);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (any_changed) {
|
||||||
|
screen->do_refresh = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ED_screen_ensure_updated(bContext *C, wmWindowManager *wm, wmWindow *win, bScreen *screen)
|
||||||
|
{
|
||||||
|
screen_regions_poll(C, win, screen);
|
||||||
if (screen->do_refresh) {
|
if (screen->do_refresh) {
|
||||||
ED_screen_refresh(wm, win);
|
ED_screen_refresh(wm, win);
|
||||||
}
|
}
|
||||||
|
|
|
@ -5080,11 +5080,6 @@ static int userpref_show_exec(bContext *C, wmOperator *op)
|
||||||
region->flag |= RGN_FLAG_HIDDEN;
|
region->flag |= RGN_FLAG_HIDDEN;
|
||||||
ED_region_visibility_change_update(C, area, region);
|
ED_region_visibility_change_update(C, area, region);
|
||||||
|
|
||||||
/* And also show the region with "Load & Save" buttons. */
|
|
||||||
region = BKE_area_find_region_type(area, RGN_TYPE_EXECUTE);
|
|
||||||
region->flag &= ~RGN_FLAG_HIDDEN;
|
|
||||||
ED_region_visibility_change_update(C, area, region);
|
|
||||||
|
|
||||||
return OPERATOR_FINISHED;
|
return OPERATOR_FINISHED;
|
||||||
}
|
}
|
||||||
BKE_report(op->reports, RPT_ERROR, "Failed to open window!");
|
BKE_report(op->reports, RPT_ERROR, "Failed to open window!");
|
||||||
|
|
|
@ -34,7 +34,6 @@ set(SRC
|
||||||
clip_graph_draw.cc
|
clip_graph_draw.cc
|
||||||
clip_graph_ops.cc
|
clip_graph_ops.cc
|
||||||
clip_ops.cc
|
clip_ops.cc
|
||||||
clip_toolbar.cc
|
|
||||||
clip_utils.cc
|
clip_utils.cc
|
||||||
space_clip.cc
|
space_clip.cc
|
||||||
tracking_ops.cc
|
tracking_ops.cc
|
||||||
|
|
|
@ -114,10 +114,6 @@ void CLIP_OT_cursor_set(struct wmOperatorType *ot);
|
||||||
|
|
||||||
void CLIP_OT_lock_selection_toggle(struct wmOperatorType *ot);
|
void CLIP_OT_lock_selection_toggle(struct wmOperatorType *ot);
|
||||||
|
|
||||||
/* clip_toolbar.cc */
|
|
||||||
|
|
||||||
struct ARegion *ED_clip_has_properties_region(struct ScrArea *area);
|
|
||||||
|
|
||||||
/* clip_utils.cc */
|
/* clip_utils.cc */
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
|
|
|
@ -1,54 +0,0 @@
|
||||||
/* SPDX-License-Identifier: GPL-2.0-or-later
|
|
||||||
* Copyright 2011 Blender Foundation */
|
|
||||||
|
|
||||||
/** \file
|
|
||||||
* \ingroup spclip
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
#include "MEM_guardedalloc.h"
|
|
||||||
|
|
||||||
#include "BLI_blenlib.h"
|
|
||||||
#include "BLI_utildefines.h"
|
|
||||||
|
|
||||||
#include "BKE_context.h"
|
|
||||||
#include "BKE_screen.h"
|
|
||||||
|
|
||||||
#include "WM_types.h"
|
|
||||||
|
|
||||||
#include "ED_screen.h"
|
|
||||||
|
|
||||||
#include "clip_intern.h" /* own include */
|
|
||||||
|
|
||||||
/* ************************ header area region *********************** */
|
|
||||||
|
|
||||||
/************************** properties ******************************/
|
|
||||||
|
|
||||||
ARegion *ED_clip_has_properties_region(ScrArea *area)
|
|
||||||
{
|
|
||||||
ARegion *region, *arnew;
|
|
||||||
|
|
||||||
region = BKE_area_find_region_type(area, RGN_TYPE_UI);
|
|
||||||
if (region) {
|
|
||||||
return region;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* add subdiv level; after header */
|
|
||||||
region = BKE_area_find_region_type(area, RGN_TYPE_HEADER);
|
|
||||||
|
|
||||||
/* is error! */
|
|
||||||
if (region == nullptr) {
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
arnew = MEM_cnew<ARegion>("clip properties region");
|
|
||||||
|
|
||||||
BLI_insertlinkafter(&area->regionbase, region, arnew);
|
|
||||||
arnew->regiontype = RGN_TYPE_UI;
|
|
||||||
arnew->alignment = RGN_ALIGN_RIGHT;
|
|
||||||
|
|
||||||
arnew->flag = RGN_FLAG_HIDDEN;
|
|
||||||
|
|
||||||
return arnew;
|
|
||||||
}
|
|
|
@ -60,10 +60,6 @@ static void init_preview_region(const Scene *scene,
|
||||||
const SpaceClip *sc,
|
const SpaceClip *sc,
|
||||||
ARegion *region)
|
ARegion *region)
|
||||||
{
|
{
|
||||||
region->regiontype = RGN_TYPE_PREVIEW;
|
|
||||||
region->alignment = RGN_ALIGN_TOP;
|
|
||||||
region->flag |= RGN_FLAG_HIDDEN;
|
|
||||||
|
|
||||||
if (sc->view == SC_VIEW_DOPESHEET) {
|
if (sc->view == SC_VIEW_DOPESHEET) {
|
||||||
region->v2d.tot.xmin = -10.0f;
|
region->v2d.tot.xmin = -10.0f;
|
||||||
region->v2d.tot.ymin = float(-area->winy) / 3.0f;
|
region->v2d.tot.ymin = float(-area->winy) / 3.0f;
|
||||||
|
@ -115,78 +111,6 @@ static void init_preview_region(const Scene *scene,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void reinit_preview_region(const bContext *C, ARegion *region)
|
|
||||||
{
|
|
||||||
Scene *scene = CTX_data_scene(C);
|
|
||||||
ScrArea *area = CTX_wm_area(C);
|
|
||||||
SpaceClip *sc = CTX_wm_space_clip(C);
|
|
||||||
|
|
||||||
if (sc->view == SC_VIEW_DOPESHEET) {
|
|
||||||
if ((region->v2d.flag & V2D_VIEWSYNC_AREA_VERTICAL) == 0) {
|
|
||||||
init_preview_region(scene, area, sc, region);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if (region->v2d.flag & V2D_VIEWSYNC_AREA_VERTICAL) {
|
|
||||||
init_preview_region(scene, area, sc, region);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static ARegion *ED_clip_has_preview_region(const bContext *C, ScrArea *area)
|
|
||||||
{
|
|
||||||
ARegion *region, *arnew;
|
|
||||||
|
|
||||||
region = BKE_area_find_region_type(area, RGN_TYPE_PREVIEW);
|
|
||||||
if (region) {
|
|
||||||
return region;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* add subdiv level; after header */
|
|
||||||
region = BKE_area_find_region_type(area, RGN_TYPE_WINDOW);
|
|
||||||
|
|
||||||
/* is error! */
|
|
||||||
if (region == nullptr) {
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
arnew = MEM_cnew<ARegion>("clip preview region");
|
|
||||||
|
|
||||||
BLI_insertlinkbefore(&area->regionbase, region, arnew);
|
|
||||||
init_preview_region(CTX_data_scene(C), area, CTX_wm_space_clip(C), arnew);
|
|
||||||
|
|
||||||
return arnew;
|
|
||||||
}
|
|
||||||
|
|
||||||
static ARegion *ED_clip_has_channels_region(ScrArea *area)
|
|
||||||
{
|
|
||||||
ARegion *region, *arnew;
|
|
||||||
|
|
||||||
region = BKE_area_find_region_type(area, RGN_TYPE_CHANNELS);
|
|
||||||
if (region) {
|
|
||||||
return region;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* add subdiv level; after header */
|
|
||||||
region = BKE_area_find_region_type(area, RGN_TYPE_PREVIEW);
|
|
||||||
|
|
||||||
/* is error! */
|
|
||||||
if (region == nullptr) {
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
arnew = MEM_cnew<ARegion>("clip channels region");
|
|
||||||
|
|
||||||
BLI_insertlinkbefore(&area->regionbase, region, arnew);
|
|
||||||
arnew->regiontype = RGN_TYPE_CHANNELS;
|
|
||||||
arnew->alignment = RGN_ALIGN_LEFT;
|
|
||||||
|
|
||||||
arnew->v2d.scroll = V2D_SCROLL_BOTTOM;
|
|
||||||
arnew->v2d.flag = V2D_VIEWSYNC_AREA_VERTICAL;
|
|
||||||
|
|
||||||
return arnew;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void clip_scopes_tag_refresh(ScrArea *area)
|
static void clip_scopes_tag_refresh(ScrArea *area)
|
||||||
{
|
{
|
||||||
SpaceClip *sc = (SpaceClip *)area->spacedata.first;
|
SpaceClip *sc = (SpaceClip *)area->spacedata.first;
|
||||||
|
@ -222,7 +146,7 @@ static void clip_area_sync_frame_from_scene(ScrArea *area, const Scene *scene)
|
||||||
|
|
||||||
/* ******************** default callbacks for clip space ***************** */
|
/* ******************** default callbacks for clip space ***************** */
|
||||||
|
|
||||||
static SpaceLink *clip_create(const ScrArea *area, const Scene *scene)
|
static SpaceLink *clip_create(const ScrArea * /*area*/, const Scene * /*scene*/)
|
||||||
{
|
{
|
||||||
ARegion *region;
|
ARegion *region;
|
||||||
SpaceClip *sc;
|
SpaceClip *sc;
|
||||||
|
@ -264,7 +188,7 @@ static SpaceLink *clip_create(const ScrArea *area, const Scene *scene)
|
||||||
region = MEM_cnew<ARegion>("preview for clip");
|
region = MEM_cnew<ARegion>("preview for clip");
|
||||||
|
|
||||||
BLI_addtail(&sc->regionbase, region);
|
BLI_addtail(&sc->regionbase, region);
|
||||||
init_preview_region(scene, area, sc, region);
|
region->regiontype = RGN_TYPE_PREVIEW;
|
||||||
|
|
||||||
/* main region */
|
/* main region */
|
||||||
region = MEM_cnew<ARegion>("main region for clip");
|
region = MEM_cnew<ARegion>("main region for clip");
|
||||||
|
@ -620,99 +544,28 @@ static void clip_dropboxes(void)
|
||||||
WM_dropbox_add(lb, "CLIP_OT_open", clip_drop_poll, clip_drop_copy, nullptr, nullptr);
|
WM_dropbox_add(lb, "CLIP_OT_open", clip_drop_poll, clip_drop_copy, nullptr, nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool clip_set_region_visible(const bContext *C,
|
static void clip_refresh(const bContext *C, ScrArea *area)
|
||||||
ARegion *region,
|
|
||||||
const bool is_visible,
|
|
||||||
const short alignment,
|
|
||||||
const bool view_all_on_show)
|
|
||||||
{
|
{
|
||||||
bool view_changed = false;
|
Scene *scene = CTX_data_scene(C);
|
||||||
|
SpaceClip *sc = (SpaceClip *)area->spacedata.first;
|
||||||
|
|
||||||
if (is_visible) {
|
ARegion *region_preview = BKE_area_find_region_type(area, RGN_TYPE_PREVIEW);
|
||||||
if (region && (region->flag & RGN_FLAG_HIDDEN)) {
|
if (!(region_preview->v2d.flag & V2D_IS_INIT)) {
|
||||||
region->flag &= ~RGN_FLAG_HIDDEN;
|
init_preview_region(scene, area, sc, region_preview);
|
||||||
region->v2d.flag &= ~V2D_IS_INIT;
|
region_preview->v2d.cur = region_preview->v2d.tot;
|
||||||
if (view_all_on_show) {
|
}
|
||||||
region->v2d.cur = region->v2d.tot;
|
/* #V2D_VIEWSYNC_AREA_VERTICAL must always be set for the dopesheet view, in graph view it must
|
||||||
}
|
* be unset. This is enforced by region re-initialization.
|
||||||
view_changed = true;
|
* That means if it's not set correctly, the view just changed and needs re-initialization */
|
||||||
}
|
else if (sc->view == SC_VIEW_DOPESHEET) {
|
||||||
if (region && region->alignment != alignment) {
|
if ((region_preview->v2d.flag & V2D_VIEWSYNC_AREA_VERTICAL) == 0) {
|
||||||
region->alignment = alignment;
|
init_preview_region(scene, area, sc, region_preview);
|
||||||
view_changed = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (region && !(region->flag & RGN_FLAG_HIDDEN)) {
|
if (region_preview->v2d.flag & V2D_VIEWSYNC_AREA_VERTICAL) {
|
||||||
region->flag |= RGN_FLAG_HIDDEN;
|
init_preview_region(scene, area, sc, region_preview);
|
||||||
region->v2d.flag &= ~V2D_IS_INIT;
|
|
||||||
WM_event_remove_handlers((bContext *)C, ®ion->handlers);
|
|
||||||
view_changed = true;
|
|
||||||
}
|
}
|
||||||
if (region && region->alignment != RGN_ALIGN_NONE) {
|
|
||||||
region->alignment = RGN_ALIGN_NONE;
|
|
||||||
view_changed = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return view_changed;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void clip_refresh(const bContext *C, ScrArea *area)
|
|
||||||
{
|
|
||||||
wmWindowManager *wm = CTX_wm_manager(C);
|
|
||||||
wmWindow *window = CTX_wm_window(C);
|
|
||||||
Scene *scene = CTX_data_scene(C);
|
|
||||||
SpaceClip *sc = (SpaceClip *)area->spacedata.first;
|
|
||||||
ARegion *region_main = BKE_area_find_region_type(area, RGN_TYPE_WINDOW);
|
|
||||||
ARegion *region_tools = BKE_area_find_region_type(area, RGN_TYPE_TOOLS);
|
|
||||||
ARegion *region_preview = ED_clip_has_preview_region(C, area);
|
|
||||||
ARegion *region_properties = ED_clip_has_properties_region(area);
|
|
||||||
ARegion *region_channels = ED_clip_has_channels_region(area);
|
|
||||||
bool main_visible = false, preview_visible = false, tools_visible = false;
|
|
||||||
bool properties_visible = false, channels_visible = false;
|
|
||||||
bool view_changed = false;
|
|
||||||
|
|
||||||
switch (sc->view) {
|
|
||||||
case SC_VIEW_CLIP:
|
|
||||||
main_visible = true;
|
|
||||||
preview_visible = false;
|
|
||||||
tools_visible = true;
|
|
||||||
properties_visible = true;
|
|
||||||
channels_visible = false;
|
|
||||||
break;
|
|
||||||
case SC_VIEW_GRAPH:
|
|
||||||
main_visible = false;
|
|
||||||
preview_visible = true;
|
|
||||||
tools_visible = false;
|
|
||||||
properties_visible = false;
|
|
||||||
channels_visible = false;
|
|
||||||
|
|
||||||
reinit_preview_region(C, region_preview);
|
|
||||||
break;
|
|
||||||
case SC_VIEW_DOPESHEET:
|
|
||||||
main_visible = false;
|
|
||||||
preview_visible = true;
|
|
||||||
tools_visible = false;
|
|
||||||
properties_visible = false;
|
|
||||||
channels_visible = true;
|
|
||||||
|
|
||||||
reinit_preview_region(C, region_preview);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
view_changed |= clip_set_region_visible(C, region_main, main_visible, RGN_ALIGN_NONE, false);
|
|
||||||
view_changed |= clip_set_region_visible(
|
|
||||||
C, region_properties, properties_visible, RGN_ALIGN_RIGHT, false);
|
|
||||||
view_changed |= clip_set_region_visible(C, region_tools, tools_visible, RGN_ALIGN_LEFT, false);
|
|
||||||
view_changed |= clip_set_region_visible(
|
|
||||||
C, region_preview, preview_visible, RGN_ALIGN_NONE, true);
|
|
||||||
view_changed |= clip_set_region_visible(
|
|
||||||
C, region_channels, channels_visible, RGN_ALIGN_LEFT, false);
|
|
||||||
|
|
||||||
if (view_changed) {
|
|
||||||
ED_area_init(wm, window, area);
|
|
||||||
ED_area_tag_redraw(area);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
BKE_movieclip_user_set_frame(&sc->user, scene->r.cfra);
|
BKE_movieclip_user_set_frame(&sc->user, scene->r.cfra);
|
||||||
|
@ -780,6 +633,12 @@ static void movieclip_main_area_set_view2d(const bContext *C, ARegion *region)
|
||||||
region->v2d.cur.ymax /= h;
|
region->v2d.cur.ymax /= h;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool clip_main_region_poll(const RegionPollParams *params)
|
||||||
|
{
|
||||||
|
const SpaceClip *sclip = static_cast<SpaceClip *>(params->area->spacedata.first);
|
||||||
|
return ELEM(sclip->view, SC_VIEW_CLIP);
|
||||||
|
}
|
||||||
|
|
||||||
/* add handlers, stuff you only do once or on area/region changes */
|
/* add handlers, stuff you only do once or on area/region changes */
|
||||||
static void clip_main_region_init(wmWindowManager *wm, ARegion *region)
|
static void clip_main_region_init(wmWindowManager *wm, ARegion *region)
|
||||||
{
|
{
|
||||||
|
@ -935,6 +794,12 @@ static void clip_main_region_listener(const wmRegionListenerParams *params)
|
||||||
|
|
||||||
/****************** preview region ******************/
|
/****************** preview region ******************/
|
||||||
|
|
||||||
|
static bool clip_preview_region_poll(const RegionPollParams *params)
|
||||||
|
{
|
||||||
|
const SpaceClip *sclip = static_cast<SpaceClip *>(params->area->spacedata.first);
|
||||||
|
return ELEM(sclip->view, SC_VIEW_GRAPH, SC_VIEW_DOPESHEET);
|
||||||
|
}
|
||||||
|
|
||||||
static void clip_preview_region_init(wmWindowManager *wm, ARegion *region)
|
static void clip_preview_region_init(wmWindowManager *wm, ARegion *region)
|
||||||
{
|
{
|
||||||
wmKeyMap *keymap;
|
wmKeyMap *keymap;
|
||||||
|
@ -1060,6 +925,12 @@ static void clip_preview_region_listener(const wmRegionListenerParams * /*params
|
||||||
|
|
||||||
/****************** channels region ******************/
|
/****************** channels region ******************/
|
||||||
|
|
||||||
|
static bool clip_channels_region_poll(const RegionPollParams *params)
|
||||||
|
{
|
||||||
|
const SpaceClip *sclip = static_cast<SpaceClip *>(params->area->spacedata.first);
|
||||||
|
return ELEM(sclip->view, SC_VIEW_DOPESHEET);
|
||||||
|
}
|
||||||
|
|
||||||
static void clip_channels_region_init(wmWindowManager *wm, ARegion *region)
|
static void clip_channels_region_init(wmWindowManager *wm, ARegion *region)
|
||||||
{
|
{
|
||||||
wmKeyMap *keymap;
|
wmKeyMap *keymap;
|
||||||
|
@ -1134,6 +1005,12 @@ static void clip_header_region_listener(const wmRegionListenerParams *params)
|
||||||
|
|
||||||
/****************** tools region ******************/
|
/****************** tools region ******************/
|
||||||
|
|
||||||
|
static bool clip_tools_region_poll(const RegionPollParams *params)
|
||||||
|
{
|
||||||
|
const SpaceClip *sclip = static_cast<SpaceClip *>(params->area->spacedata.first);
|
||||||
|
return ELEM(sclip->view, SC_VIEW_CLIP);
|
||||||
|
}
|
||||||
|
|
||||||
/* add handlers, stuff you only do once or on area/region changes */
|
/* add handlers, stuff you only do once or on area/region changes */
|
||||||
static void clip_tools_region_init(wmWindowManager *wm, ARegion *region)
|
static void clip_tools_region_init(wmWindowManager *wm, ARegion *region)
|
||||||
{
|
{
|
||||||
|
@ -1184,6 +1061,12 @@ static void clip_props_region_listener(const wmRegionListenerParams *params)
|
||||||
|
|
||||||
/****************** properties region ******************/
|
/****************** properties region ******************/
|
||||||
|
|
||||||
|
static bool clip_properties_region_poll(const RegionPollParams *params)
|
||||||
|
{
|
||||||
|
const SpaceClip *sclip = static_cast<SpaceClip *>(params->area->spacedata.first);
|
||||||
|
return ELEM(sclip->view, SC_VIEW_CLIP);
|
||||||
|
}
|
||||||
|
|
||||||
/* add handlers, stuff you only do once or on area/region changes */
|
/* add handlers, stuff you only do once or on area/region changes */
|
||||||
static void clip_properties_region_init(wmWindowManager *wm, ARegion *region)
|
static void clip_properties_region_init(wmWindowManager *wm, ARegion *region)
|
||||||
{
|
{
|
||||||
|
@ -1286,6 +1169,7 @@ void ED_spacetype_clip(void)
|
||||||
/* regions: main window */
|
/* regions: main window */
|
||||||
art = MEM_cnew<ARegionType>("spacetype clip region");
|
art = MEM_cnew<ARegionType>("spacetype clip region");
|
||||||
art->regionid = RGN_TYPE_WINDOW;
|
art->regionid = RGN_TYPE_WINDOW;
|
||||||
|
art->poll = clip_main_region_poll;
|
||||||
art->init = clip_main_region_init;
|
art->init = clip_main_region_init;
|
||||||
art->draw = clip_main_region_draw;
|
art->draw = clip_main_region_draw;
|
||||||
art->listener = clip_main_region_listener;
|
art->listener = clip_main_region_listener;
|
||||||
|
@ -1297,6 +1181,7 @@ void ED_spacetype_clip(void)
|
||||||
art = MEM_cnew<ARegionType>("spacetype clip region preview");
|
art = MEM_cnew<ARegionType>("spacetype clip region preview");
|
||||||
art->regionid = RGN_TYPE_PREVIEW;
|
art->regionid = RGN_TYPE_PREVIEW;
|
||||||
art->prefsizey = 240;
|
art->prefsizey = 240;
|
||||||
|
art->poll = clip_preview_region_poll;
|
||||||
art->init = clip_preview_region_init;
|
art->init = clip_preview_region_init;
|
||||||
art->draw = clip_preview_region_draw;
|
art->draw = clip_preview_region_draw;
|
||||||
art->listener = clip_preview_region_listener;
|
art->listener = clip_preview_region_listener;
|
||||||
|
@ -1309,6 +1194,7 @@ void ED_spacetype_clip(void)
|
||||||
art->regionid = RGN_TYPE_UI;
|
art->regionid = RGN_TYPE_UI;
|
||||||
art->prefsizex = UI_SIDEBAR_PANEL_WIDTH;
|
art->prefsizex = UI_SIDEBAR_PANEL_WIDTH;
|
||||||
art->keymapflag = ED_KEYMAP_FRAMES | ED_KEYMAP_UI;
|
art->keymapflag = ED_KEYMAP_FRAMES | ED_KEYMAP_UI;
|
||||||
|
art->poll = clip_properties_region_poll;
|
||||||
art->init = clip_properties_region_init;
|
art->init = clip_properties_region_init;
|
||||||
art->draw = clip_properties_region_draw;
|
art->draw = clip_properties_region_draw;
|
||||||
art->listener = clip_properties_region_listener;
|
art->listener = clip_properties_region_listener;
|
||||||
|
@ -1320,6 +1206,7 @@ void ED_spacetype_clip(void)
|
||||||
art->regionid = RGN_TYPE_TOOLS;
|
art->regionid = RGN_TYPE_TOOLS;
|
||||||
art->prefsizex = UI_SIDEBAR_PANEL_WIDTH;
|
art->prefsizex = UI_SIDEBAR_PANEL_WIDTH;
|
||||||
art->keymapflag = ED_KEYMAP_FRAMES | ED_KEYMAP_UI;
|
art->keymapflag = ED_KEYMAP_FRAMES | ED_KEYMAP_UI;
|
||||||
|
art->poll = clip_tools_region_poll;
|
||||||
art->listener = clip_props_region_listener;
|
art->listener = clip_props_region_listener;
|
||||||
art->init = clip_tools_region_init;
|
art->init = clip_tools_region_init;
|
||||||
art->draw = clip_tools_region_draw;
|
art->draw = clip_tools_region_draw;
|
||||||
|
@ -1345,6 +1232,7 @@ void ED_spacetype_clip(void)
|
||||||
art->regionid = RGN_TYPE_CHANNELS;
|
art->regionid = RGN_TYPE_CHANNELS;
|
||||||
art->prefsizex = UI_COMPACT_PANEL_WIDTH;
|
art->prefsizex = UI_COMPACT_PANEL_WIDTH;
|
||||||
art->keymapflag = ED_KEYMAP_FRAMES | ED_KEYMAP_UI;
|
art->keymapflag = ED_KEYMAP_FRAMES | ED_KEYMAP_UI;
|
||||||
|
art->poll = clip_channels_region_poll;
|
||||||
art->listener = clip_channels_region_listener;
|
art->listener = clip_channels_region_listener;
|
||||||
art->init = clip_channels_region_init;
|
art->init = clip_channels_region_init;
|
||||||
art->draw = clip_channels_region_draw;
|
art->draw = clip_channels_region_draw;
|
||||||
|
|
|
@ -568,9 +568,9 @@ void CLIP_OT_set_axis(wmOperatorType *ot)
|
||||||
/* identifiers */
|
/* identifiers */
|
||||||
ot->name = "Set Axis";
|
ot->name = "Set Axis";
|
||||||
ot->description =
|
ot->description =
|
||||||
"Set direction of scene axis rotating camera "
|
"Set the direction of a scene axis by rotating the camera "
|
||||||
"(or its parent if present) and assume selected track "
|
"(or its parent if present). This assumes that the selected "
|
||||||
"lies on real axis, joining it with the origin";
|
"track lies on a real axis connecting it to the origin";
|
||||||
ot->idname = "CLIP_OT_set_axis";
|
ot->idname = "CLIP_OT_set_axis";
|
||||||
|
|
||||||
/* api callbacks */
|
/* api callbacks */
|
||||||
|
|
|
@ -49,58 +49,6 @@
|
||||||
#include "filelist.h"
|
#include "filelist.h"
|
||||||
#include "fsmenu.h"
|
#include "fsmenu.h"
|
||||||
|
|
||||||
static ARegion *file_ui_region_ensure(ScrArea *area, ARegion *region_prev)
|
|
||||||
{
|
|
||||||
ARegion *region;
|
|
||||||
|
|
||||||
if ((region = BKE_area_find_region_type(area, RGN_TYPE_UI)) != NULL) {
|
|
||||||
return region;
|
|
||||||
}
|
|
||||||
|
|
||||||
region = MEM_callocN(sizeof(ARegion), "execute region for file");
|
|
||||||
BLI_insertlinkafter(&area->regionbase, region_prev, region);
|
|
||||||
region->regiontype = RGN_TYPE_UI;
|
|
||||||
region->alignment = RGN_ALIGN_TOP;
|
|
||||||
region->flag = RGN_FLAG_DYNAMIC_SIZE;
|
|
||||||
|
|
||||||
return region;
|
|
||||||
}
|
|
||||||
|
|
||||||
static ARegion *file_execute_region_ensure(ScrArea *area, ARegion *region_prev)
|
|
||||||
{
|
|
||||||
ARegion *region;
|
|
||||||
|
|
||||||
if ((region = BKE_area_find_region_type(area, RGN_TYPE_EXECUTE)) != NULL) {
|
|
||||||
return region;
|
|
||||||
}
|
|
||||||
|
|
||||||
region = MEM_callocN(sizeof(ARegion), "execute region for file");
|
|
||||||
BLI_insertlinkafter(&area->regionbase, region_prev, region);
|
|
||||||
region->regiontype = RGN_TYPE_EXECUTE;
|
|
||||||
region->alignment = RGN_ALIGN_BOTTOM;
|
|
||||||
region->flag = RGN_FLAG_DYNAMIC_SIZE;
|
|
||||||
|
|
||||||
return region;
|
|
||||||
}
|
|
||||||
|
|
||||||
static ARegion *file_tool_props_region_ensure(ScrArea *area, ARegion *region_prev)
|
|
||||||
{
|
|
||||||
ARegion *region;
|
|
||||||
|
|
||||||
if ((region = BKE_area_find_region_type(area, RGN_TYPE_TOOL_PROPS)) != NULL) {
|
|
||||||
return region;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* add subdiv level; after execute region */
|
|
||||||
region = MEM_callocN(sizeof(ARegion), "tool props for file");
|
|
||||||
BLI_insertlinkafter(&area->regionbase, region_prev, region);
|
|
||||||
region->regiontype = RGN_TYPE_TOOL_PROPS;
|
|
||||||
region->alignment = RGN_ALIGN_RIGHT;
|
|
||||||
region->flag = RGN_FLAG_HIDDEN;
|
|
||||||
|
|
||||||
return region;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ******************** default callbacks for file space ***************** */
|
/* ******************** default callbacks for file space ***************** */
|
||||||
|
|
||||||
static SpaceLink *file_create(const ScrArea *UNUSED(area), const Scene *UNUSED(scene))
|
static SpaceLink *file_create(const ScrArea *UNUSED(area), const Scene *UNUSED(scene))
|
||||||
|
@ -129,9 +77,21 @@ static SpaceLink *file_create(const ScrArea *UNUSED(area), const Scene *UNUSED(s
|
||||||
BLI_addtail(&sfile->regionbase, region);
|
BLI_addtail(&sfile->regionbase, region);
|
||||||
region->regiontype = RGN_TYPE_UI;
|
region->regiontype = RGN_TYPE_UI;
|
||||||
region->alignment = RGN_ALIGN_TOP;
|
region->alignment = RGN_ALIGN_TOP;
|
||||||
region->flag |= RGN_FLAG_DYNAMIC_SIZE;
|
region->flag = RGN_FLAG_DYNAMIC_SIZE;
|
||||||
|
|
||||||
/* Tool props and execute region are added as needed, see file_refresh(). */
|
/* execute region */
|
||||||
|
region = MEM_callocN(sizeof(ARegion), "execute region for file");
|
||||||
|
BLI_addtail(&sfile->regionbase, region);
|
||||||
|
region->regiontype = RGN_TYPE_EXECUTE;
|
||||||
|
region->alignment = RGN_ALIGN_BOTTOM;
|
||||||
|
region->flag = RGN_FLAG_DYNAMIC_SIZE;
|
||||||
|
|
||||||
|
/* tools props region */
|
||||||
|
region = MEM_callocN(sizeof(ARegion), "tool props for file");
|
||||||
|
BLI_addtail(&sfile->regionbase, region);
|
||||||
|
region->regiontype = RGN_TYPE_TOOL_PROPS;
|
||||||
|
region->alignment = RGN_ALIGN_RIGHT;
|
||||||
|
region->flag = RGN_FLAG_HIDDEN;
|
||||||
|
|
||||||
/* main region */
|
/* main region */
|
||||||
region = MEM_callocN(sizeof(ARegion), "main region for file");
|
region = MEM_callocN(sizeof(ARegion), "main region for file");
|
||||||
|
@ -231,69 +191,6 @@ static SpaceLink *file_duplicate(SpaceLink *sl)
|
||||||
return (SpaceLink *)sfilen;
|
return (SpaceLink *)sfilen;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void file_ensure_valid_region_state(bContext *C,
|
|
||||||
wmWindowManager *wm,
|
|
||||||
wmWindow *win,
|
|
||||||
ScrArea *area,
|
|
||||||
SpaceFile *sfile,
|
|
||||||
FileSelectParams *params)
|
|
||||||
{
|
|
||||||
ARegion *region_tools = BKE_area_find_region_type(area, RGN_TYPE_TOOLS);
|
|
||||||
bool needs_init = false; /* To avoid multiple ED_area_init() calls. */
|
|
||||||
|
|
||||||
BLI_assert(region_tools);
|
|
||||||
|
|
||||||
if (sfile->browse_mode == FILE_BROWSE_MODE_ASSETS) {
|
|
||||||
file_tool_props_region_ensure(area, region_tools);
|
|
||||||
|
|
||||||
ARegion *region_execute = BKE_area_find_region_type(area, RGN_TYPE_EXECUTE);
|
|
||||||
if (region_execute) {
|
|
||||||
ED_region_remove(C, area, region_execute);
|
|
||||||
needs_init = true;
|
|
||||||
}
|
|
||||||
ARegion *region_ui = BKE_area_find_region_type(area, RGN_TYPE_UI);
|
|
||||||
if (region_ui) {
|
|
||||||
ED_region_remove(C, area, region_ui);
|
|
||||||
needs_init = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/* If there's an file-operation, ensure we have the option and execute region */
|
|
||||||
else if (sfile->op && !BKE_area_find_region_type(area, RGN_TYPE_TOOL_PROPS)) {
|
|
||||||
ARegion *region_ui = file_ui_region_ensure(area, region_tools);
|
|
||||||
ARegion *region_execute = file_execute_region_ensure(area, region_ui);
|
|
||||||
ARegion *region_props = file_tool_props_region_ensure(area, region_execute);
|
|
||||||
|
|
||||||
if (params->flag & FILE_HIDE_TOOL_PROPS) {
|
|
||||||
region_props->flag |= RGN_FLAG_HIDDEN;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
region_props->flag &= ~RGN_FLAG_HIDDEN;
|
|
||||||
}
|
|
||||||
|
|
||||||
needs_init = true;
|
|
||||||
}
|
|
||||||
/* If there's _no_ file-operation, ensure we _don't_ have the option and execute region */
|
|
||||||
else if (!sfile->op) {
|
|
||||||
ARegion *region_props = BKE_area_find_region_type(area, RGN_TYPE_TOOL_PROPS);
|
|
||||||
ARegion *region_execute = BKE_area_find_region_type(area, RGN_TYPE_EXECUTE);
|
|
||||||
ARegion *region_ui = file_ui_region_ensure(area, region_tools);
|
|
||||||
UNUSED_VARS(region_ui);
|
|
||||||
|
|
||||||
if (region_execute) {
|
|
||||||
ED_region_remove(C, area, region_execute);
|
|
||||||
needs_init = true;
|
|
||||||
}
|
|
||||||
if (region_props) {
|
|
||||||
ED_region_remove(C, area, region_props);
|
|
||||||
needs_init = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (needs_init) {
|
|
||||||
ED_area_init(wm, win, area);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void file_refresh(const bContext *C, ScrArea *area)
|
static void file_refresh(const bContext *C, ScrArea *area)
|
||||||
{
|
{
|
||||||
wmWindowManager *wm = CTX_wm_manager(C);
|
wmWindowManager *wm = CTX_wm_manager(C);
|
||||||
|
@ -389,9 +286,26 @@ static void file_refresh(const bContext *C, ScrArea *area)
|
||||||
sfile->layout->dirty = true;
|
sfile->layout->dirty = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Might be called with NULL area, see file_main_region_draw() below. */
|
|
||||||
if (area) {
|
if (area) {
|
||||||
file_ensure_valid_region_state((bContext *)C, wm, win, area, sfile, params);
|
ARegion *region_props = BKE_area_find_region_type(area, RGN_TYPE_TOOL_PROPS);
|
||||||
|
const bool region_flag_old = region_props->flag;
|
||||||
|
if (!(region_props->v2d.flag & V2D_IS_INIT)) {
|
||||||
|
if (ED_fileselect_is_asset_browser(sfile)) {
|
||||||
|
/* Hide by default in asset browser. */
|
||||||
|
region_props->flag |= RGN_FLAG_HIDDEN;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (params->flag & FILE_HIDE_TOOL_PROPS) {
|
||||||
|
region_props->flag |= RGN_FLAG_HIDDEN;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
region_props->flag &= ~RGN_FLAG_HIDDEN;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (region_flag_old != region_props->flag) {
|
||||||
|
ED_region_visibility_change_update((bContext *)C, area, region_props);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ED_area_tag_redraw(area);
|
ED_area_tag_redraw(area);
|
||||||
|
@ -714,6 +628,25 @@ static void file_keymap(struct wmKeyConfig *keyconf)
|
||||||
WM_keymap_ensure(keyconf, "File Browser Buttons", SPACE_FILE, 0);
|
WM_keymap_ensure(keyconf, "File Browser Buttons", SPACE_FILE, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool file_ui_region_poll(const RegionPollParams *params)
|
||||||
|
{
|
||||||
|
const SpaceFile *sfile = (SpaceFile *)params->area->spacedata.first;
|
||||||
|
/* Always visible except when browsing assets. */
|
||||||
|
return sfile->browse_mode != FILE_BROWSE_MODE_ASSETS;
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool file_tool_props_region_poll(const RegionPollParams *params)
|
||||||
|
{
|
||||||
|
const SpaceFile *sfile = (SpaceFile *)params->area->spacedata.first;
|
||||||
|
return (sfile->browse_mode == FILE_BROWSE_MODE_ASSETS) || (sfile->op != NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool file_execution_region_poll(const RegionPollParams *params)
|
||||||
|
{
|
||||||
|
const SpaceFile *sfile = (SpaceFile *)params->area->spacedata.first;
|
||||||
|
return sfile->op != NULL;
|
||||||
|
}
|
||||||
|
|
||||||
static void file_tools_region_init(wmWindowManager *wm, ARegion *region)
|
static void file_tools_region_init(wmWindowManager *wm, ARegion *region)
|
||||||
{
|
{
|
||||||
wmKeyMap *keymap;
|
wmKeyMap *keymap;
|
||||||
|
@ -869,6 +802,10 @@ static int file_space_subtype_get(ScrArea *area)
|
||||||
static void file_space_subtype_set(ScrArea *area, int value)
|
static void file_space_subtype_set(ScrArea *area, int value)
|
||||||
{
|
{
|
||||||
SpaceFile *sfile = area->spacedata.first;
|
SpaceFile *sfile = area->spacedata.first;
|
||||||
|
/* Force re-init. */
|
||||||
|
LISTBASE_FOREACH (ARegion *, region, &area->regionbase) {
|
||||||
|
region->v2d.flag &= ~V2D_IS_INIT;
|
||||||
|
}
|
||||||
sfile->browse_mode = value;
|
sfile->browse_mode = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1085,6 +1022,7 @@ void ED_spacetype_file(void)
|
||||||
art = MEM_callocN(sizeof(ARegionType), "spacetype file region");
|
art = MEM_callocN(sizeof(ARegionType), "spacetype file region");
|
||||||
art->regionid = RGN_TYPE_UI;
|
art->regionid = RGN_TYPE_UI;
|
||||||
art->keymapflag = ED_KEYMAP_UI;
|
art->keymapflag = ED_KEYMAP_UI;
|
||||||
|
art->poll = file_ui_region_poll;
|
||||||
art->listener = file_ui_region_listener;
|
art->listener = file_ui_region_listener;
|
||||||
art->init = file_ui_region_init;
|
art->init = file_ui_region_init;
|
||||||
art->draw = file_ui_region_draw;
|
art->draw = file_ui_region_draw;
|
||||||
|
@ -1094,6 +1032,7 @@ void ED_spacetype_file(void)
|
||||||
art = MEM_callocN(sizeof(ARegionType), "spacetype file region");
|
art = MEM_callocN(sizeof(ARegionType), "spacetype file region");
|
||||||
art->regionid = RGN_TYPE_EXECUTE;
|
art->regionid = RGN_TYPE_EXECUTE;
|
||||||
art->keymapflag = ED_KEYMAP_UI;
|
art->keymapflag = ED_KEYMAP_UI;
|
||||||
|
art->poll = file_execution_region_poll;
|
||||||
art->listener = file_ui_region_listener;
|
art->listener = file_ui_region_listener;
|
||||||
art->init = file_execution_region_init;
|
art->init = file_execution_region_init;
|
||||||
art->draw = file_execution_region_draw;
|
art->draw = file_execution_region_draw;
|
||||||
|
@ -1118,6 +1057,7 @@ void ED_spacetype_file(void)
|
||||||
art->prefsizex = 240;
|
art->prefsizex = 240;
|
||||||
art->prefsizey = 60;
|
art->prefsizey = 60;
|
||||||
art->keymapflag = ED_KEYMAP_UI;
|
art->keymapflag = ED_KEYMAP_UI;
|
||||||
|
art->poll = file_tool_props_region_poll;
|
||||||
art->listener = file_tool_props_region_listener;
|
art->listener = file_tool_props_region_listener;
|
||||||
art->init = file_tools_region_init;
|
art->init = file_tools_region_init;
|
||||||
art->draw = file_tools_region_draw;
|
art->draw = file_tools_region_draw;
|
||||||
|
|
|
@ -2073,7 +2073,7 @@ void IMAGE_OT_save_as(wmOperatorType *ot)
|
||||||
"copy",
|
"copy",
|
||||||
0,
|
0,
|
||||||
"Copy",
|
"Copy",
|
||||||
"Create a new image file without modifying the current image in blender");
|
"Create a new image file without modifying the current image in Blender");
|
||||||
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
|
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
|
||||||
|
|
||||||
image_operator_prop_allow_tokens(ot);
|
image_operator_prop_allow_tokens(ot);
|
||||||
|
|
|
@ -468,7 +468,7 @@ void SEQUENCER_OT_scene_strip_add(struct wmOperatorType *ot)
|
||||||
/* Identifiers. */
|
/* Identifiers. */
|
||||||
ot->name = "Add Scene Strip";
|
ot->name = "Add Scene Strip";
|
||||||
ot->idname = "SEQUENCER_OT_scene_strip_add";
|
ot->idname = "SEQUENCER_OT_scene_strip_add";
|
||||||
ot->description = "Add a strip to the sequencer using a blender scene as a source";
|
ot->description = "Add a strip to the sequencer using a Blender scene as a source";
|
||||||
|
|
||||||
/* Api callbacks. */
|
/* Api callbacks. */
|
||||||
ot->invoke = sequencer_add_scene_strip_invoke;
|
ot->invoke = sequencer_add_scene_strip_invoke;
|
||||||
|
|
|
@ -144,7 +144,6 @@ static SpaceLink *sequencer_create(const ScrArea *UNUSED(area), const Scene *sce
|
||||||
BLI_addtail(&sseq->regionbase, region);
|
BLI_addtail(&sseq->regionbase, region);
|
||||||
region->regiontype = RGN_TYPE_PREVIEW;
|
region->regiontype = RGN_TYPE_PREVIEW;
|
||||||
region->alignment = RGN_ALIGN_TOP;
|
region->alignment = RGN_ALIGN_TOP;
|
||||||
region->flag |= RGN_FLAG_HIDDEN;
|
|
||||||
/* For now, aspect ratio should be maintained, and zoom is clamped within sane default limits. */
|
/* For now, aspect ratio should be maintained, and zoom is clamped within sane default limits. */
|
||||||
region->v2d.keepzoom = V2D_KEEPASPECT | V2D_KEEPZOOM | V2D_LIMITZOOM;
|
region->v2d.keepzoom = V2D_KEEPASPECT | V2D_KEEPZOOM | V2D_LIMITZOOM;
|
||||||
region->v2d.minzoom = 0.001f;
|
region->v2d.minzoom = 0.001f;
|
||||||
|
@ -244,107 +243,46 @@ static void sequencer_refresh(const bContext *C, ScrArea *area)
|
||||||
bool view_changed = false;
|
bool view_changed = false;
|
||||||
|
|
||||||
switch (sseq->view) {
|
switch (sseq->view) {
|
||||||
case SEQ_VIEW_SEQUENCE:
|
|
||||||
if (region_main && (region_main->flag & RGN_FLAG_HIDDEN)) {
|
|
||||||
region_main->flag &= ~RGN_FLAG_HIDDEN;
|
|
||||||
region_main->v2d.flag &= ~V2D_IS_INIT;
|
|
||||||
view_changed = true;
|
|
||||||
}
|
|
||||||
if (region_preview && !(region_preview->flag & RGN_FLAG_HIDDEN)) {
|
|
||||||
region_preview->flag |= RGN_FLAG_HIDDEN;
|
|
||||||
region_preview->v2d.flag &= ~V2D_IS_INIT;
|
|
||||||
WM_event_remove_handlers((bContext *)C, ®ion_preview->handlers);
|
|
||||||
view_changed = true;
|
|
||||||
}
|
|
||||||
if (region_main && region_main->alignment != RGN_ALIGN_NONE) {
|
|
||||||
region_main->alignment = RGN_ALIGN_NONE;
|
|
||||||
view_changed = true;
|
|
||||||
}
|
|
||||||
if (region_preview && region_preview->alignment != RGN_ALIGN_NONE) {
|
|
||||||
region_preview->alignment = RGN_ALIGN_NONE;
|
|
||||||
view_changed = true;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case SEQ_VIEW_PREVIEW:
|
case SEQ_VIEW_PREVIEW:
|
||||||
if (region_main && !(region_main->flag & RGN_FLAG_HIDDEN)) {
|
/* Reset scrolling when preview region just appears. */
|
||||||
region_main->flag |= RGN_FLAG_HIDDEN;
|
if (!(region_preview->v2d.flag & V2D_IS_INIT)) {
|
||||||
region_main->v2d.flag &= ~V2D_IS_INIT;
|
|
||||||
WM_event_remove_handlers((bContext *)C, ®ion_main->handlers);
|
|
||||||
view_changed = true;
|
|
||||||
}
|
|
||||||
if (region_preview && (region_preview->flag & RGN_FLAG_HIDDEN)) {
|
|
||||||
region_preview->flag &= ~RGN_FLAG_HIDDEN;
|
|
||||||
region_preview->v2d.flag &= ~V2D_IS_INIT;
|
|
||||||
region_preview->v2d.cur = region_preview->v2d.tot;
|
region_preview->v2d.cur = region_preview->v2d.tot;
|
||||||
view_changed = true;
|
/* Only redraw, don't re-init. */
|
||||||
|
ED_area_tag_redraw(area);
|
||||||
}
|
}
|
||||||
if (region_main && region_main->alignment != RGN_ALIGN_NONE) {
|
if (region_preview->alignment != RGN_ALIGN_NONE) {
|
||||||
region_main->alignment = RGN_ALIGN_NONE;
|
|
||||||
view_changed = true;
|
|
||||||
}
|
|
||||||
if (region_preview && region_preview->alignment != RGN_ALIGN_NONE) {
|
|
||||||
region_preview->alignment = RGN_ALIGN_NONE;
|
region_preview->alignment = RGN_ALIGN_NONE;
|
||||||
view_changed = true;
|
view_changed = true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SEQ_VIEW_SEQUENCE_PREVIEW:
|
case SEQ_VIEW_SEQUENCE_PREVIEW: {
|
||||||
if (region_main && region_preview) {
|
/* Get available height (without DPI correction). */
|
||||||
/* Get available height (without DPI correction). */
|
const float height = (area->winy - ED_area_headersize()) / UI_SCALE_FAC;
|
||||||
const float height = (area->winy - ED_area_headersize()) / UI_SCALE_FAC;
|
|
||||||
|
|
||||||
/* We reuse hidden region's size, allows to find same layout as before if we just switch
|
/* We reuse hidden region's size, allows to find same layout as before if we just switch
|
||||||
* between one 'full window' view and the combined one. This gets lost if we switch to both
|
* between one 'full window' view and the combined one. This gets lost if we switch to both
|
||||||
* 'full window' views before, though... Better than nothing. */
|
* 'full window' views before, though... Better than nothing. */
|
||||||
if (region_main->flag & RGN_FLAG_HIDDEN) {
|
if (!(region_preview->v2d.flag & V2D_IS_INIT)) {
|
||||||
region_main->flag &= ~RGN_FLAG_HIDDEN;
|
region_preview->v2d.cur = region_preview->v2d.tot;
|
||||||
region_main->v2d.flag &= ~V2D_IS_INIT;
|
region_main->sizey = (int)(height - region_preview->sizey);
|
||||||
region_preview->sizey = (int)(height - region_main->sizey);
|
region_preview->sizey = (int)(height - region_main->sizey);
|
||||||
view_changed = true;
|
view_changed = true;
|
||||||
}
|
}
|
||||||
if (region_preview->flag & RGN_FLAG_HIDDEN) {
|
if (region_preview->alignment != RGN_ALIGN_TOP) {
|
||||||
region_preview->flag &= ~RGN_FLAG_HIDDEN;
|
region_preview->alignment = RGN_ALIGN_TOP;
|
||||||
region_preview->v2d.flag &= ~V2D_IS_INIT;
|
view_changed = true;
|
||||||
region_preview->v2d.cur = region_preview->v2d.tot;
|
}
|
||||||
region_main->sizey = (int)(height - region_preview->sizey);
|
/* Final check that both preview and main height are reasonable. */
|
||||||
view_changed = true;
|
if (region_preview->sizey < 10 || region_main->sizey < 10 ||
|
||||||
}
|
region_preview->sizey + region_main->sizey > height) {
|
||||||
if (region_main->alignment != RGN_ALIGN_NONE) {
|
region_preview->sizey = roundf(height * 0.4f);
|
||||||
region_main->alignment = RGN_ALIGN_NONE;
|
region_main->sizey = (int)(height - region_preview->sizey);
|
||||||
view_changed = true;
|
view_changed = true;
|
||||||
}
|
|
||||||
if (region_preview->alignment != RGN_ALIGN_TOP) {
|
|
||||||
region_preview->alignment = RGN_ALIGN_TOP;
|
|
||||||
view_changed = true;
|
|
||||||
}
|
|
||||||
/* Final check that both preview and main height are reasonable. */
|
|
||||||
if (region_preview->sizey < 10 || region_main->sizey < 10 ||
|
|
||||||
region_preview->sizey + region_main->sizey > height) {
|
|
||||||
region_preview->sizey = roundf(height * 0.4f);
|
|
||||||
region_main->sizey = (int)(height - region_preview->sizey);
|
|
||||||
view_changed = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
|
|
||||||
ARegion *region_channels = sequencer_find_region(area, RGN_TYPE_CHANNELS);
|
|
||||||
if (sseq->view == SEQ_VIEW_SEQUENCE) {
|
|
||||||
if (region_channels && region_channels->alignment != RGN_ALIGN_LEFT) {
|
|
||||||
region_channels->alignment = RGN_ALIGN_LEFT;
|
|
||||||
view_changed = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if (region_channels && !(region_channels->flag & RGN_FLAG_HIDDEN)) {
|
|
||||||
region_channels->flag |= RGN_FLAG_HIDDEN;
|
|
||||||
region_channels->v2d.flag &= ~V2D_IS_INIT;
|
|
||||||
WM_event_remove_handlers((bContext *)C, ®ion_channels->handlers);
|
|
||||||
view_changed = true;
|
|
||||||
}
|
|
||||||
if (region_channels && region_channels->alignment != RGN_ALIGN_NONE) {
|
|
||||||
region_channels->alignment = RGN_ALIGN_NONE;
|
|
||||||
view_changed = true;
|
|
||||||
}
|
}
|
||||||
|
case SEQ_VIEW_SEQUENCE:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (view_changed) {
|
if (view_changed) {
|
||||||
|
@ -501,6 +439,13 @@ static void sequencer_gizmos(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* *********************** sequencer (main) region ************************ */
|
/* *********************** sequencer (main) region ************************ */
|
||||||
|
|
||||||
|
static bool sequencer_main_region_poll(const RegionPollParams *params)
|
||||||
|
{
|
||||||
|
const SpaceSeq *sseq = (SpaceSeq *)params->area->spacedata.first;
|
||||||
|
return ELEM(sseq->view, SEQ_VIEW_SEQUENCE, SEQ_VIEW_SEQUENCE_PREVIEW);
|
||||||
|
}
|
||||||
|
|
||||||
/* Add handlers, stuff you only do once or on area/region changes. */
|
/* Add handlers, stuff you only do once or on area/region changes. */
|
||||||
static void sequencer_main_region_init(wmWindowManager *wm, ARegion *region)
|
static void sequencer_main_region_init(wmWindowManager *wm, ARegion *region)
|
||||||
{
|
{
|
||||||
|
@ -754,6 +699,13 @@ static void sequencer_tools_region_draw(const bContext *C, ARegion *region)
|
||||||
ED_region_panels(C, region);
|
ED_region_panels(C, region);
|
||||||
}
|
}
|
||||||
/* *********************** preview region ************************ */
|
/* *********************** preview region ************************ */
|
||||||
|
|
||||||
|
static bool sequencer_preview_region_poll(const RegionPollParams *params)
|
||||||
|
{
|
||||||
|
const SpaceSeq *sseq = (SpaceSeq *)params->area->spacedata.first;
|
||||||
|
return ELEM(sseq->view, SEQ_VIEW_PREVIEW, SEQ_VIEW_SEQUENCE_PREVIEW);
|
||||||
|
}
|
||||||
|
|
||||||
static void sequencer_preview_region_init(wmWindowManager *wm, ARegion *region)
|
static void sequencer_preview_region_init(wmWindowManager *wm, ARegion *region)
|
||||||
{
|
{
|
||||||
wmKeyMap *keymap;
|
wmKeyMap *keymap;
|
||||||
|
@ -976,6 +928,12 @@ static void sequencer_id_remap(ScrArea *UNUSED(area),
|
||||||
|
|
||||||
/* ************************************* */
|
/* ************************************* */
|
||||||
|
|
||||||
|
static bool sequencer_channel_region_poll(const RegionPollParams *params)
|
||||||
|
{
|
||||||
|
const SpaceSeq *sseq = (SpaceSeq *)params->area->spacedata.first;
|
||||||
|
return ELEM(sseq->view, SEQ_VIEW_SEQUENCE);
|
||||||
|
}
|
||||||
|
|
||||||
/* add handlers, stuff you only do once or on area/region changes */
|
/* add handlers, stuff you only do once or on area/region changes */
|
||||||
static void sequencer_channel_region_init(wmWindowManager *wm, ARegion *region)
|
static void sequencer_channel_region_init(wmWindowManager *wm, ARegion *region)
|
||||||
{
|
{
|
||||||
|
@ -1063,6 +1021,7 @@ void ED_spacetype_sequencer(void)
|
||||||
/* Main window. */
|
/* Main window. */
|
||||||
art = MEM_callocN(sizeof(ARegionType), "spacetype sequencer region");
|
art = MEM_callocN(sizeof(ARegionType), "spacetype sequencer region");
|
||||||
art->regionid = RGN_TYPE_WINDOW;
|
art->regionid = RGN_TYPE_WINDOW;
|
||||||
|
art->poll = sequencer_main_region_poll;
|
||||||
art->init = sequencer_main_region_init;
|
art->init = sequencer_main_region_init;
|
||||||
art->draw = sequencer_main_region_draw;
|
art->draw = sequencer_main_region_draw;
|
||||||
art->draw_overlay = sequencer_main_region_draw_overlay;
|
art->draw_overlay = sequencer_main_region_draw_overlay;
|
||||||
|
@ -1077,6 +1036,7 @@ void ED_spacetype_sequencer(void)
|
||||||
/* Preview. */
|
/* Preview. */
|
||||||
art = MEM_callocN(sizeof(ARegionType), "spacetype sequencer region");
|
art = MEM_callocN(sizeof(ARegionType), "spacetype sequencer region");
|
||||||
art->regionid = RGN_TYPE_PREVIEW;
|
art->regionid = RGN_TYPE_PREVIEW;
|
||||||
|
art->poll = sequencer_preview_region_poll;
|
||||||
art->init = sequencer_preview_region_init;
|
art->init = sequencer_preview_region_init;
|
||||||
art->layout = sequencer_preview_region_layout;
|
art->layout = sequencer_preview_region_layout;
|
||||||
art->on_view2d_changed = sequencer_preview_region_view2d_changed;
|
art->on_view2d_changed = sequencer_preview_region_view2d_changed;
|
||||||
|
@ -1115,6 +1075,7 @@ void ED_spacetype_sequencer(void)
|
||||||
art->regionid = RGN_TYPE_CHANNELS;
|
art->regionid = RGN_TYPE_CHANNELS;
|
||||||
art->prefsizex = UI_COMPACT_PANEL_WIDTH;
|
art->prefsizex = UI_COMPACT_PANEL_WIDTH;
|
||||||
art->keymapflag = ED_KEYMAP_UI;
|
art->keymapflag = ED_KEYMAP_UI;
|
||||||
|
art->poll = sequencer_channel_region_poll;
|
||||||
art->init = sequencer_channel_region_init;
|
art->init = sequencer_channel_region_init;
|
||||||
art->draw = sequencer_channel_region_draw;
|
art->draw = sequencer_channel_region_draw;
|
||||||
art->listener = sequencer_main_region_listener;
|
art->listener = sequencer_main_region_listener;
|
||||||
|
|
|
@ -3334,7 +3334,7 @@ void TEXT_OT_selection_set(wmOperatorType *ot)
|
||||||
/* identifiers */
|
/* identifiers */
|
||||||
ot->name = "Set Selection";
|
ot->name = "Set Selection";
|
||||||
ot->idname = "TEXT_OT_selection_set";
|
ot->idname = "TEXT_OT_selection_set";
|
||||||
ot->description = "Set cursor selection";
|
ot->description = "Set text selection";
|
||||||
|
|
||||||
/* api callbacks */
|
/* api callbacks */
|
||||||
ot->invoke = text_selection_set_invoke;
|
ot->invoke = text_selection_set_invoke;
|
||||||
|
|
|
@ -65,7 +65,7 @@ static SpaceLink *userpref_create(const ScrArea *area, const Scene *UNUSED(scene
|
||||||
BLI_addtail(&spref->regionbase, region);
|
BLI_addtail(&spref->regionbase, region);
|
||||||
region->regiontype = RGN_TYPE_EXECUTE;
|
region->regiontype = RGN_TYPE_EXECUTE;
|
||||||
region->alignment = RGN_ALIGN_BOTTOM | RGN_SPLIT_PREV;
|
region->alignment = RGN_ALIGN_BOTTOM | RGN_SPLIT_PREV;
|
||||||
region->flag |= RGN_FLAG_DYNAMIC_SIZE | RGN_FLAG_HIDDEN;
|
region->flag |= RGN_FLAG_DYNAMIC_SIZE;
|
||||||
|
|
||||||
/* main region */
|
/* main region */
|
||||||
region = MEM_callocN(sizeof(ARegion), "main region for userpref");
|
region = MEM_callocN(sizeof(ARegion), "main region for userpref");
|
||||||
|
@ -156,6 +156,12 @@ static void userpref_navigation_region_draw(const bContext *C, ARegion *region)
|
||||||
ED_region_panels(C, region);
|
ED_region_panels(C, region);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool userpref_execute_region_poll(const RegionPollParams *params)
|
||||||
|
{
|
||||||
|
const ARegion *region_header = BKE_area_find_region_type(params->area, RGN_TYPE_HEADER);
|
||||||
|
return !region_header->visible;
|
||||||
|
}
|
||||||
|
|
||||||
/* add handlers, stuff you only do once or on area/region changes */
|
/* add handlers, stuff you only do once or on area/region changes */
|
||||||
static void userpref_execute_region_init(wmWindowManager *wm, ARegion *region)
|
static void userpref_execute_region_init(wmWindowManager *wm, ARegion *region)
|
||||||
{
|
{
|
||||||
|
@ -229,6 +235,7 @@ void ED_spacetype_userpref(void)
|
||||||
art = MEM_callocN(sizeof(ARegionType), "spacetype userpref region");
|
art = MEM_callocN(sizeof(ARegionType), "spacetype userpref region");
|
||||||
art->regionid = RGN_TYPE_EXECUTE;
|
art->regionid = RGN_TYPE_EXECUTE;
|
||||||
art->prefsizey = HEADERY;
|
art->prefsizey = HEADERY;
|
||||||
|
art->poll = userpref_execute_region_poll;
|
||||||
art->init = userpref_execute_region_init;
|
art->init = userpref_execute_region_init;
|
||||||
art->layout = ED_region_panels_layout;
|
art->layout = ED_region_panels_layout;
|
||||||
art->draw = ED_region_panels_draw;
|
art->draw = ED_region_panels_draw;
|
||||||
|
|
|
@ -725,6 +725,9 @@ enum {
|
||||||
* region's layout pass. so that expansion is still interactive,
|
* region's layout pass. so that expansion is still interactive,
|
||||||
*/
|
*/
|
||||||
RGN_FLAG_SEARCH_FILTER_UPDATE = (1 << 9),
|
RGN_FLAG_SEARCH_FILTER_UPDATE = (1 << 9),
|
||||||
|
/** #ARegionType.poll() failed for the current context, and the region should be treated as if it
|
||||||
|
* wouldn't exist. Runtime only flag. */
|
||||||
|
RGN_FLAG_POLL_FAILED = (1 << 10),
|
||||||
};
|
};
|
||||||
|
|
||||||
/** #ARegion.do_draw */
|
/** #ARegion.do_draw */
|
||||||
|
|
|
@ -2007,7 +2007,7 @@ static void rna_def_curve_nurb(BlenderRNA *brna)
|
||||||
RNA_def_property_boolean_sdna(prop, NULL, "flagv", CU_NURB_ENDPOINT);
|
RNA_def_property_boolean_sdna(prop, NULL, "flagv", CU_NURB_ENDPOINT);
|
||||||
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
||||||
RNA_def_property_ui_text(
|
RNA_def_property_ui_text(
|
||||||
prop, "Endpoint V", "Make this nurbs surface meet the endpoints in the V direction ");
|
prop, "Endpoint V", "Make this nurbs surface meet the endpoints in the V direction");
|
||||||
RNA_def_property_update(prop, 0, "rna_Nurb_update_knot_v");
|
RNA_def_property_update(prop, 0, "rna_Nurb_update_knot_v");
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "use_bezier_u", PROP_BOOLEAN, PROP_NONE);
|
prop = RNA_def_property(srna, "use_bezier_u", PROP_BOOLEAN, PROP_NONE);
|
||||||
|
|
|
@ -139,19 +139,19 @@ static void rna_def_lightprobe(BlenderRNA *brna)
|
||||||
prop = RNA_def_property(srna, "grid_resolution_x", PROP_INT, PROP_NONE);
|
prop = RNA_def_property(srna, "grid_resolution_x", PROP_INT, PROP_NONE);
|
||||||
RNA_def_property_range(prop, 1, 256);
|
RNA_def_property_range(prop, 1, 256);
|
||||||
RNA_def_property_ui_text(
|
RNA_def_property_ui_text(
|
||||||
prop, "Resolution X", "Number of sample along the x axis of the volume");
|
prop, "Resolution X", "Number of samples along the x axis of the volume");
|
||||||
RNA_def_property_update(prop, NC_MATERIAL | ND_SHADING, "rna_LightProbe_recalc");
|
RNA_def_property_update(prop, NC_MATERIAL | ND_SHADING, "rna_LightProbe_recalc");
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "grid_resolution_y", PROP_INT, PROP_NONE);
|
prop = RNA_def_property(srna, "grid_resolution_y", PROP_INT, PROP_NONE);
|
||||||
RNA_def_property_range(prop, 1, 256);
|
RNA_def_property_range(prop, 1, 256);
|
||||||
RNA_def_property_ui_text(
|
RNA_def_property_ui_text(
|
||||||
prop, "Resolution Y", "Number of sample along the y axis of the volume");
|
prop, "Resolution Y", "Number of samples along the y axis of the volume");
|
||||||
RNA_def_property_update(prop, NC_MATERIAL | ND_SHADING, "rna_LightProbe_recalc");
|
RNA_def_property_update(prop, NC_MATERIAL | ND_SHADING, "rna_LightProbe_recalc");
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "grid_resolution_z", PROP_INT, PROP_NONE);
|
prop = RNA_def_property(srna, "grid_resolution_z", PROP_INT, PROP_NONE);
|
||||||
RNA_def_property_range(prop, 1, 256);
|
RNA_def_property_range(prop, 1, 256);
|
||||||
RNA_def_property_ui_text(
|
RNA_def_property_ui_text(
|
||||||
prop, "Resolution Z", "Number of sample along the z axis of the volume");
|
prop, "Resolution Z", "Number of samples along the z axis of the volume");
|
||||||
RNA_def_property_update(prop, NC_MATERIAL | ND_SHADING, "rna_LightProbe_recalc");
|
RNA_def_property_update(prop, NC_MATERIAL | ND_SHADING, "rna_LightProbe_recalc");
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "visibility_buffer_bias", PROP_FLOAT, PROP_NONE);
|
prop = RNA_def_property(srna, "visibility_buffer_bias", PROP_FLOAT, PROP_NONE);
|
||||||
|
|
|
@ -110,7 +110,7 @@ static const EnumPropertyItem rna_enum_rigidbody_constraint_spring_type_items[]
|
||||||
"SPRING1",
|
"SPRING1",
|
||||||
ICON_NONE,
|
ICON_NONE,
|
||||||
"Blender 2.7",
|
"Blender 2.7",
|
||||||
"Spring implementation used in blender 2.7. Damping is capped at 1.0"},
|
"Spring implementation used in Blender 2.7. Damping is capped at 1.0"},
|
||||||
{RBC_SPRING_TYPE2,
|
{RBC_SPRING_TYPE2,
|
||||||
"SPRING2",
|
"SPRING2",
|
||||||
ICON_NONE,
|
ICON_NONE,
|
||||||
|
|
|
@ -3784,7 +3784,7 @@ static void rna_def_sequencer_tool_settings(BlenderRNA *brna)
|
||||||
};
|
};
|
||||||
|
|
||||||
static const EnumPropertyItem scale_overlap_modes[] = {
|
static const EnumPropertyItem scale_overlap_modes[] = {
|
||||||
{SEQ_OVERLAP_EXPAND, "EXPAND", 0, "Expand", "Move strips so transformed strips fits"},
|
{SEQ_OVERLAP_EXPAND, "EXPAND", 0, "Expand", "Move strips so transformed strips fit"},
|
||||||
{SEQ_OVERLAP_OVERWRITE,
|
{SEQ_OVERLAP_OVERWRITE,
|
||||||
"OVERWRITE",
|
"OVERWRITE",
|
||||||
0,
|
0,
|
||||||
|
@ -4223,7 +4223,7 @@ static void rna_def_unit_settings(BlenderRNA *brna)
|
||||||
RNA_def_property_ui_text(
|
RNA_def_property_ui_text(
|
||||||
prop,
|
prop,
|
||||||
"Unit Scale",
|
"Unit Scale",
|
||||||
"Scale to use when converting between blender units and dimensions."
|
"Scale to use when converting between Blender units and dimensions."
|
||||||
" When working at microscopic or astronomical scale, a small or large unit scale"
|
" When working at microscopic or astronomical scale, a small or large unit scale"
|
||||||
" respectively can be used to avoid numerical precision problems");
|
" respectively can be used to avoid numerical precision problems");
|
||||||
RNA_def_property_range(prop, 1e-9f, 1e+9f);
|
RNA_def_property_range(prop, 1e-9f, 1e+9f);
|
||||||
|
@ -6644,7 +6644,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
|
||||||
RNA_def_property_float_sdna(prop, NULL, "bake_biasdist");
|
RNA_def_property_float_sdna(prop, NULL, "bake_biasdist");
|
||||||
RNA_def_property_range(prop, 0.0, 1000.0);
|
RNA_def_property_range(prop, 0.0, 1000.0);
|
||||||
RNA_def_property_ui_text(
|
RNA_def_property_ui_text(
|
||||||
prop, "Bias", "Bias towards faces further away from the object (in blender units)");
|
prop, "Bias", "Bias towards faces further away from the object (in Blender units)");
|
||||||
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
|
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "use_bake_multires", PROP_BOOLEAN, PROP_NONE);
|
prop = RNA_def_property(srna, "use_bake_multires", PROP_BOOLEAN, PROP_NONE);
|
||||||
|
@ -7337,7 +7337,7 @@ static void rna_def_scene_eevee(BlenderRNA *brna)
|
||||||
prop = RNA_def_property(srna, "gi_diffuse_bounces", PROP_INT, PROP_NONE);
|
prop = RNA_def_property(srna, "gi_diffuse_bounces", PROP_INT, PROP_NONE);
|
||||||
RNA_def_property_ui_text(prop,
|
RNA_def_property_ui_text(prop,
|
||||||
"Diffuse Bounces",
|
"Diffuse Bounces",
|
||||||
"Number of time the light is reinjected inside light grids, "
|
"Number of times the light is reinjected inside light grids, "
|
||||||
"0 disable indirect diffuse light");
|
"0 disable indirect diffuse light");
|
||||||
RNA_def_property_range(prop, 0, INT_MAX);
|
RNA_def_property_range(prop, 0, INT_MAX);
|
||||||
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
|
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
|
||||||
|
@ -7801,8 +7801,8 @@ static void rna_def_scene_eevee(BlenderRNA *brna)
|
||||||
RNA_def_property_ui_text(prop,
|
RNA_def_property_ui_text(prop,
|
||||||
"Shadow Pool Size",
|
"Shadow Pool Size",
|
||||||
"Size of the shadow pool, "
|
"Size of the shadow pool, "
|
||||||
"bigger pool size allows for more shadows in the scene "
|
"a bigger pool size allows for more shadows in the scene "
|
||||||
"but might not fits into GPU memory");
|
"but might not fit into GPU memory");
|
||||||
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
|
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
|
||||||
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
|
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
|
||||||
|
|
||||||
|
|
|
@ -850,7 +850,7 @@ static void rna_def_sculpt(BlenderRNA *brna)
|
||||||
RNA_def_property_ui_text(prop,
|
RNA_def_property_ui_text(prop,
|
||||||
"Resolution",
|
"Resolution",
|
||||||
"Maximum edge length for dynamic topology sculpting (as divisor "
|
"Maximum edge length for dynamic topology sculpting (as divisor "
|
||||||
"of blender unit - higher value means smaller edge length)");
|
"of Blender unit - higher value means smaller edge length)");
|
||||||
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
|
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "use_smooth_shading", PROP_BOOLEAN, PROP_NONE);
|
prop = RNA_def_property(srna, "use_smooth_shading", PROP_BOOLEAN, PROP_NONE);
|
||||||
|
|
|
@ -2751,7 +2751,7 @@ static void rna_def_scene(BlenderRNA *brna)
|
||||||
|
|
||||||
srna = RNA_def_struct(brna, "SceneSequence", "Sequence");
|
srna = RNA_def_struct(brna, "SceneSequence", "Sequence");
|
||||||
RNA_def_struct_ui_text(
|
RNA_def_struct_ui_text(
|
||||||
srna, "Scene Sequence", "Sequence strip to used the rendered image of a scene");
|
srna, "Scene Sequence", "Sequence strip using the rendered image of a scene");
|
||||||
RNA_def_struct_sdna(srna, "Sequence");
|
RNA_def_struct_sdna(srna, "Sequence");
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "scene", PROP_POINTER, PROP_NONE);
|
prop = RNA_def_property(srna, "scene", PROP_POINTER, PROP_NONE);
|
||||||
|
@ -2762,7 +2762,7 @@ static void rna_def_scene(BlenderRNA *brna)
|
||||||
prop = RNA_def_property(srna, "scene_camera", PROP_POINTER, PROP_NONE);
|
prop = RNA_def_property(srna, "scene_camera", PROP_POINTER, PROP_NONE);
|
||||||
RNA_def_property_flag(prop, PROP_EDITABLE);
|
RNA_def_property_flag(prop, PROP_EDITABLE);
|
||||||
RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Camera_object_poll");
|
RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Camera_object_poll");
|
||||||
RNA_def_property_ui_text(prop, "Camera Override", "Override the scenes active camera");
|
RNA_def_property_ui_text(prop, "Camera Override", "Override the scene's active camera");
|
||||||
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
|
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "scene_input", PROP_ENUM, PROP_NONE);
|
prop = RNA_def_property(srna, "scene_input", PROP_ENUM, PROP_NONE);
|
||||||
|
@ -2819,7 +2819,7 @@ static void rna_def_movie(BlenderRNA *brna)
|
||||||
prop = RNA_def_property(srna, "retiming_handles", PROP_COLLECTION, PROP_NONE);
|
prop = RNA_def_property(srna, "retiming_handles", PROP_COLLECTION, PROP_NONE);
|
||||||
RNA_def_property_collection_sdna(prop, NULL, "retiming_handles", NULL);
|
RNA_def_property_collection_sdna(prop, NULL, "retiming_handles", NULL);
|
||||||
RNA_def_property_struct_type(prop, "RetimingHandle");
|
RNA_def_property_struct_type(prop, "RetimingHandle");
|
||||||
RNA_def_property_ui_text(prop, "Retiming Hndles", "");
|
RNA_def_property_ui_text(prop, "Retiming Handles", "");
|
||||||
RNA_def_property_collection_funcs(prop,
|
RNA_def_property_collection_funcs(prop,
|
||||||
"rna_SequenceEditor_retiming_handles_begin",
|
"rna_SequenceEditor_retiming_handles_begin",
|
||||||
"rna_iterator_array_next",
|
"rna_iterator_array_next",
|
||||||
|
|
|
@ -5099,7 +5099,9 @@ static void rna_def_space_view3d(BlenderRNA *brna)
|
||||||
RNA_def_property_struct_type(prop, "RegionView3D");
|
RNA_def_property_struct_type(prop, "RegionView3D");
|
||||||
RNA_def_property_pointer_funcs(prop, "rna_SpaceView3D_region_3d_get", NULL, NULL, NULL);
|
RNA_def_property_pointer_funcs(prop, "rna_SpaceView3D_region_3d_get", NULL, NULL, NULL);
|
||||||
RNA_def_property_ui_text(
|
RNA_def_property_ui_text(
|
||||||
prop, "3D Region", "3D region in this space, in case of quad view the camera region");
|
prop,
|
||||||
|
"3D Region",
|
||||||
|
"3D region for this space. When the space is in quad view, the camera region");
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "region_quadviews", PROP_COLLECTION, PROP_NONE);
|
prop = RNA_def_property(srna, "region_quadviews", PROP_COLLECTION, PROP_NONE);
|
||||||
RNA_def_property_struct_type(prop, "RegionView3D");
|
RNA_def_property_struct_type(prop, "RegionView3D");
|
||||||
|
@ -5303,9 +5305,9 @@ static void rna_def_space_view3d(BlenderRNA *brna)
|
||||||
RNA_def_property_ui_text(
|
RNA_def_property_ui_text(
|
||||||
prop,
|
prop,
|
||||||
"Is Axis Aligned",
|
"Is Axis Aligned",
|
||||||
"Is current view aligned to an axis "
|
"Whether the current view is aligned to an axis "
|
||||||
"(does not check the view is orthographic use \"is_perspective\" for that). "
|
"(does not check whether the view is orthographic, use \"is_perspective\" for that). "
|
||||||
"Assignment sets the \"view_rotation\" to the closest axis aligned view");
|
"Setting this will rotate the view to the closest axis");
|
||||||
|
|
||||||
/* This isn't directly accessible from the UI, only an operator. */
|
/* This isn't directly accessible from the UI, only an operator. */
|
||||||
prop = RNA_def_property(srna, "use_clip_planes", PROP_BOOLEAN, PROP_NONE);
|
prop = RNA_def_property(srna, "use_clip_planes", PROP_BOOLEAN, PROP_NONE);
|
||||||
|
@ -6768,7 +6770,7 @@ static void rna_def_fileselect_params(BlenderRNA *brna)
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "use_library_browsing", PROP_BOOLEAN, PROP_NONE);
|
prop = RNA_def_property(srna, "use_library_browsing", PROP_BOOLEAN, PROP_NONE);
|
||||||
RNA_def_property_ui_text(
|
RNA_def_property_ui_text(
|
||||||
prop, "Library Browser", "Whether we may browse blender files' content or not");
|
prop, "Library Browser", "Whether we may browse Blender files' content or not");
|
||||||
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
||||||
RNA_def_property_boolean_funcs(prop, "rna_FileSelectParams_use_lib_get", NULL);
|
RNA_def_property_boolean_funcs(prop, "rna_FileSelectParams_use_lib_get", NULL);
|
||||||
|
|
||||||
|
|
|
@ -291,7 +291,7 @@ static StructRNA *rna_Panel_register(Main *bmain,
|
||||||
if ((1 << dummy_pt.space_type) & WM_TOOLSYSTEM_SPACE_MASK) {
|
if ((1 << dummy_pt.space_type) & WM_TOOLSYSTEM_SPACE_MASK) {
|
||||||
BKE_reportf(reports,
|
BKE_reportf(reports,
|
||||||
RPT_ERROR,
|
RPT_ERROR,
|
||||||
"%s '%s' has category '%s' ",
|
"%s '%s' has category '%s'",
|
||||||
error_prefix,
|
error_prefix,
|
||||||
dummy_pt.idname,
|
dummy_pt.idname,
|
||||||
dummy_pt.category);
|
dummy_pt.category);
|
||||||
|
|
|
@ -4872,8 +4872,8 @@ static void rna_def_userdef_view(BlenderRNA *brna)
|
||||||
RNA_def_property_enum_funcs(prop, NULL, "rna_userdef_timecode_style_set", NULL);
|
RNA_def_property_enum_funcs(prop, NULL, "rna_userdef_timecode_style_set", NULL);
|
||||||
RNA_def_property_ui_text(
|
RNA_def_property_ui_text(
|
||||||
prop,
|
prop,
|
||||||
"TimeCode Style",
|
"Timecode Style",
|
||||||
"Format of Time Codes displayed when not displaying timing in terms of frames");
|
"Format of timecodes displayed when not displaying timing in terms of frames");
|
||||||
RNA_def_property_update(prop, 0, "rna_userdef_update");
|
RNA_def_property_update(prop, 0, "rna_userdef_update");
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "view_frame_type", PROP_ENUM, PROP_NONE);
|
prop = RNA_def_property(srna, "view_frame_type", PROP_ENUM, PROP_NONE);
|
||||||
|
|
|
@ -1333,7 +1333,7 @@ static void rna_def_gizmo(BlenderRNA *brna, PropertyRNA *cprop)
|
||||||
RNA_api_gizmo(srna);
|
RNA_api_gizmo(srna);
|
||||||
|
|
||||||
srna = RNA_def_struct(brna, "GizmoProperties", NULL);
|
srna = RNA_def_struct(brna, "GizmoProperties", NULL);
|
||||||
RNA_def_struct_ui_text(srna, "Gizmo Properties", "Input properties of an Gizmo");
|
RNA_def_struct_ui_text(srna, "Gizmo Properties", "Input properties of a Gizmo");
|
||||||
RNA_def_struct_refine_func(srna, "rna_GizmoProperties_refine");
|
RNA_def_struct_refine_func(srna, "rna_GizmoProperties_refine");
|
||||||
RNA_def_struct_idprops_func(srna, "rna_GizmoProperties_idprops");
|
RNA_def_struct_idprops_func(srna, "rna_GizmoProperties_idprops");
|
||||||
RNA_def_struct_flag(srna, STRUCT_NO_DATABLOCK_IDPROPERTIES);
|
RNA_def_struct_flag(srna, STRUCT_NO_DATABLOCK_IDPROPERTIES);
|
||||||
|
|
|
@ -895,6 +895,9 @@ static void wm_draw_window_offscreen(bContext *C, wmWindow *win, bool stereo)
|
||||||
|
|
||||||
/* Compute UI layouts for dynamically size regions. */
|
/* Compute UI layouts for dynamically size regions. */
|
||||||
LISTBASE_FOREACH (ARegion *, region, &area->regionbase) {
|
LISTBASE_FOREACH (ARegion *, region, &area->regionbase) {
|
||||||
|
if (region->flag & RGN_FLAG_POLL_FAILED) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
/* Dynamic region may have been flagged as too small because their size on init is 0.
|
/* Dynamic region may have been flagged as too small because their size on init is 0.
|
||||||
* ARegion.visible is false then, as expected. The layout should still be created then, so
|
* ARegion.visible is false then, as expected. The layout should still be created then, so
|
||||||
* the region size can be updated (it may turn out to be not too small then). */
|
* the region size can be updated (it may turn out to be not too small then). */
|
||||||
|
@ -1380,7 +1383,7 @@ void wm_draw_update(bContext *C)
|
||||||
wm_window_make_drawable(wm, win);
|
wm_window_make_drawable(wm, win);
|
||||||
|
|
||||||
/* notifiers for screen redraw */
|
/* notifiers for screen redraw */
|
||||||
ED_screen_ensure_updated(wm, win, screen);
|
ED_screen_ensure_updated(C, wm, win, screen);
|
||||||
|
|
||||||
wm_draw_window(C, win);
|
wm_draw_window(C, win);
|
||||||
wm_draw_update_clear_window(C, win);
|
wm_draw_update_clear_window(C, win);
|
||||||
|
|
Loading…
Reference in New Issue