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 *****
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef BSE_EDITIPO_H
|
|
|
|
|
#define BSE_EDITIPO_H
|
|
|
|
|
|
|
|
|
|
struct TransVert;
|
|
|
|
|
struct IpoCurve;
|
|
|
|
|
struct BezTriple;
|
|
|
|
|
struct Ipo;
|
|
|
|
|
struct EditIpo;
|
|
|
|
|
struct ID;
|
|
|
|
|
struct ListBase;
|
|
|
|
|
struct Object;
|
|
|
|
|
struct IpoKey;
|
|
|
|
|
struct TransOb;
|
2004-07-26 21:44:55 +00:00
|
|
|
struct Tex;
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
void remake_object_ipos(struct Object *ob);
|
2004-07-26 21:44:55 +00:00
|
|
|
char *getname_ac_ei(int nr);
|
|
|
|
|
char *getname_co_ei(int nr);
|
|
|
|
|
char *getname_ob_ei(int nr, int colipo);
|
|
|
|
|
char *getname_mtex_ei(int nr);
|
|
|
|
|
char *getname_tex_ei(int nr);
|
|
|
|
|
char *getname_mat_ei(int nr);
|
|
|
|
|
char *getname_world_ei(int nr);
|
|
|
|
|
char *getname_seq_ei(int nr);
|
|
|
|
|
char *getname_cu_ei(int nr);
|
|
|
|
|
char *getname_la_ei(int nr);
|
|
|
|
|
char *getname_cam_ei(int nr);
|
|
|
|
|
char *getname_snd_ei(int nr);
|
Sorry for the big commit, but I've been fixing many of these
issues in parallel... So this commit contains: an update of
the solver (e.g. moving objects), integration of blender IPOs,
improved rendering (motion blur, smoothed normals) and a first particle
test. In more detail:
Solver update:
- Moving objects using a relatively simple model, and not yet fully optimized - ok
for box falling into water, water in a moving glass might cause trouble. Simulation
times are influenced by overall no. of triangles of the mesh, scaling meshes up a lot
might also cause slowdowns.
- Additional obstacle settings: noslip (as before), free slip (move along wall freely)
and part slip (mix of both).
- Obstacle settings also added for domain boundaries now, the six walls of the domain are
obstacles after all as well
- Got rid of templates, should make compiling for e.g. macs more convenient,
for linux there's not much difference. Finally got rid of parser (and some other code
parts), the simulation now uses the internal API to transfer data.
- Some unnecessary file were removed, the GUI now needs 3 settings buttons...
This should still be changed (maybe by adding a new panel for domain objects).
IPOs:
- Animated params: viscosity, time and gravity for domains. In contrast
to normal time IPO for Blender objects, the fluidsim one scales the time
step size - so a constant 1 has no effect, values towards 0 slow it down,
larger ones speed the simulation up (-> longer time steps, more compuations).
The viscosity IPO is also only a factor for the selected viscosity (again, 1=no effect).
- For objects that are enabled for fluidsim, a new IPO type shows up. Inflow
objects can use the velocity channels to animate the inflow. Obstacles, in/outflow
objects can be switched on (Active IPO>0) and off (<0) during the simulation.
- Movement, rotation and scaling of those 3 types is exported from the normal
Blender channels (Loc,dLoc,etc.).
Particles:
- This is still experimental, so it might be deactivated for a
release... It should at some point be used to model smaller splashes,
depending on the the realworld size and the particle generation
settings particles are generated during simulation (stored in _particles_X.gz
files).
- These are loaded by enabling the particle field for an arbitrary object,
which should be given a halo material. For each frame, similar to the mesh
loading, the particle system them loads the simulated particle positions.
- For rendering, I "abused" the part->rt field - I couldnt find any use
for it in the code and it seems to work fine. The fluidsim particles
store their size there.
Rendering:
- The fluidims particles use scaled sizes and alpha values to give a more varied
appearance. In convertblender.c fluidsim particle systems use the p->rt field
to scale up the size and down the alpha of "smaller particles". Setting the
influence fields in the fluidims settings to 0 gives equally sized particles
with same alpha everywhere. Higher values cause larger differences.
- Smoothed normals: for unmodified fluid meshes (e.g. no subdivision) the normals
computed by the solver are used. This is basically done by switching off the
normal recalculation in convertblender.c (the function calc_fluidsimnormals
handles other mesh inits instead of calc_vertexnormals).
This could also be used to e.g. modify mesh normals in a modifier...
- Another change is that fluidsim meshes load the velocities computed
during the simulation for image based motion blur. This is inited in
load_fluidsimspeedvectors for the vector pass (they're loaded during the
normal load in DerivedMesh readBobjgz). Generation and loading can be switched
off in the settings. Vector pass currently loads the fluidism meshes 3 times,
so this should still be optimized.
Examples:
- smoothed normals versus normals from subdividing once:
http://www10.informatik.uni-erlangen.de/~sinithue/temp/v060227_1smoothnorms.png
http://www10.informatik.uni-erlangen.de/~sinithue/temp/v060227_2subdivnorms.png
- fluidsim particles, size/alpha influence 0:
http://www10.informatik.uni-erlangen.de/~sinithue/temp/v060227_3particlesnorm.png
size influence 1:
http://www10.informatik.uni-erlangen.de/~sinithue/temp/v060227_4particlessize.png
size & alpha influence 1:
http://www10.informatik.uni-erlangen.de/~sinithue/temp/v060227_5particlesalpha.png
- the standard drop with motion blur and particles:
http://www10.informatik.uni-erlangen.de/~sinithue/temp/elbeemupdate_t2new.mpg
(here's how it looks without
http://www10.informatik.uni-erlangen.de/~sinithue/temp/elbeemupdate_t1old.mpg)
- another inflow animation (moving, switched on/off) with a moving obstacle
(and strong mblur :)
http://www10.informatik.uni-erlangen.de/~sinithue/temp/elbeemupdate_t3ipos.mpg
Things still to fix:
- rotating & scaling domains causes wrong speed vectors
- get rid of SDL code for threading, use pthreads as well?
- update wiki documentation
- cool effects for rendering would be photon maps for caustics,
and motion blur for particles :)
2006-02-27 11:45:42 +00:00
|
|
|
char *getname_fluidsim_ei(int nr);
|
2005-09-26 15:34:21 +00:00
|
|
|
|
Version 1.0 of IpoDrivers.
First note that this is new functionality, unfinished, and only for
testing and feedback purposes. I'll list below what works, and what will
need work still.
This text is also in cms: http://www.blender.org/cms/Ipo_Drivers.680.0.html
An IpoDriver is like an IpoCurve, but instead of a Bezier curve, it allows
to connect a property of other Objects as input for the "channel". For
example, IpoDrivers can be used to have a Shape Key being "driven" by
the rotation of a Bone. Or the RGB colors of a Material get driven by the
XYZ location of an Object.
Editing of Drivers happens in the IpoWindow. Here you can notice that the
channels (right hand window) now have an "active" channel indicator.
To add a Driver, you have to use the "Transform Properties" Panel (Nkey).
Here you can add or remove a Driver to the active channel, and use the
buttons to fill in what kind of relationship you want to establish.
Driver Objects
Note that any Ipo Channel can become driven now, but that only Object
transformation or Pose Bone transformation can be used to become a
Driver now.
At this moment, only the local transformation is taken into account.
For Objects that means the location/rotation/scale value without Parent
transform (as shown in "Transform Properties" Panel for Objects).
For Pose Bones it means that only the Pose transform (changes of rest
position) is Driver information (also as shown in Transform Property
Panel in Pose Mode).
Mapping of Drivers
When an Ipo Channel is "driven", the mapping is by default one-to-one.
It is only restricted by already built-in limits for Channels, like
for Material the "R" value can only range from 0.0 to 1.0.
Also note that when mapping rotations, the actual rotation values
in Ipos are scaled down with a factor 10.0. (180 degrees actually has
in the Ipo system a value of 18.0). This is an ancient year zero
convention in Blender... it is a bit hidden, because the ruler
(vertical as well as horizontal) displays the virtual values correctly.
Only the Properties panel shows the actual value.
When you draw an IpoCurve in a Driven channel, this curve will define
the mapping between the Driver output (horizontal) and Driven input
(vertical, as usual).
A nice new option to use is "Insert one-to-one curve" (press I-key,
or in pulldown menu). This will also zoom the display in exactly to
fill the window, allowing easy edit. If you use this option with
degrees, it will map 180 degree rotation to a range of 1.0 unit.
Live updates
Since the Drivers are integrated in the Ipo system, they will always
be updated whenever an Ipo is evaluated. This happens at least on
frame changes.
For interactive feedback, updates while transforming objects were
added in these cases:
- Driven Object Ipos, by other Objects or Pose Bones
- Driven Shape Key Ipos, by other Objects or Pose Bones
You can also insert Drivers on Action Ipos, but these are only evaluated
on frame change now.
Todo
- Drivers can also get a text button, allowing a 1 line Python script
to be executed.
- Make UI for it a bit less hidden... maybe with visualization in 3D?
- Allowing global transform coordinates as Driver too.
Issues
- renaming Bones won't rename drivers
- (file) appending the Ipo won't append the linked driver Objects
2005-10-02 20:51:35 +00:00
|
|
|
struct EditIpo *get_active_editipo(void);
|
|
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
void boundbox_ipocurve(struct IpoCurve *icu);
|
|
|
|
|
void boundbox_ipo(struct Ipo *ipo, struct rctf *bb);
|
|
|
|
|
void editipo_changed(struct SpaceIpo *si, int doredraw);
|
|
|
|
|
void scale_editipo(void);
|
2005-10-10 18:05:30 +00:00
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
unsigned int ipo_rainbow(int cur, int tot);
|
2005-10-10 18:05:30 +00:00
|
|
|
|
2005-10-28 08:11:15 +00:00
|
|
|
void test_editipo(int doit);
|
2002-10-12 11:37:38 +00:00
|
|
|
void get_status_editipo(void);
|
|
|
|
|
void update_editipo_flags(void);
|
|
|
|
|
void set_editflag_editipo(void);
|
2003-03-24 01:46:05 +00:00
|
|
|
void ipo_toggle_showkey(void);
|
2002-10-12 11:37:38 +00:00
|
|
|
void swap_selectall_editipo(void);
|
|
|
|
|
void swap_visible_editipo(void);
|
|
|
|
|
void deselectall_editipo(void);
|
2005-10-10 18:05:30 +00:00
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
void move_to_frame(void);
|
|
|
|
|
void do_ipowin_buts(short event);
|
|
|
|
|
void do_ipo_selectbuttons(void);
|
2005-10-10 18:05:30 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
/* gets ipo curve, creates if needed */
|
|
|
|
|
struct IpoCurve *verify_ipocurve(struct ID *, short, char *, char *, int);
|
|
|
|
|
struct Ipo *verify_ipo(struct ID *, short, char *, char *);
|
|
|
|
|
int texchannel_to_adrcode(int channel);
|
|
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
void insert_vert_ipo(struct IpoCurve *icu, float x, float y);
|
|
|
|
|
void add_vert_ipo(void);
|
|
|
|
|
void add_duplicate_editipo(void);
|
|
|
|
|
void remove_doubles_ipo(void);
|
2004-01-12 13:30:00 +00:00
|
|
|
void join_ipo_menu(void);
|
|
|
|
|
void join_ipo(int mode);
|
|
|
|
|
void ipo_snap_menu(void);
|
|
|
|
|
void ipo_snap(short event);
|
2002-10-12 11:37:38 +00:00
|
|
|
void mouse_select_ipo(void);
|
|
|
|
|
void sethandles_ipo(int code);
|
2003-01-30 06:19:49 +00:00
|
|
|
void select_ipo_bezier_keys(struct Ipo *ipo, int selectmode);
|
2002-10-12 11:37:38 +00:00
|
|
|
void set_ipotype(void);
|
|
|
|
|
void borderselect_ipo(void);
|
|
|
|
|
void del_ipo(void);
|
2005-04-24 19:03:39 +00:00
|
|
|
void del_ipoCurve ( struct IpoCurve * icu );
|
2002-10-12 11:37:38 +00:00
|
|
|
void free_ipocopybuf(void);
|
|
|
|
|
void copy_editipo(void);
|
|
|
|
|
void paste_editipo(void);
|
2005-10-10 18:05:30 +00:00
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
void set_exprap_ipo(int mode);
|
2005-10-10 18:05:30 +00:00
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
void set_speed_editipo(float speed);
|
2005-10-10 18:05:30 +00:00
|
|
|
void insertkey(ID *id, int blocktype, char *actname, char *constname, int adrcode);
|
2002-10-12 11:37:38 +00:00
|
|
|
void insertkey_editipo(void);
|
|
|
|
|
void common_insertkey(void);
|
|
|
|
|
void free_ipokey(struct ListBase *lb);
|
|
|
|
|
void add_to_ipokey(struct ListBase *lb, struct BezTriple *bezt, int nr, int len);
|
|
|
|
|
void make_ipokey(void);
|
2003-07-20 23:04:09 +00:00
|
|
|
void make_ipokey_spec(struct ListBase *lb, struct Ipo *ipo);
|
2002-10-12 11:37:38 +00:00
|
|
|
void make_ipokey_transform(struct Object *ob, struct ListBase *lb, int sel);
|
|
|
|
|
void update_ipokey_val(void);
|
|
|
|
|
void set_tob_old(float *old, float *poin);
|
|
|
|
|
void set_ipo_pointers_transob(struct IpoKey *ik, struct TransOb *tob);
|
|
|
|
|
void nextkey(struct ListBase *elems, int dir);
|
|
|
|
|
void movekey_ipo(int dir);
|
|
|
|
|
void movekey_obipo(int dir);
|
|
|
|
|
void nextkey_ipo(int dir);
|
|
|
|
|
void nextkey_obipo(int dir);
|
|
|
|
|
void remake_ipo_transverts(struct TransVert *transmain, float *dvec, int tot);
|
|
|
|
|
void transform_ipo(int mode);
|
|
|
|
|
void filter_sampledata(float *data, int sfra, int efra);
|
|
|
|
|
void sampledata_to_ipocurve(float *data, int sfra, int efra, struct IpoCurve *icu);
|
|
|
|
|
void ipo_record(void);
|
|
|
|
|
|
2003-01-28 03:11:27 +00:00
|
|
|
void sethandles_ipo_keys(struct Ipo *ipo, int code);
|
2005-10-29 21:27:07 +00:00
|
|
|
void snap_ipo_keys(struct Ipo *ipo);
|
2003-01-28 03:59:33 +00:00
|
|
|
void setipotype_ipo(struct Ipo *ipo, int code);
|
2002-10-12 11:37:38 +00:00
|
|
|
void set_ipo_key_selection(struct Ipo *ipo, int sel);
|
|
|
|
|
int is_ipo_key_selected(struct Ipo *ipo);
|
|
|
|
|
void delete_ipo_keys(struct Ipo *ipo);
|
|
|
|
|
int fullselect_ipo_keys(struct Ipo *ipo);
|
|
|
|
|
int add_trans_ipo_keys(struct Ipo *ipo, struct TransVert *tv, int tvtot);
|
|
|
|
|
void duplicate_ipo_keys(struct Ipo *ipo);
|
|
|
|
|
void borderselect_ipo_key(struct Ipo *ipo, float xmin, float xmax, int val);
|
2003-07-20 23:04:09 +00:00
|
|
|
void borderselect_icu_key(struct IpoCurve *icu, float xmin, float xmax,
|
|
|
|
|
int (*select_function)(struct BezTriple *));
|
2005-12-18 20:14:22 +00:00
|
|
|
void bone2objectspace(float obSpaceBoneMat[][4], float obSpace[][4], float restPos[][4]);
|
|
|
|
|
void insertmatrixkey(ID *id, int blocktype, char *actname, char *constname, int adrcode, float matrixvalue);
|
2005-10-10 18:05:30 +00:00
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
void select_ipo_key(struct Ipo *ipo, float selx, int sel);
|
2003-01-30 06:19:49 +00:00
|
|
|
void select_icu_key(struct IpoCurve *icu, float selx, int selectmode);
|
2005-11-12 16:22:10 +00:00
|
|
|
void setexprap_ipoloop(struct Ipo *ipo, int code);
|
|
|
|
|
|
2005-10-10 18:05:30 +00:00
|
|
|
/* callbacks */
|
2003-01-30 06:19:49 +00:00
|
|
|
int select_bezier_add(struct BezTriple *bezt);
|
|
|
|
|
int select_bezier_subtract(struct BezTriple *bezt);
|
|
|
|
|
int select_bezier_invert(struct BezTriple *bezt);
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
#endif /* BSE_EDITIPO_H */
|
2002-10-30 02:07:20 +00:00
|
|
|
|