This commit is contained in:
Campbell Barton 2011-08-24 01:44:54 +00:00
commit 98f87b77f4
16 changed files with 269 additions and 119 deletions

@ -35,17 +35,33 @@ OS_NCASE:=$(shell uname -s | tr '[A-Z]' '[a-z]')
# Source and Build DIR's
BLENDER_DIR:=$(shell pwd -P)
BUILD_DIR:=$(shell dirname $(BLENDER_DIR))/build/$(OS_NCASE)
BUILD_TYPE:=Release
BUILD_CMAKE_ARGS:=""
# -----------------------------------------------------------------------------
# additional targets for the build configuration
# support 'make debug'
ifneq "$(findstring debug, $(MAKECMDGOALS))" ""
BUILD_DIR:=$(BUILD_DIR)_debug
BUILD_TYPE:=Debug
else
BUILD_TYPE:=Release
endif
ifneq "$(findstring lite, $(MAKECMDGOALS))" ""
BUILD_DIR:=$(BUILD_DIR)_lite
BUILD_CMAKE_ARGS:=$(BUILD_CMAKE_ARGS) -C$(BLENDER_DIR)/build_files/cmake/config/blender_lite.cmake
endif
ifneq "$(findstring headless, $(MAKECMDGOALS))" ""
BUILD_DIR:=$(BUILD_DIR)_bpy
BUILD_CMAKE_ARGS:=$(BUILD_CMAKE_ARGS) -C$(BLENDER_DIR)/build_files/cmake/config/blender_headless.cmake
endif
ifneq "$(findstring bpy, $(MAKECMDGOALS))" ""
BUILD_DIR:=$(BUILD_DIR)_bpy
BUILD_CMAKE_ARGS:=$(BUILD_CMAKE_ARGS) -C$(BLENDER_DIR)/build_files/cmake/config/bpy_module.cmake
endif
# -----------------------------------------------------------------------------
# Get the number of cores for threaded build
NPROCS:=1
ifeq ($(OS), Linux)
@ -61,14 +77,14 @@ ifeq ($(OS), NetBSD)
NPROCS:=$(shell sysctl -a | grep "hw.ncpu " | cut -d" " -f3 )
endif
# -----------------------------------------------------------------------------
# Build Blender
all:
@echo
@echo Configuring Blender ...
if test ! -f $(BUILD_DIR)/CMakeCache.txt ; then \
cmake -H$(BLENDER_DIR) -B$(BUILD_DIR) -DCMAKE_BUILD_TYPE:STRING=$(BUILD_TYPE) ; \
cmake $(BUILD_CMAKE_ARGS) -H$(BLENDER_DIR) -B$(BUILD_DIR) -DCMAKE_BUILD_TYPE:STRING=$(BUILD_TYPE); \
fi
@echo
@ -80,9 +96,40 @@ all:
@echo
debug: all
# pass
lite: all
headless: all
bpy: all
# package types
# -----------------------------------------------------------------------------
# Helo for build targets
help:
@echo ""
@echo "Convenience targets provided for building blender, (multiple at once can be used)"
@echo " * debug - build a debug binary"
@echo " * lite - disable non essential features for a smaller binary and faster build"
@echo " * headless - build without an interface (renderfarm or server automation)"
@echo " * bpy - build as a python module which can be loaded from python directly"
@echo ""
@echo "Project Files for IDE's"
@echo " * project_qtcreator - QtCreator Project Files"
@echo " * project_netbeans - NetBeans Project Files"
@echo " * project_eclipse - Eclipse CDT4 Project Files"
@echo ""
@echo "Package Targets"
@echo " * package_debian - build a debian package"
@echo " * package_pacman - build an arch linux pacmanpackage"
@echo " * package_archive - build an archive package"
@echo ""
@echo "Testing Targets (not assosiated with building blender)"
@echo " * test - run ctest, currently tests import/export, operator execution and that python modules load"
@echo " * test_cmake - runs our own cmake file checker which detects errors in the cmake file list definitions"
@echo " * test_pep8 - checks all python script are pep8 which are tagged to use the stricter formatting"
@echo " * test_deprecated - checks for deprecation tags in our code which may need to be removed"
@echo ""
# -----------------------------------------------------------------------------
# Packages
#
package_debian:
cd build_files/package_spec ; DEB_BUILD_OPTIONS="parallel=$(NPROCS)" sh ./build_debian.sh
@ -93,7 +140,10 @@ package_archive:
make -C $(BUILD_DIR) -s package_archive
@echo archive in "$(BUILD_DIR)/release"
# forward build targets
# -----------------------------------------------------------------------------
# Tests
#
test:
cd $(BUILD_DIR) ; ctest . --output-on-failure
@ -111,6 +161,21 @@ test_cmake:
test_deprecated:
python3 source/tests/check_deprecated.py
# -----------------------------------------------------------------------------
# Project Files
#
project_qtcreator:
python3 build_files/cmake/cmake_qtcreator_project.py $(BUILD_DIR)
project_netbeans:
python3 build_files/cmake/cmake_netbeans_project.py $(BUILD_DIR)
project_eclipse:
cmake -G"Eclipse CDT4 - Unix Makefiles" -H$(BLENDER_DIR) -B$(BUILD_DIR)
clean:
$(MAKE) -C $(BUILD_DIR) clean

@ -0,0 +1,24 @@
# headless configuration, useful in for servers or renderfarms
# builds without a windowing system (X11/Windows/Cocoa).
#
# Example usage:
# cmake -C../blender/build_files/cmake/config/blender_headless.cmake ../blender
#
set(WITH_HEADLESS ON CACHE FORCE BOOL)
set(WITH_GAMEENGINE OFF CACHE FORCE BOOL)
# disable audio, its possible some devs may want this but for now disable
# so the python module doesnt hold the audio device and loads quickly.
set(WITH_AUDASPACE OFF CACHE FORCE BOOL)
set(WITH_SAMPLERATE OFF CACHE FORCE BOOL)
set(WITH_FFTW3 OFF CACHE FORCE BOOL)
set(WITH_JACK OFF CACHE FORCE BOOL)
set(WITH_SDL OFF CACHE FORCE BOOL)
set(WITH_OPENAL OFF CACHE FORCE BOOL)
set(WITH_CODEC_FFMPEG OFF CACHE FORCE BOOL)
set(WITH_CODEC_SNDFILE OFF CACHE FORCE BOOL)
# other features which are not especially useful as a python module
set(WITH_X11_XINPUT OFF CACHE FORCE BOOL)
set(WITH_INPUT_NDOF OFF CACHE FORCE BOOL)

@ -0,0 +1,43 @@
# turn everything OFF CACHE FORCE BOOL) except for python which defaults to ON
# and is needed for the UI
#
# Example usage:
# cmake -C../blender/build_files/cmake/config/blender_lite.cmake ../blender
#
set(WITH_INSTALL_PORTABLE ON CACHE FORCE BOOL)
set(WITH_BUILDINFO OFF CACHE FORCE BOOL)
set(WITH_BUILTIN_GLEW OFF CACHE FORCE BOOL)
set(WITH_BULLET OFF CACHE FORCE BOOL)
set(WITH_CODEC_FFMPEG OFF CACHE FORCE BOOL)
set(WITH_CODEC_SNDFILE OFF CACHE FORCE BOOL)
set(WITH_FFTW3 OFF CACHE FORCE BOOL)
set(WITH_GAMEENGINE OFF CACHE FORCE BOOL)
set(WITH_IK_ITASC OFF CACHE FORCE BOOL)
set(WITH_IMAGE_CINEON OFF CACHE FORCE BOOL)
set(WITH_IMAGE_DDS OFF CACHE FORCE BOOL)
set(WITH_IMAGE_FRAMESERVER OFF CACHE FORCE BOOL)
set(WITH_IMAGE_HDR OFF CACHE FORCE BOOL)
set(WITH_IMAGE_OPENEXR OFF CACHE FORCE BOOL)
set(WITH_IMAGE_OPENJPEG OFF CACHE FORCE BOOL)
set(WITH_IMAGE_REDCODE OFF CACHE FORCE BOOL)
set(WITH_IMAGE_TIFF OFF CACHE FORCE BOOL)
set(WITH_INPUT_NDOF OFF CACHE FORCE BOOL)
set(WITH_INTERNATIONAL OFF CACHE FORCE BOOL)
set(WITH_JACK OFF CACHE FORCE BOOL)
set(WITH_LZMA OFF CACHE FORCE BOOL)
set(WITH_LZO OFF CACHE FORCE BOOL)
set(WITH_MOD_BOOLEAN OFF CACHE FORCE BOOL)
set(WITH_MOD_DECIMATE OFF CACHE FORCE BOOL)
set(WITH_MOD_FLUID OFF CACHE FORCE BOOL)
set(WITH_MOD_SMOKE OFF CACHE FORCE BOOL)
set(WITH_AUDASPACE OFF CACHE FORCE BOOL)
set(WITH_OPENAL OFF CACHE FORCE BOOL)
set(WITH_OPENCOLLADA OFF CACHE FORCE BOOL)
set(WITH_OPENMP OFF CACHE FORCE BOOL)
set(WITH_PYTHON_INSTALL OFF CACHE FORCE BOOL)
set(WITH_RAYOPTIMIZATION OFF CACHE FORCE BOOL)
set(WITH_SAMPLERATE OFF CACHE FORCE BOOL)
set(WITH_SDL OFF CACHE FORCE BOOL)
set(WITH_X11_XINPUT OFF CACHE FORCE BOOL)

@ -0,0 +1,34 @@
# defaults for building blender as a python module 'bpy'
#
# Example usage:
# cmake -C../blender/build_files/cmake/config/bpy_module.cmake ../blender
#
set(WITH_PYTHON_MODULE ON CACHE FORCE BOOL)
# install into the systems python dir
set(WITH_INSTALL_PORTABLE OFF CACHE FORCE BOOL)
# no point int copying python into python
set(WITH_PYTHON_INSTALL OFF CACHE FORCE BOOL)
# dont build the game engine
set(WITH_GAMEENGINE OFF CACHE FORCE BOOL)
# disable audio, its possible some devs may want this but for now disable
# so the python module doesnt hold the audio device and loads quickly.
set(WITH_AUDASPACE OFF CACHE FORCE BOOL)
set(WITH_SAMPLERATE OFF CACHE FORCE BOOL)
set(WITH_FFTW3 OFF CACHE FORCE BOOL)
set(WITH_JACK OFF CACHE FORCE BOOL)
set(WITH_SDL OFF CACHE FORCE BOOL)
set(WITH_OPENAL OFF CACHE FORCE BOOL)
set(WITH_CODEC_FFMPEG OFF CACHE FORCE BOOL)
set(WITH_CODEC_SNDFILE OFF CACHE FORCE BOOL)
# other features which are not especially useful as a python module
set(WITH_X11_XINPUT OFF CACHE FORCE BOOL)
set(WITH_INPUT_NDOF OFF CACHE FORCE BOOL)
set(WITH_OPENCOLLADA OFF CACHE FORCE BOOL)
set(WITH_INTERNATIONAL OFF CACHE FORCE BOOL)
set(WITH_BULLET OFF CACHE FORCE BOOL)

@ -385,8 +385,26 @@ GHOST_SystemSDL::processEvent(SDL_Event *sdl_event)
GHOST_TKey gkey= convertSDLKey(sdl_sub_evt.keysym.scancode);
/* note, the sdl_sub_evt.keysym.sym is truncated, for unicode support ghost has to be modified */
/* printf("%d\n", sym); */
if(sym > 127) {
sym= 0;
switch(sym) {
case SDLK_KP_DIVIDE: sym= '/'; break;
case SDLK_KP_MULTIPLY: sym= '*'; break;
case SDLK_KP_MINUS: sym= '-'; break;
case SDLK_KP_PLUS: sym= '+'; break;
case SDLK_KP_1: sym= '1'; break;
case SDLK_KP_2: sym= '2'; break;
case SDLK_KP_3: sym= '3'; break;
case SDLK_KP_4: sym= '4'; break;
case SDLK_KP_5: sym= '5'; break;
case SDLK_KP_6: sym= '6'; break;
case SDLK_KP_7: sym= '7'; break;
case SDLK_KP_8: sym= '8'; break;
case SDLK_KP_9: sym= '9'; break;
case SDLK_KP_0: sym= '0'; break;
case SDLK_KP_PERIOD: sym= '.'; break;
default: sym= 0; break;
}
}
else {
if(sdl_sub_evt.keysym.mod & (KMOD_LSHIFT|KMOD_RSHIFT)) {

@ -109,7 +109,7 @@ class DATA_PT_shape_curve(CurveButtonsPanel, Panel):
if (is_curve or is_text):
col.label(text="Fill:")
sub = col.column()
sub.active = (curve.bevel_object is None)
sub.active = (curve.dimensions == '2D' or (curve.bevel_object is None and curve.dimensions == '3D'))
sub.prop(curve, "use_fill_front")
sub.prop(curve, "use_fill_back")
col.prop(curve, "use_fill_deform", text="Fill Deformed")

@ -387,7 +387,7 @@ class IMAGE_HT_header(Header):
row = layout.row(align=True)
row.prop(toolsettings, "use_snap", text="")
row.prop(toolsettings, "snap_element", text="", icon_only=True)
row.prop(toolsettings, "snap_target", text="")
mesh = context.edit_object.data
layout.prop_search(mesh.uv_textures, "active", mesh, "uv_textures", text="")

@ -1371,6 +1371,11 @@ void makeDispListCurveTypes(Scene *scene, Object *ob, int forOrco)
Curve *cu= ob->data;
ListBase *dispbase;
/* The same check for duplis as in do_makeDispListCurveTypes.
Happens when curve used for constraint/bevel was converted to mesh.
check there is still needed for render displist and orco displists. */
if(!ELEM3(ob->type, OB_SURF, OB_CURVE, OB_FONT)) return;
freedisplist(&(ob->disp));
dispbase= &(ob->disp);
freedisplist(dispbase);

@ -424,7 +424,8 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but)
if (unit_type == PROP_UNIT_ROTATION) {
if (RNA_property_type(but->rnaprop) == PROP_FLOAT) {
BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), "Radians: %f", RNA_property_float_get_index(&but->rnapoin, but->rnaprop, but->rnaindex));
float value= RNA_property_array_check(but->rnaprop) ? RNA_property_float_get_index(&but->rnapoin, but->rnaprop, but->rnaindex) : RNA_property_float_get(&but->rnapoin, but->rnaprop);
BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), "Radians: %f", value);
data->color[data->totline]= 0x888888;
data->totline++;
}

@ -3007,10 +3007,10 @@ static int node_mute_exec(bContext *C, wmOperator *UNUSED(op))
for(node= snode->edittree->nodes.first; node; node= node->next) {
if(node->flag & SELECT) {
if(node->inputs.first && node->outputs.first) {
/* Be able to mute in-/output nodes as well. - DingTo
if(node->inputs.first && node->outputs.first) { */
node->flag ^= NODE_MUTED;
snode_tag_changed(snode, node);
}
}
}

@ -5545,7 +5545,7 @@ static void drawObjectSelect(Scene *scene, View3D *v3d, ARegion *ar, Base *base)
}
}
else if(ob->type==OB_ARMATURE) {
if(!(ob->mode & OB_MODE_POSE))
if(!(ob->mode & OB_MODE_POSE && base == scene->basact))
draw_armature(scene, v3d, ar, base, OB_WIRE, FALSE, TRUE);
}

@ -282,31 +282,32 @@ static char *view3d_modeselect_pup(Scene *scene)
str += sprintf(str, formatstr, "Object Mode", OB_MODE_OBJECT, ICON_OBJECT_DATA);
if(ob==NULL || ob->data==NULL) return string;
if(ob->id.lib || ((ID *)ob->data)->lib) return string;
if(ob->id.lib) return string;
/* if active object is editable */
if ( ((ob->type == OB_MESH)
|| (ob->type == OB_CURVE) || (ob->type == OB_SURF) || (ob->type == OB_FONT)
|| (ob->type == OB_MBALL) || (ob->type == OB_LATTICE))) {
if(!((ID *)ob->data)->lib) {
/* if active object is editable */
if ( ((ob->type == OB_MESH)
|| (ob->type == OB_CURVE) || (ob->type == OB_SURF) || (ob->type == OB_FONT)
|| (ob->type == OB_MBALL) || (ob->type == OB_LATTICE))) {
str += sprintf(str, formatstr, "Edit Mode", OB_MODE_EDIT, ICON_EDITMODE_HLT);
}
else if (ob->type == OB_ARMATURE) {
if (ob->mode & OB_MODE_POSE)
str += sprintf(str, formatstr, "Edit Mode", OB_MODE_EDIT|OB_MODE_POSE, ICON_EDITMODE_HLT);
else
str += sprintf(str, formatstr, "Edit Mode", OB_MODE_EDIT, ICON_EDITMODE_HLT);
}
else if (ob->type == OB_ARMATURE) {
if (ob->mode & OB_MODE_POSE)
str += sprintf(str, formatstr, "Edit Mode", OB_MODE_EDIT|OB_MODE_POSE, ICON_EDITMODE_HLT);
else
str += sprintf(str, formatstr, "Edit Mode", OB_MODE_EDIT, ICON_EDITMODE_HLT);
}
if (ob->type == OB_MESH) {
str += sprintf(str, formatstr, "Sculpt Mode", OB_MODE_SCULPT, ICON_SCULPTMODE_HLT);
str += sprintf(str, formatstr, "Vertex Paint", OB_MODE_VERTEX_PAINT, ICON_VPAINT_HLT);
str += sprintf(str, formatstr, "Texture Paint", OB_MODE_TEXTURE_PAINT, ICON_TPAINT_HLT);
str += sprintf(str, formatstr, "Weight Paint", OB_MODE_WEIGHT_PAINT, ICON_WPAINT_HLT);
}
}
if (ob->type == OB_MESH) {
str += sprintf(str, formatstr, "Sculpt Mode", OB_MODE_SCULPT, ICON_SCULPTMODE_HLT);
str += sprintf(str, formatstr, "Vertex Paint", OB_MODE_VERTEX_PAINT, ICON_VPAINT_HLT);
str += sprintf(str, formatstr, "Texture Paint", OB_MODE_TEXTURE_PAINT, ICON_TPAINT_HLT);
str += sprintf(str, formatstr, "Weight Paint", OB_MODE_WEIGHT_PAINT, ICON_WPAINT_HLT);
}
/* if active object is an armature */
if (ob->type==OB_ARMATURE) {
str += sprintf(str, formatstr, "Pose Mode", OB_MODE_POSE, ICON_POSE_HLT);

@ -1341,9 +1341,9 @@ static int mouse_select(bContext *C, const int mval[2], short extend, short obce
if(oldbasact != basact) {
ED_base_object_activate(C, basact); /* adds notifier */
}
WM_event_add_notifier(C, NC_SCENE|ND_OB_SELECT, scene);
}
WM_event_add_notifier(C, NC_SCENE|ND_OB_SELECT, scene);
}
return retval;
@ -1848,7 +1848,7 @@ static int view3d_select_invoke(bContext *C, wmOperator *op, wmEvent *event)
view3d_operator_needs_opengl(C);
if(obedit) {
if(obedit && center==FALSE) {
if(obedit->type==OB_MESH)
retval = mouse_mesh(C, event->mval, extend);
else if(obedit->type==OB_ARMATURE)
@ -1895,7 +1895,7 @@ void VIEW3D_OT_select(wmOperatorType *ot)
/* properties */
RNA_def_boolean(ot->srna, "extend", 0, "Extend", "Extend selection instead of deselecting everything first.");
RNA_def_boolean(ot->srna, "center", 0, "Center", "Use the object center when selecting (object mode only).");
RNA_def_boolean(ot->srna, "center", 0, "Center", "Use the object center when selecting, in editmode used to extend object selection.");
RNA_def_boolean(ot->srna, "enumerate", 0, "Enumerate", "List objects under the mouse (object mode only).");
}

@ -770,7 +770,6 @@ static void rna_def_pointcache(BlenderRNA *brna)
prop= RNA_def_property(srna, "compression", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, point_cache_compress_items);
RNA_def_property_ui_text(prop, "Cache Compression", "Compression method to be used");
RNA_def_property_update(prop, 0, NULL);
/* flags */
prop= RNA_def_property(srna, "is_baked", PROP_BOOLEAN, PROP_NONE);

@ -241,13 +241,12 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna)
RNA_def_property_enum_sdna(prop, NULL, "cache_comp");
RNA_def_property_enum_items(prop, smoke_cache_comp_items);
RNA_def_property_ui_text(prop, "Cache Compression", "Compression method to be used");
RNA_def_property_update(prop, 0, NULL);
prop= RNA_def_property(srna, "collision_extents", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "border_collisions");
RNA_def_property_enum_items(prop, smoke_domain_colli_items);
RNA_def_property_ui_text(prop, "Border Collisions", "Selects which domain border will be treated as collision object.");
RNA_def_property_update(prop, 0, NULL);
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
prop= RNA_def_property(srna, "effector_weights", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "EffectorWeights");
@ -290,14 +289,12 @@ static void rna_def_smoke_flow_settings(BlenderRNA *brna)
RNA_def_property_range(prop, 0.001, 1);
RNA_def_property_ui_range(prop, 0.001, 1.0, 1.0, 4);
RNA_def_property_ui_text(prop, "Density", "");
RNA_def_property_update(prop, 0, NULL); // NC_OBJECT|ND_MODIFIER
prop= RNA_def_property(srna, "temperature", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "temp");
RNA_def_property_range(prop, -10, 10);
RNA_def_property_ui_range(prop, -10, 10, 1, 1);
RNA_def_property_ui_text(prop, "Temp. Diff.", "Temperature difference to ambient temperature");
RNA_def_property_update(prop, 0, NULL);
prop= RNA_def_property(srna, "particle_system", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "psys");
@ -309,24 +306,20 @@ static void rna_def_smoke_flow_settings(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_outflow", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "type", MOD_SMOKE_FLOW_TYPE_OUTFLOW);
RNA_def_property_ui_text(prop, "Outflow", "Deletes smoke from simulation");
RNA_def_property_update(prop, 0, NULL);
prop= RNA_def_property(srna, "use_absolute", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_FLOW_ABSOLUTE);
RNA_def_property_ui_text(prop, "Absolute Density", "Only allows given density value in emitter area.");
RNA_def_property_update(prop, 0, NULL);
prop= RNA_def_property(srna, "initial_velocity", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_FLOW_INITVELOCITY);
RNA_def_property_ui_text(prop, "Initial Velocity", "Smoke inherits it's velocity from the emitter particle");
RNA_def_property_update(prop, 0, NULL);
prop= RNA_def_property(srna, "velocity_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "vel_multi");
RNA_def_property_range(prop, -2.0, 2.0);
RNA_def_property_ui_range(prop, -2.0, 2.0, 0.05, 5);
RNA_def_property_ui_text(prop, "Multiplier", "Multiplier to adjust velocity passed to smoke");
RNA_def_property_update(prop, 0, NULL);
}
static void rna_def_smoke_coll_settings(BlenderRNA *brna)

@ -37,8 +37,6 @@
#include "BLI_math.h"
#include "BLI_utildefines.h"
extern void PyC_LineSpit(void);
#define MAX_DIMENSIONS 4
/* Swizzle axes get packed into a single value that is used as a closure. Each
@ -1161,28 +1159,18 @@ static PyObject *Vector_mul(PyObject *v1, PyObject *v2)
}
else if (vec1) {
if (MatrixObject_Check(v2)) {
extern void PyC_LineSpit(void);
/* VEC * MATRIX */
/* this is deprecated!, use the reverse instead */
float tvec[MAX_DIMENSIONS];
/* ------ to be removed ------*/
#ifndef MATH_STANDALONE
#ifdef WITH_ASSERT_ABORT
#if 1
PyErr_SetString(PyExc_ValueError,
"(Vector * Matrix) is now removed, reverse the "
"order (promoted to an Error for Debug builds)");
return NULL;
#else
printf("Warning: (Vector * Matrix) is now deprecated, "
"reverse the multiplication order in the script.\n");
PyC_LineSpit();
#endif
#endif /* ifndef MATH_STANDALONE */
/* ------ to be removed ------*/
/* VEC * MATRIX */
/* this is deprecated!, use the reverse instead */
float tvec[MAX_DIMENSIONS];
if(BaseMath_ReadCallback((MatrixObject *)v2) == -1)
return NULL;
@ -1191,9 +1179,18 @@ static PyObject *Vector_mul(PyObject *v1, PyObject *v2)
}
return newVectorObject(tvec, vec1->size, Py_NEW, Py_TYPE(vec1));
#endif
/* ------ to be removed ------*/
}
else if (QuaternionObject_Check(v2)) {
/* VEC * QUAT */
/* ------ to be removed ------*/
#if 1
PyErr_SetString(PyExc_ValueError,
"(Vector * Quat) is now removed, reverse the "
"order (promoted to an Error for Debug builds)");
return NULL;
#else
QuaternionObject *quat2 = (QuaternionObject*)v2;
float tvec[3];
@ -1207,26 +1204,11 @@ static PyObject *Vector_mul(PyObject *v1, PyObject *v2)
return NULL;
}
/* ------ to be removed ------*/
#ifndef MATH_STANDALONE
#ifdef WITH_ASSERT_ABORT
PyErr_SetString(PyExc_ValueError,
"(Vector * Quat) is now removed, reverse the "
"order (promoted to an Error for Debug builds)");
return NULL;
#else
printf("Warning: (Vector * Quat) is now deprecated, "
"reverse the multiplication order in the script.\n");
PyC_LineSpit();
#endif
#endif /* ifndef MATH_STANDALONE */
/* ------ to be removed ------*/
copy_v3_v3(tvec, vec1->vec);
mul_qt_v3(quat2->quat, tvec);
return newVectorObject(tvec, 3, Py_NEW, Py_TYPE(vec1));
#endif
/* ------ to be removed ------*/
}
else if (((scalar= PyFloat_AsDouble(v2)) == -1.0f && PyErr_Occurred())==0) { /* VEC * FLOAT */
return vector_mul_float(vec1, scalar);
@ -1260,6 +1242,14 @@ static PyObject *Vector_imul(PyObject *v1, PyObject *v2)
/* only support vec*=float and vec*=mat
vec*=vec result is a float so that wont work */
if (MatrixObject_Check(v2)) {
/* ------ to be removed ------*/
#if 1
PyErr_SetString(PyExc_ValueError,
"(Vector *= Matrix) is now removed, reverse the "
"order (promoted to an Error for Debug builds) "
"and uses the non in-place multiplication.");
return NULL;
#else
float rvec[MAX_DIMENSIONS];
if(BaseMath_ReadCallback((MatrixObject *)v2) == -1)
return NULL;
@ -1267,28 +1257,21 @@ static PyObject *Vector_imul(PyObject *v1, PyObject *v2)
if(column_vector_multiplication(rvec, vec, (MatrixObject*)v2) == -1)
return NULL;
/* ------ to be removed ------*/
#ifndef MATH_STANDALONE
#ifdef WITH_ASSERT_ABORT
PyErr_SetString(PyExc_ValueError,
"(Vector *= Matrix) is now removed, reverse the "
"order (promoted to an Error for Debug builds) "
"and uses the non in-place multiplication.");
return NULL;
#else
printf("Warning: (Vector *= Matrix) is now deprecated, "
"reverse the (non in-place) multiplication order in the script.\n");
PyC_LineSpit();
#endif
#endif /* ifndef MATH_STANDALONE */
/* ------ to be removed ------*/
memcpy(vec->vec, rvec, sizeof(float) * vec->size);
#endif
/* ------ to be removed ------*/
}
else if (QuaternionObject_Check(v2)) {
/* VEC *= QUAT */
/* ------ to be removed ------*/
#if 1
PyErr_SetString(PyExc_ValueError,
"(Vector *= Quat) is now removed, reverse the "
"order (promoted to an Error for Debug builds) "
"and uses the non in-place multiplication.");
return NULL;
#else
QuaternionObject *quat2 = (QuaternionObject*)v2;
if(vec->size != 3) {
@ -1302,25 +1285,9 @@ static PyObject *Vector_imul(PyObject *v1, PyObject *v2)
return NULL;
}
/* ------ to be removed ------*/
#ifndef MATH_STANDALONE
#ifdef WITH_ASSERT_ABORT
PyErr_SetString(PyExc_ValueError,
"(Vector *= Quat) is now removed, reverse the "
"order (promoted to an Error for Debug builds) "
"and uses the non in-place multiplication.");
return NULL;
#else
printf("Warning: (Vector *= Quat) is now deprecated, "
"reverse the (non in-place) multiplication order in the script.\n");
PyC_LineSpit();
#endif
#endif /* ifndef MATH_STANDALONE */
/* ------ to be removed ------*/
mul_qt_v3(quat2->quat, vec->vec);
#endif
/* ------ to be removed ------*/
}
else if (((scalar= PyFloat_AsDouble(v2)) == -1.0f && PyErr_Occurred())==0) { /* VEC *= FLOAT */
mul_vn_fl(vec->vec, vec->size, scalar);