copied across changes which were missed by merging.

This commit is contained in:
2011-05-09 02:45:52 +00:00
parent 6ef77cf95a
commit 14a2330d7b
138 changed files with 156 additions and 22164 deletions

View File

@@ -1339,9 +1339,9 @@ static int pose_group_assign_exec (bContext *C, wmOperator *op)
/* add selected bones to group then */
CTX_DATA_BEGIN(C, bPoseChannel*, pchan, selected_pose_bones)
{
pchan->agrp_index= pose->active_group;
done= 1;
}
pchan->agrp_index= pose->active_group;
done= 1;
}
CTX_DATA_END;
/* notifiers for updates */

View File

@@ -4455,9 +4455,9 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, wmEvent *event)
/* RMB has two options now */
if (ui_but_menu(C, but)) {
return WM_UI_HANDLER_BREAK;
}
}
}
}
/* verify if we can edit this button */
if(ELEM(event->type, LEFTMOUSE, RETKEY)) {

View File

@@ -40,16 +40,17 @@ set(SRC
loopcut.c
mesh_ops.c
editbmesh_bvh.c
editbmesh_bvh.h
editbmesh_add.c
bmeshutils.c
mesh_intern.h
bmesh_selecthistory.c
bmesh_select.c
mesh_data.c
bmesh_tools.c
knifetool.c
editface.c
editbmesh_bvh.h
mesh_intern.h
)
blender_add_lib(bf_editor_mesh "${SRC}" "${INC}")

View File

@@ -4474,6 +4474,7 @@ struct facesort {
struct EditFace *efa;
};
#if 0 /* UNUSED */
static int vergface(const void *v1, const void *v2)
{
const struct facesort *x1=v1, *x2=v2;
@@ -4482,15 +4483,18 @@ static int vergface(const void *v1, const void *v2)
else if( x1->x < x2->x) return -1;
return 0;
}
#endif
// XXX is this needed?
/* called from buttons */
#if 0 /* UNUSED */
static void xsortvert_flag__doSetX(void *userData, EditVert *UNUSED(eve), int x, int UNUSED(y), int index)
{
xvertsort *sortblock = userData;
sortblock[index].x = x;
}
#endif
/* all verts with (flag & 'flag') are sorted */
static void xsortvert_flag(bContext *UNUSED(C), int UNUSED(flag))

View File

@@ -1809,6 +1809,7 @@ static int join_poll(bContext *C)
return 0;
}
static int join_exec(bContext *C, wmOperator *op)
{
Scene *scene= CTX_data_scene(C);
@@ -1822,7 +1823,7 @@ static int join_exec(bContext *C, wmOperator *op)
BKE_report(op->reports, RPT_ERROR, "Can't edit external libdata.");
return OPERATOR_CANCELLED;
}
if(ob->type == OB_MESH)
return join_mesh_exec(C, op);
else if(ELEM(ob->type, OB_CURVE, OB_SURF))

View File

@@ -388,7 +388,7 @@ static void test_constraints (Object *owner, bPoseChannel *pchan)
}
else if (curcon->type == CONSTRAINT_TYPE_SPLINEIK) {
bSplineIKConstraint *data = curcon->data;
/* if the number of points does not match the amount required by the chain length,
* free the points array and request a rebind...
*/

View File

@@ -415,7 +415,7 @@ void ED_object_enter_editmode(bContext *C, int flag)
if(base==NULL) return;
else if(v3d && (base->lay & v3d->lay)==0) return;
else if(!v3d && (base->lay & scene->lay)==0) return;
else if(!v3d && (base->lay & scene->lay)==0) return;
}
else {
base= scene->basact;
@@ -1847,7 +1847,7 @@ static void ofs_timeoffs(Scene *scene, View3D *v3d)
ob->sf += offset;
if (ob->sf < -MAXFRAMEF) ob->sf = -MAXFRAMEF;
else if (ob->sf > MAXFRAMEF) ob->sf = MAXFRAMEF;
}
}
CTX_DATA_END;
}

View File

@@ -954,7 +954,7 @@ static int track_set_exec(bContext *C, wmOperator *op)
Object *obact= ED_object_active_context(C);
int type= RNA_enum_get(op->ptr, "type");
if(type == 1) {
bConstraint *con;
bDampTrackConstraint *data;
@@ -1194,7 +1194,7 @@ static int make_links_scene_exec(bContext *C, wmOperator *op)
if(scene_to == CTX_data_scene(C)) {
BKE_report(op->reports, RPT_ERROR, "Can't link objects into the same scene");
return OPERATOR_CANCELLED;
}
}
if(scene_to->id.lib) {
BKE_report(op->reports, RPT_ERROR, "Can't link objects into a linked scene");
@@ -1205,11 +1205,11 @@ static int make_links_scene_exec(bContext *C, wmOperator *op)
{
if(!object_in_scene(base->object, scene_to)) {
Base *nbase= MEM_mallocN( sizeof(Base), "newbase");
*nbase= *base;
*nbase= *base;
BLI_addhead( &(scene_to->base), nbase);
id_us_plus((ID *)base->object);
}
}
id_us_plus((ID *)base->object);
}
}
CTX_DATA_END;
DAG_ids_flush_update(bmain, 0);
@@ -1299,7 +1299,7 @@ static int make_links_data_exec(bContext *C, wmOperator *op)
object_link_modifiers(obt, ob);
obt->recalc |= OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME;
break;
}
}
}
}
}

View File

@@ -661,12 +661,13 @@ static int object_origin_set_exec(bContext *C, wmOperator *op)
if(v3d && !RNA_property_is_set(op->ptr, "around"))
around= v3d->around;
}
zero_v3(cent);
if(obedit) {
INIT_MINMAX(min, max);
if(obedit->type==OB_MESH) {
INIT_MINMAX(min, max);
if(obedit->type==OB_MESH) {
Mesh *me= obedit->data;
BMEditMesh *em = me->edit_btmesh;
BMVert *eve;
@@ -694,7 +695,7 @@ static int object_origin_set_exec(bContext *C, wmOperator *op)
BM_ITER(eve, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
sub_v3_v3(eve->co, cent);
}
EDBM_RecalcNormals(em);
tot_change++;
DAG_id_tag_update(&obedit->id, OB_RECALC_DATA);

View File

@@ -510,7 +510,6 @@ void ED_vgroup_vert_remove(Object *ob, bDeformGroup *dg, int vertnum)
ED_vgroup_nr_vert_remove(ob, def_nr, vertnum);
}
static float get_vert_def_nr(Object *ob, int def_nr, int vertnum)
{
MDeformVert *dvert= NULL;
@@ -1173,6 +1172,7 @@ static void vgroup_delete_object_mode(Object *ob, bDeformGroup *dg)
ob->actdef= 1;
}
/* only in editmode */
/* removes from active defgroup, if allverts==0 only selected vertices */
static void vgroup_active_remove_verts(Object *ob, const int allverts, bDeformGroup *dg)

View File

@@ -1,68 +0,0 @@
#
# $Id$
#
# ***** 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.
#
# The Original Code is Copyright (C) 2007 Blender Foundation
# All rights reserved.
#
# The Original Code is: all of this file.
#
# Contributor(s): none yet.
#
# ***** END GPL LICENSE BLOCK *****
#
# Makes module object directory and bounces make to subdirectories.
LIBNAME = ed_screen
DIR = $(OCGDIR)/blender/$(LIBNAME)
include nan_compile.mk
CFLAGS += $(LEVEL_1_C_WARNINGS)
CPPFLAGS += -I$(NAN_GLEW)/include
CPPFLAGS += -I$(OPENGL_HEADERS)
# not very neat....
CPPFLAGS += -I../../windowmanager
CPPFLAGS += -I../../blenloader
CPPFLAGS += -I../../blenkernel
CPPFLAGS += -I../../bmesh
CPPFLAGS += -I../../blenlib
CPPFLAGS += -I../../makesdna
CPPFLAGS += -I../../makesrna
CPPFLAGS += -I../../imbuf
CPPFLAGS += -I../../python
CPPFLAGS += -I../../render/extern/include
CPPFLAGS += -I../../blenfont
CPPFLAGS += -I../../gpu
CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
# own include
CPPFLAGS += -I../include
ifeq ($(WITH_OPENEXR), true)
CPPFLAGS += -DWITH_OPENEXR
endif
ifeq ($(OS), darwin)
ifeq ($(WITH_BF_OPENMP), true)
CPPFLAGS += -DPARALLEL=1
endif
endif

View File

@@ -1,76 +0,0 @@
#
# $Id$
#
# ***** 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.
#
# The Original Code is Copyright (C) 2007 Blender Foundation
# All rights reserved.
#
# The Original Code is: all of this file.
#
# Contributor(s): none yet.
#
# ***** END GPL LICENSE BLOCK *****
#
# Makes module object directory and bounces make to subdirectories.
LIBNAME = ed_file
DIR = $(OCGDIR)/blender/$(LIBNAME)
include nan_compile.mk
CFLAGS += $(LEVEL_1_C_WARNINGS)
CPPFLAGS += -I$(NAN_GLEW)/include
CPPFLAGS += -I$(OPENGL_HEADERS)
# not very neat....
CPPFLAGS += -I../../windowmanager
CPPFLAGS += -I../../blenloader
CPPFLAGS += -I../../blenkernel
CPPFLAGS += -I../../blenlib
CPPFLAGS += -I../../makesdna
CPPFLAGS += -I../../makesrna
CPPFLAGS += -I../../imbuf
CPPFLAGS += -I../../render/extern/include
CPPFLAGS += -I../../python
CPPFLAGS += -I../../blenfont
CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
# own include
CPPFLAGS += -I../include
ifeq ($(WITH_OPENJPEG),true)
CPPFLAGS += -DWITH_OPENJPEG
endif
ifeq ($(WITH_OPENEXR), true)
CPPFLAGS += -DWITH_OPENEXR
endif
ifeq ($(WITH_TIFF), true)
CPPFLAGS += -DWITH_TIFF
endif
ifeq ($(WITH_CINEON), true)
CPPFLAGS += -DWITH_CINEON
endif
ifeq ($(WITH_HDR), true)
CPPFLAGS += -DWITH_HDR
endif

View File

@@ -1,77 +0,0 @@
#
# $Id$
#
# ***** 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.
#
# The Original Code is Copyright (C) 2007 Blender Foundation
# All rights reserved.
#
# The Original Code is: all of this file.
#
# Contributor(s): none yet.
#
# ***** END GPL LICENSE BLOCK *****
#
# Makes module object directory and bounces make to subdirectories.
LIBNAME = ed_image
DIR = $(OCGDIR)/blender/$(LIBNAME)
include nan_compile.mk
CFLAGS += $(LEVEL_1_C_WARNINGS)
CPPFLAGS += -I$(NAN_GLEW)/include
CPPFLAGS += -I$(OPENGL_HEADERS)
# not very neat....
CPPFLAGS += -I../../windowmanager
CPPFLAGS += -I../../blenkernel
CPPFLAGS += -I../../blenlib
CPPFLAGS += -I../../makesdna
CPPFLAGS += -I../../makesrna
CPPFLAGS += -I../../imbuf
CPPFLAGS += -I../../python
CPPFLAGS += -I../../render/extern/include
CPPFLAGS += -I../../bmesh
CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
# own include
CPPFLAGS += -I../include
ifeq ($(WITH_OPENEXR), true)
CPPFLAGS += -DWITH_OPENEXR
endif
ifeq ($(WITH_TIFF), true)
CPPFLAGS += -DWITH_TIFF
endif
ifeq ($(WITH_LCMS), true)
CPPFLAGS += -DWITH_LCMS
CPPFLAGS += -I$(BF_LCMS_INC)
endif
ifeq ($(WITH_CINEON), true)
CPPFLAGS += -DWITH_CINEON
endif
ifeq ($(WITH_HDR), true)
CPPFLAGS += -DWITH_HDR
endif

View File

@@ -1,56 +0,0 @@
#
# $Id$
#
# ***** 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.
#
# The Original Code is Copyright (C) 2007 Blender Foundation
# All rights reserved.
#
# The Original Code is: all of this file.
#
# Contributor(s): none yet.
#
# ***** END GPL LICENSE BLOCK *****
#
# Makes module object directory and bounces make to subdirectories.
LIBNAME = ed_info
DIR = $(OCGDIR)/blender/$(LIBNAME)
include nan_compile.mk
CFLAGS += $(LEVEL_1_C_WARNINGS)
CPPFLAGS += -I$(NAN_GLEW)/include
CPPFLAGS += -I$(OPENGL_HEADERS)
# not very neat....
CPPFLAGS += -I../../windowmanager
CPPFLAGS += -I../../blenloader
CPPFLAGS += -I../../blenkernel
CPPFLAGS += -I../../blenlib
CPPFLAGS += -I../../makesdna
CPPFLAGS += -I../../makesrna
CPPFLAGS += -I../../imbuf
CPPFLAGS += -I../../python
CPPFLAGS += -I../../bmesh
CPPFLAGS += -I../../blenfont
CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
# own include
CPPFLAGS += -I../include

View File

@@ -163,7 +163,7 @@ void GPU_lamp_shadow_buffer_bind(GPULamp *lamp, float viewmat[][4], int *winsize
void GPU_lamp_shadow_buffer_unbind(GPULamp *lamp);
void GPU_lamp_update(GPULamp *lamp, int lay, int hide, float obmat[][4]);
void GPU_lamp_update_colors(GPULamp *lamp, float r, float g, float b, float power);
void GPU_lamp_update_colors(GPULamp *lamp, float r, float g, float b, float energy);
int GPU_lamp_shadow_layer(GPULamp *lamp);
#ifdef __cplusplus

View File

@@ -1127,12 +1127,14 @@ static IK_Scene* convert_tree(Scene *blscene, Object *ob, bPoseChannel *pchan)
KDL::Frame tip(iTaSC::F_identity);
Vector3 *fl = bone->bone_mat;
KDL::Frame head(KDL::Rotation(
fl[0][0], fl[1][0], fl[2][0],
fl[0][1], fl[1][1], fl[2][1],
fl[0][2], fl[1][2], fl[2][2]),
KDL::Vector(bone->head[0], bone->head[1], bone->head[2])*scale);
KDL::Rotation brot(
fl[0][0], fl[1][0], fl[2][0],
fl[0][1], fl[1][1], fl[2][1],
fl[0][2], fl[1][2], fl[2][2]);
KDL::Vector bpos(bone->head[0], bone->head[1], bone->head[2]);
bpos = bpos*scale;
KDL::Frame head(brot, bpos);
// rest pose length of the bone taking scaling into account
length= bone->length*scale;
parent = (a > 0) ? ikscene->channels[tree->parent[a]].tail : root;

View File

@@ -49,7 +49,6 @@ targetdir = normpath(root_build_dir + '/makesdna')
if not (root_build_dir[0]==os.sep or root_build_dir[1]==':'):
targetdir = '#' + targetdir
#root_build_dir = "#"
makesdna = makesdna_tool.Program (target = targetdir, source = source_files, LIBS=['bf_intern_guardedalloc', 'bf_blenlib'])
@@ -57,8 +56,6 @@ dna_dict = dna.Dictionary()
dna.Depends ('dna.c', makesdna)
dna.Depends ('dna.c', header_files)
ap = os.path.abspath
if env['OURPLATFORM'] != 'linuxcross':
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc', 'win32-mingw'):
dna.Command ('dna.c', '', "\"" + root_build_dir+os.sep+"makesdna\" $TARGET")

View File

@@ -983,8 +983,6 @@ int make_structDNA(char *baseDirectory, FILE *file)
dna_write(file, str, 4);
len= nr_names;
dna_write(file, &len, 4);
printf("LEEEN %d\n", len);
/* calculate size of datablock with strings */
cp= names[nr_names-1];

View File

@@ -151,6 +151,7 @@ rna.Depends (generated_files, makesrna)
# this seems bad, how to retrieve it from scons?
build_dir = root_build_dir + os.sep +'source' + os.sep + 'blender' + os.sep + 'makesrna' + os.sep + 'intern' + os.sep
if env['OURPLATFORM'] != 'linuxcross':
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc', 'win32-mingw'):
rna.Command (generated_files, '', "\"" + root_build_dir+os.sep+"makesrna.exe\" \"" + build_dir )

View File

@@ -1588,7 +1588,6 @@ static void rna_def_function_funcs(FILE *f, StructDefRNA *dsrna, FunctionDefRNA
fprintf(f, "\t_retdata= _data;\n");
else {
const char *data_str;
if (cptr || (flag & PROP_DYNAMIC)) {
ptrstr= "**";
valstr= "*";

View File

@@ -2031,7 +2031,7 @@ void RNA_def_constraint(BlenderRNA *brna)
/* flags */
prop= RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", CONSTRAINT_OFF);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_OFF);
RNA_def_property_ui_text(prop, "Disable", "Enable/Disable Constraint");
prop= RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE);

View File

@@ -49,7 +49,7 @@
#include "ED_keyframing.h"
#include "ED_keyframes_edit.h"
EnumPropertyItem fmodifier_type_items[] = {
{FMODIFIER_TYPE_NULL, "NULL", 0, "Invalid", ""},
{FMODIFIER_TYPE_GENERATOR, "GENERATOR", 0, "Generator", ""},

View File

@@ -1603,7 +1603,6 @@ static void rna_def_object_modifiers(BlenderRNA *brna, PropertyRNA *cprop)
func= RNA_def_function(srna, "remove", "rna_Object_modifier_remove");
RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Remove an existing modifier from the object.");
/* target to remove*/
parm= RNA_def_pointer(func, "modifier", "Modifier", "", "Modifier to remove.");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);

View File

@@ -1,2 +1 @@
# See svn history for example formatting for this file, currently this isnt in use.

View File

@@ -11,4 +11,3 @@ mv out_work_lost_work.txt rna_properties_lost.txt
cat rna_properties.txt | grep -v "^#" > rna_properties_edits.txt
./rna_cleaner.py rna_properties.txt
echo "Updated: rna_properties.txt rna_properties_edits.txt rna_properties_lost.txt "

View File

@@ -43,7 +43,7 @@ static bNodeSocketType sh_node_output_in[]= {
static void node_shader_exec_output(void *data, bNode *node, bNodeStack **in, bNodeStack **UNUSED(out))
{
if(data && in[0] && in[1]) {
if(data) {
ShadeInput *shi= ((ShaderCallData *)data)->shi;
float col[4];

File diff suppressed because it is too large Load Diff

View File

@@ -1,128 +0,0 @@
/*
* $Id: BPY_menus.h 12931 2007-12-17 18:20:48Z theeth $
*
* ***** BEGIN GPL/BL DUAL 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. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* This is a new part of Blender.
*
* Contributor(s): Willian P. Germano, Matt Ebb
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
#ifndef BPY_MENUS_H
#define BPY_MENUS_H
/* This header exposes BPyMenu related public declarations. The implementation
* adds 'dynamic' menus to Blender, letting scripts register themselves in any
* of a few pre-defined (trivial to upgrade) places in menus. These places or
* slots are called groups here (Import, Export, etc). This is how it works:
* - scripts at dirs user pref U.pythondir and .blender/scripts/ are scanned
* for registration info.
* - this data is also saved to a Bpymenus file at the user's .blender/ dir and
* only re-created when the scripts folder gets modified.
* - on start-up Blender uses this info to fill a table, which is used to
* create the menu entries when they are needed (see header_info.c or
* header_script.c, under source/blender/src/, for examples).
*/
/* These two structs hold py menu/submenu info.
* BPyMenu holds a script's name (as should appear in the menu) and filename,
* plus an optional list of submenus. Each submenu is related to a string
* (arg) that the script can get from the __script__ pydict, to know which
* submenu was chosen. */
typedef struct BPySubMenu {
char *name;
char *arg;
struct BPySubMenu *next;
} BPySubMenu;
typedef struct BPyMenu {
char *name;
char *filename;
char *tooltip;
short version; /* Blender version */
int dir; /* 0: default, 1: U.pythondir */
struct BPySubMenu *submenus;
struct BPyMenu *next;
} BPyMenu;
/* Scripts can be added to only a few pre-defined places in menus, like
* File->Import, File->Export, etc. (for speed and better control).
* To make a new menu 'slot' available for scripts:
* - add an entry to the enum below, before PYMENU_TOTAL, of course;
* - update the bpymenu_group_atoi() and BPyMenu_group_itoa() functions in
* BPY_menus.c;
* - add the necessary code to the header_***.c file in
* source/blender/src/, like done in header_info.c for import/export;
*/
typedef enum {
PYMENU_ADD,/* creates new objects */
PYMENU_ANIMATION,
PYMENU_EXPORT,
PYMENU_IMPORT,
PYMENU_MATERIALS,
PYMENU_MESH,
PYMENU_MISC,
PYMENU_OBJECT,
PYMENU_RENDER,/* exporters to external renderers */
PYMENU_SYSTEM,
PYMENU_THEMES,
PYMENU_UV,/* UV editing tools, to go in UV/Image editor space, 'UV' menu */
PYMENU_IMAGE,/* Image editing tools, to go in UV/Image editor space, 'Image' menu */
PYMENU_WIZARDS,/* complex 'app' scripts */
/* entries put after Wizards don't appear at the Scripts win->Scripts menu;
* see define right below */
PYMENU_FACESELECT,
PYMENU_WEIGHTPAINT,
PYMENU_VERTEXPAINT,
PYMENU_UVCALCULATION,
PYMENU_ARMATURE,
PYMENU_SCRIPTTEMPLATE,
PYMENU_HELP,/*Main Help menu items - prob best to leave for 'official' ones*/
PYMENU_HELPSYSTEM,/* Resources, troubleshooting, system tools */
PYMENU_HELPWEBSITES,/* Help -> Websites submenu */
PYMENU_MESHFACEKEY, /* face key in mesh editmode */
PYMENU_ADDMESH, /* adds mesh */
PYMENU_TOTAL
} PYMENUHOOKS;
#define PYMENU_SCRIPTS_MENU_TOTAL (PYMENU_WIZARDS + 1)
/* BPyMenuTable holds all registered pymenus, as linked lists for each menu
* where they can appear (see PYMENUHOOKS enum above).
*/
extern BPyMenu *BPyMenuTable[]; /* defined in BPY_menus.c */
/* public functions: */
int BPyMenu_Init( int usedir );
void BPyMenu_RemoveAllEntries( void );
void BPyMenu_PrintAllEntries( void );
char *BPyMenu_CreatePupmenuStr( BPyMenu * pym, short group );
char *BPyMenu_group_itoa( short group );
struct BPyMenu *BPyMenu_GetEntry( short group, short pos );
#endif /* BPY_MENUS_H */

View File

@@ -1,34 +0,0 @@
#
# $Id$
#
# ***** 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.
#
# The Original Code is Copyright (C) Blender Foundation.
# All rights reserved.
#
# The Original Code is: all of this file.
#
# Contributor(s): none yet.
#
# ***** END GPL LICENSE BLOCK *****
#
# Bounces make to subdirectories.
SOURCEDIR = source/blender/python
DIRS = intern generic
include nan_subdirs.mk

View File

@@ -1,753 +0,0 @@
# ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# Contributor(s): Campbell Barton
#
# #**** END GPL LICENSE BLOCK #****
script_help_msg = '''
Usage,
run this script from blenders root path once you have compiled blender
./blender.bin -P source/blender/python/epy_doc_gen.py
This will generate python files in "./source/blender/python/doc/bpy"
Generate html docs by running...
epydoc source/blender/python/doc/bpy/ -v \\
-o source/blender/python/doc/html \\
--inheritance=included \\
--no-sourcecode \\
--graph=classtree \\
--graph-font-size=8
'''
# if you dont have graphvis installed ommit the --graph arg.
# GLOBALS['BASEDIR'] = './source/blender/python/doc'
import os
SUBMODULES = {}
INIT_SUBMODULES = {} # store initialized files
INIT_SUBMODULES_IMPORTS = {} # dont import the same module twice
def append_package(package_path, mod_name):
init_path = os.path.join(os.path.dirname(package_path), "__init__.py")
# avoid double ups
if mod_name:
imports = INIT_SUBMODULES_IMPORTS.setdefault(init_path, [])
if mod_name in imports:
return
imports.append(mod_name)
try:
os.makedirs(os.path.dirname(init_path)) # make the dirs if they are not there
except:
pass
# Open the new file for the first time, otherwise keep it open.
f = INIT_SUBMODULES.get(init_path)
if f == None:
f = INIT_SUBMODULES[init_path] = open(init_path, 'w')
if mod_name:
f.write("import %s\n" % mod_name)
return f
def append_package_recursive(package_path, BASEPATH):
'''
assume the last item of package_path will be a file (not a dir thats created)
'''
package_path = os.path.splitext(package_path)[0] # incase of .py
try:
os.makedirs(os.path.join(BASEPATH, os.path.dirname(package_path))) # make the dirs if they are not there
except:
pass
new_path = BASEPATH
for mod_name in package_path.split(os.sep):
init_path = os.path.join(new_path, "__init__.py")
new_path = os.path.join(new_path, mod_name)
append_package(init_path, mod_name)
def open_submodule(subpath, BASEPATH):
'''
This is a utility function that lets us quickly add submodules
'''
# create all the package paths leading up to this module
append_package_recursive(subpath, BASEPATH)
module_name = os.path.basename( os.path.splitext(subpath)[0] )
mod_path = os.path.join(BASEPATH, subpath)
# Open the new file for the first time, otherwise keep it open.
f = SUBMODULES.get(mod_path)
if f == None:
f = SUBMODULES[mod_path] = open(mod_path, 'w')
f = open(mod_path, 'w')
return f
def close_all():
for files in (INIT_SUBMODULES.values(), SUBMODULES.values()):
for f in files:
if f.name.endswith('.py'):
f_name = f.name
f.close()
f = open(f_name, 'a')
f.write("\ndel __package__\n") # annoying, no need do show this
f.close()
def range_str(val):
if val < -10000000: return '-inf'
if val > 10000000: return 'inf'
if type(val)==float:
return '%g' % val
else:
return str(val)
def get_array_str(length):
if length > 0: return ' array of %d items' % length
else: return ''
def full_rna_struct_path(rna_struct):
'''
Needed when referencing one struct from another
'''
nested = rna_struct.nested
if nested:
return "%s.%s" % (full_rna_struct_path(nested), rna_struct.identifier)
else:
return rna_struct.identifier
def rna_id_ignore(rna_id):
if rna_id == "rna_type":
return True
if "_OT_" in rna_id:
return True
if "_MT_" in rna_id:
return True
if "_PT_" in rna_id:
return True
return False
def write_func(rna, ident, out, func_type):
# Keyword attributes
kw_args = [] # "foo = 1", "bar=0.5", "spam='ENUM'"
kw_arg_attrs = [] # "@type mode: int"
rna_struct= rna.rna_type
# Operators and functions work differently
if func_type=='OPERATOR':
rna_func_name = rna_struct.identifier.split("_OT_")[-1]
rna_func_desc = rna_struct.description.strip()
items = rna_struct.properties.items()
else:
rna_func_name = rna.identifier
rna_func_desc = rna.description.strip()
items = rna.parameters.items()
for rna_prop_identifier, rna_prop in items:
if rna_id_ignore(rna_prop_identifier):
continue
# clear vars
val = val_error = val_str = rna_prop_type = None
# ['rna_type', 'name', 'array_length', 'description', 'hard_max', 'hard_min', 'identifier', 'precision', 'readonly', 'soft_max', 'soft_min', 'step', 'subtype', 'type']
#rna_prop= op_rna.rna_type.properties[attr]
rna_prop_type = rna_prop.type.lower() # enum, float, int, boolean
# only for rna functions, operators should not get pointers as args
if rna_prop_type=='pointer':
rna_prop_type_refine = "L{%s}" % rna_prop.fixed_type.identifier
else:
# Collections/Arrays can have a srna type
rna_prop_srna_type = rna_prop.srna
if rna_prop_srna_type:
print(rna_prop_srna_type.identifier)
rna_prop_type_refine = "L{%s}" % rna_prop_srna_type.identifier
else:
rna_prop_type_refine = rna_prop_type
del rna_prop_srna_type
try: length = rna_prop.array_length
except: length = 0
array_str = get_array_str(length)
if rna_prop.use_return:
kw_type_str= "@rtype: %s%s" % (rna_prop_type_refine, array_str)
kw_param_str= "@return: %s" % (rna_prop.description.strip())
else:
kw_type_str= "@type %s: %s%s" % (rna_prop_identifier, rna_prop_type_refine, array_str)
kw_param_str= "@param %s: %s" % (rna_prop_identifier, rna_prop.description.strip())
kw_param_set = False
if func_type=='OPERATOR':
try:
val = getattr(rna, rna_prop_identifier)
val_error = False
except:
val = "'<UNDEFINED>'"
val_error = True
if val_error:
val_str = val
elif rna_prop_type=='float':
if length==0:
val_str= '%g' % val
if '.' not in val_str and '-' not in val_str: # value could be 1e-05
val_str += '.0'
else:
# array
val_str = str(tuple(val))
kw_param_str += (' in (%s, %s)' % (range_str(rna_prop.hard_min), range_str(rna_prop.hard_max)))
kw_param_set= True
elif rna_prop_type=='int':
if length==0:
val_str='%d' % val
else:
val_str = str(tuple(val))
# print(dir(rna_prop))
kw_param_str += (' in (%s, %s)' % (range_str(rna_prop.hard_min), range_str(rna_prop.hard_max)))
# These strings dont have a max length???
#kw_param_str += ' (maximum length of %s)' % (rna_prop.max_length)
kw_param_set= True
elif rna_prop_type=='boolean':
if length==0:
if val: val_str='True'
else: val_str='False'
else:
val_str = str(tuple(val))
elif rna_prop_type=='enum':
# no array here?
val_str="'%s'" % val
# Too cramped
kw_param_str += (' in (%s)' % ', '.join(rna_prop.items.keys()))
kw_param_set= True
elif rna_prop_type=='string':
# no array here?
val_str='"%s"' % val
# todo - collection - array
# print (rna_prop.type)
kw_args.append('%s = %s' % (rna_prop_identifier, val_str))
# stora
else:
# currently functions dont have a default value
if not rna_prop.use_return:
kw_args.append('%s' % (rna_prop_identifier))
else:
kw_param_set = True
# Same for operators and functions
kw_arg_attrs.append(kw_type_str)
if kw_param_set:
kw_arg_attrs.append(kw_param_str)
out.write(ident+'def %s(%s):\n' % (rna_func_name, ', '.join(kw_args)))
out.write(ident+'\t"""\n')
# Descriptions could be multiline
for rna_func_desc_line in rna_func_desc.split('\n'):
out.write(ident+'\t%s\n' % rna_func_desc_line.strip())
for desc in kw_arg_attrs:
out.write(ident+'\t%s\n' % desc)
# out.write(ident+'\t@rtype: None\n') # implicit
out.write(ident+'\t"""\n')
def rna2epy(BASEPATH):
# Use for faster lookups
# use rna_struct.identifier as the key for each dict
rna_struct_dict = {} # store identifier:rna lookups
rna_full_path_dict = {} # store the result of full_rna_struct_path(rna_struct)
rna_children_dict = {} # store all rna_structs nested from here
rna_references_dict = {} # store a list of rna path strings that reference this type
rna_functions_dict = {} # store all functions directly in this type (not inherited)
rna_words = set()
# def write_func(rna_func, ident):
def write_struct(rna_struct, ident):
identifier = rna_struct.identifier
rna_base = rna_struct.base
if rna_base:
out.write(ident+ 'class %s(%s):\n' % (identifier, rna_base.identifier))
rna_base_prop_keys = rna_base.properties.keys() # could be cached
rna_base_func_keys = [f.identifier for f in rna_base.functions]
else:
out.write(ident+ 'class %s:\n' % identifier)
rna_base_prop_keys = []
rna_base_func_keys = []
out.write(ident+ '\t"""\n')
title = 'The %s Object' % rna_struct.name
description = rna_struct.description.strip()
out.write(ident+ '\t%s\n' % title)
out.write(ident+ '\t%s\n' % ('=' * len(title)))
out.write(ident+ '\t\t%s\n' % description)
rna_words.update(description.split())
# For convenience, give a list of all places were used.
rna_refs= rna_references_dict[identifier]
if rna_refs:
out.write(ident+ '\t\t\n')
out.write(ident+ '\t\tReferences\n')
out.write(ident+ '\t\t==========\n')
for rna_ref_string in rna_refs:
out.write(ident+ '\t\t\t- L{%s}\n' % rna_ref_string)
out.write(ident+ '\t\t\n')
else:
out.write(ident+ '\t\t\n')
out.write(ident+ '\t\t(no references to this struct found)\n')
out.write(ident+ '\t\t\n')
for rna_prop_identifier, rna_prop in rna_struct.properties.items():
if rna_prop_identifier=='RNA': continue
if rna_id_ignore(rna_prop_identifier): continue
if rna_prop_identifier in rna_base_prop_keys: continue # does this prop exist in our parent class, if so skip
rna_desc = rna_prop.description.strip()
if rna_desc: rna_words.update(rna_desc.split())
if not rna_desc: rna_desc = rna_prop.name
if not rna_desc: rna_desc = 'Note - No documentation for this property!'
rna_prop_type = rna_prop.type.lower()
if rna_prop_type=='collection': collection_str = 'Collection of '
else: collection_str = ''
# some collections have a srna for their own properties
# TODO - arrays, however this isnt used yet
rna_prop_srna_type = rna_prop.srna
if rna_prop_srna_type:
collection_str = "L{%s} %s" % (rna_prop_srna_type.identifier, collection_str)
del rna_prop_srna_type
try: rna_prop_ptr = rna_prop.fixed_type
except: rna_prop_ptr = None
try: length = rna_prop.array_length
except: length = 0
array_str = get_array_str(length)
if rna_prop.editable: readonly_str = ''
else: readonly_str = ' (readonly)'
if rna_prop_ptr: # Use the pointer type
out.write(ident+ '\t@ivar %s: %s\n' % (rna_prop_identifier, rna_desc))
out.write(ident+ '\t@type %s: %sL{%s}%s%s\n' % (rna_prop_identifier, collection_str, rna_prop_ptr.identifier, array_str, readonly_str))
else:
if rna_prop_type == 'enum':
if 0:
out.write(ident+ '\t@ivar %s: %s in (%s)\n' % (rna_prop_identifier, rna_desc, ', '.join(rna_prop.items.keys())))
else:
out.write(ident+ '\t@ivar %s: %s in...\n' % (rna_prop_identifier, rna_desc))
for e, e_rna_prop in rna_prop.items.items():
#out.write(ident+ '\t\t- %s: %s\n' % (e, e_rna_prop.description)) # XXX - segfaults, FIXME
out.write(ident+ '\t\t- %s\n' % e)
out.write(ident+ '\t@type %s: %s%s%s\n' % (rna_prop_identifier, rna_prop_type, array_str, readonly_str))
elif rna_prop_type == 'int' or rna_prop_type == 'float':
out.write(ident+ '\t@ivar %s: %s\n' % (rna_prop_identifier, rna_desc))
out.write(ident+ '\t@type %s: %s%s%s in [%s, %s]\n' % (rna_prop_identifier, rna_prop_type, array_str, readonly_str, range_str(rna_prop.hard_min), range_str(rna_prop.hard_max) ))
elif rna_prop_type == 'string':
out.write(ident+ '\t@ivar %s: %s (maximum length of %s)\n' % (rna_prop_identifier, rna_desc, rna_prop.max_length))
out.write(ident+ '\t@type %s: %s%s%s\n' % (rna_prop_identifier, rna_prop_type, array_str, readonly_str))
else:
out.write(ident+ '\t@ivar %s: %s\n' % (rna_prop_identifier, rna_desc))
out.write(ident+ '\t@type %s: %s%s%s\n' % (rna_prop_identifier, rna_prop_type, array_str, readonly_str))
out.write(ident+ '\t"""\n\n')
# Write functions
# for rna_func in rna_struct.functions: # Better ignore inherited (line below)
for rna_func in rna_functions_dict[identifier]:
if rna_func not in rna_base_func_keys:
write_func(rna_func, ident+'\t', out, 'FUNCTION')
out.write('\n')
# Now write children recursively
for child in rna_children_dict[identifier]:
write_struct(child, ident + '\t')
# out = open(target_path, 'w')
out = open_submodule("types.py", BASEPATH) # bpy.types
def base_id(rna_struct):
try: return rna_struct.base.identifier
except: return '' # invalid id
#structs = [(base_id(rna_struct), rna_struct.identifier, rna_struct) for rna_struct in bpy.doc.structs.values()]
'''
structs = []
for rna_struct in bpy.doc.structs.values():
structs.append( (base_id(rna_struct), rna_struct.identifier, rna_struct) )
'''
structs = []
for rna_type_name in dir(bpy.types):
rna_type = getattr(bpy.types, rna_type_name)
try: rna_struct = rna_type.bl_rna
except: rna_struct = None
if rna_struct:
#if not rna_type_name.startswith('__'):
identifier = rna_struct.identifier
if not rna_id_ignore(identifier):
structs.append( (base_id(rna_struct), identifier, rna_struct) )
# Simple lookup
rna_struct_dict[identifier] = rna_struct
# Store full rna path 'GameObjectSettings' -> 'Object.GameObjectSettings'
rna_full_path_dict[identifier] = full_rna_struct_path(rna_struct)
# Store a list of functions, remove inherited later
rna_functions_dict[identifier]= list(rna_struct.functions)
# fill in these later
rna_children_dict[identifier]= []
rna_references_dict[identifier]= []
else:
print("Ignoring", rna_type_name)
# Sucks but we need to copy this so we can check original parent functions
rna_functions_dict__copy = {}
for key, val in rna_functions_dict.items():
rna_functions_dict__copy[key] = val[:]
structs.sort() # not needed but speeds up sort below, setting items without an inheritance first
# Arrange so classes are always defined in the correct order
deps_ok = False
while deps_ok == False:
deps_ok = True
rna_done = set()
for i, (rna_base, identifier, rna_struct) in enumerate(structs):
rna_done.add(identifier)
if rna_base and rna_base not in rna_done:
deps_ok = False
data = structs.pop(i)
ok = False
while i < len(structs):
if structs[i][1]==rna_base:
structs.insert(i+1, data) # insert after the item we depend on.
ok = True
break
i+=1
if not ok:
print('Dependancy "%s" could not be found for "%s"' % (identifier, rna_base))
break
# Done ordering structs
# precalc vars to avoid a lot of looping
for (rna_base, identifier, rna_struct) in structs:
if rna_base:
rna_base_prop_keys = rna_struct_dict[rna_base].properties.keys() # could cache
rna_base_func_keys = [f.identifier for f in rna_struct_dict[rna_base].functions]
else:
rna_base_prop_keys = []
rna_base_func_keys= []
# rna_struct_path = full_rna_struct_path(rna_struct)
rna_struct_path = rna_full_path_dict[identifier]
for rna_prop_identifier, rna_prop in rna_struct.properties.items():
if rna_prop_identifier=='RNA': continue
if rna_id_ignore(rna_prop_identifier): continue
if rna_prop_identifier in rna_base_prop_keys: continue
for rna_prop_ptr in (getattr(rna_prop, "fixed_type", None), getattr(rna_prop, "srna", None)):
# Does this property point to me?
if rna_prop_ptr:
rna_references_dict[rna_prop_ptr.identifier].append( "%s.%s" % (rna_struct_path, rna_prop_identifier) )
for rna_func in rna_struct.functions:
for rna_prop_identifier, rna_prop in rna_func.parameters.items():
if rna_prop_identifier=='RNA': continue
if rna_id_ignore(rna_prop_identifier): continue
if rna_prop_identifier in rna_base_func_keys: continue
try: rna_prop_ptr = rna_prop.fixed_type
except: rna_prop_ptr = None
# Does this property point to me?
if rna_prop_ptr:
rna_references_dict[rna_prop_ptr.identifier].append( "%s.%s" % (rna_struct_path, rna_func.identifier) )
# Store nested children
nested = rna_struct.nested
if nested:
rna_children_dict[nested.identifier].append(rna_struct)
if rna_base:
rna_funcs = rna_functions_dict[identifier]
if rna_funcs:
# Remove inherited functions if we have any
rna_base_funcs = rna_functions_dict__copy[rna_base]
rna_funcs[:] = [f for f in rna_funcs if f not in rna_base_funcs]
rna_functions_dict__copy.clear()
del rna_functions_dict__copy
# Sort the refs, just reads nicer
for rna_refs in rna_references_dict.values():
rna_refs.sort()
for (rna_base, identifier, rna_struct) in structs:
if rna_struct.nested:
continue
write_struct(rna_struct, '')
out.write('\n')
out.close()
# # We could also just run....
# os.system('epydoc source/blender/python/doc/rna.py -o ./source/blender/python/doc/html -v')
target_path = os.path.join(BASEPATH, "dump.py") # XXX - used for other funcs
# Write graphviz
out= open(target_path.replace('.py', '.dot'), 'w')
out.write('digraph "rna data api" {\n')
out.write('\tnode [style=filled, shape = "box"];\n')
out.write('\toverlap=false;\n')
out.write('\trankdir = LR;\n')
out.write('\tsplines=true;\n')
out.write('\tratio=auto;\n')
out.write('\tsize="10,10"\n')
#out.write('\tpage="8.5,11"\n')
#out.write('\tcenter=""\n')
def isop(rna_struct):
return '_OT_' in rna_struct.identifier
for (rna_base, identifier, rna_struct) in structs:
if isop(rna_struct):
continue
base = rna_struct.base
out.write('\t"%s";\n' % identifier)
for (rna_base, identifier, rna_struct) in structs:
if isop(rna_struct):
continue
base = rna_struct.base
if base and not isop(base):
out.write('\t"%s" -> "%s" [label="(base)" weight=1.0];\n' % (base.identifier, identifier))
nested = rna_struct.nested
if nested and not isop(nested):
out.write('\t"%s" -> "%s" [label="(nested)" weight=1.0];\n' % (nested.identifier, identifier))
rna_refs= rna_references_dict[identifier]
for rna_ref_string in rna_refs:
if '_OT_' in rna_ref_string:
continue
ref = rna_ref_string.split('.')[-2]
out.write('\t"%s" -> "%s" [label="%s" weight=0.01];\n' % (ref, identifier, rna_ref_string))
out.write('}\n')
out.close()
# # We could also just run....
# os.system('dot source/blender/python/doc/rna.dot -Tsvg -o ./source/blender/python/doc/rna.svg')
out= open(target_path.replace('.py', '.words'), 'w')
rna_words = list(rna_words)
rna_words.sort()
for w in rna_words:
out.write('%s\n' % w)
def op2epy(BASEPATH):
# out = open(target_path, 'w')
op_mods = dir(bpy.ops)
op_mods.remove('add')
op_mods.remove('remove')
for op_mod_name in sorted(op_mods):
if op_mod_name.startswith('__'):
continue
# open the submodule
mod_path = os.path.join("ops", op_mod_name + ".py")
out = open_submodule(mod_path, BASEPATH)
op_mod = getattr(bpy.ops, op_mod_name)
operators = dir(op_mod)
for op in sorted(operators):
# rna = getattr(bpy.types, op).bl_rna
rna = getattr(op_mod, op).get_rna()
write_func(rna, '', out, 'OPERATOR')
out.write('\n')
out.close()
def misc2epy(BASEPATH):
'''
Hard coded modules, try to avoid adding stuff here
'''
f = append_package(os.path.join(BASEPATH, ""), ""); # add a slash on the end of the base path
f.write('''
"""
@type data: L{bpy.types.Main}
@var data: blender data is accessed from here
"""
''')
f = open_submodule("props.py", BASEPATH)
f.write('''
MAX_INT= 2**31
MAX_FLOAT= 1e+37
def BoolProperty(attr, name="", description="", default=False):
"""
return a new bool property
"""
def IntProperty(attr, name="", description="", min=-MAX_INT, max=MAX_INT, soft_min=-MAX_INT, soft_max=MAX_INT, default=0):
"""
return a new int property
"""
def FloatProperty(attr, name="", description="", min=-MAX_FLOAT, max=MAX_FLOAT, soft_min=-MAX_FLOAT, soft_max=MAX_FLOAT, default=0.0):
"""
return a new float property
"""
def StringProperty(attr, name="", description="", maxlen=0, default=""):
"""
return a new string property
"""
def EnumProperty(attr, items, name="", description="", default=""):
"""
return a new enum property
"""
''')
if __name__ == '__main__':
if 'bpy' not in dir():
print("\nError, this script must run from inside blender2.5")
print(script_help_msg)
else:
misc2epy('source/blender/python/doc/bpy') # first to write in info in some of the modules.
rna2epy('source/blender/python/doc/bpy')
op2epy('source/blender/python/doc/bpy')
close_all()
import sys
sys.exit()

View File

@@ -1,67 +0,0 @@
#
# $Id$
#
# ***** 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.
#
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
# All rights reserved.
#
# The Original Code is: all of this file.
#
# Contributor(s): none yet.
#
# ***** END GPL LICENSE BLOCK *****
#
#
LIBNAME = python
DIR = $(OCGDIR)/blender/$(LIBNAME)
include nan_compile.mk
CFLAGS += $(LEVEL_1_C_WARNINGS)
# OpenGL and Python
CPPFLAGS += $(OGL_CPPFLAGS)
CPPFLAGS += -I$(NAN_GLEW)/include
CPPFLAGS += -I$(NAN_PYTHON)/include/python$(NAN_PYTHON_VERSION)
# PreProcessor stuff
CPPFLAGS += -I$(NAN_GHOST)/include
CPPFLAGS += $(NAN_SDLCFLAGS)
# modules
CPPFLAGS += -I../../editors/include
CPPFLAGS += -I../../python
CPPFLAGS += -I../../makesdna
CPPFLAGS += -I../../makesrna
CPPFLAGS += -I../../blenlib
CPPFLAGS += -I../../blenkernel
CPPFLAGS += -I../../nodes
CPPFLAGS += -I../../imbuf
CPPFLAGS += -I../../blenloader
CPPFLAGS += -I../../windowmanager
CPPFLAGS += -I../../render/extern/include
CPPFLAGS += -I$(NAN_AUDASPACE)/include
# path to the guarded memory allocator
CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
CPPFLAGS += -I$(NAN_MEMUTIL)/include
# path to our own headerfiles
CPPFLAGS += -I..

View File

@@ -31,7 +31,6 @@
/* --- bpy build options --- */
#ifdef WITH_PYTHON_SAFETY
#include <Python.h>
/* play it safe and keep optional for now, need to test further now this affects looping on 10000's of verts for eg. */
#define USE_WEAKREFS

View File

@@ -1,69 +0,0 @@
/**
* $Id$
*
* ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* Contributor(s): Campbell Barton
*
* ***** END GPL LICENSE BLOCK *****
*/
#include "bpy_ui.h"
#include "bpy_util.h"
#include "bpy_rna.h" /* for rna buttons */
#include "bpy_operator.h" /* for setting button operator properties */
#include "WM_types.h" /* for WM_OP_INVOKE_DEFAULT & friends */
#include "BLI_dynstr.h"
#include "MEM_guardedalloc.h"
#include "BKE_global.h" /* evil G.* */
#include "BKE_context.h"
#include "DNA_screen_types.h"
#include "DNA_space_types.h" /* only for SpaceLink */
#include "UI_interface.h"
#include "WM_api.h"
/* Dummy Module, may want to include non RNA UI functions here, else it can be removed */
static struct PyMethodDef ui_methods[] = {
{NULL, NULL, 0, NULL}
};
static struct PyModuleDef ui_module = {
PyModuleDef_HEAD_INIT,
"_bpy.ui",
"",
-1,/* multiple "initialization" just copies the module dict. */
ui_methods,
NULL, NULL, NULL, NULL
};
PyObject *BPY_ui_module( void )
{
PyObject *submodule;
submodule= PyModule_Create(&ui_module);
/* INCREF since its its assumed that all these functions return the
* module with a new ref like PyDict_New, since they are passed to
* PyModule_AddObject which steals a ref */
Py_INCREF(submodule);
return submodule;
}

View File

@@ -1,31 +0,0 @@
/**
* $Id: bpy_ui.h 21094 2009-06-23 00:09:26Z gsrb3d $
*
* ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* Contributor(s): Campbell Barton
*
* ***** END GPL LICENSE BLOCK *****
*/
#ifndef BPY_UI_H__
#define BPY_UI_H__
#include <Python.h>
PyObject *BPY_ui_module( void );
#endif

View File

@@ -19,24 +19,24 @@
# #**** END GPL LICENSE BLOCK #****
defs = """
SPACE_EMPTY,
SPACE_VIEW3D,
SPACE_IPO,
SPACE_OUTLINER,
SPACE_BUTS,
SPACE_FILE,
SPACE_EMPTY,
SPACE_VIEW3D,
SPACE_IPO,
SPACE_OUTLINER,
SPACE_BUTS,
SPACE_FILE,
SPACE_IMAGE,
SPACE_INFO,
SPACE_SEQ,
SPACE_TEXT,
SPACE_IMASEL,
SPACE_SOUND,
SPACE_ACTION,
SPACE_NLA,
SPACE_SCRIPT,
SPACE_TIME,
SPACE_NODE,
SPACEICONMAX
SPACE_INFO,
SPACE_SEQ,
SPACE_TEXT,
SPACE_IMASEL,
SPACE_SOUND,
SPACE_ACTION,
SPACE_NLA,
SPACE_SCRIPT,
SPACE_TIME,
SPACE_NODE,
SPACEICONMAX
"""
print '\tmod = PyModule_New("dummy");'
@@ -44,21 +44,21 @@ print '\tPyModule_AddObject( submodule, "key", mod );'
for d in defs.split('\n'):
d = d.replace(',', ' ')
w = d.split()
d = d.replace(',', ' ')
w = d.split()
if not w:
continue
if not w:
continue
try: w.remove("#define")
except: pass
try: w.remove("#define")
except: pass
# print w
# print w
val = w[0]
py_val = w[0]
val = w[0]
py_val = w[0]
print '\tPyModule_AddObject( mod, "%s", PyLong_FromSize_t(%s) );' % (val, py_val)
print '\tPyModule_AddObject( mod, "%s", PyLong_FromSize_t(%s) );' % (val, py_val)

View File

@@ -169,3 +169,4 @@ cleanup:
return bfd;
}

View File

@@ -35,7 +35,6 @@
#include <float.h>
#include <math.h>
#include <stdio.h>
#include <math.h>
#include <algorithm>
#include <queue>
@@ -180,7 +179,7 @@ void pushup(Node *parent)
{
float c_area = bb_area(child->bb, child->bb+3) ;
int nchilds = count_childs(child);
float original_cost = (c_area / p_area)*nchilds + 1;
float original_cost = ((p_area != 0.0f)? (c_area / p_area)*nchilds: 1.0f) + 1;
float flatten_cost = nchilds;
if(flatten_cost < original_cost && nchilds >= 2)
{
@@ -311,7 +310,6 @@ float bvh_refit(Node *node)
* with the purpose to reduce the expected cost (eg.: number of BB tests).
*/
#include <vector>
#include <cmath>
#define MAX_CUT_SIZE 4 /* svbvh assumes max 4 children! */
#define MAX_OPTIMIZE_CHILDS MAX_CUT_SIZE
@@ -419,7 +417,7 @@ struct VBVH_optimalPackSIMD
for(Node *child = node->child; child && RE_rayobject_isAligned(child); child = child->sibling)
{
this->child[nchilds] = child;
this->child_hit_prob[nchilds] = bb_area(child->bb, child->bb+3) / parent_area;
this->child_hit_prob[nchilds] = (parent_area != 0.0f)? bb_area(child->bb, child->bb+3) / parent_area: 1.0f;
nchilds++;
}
@@ -489,7 +487,7 @@ struct VBVH_optimalPackSIMD
float parent_area = bb_area(node->bb, node->bb+3);
for(Node *child = node->child; child && RE_rayobject_isAligned(child); child = child->sibling)
{
cost += ( bb_area(child->bb, child->bb+3) / parent_area ) * child->get_cost(1);
cost += ((parent_area != 0.0f)? ( bb_area(child->bb, child->bb+3) / parent_area ): 1.0f) * child->get_cost(1);
}
cost += testcost(nchilds);

View File

@@ -2540,7 +2540,7 @@ static void do_render_seq(Render * re)
if(ibuf->rect_float) {
if (!rr->rectf)
rr->rectf= MEM_mallocN(4*sizeof(float)*rr->rectx*rr->recty, "render_seq rectf");
/* color management: when off ensure rectf is non-lin, since thats what the internal
* render engine delivers */
if(re->r.color_mgt_flag & R_COLOR_MANAGEMENT) {

View File

@@ -214,7 +214,7 @@ static void pointdensity_cache_object(Render *re, PointDensity *pd, Object *ob)
for(i=0; i < pd->totpoints; i++, mvert++) {
float co[3];
VECCOPY(co, mvert->co);
switch(pd->ob_cache_space) {
@@ -264,7 +264,7 @@ static void cache_pointdensity(Render *re, Tex *tex)
Object *ob = pd->object;
if (ob && ob->type == OB_MESH)
pointdensity_cache_object(re, pd, ob);
}
}
}
static void free_pointdensity(Render *UNUSED(re), Tex *tex)

View File

@@ -384,6 +384,25 @@ void renderspothalo(ShadeInput *shi, float *col, float alpha)
/* ---------------- shaders ----------------------- */
static double Normalize_d(double *n)
{
double d;
d= n[0]*n[0]+n[1]*n[1]+n[2]*n[2];
if(d>0.00000000000000001) {
d= sqrt(d);
n[0]/=d;
n[1]/=d;
n[2]/=d;
} else {
n[0]=n[1]=n[2]= 0.0;
d= 0.0;
}
return d;
}
/* mix of 'real' fresnel and allowing control. grad defines blending gradient */
float fresnel_fac(float *view, float *vn, float grad, float fac)
{
@@ -422,10 +441,10 @@ static float area_lamp_energy(float (*area)[3], float *co, float *vn)
VECSUB(vec[2], co, area[2]);
VECSUB(vec[3], co, area[3]);
normalize_dv3(vec[0]);
normalize_dv3(vec[1]);
normalize_dv3(vec[2]);
normalize_dv3(vec[3]);
Normalize_d(vec[0]);
Normalize_d(vec[1]);
Normalize_d(vec[2]);
Normalize_d(vec[3]);
/* cross product */
CROSS(cross[0], vec[0], vec[1]);
@@ -433,10 +452,10 @@ static float area_lamp_energy(float (*area)[3], float *co, float *vn)
CROSS(cross[2], vec[2], vec[3]);
CROSS(cross[3], vec[3], vec[0]);
normalize_dv3(cross[0]);
normalize_dv3(cross[1]);
normalize_dv3(cross[2]);
normalize_dv3(cross[3]);
Normalize_d(cross[0]);
Normalize_d(cross[1]);
Normalize_d(cross[2]);
Normalize_d(cross[3]);
/* angles */
rad[0]= vec[0][0]*vec[1][0]+ vec[0][1]*vec[1][1]+ vec[0][2]*vec[1][2];

View File

@@ -28,7 +28,8 @@ set(INC
.
../nodes
../gpu
../blenfont ../bmesh
../blenfont
../bmesh
../blenlib
../makesdna
../makesrna

View File

@@ -1764,7 +1764,7 @@ void wm_event_do_handlers(bContext *C)
while( (event= win->queue.first) ) {
int action = WM_HANDLER_CONTINUE;
if((G.f & G_DEBUG) && event && !ELEM(event->type, MOUSEMOVE, INBETWEEN_MOUSEMOVE))
printf("pass on evt %d val %d\n", event->type, event->val);
@@ -1904,7 +1904,6 @@ void wm_event_do_handlers(bContext *C)
win->lasttime = PIL_check_seconds_timer();
}
/* only add mousemove when queue was read entirely */
if(win->addmousemove && win->eventstate) {
wmEvent tevent= *(win->eventstate);
@@ -2348,8 +2347,7 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U
switch (type) {
/* mouse move */
case GHOST_kEventCursorMove: {
if(win->active) {
if(win->active) {
GHOST_TEventCursorData *cd= customdata;
wmEvent *lastevent= win->queue.last;
@@ -2410,7 +2408,6 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U
event.type= MOUSEPAN;
break;
}
#if defined(__APPLE__) && defined(GHOST_COCOA)
//Cocoa already uses coordinates with y=0 at bottom, and returns inwindow coordinates on mouse moved event
event.x= evt->x = pd->x;
@@ -2436,7 +2433,7 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U
case GHOST_kEventButtonUp: {
GHOST_TEventButtonData *bd= customdata;
event.val= (type==GHOST_kEventButtonDown) ? KM_PRESS:KM_RELEASE; /* Note!, this starts as 0/1 but later is converted to KM_PRESS/KM_RELEASE by tweak */
if (bd->button == GHOST_kButtonMaskLeft)
event.type= LEFTMOUSE;
else if (bd->button == GHOST_kButtonMaskRight)

View File

@@ -2255,15 +2255,15 @@ int WM_gesture_circle_modal(bContext *C, wmOperator *op, wmEvent *event)
int sx, sy;
if(event->type== MOUSEMOVE) {
wm_subwindow_getorigin(CTX_wm_window(C), gesture->swinid, &sx, &sy);
wm_subwindow_getorigin(CTX_wm_window(C), gesture->swinid, &sx, &sy);
rect->xmin= event->x - sx;
rect->ymin= event->y - sy;
rect->xmin= event->x - sx;
rect->ymin= event->y - sy;
wm_gesture_tag_redraw(C);
wm_gesture_tag_redraw(C);
if(gesture->mode)
gesture_circle_apply(C, op);
if(gesture->mode)
gesture_circle_apply(C, op);
}
else if (event->type==EVT_MODAL_MAP) {
switch (event->val) {

View File

@@ -912,9 +912,7 @@ static int wm_window_timer(const bContext *C)
void wm_window_process_events(const bContext *C)
{
int hasevent= 0;
hasevent = GHOST_ProcessEvents(g_system, 0); /* 0 is no wait */
int hasevent= GHOST_ProcessEvents(g_system, 0); /* 0 is no wait */
if(hasevent)
GHOST_DispatchEvents(g_system);

View File

@@ -236,12 +236,14 @@ if(UNIX AND NOT APPLE)
else()
set(TARGETDIR_VER ${CMAKE_INSTALL_PREFIX}/share/blender/${BLENDER_VERSION})
endif()
# important to make a clean install each time
# else old scripts get loaded.
install(
CODE
"file(REMOVE_RECURSE ${TARGETDIR_VER})"
)
# message after building.
add_custom_command(
TARGET blender POST_BUILD MAIN_DEPENDENCY blender
@@ -414,9 +416,6 @@ elseif(WIN32)
install(
FILES ${LIBDIR}/gettext/lib/gnu_gettext.dll
DESTINATION ${TARGETDIR}/
COMMAND if not exist \"${TARGETDIR}\\${BLENDER_VERSION}\\config\\locale\" mkdir \"${TARGETDIR}\\${BLENDER_VERSION}\\config\\locale\"
COMMAND copy /Y \"${CMAKE_SOURCE_DIR}\\release\\bin\\.blender\\.Blanguages\" \"${TARGETDIR}\\${BLENDER_VERSION}\\config\\\"
COMMAND xcopy /E /Y \"${CMAKE_SOURCE_DIR}\\release\\bin\\.blender\\locale\\*.*\" \"${TARGETDIR}\\${BLENDER_VERSION}\\config\\locale\\\"
)
install(
@@ -813,6 +812,7 @@ endif()
bf_intern_audaspace
bf_intern_mikktspace
)
if(WITH_MOD_CLOTH_ELTOPO)
list(APPEND BLENDER_SORTED_LIBS extern_eltopo)
endif()

View File

@@ -1168,7 +1168,6 @@ static void setupArguments(bContext *C, bArgs *ba, SYS_SystemHandle *syshandle)
BLI_argsAddCase(ba, 3, "-noaudio", 1, NULL, 0, "\n\tForce sound system to None", no_audio, NULL);
BLI_argsAddCase(ba, 3, "-setaudio", 1, NULL, 0, "\n\tForce sound system to a specific device\n\tNULL SDL OPENAL JACK", set_audio, NULL);
/* fourth pass: processing arguments */
BLI_argsAdd(ba, 4, "-g", NULL, game_doc, set_ge_parameters, syshandle);
BLI_argsAdd(ba, 4, "-f", "--render-frame", "<frame>\n\tRender frame <frame> and save it.\n\t+<frame> start frame relative, -<frame> end frame relative.", render_frame, C);
@@ -1204,6 +1203,7 @@ int main(int argc, const char **argv)
SYS_SystemHandle syshandle;
bContext *C= CTX_create();
bArgs *ba;
#ifdef WITH_PYTHON_MODULE
#undef main
#endif
@@ -1370,7 +1370,7 @@ int main(int argc, const char **argv)
}
WM_main(C);
/*XXX if (scr_init==0) {
main_init_screen();

View File

@@ -32,7 +32,6 @@ if env['WITH_BF_PYTHON']:
incs += ' ' + env['BF_PYTHON_INC']
defs.append('WITH_PYTHON')
if env['WITH_BF_FFMPEG']:
defs.append('WITH_FFMPEG')

View File

@@ -12,7 +12,6 @@ if env['WITH_BF_PYTHON']:
incs += ' ' + env['BF_PYTHON_INC']
defs.append('WITH_PYTHON')
if env['WITH_BF_CXX_GUARDEDALLOC']:
defs.append('WITH_CXX_GUARDEDALLOC')