Merge branch 'blender-v3.4-release'

This commit is contained in:
Miguel Pozo 2022-11-07 15:30:49 +01:00
commit 95631c94c4
6 changed files with 51 additions and 34 deletions

View File

@ -189,7 +189,7 @@ int EEVEE_depth_of_field_init(EEVEE_ViewLayerData *UNUSED(sldata),
const DRWContextState *draw_ctx = DRW_context_state_get();
const Scene *scene_eval = DEG_get_evaluated_scene(draw_ctx->depsgraph);
Camera *cam = (camera != NULL) ? camera->data : NULL;
Camera *cam = (camera != NULL && camera->type == OB_CAMERA) ? camera->data : NULL;
if (cam && (cam->dof.flag & CAM_DOF_ENABLED)) {
RegionView3D *rv3d = draw_ctx->rv3d;

View File

@ -289,7 +289,7 @@ void GPENCIL_cache_init(void *ved)
DRW_shgroup_call_procedural_triangles(grp, NULL, 1);
}
Camera *cam = (pd->camera != NULL) ? pd->camera->data : NULL;
Camera *cam = (pd->camera != NULL && pd->camera->type == OB_CAMERA) ? pd->camera->data : NULL;
/* Pseudo DOF setup. */
if (cam && (cam->dof.flag & CAM_DOF_ENABLED)) {

View File

@ -128,7 +128,7 @@ void workbench_dof_engine_init(WORKBENCH_Data *vedata)
camera = wpd->cam_original_ob;
}
Camera *cam = camera != NULL ? camera->data : NULL;
Camera *cam = camera != NULL && camera->type == OB_CAMERA ? camera->data : NULL;
if ((wpd->shading.flag & V3D_SHADING_DEPTH_OF_FIELD) == 0 || (cam == NULL) ||
((cam->dof.flag & CAM_DOF_ENABLED) == 0)) {
wpd->dof_enabled = false;

View File

@ -114,8 +114,11 @@ static AssetItemTree build_catalog_tree(const bContext &C, const bNodeTree *node
if (BLI_uuid_is_nil(meta_data.catalog_id)) {
return true;
}
const LibraryCatalog &library_catalog = id_to_catalog_map.lookup(meta_data.catalog_id);
assets_per_path.add(library_catalog.catalog->path, LibraryAsset{library_ref, asset});
const LibraryCatalog *library_catalog = id_to_catalog_map.lookup_ptr(meta_data.catalog_id);
if (library_catalog == nullptr) {
return true;
}
assets_per_path.add(library_catalog->catalog->path, LibraryAsset{library_ref, asset});
return true;
});
}

View File

@ -2425,21 +2425,13 @@ static bNodeSocket *rna_Node_inputs_new(ID *id,
const char *name,
const char *identifier)
{
if (ELEM(node->type, NODE_GROUP_INPUT, NODE_FRAME)) {
BKE_report(reports, RPT_ERROR, "Unable to create socket");
if (node->type != NODE_CUSTOM) {
BKE_report(reports, RPT_ERROR, "Cannot add socket to built-in node");
return NULL;
}
/* Adding an input to a group node is not working,
* simpler to add it to its underlying nodetree. */
if (ELEM(node->type, NODE_GROUP, NODE_CUSTOM_GROUP) && node->id != NULL) {
return rna_NodeTree_inputs_new((bNodeTree *)node->id, bmain, reports, type, name);
}
bNodeTree *ntree = (bNodeTree *)id;
bNodeSocket *sock;
sock = nodeAddSocket(ntree, node, SOCK_IN, type, identifier, name);
bNodeSocket *sock = nodeAddSocket(ntree, node, SOCK_IN, type, identifier, name);
if (sock == NULL) {
BKE_report(reports, RPT_ERROR, "Unable to create socket");
@ -2460,20 +2452,13 @@ static bNodeSocket *rna_Node_outputs_new(ID *id,
const char *name,
const char *identifier)
{
if (ELEM(node->type, NODE_GROUP_OUTPUT, NODE_FRAME)) {
BKE_report(reports, RPT_ERROR, "Unable to create socket");
if (node->type != NODE_CUSTOM) {
BKE_report(reports, RPT_ERROR, "Cannot add socket to built-in node");
return NULL;
}
/* Adding an output to a group node is not working,
* simpler to add it to its underlying nodetree. */
if (ELEM(node->type, NODE_GROUP, NODE_CUSTOM_GROUP) && node->id != NULL) {
return rna_NodeTree_outputs_new((bNodeTree *)node->id, bmain, reports, type, name);
}
bNodeTree *ntree = (bNodeTree *)id;
bNodeSocket *sock;
sock = nodeAddSocket(ntree, node, SOCK_OUT, type, identifier, name);
bNodeSocket *sock = nodeAddSocket(ntree, node, SOCK_OUT, type, identifier, name);
if (sock == NULL) {
BKE_report(reports, RPT_ERROR, "Unable to create socket");
@ -2489,6 +2474,11 @@ static bNodeSocket *rna_Node_outputs_new(ID *id,
static void rna_Node_socket_remove(
ID *id, bNode *node, Main *bmain, ReportList *reports, bNodeSocket *sock)
{
if (node->type != NODE_CUSTOM) {
BKE_report(reports, RPT_ERROR, "Unable to remove socket from built-in node");
return;
}
bNodeTree *ntree = (bNodeTree *)id;
if (BLI_findindex(&node->inputs, sock) == -1 && BLI_findindex(&node->outputs, sock) == -1) {
@ -2502,8 +2492,13 @@ static void rna_Node_socket_remove(
}
}
static void rna_Node_inputs_clear(ID *id, bNode *node, Main *bmain)
static void rna_Node_inputs_clear(ID *id, bNode *node, Main *bmain, ReportList *reports)
{
if (node->type != NODE_CUSTOM) {
BKE_report(reports, RPT_ERROR, "Unable to remove sockets from built-in node");
return;
}
bNodeTree *ntree = (bNodeTree *)id;
bNodeSocket *sock, *nextsock;
@ -2516,8 +2511,13 @@ static void rna_Node_inputs_clear(ID *id, bNode *node, Main *bmain)
WM_main_add_notifier(NC_NODE | NA_EDITED, ntree);
}
static void rna_Node_outputs_clear(ID *id, bNode *node, Main *bmain)
static void rna_Node_outputs_clear(ID *id, bNode *node, Main *bmain, ReportList *reports)
{
if (node->type != NODE_CUSTOM) {
BKE_report(reports, RPT_ERROR, "Unable to remove socket from built-in node");
return;
}
bNodeTree *ntree = (bNodeTree *)id;
bNodeSocket *sock, *nextsock;
@ -2530,8 +2530,14 @@ static void rna_Node_outputs_clear(ID *id, bNode *node, Main *bmain)
WM_main_add_notifier(NC_NODE | NA_EDITED, ntree);
}
static void rna_Node_inputs_move(ID *id, bNode *node, Main *bmain, int from_index, int to_index)
static void rna_Node_inputs_move(
ID *id, bNode *node, Main *bmain, ReportList *reports, int from_index, int to_index)
{
if (node->type != NODE_CUSTOM) {
BKE_report(reports, RPT_ERROR, "Unable to move sockets in built-in node");
return;
}
bNodeTree *ntree = (bNodeTree *)id;
bNodeSocket *sock;
@ -2562,8 +2568,14 @@ static void rna_Node_inputs_move(ID *id, bNode *node, Main *bmain, int from_inde
WM_main_add_notifier(NC_NODE | NA_EDITED, ntree);
}
static void rna_Node_outputs_move(ID *id, bNode *node, Main *bmain, int from_index, int to_index)
static void rna_Node_outputs_move(
ID *id, bNode *node, Main *bmain, ReportList *reports, int from_index, int to_index)
{
if (node->type != NODE_CUSTOM) {
BKE_report(reports, RPT_ERROR, "Unable to move sockets in built-in node");
return;
}
bNodeTree *ntree = (bNodeTree *)id;
bNodeSocket *sock;
@ -7042,11 +7054,11 @@ static void rna_def_cmp_output_file_slots_api(BlenderRNA *brna,
func = RNA_def_function(srna, "clear", "rna_Node_inputs_clear");
RNA_def_function_ui_description(func, "Remove all file slots from this node");
RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_USE_MAIN);
RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_USE_MAIN | FUNC_USE_REPORTS);
func = RNA_def_function(srna, "move", "rna_Node_inputs_move");
RNA_def_function_ui_description(func, "Move a file slot to another position");
RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_USE_MAIN);
RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_USE_MAIN | FUNC_USE_REPORTS);
parm = RNA_def_int(
func, "from_index", -1, 0, INT_MAX, "From Index", "Index of the socket to move", 0, 10000);
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
@ -12121,11 +12133,11 @@ static void rna_def_node_sockets_api(BlenderRNA *brna, PropertyRNA *cprop, int i
func = RNA_def_function(srna, "clear", clearfunc);
RNA_def_function_ui_description(func, "Remove all sockets from this node");
RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_USE_MAIN);
RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_USE_MAIN | FUNC_USE_REPORTS);
func = RNA_def_function(srna, "move", movefunc);
RNA_def_function_ui_description(func, "Move a socket to another position");
RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_USE_MAIN);
RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_USE_MAIN | FUNC_USE_REPORTS);
parm = RNA_def_int(
func, "from_index", -1, 0, INT_MAX, "From Index", "Index of the socket to move", 0, 10000);
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);

View File

@ -19,6 +19,8 @@ static void node_geo_exec(GeoNodeExecParams params)
{
GeometrySet geometry_set = params.extract_input<GeometrySet>("Curve");
GeometryComponentEditData::remember_deformed_curve_positions_if_necessary(geometry_set);
geometry_set.modify_geometry_sets([&](GeometrySet &geometry_set) {
if (!geometry_set.has_curves()) {
return;