Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/transform/transform.c
| Show First 20 Lines • Show All 57 Lines • ▼ Show 20 Lines | |||||
| #include "BKE_editmesh.h" | #include "BKE_editmesh.h" | ||||
| #include "BKE_editmesh_bvh.h" | #include "BKE_editmesh_bvh.h" | ||||
| #include "BKE_context.h" | #include "BKE_context.h" | ||||
| #include "BKE_constraint.h" | #include "BKE_constraint.h" | ||||
| #include "BKE_particle.h" | #include "BKE_particle.h" | ||||
| #include "BKE_unit.h" | #include "BKE_unit.h" | ||||
| #include "BKE_mask.h" | #include "BKE_mask.h" | ||||
| #include "BKE_report.h" | #include "BKE_report.h" | ||||
| #include "BKE_workspace.h" | |||||
| #include "BIF_glutil.h" | #include "BIF_glutil.h" | ||||
| #include "GPU_immediate.h" | #include "GPU_immediate.h" | ||||
| #include "GPU_immediate_util.h" | #include "GPU_immediate_util.h" | ||||
| #include "GPU_matrix.h" | #include "GPU_matrix.h" | ||||
| #include "ED_image.h" | #include "ED_image.h" | ||||
| ▲ Show 20 Lines • Show All 1,934 Lines • ▼ Show 20 Lines | if (t->flag & T_MODAL) { | ||||
| if (t->spacetype == SPACE_VIEW3D) { | if (t->spacetype == SPACE_VIEW3D) { | ||||
| if ((prop = RNA_struct_find_property(op->ptr, "constraint_orientation")) && | if ((prop = RNA_struct_find_property(op->ptr, "constraint_orientation")) && | ||||
| !RNA_property_is_set(op->ptr, prop)) | !RNA_property_is_set(op->ptr, prop)) | ||||
| { | { | ||||
| View3D *v3d = t->view; | View3D *v3d = t->view; | ||||
| v3d->twmode = t->current_orientation; | v3d->twmode = t->current_orientation; | ||||
| BLI_assert(v3d->custom_orientation == t->custom_orientation); | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| if ((prop = RNA_struct_find_property(op->ptr, "proportional"))) { | if ((prop = RNA_struct_find_property(op->ptr, "proportional"))) { | ||||
| RNA_property_enum_set(op->ptr, prop, proportional); | RNA_property_enum_set(op->ptr, prop, proportional); | ||||
| RNA_enum_set(op->ptr, "proportional_edit_falloff", t->prop_mode); | RNA_enum_set(op->ptr, "proportional_edit_falloff", t->prop_mode); | ||||
| RNA_float_set(op->ptr, "proportional_size", t->prop_size); | RNA_float_set(op->ptr, "proportional_size", t->prop_size); | ||||
| } | } | ||||
| if ((prop = RNA_struct_find_property(op->ptr, "axis"))) { | if ((prop = RNA_struct_find_property(op->ptr, "axis"))) { | ||||
| RNA_property_float_set_array(op->ptr, prop, t->axis); | RNA_property_float_set_array(op->ptr, prop, t->axis); | ||||
| } | } | ||||
| if ((prop = RNA_struct_find_property(op->ptr, "mirror"))) { | if ((prop = RNA_struct_find_property(op->ptr, "mirror"))) { | ||||
| RNA_property_boolean_set(op->ptr, prop, (t->flag & T_MIRROR) != 0); | RNA_property_boolean_set(op->ptr, prop, (t->flag & T_MIRROR) != 0); | ||||
| } | } | ||||
| if ((prop = RNA_struct_find_property(op->ptr, "constraint_axis"))) { | if ((prop = RNA_struct_find_property(op->ptr, "constraint_axis"))) { | ||||
| /* constraint orientation can be global, event if user selects something else | /* constraint orientation can be global, even if user selects something else | ||||
| * so use the orientation in the constraint if set | * so use the orientation in the constraint if set */ | ||||
| * */ | short orientation = (t->con.mode & CON_APPLY) ? t->con.orientation : t->current_orientation; | ||||
| if (t->con.mode & CON_APPLY) { | |||||
| RNA_enum_set(op->ptr, "constraint_orientation", t->con.orientation); | if (orientation == V3D_MANIP_CUSTOM) { | ||||
| } | WorkSpace *workspace = CTX_wm_workspace(C); | ||||
| else { | ListBase *transform_orientations = BKE_workspace_transform_orientations_get(workspace); | ||||
| RNA_enum_set(op->ptr, "constraint_orientation", t->current_orientation); | |||||
| /* Maybe we need a t->con.custom_orientation? Seems like it would always match t->custom_orientation. */ | |||||
| orientation = V3D_MANIP_CUSTOM + BLI_findindex(transform_orientations, t->custom_orientation); | |||||
| BLI_assert(orientation >= V3D_MANIP_CUSTOM); | |||||
| } | } | ||||
| RNA_enum_set(op->ptr, "constraint_orientation", orientation); | |||||
| if (t->con.mode & CON_APPLY) { | if (t->con.mode & CON_APPLY) { | ||||
| if (t->con.mode & CON_AXIS0) { | if (t->con.mode & CON_AXIS0) { | ||||
| constraint_axis[0] = 1; | constraint_axis[0] = 1; | ||||
| } | } | ||||
| if (t->con.mode & CON_AXIS1) { | if (t->con.mode & CON_AXIS1) { | ||||
| constraint_axis[1] = 1; | constraint_axis[1] = 1; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 6,605 Lines • Show Last 20 Lines | |||||