Next Gen Blender API

General discussion about the development of the open source Blender

Moderators: jesterKing, stiv

Post Reply
Posts: 140
Joined: Tue Oct 29, 2002 10:42 pm

Next Gen Blender API

Post by eskil » Tue Oct 29, 2002 10:57 pm

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).


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
( 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 {
} NGBNodeType;

/* Inserting a new module */

typedef enum {
} NGBIOType;

typedef struct{
NGBIOType type;
char *name;

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 {
} 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 {

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);

Posts: 16
Joined: Wed Oct 16, 2002 8:53 am

Post by H@dj » Thu Oct 31, 2002 9:40 am

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 :D

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

Thank You,


Posts: 442
Joined: Wed Oct 23, 2002 2:47 pm

Post by Money_YaY! » Thu Oct 31, 2002 6:31 pm

Pictures Please ^v^

Posts: 163
Joined: Wed Oct 16, 2002 1:01 pm
Location: Sweden, Norrköping

Post by Eric » Thu Oct 31, 2002 10:46 pm

Money_YaY! wrote:Pictures Please ^v^
Pictures of what? :)

Post Reply