[Bf-blender-cvs] [1f72360] temp_remove_particles: Merge branch 'master' into temp_remove_particles
Lukas Tönne
noreply at git.blender.org
Thu Apr 28 17:33:30 CEST 2016
Commit: 1f723603c882e6d79ab69bea6e5c034ae21a6ce7
Author: Lukas Tönne
Date: Thu Apr 28 17:33:19 2016 +0200
Branches: temp_remove_particles
https://developer.blender.org/rB1f723603c882e6d79ab69bea6e5c034ae21a6ce7
Merge branch 'master' into temp_remove_particles
===================================================================
===================================================================
diff --cc release/scripts/startup/bl_ui/space_view3d.py
index 14d63f1,374bc98..b4c8967
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@@ -1843,6 -1875,87 +1843,8 @@@ class VIEW3D_MT_hide_mask(Menu)
props = layout.operator("paint.mask_lasso_gesture", text="Lasso Mask")
-# ********** Particle menu **********
-
-
-class VIEW3D_MT_particle(Menu):
- bl_label = "Particle"
-
- def draw(self, context):
- layout = self.layout
-
- particle_edit = context.tool_settings.particle_edit
-
- layout.operator("ed.undo")
- layout.operator("ed.redo")
- layout.operator("ed.undo_history")
-
- layout.separator()
-
- layout.operator("particle.mirror")
-
- layout.separator()
-
- layout.operator("particle.remove_doubles")
- layout.operator("particle.delete")
-
- if particle_edit.select_mode == 'POINT':
- layout.operator("particle.subdivide")
-
+ layout.operator("particle.unify_length")
- layout.operator("particle.rekey")
- layout.operator("particle.weight_set")
-
- layout.separator()
-
- layout.menu("VIEW3D_MT_particle_showhide")
-
-
-class VIEW3D_MT_particle_specials(Menu):
- bl_label = "Specials"
-
- def draw(self, context):
- layout = self.layout
-
- particle_edit = context.tool_settings.particle_edit
-
- layout.operator("particle.rekey")
- layout.operator("particle.delete")
- layout.operator("particle.remove_doubles")
+ layout.operator("particle.unify_length")
-
- if particle_edit.select_mode == 'POINT':
- layout.operator("particle.subdivide")
-
- layout.operator("particle.weight_set")
- layout.separator()
-
- layout.operator("particle.mirror")
-
- if particle_edit.select_mode == 'POINT':
- layout.separator()
- layout.operator("particle.select_roots")
- layout.operator("particle.select_tips")
-
- layout.separator()
-
- layout.operator("particle.select_random")
-
- layout.separator()
-
- layout.operator("particle.select_more")
- layout.operator("particle.select_less")
-
- layout.separator()
-
- layout.operator("particle.select_all").action = 'TOGGLE'
- layout.operator("particle.select_linked")
- layout.operator("particle.select_all", text="Inverse").action = 'INVERT'
-
-
-class VIEW3D_MT_particle_showhide(ShowHideMenu, Menu):
- _operator_name = "particle"
-
# ********** Pose Menu **********
diff --cc source/blender/blenkernel/CMakeLists.txt
index 8f253e1,afab0cc..b8a6b23
--- a/source/blender/blenkernel/CMakeLists.txt
+++ b/source/blender/blenkernel/CMakeLists.txt
@@@ -75,7 -75,11 +75,10 @@@ set(SR
intern/armature_update.c
intern/autoexec.c
intern/blender.c
+ intern/blender_copybuffer.c
+ intern/blender_undo.c
+ intern/blendfile.c
intern/bmfont.c
- intern/boids.c
intern/bpath.c
intern/brush.c
intern/bullet.c
@@@ -189,8 -197,13 +192,12 @@@
BKE_armature.h
BKE_autoexec.h
BKE_blender.h
+ BKE_blender_copybuffer.h
+ BKE_blender_undo.h
+ BKE_blender_version.h
+ BKE_blendfile.h
BKE_bmfont.h
BKE_bmfont_types.h
- BKE_boids.h
BKE_bpath.h
BKE_brush.h
BKE_bullet.h
diff --cc source/blender/blenkernel/intern/pointcache.c
index a3529d8,f0ba63e..c295053
--- a/source/blender/blenkernel/intern/pointcache.c
+++ b/source/blender/blenkernel/intern/pointcache.c
@@@ -58,10 -59,8 +58,9 @@@
#include "BKE_appdir.h"
#include "BKE_anim.h"
- #include "BKE_blender.h"
#include "BKE_cloth.h"
#include "BKE_dynamicpaint.h"
+#include "BKE_key.h"
#include "BKE_global.h"
#include "BKE_main.h"
#include "BKE_modifier.h"
diff --cc source/blender/editors/transform/transform_snap_object.c
index 0000000,074d794..e9209ee
mode 000000,100644..100644
--- a/source/blender/editors/transform/transform_snap_object.c
+++ b/source/blender/editors/transform/transform_snap_object.c
@@@ -1,0 -1,1222 +1,1207 @@@
+ /*
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+ /** \file blender/editors/transform/transform_snap_object.c
+ * \ingroup edtransform
+ */
+
+ #include <stdlib.h>
+ #include <math.h>
+ #include <float.h>
+ #include <stdio.h>
+
+ #include "MEM_guardedalloc.h"
+
+ #include "BLI_math.h"
+ #include "BLI_kdopbvh.h"
+ #include "BLI_memarena.h"
+ #include "BLI_ghash.h"
+ #include "BLI_utildefines.h"
+
+ #include "DNA_armature_types.h"
+ #include "DNA_curve_types.h"
+ #include "DNA_scene_types.h"
+ #include "DNA_object_types.h"
+ #include "DNA_meshdata_types.h"
+ #include "DNA_screen_types.h"
+ #include "DNA_view3d_types.h"
+
+ #include "BKE_DerivedMesh.h"
+ #include "BKE_object.h"
+ #include "BKE_anim.h" /* for duplis */
+ #include "BKE_editmesh.h"
+ #include "BKE_main.h"
+ #include "BKE_tracking.h"
+
+ #include "ED_transform.h"
+ #include "ED_view3d.h"
+ #include "ED_armature.h"
+
+ #include "transform.h"
+
+ typedef struct SnapObjectData {
+ BVHTreeFromMesh *bvh_trees[2];
+ } SnapObjectData;
+
+
+ struct SnapObjectContext {
+ Main *bmain;
+ Scene *scene;
+ int flag;
+
+ /* Optional: when performing screen-space projection.
+ * otherwise this doesn't take viewport into account. */
+ bool use_v3d;
+ struct {
+ struct View3D *v3d;
+ struct ARegion *ar;
+ } v3d_data;
+
+
+ /* Object -> SnapObjectData map */
+ struct {
+ GHash *object_map;
+ MemArena *mem_arena;
+ } cache;
+
+ };
+
+ /* -------------------------------------------------------------------- */
+
+ /** \name Internal Object Snapping API
+ * \{ */
+
+ static bool snapEdge(
+ ARegion *ar, const float v1co[3], const short v1no[3], const float v2co[3], const short v2no[3],
+ float obmat[4][4], float timat[3][3], const float mval_fl[2], float *dist_px,
+ const float ray_start[3], const float ray_start_local[3], const float ray_normal_local[3], float *ray_depth,
+ float r_loc[3], float r_no[3])
+ {
+ float intersect[3] = {0, 0, 0}, ray_end[3], dvec[3];
+ int result;
+ bool retval = false;
+
+ copy_v3_v3(ray_end, ray_normal_local);
+ mul_v3_fl(ray_end, 2000);
+ add_v3_v3v3(ray_end, ray_start_local, ray_end);
+
+ /* dvec used but we don't care about result */
+ result = isect_line_line_v3(v1co, v2co, ray_start_local, ray_end, intersect, dvec);
+
+ if (result) {
+ float edge_loc[3], vec[3];
+ float mul;
+
+ /* check for behind ray_start */
+ sub_v3_v3v3(dvec, intersect, ray_start_local);
+
+ sub_v3_v3v3(edge_loc, v1co, v2co);
+ sub_v3_v3v3(vec, intersect, v2co);
+
+ mul = dot_v3v3(vec, edge_loc) / dot_v3v3(edge_loc, edge_loc);
+
+ if (mul > 1) {
+ mul = 1;
+ copy_v3_v3(intersect, v1co);
+ }
+ else if (mul < 0) {
+ mul = 0;
+ copy_v3_v3(intersect, v2co);
+ }
+
+ if (dot_v3v3(ray_normal_local, dvec) > 0) {
+ float location[3];
+ float new_depth;
+ float screen_loc[2];
+ float new_dist;
+
+ copy_v3_v3(location, intersect);
+
+ mul_m4_v3(obmat, location);
+
+ new_depth = len_v3v3(location, ray_start);
+
+ if (ED_view3d_project_float_global(ar, location, screen_loc, V3D_PROJ_TEST_NOP) == V3D_PROJ_RET_OK) {
+ new_dist = len_manhattan_v2v2(mval_fl, screen_loc);
+ }
+ else {
+ new_dist = TRANSFORM_DIST_MAX_PX;
+ }
+
+ /* 10% threshold if edge is closer but a bit further
+ * this takes care of series of connected edges a bit slanted w.r.t the viewport
+ * otherwise, it would stick to the verts of the closest edge and not slide along merrily
+ * */
+ if (new_dist <= *dist_px && new_depth < *ray_depth * 1.001f) {
+ float n1[3], n2[3];
+
+ *ray_depth = new_depth;
+ retval = true;
+
+ sub_v3_v3v3(edge_loc, v1co, v2co);
+ sub_v3_v3v3(vec, intersect, v2co);
+
+ mul = dot_v3v3(vec, edge_loc) / dot_v3v3(edge_loc, edge_loc);
+
+ if (r_no) {
+ normal_short_to_float_v3(n1, v1no);
+ normal_short_to_float_v3(n2, v2no);
+ interp_v3_v3v3(r_no, n2, n1, mul);
+ mul_m3_v3(timat, r_no);
+ normalize_v3(r_no);
+ }
+
+ copy_v3_v3(r_loc, location);
+
+ *dist_px = new_dist;
+ }
+ }
+ }
+
+ return retval;
+ }
+
+ static bool snapVertex(
+ ARegion *ar, const float vco[3], const short vno[3],
+ float obmat[4][4], float timat[3][3], const float mval_fl[2], float *dist_px,
+ const float ray_start[3], const float ray_start_local[3], const float ray_normal_local[3], float *ray_depth,
+ float r_loc[3], float r_no[3])
+ {
+ bool retval = false;
+ float dvec[3];
+
+ sub_v3_v3v3(dvec, vco, ray_start_local);
+
+ if (dot_v3v3(ray_normal_local, dvec) > 0) {
+ float location[3];
+ float new_depth;
+ float screen_loc[2];
+ float new_dist;
+
+ copy_v3_v3(location, vco);
+
+ mul_m4_v3(obmat, location);
+
+ new_depth = len_v3v3(location, ray_start);
+
+ if (ED_view3d_project_float_global(ar, location, screen_loc, V3D_PROJ_TEST_NOP) == V3D_PROJ_RET_OK) {
+ new_dist = len_manhattan_v2v2(mval_fl, screen_loc);
+ }
+ else {
+ new_dist = TRANSFORM_DIST_MAX_PX;
+ }
+
+
+ if (new_dist <= *dist_px && new_depth < *ray_depth) {
+ *ray_depth = new_depth;
+ retval = true;
+
+ copy_v3_v3(r_loc, location);
+
+ if (r_no
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list