Page Menu
Home
Search
Configure Global Search
Log In
Files
F19888
quick_hack_lattice_transform.diff
Public
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Authored By
Justin Dailey (dail)
Nov 13 2013, 4:20 PM
Size
1 KB
Subscribers
None
quick_hack_lattice_transform.diff
View Options
Index: source/blender/editors/object/object_transform.c
===================================================================
--- source/blender/editors/object/object_transform.c (revision 45017)
+++ source/blender/editors/object/object_transform.c (working copy)
@@ -40,6 +40,7 @@
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "DNA_group_types.h"
+#include "DNA_lattice_types.h"
#include "BLI_math.h"
#include "BLI_listbase.h"
@@ -398,6 +399,12 @@
return OPERATOR_CANCELLED;
}
}
+ else if(ob->type==OB_LATTICE) {
+ if(ID_REAL_USERS(ob->data) > 1) {
+ BKE_report(reports, RPT_ERROR, "Can't apply to a multi user lattice, doing nothing");
+ return OPERATOR_CANCELLED;
+ }
+ }
else if(ELEM(ob->type, OB_CURVE, OB_SURF)) {
Curve *cu;
@@ -487,6 +494,16 @@
else if (ob->type==OB_ARMATURE) {
ED_armature_apply_transform(ob, mat);
}
+ else if (ob->type==OB_LATTICE) {
+ Lattice *lt= ob->data;
+ BPoint *bp= lt->def;
+ int a= lt->pntsu * lt->pntsv * lt->pntsw;
+
+ while(a--) {
+ mul_m4_v3(mat, bp->vec);
+ bp++;
+ }
+ }
else if(ELEM(ob->type, OB_CURVE, OB_SURF)) {
Curve *cu= ob->data;
File Metadata
Details
Mime Type
text/x-diff
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
49/5f/90d63d68d1e724fe407e0fc5c45d
Event Timeline
Log In to Comment