88 float location[3], bv_weight,
be_weight, skin[2], crease;
92 float location[3], weight,
b_weight, radius, tilt;
96 float location[3], weight;
109 float ob_obmat_orig[4][4];
110 float ob_dims_orig[3];
111 float ob_scale_orig[3];
117 #define TRANSFORM_MEDIAN_ARRAY_LEN (sizeof(TransformMedian) / sizeof(float))
126 if (ve_median <= 0.0f) {
129 if (ve_median >= 1.0f) {
134 float median_new = ve_median;
135 float median_orig = ve_median - median;
138 CLAMP(median_orig, 0.0f, 1.0f);
139 CLAMP(median_new, 0.0f, 1.0f);
141 if (median_new <= median_orig) {
143 return median_new / median_orig;
147 return -(1.0f - median_new) / (1.0f - median_orig);
156 static void apply_raw_diff(
float *val,
const int tot,
const float ve_median,
const float median)
158 *val = (tot == 1) ? ve_median : (*val + median);
163 const float ve_median[3],
164 const float median[3])
175 float *val,
const int tot,
const float ve_median,
const float median,
const float sca)
177 if (tot == 1 || ve_median == median) {
187 const float ve_median,
192 CLAMP(*val, 0.0f, 1.0f);
194 else if (
ELEM(sca, 0.0f, 1.0f)) {
198 *val = (sca > 0.0f) ? (*val * sca) : (1.0f + ((1.0f - *val) * sca));
199 CLAMP(*val, 0.0f, 1.0f);
207 "TransformProperties");
218 int tot, totedgedata, totcurvedata, totlattdata, totcurvebweight;
219 bool has_meshdata =
false;
220 bool has_skinradius =
false;
224 tot = totedgedata = totcurvedata = totlattdata = totcurvebweight = 0;
240 has_skinradius = (cd_vert_skin_offset != -1);
248 if (cd_vert_bweight_offset != -1) {
252 if (has_skinradius) {
260 if ((cd_edge_bweight_offset != -1) || (cd_edge_crease_offset != -1)) {
264 if (cd_edge_bweight_offset != -1) {
268 if (cd_edge_crease_offset != -1) {
281 has_meshdata = (tot || totedgedata);
325 a = nu->pntsu * nu->pntsv;
346 if (totcurvedata == 1) {
374 if (totlattdata == 1) {
383 IFACE_(
"Nothing selected"),
411 if (has_skinradius) {
417 else if (totcurvedata) {
419 if (totcurvebweight) {
426 else if (totlattdata) {
435 const int butw = 200;
437 const int but_margin = 2;
456 uiDefBut(block,
UI_BTYPE_LABEL, 0,
c, 0, yi -= buth, butw, buth,
NULL, 0, 0, 0, 0,
"");
513 if (totcurvebweight == tot) {
539 yi -= buth + but_margin,
547 TIP_(
"Displays global values"));
562 TIP_(
"Displays local values"));
572 tot == 1 ?
IFACE_(
"Vertex Data:") :
IFACE_(
"Vertices Data:"),
574 yi -= buth + but_margin,
587 tot == 1 ?
IFACE_(
"Bevel Weight:") :
IFACE_(
"Mean Bevel Weight:"),
589 yi -= buth + but_margin,
597 TIP_(
"Vertex weight used by Bevel modifier"));
601 if (has_skinradius) {
606 tot == 1 ?
IFACE_(
"Radius X:") :
IFACE_(
"Mean Radius X:"),
608 yi -= buth + but_margin,
616 TIP_(
"X radius used by Skin modifier"));
622 tot == 1 ?
IFACE_(
"Radius Y:") :
IFACE_(
"Mean Radius Y:"),
624 yi -= buth + but_margin,
632 TIP_(
"Y radius used by Skin modifier"));
641 totedgedata == 1 ?
IFACE_(
"Edge Data:") :
IFACE_(
"Edges Data:"),
643 yi -= buth + but_margin,
656 totedgedata == 1 ?
IFACE_(
"Bevel Weight:") :
IFACE_(
"Mean Bevel Weight:"),
658 yi -= buth + but_margin,
666 TIP_(
"Edge weight used by Bevel modifier"));
673 totedgedata == 1 ?
IFACE_(
"Crease:") :
IFACE_(
"Mean Crease:"),
675 yi -= buth + but_margin,
683 TIP_(
"Weight used by the Subdivision Surface modifier"));
689 else if (totcurvedata) {
691 if (totcurvedata == 1) {
697 yi -= buth + but_margin,
715 yi -= buth + but_margin,
733 yi -= buth + but_margin,
747 else if (totcurvedata > 1) {
753 yi -= buth + but_margin,
761 TIP_(
"Weight used for Soft Body Goal"));
769 yi -= buth + but_margin,
777 TIP_(
"Radius of curve control points"));
785 yi -= buth + but_margin,
793 TIP_(
"Tilt of curve control points"));
800 else if (totlattdata) {
802 if (totlattdata == 1) {
808 yi -= buth + but_margin,
822 else if (totlattdata > 1) {
828 yi -= buth + but_margin,
836 TIP_(
"Weight used for Soft Body Goal"));
853 (
float *)&ve_median_basis,
854 (
float *)&median_basis,
858 const bool apply_vcos = (tot == 1) || (
len_squared_v3(median_basis.generic.location) != 0.0f);
861 (apply_vcos || median_basis.mesh.bv_weight || median_basis.mesh.skin[0] ||
862 median_basis.mesh.skin[1] || median_basis.mesh.be_weight || median_basis.mesh.crease)) {
871 int cd_vert_bweight_offset = -1;
872 int cd_vert_skin_offset = -1;
873 int cd_edge_bweight_offset = -1;
874 int cd_edge_crease_offset = -1;
876 float scale_bv_weight = 1.0f;
877 float scale_skin[2] = {1.0f, 1.0f};
878 float scale_be_weight = 1.0f;
879 float scale_crease = 1.0f;
892 for (
int i = 0; i < 2; i++) {
893 if (median->
skin[i]) {
897 if (ve_median->skin[i] != median->
skin[i]) {
898 scale_skin[i] = ve_median->skin[i] / (ve_median->skin[i] - median->
skin[i]);
909 if (cd_vert_bweight_offset != -1) {
914 if (cd_vert_skin_offset != -1) {
918 for (
int i = 0; i < 2; i++) {
919 if (median->
skin[i] != 0.0f) {
921 &vs->
radius[i], tot, ve_median->skin[i], median->
skin[i], scale_skin[i]);
960 if (median->
crease != 0.0f) {
969 (apply_vcos || median_basis.curve.b_weight || median_basis.curve.weight ||
970 median_basis.curve.radius || median_basis.curve.tilt)) {
972 *ve_median = &ve_median_basis.curve;
982 for (
a = nu->pntsu, bezt = nu->bezt;
a--; bezt++) {
1003 else if (apply_vcos) {
1015 for (
a = nu->pntsu * nu->pntsv, bp = nu->bp;
a--; bp++) {
1041 else if ((ob->
type ==
OB_LATTICE) && (apply_vcos || median_basis.lattice.weight)) {
1043 *ve_median = &ve_median_basis.lattice;
1068 #undef TRANSFORM_MEDIAN_ARRAY_LEN
1078 const int butw = 200;
1101 const float lim = FLT_MAX;
1102 for (
int i = 0; i < 3; i++) {
1104 const char text[3] = {
'X' + i,
':',
'\0'};
1127 for (
int i = 0; i < 3; i++) {
1129 axis_mask |= (1 << i);
1142 #define B_VGRP_PNL_EDIT_SINGLE 8
1195 int subset_count, vgroup_tot;
1196 const bool *vgroup_validmap;
1212 ob, subset_type, &vgroup_tot, &subset_count);
1215 if (vgroup_validmap[i]) {
1239 if (ob->
actdef != i + 1) {
1272 icon = (locked) ? ICON_BLANK1 : ICON_PASTEDOWN;
1274 "OBJECT_OT_vertex_weight_paste",
1284 icon = (locked) ? ICON_LOCKED : ICON_X;
1286 "OBJECT_OT_vertex_weight_delete",
1317 TIP_(
"Normalize weights of active vertex (if affected groups are unlocked)"));
1333 TIP_(
"Copy active vertex to other selected vertices (if affected groups are unlocked)"));
1351 bone = boneptr.
data;
1358 uiItemL(colsub,
"", ICON_NONE);
1364 ICON_DECORATE_UNLOCKED);
1371 uiItemR(colsub,
ptr,
"rotation_quaternion", 0,
IFACE_(
"Rotation"), ICON_NONE);
1381 ICON_DECORATE_UNLOCKED);
1384 uiItemL(colsub,
"", ICON_NONE);
1391 ICON_DECORATE_UNLOCKED);
1395 uiItemR(colsub,
ptr,
"rotation_axis_angle", 0,
IFACE_(
"Rotation"), ICON_NONE);
1405 ICON_DECORATE_UNLOCKED);
1408 uiItemL(colsub,
"", ICON_NONE);
1415 ICON_DECORATE_UNLOCKED);
1422 uiItemL(colsub,
"", ICON_NONE);
1428 ICON_DECORATE_UNLOCKED);
1431 uiItemR(layout,
ptr,
"rotation_mode", 0,
"", ICON_NONE);
1438 uiItemL(colsub,
"", ICON_NONE);
1444 ICON_DECORATE_UNLOCKED);
1479 if (!ebone || (ebone->
layer & arm->
layer) == 0) {
1490 uiItemR(
col, &parptr,
"tail_radius", 0,
IFACE_(
"Radius (Parent)"), ICON_NONE);
1501 uiItemR(
col, &eboneptr,
"envelope_distance", 0,
IFACE_(
"Envelope"), ICON_NONE);
1510 if (!mball || !(mball->
lastelem)) {
1642 strcpy(pt->
idname,
"VIEW3D_PT_transform");
1643 strcpy(pt->
label,
N_(
"Transform"));
1651 strcpy(pt->
idname,
"VIEW3D_PT_vgroup");
1652 strcpy(pt->
label,
N_(
"Vertex Weights"));
1662 strcpy(mt->
idname,
"VIEW3D_MT_collection");
1663 strcpy(mt->
label,
N_(
"Collection"));
1687 ot->
name =
"Object Mode Menu";
1688 ot->
idname =
"VIEW3D_OT_object_mode_pie_or_toggle";
typedef float(TangentPoint)[2]
Blender kernel action and pose functionality.
struct bPoseChannel * BKE_pose_channel_active(struct Object *ob)
struct ScrArea * CTX_wm_area(const bContext *C)
struct Scene * CTX_data_scene(const bContext *C)
struct ViewLayer * CTX_data_view_layer(const bContext *C)
struct Object * CTX_data_active_object(const bContext *C)
struct View3D * CTX_wm_view3d(const bContext *C)
struct wmWindow * CTX_wm_window(const bContext *C)
struct ListBase * BKE_curve_editNurbs_get(struct Curve *cu)
void BKE_nurb_project_2d(struct Nurb *nu)
void BKE_nurb_handles_test(struct Nurb *nu, const bool use_handles, const bool use_around_local)
CustomData interface, see also DNA_customdata_types.h.
int CustomData_get_offset(const struct CustomData *data, int type)
void BKE_editmesh_looptri_calc(BMEditMesh *em)
General operations, lookup, etc. for blender objects.
void BKE_object_dimensions_get(struct Object *ob, float r_vec[3])
bool BKE_object_is_in_wpaint_select_vert(const struct Object *ob)
bool BKE_object_is_in_editmode_vgroup(const struct Object *ob)
void BKE_object_dimensions_set_ex(struct Object *ob, const float value[3], int axis_mask, const float ob_scale_orig[3], const float ob_obmat_orig[4][4])
void BKE_report(ReportList *reports, ReportType type, const char *message)
#define LISTBASE_FOREACH(type, var, list)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
bool invert_m4_m4(float R[4][4], const float A[4][4])
void mul_m4_v3(const float M[4][4], float r[3])
void copy_m4_m4(float m1[4][4], const float m2[4][4])
void copy_vn_fl(float *array_tar, const int size, const float val)
MINLINE float len_squared_v3(const float v[3]) ATTR_WARN_UNUSED_RESULT
void sub_vn_vnvn(float *array_tar, const float *array_src_a, const float *array_src_b, const int size)
MINLINE void mul_v3_fl(float r[3], float f)
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE void add_v2_v2(float r[2], const float a[2])
MINLINE void add_v3_v3(float r[3], const float a[3])
#define BLT_I18NCONTEXT_DEFAULT_BPYRNA
void DEG_id_tag_update(struct ID *id, int flag)
Object is a sort of wrapper for general info.
#define OB_TYPE_SUPPORT_EDITMODE(_type)
#define OBEDIT_FROM_OBACT(ob)
#define OBACT(_view_layer)
struct MDeformVert * ED_mesh_active_dvert_get_only(struct Object *ob)
void ED_vgroup_vert_active_mirror(struct Object *ob, int def_nr)
void EDBM_mesh_normals_update(struct BMEditMesh *em)
bool ED_object_mode_set(struct bContext *C, eObjectMode mode)
void ED_collection_hide_menu_draw(const struct bContext *C, struct uiLayout *layout)
void ED_area_tag_redraw(ScrArea *area)
bool ED_operator_view3d_active(struct bContext *C)
Read Guarded memory(de)allocation.
Group RGB to Bright Vector Camera CLAMP
StructRNA RNA_BezierSplinePoint
StructRNA RNA_SplinePoint
StructRNA RNA_MetaElement
StructRNA RNA_LatticePoint
StructRNA RNA_ToolSettings
#define RNA_TRANSLATION_PREC_DEFAULT
void uiLayoutSetActive(uiLayout *layout, bool active)
uiBlock * uiLayoutGetBlock(uiLayout *layout)
void uiLayoutSetEnabled(uiLayout *layout, bool enabled)
uiLayout * uiLayoutColumn(uiLayout *layout, bool align)
void uiItemFullO(uiLayout *layout, const char *opname, const char *name, int icon, struct IDProperty *properties, int context, int flag, struct PointerRNA *r_opptr)
uiBut * uiDefBut(uiBlock *block, int type, int retval, const char *str, int x, int y, short width, short height, void *poin, float min, float max, float a1, float a2, const char *tip)
uiBut * uiDefButF(uiBlock *block, int type, int retval, const char *str, int x, int y, short width, short height, float *poin, float min, float max, float a1, float a2, const char *tip)
struct PointerRNA * UI_but_operator_ptr_get(uiBut *but)
void uiItemL(uiLayout *layout, const char *name, int icon)
void UI_but_drawflag_enable(uiBut *but, int flag)
uiBlock * uiLayoutAbsoluteBlock(uiLayout *layout)
void UI_but_number_step_size_set(uiBut *but, float step_size)
void UI_block_func_handle_set(uiBlock *block, uiBlockHandleFunc func, void *arg)
uiLayout * uiLayoutRow(uiLayout *layout, bool align)
uiBut * uiDefButR(uiBlock *block, int type, int retval, const char *str, int x, int y, short width, short height, struct PointerRNA *ptr, const char *propname, int index, float min, float max, float a1, float a2, const char *tip)
void UI_but_unit_type_set(uiBut *but, const int unit_type)
void uiItemR(uiLayout *layout, struct PointerRNA *ptr, const char *propname, int flag, const char *name, int icon)
uiBut * uiDefButBitS(uiBlock *block, int type, int bit, int retval, const char *str, int x, int y, short width, short height, short *poin, float min, float max, float a1, float a2, const char *tip)
void UI_block_align_begin(uiBlock *block)
void uiLayoutSetEmboss(uiLayout *layout, eUIEmbossType emboss)
uiLayout * uiLayoutSplit(uiLayout *layout, float percentage, bool align)
void UI_but_number_precision_set(uiBut *but, float precision)
void UI_but_flag_enable(uiBut *but, int flag)
int UI_pie_menu_invoke(struct bContext *C, const char *idname, const struct wmEvent *event)
uiBut * uiDefButO_ptr(uiBlock *block, int type, struct wmOperatorType *ot, int opcontext, const char *str, int x, int y, short width, short height, const char *tip)
void UI_block_align_end(uiBlock *block)
#define BM_ELEM_CD_GET_FLOAT(ele, offset)
#define BM_ELEM_CD_GET_VOID_P(ele, offset)
#define BM_elem_flag_test(ele, hflag)
#define BM_ITER_MESH(ele, iter, bm, itype)
ATTR_WARN_UNUSED_RESULT BMesh * bm
void BM_mesh_cd_flag_ensure(BMesh *bm, Mesh *mesh, const char cd_flag)
void(* MEM_freeN)(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
void split(const std::string &s, const char delim, std::vector< std::string > &tokens)
void RNA_pointer_create(ID *id, StructRNA *type, void *data, PointerRNA *r_ptr)
PointerRNA RNA_pointer_get(PointerRNA *ptr, const char *name)
void RNA_id_pointer_create(ID *id, PointerRNA *r_ptr)
void RNA_int_set(PointerRNA *ptr, const char *name, int value)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
void RNA_property_update(bContext *C, PointerRNA *ptr, PropertyRNA *prop)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
int RNA_enum_get(PointerRNA *ptr, const char *name)
static const float tilt_limit
struct EditLatt * editlatt
struct BMEditMesh * edit_mesh
void(* draw)(const struct bContext *C, struct Panel *panel)
bool(* poll)(const struct bContext *C, struct PanelType *pt)
char idname[BKE_ST_MAXNAME]
char translation_context[BKE_ST_MAXNAME]
char category[BKE_ST_MAXNAME]
char label[BKE_ST_MAXNAME]
struct ToolSettings * toolsettings
void * properties_storage
struct EditBone * act_edbone
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
int(* exec)(struct bContext *, struct wmOperator *) ATTR_WARN_UNUSED_RESULT
struct ReportList * reports
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
wmOperatorType * WM_operatortype_find(const char *idname, bool quiet)