Compare commits
13 Commits
main
...
mb-0016-cr
Author | SHA1 | Date |
---|---|---|
Jaume Bellet | 9def1304bb | |
Jaume Bellet | 6c03529087 | |
Jaume Bellet | 375f09d4ee | |
Jaume Bellet | fd4f890157 | |
Jaume Bellet | 530ac3482b | |
Jaume Bellet | 0ccfa22b1c | |
Jaume Bellet | bd60538bd9 | |
Jaume Bellet | fddffed2c4 | |
Jaume Bellet | 5b03dcaf97 | |
Jaume Bellet | b7144cc316 | |
Jaume Bellet | b2494e98f0 | |
Jaume Bellet | 881d0074e7 | |
Jaume Bellet | a8aba3f8f4 |
42
README.md
42
README.md
|
@ -1,38 +1,8 @@
|
|||
<!--
|
||||
Keep this document short & concise,
|
||||
linking to external resources instead of including content in-line.
|
||||
See 'release/text/readme.html' for the end user read-me.
|
||||
-->
|
||||
*Mechanical Blender
|
||||
|
||||
Blender
|
||||
=======
|
||||
This branch applies the current custom transform orientation to new objects
|
||||
|
||||
Blender is the free and open source 3D creation suite.
|
||||
It supports the entirety of the 3D pipeline-modeling, rigging, animation, simulation, rendering, compositing,
|
||||
motion tracking and video editing.
|
||||
|
||||
![Blender screenshot](https://code.blender.org/wp-content/uploads/2018/12/springrg.jpg "Blender screenshot")
|
||||
|
||||
Project Pages
|
||||
-------------
|
||||
|
||||
- [Main Website](http://www.blender.org)
|
||||
- [Reference Manual](https://docs.blender.org/manual/en/latest/index.html)
|
||||
- [User Community](https://www.blender.org/community/)
|
||||
|
||||
Development
|
||||
-----------
|
||||
|
||||
- [Build Instructions](https://developer.blender.org/docs/handbook/building_blender/)
|
||||
- [Code Review & Bug Tracker](https://projects.blender.org)
|
||||
- [Developer Forum](https://devtalk.blender.org)
|
||||
- [Developer Documentation](https://developer.blender.org/docs/)
|
||||
|
||||
|
||||
License
|
||||
-------
|
||||
|
||||
Blender as a whole is licensed under the GNU General Public License, Version 3.
|
||||
Individual files may have a different, but compatible license.
|
||||
|
||||
See [blender.org/about/license](https://www.blender.org/about/license) for details.
|
||||
See
|
||||
[Documentation](https://mechanicalblender.org/#documentation__improvements__use-of-custom-transform-orientation-when-creating-data)
|
||||
and [Development Notes](https://mechanicalblender.org/#development-notes__improvements__use-of-custom-transform-orientation-when-creating-data)
|
||||
on Project's website
|
||||
|
|
|
@ -19,6 +19,7 @@ set(INC
|
|||
../../render
|
||||
../../shader_fx
|
||||
../../windowmanager
|
||||
../transform
|
||||
|
||||
# RNA_prototypes.h
|
||||
${CMAKE_BINARY_DIR}/source/blender/makesrna
|
||||
|
|
|
@ -92,6 +92,7 @@
|
|||
#include "BKE_speaker.h"
|
||||
#include "BKE_vfont.hh"
|
||||
#include "BKE_volume.hh"
|
||||
#include "BKE_scene.hh"
|
||||
|
||||
#include "DEG_depsgraph.hh"
|
||||
#include "DEG_depsgraph_build.hh"
|
||||
|
@ -129,6 +130,8 @@
|
|||
|
||||
#include "object_intern.hh"
|
||||
|
||||
#include "transform_orientations.hh"
|
||||
|
||||
namespace blender::ed::object {
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
|
@ -348,15 +351,35 @@ float new_primitive_matrix(bContext *C,
|
|||
View3D *v3d = CTX_wm_view3d(C);
|
||||
float mat[3][3], rmat[3][3], cmat[3][3], imat[3][3];
|
||||
|
||||
float ts_mat[3][3];
|
||||
char ts_name[MAX_NAME];
|
||||
//int orientation_index = v3d->twmode - V3D_MANIP_CUSTOM;
|
||||
TransformOrientation *custom_orientation = nullptr;
|
||||
if (scene->orientation_slots->type >= V3D_ORIENT_CUSTOM &&
|
||||
scene->orientation_slots->index_custom != -1)
|
||||
{
|
||||
custom_orientation = BKE_scene_transform_orientation_find(
|
||||
scene, scene->orientation_slots->index_custom);
|
||||
}
|
||||
|
||||
unit_m4(r_primmat);
|
||||
|
||||
eul_to_mat3(rmat, rot);
|
||||
invert_m3(rmat);
|
||||
|
||||
if (custom_orientation) {
|
||||
applyTransformOrientation(custom_orientation, ts_mat, ts_name);
|
||||
invert_m3(ts_mat);
|
||||
mul_m3_m3m3(mat, rmat, ts_mat);
|
||||
copy_m3_m3(rmat, mat);
|
||||
}
|
||||
|
||||
|
||||
/* inverse transform for initial rotation and object */
|
||||
copy_m3_m4(mat, obedit->object_to_world().ptr());
|
||||
mul_m3_m3m3(cmat, rmat, mat);
|
||||
invert_m3_m3(imat, cmat);
|
||||
|
||||
copy_m4_m3(r_primmat, imat);
|
||||
|
||||
/* center */
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
/* Empty File */
|
|
@ -0,0 +1,2 @@
|
|||
|
||||
names = []
|
Loading…
Reference in New Issue