Compare commits

...

13 Commits

Author SHA1 Message Date
Jaume Bellet 9def1304bb Merge branch 'bf-blender' into mb-0016-create-object-with-custom-orientation
Conflicts:
	source/blender/editors/object/object_add.cc
2024-04-20 20:37:06 +02:00
Jaume Bellet 6c03529087 Merge branch 'bf-blender' into mb-0016-create-object-with-custom-orientation 2024-02-11 23:32:05 +01:00
Jaume Bellet 375f09d4ee BKE_scene.h is renamed to .hh 2024-02-11 23:30:48 +01:00
Jaume Bellet fd4f890157 Merge branch 'bf-blender' into mb-0016-create-object-with-custom-orientation
Conflicts:
	source/blender/editors/object/CMakeLists.txt
2024-02-04 22:17:13 +01:00
Jaume Bellet 530ac3482b Merge branch 'bf-blender' into mb-0016-create-object-with-custom-orientation 2024-01-29 00:05:05 +01:00
Jaume Bellet 0ccfa22b1c Merge branch 'bf-blender' into mb-0016-create-object-with-custom-orientation
Conflicts:
	README.md
	source/blender/editors/object/CMakeLists.txt
2024-01-19 22:55:19 +01:00
Jaume Bellet bd60538bd9 patches.py file 2023-12-03 22:26:37 +01:00
Jaume Bellet fddffed2c4 Merge branch 'bf-blender' into mb-0016-create-object-with-custom-orientation 2023-12-03 22:25:42 +01:00
Jaume Bellet 5b03dcaf97 rename id folder 2023-12-03 18:14:00 +01:00
Jaume Bellet b7144cc316 Merge branch 'bf-blender' into mb-0016-create-object-with-custom-orientation
Conflicts:
	source/blender/editors/object/CMakeLists.txt

because of

b683bcc46c
2023-11-25 12:57:57 +01:00
Jaume Bellet b2494e98f0 ID fil 2023-11-22 23:30:41 +01:00
Jaume Bellet 881d0074e7 readme with descrition and links 2023-11-22 23:18:11 +01:00
Jaume Bellet a8aba3f8f4 Ok 2023-11-22 22:50:16 +01:00
5 changed files with 33 additions and 36 deletions

View File

@ -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

View File

@ -19,6 +19,7 @@ set(INC
../../render
../../shader_fx
../../windowmanager
../transform
# RNA_prototypes.h
${CMAKE_BINARY_DIR}/source/blender/makesrna

View File

@ -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 */

View File

@ -0,0 +1 @@
/* Empty File */

2
tornavis/patches.py Normal file
View File

@ -0,0 +1,2 @@
names = []