Previous Thread  Next Thread

chat icon Next Gen Blender API

eskil

Posted: Tue Oct 29, 2002 10:57 pm
Joined: 29 Oct 2002
Posts: 141
Like Ton i have spent too much of my time on administration and not too much coding. but im starting to come around to it.

But I have actually started to design the plug-in API for the Next Gen Blender project. here is a draft, it isn't complete yet, and it is not yet documented or implemented (although i have started an implementation).

E

/*
This is the experimental Blender module api. It should be used only for data evaluation and manipulation.
If you are interested in writing a real-time rending engine or an interface take a look at then VLL interface
(verse.sf.net) But the major bulk of the Next Gen technology should be implemented using this API.
*/

typedef unsigned int uint;
typedef unsigned char boolean;

typedef void Node;

typedef enum {
NGB_NT_OBJECT = 0,
NGB_NT_GEOMETRY,
NGB_NT_MATERIAL,
NGB_NT_BITMAP,
NGB_NT_CODE,
NGB_NT_PARTICLE
} NGBNodeType;

/* Inserting a new module */

typedef enum {
NGBIOT_DATA,
NGBIOT_REAL,
NGBIOT_INT,
NGBIOT_VECTOR,
NGBIOT_TEXT
} NGBIOType;

typedef struct{
NGBIOType type;
char *name;
}NGBIOData;

extern void ngb_fr_insert_function(char *name, void *(* func)(void *user), void *user, NGBIOData *input, uint input_count, NGBIOData *output, uint output_count);

/* Inserting a custom data module */

extern void ngb_fr_insert_custom_data_module(char *name, void *(* func)(Node *user), NGBNodeType type);

/* Setting the read and write state */


extern boolean ngb_active_input_connect_check(uint id);
extern boolean ngb_active_output_connect_check(uint id);

/* basic datatypes */

extern void ngb_active_input_set(uint input);
extern void ngb_active_output_set(uint output);

extern uint ngb_basic_data_count(uint input);

extern double ngb_input_real(uint input);
extern void ngb_output_real(uint output, double real);
extern int ngb_input_int(uint input);
extern void ngb_output_int(uint output, int interger);
extern void ngb_input_vector(uint input, double *vector);
extern void ngb_output_vector(uint output, double *vector);
extern char * ngb_input_text(uint input);
extern void ngb_output_text(uint output, char *text);
extern void ngb_input_matrix(uint input, double *vector);
extern void ngb_output_matrix(uint output, double *vector);

/* node read / write */

extern Node * ngb_get_node_id(uint input, uint id);
extern uint ngb_get_node_count(uint input);
extern void * ngb_custom_data_get(Node *node, char *type);

extern void ngb_output_node(Node *node);

extern NGBNodeType ngb_get_node_type(Node *node);
extern char * ngb_get_node_name(Node *node);

/* Object Node */

extern Node * ngb_on_create_new_node(uint ref);

extern Node * ngb_on_get_link(Node *node, NGBNodeType type);
extern void ngb_on_set_link(Node *node, Node *link);
extern void ngb_on_get_pos(Node *node, double *pos);
extern void ngb_on_set_pos(Node *node, double *pos);
extern void ngb_on_get_transform(Node *node, double *matrix);
extern void ngb_on_set_transform(Node *node, double *matrix);

/* Geometry Node */

typedef void GLayer;

typedef enum {
NGL_G_LT_VERTEX_XYZ,
NGL_G_LT_VERTEX_UINTEGER,
NGL_G_LT_VERTEX_REAL,
NGL_G_LT_POLYGON_CORNER_UINTEGER,
NGL_G_LT_POLYGON_CORNER_REAL,
NGL_G_LT_POLYGON_FACE_UINTEGER,
NGL_G_LT_POLYGON_FACE_REAL
} NGLGLayerType;

extern Node * ngb_gn_create_new_node(uint ref);
extern GLayer * ngb_gn_create_new_layer(Node *node, char *name, NGLGLayerType type);

extern GLayer * ngb_gn_get_layer_by_name_and_type(Node *node, char *name, NGLGLayerType type);

extern GLayer * ngb_gn_get_vertex_layer_by_name(Node *node, char *name);
extern uint ngb_gn_get_vertex_layer_count(Node *node);
extern GLayer * ngb_gn_get_vertex_layer_by_nr(Node *node, uint id);
extern uint ngb_gn_get_vertex_array_length(Node *node);
extern uint ngb_gn_get_vertex_empty_slot(Node *node);

extern GLayer * ngb_gn_get_poly_layer_by_name(Node *node, char *name);
extern uint ngb_gn_get_poly_layer_count(Node *node);
extern GLayer * ngb_gn_get_poly_layer_by_nr(Node *node, uint id);
extern uint ngb_gn_get_poly_array_length(Node *node);
extern uint ngb_gn_get_poly_empty_slot(Node *node);

extern NGLGLayerType ngb_gn_get_layer_type(GLayer *layer);

extern void ngb_gn_set_vertex_pos(GLayer *layer, uint id, double *pos);
extern void ngb_gn_get_vertex_pos(GLayer *layer, uint id, double *pos);
extern void ngb_gn_set_vertex_uint(GLayer *layer, uint id, uint integer);
extern uint ngb_gn_get_vertex_uint(GLayer *layer, uint id);
extern void ngb_gn_set_vertex_real(GLayer *layer, uint id, double real);
extern double ngb_gn_get_vertex_real(GLayer *layer, uint id);
extern boolean ngb_gn_is_vertex_used(GLayer *layer, uint id);

extern void ngb_gn_set_poly_ref(GLayer *layer, uint id, uint *ref);
extern void ngb_gn_get_poly_ref(GLayer *layer, uint id, uint *ref);
extern void ngb_gn_set_poly_corner_uint(GLayer *layer, uint id, uint integer);
extern uint ngb_gn_get_poly_corner_uint(GLayer *layer, uint id);
extern void ngb_gn_set_poly_corner_real(GLayer *layer, uint id, double real);
extern double ngb_gn_get_poly_corner_real(GLayer *layer, uint id);
extern void ngb_gn_set_poly_face_uint(GLayer *layer, uint id, uint integer);
extern uint ngb_gn_get_poly_face_uint(GLayer *layer, uint id);
extern void ngb_gn_set_poly_face_real(GLayer *layer, uint id, double real);
extern double ngb_gn_get_poly_face_real(GLayer *layer, uint id);
extern boolean ngb_gn_is_poly_used(GLayer *layer, uint id);
extern boolean ngb_gn_is_quad(GLayer *layer, uint id);

/* Bitmap Node */

typedef void BLayer;

typedef enum {
NGL_B_LT_REAL,
NGL_B_LT_SHORT,
NGL_B_LT_BYTE,
NGL_B_LT_BIT
}NGLBLayerType;

extern Node * ngb_bn_create_new_node(uint ref, uint x_default, uint y_default, uint z_default);

extern BLayer * ngb_bn_create_new_layer(Node *node, char *name, NGLBLayerType type);

extern BLayer * ngb_bn_get_layer_by_name(Node *node, char *name);
extern uint ngb_bn_get_layer_count(Node *node);
extern BLayer * ngb_bn_get_layer_by_nr(Node *node, uint id);

extern void ngb_bn_get_size(Node *node, uint *x, uint *y, uint *z);
extern double ngb_bn_evaluate_image_tile(BLayer *layer, float u, float v, float w);
extern double ngb_bn_evaluate_image_clamp(BLayer *layer, float u, float v, float w);
extern double ngb_bn_evaluate_image_int(BLayer *layer, uint u, uint v, uint w);
Reply with quote


H@dj

Posted: Thu Oct 31, 2002 9:40 am
Joined: 16 Oct 2002
Posts: 17
Hi eskil,

I just wanted to say "Thank You" for spending so much of your time,
(be it administering or coding)
to help us in making Blender a better 3d_animation program Very Happy

I for one appreciate all your hard work!, so...

Thank You,

dale
Reply with quote


Money_YaY!

Posted: Thu Oct 31, 2002 6:31 pm
Joined: 23 Oct 2002
Posts: 870
Pictures Please ^v^
Reply with quote


Eric

Posted: Thu Oct 31, 2002 10:46 pm
Joined: 16 Oct 2002
Posts: 192
Money_YaY! wrote:
Pictures Please ^v^

Pictures of what? Smile
Reply with quote


 
Jump to:  
Powered by phpBB © 2001, 2005 phpBB Group