From BlenderWiki

Jump to: navigation, search

Bad Level Calls

When a function is used from a module, with that function being defined in another module on which the first module shouldn't depend, that's a bad level call. For example src/ depends on blenkernel/ and not the other way around, but blenkernel/ is still calling some functions in src/, resulting in circular dependencies between modules. Such errors show up especially when compiling the blenderplayer, which includes blenkernel/ but not src/ or render/ for example.

It would be good to get rid of those as much as possible as part of 2.50 development. Here is a list of bad level calls. These are declared and defined in as stubs, i.e. empty functions that do nothing in order to get the blenderplayer to compile:

  • blenkernel/BKE_bad_level_calls.h
  • blenkernel/bad_level_call_stubs/stubs.c

How to Fix

To be written: how to deal with module owners, review, .. .

Uncategorized

  • int winqueue_break= 0;
  • char bprogname[1];
  • char btempdir[1];
  • char *getIpoCurveName( struct IpoCurve * icu )
  • void insert_vert_icu(struct IpoCurve *icu, float x, float y, short fast)
  • struct IpoCurve *verify_ipocurve(struct ID *id, short a, char *b, char *d, int e)
  • void setscreen(struct bScreen *sc)
  • void force_draw_all(int header)
  • void build_seqar(struct ListBase *seqbase, struct Sequence ***seqar, int *totseq)
  • void free_oops(struct Oops *oops){}
  • void exit_posemode(int freedata){}
  • ListBase editNurb;
  • void error(char *str, ...)
  • int saveover(char *str)
  • short pupmenu(char *instr)
  • void waitcursor(int val)
  • float *give_cursor(void)
  • void allqueue(unsigned short event, short val)
  • void mainqenter (unsigned short event, short val)
  • void load_editMesh(void)
  • void make_editMesh(void)
  • void free_editMesh(struct EditMesh *em)
  • void docenter_new(void)
  • void free_realtime_image(Image *ima) // has to become a callback, opengl stuff
  • void copy_view3d_lock(short val)
  • void allspace(unsigned short event, short val)
  • ListBase editelems;
  • define LEFTMOUSE 0x001
  • void free_editing(struct Editing *ed)
  • void EM_select_face(struct EditFace *efa, int sel)
  • void EM_select_edge(struct EditEdge *eed, int sel)
  • struct EditVert *addvertlist(float *vec, struct EditVert *example)
  • struct EditEdge *addedgelist(struct EditVert *v1, struct EditVert *v2, struct EditEdge * *example)
  • struct EditFace *addfacelist(struct EditVert *v1, struct EditVert *v2, struct EditVert *v3, struct EditVert *v4, struct EditFace *example, struct EditFace *exampleEdges)
  • struct EditEdge *findedgelist(struct EditVert *v1, struct EditVert *v2)
  • void countall(void)
  • define FLO 128
  • define INT 96
  • char texstr[20][12]; /* buttons.c */
  • void make_unique_prop_names(char *str) {}
  • void bglBegin(int mode) {}
  • void bglVertex3fv(float *vec) {}
  • void bglVertex3f(float x, float y, float z) {}
  • void bglEnd(void) {}
  • struct DerivedMesh *NewBooleanDerivedMesh(struct Object *ob, struct Object *ob_select, int int_op_type) { return 0; }
  • void elbeemDebugOut(char *msg) {}
  • void fluidsimSettingsFree(struct FluidsimSettings* sb) {}
  • void fluidsimSettingsCopy(struct FluidsimSettings* sb) {}
  • void update_for_newframe() {}
  • void BIF_filelist_freelib(struct FileList* filelist) {};
  • TimeMarker *get_frame_marker(int frame){return 0;};
  • Sequence *get_forground_frame_seq(int frame){return 0;};
  • void set_last_seq(Sequence *seq){};
  • void harmonic_coordinates_bind(struct MeshDeformModifierData *mmd, float (*vertexcos)[3], int totvert, float cagemat[][4]) {}
  • void PE_free_particle_edit(struct ParticleSystem *psys) {}
  • void PE_get_colors(char sel[4], char nosel[4]) {}
  • void PE_recalc_world_cos(struct Object *ob, struct ParticleSystem *psys) {}
  • void txt_copy_clipboard (struct Text *text){}
  • char stipple_quarttone[1];

IK Solver

The whole IK solver interface is in stubs. Solution: link IK into the blenderplayer, this will also fix issues with the blenderplayer not loading armatures with IK correct in some cases.

  • IK_Segment *IK_CreateSegment(int flag)
  • void IK_FreeSegment(IK_Segment *seg)
  • void IK_SetParent(IK_Segment *seg, IK_Segment *parent)
  • void IK_SetTransform(IK_Segment *seg, float start[3], float rest_basis[][3], float basis[][3], float length)
  • void IK_GetBasisChange(IK_Segment *seg, float basis_change[][3])
  • void IK_GetTranslationChange(IK_Segment *seg, float *translation_change)
  • void IK_SetLimit(IK_Segment *seg, IK_SegmentAxis axis, float lower, float upper)
  • void IK_SetStiffness(IK_Segment *seg, IK_SegmentAxis axis, float stiffness)
  • IK_Solver *IK_CreateSolver(IK_Segment *root)
  • void IK_FreeSolver(IK_Solver *solver)
  • void IK_SolverAddGoal(IK_Solver *solver, IK_Segment *tip, float goal[3], float weight)
  • void IK_SolverAddGoalOrientation(IK_Solver *solver, IK_Segment *tip, float goal[][3], float weight)
  • void IK_SolverSetPoleVectorConstraint(IK_Solver *solver, IK_Segment *tip, float * goal[3], float polegoal[3], float poleangle, int getangle)
  • float IK_SolverGetPoleAngle(IK_Solver *solver)
  • int IK_Solve(IK_Solver *solver, float tolerance, int max_iterations)

Python

It seems much of the python api is in bad level calls. Solving this probably requires more work than this cleanup.

  • void BPY_do_pyscript(ID *id, short int event)
  • void BPY_clear_script(Script *script)
  • void BPY_free_compiled_text(struct Text *text)
  • void BPY_pydriver_update(void)
  • float BPY_pydriver_eval(struct IpoDriver *driver)
  • int EXPP_dict_set_item_str(struct PyObject *dict, char *key, struct PyObject *value)
  • void Node_SetStack(struct BPy_Node *self, struct bNodeStack **stack, int type){}
  • void InitNode(struct BPy_Node *self, struct bNode *node){}
  • void Node_SetShi(struct BPy_Node *self, struct ShadeInput *shi){}
  • struct BPy_NodeSockets *Node_CreateSocketLists(struct bNode *node)
  • int pytype_is_pynode(struct PyObject *pyob)
  • struct Object **BPY_pydriver_get_objects(struct IpoDriver *driver)
  • int BPY_button_eval(char *expr, double *value)
  • void BPY_pyconstraint_eval(struct bPythonConstraint *con, struct bConstraintOb *cob, struct ListBase *targets)
  • void BPY_pyconstraint_target(struct bPythonConstraint *con, struct bConstraintTarget *ct)
  • void BPY_free_scriptlink(ScriptLink *slink)
  • void BPY_copy_scriptlink(ScriptLink *scriptlink)
  • void BPY_do_all_scripts (short int event)
  • int BPY_call_importloader(char *name)

Render

  • int externtex(struct MTex *mtex, float *vec, float *tin, float *tr, float *tg, float *tb, float *ta) { return 0; }
  • void texture_rgb_blend(float *in, float *tex, float *out, float fact, float facg, int blendtype) {}
  • float texture_value_blend(float tex, float out, float fact, float facg, int blendtype, int flip) { return 0; }
  • int multitex_ext(Tex *tex, float *texvec, float *dxt, float *dyt, int osatex, TexResult *texres)
  • void antialias_tagbuf(int xsize, int ysize, char *rectmove) {}
  • void ibuf_sample(struct ImBuf *ibuf, float fx, float fy, float dx, float dy, float *result) {}
  • void RE_FreeRenderResult(struct RenderResult *rr) {}
  • void RE_GetResultImage(struct Render *re, struct RenderResult *rr) {}
  • struct RenderResult *RE_MultilayerConvert(void *exrhandle, int rectx, int recty){return NULL;}
  • struct Render *RE_GetRender(const char *name) {return (struct Render *)NULL;}
  • struct RenderResult *RE_GetResult(Render *re) {return (struct RenderResult *)NULL;}
  • float *RE_RenderLayerGetPass(RenderLayer *rl, int passtype) {return NULL;}
  • float RE_filter_value(int type, float x) {return 0.0f;}
  • struct RenderLayer *RE_GetRenderLayer(RenderResult *rr, const char *name) {return (struct RenderLayer *)NULL;}
  • void RE_Database_Free (struct Render *re) {}
  • void RE_FreeRender(Render *re) {}
  • void RE_shade_external(Render *re, ShadeInput *shi, ShadeResult *shr) {}
  • void RE_DataBase_GetView(Render *re, float mat[][4]) {}
  • struct Render *RE_NewRender(const char *name) {return (struct Render *)NULL;}
  • void RE_Database_Baking(struct Render *re, struct Scene *scene, int type, struct Object *actob) {};
  • void RE_zbuf_accumulate_vecblur(struct NodeBlurData *nd, int xsize, int ysize, float *newrect, float *imgrect, float *vecbufrect, float *zbufrect) {}