Merge branch 'blender-v4.5-release'
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
#include "BKE_action.hh"
|
||||
#include "BKE_context.hh"
|
||||
#include "BKE_layer.hh"
|
||||
#include "BKE_lib_id.hh"
|
||||
#include "BKE_object.hh"
|
||||
|
||||
#include "DNA_armature_types.h"
|
||||
@@ -120,7 +121,9 @@ static bool WIDGETGROUP_armature_spline_poll(const bContext *C, wmGizmoGroupType
|
||||
if (arm->drawtype == ARM_DRAW_TYPE_B_BONE) {
|
||||
bPoseChannel *pchan = BKE_pose_channel_active_if_bonecoll_visible(ob);
|
||||
if (pchan && pchan->bone->segments > 1) {
|
||||
return true;
|
||||
if (BKE_id_is_editable(CTX_data_main(C), &arm->id)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include "BKE_context.hh"
|
||||
#include "BKE_image.hh"
|
||||
#include "BKE_layer.hh"
|
||||
#include "BKE_lib_id.hh"
|
||||
#include "BKE_object.hh"
|
||||
|
||||
#include "DEG_depsgraph.hh"
|
||||
@@ -108,10 +109,14 @@ static bool WIDGETGROUP_empty_image_poll(const bContext *C, wmGizmoGroupType * /
|
||||
BKE_view_layer_synced_ensure(scene, view_layer);
|
||||
Base *base = BKE_view_layer_active_base_get(view_layer);
|
||||
if (base && BASE_SELECTABLE(v3d, base)) {
|
||||
Object *ob = base->object;
|
||||
const Object *ob = base->object;
|
||||
if (ob->type == OB_EMPTY) {
|
||||
if (ob->empty_drawtype == OB_EMPTY_IMAGE) {
|
||||
return BKE_object_empty_image_frame_is_visible_in_view3d(ob, rv3d);
|
||||
if (BKE_object_empty_image_frame_is_visible_in_view3d(ob, rv3d)) {
|
||||
if (BKE_id_is_editable(CTX_data_main(C), &ob->id)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
#include "BKE_context.hh"
|
||||
#include "BKE_layer.hh"
|
||||
#include "BKE_lib_id.hh"
|
||||
|
||||
#include "DNA_object_force_types.h"
|
||||
#include "DNA_object_types.h"
|
||||
@@ -47,9 +48,11 @@ static bool WIDGETGROUP_forcefield_poll(const bContext *C, wmGizmoGroupType * /*
|
||||
BKE_view_layer_synced_ensure(scene, view_layer);
|
||||
Base *base = BKE_view_layer_active_base_get(view_layer);
|
||||
if (base && BASE_SELECTABLE(v3d, base)) {
|
||||
Object *ob = base->object;
|
||||
const Object *ob = base->object;
|
||||
if (ob->pd && ob->pd->forcefield) {
|
||||
return true;
|
||||
if (BKE_id_is_editable(CTX_data_main(C), &ob->id)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
#include "BKE_context.hh"
|
||||
#include "BKE_layer.hh"
|
||||
#include "BKE_lib_id.hh"
|
||||
|
||||
#include "DEG_depsgraph.hh"
|
||||
|
||||
@@ -151,10 +152,14 @@ static bool WIDGETGROUP_light_spot_poll(const bContext *C, wmGizmoGroupType * /*
|
||||
BKE_view_layer_synced_ensure(scene, view_layer);
|
||||
Base *base = BKE_view_layer_active_base_get(view_layer);
|
||||
if (base && BASE_SELECTABLE(v3d, base)) {
|
||||
Object *ob = base->object;
|
||||
const Object *ob = base->object;
|
||||
if (ob->type == OB_LAMP) {
|
||||
Light *la = static_cast<Light *>(ob->data);
|
||||
return (la->type == LA_SPOT);
|
||||
const Light *la = static_cast<Light *>(ob->data);
|
||||
if (la->type == LA_SPOT) {
|
||||
if (BKE_id_is_editable(CTX_data_main(C), &la->id)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
@@ -313,7 +318,11 @@ static bool WIDGETGROUP_light_point_poll(const bContext *C, wmGizmoGroupType * /
|
||||
const Object *ob = base->object;
|
||||
if (ob->type == OB_LAMP) {
|
||||
const Light *la = static_cast<const Light *>(ob->data);
|
||||
return (la->type == LA_LOCAL);
|
||||
if (la->type == LA_LOCAL) {
|
||||
if (BKE_id_is_editable(CTX_data_main(C), &la->id)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
@@ -433,10 +442,14 @@ static bool WIDGETGROUP_light_area_poll(const bContext *C, wmGizmoGroupType * /*
|
||||
BKE_view_layer_synced_ensure(scene, view_layer);
|
||||
Base *base = BKE_view_layer_active_base_get(view_layer);
|
||||
if (base && BASE_SELECTABLE(v3d, base)) {
|
||||
Object *ob = base->object;
|
||||
const Object *ob = base->object;
|
||||
if (ob->type == OB_LAMP) {
|
||||
Light *la = static_cast<Light *>(ob->data);
|
||||
return (la->type == LA_AREA);
|
||||
const Light *la = static_cast<Light *>(ob->data);
|
||||
if (la->type == LA_AREA) {
|
||||
if (BKE_id_is_editable(CTX_data_main(C), &la->id)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
@@ -523,16 +536,21 @@ static bool WIDGETGROUP_light_target_poll(const bContext *C, wmGizmoGroupType *
|
||||
BKE_view_layer_synced_ensure(scene, view_layer);
|
||||
Base *base = BKE_view_layer_active_base_get(view_layer);
|
||||
if (base && BASE_SELECTABLE(v3d, base)) {
|
||||
Object *ob = base->object;
|
||||
if (ob->type == OB_LAMP) {
|
||||
Light *la = static_cast<Light *>(ob->data);
|
||||
return ELEM(la->type, LA_SUN, LA_SPOT, LA_AREA);
|
||||
}
|
||||
const Object *ob = base->object;
|
||||
if (BKE_id_is_editable(CTX_data_main(C), &ob->id)) {
|
||||
if (ob->type == OB_LAMP) {
|
||||
/* No need to check the light is editable, only the object is transformed. */
|
||||
const Light *la = static_cast<Light *>(ob->data);
|
||||
if (ELEM(la->type, LA_SUN, LA_SPOT, LA_AREA)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
#if 0
|
||||
else if (ob->type == OB_CAMERA) {
|
||||
return true;
|
||||
}
|
||||
else if (ob->type == OB_CAMERA) {
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "BLI_math_rotation.h"
|
||||
|
||||
#include "BKE_context.hh"
|
||||
#include "BKE_lib_id.hh"
|
||||
#include "BKE_screen.hh"
|
||||
|
||||
#include "RNA_access.hh"
|
||||
@@ -1395,6 +1396,17 @@ static void WIDGETGROUP_placement_setup(const bContext * /*C*/, wmGizmoGroup *gz
|
||||
}
|
||||
}
|
||||
|
||||
static bool WIDGETGROUP_placement_poll(const bContext *C, wmGizmoGroupType *gzgt)
|
||||
{
|
||||
if (ED_gizmo_poll_or_unlink_delayed_from_tool(C, gzgt)) {
|
||||
const Scene *scene = CTX_data_scene(C);
|
||||
if (BKE_id_is_editable(CTX_data_main(C), &scene->id)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void VIEW3D_GGT_placement(wmGizmoGroupType *gzgt)
|
||||
{
|
||||
gzgt->name = "Placement Widget";
|
||||
@@ -1405,7 +1417,7 @@ void VIEW3D_GGT_placement(wmGizmoGroupType *gzgt)
|
||||
gzgt->gzmap_params.spaceid = SPACE_VIEW3D;
|
||||
gzgt->gzmap_params.regionid = RGN_TYPE_WINDOW;
|
||||
|
||||
gzgt->poll = ED_gizmo_poll_or_unlink_delayed_from_tool;
|
||||
gzgt->poll = WIDGETGROUP_placement_poll;
|
||||
gzgt->setup = WIDGETGROUP_placement_setup;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user