2002-10-12 11:37:38 +00:00
|
|
|
/**
|
|
|
|
|
* $Id$
|
|
|
|
|
*
|
|
|
|
|
* ***** 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.
|
|
|
|
|
*
|
|
|
|
|
* The Original Code is: all of this file.
|
|
|
|
|
*
|
|
|
|
|
* Contributor(s): none yet.
|
|
|
|
|
*
|
|
|
|
|
* ***** END GPL/BL DUAL LICENSE BLOCK *****
|
|
|
|
|
* BKE_bad_level_calls function stubs
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
2004-01-21 04:38:03 +00:00
|
|
|
#include "BKE_bad_level_calls.h"
|
2002-10-12 11:37:38 +00:00
|
|
|
#include "BLI_blenlib.h"
|
2004-01-21 04:38:03 +00:00
|
|
|
#include "BPI_script.h"
|
2002-10-12 11:37:38 +00:00
|
|
|
#include "DNA_material_types.h"
|
|
|
|
|
|
2002-11-25 12:02:15 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
|
#include <config.h>
|
|
|
|
|
#endif
|
|
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
int winqueue_break= 0;
|
|
|
|
|
|
2002-12-12 22:18:25 +00:00
|
|
|
char bprogname[1];
|
|
|
|
|
|
|
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
/* readfile.c */
|
|
|
|
|
/* struct PluginSeq; */
|
|
|
|
|
void open_plugin_seq(struct PluginSeq *pis, char *seqname){}
|
|
|
|
|
/* struct SpaceButs; */
|
|
|
|
|
void set_rects_butspace(struct SpaceButs *buts){}
|
|
|
|
|
/* struct SpaceImaSel; */
|
|
|
|
|
void check_imasel_copy(struct SpaceImaSel *simasel){}
|
|
|
|
|
/* struct ScrArea; */
|
|
|
|
|
void unlink_screen(struct bScreen *sc){}
|
|
|
|
|
void freeAllRad(void){}
|
|
|
|
|
void free_editText(void){}
|
|
|
|
|
void free_editArmature(void){}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void setscreen(struct bScreen *sc){}
|
2004-11-07 20:15:16 +00:00
|
|
|
void force_draw_all(int header){}
|
2002-10-12 11:37:38 +00:00
|
|
|
/* otherwise the WHILE_SEQ doesn't work */
|
|
|
|
|
/* struct Sequence; */
|
|
|
|
|
|
|
|
|
|
/* MAART: added "seqar = 0; totseq = 0" because the loader will crash without it. */
|
2004-01-21 12:45:13 +00:00
|
|
|
void build_seqar(struct ListBase *seqbase, struct Sequence ***seqar, int *totseq)
|
2002-10-12 11:37:38 +00:00
|
|
|
{
|
|
|
|
|
*seqar = 0;
|
|
|
|
|
*totseq = 0;
|
|
|
|
|
}
|
|
|
|
|
|
2004-07-16 06:00:40 +00:00
|
|
|
/* blender.c */
|
|
|
|
|
void mainqenter (unsigned short event, short val){}
|
|
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
void BPY_do_pyscript(ID *id, short int event){}
|
2003-12-16 00:17:59 +00:00
|
|
|
void BPY_clear_script(Script *script){}
|
|
|
|
|
void BPY_free_compiled_text(struct Text *text){}
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
/* writefile.c */
|
|
|
|
|
/* struct Oops; */
|
|
|
|
|
void free_oops(struct Oops *oops){}
|
|
|
|
|
void exit_posemode(int freedata){}
|
|
|
|
|
void error(char *str, ...){}
|
|
|
|
|
|
|
|
|
|
/* anim.c */
|
|
|
|
|
ListBase editNurb;
|
|
|
|
|
|
|
|
|
|
/* displist.c */
|
|
|
|
|
#include "DNA_world_types.h" /* for render_types */
|
|
|
|
|
#include "render_types.h"
|
|
|
|
|
struct RE_Render R;
|
2003-07-20 17:59:57 +00:00
|
|
|
|
2003-12-21 23:38:41 +00:00
|
|
|
float Phong_Spec(float *n, float *l, float *v, int hard){return 0;}
|
|
|
|
|
float Blinn_Spec(float *n, float *l, float *v, float a, float b){return 0;}
|
|
|
|
|
float CookTorr_Spec(float *n, float *l, float *v, int hard){return 0;}
|
|
|
|
|
float Toon_Spec(float *n, float *l, float *v, float a, float b){return 0;}
|
2005-04-17 17:43:07 +00:00
|
|
|
float WardIso_Spec(float *n, float *l, float *v, float a){return 0;}
|
2003-12-21 23:38:41 +00:00
|
|
|
float Toon_Diff(float *n, float *l, float *v, float a, float b){return 0;}
|
|
|
|
|
float OrenNayar_Diff(float *n, float *l, float *v, float a, float b){return 0;}
|
2005-04-17 17:43:07 +00:00
|
|
|
float Minnaert_Diff(float nl, float *n, float *v, float a){return 0;}
|
2004-07-02 13:51:33 +00:00
|
|
|
void add_to_diffuse(float *diff, ShadeInput *shi, float is, float r, float g, float b){}
|
|
|
|
|
void ramp_diffuse_result(float *diff, ShadeInput *shi){}
|
|
|
|
|
void do_specular_ramp(ShadeInput *shi, float is, float t, float *spec){}
|
|
|
|
|
void ramp_spec_result(float *specr, float *specg, float *specb, ShadeInput *shi){}
|
2003-12-21 23:38:41 +00:00
|
|
|
|
|
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
void waitcursor(int val){}
|
|
|
|
|
void allqueue(unsigned short event, short val){}
|
|
|
|
|
#define REDRAWVIEW3D 0x4010
|
|
|
|
|
Material defmaterial;
|
|
|
|
|
|
|
|
|
|
/* effect.c */
|
|
|
|
|
void RE_jitterate1(float *jit1, float *jit2, int num, float rad1){}
|
|
|
|
|
void RE_jitterate2(float *jit1, float *jit2, int num, float rad2){}
|
|
|
|
|
|
|
|
|
|
/* exotic.c */
|
|
|
|
|
void load_editMesh(void){}
|
|
|
|
|
void make_editMesh(void){}
|
EditMesh refactory + undo recode
The changelog is very long... it's on the web too:
http://www.blender3d.org/cms/Mesh_editing_rewrite.425.0.html
EditMesh refactor notes (user)
**** New selection modes
When entering Edit Mode for a Mesh, you now have the choice for three selection modes. These are shown as icons in the 3D header (hotkey is being searched for!).
- Vertex Select
Select vertices as usual, fully compatible with how previous version work
- Edge Select
Vertices are not drawn anymore, and selections happen by default on the edges. It is a true edge select, meaning that you can select three out of four edges in a face, without automatic having the 4th edge selected.
- Face Select
Instead of vertices, now selection 'points' are drawn in the face centers. Selected faces also get a colored outline, like for edges. This also is true face select, for each face individual regardless selection status of its vertices or edges.
While holding SHIFT, and press a selection mode, you can also combine the above choices. Now selection becomes mixed, and will behave as expected.
For example; in Edge+Face select mode, selecting the 4 edges of a face will select the face too.
The selection modes and optional drawing modes (like transparant faces, normals, or solid drawing) all work together. All of Blender's mesh editing tools now react to the correct selection mode as well.
Most noticeable it's in:
**** Extrude
Extruding in Edge or Face Select mode allows much more precise control over what's extruded and what should be excluded. Try for example a checker pattern selection, and extrude it.
New is the fixed translation when faces are extruded. This always follows the (averaged) face normal(s) of the old face(s), enabling much easier working in 3D views . A single 'G' (Grab) or 'R' (Rotate) or 'S' (Scale) will change transform modus as usual.
**** Other things to note
- Hiding edges/faces will also behave different based on Select Mode.
- while editing, normals of faces are updated always now
- Border select (BKEY) has 2 different rules for edges; when one edge is fully inside of the border, it will only select edges that are fully inside. Otherwise it selects each edge intersecting with the border.
- in face mode, adding vertices, edges or a circle is invisible...
- "Add monkey" now works as a normal primitive (rotated and on 3d cursor)
- Mesh undo was fully recoded, hopefully solving issues now with Vertex Keys and Groups
- Going in and out of editmode was fully recoded. Especially on larger models you'll notice substantial speed gain.
**** Todo
Add 'FaceSelect mode' functionality in EditMode, including zbuffered selection, display and editing of UV texture.
EditMesh refactor notes (coder)
**** Usage of flags in general
The "->f" flags are reserved for the editmesh.c and editmesh_lib.c core functions. Actually only selection status is there now.
The "->f1" and "->f2" flags are free to use. They're available in vertex/edge/face structs. Since they're free, check carefully when calling other functions that use these flags... for example extrude() or subdivide() use them.
**** Selection flags
EditVert: eve->f & SELECT
EditEdge: eed->f & SELECT
EditFace: efa->f & SELECT
- Selection is only possible when not-hidden!
- Selection flags are always up-to-date, BUT:
if selection mode >= SELECT_EDGE vertex selection flags can be incorrect
if selection mode == SELECT_FACE vertex/edge selection flags can be incorrect
This because of shared vertices or edges.
- use for selecting vertices:
eve->f &= SELECT
- use for selecting edges always:
void EM_select_edge(eed, 1) // 1 = select, 0 = deselect
- use for selecting faces always:
void EM_select_face(efa, 1) // 1 = select, 0 = deselect
- To set the 'f' flags in all of the data:
void EM_set_flag_all(int flag);
void EM_clear_flag_all(int flag);
- the old faceselectedOR() and faceselectedAND() are still there, but only
to be used for evaluating its vertices
**** Code hints for handling selection
If the selectmode is 'face'; vertex or edge selections need to be flushed upward. Same is true for 'edge' selection mode. This means that you'll have to keep track of all selections while coding... selecting the four vertices in a face doesn't automatically select the face anymore.
However, by using the above calls, at least selections flush downward (to vertex level). You then can call:
void EM_selectmode_flush(void);
Which flushes selections back upward, based on the selectmode setting. This function does the following:
- if selectmode 'vertex': select edges/faces based on its selected vertices
- if selectmode 'edge': select faces based its selected edges
This works fine in nice controlled situations.
However, only changing the vertex selections then still doesn't select a face in face mode! If you really can't avoid only working with vertex selections, you can use this call:
void EM_select_flush(void);
Now selection is flushed upward regardless current selectmode. That can be destructive for special cases however, like checkerboard selected faces. So use this only when you know everything else was deselected (or deselect it). Example: adding primitives.
**** Hide flags
EditVert: eve->h
EditEdge: eed->h
EditFace: efa->h
- all hide flags are always up-to-date
- hidden vertices/edges/faces are always deselected. so when you operate on selection only, there's no need to check for hide flag.
**** Unified undo for editmode
New file: editmode_undo.h
A pretty nice function pointer handler style undo. Just code three functions, and your undo will fly! The c file has a good reference.
Also note that the old undo system has been replaced. It currently uses minimal dependencies on Meshes themselves (no abuse of going in/out editmode), and is restricted nicely to editmode functions.
**** Going in/out editmode
As speedup now all vertices/faces/edges are allocated in three big chunks. In vertices/faces/edges now tags are set to denote such data cannot be freed.
ALso the hashtable (lookup) for edges uses no mallocs at all anymore, but is part of the EditEdge itself.
2004-09-23 20:52:51 +00:00
|
|
|
void free_editMesh(struct EditMesh *em){}
|
2002-10-12 11:37:38 +00:00
|
|
|
void docentre_new(void){}
|
2002-12-20 02:08:46 +00:00
|
|
|
int saveover(char *str){ return 0;}
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
/* image.c */
|
|
|
|
|
#include "DNA_image_types.h"
|
|
|
|
|
void free_realtime_image(Image *ima){} // has to become a callback, opengl stuff
|
|
|
|
|
void RE_make_existing_file(char *name){} // from render, but these funcs should be moved anyway
|
|
|
|
|
|
|
|
|
|
/* ipo.c */
|
|
|
|
|
void copy_view3d_lock(short val){} // was a hack, to make scene layer ipo's possible
|
|
|
|
|
|
|
|
|
|
/* library.c */
|
|
|
|
|
void allspace(unsigned short event, short val){}
|
|
|
|
|
#define OOPS_TEST 2
|
|
|
|
|
|
|
|
|
|
/* mball.c */
|
|
|
|
|
ListBase editelems;
|
|
|
|
|
|
|
|
|
|
/* object.c */
|
|
|
|
|
void BPY_free_scriptlink(ScriptLink *slink){}
|
|
|
|
|
void BPY_copy_scriptlink(ScriptLink *scriptlink){}
|
2002-12-20 02:08:46 +00:00
|
|
|
float *give_cursor(void){ return 0;} // become a callback or argument
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
/* packedFile.c */
|
2002-12-20 02:08:46 +00:00
|
|
|
short pupmenu(char *instr){ return 0;} // will be general callback
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
/* sca.c */
|
|
|
|
|
#define LEFTMOUSE 0x001 // because of mouse sensor
|
|
|
|
|
|
|
|
|
|
/* scene.c */
|
|
|
|
|
#include "DNA_sequence_types.h"
|
|
|
|
|
void free_editing(struct Editing *ed){} // scenes and sequences problem...
|
|
|
|
|
void BPY_do_all_scripts (short int event){}
|
|
|
|
|
|
|
|
|
|
/* IKsolver stubs */
|
|
|
|
|
#include "IK_solver.h"
|
|
|
|
|
extern int IK_LoadChain(IK_Chain_ExternPtr chain,IK_Segment_ExternPtr segments, int num_segs)
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
extern int IK_SolveChain(
|
|
|
|
|
IK_Chain_ExternPtr chain,
|
|
|
|
|
float goal[3],
|
|
|
|
|
float tolerance,
|
|
|
|
|
int max_iterations,
|
|
|
|
|
float max_angle_change,
|
|
|
|
|
IK_Segment_ExternPtr output
|
|
|
|
|
)
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
extern void IK_FreeChain(IK_Chain_ExternPtr chain)
|
|
|
|
|
{
|
|
|
|
|
;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern IK_Chain_ExternPtr IK_CreateChain(void)
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2002-12-12 22:18:25 +00:00
|
|
|
/* exotic.c */
|
|
|
|
|
int BPY_call_importloader(char *name)
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
/* texture.c */
|
|
|
|
|
#define FLO 128
|
|
|
|
|
#define INT 96
|
|
|
|
|
/* struct EnvMap; */
|
|
|
|
|
/* struct Tex; */
|
2003-12-21 23:38:41 +00:00
|
|
|
|
|
|
|
|
void do_material_tex(ShadeInput *shi){}
|
Biiig commit! Thanks to 2-3 weeks of cvs freeze...
Render:
- New; support for dual CPU render (SDL thread)
Currently only works with alternating scanlines, but gives excellent
performance. For both normal render as unified implemented.
Note the "mutex" locks on z-transp buffer render and imbuf loads.
- This has been made possible by major cleanups in render code, especially
getting rid of globals (example Tin Tr Tg Tb Ta for textures) or struct
OSA or using Materials or Texture data to write to.
- Made normal render fully 4x32 floats too, and removed all old optimizes
with chars or shorts.
- Made normal render and unified render use same code for sky and halo
render, giving equal (and better) results for halo render. Old render
now also uses PostProcess options (brightness, mul, gamma)
- Added option ("FBuf") in F10 Output Panel, this keeps a 4x32 bits buffer
after render. Using PostProcess menu you will note an immediate re-
display of image too (32 bits RGBA)
- Added "Hue" and "Saturation" sliders to PostProcess options
- Render module is still not having a "nice" API, but amount of dependencies
went down a lot. Next todo: remove abusive "previewrender" code.
The last main global in Render (struct Render) now can be re-used for fully
controlling a render, to allow multiple "instances" of render to open.
- Renderwindow now displays a smal bar on top with the stats, and keeps the
stats after render too. Including "spare" page support.
Not only easier visible that way, but also to remove the awkward code that
was drawing stats in the Info header (extreme slow on some ATIs too)
- Cleaned up blendef.h and BKE_utildefines.h, these two had overlapping
defines.
- I might have forgotten stuff... and will write a nice doc on the architecture!
2004-12-27 19:28:52 +00:00
|
|
|
void externtex(struct MTex *mtex, float *vec, float *tin, float *tr, float *tg, float *tb, float *ta){}
|
2003-12-21 23:38:41 +00:00
|
|
|
void init_render_textures(void){}
|
|
|
|
|
void end_render_textures(void){}
|
|
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
void RE_free_envmap(struct EnvMap *env){}
|
2002-12-20 02:08:46 +00:00
|
|
|
struct EnvMap *RE_copy_envmap(struct EnvMap *env){ return env;}
|
2002-10-12 11:37:38 +00:00
|
|
|
void RE_free_envmapdata(struct EnvMap *env){}
|
2002-12-20 02:08:46 +00:00
|
|
|
|
|
|
|
|
int RE_envmaptex(struct Tex *tex, float *texvec, float *dxt, float *dyt){
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2004-04-29 15:56:26 +00:00
|
|
|
char texstr[20][12]; /* buttons.c */
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
/* editsca.c */
|
|
|
|
|
void make_unique_prop_names(char *str) {}
|
2005-03-28 15:23:36 +00:00
|
|
|
|
|
|
|
|
/* DerivedMesh.c */
|
|
|
|
|
void bglBegin(int mode) {}
|
|
|
|
|
void bglVertex3fv(float *vec) {}
|
|
|
|
|
void bglEnd(void) {}
|