Code cleanup in rna files (huge, higly automated with py script).

Addresses:
* C++ comments.
* Spaces after if/for/while/switch statements.
* Spaces around assignment operators.
This commit is contained in:
2012-03-05 23:30:41 +00:00
parent 1eb893a114
commit 0114d78c33
82 changed files with 12466 additions and 12461 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -84,30 +84,30 @@ EnumPropertyItem id_type_items[] = {
/* name functions that ignore the first two ID characters */ /* name functions that ignore the first two ID characters */
void rna_ID_name_get(PointerRNA *ptr, char *value) void rna_ID_name_get(PointerRNA *ptr, char *value)
{ {
ID *id= (ID*)ptr->data; ID *id = (ID*)ptr->data;
BLI_strncpy(value, id->name+2, sizeof(id->name)-2); BLI_strncpy(value, id->name+2, sizeof(id->name)-2);
} }
int rna_ID_name_length(PointerRNA *ptr) int rna_ID_name_length(PointerRNA *ptr)
{ {
ID *id= (ID*)ptr->data; ID *id = (ID*)ptr->data;
return strlen(id->name+2); return strlen(id->name+2);
} }
void rna_ID_name_set(PointerRNA *ptr, const char *value) void rna_ID_name_set(PointerRNA *ptr, const char *value)
{ {
ID *id= (ID*)ptr->data; ID *id = (ID*)ptr->data;
BLI_strncpy_utf8(id->name+2, value, sizeof(id->name)-2); BLI_strncpy_utf8(id->name+2, value, sizeof(id->name)-2);
test_idbutton(id->name+2); test_idbutton(id->name+2);
} }
static int rna_ID_name_editable(PointerRNA *ptr) static int rna_ID_name_editable(PointerRNA *ptr)
{ {
ID *id= (ID*)ptr->data; ID *id = (ID*)ptr->data;
if (GS(id->name) == ID_VF) { if (GS(id->name) == ID_VF) {
VFont *vf= (VFont *)id; VFont *vf = (VFont *)id;
if (strcmp(vf->name, FO_BUILTIN_NAME)==0) if (strcmp(vf->name, FO_BUILTIN_NAME) == 0)
return 0; return 0;
} }
@@ -116,41 +116,41 @@ static int rna_ID_name_editable(PointerRNA *ptr)
short RNA_type_to_ID_code(StructRNA *type) short RNA_type_to_ID_code(StructRNA *type)
{ {
if(RNA_struct_is_a(type, &RNA_Action)) return ID_AC; if (RNA_struct_is_a(type, &RNA_Action)) return ID_AC;
if(RNA_struct_is_a(type, &RNA_Armature)) return ID_AR; if (RNA_struct_is_a(type, &RNA_Armature)) return ID_AR;
if(RNA_struct_is_a(type, &RNA_Brush)) return ID_BR; if (RNA_struct_is_a(type, &RNA_Brush)) return ID_BR;
if(RNA_struct_is_a(type, &RNA_Camera)) return ID_CA; if (RNA_struct_is_a(type, &RNA_Camera)) return ID_CA;
if(RNA_struct_is_a(type, &RNA_Curve)) return ID_CU; if (RNA_struct_is_a(type, &RNA_Curve)) return ID_CU;
if(RNA_struct_is_a(type, &RNA_GreasePencil)) return ID_GD; if (RNA_struct_is_a(type, &RNA_GreasePencil)) return ID_GD;
if(RNA_struct_is_a(type, &RNA_Group)) return ID_GR; if (RNA_struct_is_a(type, &RNA_Group)) return ID_GR;
if(RNA_struct_is_a(type, &RNA_Image)) return ID_IM; if (RNA_struct_is_a(type, &RNA_Image)) return ID_IM;
if(RNA_struct_is_a(type, &RNA_Key)) return ID_KE; if (RNA_struct_is_a(type, &RNA_Key)) return ID_KE;
if(RNA_struct_is_a(type, &RNA_Lamp)) return ID_LA; if (RNA_struct_is_a(type, &RNA_Lamp)) return ID_LA;
if(RNA_struct_is_a(type, &RNA_Library)) return ID_LI; if (RNA_struct_is_a(type, &RNA_Library)) return ID_LI;
if(RNA_struct_is_a(type, &RNA_Lattice)) return ID_LT; if (RNA_struct_is_a(type, &RNA_Lattice)) return ID_LT;
if(RNA_struct_is_a(type, &RNA_Material)) return ID_MA; if (RNA_struct_is_a(type, &RNA_Material)) return ID_MA;
if(RNA_struct_is_a(type, &RNA_MetaBall)) return ID_MB; if (RNA_struct_is_a(type, &RNA_MetaBall)) return ID_MB;
if(RNA_struct_is_a(type, &RNA_NodeTree)) return ID_NT; if (RNA_struct_is_a(type, &RNA_NodeTree)) return ID_NT;
if(RNA_struct_is_a(type, &RNA_Mesh)) return ID_ME; if (RNA_struct_is_a(type, &RNA_Mesh)) return ID_ME;
if(RNA_struct_is_a(type, &RNA_Object)) return ID_OB; if (RNA_struct_is_a(type, &RNA_Object)) return ID_OB;
if(RNA_struct_is_a(type, &RNA_ParticleSettings)) return ID_PA; if (RNA_struct_is_a(type, &RNA_ParticleSettings)) return ID_PA;
if(RNA_struct_is_a(type, &RNA_Scene)) return ID_SCE; if (RNA_struct_is_a(type, &RNA_Scene)) return ID_SCE;
if(RNA_struct_is_a(type, &RNA_Screen)) return ID_SCR; if (RNA_struct_is_a(type, &RNA_Screen)) return ID_SCR;
if(RNA_struct_is_a(type, &RNA_Speaker)) return ID_SPK; if (RNA_struct_is_a(type, &RNA_Speaker)) return ID_SPK;
if(RNA_struct_is_a(type, &RNA_Sound)) return ID_SO; if (RNA_struct_is_a(type, &RNA_Sound)) return ID_SO;
if(RNA_struct_is_a(type, &RNA_Text)) return ID_TXT; if (RNA_struct_is_a(type, &RNA_Text)) return ID_TXT;
if(RNA_struct_is_a(type, &RNA_Texture)) return ID_TE; if (RNA_struct_is_a(type, &RNA_Texture)) return ID_TE;
if(RNA_struct_is_a(type, &RNA_VectorFont)) return ID_VF; if (RNA_struct_is_a(type, &RNA_VectorFont)) return ID_VF;
if(RNA_struct_is_a(type, &RNA_World)) return ID_WO; if (RNA_struct_is_a(type, &RNA_World)) return ID_WO;
if(RNA_struct_is_a(type, &RNA_WindowManager)) return ID_WM; if (RNA_struct_is_a(type, &RNA_WindowManager)) return ID_WM;
if(RNA_struct_is_a(type, &RNA_MovieClip)) return ID_MC; if (RNA_struct_is_a(type, &RNA_MovieClip)) return ID_MC;
return 0; return 0;
} }
StructRNA *ID_code_to_RNA_type(short idcode) StructRNA *ID_code_to_RNA_type(short idcode)
{ {
switch(idcode) { switch (idcode) {
case ID_AC: return &RNA_Action; case ID_AC: return &RNA_Action;
case ID_AR: return &RNA_Armature; case ID_AR: return &RNA_Armature;
case ID_BR: return &RNA_Brush; case ID_BR: return &RNA_Brush;
@@ -185,7 +185,7 @@ StructRNA *ID_code_to_RNA_type(short idcode)
StructRNA *rna_ID_refine(PointerRNA *ptr) StructRNA *rna_ID_refine(PointerRNA *ptr)
{ {
ID *id= (ID*)ptr->data; ID *id = (ID*)ptr->data;
return ID_code_to_RNA_type(GS(id->name)); return ID_code_to_RNA_type(GS(id->name));
} }
@@ -197,13 +197,13 @@ IDProperty *rna_ID_idprops(PointerRNA *ptr, int create)
void rna_ID_fake_user_set(PointerRNA *ptr, int value) void rna_ID_fake_user_set(PointerRNA *ptr, int value)
{ {
ID *id= (ID*)ptr->data; ID *id = (ID*)ptr->data;
if(value && !(id->flag & LIB_FAKEUSER)) { if (value && !(id->flag & LIB_FAKEUSER)) {
id->flag |= LIB_FAKEUSER; id->flag |= LIB_FAKEUSER;
id_us_plus(id); id_us_plus(id);
} }
else if(!value && (id->flag & LIB_FAKEUSER)) { else if (!value && (id->flag & LIB_FAKEUSER)) {
id->flag &= ~LIB_FAKEUSER; id->flag &= ~LIB_FAKEUSER;
id_us_min(id); id_us_min(id);
} }
@@ -227,19 +227,19 @@ StructRNA *rna_PropertyGroup_register(Main *UNUSED(bmain), ReportList *reports,
RNA_pointer_create(NULL, &RNA_PropertyGroup, NULL, &dummyptr); RNA_pointer_create(NULL, &RNA_PropertyGroup, NULL, &dummyptr);
/* validate the python class */ /* validate the python class */
if(validate(&dummyptr, data, NULL) != 0) if (validate(&dummyptr, data, NULL) != 0)
return NULL; return NULL;
/* note: it looks like there is no length limit on the srna id since its /* note: it looks like there is no length limit on the srna id since its
* just a char pointer, but take care here, also be careful that python * just a char pointer, but take care here, also be careful that python
* owns the string pointer which it could potentially free while blender * owns the string pointer which it could potentially free while blender
* is running. */ * is running. */
if(BLI_strnlen(identifier, MAX_IDPROP_NAME) == MAX_IDPROP_NAME) { if (BLI_strnlen(identifier, MAX_IDPROP_NAME) == MAX_IDPROP_NAME) {
BKE_reportf(reports, RPT_ERROR, "registering id property class: '%s' is too long, maximum length is " STRINGIFY(MAX_IDPROP_NAME), identifier); BKE_reportf(reports, RPT_ERROR, "registering id property class: '%s' is too long, maximum length is " STRINGIFY(MAX_IDPROP_NAME), identifier);
return NULL; return NULL;
} }
return RNA_def_struct(&BLENDER_RNA, identifier, "PropertyGroup"); // XXX return RNA_def_struct(&BLENDER_RNA, identifier, "PropertyGroup"); /* XXX */
} }
StructRNA* rna_PropertyGroup_refine(PointerRNA *ptr) StructRNA* rna_PropertyGroup_refine(PointerRNA *ptr)
@@ -251,8 +251,8 @@ ID *rna_ID_copy(ID *id)
{ {
ID *newid; ID *newid;
if(id_copy(id, &newid, 0)) { if (id_copy(id, &newid, 0)) {
if(newid) id_us_min(newid); if (newid) id_us_min(newid);
return newid; return newid;
} }
@@ -268,14 +268,14 @@ static void rna_ID_update_tag(ID *id, ReportList *reports, int flag)
BKE_text_to_curve(sce, ob, CU_LEFT); BKE_text_to_curve(sce, ob, CU_LEFT);
}*/ }*/
if(flag == 0) { if (flag == 0) {
/* pass */ /* pass */
} }
else { else {
/* ensure flag us correct for the type */ /* ensure flag us correct for the type */
switch(GS(id->name)) { switch (GS(id->name)) {
case ID_OB: case ID_OB:
if(flag & ~(OB_RECALC_ALL)) { if (flag & ~(OB_RECALC_ALL)) {
BKE_report(reports, RPT_ERROR, "'refresh' incompatible with Object ID type"); BKE_report(reports, RPT_ERROR, "'refresh' incompatible with Object ID type");
return; return;
} }
@@ -298,28 +298,28 @@ static void rna_ID_update_tag(ID *id, ReportList *reports, int flag)
void rna_ID_user_clear(ID *id) void rna_ID_user_clear(ID *id)
{ {
id->us= 0; /* dont save */ id->us = 0; /* dont save */
id->flag &= ~LIB_FAKEUSER; id->flag &= ~LIB_FAKEUSER;
} }
static void rna_IDPArray_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) static void rna_IDPArray_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{ {
IDProperty *prop= (IDProperty *)ptr->data; IDProperty *prop = (IDProperty *)ptr->data;
rna_iterator_array_begin(iter, IDP_IDPArray(prop), sizeof(IDProperty), prop->len, 0, NULL); rna_iterator_array_begin(iter, IDP_IDPArray(prop), sizeof(IDProperty), prop->len, 0, NULL);
} }
static int rna_IDPArray_length(PointerRNA *ptr) static int rna_IDPArray_length(PointerRNA *ptr)
{ {
IDProperty *prop= (IDProperty *)ptr->data; IDProperty *prop = (IDProperty *)ptr->data;
return prop->len; return prop->len;
} }
int rna_IDMaterials_assign_int(PointerRNA *ptr, int key, const PointerRNA *assign_ptr) int rna_IDMaterials_assign_int(PointerRNA *ptr, int key, const PointerRNA *assign_ptr)
{ {
ID *id= ptr->id.data; ID *id = ptr->id.data;
short *totcol= give_totcolp_id(id); short *totcol = give_totcolp_id(id);
Material *mat_id= assign_ptr->id.data; Material *mat_id = assign_ptr->id.data;
if(totcol && (key >= 0 && key < *totcol)) { if (totcol && (key >= 0 && key < *totcol)) {
assign_material_id(id, mat_id, key + 1); assign_material_id(id, mat_id, key + 1);
return 1; return 1;
} }
@@ -330,7 +330,7 @@ int rna_IDMaterials_assign_int(PointerRNA *ptr, int key, const PointerRNA *assig
void rna_Library_filepath_set(PointerRNA *ptr, const char *value) void rna_Library_filepath_set(PointerRNA *ptr, const char *value)
{ {
Library *lib= (Library*)ptr->data; Library *lib = (Library*)ptr->data;
BKE_library_filepath_set(lib, value); BKE_library_filepath_set(lib, value);
} }
@@ -343,56 +343,56 @@ static void rna_def_ID_properties(BlenderRNA *brna)
/* this is struct is used for holding the virtual /* this is struct is used for holding the virtual
* PropertyRNA's for ID properties */ * PropertyRNA's for ID properties */
srna= RNA_def_struct(brna, "PropertyGroupItem", NULL); srna = RNA_def_struct(brna, "PropertyGroupItem", NULL);
RNA_def_struct_sdna(srna, "IDProperty"); RNA_def_struct_sdna(srna, "IDProperty");
RNA_def_struct_ui_text(srna, "ID Property", "Property that stores arbitrary, user defined properties"); RNA_def_struct_ui_text(srna, "ID Property", "Property that stores arbitrary, user defined properties");
/* IDP_STRING */ /* IDP_STRING */
prop= RNA_def_property(srna, "string", PROP_STRING, PROP_NONE); prop = RNA_def_property(srna, "string", PROP_STRING, PROP_NONE);
RNA_def_property_flag(prop, PROP_EXPORT|PROP_IDPROPERTY); RNA_def_property_flag(prop, PROP_EXPORT|PROP_IDPROPERTY);
/* IDP_INT */ /* IDP_INT */
prop= RNA_def_property(srna, "int", PROP_INT, PROP_NONE); prop = RNA_def_property(srna, "int", PROP_INT, PROP_NONE);
RNA_def_property_flag(prop, PROP_EXPORT|PROP_IDPROPERTY); RNA_def_property_flag(prop, PROP_EXPORT|PROP_IDPROPERTY);
prop= RNA_def_property(srna, "int_array", PROP_INT, PROP_NONE); prop = RNA_def_property(srna, "int_array", PROP_INT, PROP_NONE);
RNA_def_property_flag(prop, PROP_EXPORT|PROP_IDPROPERTY); RNA_def_property_flag(prop, PROP_EXPORT|PROP_IDPROPERTY);
RNA_def_property_array(prop, 1); RNA_def_property_array(prop, 1);
/* IDP_FLOAT */ /* IDP_FLOAT */
prop= RNA_def_property(srna, "float", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "float", PROP_FLOAT, PROP_NONE);
RNA_def_property_flag(prop, PROP_EXPORT|PROP_IDPROPERTY); RNA_def_property_flag(prop, PROP_EXPORT|PROP_IDPROPERTY);
prop= RNA_def_property(srna, "float_array", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "float_array", PROP_FLOAT, PROP_NONE);
RNA_def_property_flag(prop, PROP_EXPORT|PROP_IDPROPERTY); RNA_def_property_flag(prop, PROP_EXPORT|PROP_IDPROPERTY);
RNA_def_property_array(prop, 1); RNA_def_property_array(prop, 1);
/* IDP_DOUBLE */ /* IDP_DOUBLE */
prop= RNA_def_property(srna, "double", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "double", PROP_FLOAT, PROP_NONE);
RNA_def_property_flag(prop, PROP_EXPORT|PROP_IDPROPERTY); RNA_def_property_flag(prop, PROP_EXPORT|PROP_IDPROPERTY);
prop= RNA_def_property(srna, "double_array", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "double_array", PROP_FLOAT, PROP_NONE);
RNA_def_property_flag(prop, PROP_EXPORT|PROP_IDPROPERTY); RNA_def_property_flag(prop, PROP_EXPORT|PROP_IDPROPERTY);
RNA_def_property_array(prop, 1); RNA_def_property_array(prop, 1);
/* IDP_GROUP */ /* IDP_GROUP */
prop= RNA_def_property(srna, "group", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "group", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_EXPORT|PROP_IDPROPERTY); RNA_def_property_flag(prop, PROP_EXPORT|PROP_IDPROPERTY);
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "PropertyGroup"); RNA_def_property_struct_type(prop, "PropertyGroup");
prop= RNA_def_property(srna, "collection", PROP_COLLECTION, PROP_NONE); prop = RNA_def_property(srna, "collection", PROP_COLLECTION, PROP_NONE);
RNA_def_property_flag(prop, PROP_EXPORT|PROP_IDPROPERTY); RNA_def_property_flag(prop, PROP_EXPORT|PROP_IDPROPERTY);
RNA_def_property_struct_type(prop, "PropertyGroup"); RNA_def_property_struct_type(prop, "PropertyGroup");
prop= RNA_def_property(srna, "idp_array", PROP_COLLECTION, PROP_NONE); prop = RNA_def_property(srna, "idp_array", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "PropertyGroup"); RNA_def_property_struct_type(prop, "PropertyGroup");
RNA_def_property_collection_funcs(prop, "rna_IDPArray_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_IDPArray_length", NULL, NULL, NULL); RNA_def_property_collection_funcs(prop, "rna_IDPArray_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_IDPArray_length", NULL, NULL, NULL);
RNA_def_property_flag(prop, PROP_EXPORT|PROP_IDPROPERTY); RNA_def_property_flag(prop, PROP_EXPORT|PROP_IDPROPERTY);
// never tested, maybe its useful to have this? /* never tested, maybe its useful to have this? */
#if 0 #if 0
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_flag(prop, PROP_EXPORT|PROP_IDPROPERTY); RNA_def_property_flag(prop, PROP_EXPORT|PROP_IDPROPERTY);
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Name", "Unique name used in the code and scripting"); RNA_def_property_ui_text(prop, "Name", "Unique name used in the code and scripting");
@@ -404,7 +404,7 @@ static void rna_def_ID_properties(BlenderRNA *brna)
/* ID property groups > level 0, since level 0 group is merged /* ID property groups > level 0, since level 0 group is merged
* with native RNA properties. the builtin_properties will take * with native RNA properties. the builtin_properties will take
* care of the properties here */ * care of the properties here */
srna= RNA_def_struct(brna, "PropertyGroup", NULL); srna = RNA_def_struct(brna, "PropertyGroup", NULL);
RNA_def_struct_sdna(srna, "IDPropertyGroup"); RNA_def_struct_sdna(srna, "IDPropertyGroup");
RNA_def_struct_ui_text(srna, "ID Property Group", "Group of ID properties"); RNA_def_struct_ui_text(srna, "ID Property Group", "Group of ID properties");
RNA_def_struct_idprops_func(srna, "rna_PropertyGroup_idprops"); RNA_def_struct_idprops_func(srna, "rna_PropertyGroup_idprops");
@@ -414,9 +414,9 @@ static void rna_def_ID_properties(BlenderRNA *brna)
/* important so python types can have their name used in list views /* important so python types can have their name used in list views
* however this isnt prefect because it overrides how python would set the name * however this isnt prefect because it overrides how python would set the name
* when we only really want this so RNA_def_struct_name_property() is set to something useful */ * when we only really want this so RNA_def_struct_name_property() is set to something useful */
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_flag(prop, PROP_EXPORT|PROP_IDPROPERTY); RNA_def_property_flag(prop, PROP_EXPORT|PROP_IDPROPERTY);
//RNA_def_property_clear_flag(prop, PROP_EDITABLE); /*RNA_def_property_clear_flag(prop, PROP_EDITABLE); */
RNA_def_property_ui_text(prop, "Name", "Unique name used in the code and scripting"); RNA_def_property_ui_text(prop, "Name", "Unique name used in the code and scripting");
RNA_def_struct_name_property(srna, prop); RNA_def_struct_name_property(srna, prop);
} }
@@ -429,21 +429,21 @@ static void rna_def_ID_materials(BlenderRNA *brna)
PropertyRNA *parm; PropertyRNA *parm;
/* for mesh/mball/curve materials */ /* for mesh/mball/curve materials */
srna= RNA_def_struct(brna, "IDMaterials", NULL); srna = RNA_def_struct(brna, "IDMaterials", NULL);
RNA_def_struct_sdna(srna, "ID"); RNA_def_struct_sdna(srna, "ID");
RNA_def_struct_ui_text(srna, "ID Materials", "Collection of materials"); RNA_def_struct_ui_text(srna, "ID Materials", "Collection of materials");
func= RNA_def_function(srna, "append", "material_append_id"); func = RNA_def_function(srna, "append", "material_append_id");
RNA_def_function_ui_description(func, "Add a new material to the data block"); RNA_def_function_ui_description(func, "Add a new material to the data block");
parm= RNA_def_pointer(func, "material", "Material", "", "Material to add"); parm = RNA_def_pointer(func, "material", "Material", "", "Material to add");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
func= RNA_def_function(srna, "pop", "material_pop_id"); func = RNA_def_function(srna, "pop", "material_pop_id");
RNA_def_function_ui_description(func, "Remove a material from the data block"); RNA_def_function_ui_description(func, "Remove a material from the data block");
parm= RNA_def_int(func, "index", 0, 0, MAXMAT, "", "Index of material to remove", 0, MAXMAT); parm = RNA_def_int(func, "index", 0, 0, MAXMAT, "", "Index of material to remove", 0, MAXMAT);
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_boolean(func, "update_data", 0, "", "Update data by re-adjusting the material slots assigned"); RNA_def_boolean(func, "update_data", 0, "", "Update data by re-adjusting the material slots assigned");
parm= RNA_def_pointer(func, "material", "Material", "", "Material to remove"); parm = RNA_def_pointer(func, "material", "Material", "", "Material to remove");
RNA_def_function_return(func, parm); RNA_def_function_return(func, parm);
} }
@@ -459,13 +459,13 @@ static void rna_def_ID(BlenderRNA *brna)
{OB_RECALC_TIME, "TIME", 0, "Time", ""}, {OB_RECALC_TIME, "TIME", 0, "Time", ""},
{0, NULL, 0, NULL, NULL}}; {0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "ID", NULL); srna = RNA_def_struct(brna, "ID", NULL);
RNA_def_struct_ui_text(srna, "ID", "Base type for datablocks, defining a unique name, linking from other libraries and garbage collection"); RNA_def_struct_ui_text(srna, "ID", "Base type for datablocks, defining a unique name, linking from other libraries and garbage collection");
RNA_def_struct_flag(srna, STRUCT_ID|STRUCT_ID_REFCOUNT); RNA_def_struct_flag(srna, STRUCT_ID|STRUCT_ID_REFCOUNT);
RNA_def_struct_refine_func(srna, "rna_ID_refine"); RNA_def_struct_refine_func(srna, "rna_ID_refine");
RNA_def_struct_idprops_func(srna, "rna_ID_idprops"); RNA_def_struct_idprops_func(srna, "rna_ID_idprops");
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Name", "Unique datablock ID name"); RNA_def_property_ui_text(prop, "Name", "Unique datablock ID name");
RNA_def_property_string_funcs(prop, "rna_ID_name_get", "rna_ID_name_length", "rna_ID_name_set"); RNA_def_property_string_funcs(prop, "rna_ID_name_get", "rna_ID_name_length", "rna_ID_name_set");
RNA_def_property_string_maxlength(prop, MAX_ID_NAME-2); RNA_def_property_string_maxlength(prop, MAX_ID_NAME-2);
@@ -473,55 +473,55 @@ static void rna_def_ID(BlenderRNA *brna)
RNA_def_property_update(prop, NC_ID|NA_RENAME, NULL); RNA_def_property_update(prop, NC_ID|NA_RENAME, NULL);
RNA_def_struct_name_property(srna, prop); RNA_def_struct_name_property(srna, prop);
prop= RNA_def_property(srna, "users", PROP_INT, PROP_UNSIGNED); prop = RNA_def_property(srna, "users", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "us"); RNA_def_property_int_sdna(prop, NULL, "us");
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Users", "Number of times this datablock is referenced"); RNA_def_property_ui_text(prop, "Users", "Number of times this datablock is referenced");
prop= RNA_def_property(srna, "use_fake_user", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_fake_user", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", LIB_FAKEUSER); RNA_def_property_boolean_sdna(prop, NULL, "flag", LIB_FAKEUSER);
RNA_def_property_ui_text(prop, "Fake User", "Save this datablock even if it has no users"); RNA_def_property_ui_text(prop, "Fake User", "Save this datablock even if it has no users");
RNA_def_property_boolean_funcs(prop, NULL, "rna_ID_fake_user_set"); RNA_def_property_boolean_funcs(prop, NULL, "rna_ID_fake_user_set");
prop= RNA_def_property(srna, "tag", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "tag", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", LIB_DOIT); RNA_def_property_boolean_sdna(prop, NULL, "flag", LIB_DOIT);
RNA_def_property_flag(prop, PROP_LIB_EXCEPTION); RNA_def_property_flag(prop, PROP_LIB_EXCEPTION);
RNA_def_property_ui_text(prop, "Tag", "Tools can use this to tag data (initial state is undefined)"); RNA_def_property_ui_text(prop, "Tag", "Tools can use this to tag data (initial state is undefined)");
prop= RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", LIB_ID_RECALC); RNA_def_property_boolean_sdna(prop, NULL, "flag", LIB_ID_RECALC);
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Is Updated", "Datablock is tagged for recalculation"); RNA_def_property_ui_text(prop, "Is Updated", "Datablock is tagged for recalculation");
prop= RNA_def_property(srna, "is_updated_data", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "is_updated_data", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", LIB_ID_RECALC_DATA); RNA_def_property_boolean_sdna(prop, NULL, "flag", LIB_ID_RECALC_DATA);
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Is Updated Data", "Datablock data is tagged for recalculation"); RNA_def_property_ui_text(prop, "Is Updated Data", "Datablock data is tagged for recalculation");
prop= RNA_def_property(srna, "library", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "library", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "lib"); RNA_def_property_pointer_sdna(prop, NULL, "lib");
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Library", "Library file the datablock is linked from"); RNA_def_property_ui_text(prop, "Library", "Library file the datablock is linked from");
/* functions */ /* functions */
func= RNA_def_function(srna, "copy", "rna_ID_copy"); func = RNA_def_function(srna, "copy", "rna_ID_copy");
RNA_def_function_ui_description(func, "Create a copy of this datablock (not supported for all datablocks)"); RNA_def_function_ui_description(func, "Create a copy of this datablock (not supported for all datablocks)");
parm= RNA_def_pointer(func, "id", "ID", "", "New copy of the ID"); parm = RNA_def_pointer(func, "id", "ID", "", "New copy of the ID");
RNA_def_function_return(func, parm); RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "user_clear", "rna_ID_user_clear"); func = RNA_def_function(srna, "user_clear", "rna_ID_user_clear");
RNA_def_function_ui_description(func, "Clear the user count of a datablock so its not saved, " RNA_def_function_ui_description(func, "Clear the user count of a datablock so its not saved, "
"on reload the data will be removed"); "on reload the data will be removed");
func= RNA_def_function(srna, "animation_data_create", "BKE_id_add_animdata"); func = RNA_def_function(srna, "animation_data_create", "BKE_id_add_animdata");
RNA_def_function_ui_description(func, "Create animation data to this ID, note that not all ID types support this"); RNA_def_function_ui_description(func, "Create animation data to this ID, note that not all ID types support this");
parm= RNA_def_pointer(func, "anim_data", "AnimData", "", "New animation data or NULL"); parm = RNA_def_pointer(func, "anim_data", "AnimData", "", "New animation data or NULL");
RNA_def_function_return(func, parm); RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "animation_data_clear", "BKE_free_animdata"); func = RNA_def_function(srna, "animation_data_clear", "BKE_free_animdata");
RNA_def_function_ui_description(func, "Clear animation on this this ID"); RNA_def_function_ui_description(func, "Clear animation on this this ID");
func= RNA_def_function(srna, "update_tag", "rna_ID_update_tag"); func = RNA_def_function(srna, "update_tag", "rna_ID_update_tag");
RNA_def_function_flag(func, FUNC_USE_REPORTS); RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Tag the ID to update its display data"); RNA_def_function_ui_description(func, "Tag the ID to update its display data");
RNA_def_enum_flag(func, "refresh", update_flag_items, 0, "", "Type of updates to perform"); RNA_def_enum_flag(func, "refresh", update_flag_items, 0, "", "Type of updates to perform");
@@ -532,16 +532,16 @@ static void rna_def_library(BlenderRNA *brna)
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
srna= RNA_def_struct(brna, "Library", "ID"); srna = RNA_def_struct(brna, "Library", "ID");
RNA_def_struct_ui_text(srna, "Library", "External .blend file from which data is linked"); RNA_def_struct_ui_text(srna, "Library", "External .blend file from which data is linked");
RNA_def_struct_ui_icon(srna, ICON_LIBRARY_DATA_DIRECT); RNA_def_struct_ui_icon(srna, ICON_LIBRARY_DATA_DIRECT);
prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH); prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
RNA_def_property_string_sdna(prop, NULL, "name"); RNA_def_property_string_sdna(prop, NULL, "name");
RNA_def_property_ui_text(prop, "File Path", "Path to the library .blend file"); RNA_def_property_ui_text(prop, "File Path", "Path to the library .blend file");
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Library_filepath_set"); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Library_filepath_set");
prop= RNA_def_property(srna, "parent", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "parent", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Library"); RNA_def_property_struct_type(prop, "Library");
RNA_def_property_ui_text(prop, "Parent", ""); RNA_def_property_ui_text(prop, "Parent", "");
} }
@@ -550,11 +550,11 @@ void RNA_def_ID(BlenderRNA *brna)
StructRNA *srna; StructRNA *srna;
/* built-in unknown type */ /* built-in unknown type */
srna= RNA_def_struct(brna, "UnknownType", NULL); srna = RNA_def_struct(brna, "UnknownType", NULL);
RNA_def_struct_ui_text(srna, "Unknown Type", "Stub RNA type used for pointers to unknown or internal data"); RNA_def_struct_ui_text(srna, "Unknown Type", "Stub RNA type used for pointers to unknown or internal data");
/* built-in any type */ /* built-in any type */
srna= RNA_def_struct(brna, "AnyType", NULL); srna = RNA_def_struct(brna, "AnyType", NULL);
RNA_def_struct_ui_text(srna, "Any Type", "RNA type used for pointers to any possible data"); RNA_def_struct_ui_text(srna, "Any Type", "RNA type used for pointers to any possible data");
rna_def_ID(brna); rna_def_ID(brna);

File diff suppressed because it is too large Load Diff

View File

@@ -50,17 +50,17 @@
static void rna_ActionGroup_channels_next(CollectionPropertyIterator *iter) static void rna_ActionGroup_channels_next(CollectionPropertyIterator *iter)
{ {
ListBaseIterator *internal= iter->internal; ListBaseIterator *internal = iter->internal;
FCurve *fcu= (FCurve*)internal->link; FCurve *fcu = (FCurve*)internal->link;
bActionGroup *grp= fcu->grp; bActionGroup *grp = fcu->grp;
/* only continue if the next F-Curve (if existant) belongs in the same group */ /* only continue if the next F-Curve (if existant) belongs in the same group */
if ((fcu->next) && (fcu->next->grp == grp)) if ((fcu->next) && (fcu->next->grp == grp))
internal->link= (Link*)fcu->next; internal->link = (Link*)fcu->next;
else else
internal->link= NULL; internal->link = NULL;
iter->valid= (internal->link != NULL); iter->valid = (internal->link != NULL);
} }
static bActionGroup *rna_Action_groups_new(bAction *act, const char name[]) static bActionGroup *rna_Action_groups_new(bAction *act, const char name[])
@@ -79,8 +79,8 @@ static void rna_Action_groups_remove(bAction *act, ReportList *reports, bActionG
} }
/* move every one one of the group's F-Curves out into the Action again */ /* move every one one of the group's F-Curves out into the Action again */
for (fcu= agrp->channels.first; (fcu) && (fcu->grp==agrp); fcu=fcn) { for (fcu = agrp->channels.first; (fcu) && (fcu->grp == agrp); fcu = fcn) {
fcn= fcu->next; fcn = fcu->next;
/* remove from group */ /* remove from group */
action_groups_remove_channel(act, fcu); action_groups_remove_channel(act, fcu);
@@ -95,7 +95,7 @@ static void rna_Action_groups_remove(bAction *act, ReportList *reports, bActionG
static FCurve *rna_Action_fcurve_new(bAction *act, ReportList *reports, const char *data_path, int index, const char *group) static FCurve *rna_Action_fcurve_new(bAction *act, ReportList *reports, const char *data_path, int index, const char *group)
{ {
if (group && group[0]=='\0') group= NULL; if (group && group[0] =='\0') group = NULL;
if (data_path[0] == '\0') { if (data_path[0] == '\0') {
BKE_report(reports, RPT_ERROR, "F-Curve data path empty, invalid argument"); BKE_report(reports, RPT_ERROR, "F-Curve data path empty, invalid argument");
@@ -135,8 +135,8 @@ static void rna_Action_fcurve_remove(bAction *act, ReportList *reports, FCurve *
static TimeMarker *rna_Action_pose_markers_new(bAction *act, const char name[]) static TimeMarker *rna_Action_pose_markers_new(bAction *act, const char name[])
{ {
TimeMarker *marker = MEM_callocN(sizeof(TimeMarker), "TimeMarker"); TimeMarker *marker = MEM_callocN(sizeof(TimeMarker), "TimeMarker");
marker->flag= 1; marker->flag = 1;
marker->frame= 1; marker->frame = 1;
BLI_strncpy_utf8(marker->name, name, sizeof(marker->name)); BLI_strncpy_utf8(marker->name, name, sizeof(marker->name));
BLI_addtail(&act->markers, marker); BLI_addtail(&act->markers, marker);
return marker; return marker;
@@ -155,35 +155,35 @@ static void rna_Action_pose_markers_remove(bAction *act, ReportList *reports, Ti
static PointerRNA rna_Action_active_pose_marker_get(PointerRNA *ptr) static PointerRNA rna_Action_active_pose_marker_get(PointerRNA *ptr)
{ {
bAction *act= (bAction*)ptr->data; bAction *act = (bAction*)ptr->data;
return rna_pointer_inherit_refine(ptr, &RNA_TimelineMarker, BLI_findlink(&act->markers, act->active_marker-1)); return rna_pointer_inherit_refine(ptr, &RNA_TimelineMarker, BLI_findlink(&act->markers, act->active_marker-1));
} }
static void rna_Action_active_pose_marker_set(PointerRNA *ptr, PointerRNA value) static void rna_Action_active_pose_marker_set(PointerRNA *ptr, PointerRNA value)
{ {
bAction *act= (bAction*)ptr->data; bAction *act = (bAction*)ptr->data;
act->active_marker= BLI_findindex(&act->markers, value.data) + 1; act->active_marker = BLI_findindex(&act->markers, value.data) + 1;
} }
static int rna_Action_active_pose_marker_index_get(PointerRNA *ptr) static int rna_Action_active_pose_marker_index_get(PointerRNA *ptr)
{ {
bAction *act= (bAction*)ptr->data; bAction *act = (bAction*)ptr->data;
return MAX2(act->active_marker-1, 0); return MAX2(act->active_marker-1, 0);
} }
static void rna_Action_active_pose_marker_index_set(PointerRNA *ptr, int value) static void rna_Action_active_pose_marker_index_set(PointerRNA *ptr, int value)
{ {
bAction *act= (bAction*)ptr->data; bAction *act = (bAction*)ptr->data;
act->active_marker= value+1; act->active_marker = value+1;
} }
static void rna_Action_active_pose_marker_index_range(PointerRNA *ptr, int *min, int *max) static void rna_Action_active_pose_marker_index_range(PointerRNA *ptr, int *min, int *max)
{ {
bAction *act= (bAction*)ptr->data; bAction *act = (bAction*)ptr->data;
*min= 0; *min = 0;
*max= BLI_countlist(&act->markers)-1; *max = BLI_countlist(&act->markers)-1;
*max= MAX2(0, *max); *max = MAX2(0, *max);
} }
@@ -251,173 +251,173 @@ static void rna_def_dopesheet(BlenderRNA *brna)
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
srna= RNA_def_struct(brna, "DopeSheet", NULL); srna = RNA_def_struct(brna, "DopeSheet", NULL);
RNA_def_struct_sdna(srna, "bDopeSheet"); RNA_def_struct_sdna(srna, "bDopeSheet");
RNA_def_struct_ui_text(srna, "DopeSheet", "Settings for filtering the channels shown in Animation Editors"); RNA_def_struct_ui_text(srna, "DopeSheet", "Settings for filtering the channels shown in Animation Editors");
/* Source of DopeSheet data */ /* Source of DopeSheet data */
// XXX: make this obsolete? /* XXX: make this obsolete? */
prop= RNA_def_property(srna, "source", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "source", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "ID"); RNA_def_property_struct_type(prop, "ID");
RNA_def_property_ui_text(prop, "Source", "ID-Block representing source data, currently ID_SCE (for Dopesheet), and ID_SC (for Grease Pencil)"); RNA_def_property_ui_text(prop, "Source", "ID-Block representing source data, currently ID_SCE (for Dopesheet), and ID_SC (for Grease Pencil)");
/* Show datablock filters */ /* Show datablock filters */
prop= RNA_def_property(srna, "show_datablock_filters", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "show_datablock_filters", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ADS_FLAG_SHOW_DBFILTERS); RNA_def_property_boolean_sdna(prop, NULL, "flag", ADS_FLAG_SHOW_DBFILTERS);
RNA_def_property_ui_text(prop, "Show Datablock Filters", "Show options for whether channels related to certain types of data are included"); RNA_def_property_ui_text(prop, "Show Datablock Filters", "Show options for whether channels related to certain types of data are included");
RNA_def_property_ui_icon(prop, ICON_DISCLOSURE_TRI_RIGHT, -1); RNA_def_property_ui_icon(prop, ICON_DISCLOSURE_TRI_RIGHT, -1);
RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN, NULL); RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN, NULL);
/* General Filtering Settings */ /* General Filtering Settings */
prop= RNA_def_property(srna, "show_only_selected", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "show_only_selected", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "filterflag", ADS_FILTER_ONLYSEL); RNA_def_property_boolean_sdna(prop, NULL, "filterflag", ADS_FILTER_ONLYSEL);
RNA_def_property_ui_text(prop, "Only Selected", "Only include channels relating to selected objects and data"); RNA_def_property_ui_text(prop, "Only Selected", "Only include channels relating to selected objects and data");
RNA_def_property_ui_icon(prop, ICON_RESTRICT_SELECT_OFF, 0); RNA_def_property_ui_icon(prop, ICON_RESTRICT_SELECT_OFF, 0);
RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL); RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
prop= RNA_def_property(srna, "show_hidden", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "show_hidden", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "filterflag", ADS_FILTER_INCL_HIDDEN); RNA_def_property_boolean_sdna(prop, NULL, "filterflag", ADS_FILTER_INCL_HIDDEN);
RNA_def_property_ui_text(prop, "Display Hidden", "Include channels from objects/bone that aren't visible"); RNA_def_property_ui_text(prop, "Display Hidden", "Include channels from objects/bone that aren't visible");
RNA_def_property_ui_icon(prop, ICON_GHOST_ENABLED, 0); RNA_def_property_ui_icon(prop, ICON_GHOST_ENABLED, 0);
RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL); RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
/* Object Group Filtering Settings */ /* Object Group Filtering Settings */
prop= RNA_def_property(srna, "show_only_group_objects", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "show_only_group_objects", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "filterflag", ADS_FILTER_ONLYOBGROUP); RNA_def_property_boolean_sdna(prop, NULL, "filterflag", ADS_FILTER_ONLYOBGROUP);
RNA_def_property_ui_text(prop, "Only Objects in Group", "Only include channels from Objects in the specified Group"); RNA_def_property_ui_text(prop, "Only Objects in Group", "Only include channels from Objects in the specified Group");
RNA_def_property_ui_icon(prop, ICON_GROUP, 0); RNA_def_property_ui_icon(prop, ICON_GROUP, 0);
RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL); RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
prop= RNA_def_property(srna, "filter_group", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "filter_group", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "filter_grp"); RNA_def_property_pointer_sdna(prop, NULL, "filter_grp");
RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Filtering Group", "Group that included Object should be a member of"); RNA_def_property_ui_text(prop, "Filtering Group", "Group that included Object should be a member of");
RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL); RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
/* FCurve Display Name Search Settings */ /* FCurve Display Name Search Settings */
prop= RNA_def_property(srna, "show_only_matching_fcurves", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "show_only_matching_fcurves", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "filterflag", ADS_FILTER_BY_FCU_NAME); RNA_def_property_boolean_sdna(prop, NULL, "filterflag", ADS_FILTER_BY_FCU_NAME);
RNA_def_property_ui_text(prop, "Only Matching F-Curves", "Only include F-Curves with names containing search text"); RNA_def_property_ui_text(prop, "Only Matching F-Curves", "Only include F-Curves with names containing search text");
RNA_def_property_ui_icon(prop, ICON_VIEWZOOM, 0); RNA_def_property_ui_icon(prop, ICON_VIEWZOOM, 0);
RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL); RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
prop= RNA_def_property(srna, "filter_fcurve_name", PROP_STRING, PROP_NONE); prop = RNA_def_property(srna, "filter_fcurve_name", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "searchstr"); RNA_def_property_string_sdna(prop, NULL, "searchstr");
RNA_def_property_ui_text(prop, "F-Curve Name Filter", "F-Curve live filtering string"); RNA_def_property_ui_text(prop, "F-Curve Name Filter", "F-Curve live filtering string");
RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL); RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
/* NLA Specific Settings */ /* NLA Specific Settings */
prop= RNA_def_property(srna, "show_missing_nla", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "show_missing_nla", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NLA_NOACT); RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NLA_NOACT);
RNA_def_property_ui_text(prop, "Include Missing NLA", "Include Animation Data blocks with no NLA data (NLA Editor only)"); RNA_def_property_ui_text(prop, "Include Missing NLA", "Include Animation Data blocks with no NLA data (NLA Editor only)");
RNA_def_property_ui_icon(prop, ICON_ACTION, 0); RNA_def_property_ui_icon(prop, ICON_ACTION, 0);
RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL); RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
/* Summary Settings (DopeSheet editors only) */ /* Summary Settings (DopeSheet editors only) */
prop= RNA_def_property(srna, "show_summary", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "show_summary", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "filterflag", ADS_FILTER_SUMMARY); RNA_def_property_boolean_sdna(prop, NULL, "filterflag", ADS_FILTER_SUMMARY);
RNA_def_property_ui_text(prop, "Display Summary", "Display an additional 'summary' line (DopeSheet Editors only)"); RNA_def_property_ui_text(prop, "Display Summary", "Display an additional 'summary' line (DopeSheet Editors only)");
RNA_def_property_ui_icon(prop, ICON_BORDERMOVE, 0); RNA_def_property_ui_icon(prop, ICON_BORDERMOVE, 0);
RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL); RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
prop= RNA_def_property(srna, "show_expanded_summary", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "show_expanded_summary", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", ADS_FLAG_SUMMARY_COLLAPSED); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", ADS_FLAG_SUMMARY_COLLAPSED);
RNA_def_property_ui_text(prop, "Collapse Summary", "Collapse summary when shown, so all other channels get hidden (DopeSheet Editors Only)"); RNA_def_property_ui_text(prop, "Collapse Summary", "Collapse summary when shown, so all other channels get hidden (DopeSheet Editors Only)");
RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL); RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
/* General DataType Filtering Settings */ /* General DataType Filtering Settings */
prop= RNA_def_property(srna, "show_transforms", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "show_transforms", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOOBJ); RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOOBJ);
RNA_def_property_ui_text(prop, "Display Transforms", "Include visualization of Object-level Animation data (mostly Transforms)"); RNA_def_property_ui_text(prop, "Display Transforms", "Include visualization of Object-level Animation data (mostly Transforms)");
RNA_def_property_ui_icon(prop, ICON_MANIPUL, 0); // XXX? RNA_def_property_ui_icon(prop, ICON_MANIPUL, 0); /* XXX? */
RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL); RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
prop= RNA_def_property(srna, "show_shapekeys", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "show_shapekeys", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOSHAPEKEYS); RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOSHAPEKEYS);
RNA_def_property_ui_text(prop, "Display Shapekeys", "Include visualization of ShapeKey related Animation data"); RNA_def_property_ui_text(prop, "Display Shapekeys", "Include visualization of ShapeKey related Animation data");
RNA_def_property_ui_icon(prop, ICON_SHAPEKEY_DATA, 0); RNA_def_property_ui_icon(prop, ICON_SHAPEKEY_DATA, 0);
RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL); RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
prop= RNA_def_property(srna, "show_meshes", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "show_meshes", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOMESH); RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOMESH);
RNA_def_property_ui_text(prop, "Display Meshes", "Include visualization of Mesh related Animation data"); RNA_def_property_ui_text(prop, "Display Meshes", "Include visualization of Mesh related Animation data");
RNA_def_property_ui_icon(prop, ICON_MESH_DATA, 0); RNA_def_property_ui_icon(prop, ICON_MESH_DATA, 0);
RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL); RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
prop= RNA_def_property(srna, "show_lattices", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "show_lattices", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOLAT); RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOLAT);
RNA_def_property_ui_text(prop, "Display Lattices", "Include visualization of Lattice related Animation data"); RNA_def_property_ui_text(prop, "Display Lattices", "Include visualization of Lattice related Animation data");
RNA_def_property_ui_icon(prop, ICON_LATTICE_DATA, 0); RNA_def_property_ui_icon(prop, ICON_LATTICE_DATA, 0);
RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL); RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
prop= RNA_def_property(srna, "show_cameras", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "show_cameras", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOCAM); RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOCAM);
RNA_def_property_ui_text(prop, "Display Camera", "Include visualization of Camera related Animation data"); RNA_def_property_ui_text(prop, "Display Camera", "Include visualization of Camera related Animation data");
RNA_def_property_ui_icon(prop, ICON_CAMERA_DATA, 0); RNA_def_property_ui_icon(prop, ICON_CAMERA_DATA, 0);
RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL); RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
prop= RNA_def_property(srna, "show_materials", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "show_materials", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOMAT); RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOMAT);
RNA_def_property_ui_text(prop, "Display Material", "Include visualization of Material related Animation data"); RNA_def_property_ui_text(prop, "Display Material", "Include visualization of Material related Animation data");
RNA_def_property_ui_icon(prop, ICON_MATERIAL_DATA, 0); RNA_def_property_ui_icon(prop, ICON_MATERIAL_DATA, 0);
RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL); RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
prop= RNA_def_property(srna, "show_lamps", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "show_lamps", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOLAM); RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOLAM);
RNA_def_property_ui_text(prop, "Display Lamp", "Include visualization of Lamp related Animation data"); RNA_def_property_ui_text(prop, "Display Lamp", "Include visualization of Lamp related Animation data");
RNA_def_property_ui_icon(prop, ICON_LAMP_DATA, 0); RNA_def_property_ui_icon(prop, ICON_LAMP_DATA, 0);
RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL); RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
prop= RNA_def_property(srna, "show_textures", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "show_textures", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOTEX); RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOTEX);
RNA_def_property_ui_text(prop, "Display Texture", "Include visualization of Texture related Animation data"); RNA_def_property_ui_text(prop, "Display Texture", "Include visualization of Texture related Animation data");
RNA_def_property_ui_icon(prop, ICON_TEXTURE_DATA, 0); RNA_def_property_ui_icon(prop, ICON_TEXTURE_DATA, 0);
RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL); RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
prop= RNA_def_property(srna, "show_curves", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "show_curves", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOCUR); RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOCUR);
RNA_def_property_ui_text(prop, "Display Curve", "Include visualization of Curve related Animation data"); RNA_def_property_ui_text(prop, "Display Curve", "Include visualization of Curve related Animation data");
RNA_def_property_ui_icon(prop, ICON_CURVE_DATA, 0); RNA_def_property_ui_icon(prop, ICON_CURVE_DATA, 0);
RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL); RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
prop= RNA_def_property(srna, "show_worlds", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "show_worlds", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOWOR); RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOWOR);
RNA_def_property_ui_text(prop, "Display World", "Include visualization of World related Animation data"); RNA_def_property_ui_text(prop, "Display World", "Include visualization of World related Animation data");
RNA_def_property_ui_icon(prop, ICON_WORLD_DATA, 0); RNA_def_property_ui_icon(prop, ICON_WORLD_DATA, 0);
RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL); RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
prop= RNA_def_property(srna, "show_scenes", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "show_scenes", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOSCE); RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOSCE);
RNA_def_property_ui_text(prop, "Display Scene", "Include visualization of Scene related Animation data"); RNA_def_property_ui_text(prop, "Display Scene", "Include visualization of Scene related Animation data");
RNA_def_property_ui_icon(prop, ICON_SCENE_DATA, 0); RNA_def_property_ui_icon(prop, ICON_SCENE_DATA, 0);
RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL); RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
prop= RNA_def_property(srna, "show_particles", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "show_particles", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOPART); RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOPART);
RNA_def_property_ui_text(prop, "Display Particle", "Include visualization of Particle related Animation data"); RNA_def_property_ui_text(prop, "Display Particle", "Include visualization of Particle related Animation data");
RNA_def_property_ui_icon(prop, ICON_PARTICLE_DATA, 0); RNA_def_property_ui_icon(prop, ICON_PARTICLE_DATA, 0);
RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL); RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
prop= RNA_def_property(srna, "show_metaballs", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "show_metaballs", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOMBA); RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOMBA);
RNA_def_property_ui_text(prop, "Display Metaball", "Include visualization of Metaball related Animation data"); RNA_def_property_ui_text(prop, "Display Metaball", "Include visualization of Metaball related Animation data");
RNA_def_property_ui_icon(prop, ICON_META_DATA, 0); RNA_def_property_ui_icon(prop, ICON_META_DATA, 0);
RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL); RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
prop= RNA_def_property(srna, "show_armatures", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "show_armatures", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOARM); RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOARM);
RNA_def_property_ui_text(prop, "Display Armature", "Include visualization of Armature related Animation data"); RNA_def_property_ui_text(prop, "Display Armature", "Include visualization of Armature related Animation data");
RNA_def_property_ui_icon(prop, ICON_ARMATURE_DATA, 0); RNA_def_property_ui_icon(prop, ICON_ARMATURE_DATA, 0);
RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL); RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
prop= RNA_def_property(srna, "show_nodes", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "show_nodes", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NONTREE); RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NONTREE);
RNA_def_property_ui_text(prop, "Display Node", "Include visualization of Node related Animation data"); RNA_def_property_ui_text(prop, "Display Node", "Include visualization of Node related Animation data");
RNA_def_property_ui_icon(prop, ICON_NODETREE, 0); RNA_def_property_ui_icon(prop, ICON_NODETREE, 0);
RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL); RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
prop= RNA_def_property(srna, "show_speakers", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "show_speakers", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOSPK); RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOSPK);
RNA_def_property_ui_text(prop, "Display Speaker", "Include visualization of Speaker related Animation data"); RNA_def_property_ui_text(prop, "Display Speaker", "Include visualization of Speaker related Animation data");
RNA_def_property_ui_icon(prop, ICON_SPEAKER, 0); RNA_def_property_ui_icon(prop, ICON_SPEAKER, 0);
@@ -429,11 +429,11 @@ static void rna_def_action_group(BlenderRNA *brna)
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
srna= RNA_def_struct(brna, "ActionGroup", NULL); srna = RNA_def_struct(brna, "ActionGroup", NULL);
RNA_def_struct_sdna(srna, "bActionGroup"); RNA_def_struct_sdna(srna, "bActionGroup");
RNA_def_struct_ui_text(srna, "Action Group", "Groups of F-Curves"); RNA_def_struct_ui_text(srna, "Action Group", "Groups of F-Curves");
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Name", ""); RNA_def_property_ui_text(prop, "Name", "");
RNA_def_struct_name_property(srna, prop); RNA_def_struct_name_property(srna, prop);
RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL); RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
@@ -448,28 +448,28 @@ static void rna_def_action_group(BlenderRNA *brna)
* If such changes are required, these MUST go through the API functions for manipulating * If such changes are required, these MUST go through the API functions for manipulating
* these F-Curve groupings. Also, note that groups only apply in actions ONLY. * these F-Curve groupings. Also, note that groups only apply in actions ONLY.
*/ */
prop= RNA_def_property(srna, "channels", PROP_COLLECTION, PROP_NONE); prop = RNA_def_property(srna, "channels", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "channels", NULL); RNA_def_property_collection_sdna(prop, NULL, "channels", NULL);
RNA_def_property_struct_type(prop, "FCurve"); RNA_def_property_struct_type(prop, "FCurve");
RNA_def_property_collection_funcs(prop, 0, "rna_ActionGroup_channels_next", NULL, NULL, NULL, NULL, NULL, NULL); RNA_def_property_collection_funcs(prop, 0, "rna_ActionGroup_channels_next", NULL, NULL, NULL, NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Channels", "F-Curves in this group"); RNA_def_property_ui_text(prop, "Channels", "F-Curves in this group");
prop= RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", AGRP_SELECTED); RNA_def_property_boolean_sdna(prop, NULL, "flag", AGRP_SELECTED);
RNA_def_property_ui_text(prop, "Select", "Action Group is selected"); RNA_def_property_ui_text(prop, "Select", "Action Group is selected");
RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_SELECTED, NULL); RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_SELECTED, NULL);
prop= RNA_def_property(srna, "lock", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "lock", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", AGRP_PROTECTED); RNA_def_property_boolean_sdna(prop, NULL, "flag", AGRP_PROTECTED);
RNA_def_property_ui_text(prop, "Lock", "Action Group is locked"); RNA_def_property_ui_text(prop, "Lock", "Action Group is locked");
RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL); RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
prop= RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", AGRP_EXPANDED); RNA_def_property_boolean_sdna(prop, NULL, "flag", AGRP_EXPANDED);
RNA_def_property_ui_text(prop, "Expanded", "Action Group is expanded"); RNA_def_property_ui_text(prop, "Expanded", "Action Group is expanded");
RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL); RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
prop= RNA_def_property(srna, "custom_color", PROP_INT, PROP_NONE); prop = RNA_def_property(srna, "custom_color", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "customCol"); RNA_def_property_int_sdna(prop, NULL, "customCol");
RNA_def_property_ui_text(prop, "Custom Color", "Index of custom color set"); RNA_def_property_ui_text(prop, "Custom Color", "Index of custom color set");
RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL); RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
@@ -484,23 +484,23 @@ static void rna_def_action_groups(BlenderRNA *brna, PropertyRNA *cprop)
PropertyRNA *parm; PropertyRNA *parm;
RNA_def_property_srna(cprop, "ActionGroups"); RNA_def_property_srna(cprop, "ActionGroups");
srna= RNA_def_struct(brna, "ActionGroups", NULL); srna = RNA_def_struct(brna, "ActionGroups", NULL);
RNA_def_struct_sdna(srna, "bAction"); RNA_def_struct_sdna(srna, "bAction");
RNA_def_struct_ui_text(srna, "Action Groups", "Collection of action groups"); RNA_def_struct_ui_text(srna, "Action Groups", "Collection of action groups");
func= RNA_def_function(srna, "new", "rna_Action_groups_new"); func = RNA_def_function(srna, "new", "rna_Action_groups_new");
RNA_def_function_ui_description(func, "Add a keyframe to the curve"); RNA_def_function_ui_description(func, "Add a keyframe to the curve");
parm= RNA_def_string(func, "name", "Group", 0, "", "New name for the action group"); parm = RNA_def_string(func, "name", "Group", 0, "", "New name for the action group");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
parm= RNA_def_pointer(func, "action_group", "ActionGroup", "", "Newly created action group"); parm = RNA_def_pointer(func, "action_group", "ActionGroup", "", "Newly created action group");
RNA_def_function_return(func, parm); RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "remove", "rna_Action_groups_remove"); func = RNA_def_function(srna, "remove", "rna_Action_groups_remove");
RNA_def_function_ui_description(func, "Remove action group"); RNA_def_function_ui_description(func, "Remove action group");
RNA_def_function_flag(func, FUNC_USE_REPORTS); RNA_def_function_flag(func, FUNC_USE_REPORTS);
parm= RNA_def_pointer(func, "action_group", "ActionGroup", "", "Action group to remove"); parm = RNA_def_pointer(func, "action_group", "ActionGroup", "", "Action group to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
} }
@@ -512,26 +512,26 @@ static void rna_def_action_fcurves(BlenderRNA *brna, PropertyRNA *cprop)
PropertyRNA *parm; PropertyRNA *parm;
RNA_def_property_srna(cprop, "ActionFCurves"); RNA_def_property_srna(cprop, "ActionFCurves");
srna= RNA_def_struct(brna, "ActionFCurves", NULL); srna = RNA_def_struct(brna, "ActionFCurves", NULL);
RNA_def_struct_sdna(srna, "bAction"); RNA_def_struct_sdna(srna, "bAction");
RNA_def_struct_ui_text(srna, "Action F-Curves", "Collection of action F-Curves"); RNA_def_struct_ui_text(srna, "Action F-Curves", "Collection of action F-Curves");
func= RNA_def_function(srna, "new", "rna_Action_fcurve_new"); func = RNA_def_function(srna, "new", "rna_Action_fcurve_new");
RNA_def_function_ui_description(func, "Add a keyframe to the F-Curve"); RNA_def_function_ui_description(func, "Add a keyframe to the F-Curve");
RNA_def_function_flag(func, FUNC_USE_REPORTS); RNA_def_function_flag(func, FUNC_USE_REPORTS);
parm= RNA_def_string(func, "data_path", "", 0, "Data Path", "F-Curve data path to use"); parm = RNA_def_string(func, "data_path", "", 0, "Data Path", "F-Curve data path to use");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_int(func, "index", 0, 0, INT_MAX, "Index", "Array index", 0, INT_MAX); RNA_def_int(func, "index", 0, 0, INT_MAX, "Index", "Array index", 0, INT_MAX);
RNA_def_string(func, "action_group", "", 0, "Action Group", "Acton group to add this F-Curve into"); RNA_def_string(func, "action_group", "", 0, "Action Group", "Acton group to add this F-Curve into");
parm= RNA_def_pointer(func, "fcurve", "FCurve", "", "Newly created F-Curve"); parm = RNA_def_pointer(func, "fcurve", "FCurve", "", "Newly created F-Curve");
RNA_def_function_return(func, parm); RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "remove", "rna_Action_fcurve_remove"); func = RNA_def_function(srna, "remove", "rna_Action_fcurve_remove");
RNA_def_function_ui_description(func, "Remove action group"); RNA_def_function_ui_description(func, "Remove action group");
RNA_def_function_flag(func, FUNC_USE_REPORTS); RNA_def_function_flag(func, FUNC_USE_REPORTS);
parm= RNA_def_pointer(func, "fcurve", "FCurve", "", "F-Curve to remove"); parm = RNA_def_pointer(func, "fcurve", "FCurve", "", "F-Curve to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
} }
@@ -544,31 +544,31 @@ static void rna_def_action_pose_markers(BlenderRNA *brna, PropertyRNA *cprop)
PropertyRNA *parm; PropertyRNA *parm;
RNA_def_property_srna(cprop, "ActionPoseMarkers"); RNA_def_property_srna(cprop, "ActionPoseMarkers");
srna= RNA_def_struct(brna, "ActionPoseMarkers", NULL); srna = RNA_def_struct(brna, "ActionPoseMarkers", NULL);
RNA_def_struct_sdna(srna, "bAction"); RNA_def_struct_sdna(srna, "bAction");
RNA_def_struct_ui_text(srna, "Action Pose Markers", "Collection of timeline markers"); RNA_def_struct_ui_text(srna, "Action Pose Markers", "Collection of timeline markers");
func= RNA_def_function(srna, "new", "rna_Action_pose_markers_new"); func = RNA_def_function(srna, "new", "rna_Action_pose_markers_new");
RNA_def_function_ui_description(func, "Add a pose marker to the action"); RNA_def_function_ui_description(func, "Add a pose marker to the action");
parm= RNA_def_string(func, "name", "Marker", 0, "", "New name for the marker (not unique)"); parm = RNA_def_string(func, "name", "Marker", 0, "", "New name for the marker (not unique)");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
parm= RNA_def_pointer(func, "marker", "TimelineMarker", "", "Newly created marker"); parm = RNA_def_pointer(func, "marker", "TimelineMarker", "", "Newly created marker");
RNA_def_function_return(func, parm); RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "remove", "rna_Action_pose_markers_remove"); func = RNA_def_function(srna, "remove", "rna_Action_pose_markers_remove");
RNA_def_function_ui_description(func, "Remove a timeline marker"); RNA_def_function_ui_description(func, "Remove a timeline marker");
RNA_def_function_flag(func, FUNC_USE_REPORTS); RNA_def_function_flag(func, FUNC_USE_REPORTS);
parm= RNA_def_pointer(func, "marker", "TimelineMarker", "", "Timeline marker to remove"); parm = RNA_def_pointer(func, "marker", "TimelineMarker", "", "Timeline marker to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "TimelineMarker"); RNA_def_property_struct_type(prop, "TimelineMarker");
RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_pointer_funcs(prop, "rna_Action_active_pose_marker_get", "rna_Action_active_pose_marker_set", NULL, NULL); RNA_def_property_pointer_funcs(prop, "rna_Action_active_pose_marker_get", "rna_Action_active_pose_marker_set", NULL, NULL);
RNA_def_property_ui_text(prop, "Active Pose Marker", "Active pose marker for this Action"); RNA_def_property_ui_text(prop, "Active Pose Marker", "Active pose marker for this Action");
prop= RNA_def_property(srna, "active_index", PROP_INT, PROP_NONE); prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "active_marker"); RNA_def_property_int_sdna(prop, NULL, "active_marker");
RNA_def_property_int_funcs(prop, "rna_Action_active_pose_marker_index_get", "rna_Action_active_pose_marker_index_set", "rna_Action_active_pose_marker_index_range"); RNA_def_property_int_funcs(prop, "rna_Action_active_pose_marker_index_get", "rna_Action_active_pose_marker_index_set", "rna_Action_active_pose_marker_index_range");
RNA_def_property_ui_text(prop, "Active Pose Marker Index", "Index of active pose marker"); RNA_def_property_ui_text(prop, "Active Pose Marker Index", "Index of active pose marker");
@@ -579,37 +579,37 @@ static void rna_def_action(BlenderRNA *brna)
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
srna= RNA_def_struct(brna, "Action", "ID"); srna = RNA_def_struct(brna, "Action", "ID");
RNA_def_struct_sdna(srna, "bAction"); RNA_def_struct_sdna(srna, "bAction");
RNA_def_struct_ui_text(srna, "Action", "A collection of F-Curves for animation"); RNA_def_struct_ui_text(srna, "Action", "A collection of F-Curves for animation");
RNA_def_struct_ui_icon(srna, ICON_ACTION); RNA_def_struct_ui_icon(srna, ICON_ACTION);
/* collections */ /* collections */
prop= RNA_def_property(srna, "fcurves", PROP_COLLECTION, PROP_NONE); prop = RNA_def_property(srna, "fcurves", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "curves", NULL); RNA_def_property_collection_sdna(prop, NULL, "curves", NULL);
RNA_def_property_struct_type(prop, "FCurve"); RNA_def_property_struct_type(prop, "FCurve");
RNA_def_property_ui_text(prop, "F-Curves", "The individual F-Curves that make up the Action"); RNA_def_property_ui_text(prop, "F-Curves", "The individual F-Curves that make up the Action");
rna_def_action_fcurves(brna, prop); rna_def_action_fcurves(brna, prop);
prop= RNA_def_property(srna, "groups", PROP_COLLECTION, PROP_NONE); prop = RNA_def_property(srna, "groups", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "groups", NULL); RNA_def_property_collection_sdna(prop, NULL, "groups", NULL);
RNA_def_property_struct_type(prop, "ActionGroup"); RNA_def_property_struct_type(prop, "ActionGroup");
RNA_def_property_ui_text(prop, "Groups", "Convenient groupings of F-Curves"); RNA_def_property_ui_text(prop, "Groups", "Convenient groupings of F-Curves");
rna_def_action_groups(brna, prop); rna_def_action_groups(brna, prop);
prop= RNA_def_property(srna, "pose_markers", PROP_COLLECTION, PROP_NONE); prop = RNA_def_property(srna, "pose_markers", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "markers", NULL); RNA_def_property_collection_sdna(prop, NULL, "markers", NULL);
RNA_def_property_struct_type(prop, "TimelineMarker"); RNA_def_property_struct_type(prop, "TimelineMarker");
RNA_def_property_ui_text(prop, "Pose Markers", "Markers specific to this Action, for labeling poses"); RNA_def_property_ui_text(prop, "Pose Markers", "Markers specific to this Action, for labeling poses");
rna_def_action_pose_markers(brna, prop); rna_def_action_pose_markers(brna, prop);
/* properties */ /* properties */
prop= RNA_def_float_vector(srna, "frame_range" , 2 , NULL , 0, 0, "Frame Range" , "The final frame range of all F-Curves within this action" , 0 , 0); prop = RNA_def_float_vector(srna, "frame_range" , 2 , NULL , 0, 0, "Frame Range" , "The final frame range of all F-Curves within this action" , 0 , 0);
RNA_def_property_float_funcs(prop, "rna_Action_frame_range_get" , NULL, NULL); RNA_def_property_float_funcs(prop, "rna_Action_frame_range_get" , NULL, NULL);
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
/* special "type" limiter - should not really be edited in general, but is still available/editable in 'emergencies' */ /* special "type" limiter - should not really be edited in general, but is still available/editable in 'emergencies' */
prop= RNA_def_property(srna, "id_root", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "id_root", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "idroot"); RNA_def_property_enum_sdna(prop, NULL, "idroot");
RNA_def_property_enum_items(prop, id_type_items); RNA_def_property_enum_items(prop, id_type_items);
RNA_def_property_ui_text(prop, "ID Root Type", "Type of ID-block that action can be used on - DO NOT CHANGE UNLESS YOU KNOW WHAT YOU'RE DOING"); RNA_def_property_ui_text(prop, "ID Root Type", "Type of ID-block that action can be used on - DO NOT CHANGE UNLESS YOU KNOW WHAT YOU'RE DOING");

File diff suppressed because it is too large Load Diff

View File

@@ -58,15 +58,15 @@ void RNA_api_actuator(StructRNA *srna)
FunctionRNA *func; FunctionRNA *func;
PropertyRNA *parm; PropertyRNA *parm;
func= RNA_def_function(srna, "link", "rna_Actuator_link"); func = RNA_def_function(srna, "link", "rna_Actuator_link");
RNA_def_function_ui_description(func, "Link the actuator to a controller"); RNA_def_function_ui_description(func, "Link the actuator to a controller");
parm= RNA_def_pointer(func, "controller", "Controller", "", "Controller to link to"); parm = RNA_def_pointer(func, "controller", "Controller", "", "Controller to link to");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_property_update(parm, NC_LOGIC, NULL); RNA_def_property_update(parm, NC_LOGIC, NULL);
func= RNA_def_function(srna, "unlink", "rna_Actuator_unlink"); func = RNA_def_function(srna, "unlink", "rna_Actuator_unlink");
RNA_def_function_ui_description(func, "Unlink the actuator from a controller"); RNA_def_function_ui_description(func, "Unlink the actuator from a controller");
parm= RNA_def_pointer(func, "controller", "Controller", "", "Controller to unlink from"); parm = RNA_def_pointer(func, "controller", "Controller", "", "Controller to unlink from");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_property_update(parm, NC_LOGIC, NULL); RNA_def_property_update(parm, NC_LOGIC, NULL);
} }

View File

@@ -60,7 +60,7 @@ EnumPropertyItem keyingset_path_grouping_items[] = {
static int rna_AnimData_action_editable(PointerRNA *ptr) static int rna_AnimData_action_editable(PointerRNA *ptr)
{ {
AnimData *adt= (AnimData *)ptr->data; AnimData *adt = (AnimData *)ptr->data;
/* active action is only editable when it is not a tweaking strip */ /* active action is only editable when it is not a tweaking strip */
if ((adt->flag & ADT_NLA_EDIT_ON) || (adt->actstrip) || (adt->tmpact)) if ((adt->flag & ADT_NLA_EDIT_ON) || (adt->actstrip) || (adt->tmpact))
@@ -89,7 +89,7 @@ static int RKS_POLL_rna_internal(KeyingSetInfo *ksi, bContext *C)
int ok; int ok;
RNA_pointer_create(NULL, ksi->ext.srna, ksi, &ptr); RNA_pointer_create(NULL, ksi->ext.srna, ksi, &ptr);
func= &rna_KeyingSetInfo_poll_func; /* RNA_struct_find_function(&ptr, "poll"); */ func = &rna_KeyingSetInfo_poll_func; /* RNA_struct_find_function(&ptr, "poll"); */
RNA_parameter_list_create(&list, &ptr, func); RNA_parameter_list_create(&list, &ptr, func);
/* hook up arguments */ /* hook up arguments */
@@ -101,7 +101,7 @@ static int RKS_POLL_rna_internal(KeyingSetInfo *ksi, bContext *C)
/* read the result */ /* read the result */
RNA_parameter_get_lookup(&list, "ok", &ret); RNA_parameter_get_lookup(&list, "ok", &ret);
ok= *(int*)ret; ok = *(int*)ret;
RNA_parameter_list_free(&list); RNA_parameter_list_free(&list);
return ok; return ok;
@@ -117,7 +117,7 @@ static void RKS_ITER_rna_internal(KeyingSetInfo *ksi, bContext *C, KeyingSet *ks
FunctionRNA *func; FunctionRNA *func;
RNA_pointer_create(NULL, ksi->ext.srna, ksi, &ptr); RNA_pointer_create(NULL, ksi->ext.srna, ksi, &ptr);
func= &rna_KeyingSetInfo_iterator_func; /* RNA_struct_find_function(&ptr, "poll"); */ func = &rna_KeyingSetInfo_iterator_func; /* RNA_struct_find_function(&ptr, "poll"); */
RNA_parameter_list_create(&list, &ptr, func); RNA_parameter_list_create(&list, &ptr, func);
/* hook up arguments */ /* hook up arguments */
@@ -140,7 +140,7 @@ static void RKS_GEN_rna_internal(KeyingSetInfo *ksi, bContext *C, KeyingSet *ks,
FunctionRNA *func; FunctionRNA *func;
RNA_pointer_create(NULL, ksi->ext.srna, ksi, &ptr); RNA_pointer_create(NULL, ksi->ext.srna, ksi, &ptr);
func= &rna_KeyingSetInfo_generate_func; /* RNA_struct_find_generate(&ptr, "poll"); */ func = &rna_KeyingSetInfo_generate_func; /* RNA_struct_find_generate(&ptr, "poll"); */
RNA_parameter_list_create(&list, &ptr, func); RNA_parameter_list_create(&list, &ptr, func);
/* hook up arguments */ /* hook up arguments */
@@ -156,16 +156,16 @@ static void RKS_GEN_rna_internal(KeyingSetInfo *ksi, bContext *C, KeyingSet *ks,
/* ------ */ /* ------ */
// XXX: the exact purpose of this is not too clear... maybe we want to revise this at some point? /* XXX: the exact purpose of this is not too clear... maybe we want to revise this at some point? */
static StructRNA *rna_KeyingSetInfo_refine(PointerRNA *ptr) static StructRNA *rna_KeyingSetInfo_refine(PointerRNA *ptr)
{ {
KeyingSetInfo *ksi= (KeyingSetInfo *)ptr->data; KeyingSetInfo *ksi = (KeyingSetInfo *)ptr->data;
return (ksi->ext.srna)? ksi->ext.srna: &RNA_KeyingSetInfo; return (ksi->ext.srna)? ksi->ext.srna: &RNA_KeyingSetInfo;
} }
static void rna_KeyingSetInfo_unregister(Main *bmain, StructRNA *type) static void rna_KeyingSetInfo_unregister(Main *bmain, StructRNA *type)
{ {
KeyingSetInfo *ksi= RNA_struct_blender_type_get(type); KeyingSetInfo *ksi = RNA_struct_blender_type_get(type);
if (ksi == NULL) if (ksi == NULL)
return; return;
@@ -186,7 +186,7 @@ static StructRNA *rna_KeyingSetInfo_register(Main *bmain, ReportList *reports, v
int have_function[3]; int have_function[3];
/* setup dummy type info to store static properties in */ /* setup dummy type info to store static properties in */
// TODO: perhaps we want to get users to register as if they're using 'KeyingSet' directly instead? /* TODO: perhaps we want to get users to register as if they're using 'KeyingSet' directly instead? */
RNA_pointer_create(NULL, &RNA_KeyingSetInfo, &dummyksi, &dummyptr); RNA_pointer_create(NULL, &RNA_KeyingSetInfo, &dummyksi, &dummyptr);
/* validate the python class */ /* validate the python class */
@@ -204,21 +204,21 @@ static StructRNA *rna_KeyingSetInfo_register(Main *bmain, ReportList *reports, v
rna_KeyingSetInfo_unregister(bmain, ksi->ext.srna); rna_KeyingSetInfo_unregister(bmain, ksi->ext.srna);
/* create a new KeyingSetInfo type */ /* create a new KeyingSetInfo type */
ksi= MEM_callocN(sizeof(KeyingSetInfo), "python keying set info"); ksi = MEM_callocN(sizeof(KeyingSetInfo), "python keying set info");
memcpy(ksi, &dummyksi, sizeof(KeyingSetInfo)); memcpy(ksi, &dummyksi, sizeof(KeyingSetInfo));
/* set RNA-extensions info */ /* set RNA-extensions info */
ksi->ext.srna= RNA_def_struct(&BLENDER_RNA, ksi->idname, "KeyingSetInfo"); ksi->ext.srna = RNA_def_struct(&BLENDER_RNA, ksi->idname, "KeyingSetInfo");
ksi->ext.data= data; ksi->ext.data = data;
ksi->ext.call= call; ksi->ext.call = call;
ksi->ext.free= free; ksi->ext.free = free;
RNA_struct_blender_type_set(ksi->ext.srna, ksi); RNA_struct_blender_type_set(ksi->ext.srna, ksi);
/* set callbacks */ /* set callbacks */
// NOTE: we really should have all of these... /* NOTE: we really should have all of these... */
ksi->poll= (have_function[0])? RKS_POLL_rna_internal: NULL; ksi->poll = (have_function[0])? RKS_POLL_rna_internal: NULL;
ksi->iter= (have_function[1])? RKS_ITER_rna_internal: NULL; ksi->iter = (have_function[1])? RKS_ITER_rna_internal: NULL;
ksi->generate= (have_function[2])? RKS_GEN_rna_internal: NULL; ksi->generate = (have_function[2])? RKS_GEN_rna_internal: NULL;
/* add and register with other info as needed */ /* add and register with other info as needed */
ANIM_keyingset_info_register(ksi); ANIM_keyingset_info_register(ksi);
@@ -231,39 +231,39 @@ static StructRNA *rna_KeyingSetInfo_register(Main *bmain, ReportList *reports, v
static StructRNA *rna_ksPath_id_typef(PointerRNA *ptr) static StructRNA *rna_ksPath_id_typef(PointerRNA *ptr)
{ {
KS_Path *ksp= (KS_Path*)ptr->data; KS_Path *ksp = (KS_Path*)ptr->data;
return ID_code_to_RNA_type(ksp->idtype); return ID_code_to_RNA_type(ksp->idtype);
} }
static int rna_ksPath_id_editable(PointerRNA *ptr) static int rna_ksPath_id_editable(PointerRNA *ptr)
{ {
KS_Path *ksp= (KS_Path*)ptr->data; KS_Path *ksp = (KS_Path*)ptr->data;
return (ksp->idtype)? PROP_EDITABLE : 0; return (ksp->idtype)? PROP_EDITABLE : 0;
} }
static void rna_ksPath_id_type_set(PointerRNA *ptr, int value) static void rna_ksPath_id_type_set(PointerRNA *ptr, int value)
{ {
KS_Path *data= (KS_Path*)(ptr->data); KS_Path *data = (KS_Path*)(ptr->data);
/* set the driver type, then clear the id-block if the type is invalid */ /* set the driver type, then clear the id-block if the type is invalid */
data->idtype= value; data->idtype = value;
if ((data->id) && (GS(data->id->name) != data->idtype)) if ((data->id) && (GS(data->id->name) != data->idtype))
data->id= NULL; data->id = NULL;
} }
static void rna_ksPath_RnaPath_get(PointerRNA *ptr, char *value) static void rna_ksPath_RnaPath_get(PointerRNA *ptr, char *value)
{ {
KS_Path *ksp= (KS_Path *)ptr->data; KS_Path *ksp = (KS_Path *)ptr->data;
if (ksp->rna_path) if (ksp->rna_path)
strcpy(value, ksp->rna_path); strcpy(value, ksp->rna_path);
else else
value[0]= '\0'; value[0] = '\0';
} }
static int rna_ksPath_RnaPath_length(PointerRNA *ptr) static int rna_ksPath_RnaPath_length(PointerRNA *ptr)
{ {
KS_Path *ksp= (KS_Path *)ptr->data; KS_Path *ksp = (KS_Path *)ptr->data;
if (ksp->rna_path) if (ksp->rna_path)
return strlen(ksp->rna_path); return strlen(ksp->rna_path);
@@ -273,22 +273,22 @@ static int rna_ksPath_RnaPath_length(PointerRNA *ptr)
static void rna_ksPath_RnaPath_set(PointerRNA *ptr, const char *value) static void rna_ksPath_RnaPath_set(PointerRNA *ptr, const char *value)
{ {
KS_Path *ksp= (KS_Path *)ptr->data; KS_Path *ksp = (KS_Path *)ptr->data;
if (ksp->rna_path) if (ksp->rna_path)
MEM_freeN(ksp->rna_path); MEM_freeN(ksp->rna_path);
if (value[0]) if (value[0])
ksp->rna_path= BLI_strdup(value); ksp->rna_path = BLI_strdup(value);
else else
ksp->rna_path= NULL; ksp->rna_path = NULL;
} }
/* ****************************** */ /* ****************************** */
static int rna_KeyingSet_active_ksPath_editable(PointerRNA *ptr) static int rna_KeyingSet_active_ksPath_editable(PointerRNA *ptr)
{ {
KeyingSet *ks= (KeyingSet *)ptr->data; KeyingSet *ks = (KeyingSet *)ptr->data;
/* only editable if there are some paths to change to */ /* only editable if there are some paths to change to */
return (ks->paths.first != NULL); return (ks->paths.first != NULL);
@@ -296,45 +296,45 @@ static int rna_KeyingSet_active_ksPath_editable(PointerRNA *ptr)
static PointerRNA rna_KeyingSet_active_ksPath_get(PointerRNA *ptr) static PointerRNA rna_KeyingSet_active_ksPath_get(PointerRNA *ptr)
{ {
KeyingSet *ks= (KeyingSet *)ptr->data; KeyingSet *ks = (KeyingSet *)ptr->data;
return rna_pointer_inherit_refine(ptr, &RNA_KeyingSetPath, BLI_findlink(&ks->paths, ks->active_path-1)); return rna_pointer_inherit_refine(ptr, &RNA_KeyingSetPath, BLI_findlink(&ks->paths, ks->active_path-1));
} }
static void rna_KeyingSet_active_ksPath_set(PointerRNA *ptr, PointerRNA value) static void rna_KeyingSet_active_ksPath_set(PointerRNA *ptr, PointerRNA value)
{ {
KeyingSet *ks= (KeyingSet *)ptr->data; KeyingSet *ks = (KeyingSet *)ptr->data;
KS_Path *ksp= (KS_Path*)value.data; KS_Path *ksp = (KS_Path*)value.data;
ks->active_path= BLI_findindex(&ks->paths, ksp) + 1; ks->active_path = BLI_findindex(&ks->paths, ksp) + 1;
} }
static int rna_KeyingSet_active_ksPath_index_get(PointerRNA *ptr) static int rna_KeyingSet_active_ksPath_index_get(PointerRNA *ptr)
{ {
KeyingSet *ks= (KeyingSet *)ptr->data; KeyingSet *ks = (KeyingSet *)ptr->data;
return MAX2(ks->active_path-1, 0); return MAX2(ks->active_path-1, 0);
} }
static void rna_KeyingSet_active_ksPath_index_set(PointerRNA *ptr, int value) static void rna_KeyingSet_active_ksPath_index_set(PointerRNA *ptr, int value)
{ {
KeyingSet *ks= (KeyingSet *)ptr->data; KeyingSet *ks = (KeyingSet *)ptr->data;
ks->active_path= value+1; ks->active_path = value+1;
} }
static void rna_KeyingSet_active_ksPath_index_range(PointerRNA *ptr, int *min, int *max) static void rna_KeyingSet_active_ksPath_index_range(PointerRNA *ptr, int *min, int *max)
{ {
KeyingSet *ks= (KeyingSet *)ptr->data; KeyingSet *ks = (KeyingSet *)ptr->data;
*min= 0; *min = 0;
*max= BLI_countlist(&ks->paths)-1; *max = BLI_countlist(&ks->paths)-1;
*max= MAX2(0, *max); *max = MAX2(0, *max);
} }
static PointerRNA rna_KeyingSet_typeinfo_get(PointerRNA *ptr) static PointerRNA rna_KeyingSet_typeinfo_get(PointerRNA *ptr)
{ {
KeyingSet *ks= (KeyingSet *)ptr->data; KeyingSet *ks = (KeyingSet *)ptr->data;
KeyingSetInfo *ksi = NULL; KeyingSetInfo *ksi = NULL;
/* keying set info is only for builtin Keying Sets */ /* keying set info is only for builtin Keying Sets */
if ((ks->flag & KEYINGSET_ABSOLUTE)==0) if ((ks->flag & KEYINGSET_ABSOLUTE) == 0)
ksi = ANIM_keyingset_info_find_named(ks->typeinfo); ksi = ANIM_keyingset_info_find_named(ks->typeinfo);
return rna_pointer_inherit_refine(ptr, &RNA_KeyingSetInfo, ksi); return rna_pointer_inherit_refine(ptr, &RNA_KeyingSetInfo, ksi);
} }
@@ -355,8 +355,8 @@ static KS_Path *rna_KeyingSet_paths_add(KeyingSet *keyingset, ReportList *report
/* if data is valid, call the API function for this */ /* if data is valid, call the API function for this */
if (keyingset) { if (keyingset) {
ksp= BKE_keyingset_add_path(keyingset, id, group_name, rna_path, index, flag, group_method); ksp = BKE_keyingset_add_path(keyingset, id, group_name, rna_path, index, flag, group_method);
keyingset->active_path= BLI_countlist(&keyingset->paths); keyingset->active_path = BLI_countlist(&keyingset->paths);
} }
else { else {
BKE_report(reports, RPT_ERROR, "Keying Set Path could not be added"); BKE_report(reports, RPT_ERROR, "Keying Set Path could not be added");
@@ -374,7 +374,7 @@ static void rna_KeyingSet_paths_remove(KeyingSet *keyingset, ReportList *reports
BKE_keyingset_free_path(keyingset, ksp); BKE_keyingset_free_path(keyingset, ksp);
/* the active path number will most likely have changed */ /* the active path number will most likely have changed */
// TODO: we should get more fancy and actually check if it was removed, but this will do for now /* TODO: we should get more fancy and actually check if it was removed, but this will do for now */
keyingset->active_path = 0; keyingset->active_path = 0;
} }
else { else {
@@ -389,8 +389,8 @@ static void rna_KeyingSet_paths_clear(KeyingSet *keyingset, ReportList *reports)
KS_Path *ksp, *kspn; KS_Path *ksp, *kspn;
/* free each path as we go to avoid looping twice */ /* free each path as we go to avoid looping twice */
for (ksp= keyingset->paths.first; ksp; ksp= kspn) { for (ksp = keyingset->paths.first; ksp; ksp = kspn) {
kspn= ksp->next; kspn = ksp->next;
BKE_keyingset_free_path(keyingset, ksp); BKE_keyingset_free_path(keyingset, ksp);
} }
@@ -421,15 +421,15 @@ static void rna_NlaTrack_remove(AnimData *adt, bContext *C, NlaTrack *track)
static PointerRNA rna_NlaTrack_active_get(PointerRNA *ptr) static PointerRNA rna_NlaTrack_active_get(PointerRNA *ptr)
{ {
AnimData *adt= (AnimData*)ptr->data; AnimData *adt = (AnimData*)ptr->data;
NlaTrack *track= BKE_nlatrack_find_active(&adt->nla_tracks); NlaTrack *track = BKE_nlatrack_find_active(&adt->nla_tracks);
return rna_pointer_inherit_refine(ptr, &RNA_NlaTrack, track); return rna_pointer_inherit_refine(ptr, &RNA_NlaTrack, track);
} }
static void rna_NlaTrack_active_set(PointerRNA *ptr, PointerRNA value) static void rna_NlaTrack_active_set(PointerRNA *ptr, PointerRNA value)
{ {
AnimData *adt= (AnimData*)ptr->data; AnimData *adt = (AnimData*)ptr->data;
NlaTrack *track= (NlaTrack*)value.data; NlaTrack *track = (NlaTrack*)value.data;
BKE_nlatrack_set_active(&adt->nla_tracks, track); BKE_nlatrack_set_active(&adt->nla_tracks, track);
} }
@@ -445,7 +445,7 @@ static FCurve *rna_Driver_from_existing(AnimData *adt, bContext *C, FCurve *src_
/* just make a copy of the existing one and add to self */ /* just make a copy of the existing one and add to self */
FCurve *new_fcu = copy_fcurve(src_driver); FCurve *new_fcu = copy_fcurve(src_driver);
// XXX: if we impose any ordering on these someday, this will be problematic /* XXX: if we impose any ordering on these someday, this will be problematic */
BLI_addtail(&adt->drivers, new_fcu); BLI_addtail(&adt->drivers, new_fcu);
return new_fcu; return new_fcu;
} }
@@ -464,7 +464,7 @@ static void rna_def_common_keying_flags(StructRNA *srna, short reg)
{INSERTKEY_XYZ2RGB, "INSERTKEY_XYZ_TO_RGB", 0, "F-Curve Colors - XYZ to RGB", "Color for newly added transformation F-Curves (Location, Rotation, Scale) and also Color is based on the transform axis"}, {INSERTKEY_XYZ2RGB, "INSERTKEY_XYZ_TO_RGB", 0, "F-Curve Colors - XYZ to RGB", "Color for newly added transformation F-Curves (Location, Rotation, Scale) and also Color is based on the transform axis"},
{0, NULL, 0, NULL, NULL}}; {0, NULL, 0, NULL, NULL}};
prop= RNA_def_property(srna, "bl_options", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "bl_options", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "keyingflag"); RNA_def_property_enum_sdna(prop, NULL, "keyingflag");
RNA_def_property_enum_items(prop, keying_flag_items); RNA_def_property_enum_items(prop, keying_flag_items);
RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL|PROP_ENUM_FLAG); RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL|PROP_ENUM_FLAG);
@@ -480,7 +480,7 @@ static void rna_def_keyingset_info(BlenderRNA *brna)
FunctionRNA *func; FunctionRNA *func;
PropertyRNA *parm; PropertyRNA *parm;
srna= RNA_def_struct(brna, "KeyingSetInfo", NULL); srna = RNA_def_struct(brna, "KeyingSetInfo", NULL);
RNA_def_struct_sdna(srna, "KeyingSetInfo"); RNA_def_struct_sdna(srna, "KeyingSetInfo");
RNA_def_struct_ui_text(srna, "Keying Set Info", "Callback function defines for builtin Keying Sets"); RNA_def_struct_ui_text(srna, "Keying Set Info", "Callback function defines for builtin Keying Sets");
RNA_def_struct_refine_func(srna, "rna_KeyingSetInfo_refine"); RNA_def_struct_refine_func(srna, "rna_KeyingSetInfo_refine");
@@ -488,14 +488,14 @@ static void rna_def_keyingset_info(BlenderRNA *brna)
/* Properties --------------------- */ /* Properties --------------------- */
RNA_define_verify_sdna(0); // not in sdna RNA_define_verify_sdna(0); /* not in sdna */
prop= RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE); prop = RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "idname"); RNA_def_property_string_sdna(prop, NULL, "idname");
RNA_def_property_flag(prop, PROP_REGISTER|PROP_NEVER_CLAMP); RNA_def_property_flag(prop, PROP_REGISTER|PROP_NEVER_CLAMP);
/* Name */ /* Name */
prop= RNA_def_property(srna, "bl_label", PROP_STRING, PROP_TRANSLATE); prop = RNA_def_property(srna, "bl_label", PROP_STRING, PROP_TRANSLATE);
RNA_def_property_string_sdna(prop, NULL, "name"); RNA_def_property_string_sdna(prop, NULL, "name");
RNA_def_property_ui_text(prop, "Name", ""); RNA_def_property_ui_text(prop, "Name", "");
RNA_def_struct_name_property(srna, prop); RNA_def_struct_name_property(srna, prop);
@@ -507,31 +507,31 @@ static void rna_def_keyingset_info(BlenderRNA *brna)
/* Function Callbacks ------------- */ /* Function Callbacks ------------- */
/* poll */ /* poll */
func= RNA_def_function(srna, "poll", NULL); func = RNA_def_function(srna, "poll", NULL);
RNA_def_function_ui_description(func, "Test if Keying Set can be used or not"); RNA_def_function_ui_description(func, "Test if Keying Set can be used or not");
RNA_def_function_flag(func, FUNC_REGISTER); RNA_def_function_flag(func, FUNC_REGISTER);
RNA_def_function_return(func, RNA_def_boolean(func, "ok", 1, "", "")); RNA_def_function_return(func, RNA_def_boolean(func, "ok", 1, "", ""));
parm= RNA_def_pointer(func, "context", "Context", "", ""); parm = RNA_def_pointer(func, "context", "Context", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
/* iterator */ /* iterator */
func= RNA_def_function(srna, "iterator", NULL); func = RNA_def_function(srna, "iterator", NULL);
RNA_def_function_ui_description(func, "Call generate() on the structs which have properties to be keyframed"); RNA_def_function_ui_description(func, "Call generate() on the structs which have properties to be keyframed");
RNA_def_function_flag(func, FUNC_REGISTER); RNA_def_function_flag(func, FUNC_REGISTER);
parm= RNA_def_pointer(func, "context", "Context", "", ""); parm = RNA_def_pointer(func, "context", "Context", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
parm= RNA_def_pointer(func, "ks", "KeyingSet", "", ""); parm = RNA_def_pointer(func, "ks", "KeyingSet", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
/* generate */ /* generate */
func= RNA_def_function(srna, "generate", NULL); func = RNA_def_function(srna, "generate", NULL);
RNA_def_function_ui_description(func, "Add Paths to the Keying Set to keyframe the properties of the given data"); RNA_def_function_ui_description(func, "Add Paths to the Keying Set to keyframe the properties of the given data");
RNA_def_function_flag(func, FUNC_REGISTER); RNA_def_function_flag(func, FUNC_REGISTER);
parm= RNA_def_pointer(func, "context", "Context", "", ""); parm = RNA_def_pointer(func, "context", "Context", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
parm= RNA_def_pointer(func, "ks", "KeyingSet", "", ""); parm = RNA_def_pointer(func, "ks", "KeyingSet", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
parm= RNA_def_pointer(func, "data", "AnyType", "", ""); parm = RNA_def_pointer(func, "data", "AnyType", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL);
} }
@@ -540,56 +540,56 @@ static void rna_def_keyingset_path(BlenderRNA *brna)
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
srna= RNA_def_struct(brna, "KeyingSetPath", NULL); srna = RNA_def_struct(brna, "KeyingSetPath", NULL);
RNA_def_struct_sdna(srna, "KS_Path"); RNA_def_struct_sdna(srna, "KS_Path");
RNA_def_struct_ui_text(srna, "Keying Set Path", "Path to a setting for use in a Keying Set"); RNA_def_struct_ui_text(srna, "Keying Set Path", "Path to a setting for use in a Keying Set");
/* ID */ /* ID */
prop= RNA_def_property(srna, "id", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "id", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "ID"); RNA_def_property_struct_type(prop, "ID");
RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_editable_func(prop, "rna_ksPath_id_editable"); RNA_def_property_editable_func(prop, "rna_ksPath_id_editable");
RNA_def_property_pointer_funcs(prop, NULL, NULL, "rna_ksPath_id_typef", NULL); RNA_def_property_pointer_funcs(prop, NULL, NULL, "rna_ksPath_id_typef", NULL);
RNA_def_property_ui_text(prop, "ID-Block", "ID-Block that keyframes for Keying Set should be added to (for Absolute Keying Sets only)"); RNA_def_property_ui_text(prop, "ID-Block", "ID-Block that keyframes for Keying Set should be added to (for Absolute Keying Sets only)");
RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET|NA_EDITED, NULL); // XXX: maybe a bit too noisy RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET|NA_EDITED, NULL); /* XXX: maybe a bit too noisy */
prop= RNA_def_property(srna, "id_type", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "id_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "idtype"); RNA_def_property_enum_sdna(prop, NULL, "idtype");
RNA_def_property_enum_items(prop, id_type_items); RNA_def_property_enum_items(prop, id_type_items);
RNA_def_property_enum_default(prop, ID_OB); RNA_def_property_enum_default(prop, ID_OB);
RNA_def_property_enum_funcs(prop, NULL, "rna_ksPath_id_type_set", NULL); RNA_def_property_enum_funcs(prop, NULL, "rna_ksPath_id_type_set", NULL);
RNA_def_property_ui_text(prop, "ID Type", "Type of ID-block that can be used"); RNA_def_property_ui_text(prop, "ID Type", "Type of ID-block that can be used");
RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET|NA_EDITED, NULL); // XXX: maybe a bit too noisy RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET|NA_EDITED, NULL); /* XXX: maybe a bit too noisy */
/* Group */ /* Group */
prop= RNA_def_property(srna, "group", PROP_STRING, PROP_NONE); prop = RNA_def_property(srna, "group", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Group Name", "Name of Action Group to assign setting(s) for this path to"); RNA_def_property_ui_text(prop, "Group Name", "Name of Action Group to assign setting(s) for this path to");
RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET|NA_EDITED, NULL); // XXX: maybe a bit too noisy RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET|NA_EDITED, NULL); /* XXX: maybe a bit too noisy */
/* Grouping */ /* Grouping */
prop= RNA_def_property(srna, "group_method", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "group_method", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "groupmode"); RNA_def_property_enum_sdna(prop, NULL, "groupmode");
RNA_def_property_enum_items(prop, keyingset_path_grouping_items); RNA_def_property_enum_items(prop, keyingset_path_grouping_items);
RNA_def_property_ui_text(prop, "Grouping Method", "Method used to define which Group-name to use"); RNA_def_property_ui_text(prop, "Grouping Method", "Method used to define which Group-name to use");
RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET|NA_EDITED, NULL); // XXX: maybe a bit too noisy RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET|NA_EDITED, NULL); /* XXX: maybe a bit too noisy */
/* Path + Array Index */ /* Path + Array Index */
prop= RNA_def_property(srna, "data_path", PROP_STRING, PROP_NONE); prop = RNA_def_property(srna, "data_path", PROP_STRING, PROP_NONE);
RNA_def_property_string_funcs(prop, "rna_ksPath_RnaPath_get", "rna_ksPath_RnaPath_length", "rna_ksPath_RnaPath_set"); RNA_def_property_string_funcs(prop, "rna_ksPath_RnaPath_get", "rna_ksPath_RnaPath_length", "rna_ksPath_RnaPath_set");
RNA_def_property_ui_text(prop, "Data Path", "Path to property setting"); RNA_def_property_ui_text(prop, "Data Path", "Path to property setting");
RNA_def_struct_name_property(srna, prop); // XXX this is the best indicator for now... RNA_def_struct_name_property(srna, prop); /* XXX this is the best indicator for now... */
RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET|NA_EDITED, NULL); RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET|NA_EDITED, NULL);
/* called 'index' when given as function arg */ /* called 'index' when given as function arg */
prop= RNA_def_property(srna, "array_index", PROP_INT, PROP_NONE); prop = RNA_def_property(srna, "array_index", PROP_INT, PROP_NONE);
RNA_def_property_ui_text(prop, "RNA Array Index", "Index to the specific setting if applicable"); RNA_def_property_ui_text(prop, "RNA Array Index", "Index to the specific setting if applicable");
RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET|NA_EDITED, NULL); // XXX: maybe a bit too noisy RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET|NA_EDITED, NULL); /* XXX: maybe a bit too noisy */
/* Flags */ /* Flags */
prop= RNA_def_property(srna, "use_entire_array", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_entire_array", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", KSP_FLAG_WHOLE_ARRAY); RNA_def_property_boolean_sdna(prop, NULL, "flag", KSP_FLAG_WHOLE_ARRAY);
RNA_def_property_ui_text(prop, "Entire Array", "When an 'array/vector' type is chosen (Location, Rotation, Color, etc.), entire array is to be used"); RNA_def_property_ui_text(prop, "Entire Array", "When an 'array/vector' type is chosen (Location, Rotation, Color, etc.), entire array is to be used");
RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET|NA_EDITED, NULL); // XXX: maybe a bit too noisy RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET|NA_EDITED, NULL); /* XXX: maybe a bit too noisy */
/* Keyframing Settings */ /* Keyframing Settings */
rna_def_common_keying_flags(srna, 0); rna_def_common_keying_flags(srna, 0);
@@ -607,23 +607,23 @@ static void rna_def_keyingset_paths(BlenderRNA *brna, PropertyRNA *cprop)
PropertyRNA *prop; PropertyRNA *prop;
RNA_def_property_srna(cprop, "KeyingSetPaths"); RNA_def_property_srna(cprop, "KeyingSetPaths");
srna= RNA_def_struct(brna, "KeyingSetPaths", NULL); srna = RNA_def_struct(brna, "KeyingSetPaths", NULL);
RNA_def_struct_sdna(srna, "KeyingSet"); RNA_def_struct_sdna(srna, "KeyingSet");
RNA_def_struct_ui_text(srna, "Keying set paths", "Collection of keying set paths"); RNA_def_struct_ui_text(srna, "Keying set paths", "Collection of keying set paths");
/* Add Path */ /* Add Path */
func= RNA_def_function(srna, "add", "rna_KeyingSet_paths_add"); func = RNA_def_function(srna, "add", "rna_KeyingSet_paths_add");
RNA_def_function_ui_description(func, "Add a new path for the Keying Set"); RNA_def_function_ui_description(func, "Add a new path for the Keying Set");
RNA_def_function_flag(func, FUNC_USE_REPORTS); RNA_def_function_flag(func, FUNC_USE_REPORTS);
/* return arg */ /* return arg */
parm= RNA_def_pointer(func, "ksp", "KeyingSetPath", "New Path", "Path created and added to the Keying Set"); parm = RNA_def_pointer(func, "ksp", "KeyingSetPath", "New Path", "Path created and added to the Keying Set");
RNA_def_function_return(func, parm); RNA_def_function_return(func, parm);
/* ID-block for target */ /* ID-block for target */
parm= RNA_def_pointer(func, "target_id", "ID", "Target ID", "ID-Datablock for the destination"); parm = RNA_def_pointer(func, "target_id", "ID", "Target ID", "ID-Datablock for the destination");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
/* rna-path */ /* rna-path */
parm= RNA_def_string(func, "data_path", "", 256, "Data-Path", "RNA-Path to destination property"); // xxx hopefully this is long enough parm = RNA_def_string(func, "data_path", "", 256, "Data-Path", "RNA-Path to destination property"); /* xxx hopefully this is long enough */
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
/* index (defaults to -1 for entire array) */ /* index (defaults to -1 for entire array) */
RNA_def_int(func, "index", -1, -1, INT_MAX, "Index", RNA_def_int(func, "index", -1, -1, INT_MAX, "Index",
@@ -637,27 +637,27 @@ static void rna_def_keyingset_paths(BlenderRNA *brna, PropertyRNA *cprop)
/* Remove Path */ /* Remove Path */
func= RNA_def_function(srna, "remove", "rna_KeyingSet_paths_remove"); func = RNA_def_function(srna, "remove", "rna_KeyingSet_paths_remove");
RNA_def_function_ui_description(func, "Remove the given path from the Keying Set"); RNA_def_function_ui_description(func, "Remove the given path from the Keying Set");
RNA_def_function_flag(func, FUNC_USE_REPORTS); RNA_def_function_flag(func, FUNC_USE_REPORTS);
/* path to remove */ /* path to remove */
parm= RNA_def_pointer(func, "path", "KeyingSetPath", "Path", ""); parm = RNA_def_pointer(func, "path", "KeyingSetPath", "Path", "");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
/* Remove All Paths */ /* Remove All Paths */
func= RNA_def_function(srna, "clear", "rna_KeyingSet_paths_clear"); func = RNA_def_function(srna, "clear", "rna_KeyingSet_paths_clear");
RNA_def_function_ui_description(func, "Remove all the paths from the Keying Set"); RNA_def_function_ui_description(func, "Remove all the paths from the Keying Set");
RNA_def_function_flag(func, FUNC_USE_REPORTS); RNA_def_function_flag(func, FUNC_USE_REPORTS);
prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "KeyingSetPath"); RNA_def_property_struct_type(prop, "KeyingSetPath");
RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_editable_func(prop, "rna_KeyingSet_active_ksPath_editable"); RNA_def_property_editable_func(prop, "rna_KeyingSet_active_ksPath_editable");
RNA_def_property_pointer_funcs(prop, "rna_KeyingSet_active_ksPath_get", "rna_KeyingSet_active_ksPath_set", NULL, NULL); RNA_def_property_pointer_funcs(prop, "rna_KeyingSet_active_ksPath_get", "rna_KeyingSet_active_ksPath_set", NULL, NULL);
RNA_def_property_ui_text(prop, "Active Keying Set", "Active Keying Set used to insert/delete keyframes"); RNA_def_property_ui_text(prop, "Active Keying Set", "Active Keying Set used to insert/delete keyframes");
prop= RNA_def_property(srna, "active_index", PROP_INT, PROP_NONE); prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "active_path"); RNA_def_property_int_sdna(prop, NULL, "active_path");
RNA_def_property_int_funcs(prop, "rna_KeyingSet_active_ksPath_index_get", "rna_KeyingSet_active_ksPath_index_set", "rna_KeyingSet_active_ksPath_index_range"); RNA_def_property_int_funcs(prop, "rna_KeyingSet_active_ksPath_index_get", "rna_KeyingSet_active_ksPath_index_set", "rna_KeyingSet_active_ksPath_index_range");
RNA_def_property_ui_text(prop, "Active Path Index", "Current Keying Set index"); RNA_def_property_ui_text(prop, "Active Path Index", "Current Keying Set index");
@@ -668,31 +668,31 @@ static void rna_def_keyingset(BlenderRNA *brna)
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
srna= RNA_def_struct(brna, "KeyingSet", NULL); srna = RNA_def_struct(brna, "KeyingSet", NULL);
RNA_def_struct_ui_text(srna, "Keying Set", "Settings that should be keyframed together"); RNA_def_struct_ui_text(srna, "Keying Set", "Settings that should be keyframed together");
/* Name */ /* Name */
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Name", ""); RNA_def_property_ui_text(prop, "Name", "");
RNA_def_struct_ui_icon(srna, ICON_KEYINGSET); RNA_def_struct_ui_icon(srna, ICON_KEYINGSET);
RNA_def_struct_name_property(srna, prop); RNA_def_struct_name_property(srna, prop);
RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET|NA_RENAME, NULL); RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET|NA_RENAME, NULL);
/* KeyingSetInfo (Type Info) for Builtin Sets only */ /* KeyingSetInfo (Type Info) for Builtin Sets only */
prop= RNA_def_property(srna, "type_info", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "type_info", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "KeyingSetInfo"); RNA_def_property_struct_type(prop, "KeyingSetInfo");
RNA_def_property_pointer_funcs(prop, "rna_KeyingSet_typeinfo_get", NULL, NULL, NULL); RNA_def_property_pointer_funcs(prop, "rna_KeyingSet_typeinfo_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Type Info", "Callback function defines for built-in Keying Sets"); RNA_def_property_ui_text(prop, "Type Info", "Callback function defines for built-in Keying Sets");
/* Paths */ /* Paths */
prop= RNA_def_property(srna, "paths", PROP_COLLECTION, PROP_NONE); prop = RNA_def_property(srna, "paths", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "paths", NULL); RNA_def_property_collection_sdna(prop, NULL, "paths", NULL);
RNA_def_property_struct_type(prop, "KeyingSetPath"); RNA_def_property_struct_type(prop, "KeyingSetPath");
RNA_def_property_ui_text(prop, "Paths", "Keying Set Paths to define settings that get keyframed together"); RNA_def_property_ui_text(prop, "Paths", "Keying Set Paths to define settings that get keyframed together");
rna_def_keyingset_paths(brna, prop); rna_def_keyingset_paths(brna, prop);
/* Flags */ /* Flags */
prop= RNA_def_property(srna, "is_path_absolute", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "is_path_absolute", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", KEYINGSET_ABSOLUTE); RNA_def_property_boolean_sdna(prop, NULL, "flag", KEYINGSET_ABSOLUTE);
RNA_def_property_ui_text(prop, "Absolute", "Keying Set defines specific paths/settings to be keyframed (i.e. is not reliant on context info)"); RNA_def_property_ui_text(prop, "Absolute", "Keying Set defines specific paths/settings to be keyframed (i.e. is not reliant on context info)");
@@ -716,7 +716,7 @@ static void rna_api_animdata_nla_tracks(BlenderRNA *brna, PropertyRNA *cprop)
PropertyRNA *prop; PropertyRNA *prop;
RNA_def_property_srna(cprop, "NlaTracks"); RNA_def_property_srna(cprop, "NlaTracks");
srna= RNA_def_struct(brna, "NlaTracks", NULL); srna = RNA_def_struct(brna, "NlaTracks", NULL);
RNA_def_struct_sdna(srna, "AnimData"); RNA_def_struct_sdna(srna, "AnimData");
RNA_def_struct_ui_text(srna, "NLA Tracks", "Collection of NLA Tracks"); RNA_def_struct_ui_text(srna, "NLA Tracks", "Collection of NLA Tracks");
@@ -734,7 +734,7 @@ static void rna_api_animdata_nla_tracks(BlenderRNA *brna, PropertyRNA *cprop)
parm = RNA_def_pointer(func, "track", "NlaTrack", "", "NLA Track to remove"); parm = RNA_def_pointer(func, "track", "NlaTrack", "", "NLA Track to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "NlaTrack"); RNA_def_property_struct_type(prop, "NlaTrack");
RNA_def_property_pointer_funcs(prop, "rna_NlaTrack_active_get", "rna_NlaTrack_active_set", NULL, NULL); RNA_def_property_pointer_funcs(prop, "rna_NlaTrack_active_get", "rna_NlaTrack_active_set", NULL, NULL);
RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_flag(prop, PROP_EDITABLE);
@@ -749,10 +749,10 @@ static void rna_api_animdata_drivers(BlenderRNA *brna, PropertyRNA *cprop)
PropertyRNA *parm; PropertyRNA *parm;
FunctionRNA *func; FunctionRNA *func;
// PropertyRNA *prop; /* PropertyRNA *prop; */
RNA_def_property_srna(cprop, "AnimDataDrivers"); RNA_def_property_srna(cprop, "AnimDataDrivers");
srna= RNA_def_struct(brna, "AnimDataDrivers", NULL); srna = RNA_def_struct(brna, "AnimDataDrivers", NULL);
RNA_def_struct_sdna(srna, "AnimData"); RNA_def_struct_sdna(srna, "AnimData");
RNA_def_struct_ui_text(srna, "Drivers", "Collection of Driver F-Curves"); RNA_def_struct_ui_text(srna, "Drivers", "Collection of Driver F-Curves");
@@ -769,7 +769,7 @@ void rna_def_animdata_common(StructRNA *srna)
{ {
PropertyRNA *prop; PropertyRNA *prop;
prop= RNA_def_property(srna, "animation_data", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "animation_data", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "adt"); RNA_def_property_pointer_sdna(prop, NULL, "adt");
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Animation Data", "Animation data for this datablock"); RNA_def_property_ui_text(prop, "Animation Data", "Animation data for this datablock");
@@ -780,11 +780,11 @@ void rna_def_animdata(BlenderRNA *brna)
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
srna= RNA_def_struct(brna, "AnimData", NULL); srna = RNA_def_struct(brna, "AnimData", NULL);
RNA_def_struct_ui_text(srna, "Animation Data", "Animation data for datablock"); RNA_def_struct_ui_text(srna, "Animation Data", "Animation data for datablock");
/* NLA */ /* NLA */
prop= RNA_def_property(srna, "nla_tracks", PROP_COLLECTION, PROP_NONE); prop = RNA_def_property(srna, "nla_tracks", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "nla_tracks", NULL); RNA_def_property_collection_sdna(prop, NULL, "nla_tracks", NULL);
RNA_def_property_struct_type(prop, "NlaTrack"); RNA_def_property_struct_type(prop, "NlaTrack");
RNA_def_property_ui_text(prop, "NLA Tracks", "NLA Tracks (i.e. Animation Layers)"); RNA_def_property_ui_text(prop, "NLA Tracks", "NLA Tracks (i.e. Animation Layers)");
@@ -792,7 +792,7 @@ void rna_def_animdata(BlenderRNA *brna)
rna_api_animdata_nla_tracks(brna, prop); rna_api_animdata_nla_tracks(brna, prop);
/* Active Action */ /* Active Action */
prop= RNA_def_property(srna, "action", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "action", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_EDITABLE); /* this flag as well as the dynamic test must be defined for this to be editable... */ RNA_def_property_flag(prop, PROP_EDITABLE); /* this flag as well as the dynamic test must be defined for this to be editable... */
RNA_def_property_pointer_funcs(prop, NULL, "rna_AnimData_action_set", NULL, "rna_Action_id_poll"); RNA_def_property_pointer_funcs(prop, NULL, "rna_AnimData_action_set", NULL, "rna_Action_id_poll");
RNA_def_property_editable_func(prop, "rna_AnimData_action_editable"); RNA_def_property_editable_func(prop, "rna_AnimData_action_editable");
@@ -800,19 +800,19 @@ void rna_def_animdata(BlenderRNA *brna)
RNA_def_property_update(prop, NC_ANIMATION, NULL); /* this will do? */ RNA_def_property_update(prop, NC_ANIMATION, NULL); /* this will do? */
/* Active Action Settings */ /* Active Action Settings */
prop= RNA_def_property(srna, "action_extrapolation", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "action_extrapolation", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "act_extendmode"); RNA_def_property_enum_sdna(prop, NULL, "act_extendmode");
RNA_def_property_enum_items(prop, nla_mode_extend_items); RNA_def_property_enum_items(prop, nla_mode_extend_items);
RNA_def_property_ui_text(prop, "Action Extrapolation", "Action to take for gaps past the Active Action's range (when evaluating with NLA)"); RNA_def_property_ui_text(prop, "Action Extrapolation", "Action to take for gaps past the Active Action's range (when evaluating with NLA)");
RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */ RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
prop= RNA_def_property(srna, "action_blend_type", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "action_blend_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "act_blendmode"); RNA_def_property_enum_sdna(prop, NULL, "act_blendmode");
RNA_def_property_enum_items(prop, nla_mode_blend_items); RNA_def_property_enum_items(prop, nla_mode_blend_items);
RNA_def_property_ui_text(prop, "Action Blending", "Method used for combining Active Action's result with result of NLA stack"); RNA_def_property_ui_text(prop, "Action Blending", "Method used for combining Active Action's result with result of NLA stack");
RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */ RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
prop= RNA_def_property(srna, "action_influence", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "action_influence", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "act_influence"); RNA_def_property_float_sdna(prop, NULL, "act_influence");
RNA_def_property_float_default(prop, 1.0f); RNA_def_property_float_default(prop, 1.0f);
RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_range(prop, 0.0f, 1.0f);
@@ -820,7 +820,7 @@ void rna_def_animdata(BlenderRNA *brna)
RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */ RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
/* Drivers */ /* Drivers */
prop= RNA_def_property(srna, "drivers", PROP_COLLECTION, PROP_NONE); prop = RNA_def_property(srna, "drivers", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "drivers", NULL); RNA_def_property_collection_sdna(prop, NULL, "drivers", NULL);
RNA_def_property_struct_type(prop, "FCurve"); RNA_def_property_struct_type(prop, "FCurve");
RNA_def_property_ui_text(prop, "Drivers", "The Drivers/Expressions for this datablock"); RNA_def_property_ui_text(prop, "Drivers", "The Drivers/Expressions for this datablock");
@@ -828,7 +828,7 @@ void rna_def_animdata(BlenderRNA *brna)
rna_api_animdata_drivers(brna, prop); rna_api_animdata_drivers(brna, prop);
/* General Settings */ /* General Settings */
prop= RNA_def_property(srna, "use_nla", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_nla", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", ADT_NLA_EVAL_OFF); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", ADT_NLA_EVAL_OFF);
RNA_def_property_ui_text(prop, "NLA Evaluation Enabled", "NLA stack is evaluated when evaluating this block"); RNA_def_property_ui_text(prop, "NLA Evaluation Enabled", "NLA stack is evaluated when evaluating this block");
RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */ RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */

View File

@@ -49,7 +49,7 @@
static void rna_KeyingSet_context_refresh(KeyingSet *ks, bContext *C, ReportList *reports) static void rna_KeyingSet_context_refresh(KeyingSet *ks, bContext *C, ReportList *reports)
{ {
// TODO: enable access to providing a list of overrides (dsources)? /* TODO: enable access to providing a list of overrides (dsources)? */
int success = ANIM_validate_keyingset(C, NULL, ks); int success = ANIM_validate_keyingset(C, NULL, ks);
if (success != 0) { if (success != 0) {
@@ -70,10 +70,10 @@ static void rna_KeyingSet_context_refresh(KeyingSet *ks, bContext *C, ReportList
void RNA_api_keyingset(StructRNA *srna) void RNA_api_keyingset(StructRNA *srna)
{ {
FunctionRNA *func; FunctionRNA *func;
//PropertyRNA *parm; /*PropertyRNA *parm; */
/* validate relative Keying Set (used to ensure paths are ok for context) */ /* validate relative Keying Set (used to ensure paths are ok for context) */
func= RNA_def_function(srna, "refresh", "rna_KeyingSet_context_refresh"); func = RNA_def_function(srna, "refresh", "rna_KeyingSet_context_refresh");
RNA_def_function_ui_description(func, "Refresh Keying Set to ensure that it is valid for the current context. Call before each use of one"); RNA_def_function_ui_description(func, "Refresh Keying Set to ensure that it is valid for the current context. Call before each use of one");
RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS); RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
} }

View File

@@ -53,35 +53,35 @@ static PointerRNA rna_AnimViz_motion_paths_get(PointerRNA *ptr)
static void rna_AnimViz_ghost_start_frame_set(PointerRNA *ptr, int value) static void rna_AnimViz_ghost_start_frame_set(PointerRNA *ptr, int value)
{ {
bAnimVizSettings *data= (bAnimVizSettings*)ptr->data; bAnimVizSettings *data = (bAnimVizSettings*)ptr->data;
CLAMP(value, 1, data->ghost_ef); CLAMP(value, 1, data->ghost_ef);
data->ghost_sf= value; data->ghost_sf = value;
} }
static void rna_AnimViz_ghost_end_frame_set(PointerRNA *ptr, int value) static void rna_AnimViz_ghost_end_frame_set(PointerRNA *ptr, int value)
{ {
bAnimVizSettings *data= (bAnimVizSettings*)ptr->data; bAnimVizSettings *data = (bAnimVizSettings*)ptr->data;
CLAMP(value, data->ghost_sf, (int)(MAXFRAMEF/2)); CLAMP(value, data->ghost_sf, (int)(MAXFRAMEF/2));
data->ghost_ef= value; data->ghost_ef = value;
} }
static void rna_AnimViz_path_start_frame_set(PointerRNA *ptr, int value) static void rna_AnimViz_path_start_frame_set(PointerRNA *ptr, int value)
{ {
bAnimVizSettings *data= (bAnimVizSettings*)ptr->data; bAnimVizSettings *data = (bAnimVizSettings*)ptr->data;
CLAMP(value, 1, data->path_ef-1); CLAMP(value, 1, data->path_ef-1);
data->path_sf= value; data->path_sf = value;
} }
static void rna_AnimViz_path_end_frame_set(PointerRNA *ptr, int value) static void rna_AnimViz_path_end_frame_set(PointerRNA *ptr, int value)
{ {
bAnimVizSettings *data= (bAnimVizSettings*)ptr->data; bAnimVizSettings *data = (bAnimVizSettings*)ptr->data;
// XXX: watchit! Path Start > MAXFRAME/2 could be a problem... /* XXX: watchit! Path Start > MAXFRAME/2 could be a problem... */
CLAMP(value, data->path_sf+1, (int)(MAXFRAMEF/2)); CLAMP(value, data->path_sf+1, (int)(MAXFRAMEF/2));
data->path_ef= value; data->path_ef = value;
} }
#else #else
@@ -90,7 +90,7 @@ void rna_def_motionpath_common(StructRNA *srna)
{ {
PropertyRNA *prop; PropertyRNA *prop;
prop= RNA_def_property(srna, "motion_path", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "motion_path", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "mpath"); RNA_def_property_pointer_sdna(prop, NULL, "mpath");
RNA_def_property_ui_text(prop, "Motion Path", "Motion Path for this element"); RNA_def_property_ui_text(prop, "Motion Path", "Motion Path for this element");
} }
@@ -100,15 +100,15 @@ static void rna_def_animviz_motionpath_vert(BlenderRNA *brna)
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
srna= RNA_def_struct(brna, "MotionPathVert", NULL); srna = RNA_def_struct(brna, "MotionPathVert", NULL);
RNA_def_struct_sdna(srna, "bMotionPathVert"); RNA_def_struct_sdna(srna, "bMotionPathVert");
RNA_def_struct_ui_text(srna, "Motion Path Cache Point", "Cached location on path"); RNA_def_struct_ui_text(srna, "Motion Path Cache Point", "Cached location on path");
prop= RNA_def_property(srna, "co", PROP_FLOAT, PROP_XYZ); prop = RNA_def_property(srna, "co", PROP_FLOAT, PROP_XYZ);
RNA_def_property_array(prop, 3); RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Coordinates", ""); RNA_def_property_ui_text(prop, "Coordinates", "");
prop= RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOTIONPATH_VERT_SEL); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOTIONPATH_VERT_SEL);
RNA_def_property_ui_text(prop, "Select", "Path point is selected for editing"); RNA_def_property_ui_text(prop, "Select", "Path point is selected for editing");
} }
@@ -118,38 +118,38 @@ static void rna_def_animviz_motion_path(BlenderRNA *brna)
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
srna= RNA_def_struct(brna, "MotionPath", NULL); srna = RNA_def_struct(brna, "MotionPath", NULL);
RNA_def_struct_sdna(srna, "bMotionPath"); RNA_def_struct_sdna(srna, "bMotionPath");
RNA_def_struct_ui_text(srna, "Motion Path", "Cache of the worldspace positions of an element over a frame range"); RNA_def_struct_ui_text(srna, "Motion Path", "Cache of the worldspace positions of an element over a frame range");
/* Collections */ /* Collections */
prop= RNA_def_property(srna, "points", PROP_COLLECTION, PROP_NONE); prop = RNA_def_property(srna, "points", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "points", "length"); RNA_def_property_collection_sdna(prop, NULL, "points", "length");
RNA_def_property_struct_type(prop, "MotionPathVert"); RNA_def_property_struct_type(prop, "MotionPathVert");
RNA_def_property_ui_text(prop, "Motion Path Points", "Cached positions per frame"); RNA_def_property_ui_text(prop, "Motion Path Points", "Cached positions per frame");
/* Playback Ranges */ /* Playback Ranges */
prop= RNA_def_property(srna, "frame_start", PROP_INT, PROP_TIME); prop = RNA_def_property(srna, "frame_start", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "start_frame"); RNA_def_property_int_sdna(prop, NULL, "start_frame");
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Start Frame", "Starting frame of the stored range"); RNA_def_property_ui_text(prop, "Start Frame", "Starting frame of the stored range");
prop= RNA_def_property(srna, "frame_end", PROP_INT, PROP_TIME); prop = RNA_def_property(srna, "frame_end", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "end_frame"); RNA_def_property_int_sdna(prop, NULL, "end_frame");
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "End Frame", "End frame of the stored range"); RNA_def_property_ui_text(prop, "End Frame", "End frame of the stored range");
prop= RNA_def_property(srna, "length", PROP_INT, PROP_TIME); prop = RNA_def_property(srna, "length", PROP_INT, PROP_TIME);
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Length", "Number of frames cached"); RNA_def_property_ui_text(prop, "Length", "Number of frames cached");
/* Settings */ /* Settings */
prop= RNA_def_property(srna, "use_bone_head", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_bone_head", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOTIONPATH_FLAG_BHEAD); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOTIONPATH_FLAG_BHEAD);
RNA_def_property_clear_flag(prop, PROP_EDITABLE); // xxx RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* xxx */
RNA_def_property_ui_text(prop, "Use Bone Heads", "For PoseBone paths, use the bone head location when calculating this path"); RNA_def_property_ui_text(prop, "Use Bone Heads", "For PoseBone paths, use the bone head location when calculating this path");
prop= RNA_def_property(srna, "is_modified", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "is_modified", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOTIONPATH_FLAG_EDIT); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOTIONPATH_FLAG_EDIT);
RNA_def_property_ui_text(prop, "Edit Path", "Path is being edited"); RNA_def_property_ui_text(prop, "Edit Path", "Path is being edited");
} }
@@ -169,51 +169,51 @@ static void rna_def_animviz_ghosts(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}}; {0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "AnimVizOnionSkinning", NULL); srna = RNA_def_struct(brna, "AnimVizOnionSkinning", NULL);
RNA_def_struct_sdna(srna, "bAnimVizSettings"); RNA_def_struct_sdna(srna, "bAnimVizSettings");
RNA_def_struct_nested(brna, srna, "AnimViz"); RNA_def_struct_nested(brna, srna, "AnimViz");
RNA_def_struct_ui_text(srna, "Onion Skinning Settings", "Onion Skinning settings for animation visualisation"); RNA_def_struct_ui_text(srna, "Onion Skinning Settings", "Onion Skinning settings for animation visualisation");
/* Enums */ /* Enums */
prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "ghost_type"); RNA_def_property_enum_sdna(prop, NULL, "ghost_type");
RNA_def_property_enum_items(prop, prop_type_items); RNA_def_property_enum_items(prop, prop_type_items);
RNA_def_property_ui_text(prop, "Type", "Method used for determining what ghosts get drawn"); RNA_def_property_ui_text(prop, "Type", "Method used for determining what ghosts get drawn");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */ RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */
/* Settings */ /* Settings */
prop= RNA_def_property(srna, "show_only_selected", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "show_only_selected", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ghost_flag", GHOST_FLAG_ONLYSEL); RNA_def_property_boolean_sdna(prop, NULL, "ghost_flag", GHOST_FLAG_ONLYSEL);
RNA_def_property_ui_text(prop, "On Selected Bones Only", "For Pose-Mode drawing, only draw ghosts for selected bones"); RNA_def_property_ui_text(prop, "On Selected Bones Only", "For Pose-Mode drawing, only draw ghosts for selected bones");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */ RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */
prop= RNA_def_property(srna, "frame_step", PROP_INT, PROP_NONE); prop = RNA_def_property(srna, "frame_step", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "ghost_step"); RNA_def_property_int_sdna(prop, NULL, "ghost_step");
RNA_def_property_range(prop, 1, 20); RNA_def_property_range(prop, 1, 20);
RNA_def_property_ui_text(prop, "Frame Step", "Number of frames between ghosts shown (not for 'On Keyframes' Onion-skinning method)"); RNA_def_property_ui_text(prop, "Frame Step", "Number of frames between ghosts shown (not for 'On Keyframes' Onion-skinning method)");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */ RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */
/* Playback Ranges */ /* Playback Ranges */
prop= RNA_def_property(srna, "frame_start", PROP_INT, PROP_TIME); prop = RNA_def_property(srna, "frame_start", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "ghost_sf"); RNA_def_property_int_sdna(prop, NULL, "ghost_sf");
RNA_def_property_int_funcs(prop, NULL, "rna_AnimViz_ghost_start_frame_set", NULL); RNA_def_property_int_funcs(prop, NULL, "rna_AnimViz_ghost_start_frame_set", NULL);
RNA_def_property_ui_text(prop, "Start Frame", "Starting frame of range of Ghosts to display (not for 'Around Current Frame' Onion-skinning method)"); RNA_def_property_ui_text(prop, "Start Frame", "Starting frame of range of Ghosts to display (not for 'Around Current Frame' Onion-skinning method)");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */ RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */
prop= RNA_def_property(srna, "frame_end", PROP_INT, PROP_TIME); prop = RNA_def_property(srna, "frame_end", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "ghost_ef"); RNA_def_property_int_sdna(prop, NULL, "ghost_ef");
RNA_def_property_int_funcs(prop, NULL, "rna_AnimViz_ghost_end_frame_set", NULL); RNA_def_property_int_funcs(prop, NULL, "rna_AnimViz_ghost_end_frame_set", NULL);
RNA_def_property_ui_text(prop, "End Frame", "End frame of range of Ghosts to display (not for 'Around Current Frame' Onion-skinning method)"); RNA_def_property_ui_text(prop, "End Frame", "End frame of range of Ghosts to display (not for 'Around Current Frame' Onion-skinning method)");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */ RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */
/* Around Current Ranges */ /* Around Current Ranges */
prop= RNA_def_property(srna, "frame_before", PROP_INT, PROP_TIME); prop = RNA_def_property(srna, "frame_before", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "ghost_bc"); RNA_def_property_int_sdna(prop, NULL, "ghost_bc");
RNA_def_property_range(prop, 0, 30); RNA_def_property_range(prop, 0, 30);
RNA_def_property_ui_text(prop, "Before Current", "Number of frames to show before the current frame (only for 'Around Current Frame' Onion-skinning method)"); RNA_def_property_ui_text(prop, "Before Current", "Number of frames to show before the current frame (only for 'Around Current Frame' Onion-skinning method)");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */ RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */
prop= RNA_def_property(srna, "frame_after", PROP_INT, PROP_TIME); prop = RNA_def_property(srna, "frame_after", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "ghost_ac"); RNA_def_property_int_sdna(prop, NULL, "ghost_ac");
RNA_def_property_range(prop, 0, 30); RNA_def_property_range(prop, 0, 30);
RNA_def_property_ui_text(prop, "After Current", "Number of frames to show after the current frame (only for 'Around Current Frame' Onion-skinning method)"); RNA_def_property_ui_text(prop, "After Current", "Number of frames to show after the current frame (only for 'Around Current Frame' Onion-skinning method)");
@@ -225,55 +225,55 @@ static void rna_def_animviz_paths(BlenderRNA *brna)
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
static const EnumPropertyItem prop_type_items[]= { static const EnumPropertyItem prop_type_items[] = {
{MOTIONPATH_TYPE_ACFRA, "CURRENT_FRAME", 0, "Around Frame", "Display Paths of poses within a fixed number of frames around the current frame"}, {MOTIONPATH_TYPE_ACFRA, "CURRENT_FRAME", 0, "Around Frame", "Display Paths of poses within a fixed number of frames around the current frame"},
{MOTIONPATH_TYPE_RANGE, "RANGE", 0, "In Range", "Display Paths of poses within specified range"}, {MOTIONPATH_TYPE_RANGE, "RANGE", 0, "In Range", "Display Paths of poses within specified range"},
{0, NULL, 0, NULL, NULL}}; {0, NULL, 0, NULL, NULL}};
static const EnumPropertyItem prop_location_items[]= { static const EnumPropertyItem prop_location_items[] = {
{MOTIONPATH_BAKE_HEADS, "HEADS", 0, "Heads", "Calculate bone paths from heads"}, {MOTIONPATH_BAKE_HEADS, "HEADS", 0, "Heads", "Calculate bone paths from heads"},
{0, "TAILS", 0, "Tails", "Calculate bone paths from tails"}, {0, "TAILS", 0, "Tails", "Calculate bone paths from tails"},
{0, NULL, 0, NULL, NULL}}; {0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "AnimVizMotionPaths", NULL); srna = RNA_def_struct(brna, "AnimVizMotionPaths", NULL);
RNA_def_struct_sdna(srna, "bAnimVizSettings"); RNA_def_struct_sdna(srna, "bAnimVizSettings");
RNA_def_struct_nested(brna, srna, "AnimViz"); RNA_def_struct_nested(brna, srna, "AnimViz");
RNA_def_struct_ui_text(srna, "Motion Path Settings", "Motion Path settings for animation visualisation"); RNA_def_struct_ui_text(srna, "Motion Path Settings", "Motion Path settings for animation visualisation");
/* Enums */ /* Enums */
prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "path_type"); RNA_def_property_enum_sdna(prop, NULL, "path_type");
RNA_def_property_enum_items(prop, prop_type_items); RNA_def_property_enum_items(prop, prop_type_items);
RNA_def_property_ui_text(prop, "Paths Type", "Type of range to show for Motion Paths"); RNA_def_property_ui_text(prop, "Paths Type", "Type of range to show for Motion Paths");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */ RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */
prop= RNA_def_property(srna, "bake_location", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "bake_location", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "path_bakeflag"); RNA_def_property_enum_bitflag_sdna(prop, NULL, "path_bakeflag");
RNA_def_property_enum_items(prop, prop_location_items); RNA_def_property_enum_items(prop, prop_location_items);
RNA_def_property_ui_text(prop, "Bake Location", "When calculating Bone Paths, use Head or Tips"); RNA_def_property_ui_text(prop, "Bake Location", "When calculating Bone Paths, use Head or Tips");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */ RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */
/* Settings */ /* Settings */
prop= RNA_def_property(srna, "show_frame_numbers", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "show_frame_numbers", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "path_viewflag", MOTIONPATH_VIEW_FNUMS); RNA_def_property_boolean_sdna(prop, NULL, "path_viewflag", MOTIONPATH_VIEW_FNUMS);
RNA_def_property_ui_text(prop, "Show Frame Numbers", "Show frame numbers on Motion Paths"); RNA_def_property_ui_text(prop, "Show Frame Numbers", "Show frame numbers on Motion Paths");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */ RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */
prop= RNA_def_property(srna, "show_keyframe_highlight", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "show_keyframe_highlight", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "path_viewflag", MOTIONPATH_VIEW_KFRAS); RNA_def_property_boolean_sdna(prop, NULL, "path_viewflag", MOTIONPATH_VIEW_KFRAS);
RNA_def_property_ui_text(prop, "Highlight Keyframes", "Emphasize position of keyframes on Motion Paths"); RNA_def_property_ui_text(prop, "Highlight Keyframes", "Emphasize position of keyframes on Motion Paths");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */ RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */
prop= RNA_def_property(srna, "show_keyframe_numbers", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "show_keyframe_numbers", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "path_viewflag", MOTIONPATH_VIEW_KFNOS); RNA_def_property_boolean_sdna(prop, NULL, "path_viewflag", MOTIONPATH_VIEW_KFNOS);
RNA_def_property_ui_text(prop, "Show Keyframe Numbers", "Show frame numbers of Keyframes on Motion Paths"); RNA_def_property_ui_text(prop, "Show Keyframe Numbers", "Show frame numbers of Keyframes on Motion Paths");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */ RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */
prop= RNA_def_property(srna, "show_keyframe_action_all", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "show_keyframe_action_all", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "path_viewflag", MOTIONPATH_VIEW_KFACT); RNA_def_property_boolean_sdna(prop, NULL, "path_viewflag", MOTIONPATH_VIEW_KFACT);
RNA_def_property_ui_text(prop, "All Action Keyframes", "For bone motion paths, search whole Action for keyframes instead of in group with matching name only (is slower)"); RNA_def_property_ui_text(prop, "All Action Keyframes", "For bone motion paths, search whole Action for keyframes instead of in group with matching name only (is slower)");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */ RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */
prop= RNA_def_property(srna, "frame_step", PROP_INT, PROP_NONE); prop = RNA_def_property(srna, "frame_step", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "path_step"); RNA_def_property_int_sdna(prop, NULL, "path_step");
RNA_def_property_range(prop, 1, 100); RNA_def_property_range(prop, 1, 100);
RNA_def_property_ui_text(prop, "Frame Step", "Number of frames between paths shown (not for 'On Keyframes' Onion-skinning method)"); RNA_def_property_ui_text(prop, "Frame Step", "Number of frames between paths shown (not for 'On Keyframes' Onion-skinning method)");
@@ -281,26 +281,26 @@ static void rna_def_animviz_paths(BlenderRNA *brna)
/* Playback Ranges */ /* Playback Ranges */
prop= RNA_def_property(srna, "frame_start", PROP_INT, PROP_TIME); prop = RNA_def_property(srna, "frame_start", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "path_sf"); RNA_def_property_int_sdna(prop, NULL, "path_sf");
RNA_def_property_int_funcs(prop, NULL, "rna_AnimViz_path_start_frame_set", NULL); RNA_def_property_int_funcs(prop, NULL, "rna_AnimViz_path_start_frame_set", NULL);
RNA_def_property_ui_text(prop, "Start Frame", "Starting frame of range of paths to display/calculate (not for 'Around Current Frame' Onion-skinning method)"); RNA_def_property_ui_text(prop, "Start Frame", "Starting frame of range of paths to display/calculate (not for 'Around Current Frame' Onion-skinning method)");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */ RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */
prop= RNA_def_property(srna, "frame_end", PROP_INT, PROP_TIME); prop = RNA_def_property(srna, "frame_end", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "path_ef"); RNA_def_property_int_sdna(prop, NULL, "path_ef");
RNA_def_property_int_funcs(prop, NULL, "rna_AnimViz_path_end_frame_set", NULL); RNA_def_property_int_funcs(prop, NULL, "rna_AnimViz_path_end_frame_set", NULL);
RNA_def_property_ui_text(prop, "End Frame", "End frame of range of paths to display/calculate (not for 'Around Current Frame' Onion-skinning method)"); RNA_def_property_ui_text(prop, "End Frame", "End frame of range of paths to display/calculate (not for 'Around Current Frame' Onion-skinning method)");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */ RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */
/* Around Current Ranges */ /* Around Current Ranges */
prop= RNA_def_property(srna, "frame_before", PROP_INT, PROP_TIME); prop = RNA_def_property(srna, "frame_before", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "path_bc"); RNA_def_property_int_sdna(prop, NULL, "path_bc");
RNA_def_property_range(prop, 1, MAXFRAMEF/2); RNA_def_property_range(prop, 1, MAXFRAMEF/2);
RNA_def_property_ui_text(prop, "Before Current", "Number of frames to show before the current frame (only for 'Around Current Frame' Onion-skinning method)"); RNA_def_property_ui_text(prop, "Before Current", "Number of frames to show before the current frame (only for 'Around Current Frame' Onion-skinning method)");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */ RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */
prop= RNA_def_property(srna, "frame_after", PROP_INT, PROP_TIME); prop = RNA_def_property(srna, "frame_after", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "path_ac"); RNA_def_property_int_sdna(prop, NULL, "path_ac");
RNA_def_property_range(prop, 1, MAXFRAMEF/2); RNA_def_property_range(prop, 1, MAXFRAMEF/2);
RNA_def_property_ui_text(prop, "After Current", "Number of frames to show after the current frame (only for 'Around Current Frame' Onion-skinning method)"); RNA_def_property_ui_text(prop, "After Current", "Number of frames to show after the current frame (only for 'Around Current Frame' Onion-skinning method)");
@@ -313,7 +313,7 @@ void rna_def_animviz_common(StructRNA *srna)
{ {
PropertyRNA *prop; PropertyRNA *prop;
prop= RNA_def_property(srna, "animation_visualisation", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "animation_visualisation", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "avs"); RNA_def_property_pointer_sdna(prop, NULL, "avs");
RNA_def_property_ui_text(prop, "Animation Visualisation", "Animation data for this datablock"); RNA_def_property_ui_text(prop, "Animation Visualisation", "Animation data for this datablock");
@@ -324,19 +324,19 @@ static void rna_def_animviz(BlenderRNA *brna)
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
srna= RNA_def_struct(brna, "AnimViz", NULL); srna = RNA_def_struct(brna, "AnimViz", NULL);
RNA_def_struct_sdna(srna, "bAnimVizSettings"); RNA_def_struct_sdna(srna, "bAnimVizSettings");
RNA_def_struct_ui_text(srna, "Animation Visualisation", "Settings for the visualisation of motion"); RNA_def_struct_ui_text(srna, "Animation Visualisation", "Settings for the visualisation of motion");
/* onion-skinning settings (nested struct) */ /* onion-skinning settings (nested struct) */
prop= RNA_def_property(srna, "onion_skin_frames", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "onion_skin_frames", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "AnimVizOnionSkinning"); RNA_def_property_struct_type(prop, "AnimVizOnionSkinning");
RNA_def_property_pointer_funcs(prop, "rna_AnimViz_onion_skinning_get", NULL, NULL, NULL); RNA_def_property_pointer_funcs(prop, "rna_AnimViz_onion_skinning_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Onion Skinning", "Onion Skinning (ghosting) settings for visualisation"); RNA_def_property_ui_text(prop, "Onion Skinning", "Onion Skinning (ghosting) settings for visualisation");
/* motion path settings (nested struct) */ /* motion path settings (nested struct) */
prop= RNA_def_property(srna, "motion_path", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "motion_path", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "AnimVizMotionPaths"); RNA_def_property_struct_type(prop, "AnimVizMotionPaths");
RNA_def_property_pointer_funcs(prop, "rna_AnimViz_motion_paths_get", NULL, NULL, NULL); RNA_def_property_pointer_funcs(prop, "rna_AnimViz_motion_paths_get", NULL, NULL, NULL);

File diff suppressed because it is too large Load Diff

View File

@@ -44,7 +44,7 @@
void rna_EditBone_align_roll(EditBone *ebo, float no[3]) void rna_EditBone_align_roll(EditBone *ebo, float no[3])
{ {
ebo->roll= ED_rollBoneToVector(ebo, no, FALSE); ebo->roll = ED_rollBoneToVector(ebo, no, FALSE);
} }
float rna_Bone_do_envelope(Bone *bone, float *vec) float rna_Bone_do_envelope(Bone *bone, float *vec)
@@ -60,10 +60,10 @@ void RNA_api_armature_edit_bone(StructRNA *srna)
FunctionRNA *func; FunctionRNA *func;
PropertyRNA *parm; PropertyRNA *parm;
func= RNA_def_function(srna, "align_roll", "rna_EditBone_align_roll"); func = RNA_def_function(srna, "align_roll", "rna_EditBone_align_roll");
RNA_def_function_ui_description(func, "Align the bone to a localspace roll so the Z axis " RNA_def_function_ui_description(func, "Align the bone to a localspace roll so the Z axis "
"points in the direction of the vector given"); "points in the direction of the vector given");
parm= RNA_def_float_vector(func, "vector", 3, NULL, -FLT_MAX, FLT_MAX, "Vector", "", -FLT_MAX, FLT_MAX); parm = RNA_def_float_vector(func, "vector", 3, NULL, -FLT_MAX, FLT_MAX, "Vector", "", -FLT_MAX, FLT_MAX);
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
} }
@@ -72,13 +72,13 @@ void RNA_api_bone(StructRNA *srna)
PropertyRNA *parm; PropertyRNA *parm;
FunctionRNA *func; FunctionRNA *func;
func= RNA_def_function(srna, "evaluate_envelope", "rna_Bone_do_envelope"); func = RNA_def_function(srna, "evaluate_envelope", "rna_Bone_do_envelope");
RNA_def_function_ui_description(func, "Calculate bone envelope at given point"); RNA_def_function_ui_description(func, "Calculate bone envelope at given point");
parm= RNA_def_float_vector_xyz(func, "point", 3, NULL, -FLT_MAX, FLT_MAX, "Point", parm = RNA_def_float_vector_xyz(func, "point", 3, NULL, -FLT_MAX, FLT_MAX, "Point",
"Position in 3d space to evaluate", -FLT_MAX, FLT_MAX); "Position in 3d space to evaluate", -FLT_MAX, FLT_MAX);
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
/* return value */ /* return value */
parm= RNA_def_float(func, "factor", 0, -FLT_MAX, FLT_MAX, "Factor", "Envelope factor", -FLT_MAX, FLT_MAX); parm = RNA_def_float(func, "factor", 0, -FLT_MAX, FLT_MAX, "Factor", "Envelope factor", -FLT_MAX, FLT_MAX);
RNA_def_function_return(func, parm); RNA_def_function_return(func, parm);
} }

View File

@@ -46,7 +46,7 @@
#include "WM_api.h" #include "WM_api.h"
#include "WM_types.h" #include "WM_types.h"
EnumPropertyItem boidrule_type_items[] ={ EnumPropertyItem boidrule_type_items[] = {
{eBoidRuleType_Goal, "GOAL", 0, "Goal", "Go to assigned object or loudest assigned signal source"}, {eBoidRuleType_Goal, "GOAL", 0, "Goal", "Go to assigned object or loudest assigned signal source"},
{eBoidRuleType_Avoid, "AVOID", 0, "Avoid", "Get away from assigned object or loudest assigned signal source"}, {eBoidRuleType_Avoid, "AVOID", 0, "Avoid", "Get away from assigned object or loudest assigned signal source"},
{eBoidRuleType_AvoidCollision, "AVOID_COLLISION", 0, "Avoid Collision", "Manoeuvre to avoid collisions with other boids and deflector objects in near future"}, {eBoidRuleType_AvoidCollision, "AVOID_COLLISION", 0, "Avoid Collision", "Manoeuvre to avoid collisions with other boids and deflector objects in near future"},
@@ -55,13 +55,13 @@ EnumPropertyItem boidrule_type_items[] ={
{eBoidRuleType_FollowLeader, "FOLLOW_LEADER", 0, "Follow Leader", "Follow a boid or assigned object"}, {eBoidRuleType_FollowLeader, "FOLLOW_LEADER", 0, "Follow Leader", "Follow a boid or assigned object"},
{eBoidRuleType_AverageSpeed, "AVERAGE_SPEED", 0, "Average Speed", "Maintain speed, flight level or wander"}, {eBoidRuleType_AverageSpeed, "AVERAGE_SPEED", 0, "Average Speed", "Maintain speed, flight level or wander"},
{eBoidRuleType_Fight, "FIGHT", 0, "Fight", "Go to closest enemy and attack when in range"}, {eBoidRuleType_Fight, "FIGHT", 0, "Fight", "Go to closest enemy and attack when in range"},
//{eBoidRuleType_Protect, "PROTECT", 0, "Protect", "Go to enemy closest to target and attack when in range"}, /*{eBoidRuleType_Protect, "PROTECT", 0, "Protect", "Go to enemy closest to target and attack when in range"}, */
//{eBoidRuleType_Hide, "HIDE", 0, "Hide", "Find a deflector move to it's other side from closest enemy"}, /*{eBoidRuleType_Hide, "HIDE", 0, "Hide", "Find a deflector move to it's other side from closest enemy"}, */
//{eBoidRuleType_FollowPath, "FOLLOW_PATH", 0, "Follow Path", "Move along a assigned curve or closest curve in a group"}, /*{eBoidRuleType_FollowPath, "FOLLOW_PATH", 0, "Follow Path", "Move along a assigned curve or closest curve in a group"}, */
//{eBoidRuleType_FollowWall, "FOLLOW_WALL", 0, "Follow Wall", "Move next to a deflector object's in direction of it's tangent"}, /*{eBoidRuleType_FollowWall, "FOLLOW_WALL", 0, "Follow Wall", "Move next to a deflector object's in direction of it's tangent"}, */
{0, NULL, 0, NULL, NULL}}; {0, NULL, 0, NULL, NULL}};
EnumPropertyItem boidruleset_type_items[] ={ EnumPropertyItem boidruleset_type_items[] = {
{eBoidRulesetType_Fuzzy, "FUZZY", 0, "Fuzzy", "Rules are gone through top to bottom. Only the first rule that effect above fuzziness threshold is evaluated"}, {eBoidRulesetType_Fuzzy, "FUZZY", 0, "Fuzzy", "Rules are gone through top to bottom. Only the first rule that effect above fuzziness threshold is evaluated"},
{eBoidRulesetType_Random, "RANDOM", 0, "Random", "A random rule is selected for each boid"}, {eBoidRulesetType_Random, "RANDOM", 0, "Random", "A random rule is selected for each boid"},
{eBoidRulesetType_Average, "AVERAGE", 0, "Average", "All rules are averaged"}, {eBoidRulesetType_Average, "AVERAGE", 0, "Average", "All rules are averaged"},
@@ -76,7 +76,7 @@ EnumPropertyItem boidruleset_type_items[] ={
static void rna_Boids_reset(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) static void rna_Boids_reset(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{ {
if(ptr->type==&RNA_ParticleSystem) { if (ptr->type == &RNA_ParticleSystem) {
ParticleSystem *psys = (ParticleSystem*)ptr->data; ParticleSystem *psys = (ParticleSystem*)ptr->data;
psys->recalc = PSYS_RECALC_RESET; psys->recalc = PSYS_RECALC_RESET;
@@ -90,7 +90,7 @@ static void rna_Boids_reset(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRN
} }
static void rna_Boids_reset_deps(Main *bmain, Scene *scene, PointerRNA *ptr) static void rna_Boids_reset_deps(Main *bmain, Scene *scene, PointerRNA *ptr)
{ {
if(ptr->type==&RNA_ParticleSystem) { if (ptr->type == &RNA_ParticleSystem) {
ParticleSystem *psys = (ParticleSystem*)ptr->data; ParticleSystem *psys = (ParticleSystem*)ptr->data;
psys->recalc = PSYS_RECALC_RESET; psys->recalc = PSYS_RECALC_RESET;
@@ -107,9 +107,9 @@ static void rna_Boids_reset_deps(Main *bmain, Scene *scene, PointerRNA *ptr)
static StructRNA* rna_BoidRule_refine(struct PointerRNA *ptr) static StructRNA* rna_BoidRule_refine(struct PointerRNA *ptr)
{ {
BoidRule *rule= (BoidRule*)ptr->data; BoidRule *rule = (BoidRule*)ptr->data;
switch(rule->type) { switch (rule->type) {
case eBoidRuleType_Goal: case eBoidRuleType_Goal:
return &RNA_BoidRuleGoal; return &RNA_BoidRuleGoal;
case eBoidRuleType_Avoid: case eBoidRuleType_Avoid:
@@ -129,36 +129,36 @@ static StructRNA* rna_BoidRule_refine(struct PointerRNA *ptr)
static char *rna_BoidRule_path(PointerRNA *ptr) static char *rna_BoidRule_path(PointerRNA *ptr)
{ {
return BLI_sprintfN("rules[\"%s\"]", ((BoidRule*)ptr->data)->name); // XXX not unique return BLI_sprintfN("rules[\"%s\"]", ((BoidRule*)ptr->data)->name); /* XXX not unique */
} }
static PointerRNA rna_BoidState_active_boid_rule_get(PointerRNA *ptr) static PointerRNA rna_BoidState_active_boid_rule_get(PointerRNA *ptr)
{ {
BoidState *state= (BoidState*)ptr->data; BoidState *state = (BoidState*)ptr->data;
BoidRule *rule = (BoidRule*)state->rules.first; BoidRule *rule = (BoidRule*)state->rules.first;
for(; rule; rule=rule->next) { for (; rule; rule = rule->next) {
if(rule->flag & BOIDRULE_CURRENT) if (rule->flag & BOIDRULE_CURRENT)
return rna_pointer_inherit_refine(ptr, &RNA_BoidRule, rule); return rna_pointer_inherit_refine(ptr, &RNA_BoidRule, rule);
} }
return rna_pointer_inherit_refine(ptr, &RNA_BoidRule, NULL); return rna_pointer_inherit_refine(ptr, &RNA_BoidRule, NULL);
} }
static void rna_BoidState_active_boid_rule_index_range(PointerRNA *ptr, int *min, int *max) static void rna_BoidState_active_boid_rule_index_range(PointerRNA *ptr, int *min, int *max)
{ {
BoidState *state= (BoidState*)ptr->data; BoidState *state = (BoidState*)ptr->data;
*min= 0; *min = 0;
*max= BLI_countlist(&state->rules)-1; *max = BLI_countlist(&state->rules)-1;
*max= MAX2(0, *max); *max = MAX2(0, *max);
} }
static int rna_BoidState_active_boid_rule_index_get(PointerRNA *ptr) static int rna_BoidState_active_boid_rule_index_get(PointerRNA *ptr)
{ {
BoidState *state= (BoidState*)ptr->data; BoidState *state = (BoidState*)ptr->data;
BoidRule *rule = (BoidRule*)state->rules.first; BoidRule *rule = (BoidRule*)state->rules.first;
int i=0; int i = 0;
for(; rule; rule=rule->next, i++) { for (; rule; rule = rule->next, i++) {
if(rule->flag & BOIDRULE_CURRENT) if (rule->flag & BOIDRULE_CURRENT)
return i; return i;
} }
return 0; return 0;
@@ -166,12 +166,12 @@ static int rna_BoidState_active_boid_rule_index_get(PointerRNA *ptr)
static void rna_BoidState_active_boid_rule_index_set(struct PointerRNA *ptr, int value) static void rna_BoidState_active_boid_rule_index_set(struct PointerRNA *ptr, int value)
{ {
BoidState *state= (BoidState*)ptr->data; BoidState *state = (BoidState*)ptr->data;
BoidRule *rule = (BoidRule*)state->rules.first; BoidRule *rule = (BoidRule*)state->rules.first;
int i=0; int i = 0;
for(; rule; rule=rule->next, i++) { for (; rule; rule = rule->next, i++) {
if(i==value) if (i == value)
rule->flag |= BOIDRULE_CURRENT; rule->flag |= BOIDRULE_CURRENT;
else else
rule->flag &= ~BOIDRULE_CURRENT; rule->flag &= ~BOIDRULE_CURRENT;
@@ -180,7 +180,7 @@ static void rna_BoidState_active_boid_rule_index_set(struct PointerRNA *ptr, int
static int particle_id_check(PointerRNA *ptr) static int particle_id_check(PointerRNA *ptr)
{ {
ID *id= ptr->id.data; ID *id = ptr->id.data;
return (GS(id->name) == ID_PA); return (GS(id->name) == ID_PA);
} }
@@ -189,7 +189,7 @@ static char *rna_BoidSettings_path(PointerRNA *ptr)
{ {
BoidSettings *boids = (BoidSettings *)ptr->data; BoidSettings *boids = (BoidSettings *)ptr->data;
if(particle_id_check(ptr)) { if (particle_id_check(ptr)) {
ParticleSettings *part = (ParticleSettings*)ptr->id.data; ParticleSettings *part = (ParticleSettings*)ptr->id.data;
if (part->boids == boids) if (part->boids == boids)
@@ -200,31 +200,31 @@ static char *rna_BoidSettings_path(PointerRNA *ptr)
static PointerRNA rna_BoidSettings_active_boid_state_get(PointerRNA *ptr) static PointerRNA rna_BoidSettings_active_boid_state_get(PointerRNA *ptr)
{ {
BoidSettings *boids= (BoidSettings*)ptr->data; BoidSettings *boids = (BoidSettings*)ptr->data;
BoidState *state = (BoidState*)boids->states.first; BoidState *state = (BoidState*)boids->states.first;
for(; state; state=state->next) { for (; state; state = state->next) {
if(state->flag & BOIDSTATE_CURRENT) if (state->flag & BOIDSTATE_CURRENT)
return rna_pointer_inherit_refine(ptr, &RNA_BoidState, state); return rna_pointer_inherit_refine(ptr, &RNA_BoidState, state);
} }
return rna_pointer_inherit_refine(ptr, &RNA_BoidState, NULL); return rna_pointer_inherit_refine(ptr, &RNA_BoidState, NULL);
} }
static void rna_BoidSettings_active_boid_state_index_range(PointerRNA *ptr, int *min, int *max) static void rna_BoidSettings_active_boid_state_index_range(PointerRNA *ptr, int *min, int *max)
{ {
BoidSettings *boids= (BoidSettings*)ptr->data; BoidSettings *boids = (BoidSettings*)ptr->data;
*min= 0; *min = 0;
*max= BLI_countlist(&boids->states)-1; *max = BLI_countlist(&boids->states)-1;
*max= MAX2(0, *max); *max = MAX2(0, *max);
} }
static int rna_BoidSettings_active_boid_state_index_get(PointerRNA *ptr) static int rna_BoidSettings_active_boid_state_index_get(PointerRNA *ptr)
{ {
BoidSettings *boids= (BoidSettings*)ptr->data; BoidSettings *boids = (BoidSettings*)ptr->data;
BoidState *state = (BoidState*)boids->states.first; BoidState *state = (BoidState*)boids->states.first;
int i=0; int i = 0;
for(; state; state=state->next, i++) { for (; state; state = state->next, i++) {
if(state->flag & BOIDSTATE_CURRENT) if (state->flag & BOIDSTATE_CURRENT)
return i; return i;
} }
return 0; return 0;
@@ -232,12 +232,12 @@ static int rna_BoidSettings_active_boid_state_index_get(PointerRNA *ptr)
static void rna_BoidSettings_active_boid_state_index_set(struct PointerRNA *ptr, int value) static void rna_BoidSettings_active_boid_state_index_set(struct PointerRNA *ptr, int value)
{ {
BoidSettings *boids= (BoidSettings*)ptr->data; BoidSettings *boids = (BoidSettings*)ptr->data;
BoidState *state = (BoidState*)boids->states.first; BoidState *state = (BoidState*)boids->states.first;
int i=0; int i = 0;
for(; state; state=state->next, i++) { for (; state; state = state->next, i++) {
if(i==value) if (i == value)
state->flag |= BOIDSTATE_CURRENT; state->flag |= BOIDSTATE_CURRENT;
else else
state->flag &= ~BOIDSTATE_CURRENT; state->flag &= ~BOIDSTATE_CURRENT;
@@ -251,17 +251,17 @@ static void rna_def_boidrule_goal(BlenderRNA *brna)
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
srna= RNA_def_struct(brna, "BoidRuleGoal", "BoidRule"); srna = RNA_def_struct(brna, "BoidRuleGoal", "BoidRule");
RNA_def_struct_ui_text(srna, "Goal", ""); RNA_def_struct_ui_text(srna, "Goal", "");
RNA_def_struct_sdna(srna, "BoidRuleGoalAvoid"); RNA_def_struct_sdna(srna, "BoidRuleGoalAvoid");
prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "ob"); RNA_def_property_pointer_sdna(prop, NULL, "ob");
RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Object", "Goal object"); RNA_def_property_ui_text(prop, "Object", "Goal object");
RNA_def_property_update(prop, 0, "rna_Boids_reset_deps"); RNA_def_property_update(prop, 0, "rna_Boids_reset_deps");
prop= RNA_def_property(srna, "use_predict", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_predict", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "options", BRULE_GOAL_AVOID_PREDICT); RNA_def_property_boolean_sdna(prop, NULL, "options", BRULE_GOAL_AVOID_PREDICT);
RNA_def_property_ui_text(prop, "Predict", "Predict target movement"); RNA_def_property_ui_text(prop, "Predict", "Predict target movement");
RNA_def_property_update(prop, 0, "rna_Boids_reset"); RNA_def_property_update(prop, 0, "rna_Boids_reset");
@@ -272,22 +272,22 @@ static void rna_def_boidrule_avoid(BlenderRNA *brna)
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
srna= RNA_def_struct(brna, "BoidRuleAvoid", "BoidRule"); srna = RNA_def_struct(brna, "BoidRuleAvoid", "BoidRule");
RNA_def_struct_ui_text(srna, "Avoid", ""); RNA_def_struct_ui_text(srna, "Avoid", "");
RNA_def_struct_sdna(srna, "BoidRuleGoalAvoid"); RNA_def_struct_sdna(srna, "BoidRuleGoalAvoid");
prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "ob"); RNA_def_property_pointer_sdna(prop, NULL, "ob");
RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Object", "Object to avoid"); RNA_def_property_ui_text(prop, "Object", "Object to avoid");
RNA_def_property_update(prop, 0, "rna_Boids_reset_deps"); RNA_def_property_update(prop, 0, "rna_Boids_reset_deps");
prop= RNA_def_property(srna, "use_predict", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_predict", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "options", BRULE_GOAL_AVOID_PREDICT); RNA_def_property_boolean_sdna(prop, NULL, "options", BRULE_GOAL_AVOID_PREDICT);
RNA_def_property_ui_text(prop, "Predict", "Predict target movement"); RNA_def_property_ui_text(prop, "Predict", "Predict target movement");
RNA_def_property_update(prop, 0, "rna_Boids_reset"); RNA_def_property_update(prop, 0, "rna_Boids_reset");
prop= RNA_def_property(srna, "fear_factor", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "fear_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 100.0f); RNA_def_property_range(prop, 0.0f, 100.0f);
RNA_def_property_ui_text(prop, "Fear factor", "Avoid object if danger from it is above this threshold"); RNA_def_property_ui_text(prop, "Fear factor", "Avoid object if danger from it is above this threshold");
RNA_def_property_update(prop, 0, "rna_Boids_reset"); RNA_def_property_update(prop, 0, "rna_Boids_reset");
@@ -298,20 +298,20 @@ static void rna_def_boidrule_avoid_collision(BlenderRNA *brna)
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
srna= RNA_def_struct(brna, "BoidRuleAvoidCollision", "BoidRule"); srna = RNA_def_struct(brna, "BoidRuleAvoidCollision", "BoidRule");
RNA_def_struct_ui_text(srna, "Avoid Collision", ""); RNA_def_struct_ui_text(srna, "Avoid Collision", "");
prop= RNA_def_property(srna, "use_avoid", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_avoid", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "options", BRULE_ACOLL_WITH_BOIDS); RNA_def_property_boolean_sdna(prop, NULL, "options", BRULE_ACOLL_WITH_BOIDS);
RNA_def_property_ui_text(prop, "Boids", "Avoid collision with other boids"); RNA_def_property_ui_text(prop, "Boids", "Avoid collision with other boids");
RNA_def_property_update(prop, 0, "rna_Boids_reset"); RNA_def_property_update(prop, 0, "rna_Boids_reset");
prop= RNA_def_property(srna, "use_avoid_collision", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_avoid_collision", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "options", BRULE_ACOLL_WITH_DEFLECTORS); RNA_def_property_boolean_sdna(prop, NULL, "options", BRULE_ACOLL_WITH_DEFLECTORS);
RNA_def_property_ui_text(prop, "Deflectors", "Avoid collision with deflector objects"); RNA_def_property_ui_text(prop, "Deflectors", "Avoid collision with deflector objects");
RNA_def_property_update(prop, 0, "rna_Boids_reset"); RNA_def_property_update(prop, 0, "rna_Boids_reset");
prop= RNA_def_property(srna, "look_ahead", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "look_ahead", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 100.0f); RNA_def_property_range(prop, 0.0f, 100.0f);
RNA_def_property_ui_text(prop, "Look ahead", "Time to look ahead in seconds"); RNA_def_property_ui_text(prop, "Look ahead", "Time to look ahead in seconds");
RNA_def_property_update(prop, 0, "rna_Boids_reset"); RNA_def_property_update(prop, 0, "rna_Boids_reset");
@@ -322,27 +322,27 @@ static void rna_def_boidrule_follow_leader(BlenderRNA *brna)
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
srna= RNA_def_struct(brna, "BoidRuleFollowLeader", "BoidRule"); srna = RNA_def_struct(brna, "BoidRuleFollowLeader", "BoidRule");
RNA_def_struct_ui_text(srna, "Follow Leader", ""); RNA_def_struct_ui_text(srna, "Follow Leader", "");
prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "ob"); RNA_def_property_pointer_sdna(prop, NULL, "ob");
RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Object", "Follow this object instead of a boid"); RNA_def_property_ui_text(prop, "Object", "Follow this object instead of a boid");
RNA_def_property_update(prop, 0, "rna_Boids_reset_deps"); RNA_def_property_update(prop, 0, "rna_Boids_reset_deps");
prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "distance", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 100.0f); RNA_def_property_range(prop, 0.0f, 100.0f);
RNA_def_property_ui_text(prop, "Distance", "Distance behind leader to follow"); RNA_def_property_ui_text(prop, "Distance", "Distance behind leader to follow");
RNA_def_property_update(prop, 0, "rna_Boids_reset"); RNA_def_property_update(prop, 0, "rna_Boids_reset");
prop= RNA_def_property(srna, "queue_count", PROP_INT, PROP_NONE); prop = RNA_def_property(srna, "queue_count", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "queue_size"); RNA_def_property_int_sdna(prop, NULL, "queue_size");
RNA_def_property_range(prop, 0.0f, 100.0f); RNA_def_property_range(prop, 0.0f, 100.0f);
RNA_def_property_ui_text(prop, "Queue Size", "How many boids in a line"); RNA_def_property_ui_text(prop, "Queue Size", "How many boids in a line");
RNA_def_property_update(prop, 0, "rna_Boids_reset"); RNA_def_property_update(prop, 0, "rna_Boids_reset");
prop= RNA_def_property(srna, "use_line", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_line", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "options", BRULE_LEADER_IN_LINE); RNA_def_property_boolean_sdna(prop, NULL, "options", BRULE_LEADER_IN_LINE);
RNA_def_property_ui_text(prop, "Line", "Follow leader in a line"); RNA_def_property_ui_text(prop, "Line", "Follow leader in a line");
RNA_def_property_update(prop, 0, "rna_Boids_reset"); RNA_def_property_update(prop, 0, "rna_Boids_reset");
@@ -353,20 +353,20 @@ static void rna_def_boidrule_average_speed(BlenderRNA *brna)
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
srna= RNA_def_struct(brna, "BoidRuleAverageSpeed", "BoidRule"); srna = RNA_def_struct(brna, "BoidRuleAverageSpeed", "BoidRule");
RNA_def_struct_ui_text(srna, "Average Speed", ""); RNA_def_struct_ui_text(srna, "Average Speed", "");
prop= RNA_def_property(srna, "wander", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "wander", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Wander", "How fast velocity's direction is randomized"); RNA_def_property_ui_text(prop, "Wander", "How fast velocity's direction is randomized");
RNA_def_property_update(prop, 0, "rna_Boids_reset"); RNA_def_property_update(prop, 0, "rna_Boids_reset");
prop= RNA_def_property(srna, "level", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "level", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Level", "How much velocity's z-component is kept constant"); RNA_def_property_ui_text(prop, "Level", "How much velocity's z-component is kept constant");
RNA_def_property_update(prop, 0, "rna_Boids_reset"); RNA_def_property_update(prop, 0, "rna_Boids_reset");
prop= RNA_def_property(srna, "speed", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "speed", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Speed", "Percentage of maximum speed"); RNA_def_property_ui_text(prop, "Speed", "Percentage of maximum speed");
RNA_def_property_update(prop, 0, "rna_Boids_reset"); RNA_def_property_update(prop, 0, "rna_Boids_reset");
@@ -377,15 +377,15 @@ static void rna_def_boidrule_fight(BlenderRNA *brna)
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
srna= RNA_def_struct(brna, "BoidRuleFight", "BoidRule"); srna = RNA_def_struct(brna, "BoidRuleFight", "BoidRule");
RNA_def_struct_ui_text(srna, "Fight", ""); RNA_def_struct_ui_text(srna, "Fight", "");
prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "distance", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 100.0f); RNA_def_property_range(prop, 0.0f, 100.0f);
RNA_def_property_ui_text(prop, "Fight Distance", "Attack boids at max this distance"); RNA_def_property_ui_text(prop, "Fight Distance", "Attack boids at max this distance");
RNA_def_property_update(prop, 0, "rna_Boids_reset"); RNA_def_property_update(prop, 0, "rna_Boids_reset");
prop= RNA_def_property(srna, "flee_distance", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "flee_distance", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 100.0f); RNA_def_property_range(prop, 0.0f, 100.0f);
RNA_def_property_ui_text(prop, "Flee Distance", "Flee to this distance"); RNA_def_property_ui_text(prop, "Flee Distance", "Flee to this distance");
RNA_def_property_update(prop, 0, "rna_Boids_reset"); RNA_def_property_update(prop, 0, "rna_Boids_reset");
@@ -397,37 +397,37 @@ static void rna_def_boidrule(BlenderRNA *brna)
PropertyRNA *prop; PropertyRNA *prop;
/* data */ /* data */
srna= RNA_def_struct(brna, "BoidRule", NULL); srna = RNA_def_struct(brna, "BoidRule", NULL);
RNA_def_struct_ui_text(srna , "Boid Rule", ""); RNA_def_struct_ui_text(srna , "Boid Rule", "");
RNA_def_struct_refine_func(srna, "rna_BoidRule_refine"); RNA_def_struct_refine_func(srna, "rna_BoidRule_refine");
RNA_def_struct_path_func(srna, "rna_BoidRule_path"); RNA_def_struct_path_func(srna, "rna_BoidRule_path");
/* strings */ /* strings */
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Name", "Boid rule name"); RNA_def_property_ui_text(prop, "Name", "Boid rule name");
RNA_def_struct_name_property(srna, prop); RNA_def_struct_name_property(srna, prop);
/* enums */ /* enums */
prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_enum_sdna(prop, NULL, "type"); RNA_def_property_enum_sdna(prop, NULL, "type");
RNA_def_property_enum_items(prop, boidrule_type_items); RNA_def_property_enum_items(prop, boidrule_type_items);
RNA_def_property_ui_text(prop, "Type", ""); RNA_def_property_ui_text(prop, "Type", "");
/* flags */ /* flags */
prop= RNA_def_property(srna, "use_in_air", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_in_air", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BOIDRULE_IN_AIR); RNA_def_property_boolean_sdna(prop, NULL, "flag", BOIDRULE_IN_AIR);
RNA_def_property_ui_text(prop, "In Air", "Use rule when boid is flying"); RNA_def_property_ui_text(prop, "In Air", "Use rule when boid is flying");
RNA_def_property_update(prop, 0, "rna_Boids_reset"); RNA_def_property_update(prop, 0, "rna_Boids_reset");
prop= RNA_def_property(srna, "use_on_land", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_on_land", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BOIDRULE_ON_LAND); RNA_def_property_boolean_sdna(prop, NULL, "flag", BOIDRULE_ON_LAND);
RNA_def_property_ui_text(prop, "On Land", "Use rule when boid is on land"); RNA_def_property_ui_text(prop, "On Land", "Use rule when boid is on land");
RNA_def_property_update(prop, 0, "rna_Boids_reset"); RNA_def_property_update(prop, 0, "rna_Boids_reset");
//prop= RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE); /*prop= RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE); */
//RNA_def_property_boolean_sdna(prop, NULL, "mode", eModifierMode_Expanded); /*RNA_def_property_boolean_sdna(prop, NULL, "mode", eModifierMode_Expanded); */
//RNA_def_property_ui_text(prop, "Expanded", "Set modifier expanded in the user interface"); /*RNA_def_property_ui_text(prop, "Expanded", "Set modifier expanded in the user interface"); */
/* types */ /* types */
rna_def_boidrule_goal(brna); rna_def_boidrule_goal(brna);
@@ -446,39 +446,39 @@ static void rna_def_boidstate(BlenderRNA *brna)
srna = RNA_def_struct(brna, "BoidState", NULL); srna = RNA_def_struct(brna, "BoidState", NULL);
RNA_def_struct_ui_text(srna, "Boid State", "Boid state for boid physics"); RNA_def_struct_ui_text(srna, "Boid State", "Boid state for boid physics");
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Name", "Boid state name"); RNA_def_property_ui_text(prop, "Name", "Boid state name");
RNA_def_struct_name_property(srna, prop); RNA_def_struct_name_property(srna, prop);
prop= RNA_def_property(srna, "ruleset_type", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "ruleset_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, boidruleset_type_items); RNA_def_property_enum_items(prop, boidruleset_type_items);
RNA_def_property_ui_text(prop, "Rule Evaluation", "How the rules in the list are evaluated"); RNA_def_property_ui_text(prop, "Rule Evaluation", "How the rules in the list are evaluated");
prop= RNA_def_property(srna, "rules", PROP_COLLECTION, PROP_NONE); prop = RNA_def_property(srna, "rules", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "BoidRule"); RNA_def_property_struct_type(prop, "BoidRule");
RNA_def_property_ui_text(prop, "Boid Rules", ""); RNA_def_property_ui_text(prop, "Boid Rules", "");
prop= RNA_def_property(srna, "active_boid_rule", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "active_boid_rule", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "BoidRule"); RNA_def_property_struct_type(prop, "BoidRule");
RNA_def_property_pointer_funcs(prop, "rna_BoidState_active_boid_rule_get", NULL, NULL, NULL); RNA_def_property_pointer_funcs(prop, "rna_BoidState_active_boid_rule_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Active Boid Rule", ""); RNA_def_property_ui_text(prop, "Active Boid Rule", "");
prop= RNA_def_property(srna, "active_boid_rule_index", PROP_INT, PROP_UNSIGNED); prop = RNA_def_property(srna, "active_boid_rule_index", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_funcs(prop, "rna_BoidState_active_boid_rule_index_get", "rna_BoidState_active_boid_rule_index_set", "rna_BoidState_active_boid_rule_index_range"); RNA_def_property_int_funcs(prop, "rna_BoidState_active_boid_rule_index_get", "rna_BoidState_active_boid_rule_index_set", "rna_BoidState_active_boid_rule_index_range");
RNA_def_property_ui_text(prop, "Active Boid Rule Index", ""); RNA_def_property_ui_text(prop, "Active Boid Rule Index", "");
prop= RNA_def_property(srna, "rule_fuzzy", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "rule_fuzzy", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "rule_fuzziness"); RNA_def_property_float_sdna(prop, NULL, "rule_fuzziness");
RNA_def_property_range(prop, 0.0, 1.0); RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_ui_text(prop, "Rule Fuzziness", ""); RNA_def_property_ui_text(prop, "Rule Fuzziness", "");
RNA_def_property_update(prop, 0, "rna_Boids_reset"); RNA_def_property_update(prop, 0, "rna_Boids_reset");
prop= RNA_def_property(srna, "volume", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "volume", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0, 100.0); RNA_def_property_range(prop, 0.0, 100.0);
RNA_def_property_ui_text(prop, "Volume", ""); RNA_def_property_ui_text(prop, "Volume", "");
RNA_def_property_update(prop, 0, "rna_Boids_reset"); RNA_def_property_update(prop, 0, "rna_Boids_reset");
prop= RNA_def_property(srna, "falloff", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "falloff", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0, 10.0); RNA_def_property_range(prop, 0.0, 10.0);
RNA_def_property_ui_text(prop, "Falloff", ""); RNA_def_property_ui_text(prop, "Falloff", "");
RNA_def_property_update(prop, 0, "rna_Boids_reset"); RNA_def_property_update(prop, 0, "rna_Boids_reset");
@@ -492,144 +492,144 @@ static void rna_def_boid_settings(BlenderRNA *brna)
RNA_def_struct_path_func(srna, "rna_BoidSettings_path"); RNA_def_struct_path_func(srna, "rna_BoidSettings_path");
RNA_def_struct_ui_text(srna, "Boid Settings", "Settings for boid physics"); RNA_def_struct_ui_text(srna, "Boid Settings", "Settings for boid physics");
prop= RNA_def_property(srna, "land_smooth", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "land_smooth", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "landing_smoothness"); RNA_def_property_float_sdna(prop, NULL, "landing_smoothness");
RNA_def_property_range(prop, 0.0, 10.0); RNA_def_property_range(prop, 0.0, 10.0);
RNA_def_property_ui_text(prop, "Landing Smoothness", "How smoothly the boids land"); RNA_def_property_ui_text(prop, "Landing Smoothness", "How smoothly the boids land");
RNA_def_property_update(prop, 0, "rna_Boids_reset"); RNA_def_property_update(prop, 0, "rna_Boids_reset");
prop= RNA_def_property(srna, "bank", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "bank", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "banking"); RNA_def_property_float_sdna(prop, NULL, "banking");
RNA_def_property_range(prop, 0.0, 2.0); RNA_def_property_range(prop, 0.0, 2.0);
RNA_def_property_ui_text(prop, "Banking", "Amount of rotation around velocity vector on turns"); RNA_def_property_ui_text(prop, "Banking", "Amount of rotation around velocity vector on turns");
RNA_def_property_update(prop, 0, "rna_Boids_reset"); RNA_def_property_update(prop, 0, "rna_Boids_reset");
prop= RNA_def_property(srna, "pitch", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "pitch", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "pitch"); RNA_def_property_float_sdna(prop, NULL, "pitch");
RNA_def_property_range(prop, 0.0, 2.0); RNA_def_property_range(prop, 0.0, 2.0);
RNA_def_property_ui_text(prop, "Pitch", "Amount of rotation around side vector"); RNA_def_property_ui_text(prop, "Pitch", "Amount of rotation around side vector");
RNA_def_property_update(prop, 0, "rna_Boids_reset"); RNA_def_property_update(prop, 0, "rna_Boids_reset");
prop= RNA_def_property(srna, "height", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "height", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0, 2.0); RNA_def_property_range(prop, 0.0, 2.0);
RNA_def_property_ui_text(prop, "Height", "Boid height relative to particle size"); RNA_def_property_ui_text(prop, "Height", "Boid height relative to particle size");
RNA_def_property_update(prop, 0, "rna_Boids_reset"); RNA_def_property_update(prop, 0, "rna_Boids_reset");
/* states */ /* states */
prop= RNA_def_property(srna, "states", PROP_COLLECTION, PROP_NONE); prop = RNA_def_property(srna, "states", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "BoidState"); RNA_def_property_struct_type(prop, "BoidState");
RNA_def_property_ui_text(prop, "Boid States", ""); RNA_def_property_ui_text(prop, "Boid States", "");
prop= RNA_def_property(srna, "active_boid_state", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "active_boid_state", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "BoidRule"); RNA_def_property_struct_type(prop, "BoidRule");
RNA_def_property_pointer_funcs(prop, "rna_BoidSettings_active_boid_state_get", NULL, NULL, NULL); RNA_def_property_pointer_funcs(prop, "rna_BoidSettings_active_boid_state_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Active Boid Rule", ""); RNA_def_property_ui_text(prop, "Active Boid Rule", "");
prop= RNA_def_property(srna, "active_boid_state_index", PROP_INT, PROP_UNSIGNED); prop = RNA_def_property(srna, "active_boid_state_index", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_funcs(prop, "rna_BoidSettings_active_boid_state_index_get", "rna_BoidSettings_active_boid_state_index_set", "rna_BoidSettings_active_boid_state_index_range"); RNA_def_property_int_funcs(prop, "rna_BoidSettings_active_boid_state_index_get", "rna_BoidSettings_active_boid_state_index_set", "rna_BoidSettings_active_boid_state_index_range");
RNA_def_property_ui_text(prop, "Active Boid State Index", ""); RNA_def_property_ui_text(prop, "Active Boid State Index", "");
/* character properties */ /* character properties */
prop= RNA_def_property(srna, "health", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "health", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0, 100.0); RNA_def_property_range(prop, 0.0, 100.0);
RNA_def_property_ui_text(prop, "Health", "Initial boid health when born"); RNA_def_property_ui_text(prop, "Health", "Initial boid health when born");
RNA_def_property_update(prop, 0, "rna_Boids_reset"); RNA_def_property_update(prop, 0, "rna_Boids_reset");
prop= RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0, 100.0); RNA_def_property_range(prop, 0.0, 100.0);
RNA_def_property_ui_text(prop, "Strength", "Maximum caused damage on attack per second"); RNA_def_property_ui_text(prop, "Strength", "Maximum caused damage on attack per second");
RNA_def_property_update(prop, 0, "rna_Boids_reset"); RNA_def_property_update(prop, 0, "rna_Boids_reset");
prop= RNA_def_property(srna, "aggression", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "aggression", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0, 100.0); RNA_def_property_range(prop, 0.0, 100.0);
RNA_def_property_ui_text(prop, "Aggression", "Boid will fight this times stronger enemy"); RNA_def_property_ui_text(prop, "Aggression", "Boid will fight this times stronger enemy");
RNA_def_property_update(prop, 0, "rna_Boids_reset"); RNA_def_property_update(prop, 0, "rna_Boids_reset");
prop= RNA_def_property(srna, "accuracy", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "accuracy", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0, 1.0); RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_ui_text(prop, "Accuracy", "Accuracy of attack"); RNA_def_property_ui_text(prop, "Accuracy", "Accuracy of attack");
RNA_def_property_update(prop, 0, "rna_Boids_reset"); RNA_def_property_update(prop, 0, "rna_Boids_reset");
prop= RNA_def_property(srna, "range", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "range", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0, 100.0); RNA_def_property_range(prop, 0.0, 100.0);
RNA_def_property_ui_text(prop, "Range", "Maximum distance from which a boid can attack"); RNA_def_property_ui_text(prop, "Range", "Maximum distance from which a boid can attack");
RNA_def_property_update(prop, 0, "rna_Boids_reset"); RNA_def_property_update(prop, 0, "rna_Boids_reset");
/* physical properties */ /* physical properties */
prop= RNA_def_property(srna, "air_speed_min", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "air_speed_min", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "air_min_speed"); RNA_def_property_float_sdna(prop, NULL, "air_min_speed");
RNA_def_property_range(prop, 0.0, 1.0); RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_ui_text(prop, "Min Air Speed", "Minimum speed in air (relative to maximum speed)"); RNA_def_property_ui_text(prop, "Min Air Speed", "Minimum speed in air (relative to maximum speed)");
RNA_def_property_update(prop, 0, "rna_Boids_reset"); RNA_def_property_update(prop, 0, "rna_Boids_reset");
prop= RNA_def_property(srna, "air_speed_max", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "air_speed_max", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "air_max_speed"); RNA_def_property_float_sdna(prop, NULL, "air_max_speed");
RNA_def_property_range(prop, 0.0, 100.0); RNA_def_property_range(prop, 0.0, 100.0);
RNA_def_property_ui_text(prop, "Max Air Speed", "Maximum speed in air"); RNA_def_property_ui_text(prop, "Max Air Speed", "Maximum speed in air");
RNA_def_property_update(prop, 0, "rna_Boids_reset"); RNA_def_property_update(prop, 0, "rna_Boids_reset");
prop= RNA_def_property(srna, "air_acc_max", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "air_acc_max", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "air_max_acc"); RNA_def_property_float_sdna(prop, NULL, "air_max_acc");
RNA_def_property_range(prop, 0.0, 1.0); RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_ui_text(prop, "Max Air Acceleration", "Maximum acceleration in air (relative to maximum speed)"); RNA_def_property_ui_text(prop, "Max Air Acceleration", "Maximum acceleration in air (relative to maximum speed)");
RNA_def_property_update(prop, 0, "rna_Boids_reset"); RNA_def_property_update(prop, 0, "rna_Boids_reset");
prop= RNA_def_property(srna, "air_ave_max", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "air_ave_max", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "air_max_ave"); RNA_def_property_float_sdna(prop, NULL, "air_max_ave");
RNA_def_property_range(prop, 0.0, 1.0); RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_ui_text(prop, "Max Air Angular Velocity", "Maximum angular velocity in air (relative to 180 degrees)"); RNA_def_property_ui_text(prop, "Max Air Angular Velocity", "Maximum angular velocity in air (relative to 180 degrees)");
RNA_def_property_update(prop, 0, "rna_Boids_reset"); RNA_def_property_update(prop, 0, "rna_Boids_reset");
prop= RNA_def_property(srna, "air_personal_space", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "air_personal_space", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0, 10.0); RNA_def_property_range(prop, 0.0, 10.0);
RNA_def_property_ui_text(prop, "Air Personal Space", "Radius of boids personal space in air (% of particle size)"); RNA_def_property_ui_text(prop, "Air Personal Space", "Radius of boids personal space in air (% of particle size)");
RNA_def_property_update(prop, 0, "rna_Boids_reset"); RNA_def_property_update(prop, 0, "rna_Boids_reset");
prop= RNA_def_property(srna, "land_jump_speed", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "land_jump_speed", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0, 100.0); RNA_def_property_range(prop, 0.0, 100.0);
RNA_def_property_ui_text(prop, "Jump Speed", "Maximum speed for jumping"); RNA_def_property_ui_text(prop, "Jump Speed", "Maximum speed for jumping");
RNA_def_property_update(prop, 0, "rna_Boids_reset"); RNA_def_property_update(prop, 0, "rna_Boids_reset");
prop= RNA_def_property(srna, "land_speed_max", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "land_speed_max", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "land_max_speed"); RNA_def_property_float_sdna(prop, NULL, "land_max_speed");
RNA_def_property_range(prop, 0.0, 100.0); RNA_def_property_range(prop, 0.0, 100.0);
RNA_def_property_ui_text(prop, "Max Land Speed", "Maximum speed on land"); RNA_def_property_ui_text(prop, "Max Land Speed", "Maximum speed on land");
RNA_def_property_update(prop, 0, "rna_Boids_reset"); RNA_def_property_update(prop, 0, "rna_Boids_reset");
prop= RNA_def_property(srna, "land_acc_max", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "land_acc_max", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "land_max_acc"); RNA_def_property_float_sdna(prop, NULL, "land_max_acc");
RNA_def_property_range(prop, 0.0, 1.0); RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_ui_text(prop, "Max Land Acceleration", "Maximum acceleration on land (relative to maximum speed)"); RNA_def_property_ui_text(prop, "Max Land Acceleration", "Maximum acceleration on land (relative to maximum speed)");
RNA_def_property_update(prop, 0, "rna_Boids_reset"); RNA_def_property_update(prop, 0, "rna_Boids_reset");
prop= RNA_def_property(srna, "land_ave_max", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "land_ave_max", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "land_max_ave"); RNA_def_property_float_sdna(prop, NULL, "land_max_ave");
RNA_def_property_range(prop, 0.0, 1.0); RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_ui_text(prop, "Max Land Angular Velocity", "Maximum angular velocity on land (relative to 180 degrees)"); RNA_def_property_ui_text(prop, "Max Land Angular Velocity", "Maximum angular velocity on land (relative to 180 degrees)");
RNA_def_property_update(prop, 0, "rna_Boids_reset"); RNA_def_property_update(prop, 0, "rna_Boids_reset");
prop= RNA_def_property(srna, "land_personal_space", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "land_personal_space", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0, 10.0); RNA_def_property_range(prop, 0.0, 10.0);
RNA_def_property_ui_text(prop, "Land Personal Space", "Radius of boids personal space on land (% of particle size)"); RNA_def_property_ui_text(prop, "Land Personal Space", "Radius of boids personal space on land (% of particle size)");
RNA_def_property_update(prop, 0, "rna_Boids_reset"); RNA_def_property_update(prop, 0, "rna_Boids_reset");
prop= RNA_def_property(srna, "land_stick_force", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "land_stick_force", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0, 1000.0); RNA_def_property_range(prop, 0.0, 1000.0);
RNA_def_property_ui_text(prop, "Land Stick Force", "How strong a force must be to start effecting a boid on land"); RNA_def_property_ui_text(prop, "Land Stick Force", "How strong a force must be to start effecting a boid on land");
RNA_def_property_update(prop, 0, "rna_Boids_reset"); RNA_def_property_update(prop, 0, "rna_Boids_reset");
/* options */ /* options */
prop= RNA_def_property(srna, "use_flight", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_flight", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "options", BOID_ALLOW_FLIGHT); RNA_def_property_boolean_sdna(prop, NULL, "options", BOID_ALLOW_FLIGHT);
RNA_def_property_ui_text(prop, "Allow Flight", "Allow boids to move in air"); RNA_def_property_ui_text(prop, "Allow Flight", "Allow boids to move in air");
RNA_def_property_update(prop, 0, "rna_Boids_reset"); RNA_def_property_update(prop, 0, "rna_Boids_reset");
prop= RNA_def_property(srna, "use_land", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_land", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "options", BOID_ALLOW_LAND); RNA_def_property_boolean_sdna(prop, NULL, "options", BOID_ALLOW_LAND);
RNA_def_property_ui_text(prop, "Allow Land", "Allow boids to move on land"); RNA_def_property_ui_text(prop, "Allow Land", "Allow boids to move on land");
RNA_def_property_update(prop, 0, "rna_Boids_reset"); RNA_def_property_update(prop, 0, "rna_Boids_reset");
prop= RNA_def_property(srna, "use_climb", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_climb", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "options", BOID_ALLOW_CLIMB); RNA_def_property_boolean_sdna(prop, NULL, "options", BOID_ALLOW_CLIMB);
RNA_def_property_ui_text(prop, "Allow Climbing", "Allow boids to climb goal objects"); RNA_def_property_ui_text(prop, "Allow Climbing", "Allow boids to climb goal objects");
RNA_def_property_update(prop, 0, "rna_Boids_reset"); RNA_def_property_update(prop, 0, "rna_Boids_reset");

View File

@@ -43,7 +43,7 @@
#include "WM_types.h" #include "WM_types.h"
static EnumPropertyItem prop_direction_items[]= { static EnumPropertyItem prop_direction_items[] = {
{0, "ADD", 0, "Add", "Add effect of brush"}, {0, "ADD", 0, "Add", "Add effect of brush"},
{BRUSH_DIR_IN, "SUBTRACT", 0, "Subtract", "Subtract effect of brush"}, {BRUSH_DIR_IN, "SUBTRACT", 0, "Subtract", "Subtract effect of brush"},
{0, NULL, 0, NULL, NULL}}; {0, NULL, 0, NULL, NULL}};
@@ -104,10 +104,10 @@ static void rna_Brush_reset_icon(Brush *br, const char *UNUSED(type))
{ {
ID *id = &br->id; ID *id = &br->id;
if(br->flag & BRUSH_CUSTOM_ICON) if (br->flag & BRUSH_CUSTOM_ICON)
return; return;
if(id->icon_id >= BIFICONID_LAST) { if (id->icon_id >= BIFICONID_LAST) {
BKE_icon_delete(id); BKE_icon_delete(id);
BKE_previewimg_free_id(id); BKE_previewimg_free_id(id);
} }
@@ -117,44 +117,44 @@ static void rna_Brush_reset_icon(Brush *br, const char *UNUSED(type))
static void rna_Brush_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) static void rna_Brush_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{ {
Brush *br= (Brush*)ptr->data; Brush *br = (Brush*)ptr->data;
WM_main_add_notifier(NC_BRUSH|NA_EDITED, br); WM_main_add_notifier(NC_BRUSH|NA_EDITED, br);
//WM_main_add_notifier(NC_SPACE|ND_SPACE_VIEW3D, NULL); /*WM_main_add_notifier(NC_SPACE|ND_SPACE_VIEW3D, NULL); */
} }
static void rna_Brush_sculpt_tool_update(Main *bmain, Scene *scene, PointerRNA *ptr) static void rna_Brush_sculpt_tool_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{ {
Brush *br= (Brush*)ptr->data; Brush *br = (Brush*)ptr->data;
rna_Brush_reset_icon(br, "sculpt"); rna_Brush_reset_icon(br, "sculpt");
rna_Brush_update(bmain, scene, ptr); rna_Brush_update(bmain, scene, ptr);
} }
static void rna_Brush_vertex_tool_update(Main *bmain, Scene *scene, PointerRNA *ptr) static void rna_Brush_vertex_tool_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{ {
Brush *br= (Brush*)ptr->data; Brush *br = (Brush*)ptr->data;
rna_Brush_reset_icon(br, "vertex_paint"); rna_Brush_reset_icon(br, "vertex_paint");
rna_Brush_update(bmain, scene, ptr); rna_Brush_update(bmain, scene, ptr);
} }
static void rna_Brush_imagepaint_tool_update(Main *bmain, Scene *scene, PointerRNA *ptr) static void rna_Brush_imagepaint_tool_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{ {
Brush *br= (Brush*)ptr->data; Brush *br = (Brush*)ptr->data;
rna_Brush_reset_icon(br, "image_paint"); rna_Brush_reset_icon(br, "image_paint");
rna_Brush_update(bmain, scene, ptr); rna_Brush_update(bmain, scene, ptr);
} }
static void rna_Brush_icon_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) static void rna_Brush_icon_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{ {
Brush *br= (Brush*)ptr->data; Brush *br = (Brush*)ptr->data;
if(br->icon_imbuf) { if (br->icon_imbuf) {
IMB_freeImBuf(br->icon_imbuf); IMB_freeImBuf(br->icon_imbuf);
br->icon_imbuf= NULL; br->icon_imbuf = NULL;
} }
br->id.icon_id = 0; br->id.icon_id = 0;
if(br->flag & BRUSH_CUSTOM_ICON) { if (br->flag & BRUSH_CUSTOM_ICON) {
BKE_previewimg_get(&br->id); BKE_previewimg_get(&br->id);
BKE_icon_changed(BKE_icon_getid(&br->id)); BKE_icon_changed(BKE_icon_getid(&br->id));
} }
@@ -169,7 +169,7 @@ static void rna_Brush_set_size(PointerRNA *ptr, int value)
/* scale unprojected radius so it stays consistent with brush size */ /* scale unprojected radius so it stays consistent with brush size */
brush_scale_unprojected_radius(&brush->unprojected_radius, brush_scale_unprojected_radius(&brush->unprojected_radius,
value, brush->size); value, brush->size);
brush->size= value; brush->size = value;
} }
static void rna_Brush_set_unprojected_radius(PointerRNA *ptr, float value) static void rna_Brush_set_unprojected_radius(PointerRNA *ptr, float value)
@@ -178,40 +178,40 @@ static void rna_Brush_set_unprojected_radius(PointerRNA *ptr, float value)
/* scale brush size so it stays consistent with unprojected_radius */ /* scale brush size so it stays consistent with unprojected_radius */
brush_scale_size(&brush->size, value, brush->unprojected_radius); brush_scale_size(&brush->size, value, brush->unprojected_radius);
brush->unprojected_radius= value; brush->unprojected_radius = value;
} }
static EnumPropertyItem *rna_Brush_direction_itemf(bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *UNUSED(free)) static EnumPropertyItem *rna_Brush_direction_itemf(bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *UNUSED(free))
{ {
static EnumPropertyItem prop_default_items[]= { static EnumPropertyItem prop_default_items[] = {
{0, NULL, 0, NULL, NULL}}; {0, NULL, 0, NULL, NULL}};
static EnumPropertyItem prop_flatten_contrast_items[]= { static EnumPropertyItem prop_flatten_contrast_items[] = {
{0, "FLATTEN", 0, "Flatten", "Add effect of brush"}, {0, "FLATTEN", 0, "Flatten", "Add effect of brush"},
{BRUSH_DIR_IN, "CONTRAST", 0, "Contrast", "Subtract effect of brush"}, {BRUSH_DIR_IN, "CONTRAST", 0, "Contrast", "Subtract effect of brush"},
{0, NULL, 0, NULL, NULL}}; {0, NULL, 0, NULL, NULL}};
static EnumPropertyItem prop_fill_deepen_items[]= { static EnumPropertyItem prop_fill_deepen_items[] = {
{0, "FILL", 0, "Fill", "Add effect of brush"}, {0, "FILL", 0, "Fill", "Add effect of brush"},
{BRUSH_DIR_IN, "DEEPEN", 0, "Deepen", "Subtract effect of brush"}, {BRUSH_DIR_IN, "DEEPEN", 0, "Deepen", "Subtract effect of brush"},
{0, NULL, 0, NULL, NULL}}; {0, NULL, 0, NULL, NULL}};
static EnumPropertyItem prop_scrape_peaks_items[]= { static EnumPropertyItem prop_scrape_peaks_items[] = {
{0, "SCRAPE", 0, "Scrape", "Add effect of brush"}, {0, "SCRAPE", 0, "Scrape", "Add effect of brush"},
{BRUSH_DIR_IN, "PEAKS", 0, "Peaks", "Subtract effect of brush"}, {BRUSH_DIR_IN, "PEAKS", 0, "Peaks", "Subtract effect of brush"},
{0, NULL, 0, NULL, NULL}}; {0, NULL, 0, NULL, NULL}};
static EnumPropertyItem prop_pinch_magnify_items[]= { static EnumPropertyItem prop_pinch_magnify_items[] = {
{0, "PINCH", 0, "Pinch", "Add effect of brush"}, {0, "PINCH", 0, "Pinch", "Add effect of brush"},
{BRUSH_DIR_IN, "MAGNIFY", 0, "Magnify", "Subtract effect of brush"}, {BRUSH_DIR_IN, "MAGNIFY", 0, "Magnify", "Subtract effect of brush"},
{0, NULL, 0, NULL, NULL}}; {0, NULL, 0, NULL, NULL}};
static EnumPropertyItem prop_inflate_deflate_items[]= { static EnumPropertyItem prop_inflate_deflate_items[] = {
{0, "INFLATE", 0, "Inflate", "Add effect of brush"}, {0, "INFLATE", 0, "Inflate", "Add effect of brush"},
{BRUSH_DIR_IN, "DEFLATE", 0, "Deflate", "Subtract effect of brush"}, {BRUSH_DIR_IN, "DEFLATE", 0, "Deflate", "Subtract effect of brush"},
{0, NULL, 0, NULL, NULL}}; {0, NULL, 0, NULL, NULL}};
Brush *me= (Brush*)(ptr->data); Brush *me = (Brush*)(ptr->data);
switch (me->sculpt_tool) { switch (me->sculpt_tool) {
case SCULPT_TOOL_DRAW: case SCULPT_TOOL_DRAW:
@@ -254,17 +254,17 @@ static void rna_def_brush_texture_slot(BlenderRNA *brna)
{MTEX_MAP_MODE_3D, "3D", 0, "3D", ""}, {MTEX_MAP_MODE_3D, "3D", 0, "3D", ""},
{0, NULL, 0, NULL, NULL}}; {0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "BrushTextureSlot", "TextureSlot"); srna = RNA_def_struct(brna, "BrushTextureSlot", "TextureSlot");
RNA_def_struct_sdna(srna, "MTex"); RNA_def_struct_sdna(srna, "MTex");
RNA_def_struct_ui_text(srna, "Brush Texture Slot", "Texture slot for textures in a Brush datablock"); RNA_def_struct_ui_text(srna, "Brush Texture Slot", "Texture slot for textures in a Brush datablock");
prop= RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE); prop = RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "rot"); RNA_def_property_float_sdna(prop, NULL, "rot");
RNA_def_property_range(prop, 0, M_PI*2); RNA_def_property_range(prop, 0, M_PI*2);
RNA_def_property_ui_text(prop, "Angle", "Brush texture rotation"); RNA_def_property_ui_text(prop, "Angle", "Brush texture rotation");
RNA_def_property_update(prop, 0, "rna_TextureSlot_update"); RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
prop= RNA_def_property(srna, "map_mode", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "map_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "brush_map_mode"); RNA_def_property_enum_sdna(prop, NULL, "brush_map_mode");
RNA_def_property_enum_items(prop, prop_map_mode_items); RNA_def_property_enum_items(prop, prop_map_mode_items);
RNA_def_property_ui_text(prop, "Mode", ""); RNA_def_property_ui_text(prop, "Mode", "");
@@ -314,115 +314,115 @@ static void rna_def_brush(BlenderRNA *brna)
{SCULPT_DISP_DIR_Z, "Z", 0, "Z Plane", ""}, {SCULPT_DISP_DIR_Z, "Z", 0, "Z Plane", ""},
{0, NULL, 0, NULL, NULL}}; {0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "Brush", "ID"); srna = RNA_def_struct(brna, "Brush", "ID");
RNA_def_struct_ui_text(srna, "Brush", "Brush datablock for storing brush settings for painting and sculpting"); RNA_def_struct_ui_text(srna, "Brush", "Brush datablock for storing brush settings for painting and sculpting");
RNA_def_struct_ui_icon(srna, ICON_BRUSH_DATA); RNA_def_struct_ui_icon(srna, ICON_BRUSH_DATA);
/* enums */ /* enums */
prop= RNA_def_property(srna, "blend", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "blend", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, prop_blend_items); RNA_def_property_enum_items(prop, prop_blend_items);
RNA_def_property_ui_text(prop, "Blending mode", "Brush blending mode"); RNA_def_property_ui_text(prop, "Blending mode", "Brush blending mode");
RNA_def_property_update(prop, 0, "rna_Brush_update"); RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "sculpt_tool", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "sculpt_tool", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, brush_sculpt_tool_items); RNA_def_property_enum_items(prop, brush_sculpt_tool_items);
RNA_def_property_ui_text(prop, "Sculpt Tool", ""); RNA_def_property_ui_text(prop, "Sculpt Tool", "");
RNA_def_property_update(prop, 0, "rna_Brush_sculpt_tool_update"); RNA_def_property_update(prop, 0, "rna_Brush_sculpt_tool_update");
prop= RNA_def_property(srna, "vertex_tool", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "vertex_tool", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "vertexpaint_tool"); RNA_def_property_enum_sdna(prop, NULL, "vertexpaint_tool");
RNA_def_property_enum_items(prop, brush_vertex_tool_items); RNA_def_property_enum_items(prop, brush_vertex_tool_items);
RNA_def_property_ui_text(prop, "Vertex/Weight Paint Tool", ""); RNA_def_property_ui_text(prop, "Vertex/Weight Paint Tool", "");
RNA_def_property_update(prop, 0, "rna_Brush_vertex_tool_update"); RNA_def_property_update(prop, 0, "rna_Brush_vertex_tool_update");
prop= RNA_def_property(srna, "image_tool", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "image_tool", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "imagepaint_tool"); RNA_def_property_enum_sdna(prop, NULL, "imagepaint_tool");
RNA_def_property_enum_items(prop, brush_image_tool_items); RNA_def_property_enum_items(prop, brush_image_tool_items);
RNA_def_property_ui_text(prop, "Image Paint Tool", ""); RNA_def_property_ui_text(prop, "Image Paint Tool", "");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, "rna_Brush_imagepaint_tool_update"); RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, "rna_Brush_imagepaint_tool_update");
prop= RNA_def_property(srna, "direction", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "direction", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
RNA_def_property_enum_items(prop, prop_direction_items); RNA_def_property_enum_items(prop, prop_direction_items);
RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Brush_direction_itemf"); RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Brush_direction_itemf");
RNA_def_property_ui_text(prop, "Direction", ""); RNA_def_property_ui_text(prop, "Direction", "");
RNA_def_property_update(prop, 0, "rna_Brush_update"); RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "stroke_method", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "stroke_method", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
RNA_def_property_enum_items(prop, brush_stroke_method_items); RNA_def_property_enum_items(prop, brush_stroke_method_items);
RNA_def_property_ui_text(prop, "Stroke Method", ""); RNA_def_property_ui_text(prop, "Stroke Method", "");
RNA_def_property_update(prop, 0, "rna_Brush_update"); RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "texture_angle_source_random", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "texture_angle_source_random", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
RNA_def_property_enum_items(prop, texture_angle_source_items); RNA_def_property_enum_items(prop, texture_angle_source_items);
RNA_def_property_ui_text(prop, "Texture Angle Source", ""); RNA_def_property_ui_text(prop, "Texture Angle Source", "");
RNA_def_property_update(prop, 0, "rna_Brush_update"); RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "texture_angle_source_no_random", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "texture_angle_source_no_random", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
RNA_def_property_enum_items(prop, texture_angle_source_no_random_items); RNA_def_property_enum_items(prop, texture_angle_source_no_random_items);
RNA_def_property_ui_text(prop, "Texture Angle Source", ""); RNA_def_property_ui_text(prop, "Texture Angle Source", "");
RNA_def_property_update(prop, 0, "rna_Brush_update"); RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "sculpt_plane", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "sculpt_plane", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, brush_sculpt_plane_items); RNA_def_property_enum_items(prop, brush_sculpt_plane_items);
RNA_def_property_ui_text(prop, "Sculpt Plane", ""); RNA_def_property_ui_text(prop, "Sculpt Plane", "");
RNA_def_property_update(prop, 0, "rna_Brush_update"); RNA_def_property_update(prop, 0, "rna_Brush_update");
/* number values */ /* number values */
prop= RNA_def_property(srna, "size", PROP_INT, PROP_DISTANCE); prop = RNA_def_property(srna, "size", PROP_INT, PROP_DISTANCE);
RNA_def_property_int_funcs(prop, NULL, "rna_Brush_set_size", NULL); RNA_def_property_int_funcs(prop, NULL, "rna_Brush_set_size", NULL);
RNA_def_property_range(prop, 1, MAX_BRUSH_PIXEL_RADIUS*10); RNA_def_property_range(prop, 1, MAX_BRUSH_PIXEL_RADIUS*10);
RNA_def_property_ui_range(prop, 1, MAX_BRUSH_PIXEL_RADIUS, 1, 0); RNA_def_property_ui_range(prop, 1, MAX_BRUSH_PIXEL_RADIUS, 1, 0);
RNA_def_property_ui_text(prop, "Radius", "Radius of the brush in pixels"); RNA_def_property_ui_text(prop, "Radius", "Radius of the brush in pixels");
RNA_def_property_update(prop, 0, "rna_Brush_update"); RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "unprojected_radius", PROP_FLOAT, PROP_DISTANCE); prop = RNA_def_property(srna, "unprojected_radius", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_funcs(prop, NULL, "rna_Brush_set_unprojected_radius", NULL); RNA_def_property_float_funcs(prop, NULL, "rna_Brush_set_unprojected_radius", NULL);
RNA_def_property_range(prop, 0.001, FLT_MAX); RNA_def_property_range(prop, 0.001, FLT_MAX);
RNA_def_property_ui_range(prop, 0.001, 1, 0, 0); RNA_def_property_ui_range(prop, 0.001, 1, 0, 0);
RNA_def_property_ui_text(prop, "Unprojected Radius", "Radius of brush in Blender units"); RNA_def_property_ui_text(prop, "Unprojected Radius", "Radius of brush in Blender units");
RNA_def_property_update(prop, 0, "rna_Brush_update"); RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "jitter", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "jitter", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "jitter"); RNA_def_property_float_sdna(prop, NULL, "jitter");
RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Jitter", "Jitter the position of the brush while painting"); RNA_def_property_ui_text(prop, "Jitter", "Jitter the position of the brush while painting");
RNA_def_property_update(prop, 0, "rna_Brush_update"); RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "spacing", PROP_INT, PROP_PERCENTAGE); prop = RNA_def_property(srna, "spacing", PROP_INT, PROP_PERCENTAGE);
RNA_def_property_int_sdna(prop, NULL, "spacing"); RNA_def_property_int_sdna(prop, NULL, "spacing");
RNA_def_property_range(prop, 1, 1000); RNA_def_property_range(prop, 1, 1000);
RNA_def_property_ui_range(prop, 1, 500, 5, 0); RNA_def_property_ui_range(prop, 1, 500, 5, 0);
RNA_def_property_ui_text(prop, "Spacing", "Spacing between brush daubs as a percentage of brush diameter"); RNA_def_property_ui_text(prop, "Spacing", "Spacing between brush daubs as a percentage of brush diameter");
RNA_def_property_update(prop, 0, "rna_Brush_update"); RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "smooth_stroke_radius", PROP_INT, PROP_DISTANCE); prop = RNA_def_property(srna, "smooth_stroke_radius", PROP_INT, PROP_DISTANCE);
RNA_def_property_range(prop, 10, 200); RNA_def_property_range(prop, 10, 200);
RNA_def_property_ui_text(prop, "Smooth Stroke Radius", "Minimum distance from last point before stroke continues"); RNA_def_property_ui_text(prop, "Smooth Stroke Radius", "Minimum distance from last point before stroke continues");
RNA_def_property_update(prop, 0, "rna_Brush_update"); RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "smooth_stroke_factor", PROP_FLOAT, PROP_FACTOR); prop = RNA_def_property(srna, "smooth_stroke_factor", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_range(prop, 0.5, 0.99); RNA_def_property_range(prop, 0.5, 0.99);
RNA_def_property_ui_text(prop, "Smooth Stroke Factor", "Higher values give a smoother stroke"); RNA_def_property_ui_text(prop, "Smooth Stroke Factor", "Higher values give a smoother stroke");
RNA_def_property_update(prop, 0, "rna_Brush_update"); RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "rate", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "rate", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "rate"); RNA_def_property_float_sdna(prop, NULL, "rate");
RNA_def_property_range(prop, 0.0001f , 10000.0f); RNA_def_property_range(prop, 0.0001f , 10000.0f);
RNA_def_property_ui_range(prop, 0.01f, 1.0f, 1, 3); RNA_def_property_ui_range(prop, 0.01f, 1.0f, 1, 3);
RNA_def_property_ui_text(prop, "Rate", "Interval between paints for Airbrush"); RNA_def_property_ui_text(prop, "Rate", "Interval between paints for Airbrush");
RNA_def_property_update(prop, 0, "rna_Brush_update"); RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR_GAMMA); prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_range(prop, 0.0, 1.0); RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_float_sdna(prop, NULL, "rgb"); RNA_def_property_float_sdna(prop, NULL, "rgb");
RNA_def_property_ui_text(prop, "Color", ""); RNA_def_property_ui_text(prop, "Color", "");
RNA_def_property_update(prop, 0, "rna_Brush_update"); RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "strength", PROP_FLOAT, PROP_FACTOR); prop = RNA_def_property(srna, "strength", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "alpha"); RNA_def_property_float_sdna(prop, NULL, "alpha");
RNA_def_property_float_default(prop, 0.5f); RNA_def_property_float_default(prop, 0.5f);
RNA_def_property_range(prop, 0.0f, 10.0f); RNA_def_property_range(prop, 0.0f, 10.0f);
@@ -430,7 +430,7 @@ static void rna_def_brush(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Strength", "How powerful the effect of the brush is when applied"); RNA_def_property_ui_text(prop, "Strength", "How powerful the effect of the brush is when applied");
RNA_def_property_update(prop, 0, "rna_Brush_update"); RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "plane_offset", PROP_FLOAT, PROP_DISTANCE); prop = RNA_def_property(srna, "plane_offset", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "plane_offset"); RNA_def_property_float_sdna(prop, NULL, "plane_offset");
RNA_def_property_float_default(prop, 0); RNA_def_property_float_default(prop, 0);
RNA_def_property_range(prop, -2.0f, 2.0f); RNA_def_property_range(prop, -2.0f, 2.0f);
@@ -438,42 +438,42 @@ static void rna_def_brush(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Plane Offset", "Adjust plane on which the brush acts towards or away from the object surface"); RNA_def_property_ui_text(prop, "Plane Offset", "Adjust plane on which the brush acts towards or away from the object surface");
RNA_def_property_update(prop, 0, "rna_Brush_update"); RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "plane_trim", PROP_FLOAT, PROP_DISTANCE); prop = RNA_def_property(srna, "plane_trim", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "plane_trim"); RNA_def_property_float_sdna(prop, NULL, "plane_trim");
RNA_def_property_float_default(prop, 0.5f); RNA_def_property_float_default(prop, 0.5f);
RNA_def_property_range(prop, 0, 1.0f); RNA_def_property_range(prop, 0, 1.0f);
RNA_def_property_ui_text(prop, "Plane Trim", "If a vertex is further away from offset plane than this, then it is not affected"); RNA_def_property_ui_text(prop, "Plane Trim", "If a vertex is further away from offset plane than this, then it is not affected");
RNA_def_property_update(prop, 0, "rna_Brush_update"); RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "height", PROP_FLOAT, PROP_DISTANCE); prop = RNA_def_property(srna, "height", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "height"); RNA_def_property_float_sdna(prop, NULL, "height");
RNA_def_property_float_default(prop, 0.5f); RNA_def_property_float_default(prop, 0.5f);
RNA_def_property_range(prop, 0, 1.0f); RNA_def_property_range(prop, 0, 1.0f);
RNA_def_property_ui_text(prop, "Brush Height", "Affectable height of brush (layer height for layer tool, i.e.)"); RNA_def_property_ui_text(prop, "Brush Height", "Affectable height of brush (layer height for layer tool, i.e.)");
RNA_def_property_update(prop, 0, "rna_Brush_update"); RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "texture_sample_bias", PROP_FLOAT, PROP_DISTANCE); prop = RNA_def_property(srna, "texture_sample_bias", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "texture_sample_bias"); RNA_def_property_float_sdna(prop, NULL, "texture_sample_bias");
RNA_def_property_float_default(prop, 0); RNA_def_property_float_default(prop, 0);
RNA_def_property_range(prop, -1, 1); RNA_def_property_range(prop, -1, 1);
RNA_def_property_ui_text(prop, "Texture Sample Bias", "Value added to texture samples"); RNA_def_property_ui_text(prop, "Texture Sample Bias", "Value added to texture samples");
RNA_def_property_update(prop, 0, "rna_Brush_update"); RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "normal_weight", PROP_FLOAT, PROP_FACTOR); prop = RNA_def_property(srna, "normal_weight", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "normal_weight"); RNA_def_property_float_sdna(prop, NULL, "normal_weight");
RNA_def_property_float_default(prop, 0); RNA_def_property_float_default(prop, 0);
RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Normal Weight", "How much grab will pull vertexes out of surface during a grab"); RNA_def_property_ui_text(prop, "Normal Weight", "How much grab will pull vertexes out of surface during a grab");
RNA_def_property_update(prop, 0, "rna_Brush_update"); RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "crease_pinch_factor", PROP_FLOAT, PROP_FACTOR); prop = RNA_def_property(srna, "crease_pinch_factor", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "crease_pinch_factor"); RNA_def_property_float_sdna(prop, NULL, "crease_pinch_factor");
RNA_def_property_float_default(prop, 2.0f/3.0f); RNA_def_property_float_default(prop, 2.0f/3.0f);
RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Crease Brush Pinch Factor", "How much the crease brush pinches"); RNA_def_property_ui_text(prop, "Crease Brush Pinch Factor", "How much the crease brush pinches");
RNA_def_property_update(prop, 0, "rna_Brush_update"); RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "auto_smooth_factor", PROP_FLOAT, PROP_FACTOR); prop = RNA_def_property(srna, "auto_smooth_factor", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "autosmooth_factor"); RNA_def_property_float_sdna(prop, NULL, "autosmooth_factor");
RNA_def_property_float_default(prop, 0); RNA_def_property_float_default(prop, 0);
RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_range(prop, 0.0f, 1.0f);
@@ -482,221 +482,221 @@ static void rna_def_brush(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_Brush_update"); RNA_def_property_update(prop, 0, "rna_Brush_update");
/* flag */ /* flag */
prop= RNA_def_property(srna, "use_airbrush", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_airbrush", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_AIRBRUSH); RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_AIRBRUSH);
RNA_def_property_ui_text(prop, "Airbrush", "Keep applying paint effect while holding mouse (spray)"); RNA_def_property_ui_text(prop, "Airbrush", "Keep applying paint effect while holding mouse (spray)");
RNA_def_property_update(prop, 0, "rna_Brush_update"); RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "use_original_normal", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_original_normal", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_ORIGINAL_NORMAL); RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_ORIGINAL_NORMAL);
RNA_def_property_ui_text(prop, "Original Normal", "When locked keep using normal of surface where stroke was initiated"); RNA_def_property_ui_text(prop, "Original Normal", "When locked keep using normal of surface where stroke was initiated");
RNA_def_property_update(prop, 0, "rna_Brush_update"); RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "use_wrap", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_wrap", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_TORUS); RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_TORUS);
RNA_def_property_ui_text(prop, "Wrap", "Enable torus wrapping while painting"); RNA_def_property_ui_text(prop, "Wrap", "Enable torus wrapping while painting");
RNA_def_property_update(prop, 0, "rna_Brush_update"); RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "use_pressure_strength", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_pressure_strength", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_ALPHA_PRESSURE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_ALPHA_PRESSURE);
RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0); RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
RNA_def_property_ui_text(prop, "Strength Pressure", "Enable tablet pressure sensitivity for strength"); RNA_def_property_ui_text(prop, "Strength Pressure", "Enable tablet pressure sensitivity for strength");
RNA_def_property_update(prop, 0, "rna_Brush_update"); RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "use_offset_pressure", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_offset_pressure", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_OFFSET_PRESSURE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_OFFSET_PRESSURE);
RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0); RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
RNA_def_property_ui_text(prop, "Plane Offset Pressure", "Enable tablet pressure sensitivity for offset"); RNA_def_property_ui_text(prop, "Plane Offset Pressure", "Enable tablet pressure sensitivity for offset");
RNA_def_property_update(prop, 0, "rna_Brush_update"); RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "use_pressure_size", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_pressure_size", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_SIZE_PRESSURE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_SIZE_PRESSURE);
RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0); RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
RNA_def_property_ui_text(prop, "Size Pressure", "Enable tablet pressure sensitivity for size"); RNA_def_property_ui_text(prop, "Size Pressure", "Enable tablet pressure sensitivity for size");
RNA_def_property_update(prop, 0, "rna_Brush_update"); RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "use_pressure_jitter", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_pressure_jitter", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_JITTER_PRESSURE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_JITTER_PRESSURE);
RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0); RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
RNA_def_property_ui_text(prop, "Jitter Pressure", "Enable tablet pressure sensitivity for jitter"); RNA_def_property_ui_text(prop, "Jitter Pressure", "Enable tablet pressure sensitivity for jitter");
RNA_def_property_update(prop, 0, "rna_Brush_update"); RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "use_pressure_spacing", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_pressure_spacing", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_SPACING_PRESSURE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_SPACING_PRESSURE);
RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0); RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
RNA_def_property_ui_text(prop, "Spacing Pressure", "Enable tablet pressure sensitivity for spacing"); RNA_def_property_ui_text(prop, "Spacing Pressure", "Enable tablet pressure sensitivity for spacing");
RNA_def_property_update(prop, 0, "rna_Brush_update"); RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "use_inverse_smooth_pressure", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_inverse_smooth_pressure", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_INVERSE_SMOOTH_PRESSURE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_INVERSE_SMOOTH_PRESSURE);
RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0); RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
RNA_def_property_ui_text(prop, "Inverse Smooth Pressure", "Lighter pressure causes more smoothing to be applied"); RNA_def_property_ui_text(prop, "Inverse Smooth Pressure", "Lighter pressure causes more smoothing to be applied");
RNA_def_property_update(prop, 0, "rna_Brush_update"); RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "use_rake", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_rake", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_RAKE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_RAKE);
RNA_def_property_ui_text(prop, "Rake", "Rotate the brush texture to match the stroke direction"); RNA_def_property_ui_text(prop, "Rake", "Rotate the brush texture to match the stroke direction");
RNA_def_property_update(prop, 0, "rna_Brush_update"); RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "use_random_rotation", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_random_rotation", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_RANDOM_ROTATION); RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_RANDOM_ROTATION);
RNA_def_property_ui_text(prop, "Random Rotation", "Rotate the brush texture at random"); RNA_def_property_ui_text(prop, "Random Rotation", "Rotate the brush texture at random");
RNA_def_property_update(prop, 0, "rna_Brush_update"); RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "use_plane_trim", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_plane_trim", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_PLANE_TRIM); RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_PLANE_TRIM);
RNA_def_property_ui_text(prop, "Use Plane Trim", "Enable Plane Trim"); RNA_def_property_ui_text(prop, "Use Plane Trim", "Enable Plane Trim");
RNA_def_property_update(prop, 0, "rna_Brush_update"); RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "use_frontface", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_frontface", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_FRONTFACE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_FRONTFACE);
RNA_def_property_ui_text(prop, "Use Front-Face", "Brush only affects vertexes that face the viewer"); RNA_def_property_ui_text(prop, "Use Front-Face", "Brush only affects vertexes that face the viewer");
RNA_def_property_update(prop, 0, "rna_Brush_update"); RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "use_anchor", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_anchor", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_ANCHORED); RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_ANCHORED);
RNA_def_property_ui_text(prop, "Anchored", "Keep the brush anchored to the initial location"); RNA_def_property_ui_text(prop, "Anchored", "Keep the brush anchored to the initial location");
RNA_def_property_update(prop, 0, "rna_Brush_update"); RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "use_space", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_space", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_SPACE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_SPACE);
RNA_def_property_ui_text(prop, "Space", "Limit brush application to the distance specified by spacing"); RNA_def_property_ui_text(prop, "Space", "Limit brush application to the distance specified by spacing");
RNA_def_property_update(prop, 0, "rna_Brush_update"); RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "use_smooth_stroke", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_smooth_stroke", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_SMOOTH_STROKE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_SMOOTH_STROKE);
RNA_def_property_ui_text(prop, "Smooth Stroke", "Brush lags behind mouse and follows a smoother path"); RNA_def_property_ui_text(prop, "Smooth Stroke", "Brush lags behind mouse and follows a smoother path");
RNA_def_property_update(prop, 0, "rna_Brush_update"); RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "use_persistent", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_persistent", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_PERSISTENT); RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_PERSISTENT);
RNA_def_property_ui_text(prop, "Persistent", "Sculpt on a persistent layer of the mesh"); RNA_def_property_ui_text(prop, "Persistent", "Sculpt on a persistent layer of the mesh");
RNA_def_property_update(prop, 0, "rna_Brush_update"); RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "use_accumulate", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_accumulate", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_ACCUMULATE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_ACCUMULATE);
RNA_def_property_ui_text(prop, "Accumulate", "Accumulate stroke daubs on top of each other"); RNA_def_property_ui_text(prop, "Accumulate", "Accumulate stroke daubs on top of each other");
RNA_def_property_update(prop, 0, "rna_Brush_update"); RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "use_space_atten", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_space_atten", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_SPACE_ATTEN); RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_SPACE_ATTEN);
RNA_def_property_ui_text(prop, "Use Automatic Strength Adjustment", "Automatically adjust strength to give consistent results for different spacings"); RNA_def_property_ui_text(prop, "Use Automatic Strength Adjustment", "Automatically adjust strength to give consistent results for different spacings");
RNA_def_property_update(prop, 0, "rna_Brush_update"); RNA_def_property_update(prop, 0, "rna_Brush_update");
/* adaptive space is not implemented yet */ /* adaptive space is not implemented yet */
prop= RNA_def_property(srna, "use_adaptive_space", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_adaptive_space", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_ADAPTIVE_SPACE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_ADAPTIVE_SPACE);
RNA_def_property_ui_text(prop, "Adaptive Spacing", "Space daubs according to surface orientation instead of screen space"); RNA_def_property_ui_text(prop, "Adaptive Spacing", "Space daubs according to surface orientation instead of screen space");
RNA_def_property_update(prop, 0, "rna_Brush_update"); RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "use_locked_size", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_locked_size", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_LOCK_SIZE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_LOCK_SIZE);
RNA_def_property_ui_text(prop, "Use Blender Units", "When locked brush stays same size relative to object; when unlocked brush size is given in pixels"); RNA_def_property_ui_text(prop, "Use Blender Units", "When locked brush stays same size relative to object; when unlocked brush size is given in pixels");
RNA_def_property_update(prop, 0, "rna_Brush_update"); RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "use_texture_overlay", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_texture_overlay", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_TEXTURE_OVERLAY); RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_TEXTURE_OVERLAY);
RNA_def_property_ui_text(prop, "Use Texture Overlay", "Show texture in viewport"); RNA_def_property_ui_text(prop, "Use Texture Overlay", "Show texture in viewport");
RNA_def_property_update(prop, 0, "rna_Brush_update"); RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "use_edge_to_edge", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_edge_to_edge", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_EDGE_TO_EDGE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_EDGE_TO_EDGE);
RNA_def_property_ui_text(prop, "Edge-to-edge", "Drag anchor brush from edge-to-edge"); RNA_def_property_ui_text(prop, "Edge-to-edge", "Drag anchor brush from edge-to-edge");
RNA_def_property_update(prop, 0, "rna_Brush_update"); RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "use_restore_mesh", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_restore_mesh", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_RESTORE_MESH); RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_RESTORE_MESH);
RNA_def_property_ui_text(prop, "Restore Mesh", "Allow a single dot to be carefully positioned"); RNA_def_property_ui_text(prop, "Restore Mesh", "Allow a single dot to be carefully positioned");
RNA_def_property_update(prop, 0, "rna_Brush_update"); RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "use_fixed_texture", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_fixed_texture", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_FIXED_TEX); RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_FIXED_TEX);
RNA_def_property_ui_text(prop, "Fixed Texture", "Keep texture origin in fixed position"); RNA_def_property_ui_text(prop, "Fixed Texture", "Keep texture origin in fixed position");
RNA_def_property_update(prop, 0, "rna_Brush_update"); RNA_def_property_update(prop, 0, "rna_Brush_update");
/* only for projection paint, TODO, other paint modes */ /* only for projection paint, TODO, other paint modes */
prop= RNA_def_property(srna, "use_alpha", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_alpha", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", BRUSH_LOCK_ALPHA); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", BRUSH_LOCK_ALPHA);
RNA_def_property_ui_text(prop, "Alpha", "When this is disabled, lock alpha while painting"); RNA_def_property_ui_text(prop, "Alpha", "When this is disabled, lock alpha while painting");
RNA_def_property_update(prop, 0, "rna_Brush_update"); RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "curve", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "curve", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_ui_text(prop, "Curve", "Editable falloff curve"); RNA_def_property_ui_text(prop, "Curve", "Editable falloff curve");
RNA_def_property_update(prop, 0, "rna_Brush_update"); RNA_def_property_update(prop, 0, "rna_Brush_update");
/* paint mode flags */ /* paint mode flags */
prop= RNA_def_property(srna, "use_paint_sculpt", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_paint_sculpt", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ob_mode", OB_MODE_SCULPT); RNA_def_property_boolean_sdna(prop, NULL, "ob_mode", OB_MODE_SCULPT);
RNA_def_property_ui_text(prop, "Use Sculpt", "Use this brush in sculpt mode"); RNA_def_property_ui_text(prop, "Use Sculpt", "Use this brush in sculpt mode");
prop= RNA_def_property(srna, "use_paint_vertex", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_paint_vertex", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ob_mode", OB_MODE_VERTEX_PAINT); RNA_def_property_boolean_sdna(prop, NULL, "ob_mode", OB_MODE_VERTEX_PAINT);
RNA_def_property_ui_text(prop, "Use Vertex", "Use this brush in vertex paint mode"); RNA_def_property_ui_text(prop, "Use Vertex", "Use this brush in vertex paint mode");
prop= RNA_def_property(srna, "use_paint_weight", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_paint_weight", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ob_mode", OB_MODE_WEIGHT_PAINT); RNA_def_property_boolean_sdna(prop, NULL, "ob_mode", OB_MODE_WEIGHT_PAINT);
RNA_def_property_ui_text(prop, "Use Weight", "Use this brush in weight paint mode"); RNA_def_property_ui_text(prop, "Use Weight", "Use this brush in weight paint mode");
prop= RNA_def_property(srna, "use_paint_image", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_paint_image", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ob_mode", OB_MODE_TEXTURE_PAINT); RNA_def_property_boolean_sdna(prop, NULL, "ob_mode", OB_MODE_TEXTURE_PAINT);
RNA_def_property_ui_text(prop, "Use Texture", "Use this brush in texture paint mode"); RNA_def_property_ui_text(prop, "Use Texture", "Use this brush in texture paint mode");
/* texture */ /* texture */
prop= RNA_def_property(srna, "texture_slot", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "texture_slot", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "BrushTextureSlot"); RNA_def_property_struct_type(prop, "BrushTextureSlot");
RNA_def_property_pointer_sdna(prop, NULL, "mtex"); RNA_def_property_pointer_sdna(prop, NULL, "mtex");
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Texture Slot", ""); RNA_def_property_ui_text(prop, "Texture Slot", "");
prop= RNA_def_property(srna, "texture", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "texture", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "mtex.tex"); RNA_def_property_pointer_sdna(prop, NULL, "mtex.tex");
RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Texture", ""); RNA_def_property_ui_text(prop, "Texture", "");
RNA_def_property_update(prop, NC_TEXTURE, "rna_Brush_update"); RNA_def_property_update(prop, NC_TEXTURE, "rna_Brush_update");
prop= RNA_def_property(srna, "texture_overlay_alpha", PROP_INT, PROP_PERCENTAGE); prop = RNA_def_property(srna, "texture_overlay_alpha", PROP_INT, PROP_PERCENTAGE);
RNA_def_property_int_sdna(prop, NULL, "texture_overlay_alpha"); RNA_def_property_int_sdna(prop, NULL, "texture_overlay_alpha");
RNA_def_property_range(prop, 1, 100); RNA_def_property_range(prop, 1, 100);
RNA_def_property_ui_text(prop, "Texture Overlay Alpha", ""); RNA_def_property_ui_text(prop, "Texture Overlay Alpha", "");
RNA_def_property_update(prop, 0, "rna_Brush_update"); RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "cursor_color_add", PROP_FLOAT, PROP_COLOR); prop = RNA_def_property(srna, "cursor_color_add", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "add_col"); RNA_def_property_float_sdna(prop, NULL, "add_col");
RNA_def_property_array(prop, 3); RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Add Color", "Color of cursor when adding"); RNA_def_property_ui_text(prop, "Add Color", "Color of cursor when adding");
RNA_def_property_update(prop, 0, "rna_Brush_update"); RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "cursor_color_subtract", PROP_FLOAT, PROP_COLOR); prop = RNA_def_property(srna, "cursor_color_subtract", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "sub_col"); RNA_def_property_float_sdna(prop, NULL, "sub_col");
RNA_def_property_array(prop, 3); RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Subtract Color", "Color of cursor when subtracting"); RNA_def_property_ui_text(prop, "Subtract Color", "Color of cursor when subtracting");
RNA_def_property_update(prop, 0, "rna_Brush_update"); RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "use_custom_icon", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_custom_icon", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_CUSTOM_ICON); RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_CUSTOM_ICON);
RNA_def_property_ui_text(prop, "Custom Icon", "Set the brush icon from an image file"); RNA_def_property_ui_text(prop, "Custom Icon", "Set the brush icon from an image file");
RNA_def_property_update(prop, 0, "rna_Brush_icon_update"); RNA_def_property_update(prop, 0, "rna_Brush_icon_update");
prop= RNA_def_property(srna, "icon_filepath", PROP_STRING, PROP_FILEPATH); prop = RNA_def_property(srna, "icon_filepath", PROP_STRING, PROP_FILEPATH);
RNA_def_property_string_sdna(prop, NULL, "icon_filepath"); RNA_def_property_string_sdna(prop, NULL, "icon_filepath");
RNA_def_property_ui_text(prop, "Brush Icon Filepath", "File path to brush icon"); RNA_def_property_ui_text(prop, "Brush Icon Filepath", "File path to brush icon");
RNA_def_property_update(prop, 0, "rna_Brush_icon_update"); RNA_def_property_update(prop, 0, "rna_Brush_icon_update");
/* clone tool */ /* clone tool */
prop= RNA_def_property(srna, "clone_image", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "clone_image", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "clone.image"); RNA_def_property_pointer_sdna(prop, NULL, "clone.image");
RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Clone Image", "Image for clone tool"); RNA_def_property_ui_text(prop, "Clone Image", "Image for clone tool");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, "rna_Brush_update"); RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, "rna_Brush_update");
prop= RNA_def_property(srna, "clone_alpha", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "clone_alpha", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "clone.alpha"); RNA_def_property_float_sdna(prop, NULL, "clone.alpha");
RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Clone Alpha", "Opacity of clone image display"); RNA_def_property_ui_text(prop, "Clone Alpha", "Opacity of clone image display");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, "rna_Brush_update"); RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, "rna_Brush_update");
prop= RNA_def_property(srna, "clone_offset", PROP_FLOAT, PROP_XYZ); prop = RNA_def_property(srna, "clone_offset", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "clone.offset"); RNA_def_property_float_sdna(prop, NULL, "clone.offset");
RNA_def_property_ui_text(prop, "Clone Offset", ""); RNA_def_property_ui_text(prop, "Clone Offset", "");
RNA_def_property_ui_range(prop, -1.0f , 1.0f, 10.0f, 3); RNA_def_property_ui_range(prop, -1.0f , 1.0f, 10.0f, 3);
@@ -719,42 +719,42 @@ static void rna_def_operator_stroke_element(BlenderRNA *brna)
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
srna= RNA_def_struct(brna, "OperatorStrokeElement", "PropertyGroup"); srna = RNA_def_struct(brna, "OperatorStrokeElement", "PropertyGroup");
RNA_def_struct_ui_text(srna, "Operator Stroke Element", ""); RNA_def_struct_ui_text(srna, "Operator Stroke Element", "");
prop= RNA_def_property(srna, "location", PROP_FLOAT, PROP_XYZ); prop = RNA_def_property(srna, "location", PROP_FLOAT, PROP_XYZ);
RNA_def_property_flag(prop, PROP_IDPROPERTY); RNA_def_property_flag(prop, PROP_IDPROPERTY);
RNA_def_property_array(prop, 3); RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Location", ""); RNA_def_property_ui_text(prop, "Location", "");
prop= RNA_def_property(srna, "mouse", PROP_FLOAT, PROP_XYZ); prop = RNA_def_property(srna, "mouse", PROP_FLOAT, PROP_XYZ);
RNA_def_property_flag(prop, PROP_IDPROPERTY); RNA_def_property_flag(prop, PROP_IDPROPERTY);
RNA_def_property_array(prop, 2); RNA_def_property_array(prop, 2);
RNA_def_property_ui_text(prop, "Mouse", ""); RNA_def_property_ui_text(prop, "Mouse", "");
prop= RNA_def_property(srna, "pressure", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "pressure", PROP_FLOAT, PROP_NONE);
RNA_def_property_flag(prop, PROP_IDPROPERTY); RNA_def_property_flag(prop, PROP_IDPROPERTY);
RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Pressure", "Tablet pressure"); RNA_def_property_ui_text(prop, "Pressure", "Tablet pressure");
prop= RNA_def_property(srna, "pen_flip", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "pen_flip", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_flag(prop, PROP_IDPROPERTY); RNA_def_property_flag(prop, PROP_IDPROPERTY);
RNA_def_property_ui_text(prop, "Flip", ""); RNA_def_property_ui_text(prop, "Flip", "");
// used in uv painting /* used in uv painting */
prop= RNA_def_property(srna, "time", PROP_FLOAT, PROP_UNSIGNED); prop = RNA_def_property(srna, "time", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_flag(prop, PROP_IDPROPERTY); RNA_def_property_flag(prop, PROP_IDPROPERTY);
RNA_def_property_ui_text(prop, "Time", ""); RNA_def_property_ui_text(prop, "Time", "");
/* used for Grease Pencil sketching sessions */ /* used for Grease Pencil sketching sessions */
prop= RNA_def_property(srna, "is_start", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "is_start", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_flag(prop, PROP_IDPROPERTY); RNA_def_property_flag(prop, PROP_IDPROPERTY);
RNA_def_property_ui_text(prop, "Is Stroke Start", ""); RNA_def_property_ui_text(prop, "Is Stroke Start", "");
/* XXX: Tool (this will be for pressing a modifier key for a different brush, /* XXX: Tool (this will be for pressing a modifier key for a different brush,
e.g. switching to a Smooth brush in the middle of the stroke */ e.g. switching to a Smooth brush in the middle of the stroke */
// XXX: i don't think blender currently supports the ability to properly do a remappable modifier in the middle of a stroke /* XXX: i don't think blender currently supports the ability to properly do a remappable modifier in the middle of a stroke */
} }
void RNA_def_brush(BlenderRNA *brna) void RNA_def_brush(BlenderRNA *brna)

View File

@@ -45,45 +45,45 @@
static float rna_Camera_angle_get(PointerRNA *ptr) static float rna_Camera_angle_get(PointerRNA *ptr)
{ {
Camera *cam= ptr->id.data; Camera *cam = ptr->id.data;
float sensor= camera_sensor_size(cam->sensor_fit, cam->sensor_x, cam->sensor_y); float sensor = camera_sensor_size(cam->sensor_fit, cam->sensor_x, cam->sensor_y);
return focallength_to_fov(cam->lens, sensor); return focallength_to_fov(cam->lens, sensor);
} }
static void rna_Camera_angle_set(PointerRNA *ptr, float value) static void rna_Camera_angle_set(PointerRNA *ptr, float value)
{ {
Camera *cam= ptr->id.data; Camera *cam = ptr->id.data;
float sensor= camera_sensor_size(cam->sensor_fit, cam->sensor_x, cam->sensor_y); float sensor = camera_sensor_size(cam->sensor_fit, cam->sensor_x, cam->sensor_y);
cam->lens= fov_to_focallength(value, sensor); cam->lens = fov_to_focallength(value, sensor);
} }
static float rna_Camera_angle_x_get(PointerRNA *ptr) static float rna_Camera_angle_x_get(PointerRNA *ptr)
{ {
Camera *cam= ptr->id.data; Camera *cam = ptr->id.data;
return focallength_to_fov(cam->lens, cam->sensor_x); return focallength_to_fov(cam->lens, cam->sensor_x);
} }
static void rna_Camera_angle_x_set(PointerRNA *ptr, float value) static void rna_Camera_angle_x_set(PointerRNA *ptr, float value)
{ {
Camera *cam= ptr->id.data; Camera *cam = ptr->id.data;
cam->lens= fov_to_focallength(value, cam->sensor_x); cam->lens = fov_to_focallength(value, cam->sensor_x);
} }
static float rna_Camera_angle_y_get(PointerRNA *ptr) static float rna_Camera_angle_y_get(PointerRNA *ptr)
{ {
Camera *cam= ptr->id.data; Camera *cam = ptr->id.data;
return focallength_to_fov(cam->lens, cam->sensor_y); return focallength_to_fov(cam->lens, cam->sensor_y);
} }
static void rna_Camera_angle_y_set(PointerRNA *ptr, float value) static void rna_Camera_angle_y_set(PointerRNA *ptr, float value)
{ {
Camera *cam= ptr->id.data; Camera *cam = ptr->id.data;
cam->lens= fov_to_focallength(value, cam->sensor_y); cam->lens = fov_to_focallength(value, cam->sensor_y);
} }
static void rna_Camera_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) static void rna_Camera_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{ {
Camera *camera= (Camera*)ptr->id.data; Camera *camera = (Camera*)ptr->id.data;
DAG_id_tag_update(&camera->id, 0); DAG_id_tag_update(&camera->id, 0);
} }
@@ -118,24 +118,24 @@ void RNA_def_camera(BlenderRNA *brna)
{CAMERA_SENSOR_FIT_VERT, "VERTICAL", 0, "Vertical", "Fit to the sensor height"}, {CAMERA_SENSOR_FIT_VERT, "VERTICAL", 0, "Vertical", "Fit to the sensor height"},
{0, NULL, 0, NULL, NULL}}; {0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "Camera", "ID"); srna = RNA_def_struct(brna, "Camera", "ID");
RNA_def_struct_ui_text(srna, "Camera", "Camera datablock for storing camera settings"); RNA_def_struct_ui_text(srna, "Camera", "Camera datablock for storing camera settings");
RNA_def_struct_ui_icon(srna, ICON_CAMERA_DATA); RNA_def_struct_ui_icon(srna, ICON_CAMERA_DATA);
/* Enums */ /* Enums */
prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, prop_type_items); RNA_def_property_enum_items(prop, prop_type_items);
RNA_def_property_ui_text(prop, "Type", "Camera types"); RNA_def_property_ui_text(prop, "Type", "Camera types");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Camera_update"); RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Camera_update");
prop= RNA_def_property(srna, "show_guide", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "show_guide", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "dtx"); RNA_def_property_enum_sdna(prop, NULL, "dtx");
RNA_def_property_enum_items(prop, prop_draw_type_extra_items); RNA_def_property_enum_items(prop, prop_draw_type_extra_items);
RNA_def_property_flag(prop, PROP_ENUM_FLAG); RNA_def_property_flag(prop, PROP_ENUM_FLAG);
RNA_def_property_ui_text(prop, "Composition Guides", "Draw overlay"); RNA_def_property_ui_text(prop, "Composition Guides", "Draw overlay");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
prop= RNA_def_property(srna, "sensor_fit", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "sensor_fit", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "sensor_fit"); RNA_def_property_enum_sdna(prop, NULL, "sensor_fit");
RNA_def_property_enum_items(prop, sensor_fit_items); RNA_def_property_enum_items(prop, sensor_fit_items);
RNA_def_property_ui_text(prop, "Sensor Fit", "Method to fit image and field of view angle inside the sensor"); RNA_def_property_ui_text(prop, "Sensor Fit", "Method to fit image and field of view angle inside the sensor");
@@ -143,134 +143,134 @@ void RNA_def_camera(BlenderRNA *brna)
/* Number values */ /* Number values */
prop= RNA_def_property(srna, "passepartout_alpha", PROP_FLOAT, PROP_FACTOR); prop = RNA_def_property(srna, "passepartout_alpha", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "passepartalpha"); RNA_def_property_float_sdna(prop, NULL, "passepartalpha");
RNA_def_property_ui_text(prop, "Passepartout Alpha", "Opacity (alpha) of the darkened overlay in Camera view"); RNA_def_property_ui_text(prop, "Passepartout Alpha", "Opacity (alpha) of the darkened overlay in Camera view");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
prop= RNA_def_property(srna, "angle_x", PROP_FLOAT, PROP_ANGLE); prop = RNA_def_property(srna, "angle_x", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_range(prop, M_PI * (0.367/180.0), M_PI * (172.847/180.0)); RNA_def_property_range(prop, M_PI * (0.367/180.0), M_PI * (172.847/180.0));
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Horizontal FOV", "Camera lens horizontal field of view in degrees"); RNA_def_property_ui_text(prop, "Horizontal FOV", "Camera lens horizontal field of view in degrees");
RNA_def_property_float_funcs(prop, "rna_Camera_angle_x_get", "rna_Camera_angle_x_set", NULL); RNA_def_property_float_funcs(prop, "rna_Camera_angle_x_get", "rna_Camera_angle_x_set", NULL);
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Camera_update"); RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Camera_update");
prop= RNA_def_property(srna, "angle_y", PROP_FLOAT, PROP_ANGLE); prop = RNA_def_property(srna, "angle_y", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_range(prop, M_PI * (0.367/180.0), M_PI * (172.847/180.0)); RNA_def_property_range(prop, M_PI * (0.367/180.0), M_PI * (172.847/180.0));
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Vertical FOV", "Camera lens vertical field of view in degrees"); RNA_def_property_ui_text(prop, "Vertical FOV", "Camera lens vertical field of view in degrees");
RNA_def_property_float_funcs(prop, "rna_Camera_angle_y_get", "rna_Camera_angle_y_set", NULL); RNA_def_property_float_funcs(prop, "rna_Camera_angle_y_get", "rna_Camera_angle_y_set", NULL);
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Camera_update"); RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Camera_update");
prop= RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE); prop = RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_range(prop, M_PI * (0.367/180.0), M_PI * (172.847/180.0)); RNA_def_property_range(prop, M_PI * (0.367/180.0), M_PI * (172.847/180.0));
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Field of View", "Camera lens field of view in degrees"); RNA_def_property_ui_text(prop, "Field of View", "Camera lens field of view in degrees");
RNA_def_property_float_funcs(prop, "rna_Camera_angle_get", "rna_Camera_angle_set", NULL); RNA_def_property_float_funcs(prop, "rna_Camera_angle_get", "rna_Camera_angle_set", NULL);
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Camera_update"); RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Camera_update");
prop= RNA_def_property(srna, "clip_start", PROP_FLOAT, PROP_DISTANCE); prop = RNA_def_property(srna, "clip_start", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "clipsta"); RNA_def_property_float_sdna(prop, NULL, "clipsta");
RNA_def_property_range(prop, 0.001f, FLT_MAX); RNA_def_property_range(prop, 0.001f, FLT_MAX);
RNA_def_property_ui_text(prop, "Clip Start", "Camera near clipping distance"); RNA_def_property_ui_text(prop, "Clip Start", "Camera near clipping distance");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
prop= RNA_def_property(srna, "clip_end", PROP_FLOAT, PROP_DISTANCE); prop = RNA_def_property(srna, "clip_end", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "clipend"); RNA_def_property_float_sdna(prop, NULL, "clipend");
RNA_def_property_range(prop, 1.0f, FLT_MAX); RNA_def_property_range(prop, 1.0f, FLT_MAX);
RNA_def_property_ui_text(prop, "Clip End", "Camera far clipping distance"); RNA_def_property_ui_text(prop, "Clip End", "Camera far clipping distance");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
prop= RNA_def_property(srna, "lens", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "lens", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "lens"); RNA_def_property_float_sdna(prop, NULL, "lens");
RNA_def_property_range(prop, 1.0f, 5000.0f); RNA_def_property_range(prop, 1.0f, 5000.0f);
RNA_def_property_ui_text(prop, "Focal Length", "Perspective Camera lens value in millimeters"); RNA_def_property_ui_text(prop, "Focal Length", "Perspective Camera lens value in millimeters");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Camera_update"); RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Camera_update");
prop= RNA_def_property(srna, "sensor_width", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "sensor_width", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "sensor_x"); RNA_def_property_float_sdna(prop, NULL, "sensor_x");
RNA_def_property_range(prop, 1.0f, FLT_MAX); RNA_def_property_range(prop, 1.0f, FLT_MAX);
RNA_def_property_ui_range(prop, 1.0f, 100.f, 1, 2); RNA_def_property_ui_range(prop, 1.0f, 100.f, 1, 2);
RNA_def_property_ui_text(prop, "Sensor Width", "Horizontal size of the image sensor area in millimeters"); RNA_def_property_ui_text(prop, "Sensor Width", "Horizontal size of the image sensor area in millimeters");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Camera_update"); RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Camera_update");
prop= RNA_def_property(srna, "sensor_height", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "sensor_height", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "sensor_y"); RNA_def_property_float_sdna(prop, NULL, "sensor_y");
RNA_def_property_range(prop, 1.0f, FLT_MAX); RNA_def_property_range(prop, 1.0f, FLT_MAX);
RNA_def_property_ui_range(prop, 1.0f, 100.f, 1, 2); RNA_def_property_ui_range(prop, 1.0f, 100.f, 1, 2);
RNA_def_property_ui_text(prop, "Sensor Height", "Vertical size of the image sensor area in millimeters"); RNA_def_property_ui_text(prop, "Sensor Height", "Vertical size of the image sensor area in millimeters");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Camera_update"); RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Camera_update");
prop= RNA_def_property(srna, "ortho_scale", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "ortho_scale", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ortho_scale"); RNA_def_property_float_sdna(prop, NULL, "ortho_scale");
RNA_def_property_range(prop, 0.01f, 4000.0f); RNA_def_property_range(prop, 0.01f, 4000.0f);
RNA_def_property_ui_text(prop, "Orthographic Scale", "Orthographic Camera scale (similar to zoom)"); RNA_def_property_ui_text(prop, "Orthographic Scale", "Orthographic Camera scale (similar to zoom)");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Camera_update"); RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Camera_update");
prop= RNA_def_property(srna, "draw_size", PROP_FLOAT, PROP_DISTANCE); prop = RNA_def_property(srna, "draw_size", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "drawsize"); RNA_def_property_float_sdna(prop, NULL, "drawsize");
RNA_def_property_range(prop, 0.01f, 1000.0f); RNA_def_property_range(prop, 0.01f, 1000.0f);
RNA_def_property_ui_range(prop, 0.01, 100, 1, 2); RNA_def_property_ui_range(prop, 0.01, 100, 1, 2);
RNA_def_property_ui_text(prop, "Draw Size", "Apparent size of the Camera object in the 3D View"); RNA_def_property_ui_text(prop, "Draw Size", "Apparent size of the Camera object in the 3D View");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
prop= RNA_def_property(srna, "shift_x", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "shift_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "shiftx"); RNA_def_property_float_sdna(prop, NULL, "shiftx");
RNA_def_property_range(prop, -10.0f, 10.0f); RNA_def_property_range(prop, -10.0f, 10.0f);
RNA_def_property_ui_range(prop, -2.0, 2.0, 1, 3); RNA_def_property_ui_range(prop, -2.0, 2.0, 1, 3);
RNA_def_property_ui_text(prop, "Shift X", "Perspective Camera horizontal shift"); RNA_def_property_ui_text(prop, "Shift X", "Perspective Camera horizontal shift");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Camera_update"); RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Camera_update");
prop= RNA_def_property(srna, "shift_y", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "shift_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "shifty"); RNA_def_property_float_sdna(prop, NULL, "shifty");
RNA_def_property_range(prop, -10.0f, 10.0f); RNA_def_property_range(prop, -10.0f, 10.0f);
RNA_def_property_ui_range(prop, -2.0, 2.0, 1, 3); RNA_def_property_ui_range(prop, -2.0, 2.0, 1, 3);
RNA_def_property_ui_text(prop, "Shift Y", "Perspective Camera vertical shift"); RNA_def_property_ui_text(prop, "Shift Y", "Perspective Camera vertical shift");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Camera_update"); RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Camera_update");
prop= RNA_def_property(srna, "dof_distance", PROP_FLOAT, PROP_DISTANCE); prop = RNA_def_property(srna, "dof_distance", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "YF_dofdist"); RNA_def_property_float_sdna(prop, NULL, "YF_dofdist");
RNA_def_property_range(prop, 0.0f, 5000.0f); RNA_def_property_range(prop, 0.0f, 5000.0f);
RNA_def_property_ui_text(prop, "DOF Distance", "Distance to the focus point for depth of field"); RNA_def_property_ui_text(prop, "DOF Distance", "Distance to the focus point for depth of field");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
/* flag */ /* flag */
prop= RNA_def_property(srna, "show_limits", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "show_limits", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CAM_SHOWLIMITS); RNA_def_property_boolean_sdna(prop, NULL, "flag", CAM_SHOWLIMITS);
RNA_def_property_ui_text(prop, "Show Limits", "Draw the clipping range and focus point on the camera"); RNA_def_property_ui_text(prop, "Show Limits", "Draw the clipping range and focus point on the camera");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
prop= RNA_def_property(srna, "show_mist", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "show_mist", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CAM_SHOWMIST); RNA_def_property_boolean_sdna(prop, NULL, "flag", CAM_SHOWMIST);
RNA_def_property_ui_text(prop, "Show Mist", "Draw a line from the Camera to indicate the mist area"); RNA_def_property_ui_text(prop, "Show Mist", "Draw a line from the Camera to indicate the mist area");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
prop= RNA_def_property(srna, "show_passepartout", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "show_passepartout", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CAM_SHOWPASSEPARTOUT); RNA_def_property_boolean_sdna(prop, NULL, "flag", CAM_SHOWPASSEPARTOUT);
RNA_def_property_ui_text(prop, "Show Passepartout", "Show a darkened overlay outside the image area in Camera view"); RNA_def_property_ui_text(prop, "Show Passepartout", "Show a darkened overlay outside the image area in Camera view");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
prop= RNA_def_property(srna, "show_title_safe", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "show_title_safe", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CAM_SHOWTITLESAFE); RNA_def_property_boolean_sdna(prop, NULL, "flag", CAM_SHOWTITLESAFE);
RNA_def_property_ui_text(prop, "Show Title Safe", "Show indicators for the title safe zone in Camera view"); RNA_def_property_ui_text(prop, "Show Title Safe", "Show indicators for the title safe zone in Camera view");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
prop= RNA_def_property(srna, "show_name", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "show_name", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CAM_SHOWNAME); RNA_def_property_boolean_sdna(prop, NULL, "flag", CAM_SHOWNAME);
RNA_def_property_ui_text(prop, "Show Name", "Show the active Camera's name in Camera view"); RNA_def_property_ui_text(prop, "Show Name", "Show the active Camera's name in Camera view");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
prop= RNA_def_property(srna, "show_sensor", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "show_sensor", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CAM_SHOWSENSOR); RNA_def_property_boolean_sdna(prop, NULL, "flag", CAM_SHOWSENSOR);
RNA_def_property_ui_text(prop, "Show Sensor Size", "Show sensor size (film gate) in Camera view"); RNA_def_property_ui_text(prop, "Show Sensor Size", "Show sensor size (film gate) in Camera view");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
prop= RNA_def_property(srna, "lens_unit", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "lens_unit", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
RNA_def_property_enum_items(prop, prop_lens_unit_items); RNA_def_property_enum_items(prop, prop_lens_unit_items);
RNA_def_property_ui_text(prop, "Lens Unit", "Unit to edit lens in for the user interface"); RNA_def_property_ui_text(prop, "Lens Unit", "Unit to edit lens in for the user interface");
prop= RNA_def_property(srna, "use_panorama", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_panorama", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CAM_PANORAMA); RNA_def_property_boolean_sdna(prop, NULL, "flag", CAM_PANORAMA);
RNA_def_property_ui_text(prop, "Panorama", "Render the scene with a cylindrical camera for pseudo-fisheye lens effects"); RNA_def_property_ui_text(prop, "Panorama", "Render the scene with a cylindrical camera for pseudo-fisheye lens effects");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
@@ -278,7 +278,7 @@ void RNA_def_camera(BlenderRNA *brna)
/* pointers */ /* pointers */
rna_def_animdata_common(srna); rna_def_animdata_common(srna);
prop= RNA_def_property(srna, "dof_object", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "dof_object", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Object"); RNA_def_property_struct_type(prop, "Object");
RNA_def_property_pointer_sdna(prop, NULL, "dof_ob"); RNA_def_property_pointer_sdna(prop, NULL, "dof_ob");
RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_flag(prop, PROP_EDITABLE);

View File

@@ -61,25 +61,25 @@ void RNA_api_camera(StructRNA *srna)
FunctionRNA *func; FunctionRNA *func;
PropertyRNA *parm; PropertyRNA *parm;
func= RNA_def_function(srna, "view_frame", "rna_camera_view_frame"); func = RNA_def_function(srna, "view_frame", "rna_camera_view_frame");
RNA_def_function_ui_description(func, "Return 4 points for the cameras frame (before object transformation)"); RNA_def_function_ui_description(func, "Return 4 points for the cameras frame (before object transformation)");
RNA_def_pointer(func, "scene", "Scene", "", "Scene to use for aspect calculation, when omitted 1:1 aspect is used"); RNA_def_pointer(func, "scene", "Scene", "", "Scene to use for aspect calculation, when omitted 1:1 aspect is used");
/* return location and normal */ /* return location and normal */
parm= RNA_def_float_vector(func, "result_1", 3, NULL, -FLT_MAX, FLT_MAX, "Result", NULL, -1e4, 1e4); parm = RNA_def_float_vector(func, "result_1", 3, NULL, -FLT_MAX, FLT_MAX, "Result", NULL, -1e4, 1e4);
RNA_def_property_flag(parm, PROP_THICK_WRAP); RNA_def_property_flag(parm, PROP_THICK_WRAP);
RNA_def_function_output(func, parm); RNA_def_function_output(func, parm);
parm= RNA_def_float_vector(func, "result_2", 3, NULL, -FLT_MAX, FLT_MAX, "Result", NULL, -1e4, 1e4); parm = RNA_def_float_vector(func, "result_2", 3, NULL, -FLT_MAX, FLT_MAX, "Result", NULL, -1e4, 1e4);
RNA_def_property_flag(parm, PROP_THICK_WRAP); RNA_def_property_flag(parm, PROP_THICK_WRAP);
RNA_def_function_output(func, parm); RNA_def_function_output(func, parm);
parm= RNA_def_float_vector(func, "result_3", 3, NULL, -FLT_MAX, FLT_MAX, "Result", NULL, -1e4, 1e4); parm = RNA_def_float_vector(func, "result_3", 3, NULL, -FLT_MAX, FLT_MAX, "Result", NULL, -1e4, 1e4);
RNA_def_property_flag(parm, PROP_THICK_WRAP); RNA_def_property_flag(parm, PROP_THICK_WRAP);
RNA_def_function_output(func, parm); RNA_def_function_output(func, parm);
parm= RNA_def_float_vector(func, "result_4", 3, NULL, -FLT_MAX, FLT_MAX, "Result", NULL, -1e4, 1e4); parm = RNA_def_float_vector(func, "result_4", 3, NULL, -FLT_MAX, FLT_MAX, "Result", NULL, -1e4, 1e4);
RNA_def_property_flag(parm, PROP_THICK_WRAP); RNA_def_property_flag(parm, PROP_THICK_WRAP);
RNA_def_function_output(func, parm); RNA_def_function_output(func, parm);
} }

View File

@@ -49,7 +49,7 @@
static void rna_cloth_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) static void rna_cloth_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{ {
Object *ob= (Object*)ptr->id.data; Object *ob = (Object*)ptr->id.data;
DAG_id_tag_update(&ob->id, OB_RECALC_DATA); DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
WM_main_add_notifier(NC_OBJECT|ND_MODIFIER, ob); WM_main_add_notifier(NC_OBJECT|ND_MODIFIER, ob);
@@ -57,8 +57,8 @@ static void rna_cloth_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerR
static void rna_cloth_pinning_changed(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) static void rna_cloth_pinning_changed(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{ {
Object *ob= (Object*)ptr->id.data; Object *ob = (Object*)ptr->id.data;
// ClothSimSettings *settings = (ClothSimSettings*)ptr->data; /* ClothSimSettings *settings = (ClothSimSettings*)ptr->data; */
ClothModifierData *clmd = (ClothModifierData*)modifiers_findByType(ob, eModifierType_Cloth); ClothModifierData *clmd = (ClothModifierData*)modifiers_findByType(ob, eModifierType_Cloth);
cloth_free_modifier(clmd); cloth_free_modifier(clmd);
@@ -69,7 +69,7 @@ static void rna_cloth_pinning_changed(Main *UNUSED(bmain), Scene *UNUSED(scene),
static void rna_cloth_reset(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) static void rna_cloth_reset(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{ {
Object *ob= (Object*)ptr->id.data; Object *ob = (Object*)ptr->id.data;
ClothSimSettings *settings = (ClothSimSettings*)ptr->data; ClothSimSettings *settings = (ClothSimSettings*)ptr->data;
settings->reset = 1; settings->reset = 1;
@@ -84,7 +84,7 @@ static void rna_ClothSettings_max_bend_set(struct PointerRNA *ptr, float value)
ClothSimSettings *settings = (ClothSimSettings*)ptr->data; ClothSimSettings *settings = (ClothSimSettings*)ptr->data;
/* check for clipping */ /* check for clipping */
if(value < settings->bending) if (value < settings->bending)
value = settings->bending; value = settings->bending;
settings->max_bend = value; settings->max_bend = value;
@@ -95,7 +95,7 @@ static void rna_ClothSettings_max_struct_set(struct PointerRNA *ptr, float value
ClothSimSettings *settings = (ClothSimSettings*)ptr->data; ClothSimSettings *settings = (ClothSimSettings*)ptr->data;
/* check for clipping */ /* check for clipping */
if(value < settings->structural) if (value < settings->structural)
value = settings->structural; value = settings->structural;
settings->max_struct = value; settings->max_struct = value;
@@ -103,104 +103,104 @@ static void rna_ClothSettings_max_struct_set(struct PointerRNA *ptr, float value
static void rna_ClothSettings_mass_vgroup_get(PointerRNA *ptr, char *value) static void rna_ClothSettings_mass_vgroup_get(PointerRNA *ptr, char *value)
{ {
ClothSimSettings *sim= (ClothSimSettings*)ptr->data; ClothSimSettings *sim = (ClothSimSettings*)ptr->data;
rna_object_vgroup_name_index_get(ptr, value, sim->vgroup_mass); rna_object_vgroup_name_index_get(ptr, value, sim->vgroup_mass);
} }
static int rna_ClothSettings_mass_vgroup_length(PointerRNA *ptr) static int rna_ClothSettings_mass_vgroup_length(PointerRNA *ptr)
{ {
ClothSimSettings *sim= (ClothSimSettings*)ptr->data; ClothSimSettings *sim = (ClothSimSettings*)ptr->data;
return rna_object_vgroup_name_index_length(ptr, sim->vgroup_mass); return rna_object_vgroup_name_index_length(ptr, sim->vgroup_mass);
} }
static void rna_ClothSettings_mass_vgroup_set(PointerRNA *ptr, const char *value) static void rna_ClothSettings_mass_vgroup_set(PointerRNA *ptr, const char *value)
{ {
ClothSimSettings *sim= (ClothSimSettings*)ptr->data; ClothSimSettings *sim = (ClothSimSettings*)ptr->data;
rna_object_vgroup_name_index_set(ptr, value, &sim->vgroup_mass); rna_object_vgroup_name_index_set(ptr, value, &sim->vgroup_mass);
} }
static void rna_ClothSettings_struct_vgroup_get(PointerRNA *ptr, char *value) static void rna_ClothSettings_struct_vgroup_get(PointerRNA *ptr, char *value)
{ {
ClothSimSettings *sim= (ClothSimSettings*)ptr->data; ClothSimSettings *sim = (ClothSimSettings*)ptr->data;
rna_object_vgroup_name_index_get(ptr, value, sim->vgroup_struct); rna_object_vgroup_name_index_get(ptr, value, sim->vgroup_struct);
} }
static int rna_ClothSettings_struct_vgroup_length(PointerRNA *ptr) static int rna_ClothSettings_struct_vgroup_length(PointerRNA *ptr)
{ {
ClothSimSettings *sim= (ClothSimSettings*)ptr->data; ClothSimSettings *sim = (ClothSimSettings*)ptr->data;
return rna_object_vgroup_name_index_length(ptr, sim->vgroup_struct); return rna_object_vgroup_name_index_length(ptr, sim->vgroup_struct);
} }
static void rna_ClothSettings_struct_vgroup_set(PointerRNA *ptr, const char *value) static void rna_ClothSettings_struct_vgroup_set(PointerRNA *ptr, const char *value)
{ {
ClothSimSettings *sim= (ClothSimSettings*)ptr->data; ClothSimSettings *sim = (ClothSimSettings*)ptr->data;
rna_object_vgroup_name_index_set(ptr, value, &sim->vgroup_struct); rna_object_vgroup_name_index_set(ptr, value, &sim->vgroup_struct);
} }
static void rna_ClothSettings_bend_vgroup_get(PointerRNA *ptr, char *value) static void rna_ClothSettings_bend_vgroup_get(PointerRNA *ptr, char *value)
{ {
ClothSimSettings *sim= (ClothSimSettings*)ptr->data; ClothSimSettings *sim = (ClothSimSettings*)ptr->data;
rna_object_vgroup_name_index_get(ptr, value, sim->vgroup_bend); rna_object_vgroup_name_index_get(ptr, value, sim->vgroup_bend);
} }
static int rna_ClothSettings_bend_vgroup_length(PointerRNA *ptr) static int rna_ClothSettings_bend_vgroup_length(PointerRNA *ptr)
{ {
ClothSimSettings *sim= (ClothSimSettings*)ptr->data; ClothSimSettings *sim = (ClothSimSettings*)ptr->data;
return rna_object_vgroup_name_index_length(ptr, sim->vgroup_bend); return rna_object_vgroup_name_index_length(ptr, sim->vgroup_bend);
} }
static void rna_ClothSettings_bend_vgroup_set(PointerRNA *ptr, const char *value) static void rna_ClothSettings_bend_vgroup_set(PointerRNA *ptr, const char *value)
{ {
ClothSimSettings *sim= (ClothSimSettings*)ptr->data; ClothSimSettings *sim = (ClothSimSettings*)ptr->data;
rna_object_vgroup_name_index_set(ptr, value, &sim->vgroup_bend); rna_object_vgroup_name_index_set(ptr, value, &sim->vgroup_bend);
} }
static PointerRNA rna_ClothSettings_rest_shape_key_get(PointerRNA *ptr) static PointerRNA rna_ClothSettings_rest_shape_key_get(PointerRNA *ptr)
{ {
Object *ob= (Object*)ptr->id.data; Object *ob = (Object*)ptr->id.data;
ClothSimSettings *sim= (ClothSimSettings*)ptr->data; ClothSimSettings *sim = (ClothSimSettings*)ptr->data;
return rna_object_shapekey_index_get(ob->data, sim->shapekey_rest); return rna_object_shapekey_index_get(ob->data, sim->shapekey_rest);
} }
static void rna_ClothSettings_rest_shape_key_set(PointerRNA *ptr, PointerRNA value) static void rna_ClothSettings_rest_shape_key_set(PointerRNA *ptr, PointerRNA value)
{ {
Object *ob= (Object*)ptr->id.data; Object *ob = (Object*)ptr->id.data;
ClothSimSettings *sim= (ClothSimSettings*)ptr->data; ClothSimSettings *sim = (ClothSimSettings*)ptr->data;
sim->shapekey_rest= rna_object_shapekey_index_set(ob->data, value, sim->shapekey_rest); sim->shapekey_rest = rna_object_shapekey_index_set(ob->data, value, sim->shapekey_rest);
} }
static void rna_ClothSettings_gravity_get(PointerRNA *ptr, float *values) static void rna_ClothSettings_gravity_get(PointerRNA *ptr, float *values)
{ {
ClothSimSettings *sim= (ClothSimSettings*)ptr->data; ClothSimSettings *sim = (ClothSimSettings*)ptr->data;
values[0]= sim->gravity[0]; values[0] = sim->gravity[0];
values[1]= sim->gravity[1]; values[1] = sim->gravity[1];
values[2]= sim->gravity[2]; values[2] = sim->gravity[2];
} }
static void rna_ClothSettings_gravity_set(PointerRNA *ptr, const float *values) static void rna_ClothSettings_gravity_set(PointerRNA *ptr, const float *values)
{ {
ClothSimSettings *sim= (ClothSimSettings*)ptr->data; ClothSimSettings *sim = (ClothSimSettings*)ptr->data;
sim->gravity[0]= values[0]; sim->gravity[0] = values[0];
sim->gravity[1]= values[1]; sim->gravity[1] = values[1];
sim->gravity[2]= values[2]; sim->gravity[2] = values[2];
} }
static char *rna_ClothSettings_path(PointerRNA *ptr) static char *rna_ClothSettings_path(PointerRNA *ptr)
{ {
Object *ob= (Object*)ptr->id.data; Object *ob = (Object*)ptr->id.data;
ModifierData *md= modifiers_findByType(ob, eModifierType_Cloth); ModifierData *md = modifiers_findByType(ob, eModifierType_Cloth);
return md ? BLI_sprintfN("modifiers[\"%s\"].settings", md->name) : NULL; return md ? BLI_sprintfN("modifiers[\"%s\"].settings", md->name) : NULL;
} }
static char *rna_ClothCollisionSettings_path(PointerRNA *ptr) static char *rna_ClothCollisionSettings_path(PointerRNA *ptr)
{ {
Object *ob= (Object*)ptr->id.data; Object *ob = (Object*)ptr->id.data;
ModifierData *md= modifiers_findByType(ob, eModifierType_Cloth); ModifierData *md = modifiers_findByType(ob, eModifierType_Cloth);
return md ? BLI_sprintfN("modifiers[\"%s\"].collision_settings", md->name) : NULL; return md ? BLI_sprintfN("modifiers[\"%s\"].collision_settings", md->name) : NULL;
} }
@@ -219,43 +219,43 @@ static void rna_def_cloth_sim_settings(BlenderRNA *brna)
/* goal */ /* goal */
prop= RNA_def_property(srna, "goal_min", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "goal_min", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "mingoal"); RNA_def_property_float_sdna(prop, NULL, "mingoal");
RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Goal Minimum", "Goal minimum, vertex group weights are scaled to match this range"); RNA_def_property_ui_text(prop, "Goal Minimum", "Goal minimum, vertex group weights are scaled to match this range");
RNA_def_property_update(prop, 0, "rna_cloth_update"); RNA_def_property_update(prop, 0, "rna_cloth_update");
prop= RNA_def_property(srna, "goal_max", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "goal_max", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "maxgoal"); RNA_def_property_float_sdna(prop, NULL, "maxgoal");
RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Goal Maximum", "Goal maximum, vertex group weights are scaled to match this range"); RNA_def_property_ui_text(prop, "Goal Maximum", "Goal maximum, vertex group weights are scaled to match this range");
RNA_def_property_update(prop, 0, "rna_cloth_update"); RNA_def_property_update(prop, 0, "rna_cloth_update");
prop= RNA_def_property(srna, "goal_default", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "goal_default", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "defgoal"); RNA_def_property_float_sdna(prop, NULL, "defgoal");
RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Goal Default", "Default Goal (vertex target position) value, when no Vertex Group used"); RNA_def_property_ui_text(prop, "Goal Default", "Default Goal (vertex target position) value, when no Vertex Group used");
RNA_def_property_update(prop, 0, "rna_cloth_update"); RNA_def_property_update(prop, 0, "rna_cloth_update");
prop= RNA_def_property(srna, "goal_spring", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "goal_spring", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "goalspring"); RNA_def_property_float_sdna(prop, NULL, "goalspring");
RNA_def_property_range(prop, 0.0f, 0.999f); RNA_def_property_range(prop, 0.0f, 0.999f);
RNA_def_property_ui_text(prop, "Goal Stiffness", "Goal (vertex target position) spring stiffness"); RNA_def_property_ui_text(prop, "Goal Stiffness", "Goal (vertex target position) spring stiffness");
RNA_def_property_update(prop, 0, "rna_cloth_update"); RNA_def_property_update(prop, 0, "rna_cloth_update");
prop= RNA_def_property(srna, "goal_friction", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "goal_friction", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "goalfrict"); RNA_def_property_float_sdna(prop, NULL, "goalfrict");
RNA_def_property_range(prop, 0.0f, 50.0f); RNA_def_property_range(prop, 0.0f, 50.0f);
RNA_def_property_ui_text(prop, "Goal Damping", "Goal (vertex target position) friction"); RNA_def_property_ui_text(prop, "Goal Damping", "Goal (vertex target position) friction");
RNA_def_property_update(prop, 0, "rna_cloth_update"); RNA_def_property_update(prop, 0, "rna_cloth_update");
prop= RNA_def_property(srna, "internal_friction", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "internal_friction", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "velocity_smooth"); RNA_def_property_float_sdna(prop, NULL, "velocity_smooth");
RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Internal Friction", ""); RNA_def_property_ui_text(prop, "Internal Friction", "");
RNA_def_property_update(prop, 0, "rna_cloth_update"); RNA_def_property_update(prop, 0, "rna_cloth_update");
prop= RNA_def_property(srna, "collider_friction", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "collider_friction", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "collider_friction"); RNA_def_property_float_sdna(prop, NULL, "collider_friction");
RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Collider Friction", ""); RNA_def_property_ui_text(prop, "Collider Friction", "");
@@ -263,18 +263,18 @@ static void rna_def_cloth_sim_settings(BlenderRNA *brna)
/* mass */ /* mass */
prop= RNA_def_property(srna, "mass", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "mass", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 10.0f); RNA_def_property_range(prop, 0.0f, 10.0f);
RNA_def_property_ui_text(prop, "Mass", "Mass of cloth material"); RNA_def_property_ui_text(prop, "Mass", "Mass of cloth material");
RNA_def_property_update(prop, 0, "rna_cloth_update"); RNA_def_property_update(prop, 0, "rna_cloth_update");
prop= RNA_def_property(srna, "vertex_group_mass", PROP_STRING, PROP_NONE); prop = RNA_def_property(srna, "vertex_group_mass", PROP_STRING, PROP_NONE);
RNA_def_property_string_funcs(prop, "rna_ClothSettings_mass_vgroup_get", "rna_ClothSettings_mass_vgroup_length", RNA_def_property_string_funcs(prop, "rna_ClothSettings_mass_vgroup_get", "rna_ClothSettings_mass_vgroup_length",
"rna_ClothSettings_mass_vgroup_set"); "rna_ClothSettings_mass_vgroup_set");
RNA_def_property_ui_text(prop, "Mass Vertex Group", "Vertex Group for pinning of vertices"); RNA_def_property_ui_text(prop, "Mass Vertex Group", "Vertex Group for pinning of vertices");
RNA_def_property_update(prop, 0, "rna_cloth_pinning_changed"); RNA_def_property_update(prop, 0, "rna_cloth_pinning_changed");
prop= RNA_def_property(srna, "gravity", PROP_FLOAT, PROP_ACCELERATION); prop = RNA_def_property(srna, "gravity", PROP_FLOAT, PROP_ACCELERATION);
RNA_def_property_array(prop, 3); RNA_def_property_array(prop, 3);
RNA_def_property_range(prop, -100.0, 100.0); RNA_def_property_range(prop, -100.0, 100.0);
RNA_def_property_float_funcs(prop, "rna_ClothSettings_gravity_get", "rna_ClothSettings_gravity_set", NULL); RNA_def_property_float_funcs(prop, "rna_ClothSettings_gravity_get", "rna_ClothSettings_gravity_set", NULL);
@@ -283,13 +283,13 @@ static void rna_def_cloth_sim_settings(BlenderRNA *brna)
/* various */ /* various */
prop= RNA_def_property(srna, "air_damping", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "air_damping", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "Cvi"); RNA_def_property_float_sdna(prop, NULL, "Cvi");
RNA_def_property_range(prop, 0.0f, 10.0f); RNA_def_property_range(prop, 0.0f, 10.0f);
RNA_def_property_ui_text(prop, "Air Damping", "Air has normally some thickness which slows falling things down"); RNA_def_property_ui_text(prop, "Air Damping", "Air has normally some thickness which slows falling things down");
RNA_def_property_update(prop, 0, "rna_cloth_update"); RNA_def_property_update(prop, 0, "rna_cloth_update");
prop= RNA_def_property(srna, "vel_damping", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "vel_damping", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "vel_damping"); RNA_def_property_float_sdna(prop, NULL, "vel_damping");
RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Velocity Damping", RNA_def_property_ui_text(prop, "Velocity Damping",
@@ -297,19 +297,19 @@ static void rna_def_cloth_sim_settings(BlenderRNA *brna)
"(1.0 = no damping, 0.0 = fully dampened)"); "(1.0 = no damping, 0.0 = fully dampened)");
RNA_def_property_update(prop, 0, "rna_cloth_update"); RNA_def_property_update(prop, 0, "rna_cloth_update");
prop= RNA_def_property(srna, "use_pin_cloth", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_pin_cloth", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", CLOTH_SIMSETTINGS_FLAG_GOAL); RNA_def_property_boolean_sdna(prop, NULL, "flags", CLOTH_SIMSETTINGS_FLAG_GOAL);
RNA_def_property_ui_text(prop, "Pin Cloth", "Enable pinning of cloth vertices to other objects/positions"); RNA_def_property_ui_text(prop, "Pin Cloth", "Enable pinning of cloth vertices to other objects/positions");
RNA_def_property_update(prop, 0, "rna_cloth_pinning_changed"); RNA_def_property_update(prop, 0, "rna_cloth_pinning_changed");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
prop= RNA_def_property(srna, "pin_stiffness", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "pin_stiffness", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "goalspring"); RNA_def_property_float_sdna(prop, NULL, "goalspring");
RNA_def_property_range(prop, 0.0f, 50.0); RNA_def_property_range(prop, 0.0f, 50.0);
RNA_def_property_ui_text(prop, "Pin Stiffness", "Pin (vertex target position) spring stiffness"); RNA_def_property_ui_text(prop, "Pin Stiffness", "Pin (vertex target position) spring stiffness");
RNA_def_property_update(prop, 0, "rna_cloth_update"); RNA_def_property_update(prop, 0, "rna_cloth_update");
prop= RNA_def_property(srna, "quality", PROP_INT, PROP_NONE); prop = RNA_def_property(srna, "quality", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "stepsPerFrame"); RNA_def_property_int_sdna(prop, NULL, "stepsPerFrame");
RNA_def_property_range(prop, 4, 80); RNA_def_property_range(prop, 4, 80);
RNA_def_property_ui_text(prop, "Quality", RNA_def_property_ui_text(prop, "Quality",
@@ -318,70 +318,70 @@ static void rna_def_cloth_sim_settings(BlenderRNA *brna)
/* springs */ /* springs */
prop= RNA_def_property(srna, "use_stiffness_scale", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_stiffness_scale", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", CLOTH_SIMSETTINGS_FLAG_SCALING); RNA_def_property_boolean_sdna(prop, NULL, "flags", CLOTH_SIMSETTINGS_FLAG_SCALING);
RNA_def_property_ui_text(prop, "Stiffness Scaling", RNA_def_property_ui_text(prop, "Stiffness Scaling",
"If enabled, stiffness can be scaled along a weight painted vertex group"); "If enabled, stiffness can be scaled along a weight painted vertex group");
RNA_def_property_update(prop, 0, "rna_cloth_update"); RNA_def_property_update(prop, 0, "rna_cloth_update");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
prop= RNA_def_property(srna, "spring_damping", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "spring_damping", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "Cdis"); RNA_def_property_float_sdna(prop, NULL, "Cdis");
RNA_def_property_range(prop, 0.0f, 50.0f); RNA_def_property_range(prop, 0.0f, 50.0f);
RNA_def_property_ui_text(prop, "Spring Damping", "Damping of cloth velocity (higher = more smooth, less jiggling)"); RNA_def_property_ui_text(prop, "Spring Damping", "Damping of cloth velocity (higher = more smooth, less jiggling)");
RNA_def_property_update(prop, 0, "rna_cloth_update"); RNA_def_property_update(prop, 0, "rna_cloth_update");
prop= RNA_def_property(srna, "structural_stiffness", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "structural_stiffness", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "structural"); RNA_def_property_float_sdna(prop, NULL, "structural");
RNA_def_property_range(prop, 0.0f, 10000.0f); RNA_def_property_range(prop, 0.0f, 10000.0f);
RNA_def_property_ui_text(prop, "Structural Stiffness", "Overall stiffness of structure"); RNA_def_property_ui_text(prop, "Structural Stiffness", "Overall stiffness of structure");
RNA_def_property_update(prop, 0, "rna_cloth_update"); RNA_def_property_update(prop, 0, "rna_cloth_update");
prop= RNA_def_property(srna, "structural_stiffness_max", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "structural_stiffness_max", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "max_struct"); RNA_def_property_float_sdna(prop, NULL, "max_struct");
RNA_def_property_range(prop, 0.0f, 10000.0f); RNA_def_property_range(prop, 0.0f, 10000.0f);
RNA_def_property_float_funcs(prop, NULL, "rna_ClothSettings_max_struct_set", NULL); RNA_def_property_float_funcs(prop, NULL, "rna_ClothSettings_max_struct_set", NULL);
RNA_def_property_ui_text(prop, "Structural Stiffness Maximum", "Maximum structural stiffness value"); RNA_def_property_ui_text(prop, "Structural Stiffness Maximum", "Maximum structural stiffness value");
RNA_def_property_update(prop, 0, "rna_cloth_update"); RNA_def_property_update(prop, 0, "rna_cloth_update");
prop= RNA_def_property(srna, "vertex_group_structural_stiffness", PROP_STRING, PROP_NONE); prop = RNA_def_property(srna, "vertex_group_structural_stiffness", PROP_STRING, PROP_NONE);
RNA_def_property_string_funcs(prop, "rna_ClothSettings_struct_vgroup_get", "rna_ClothSettings_struct_vgroup_length", RNA_def_property_string_funcs(prop, "rna_ClothSettings_struct_vgroup_get", "rna_ClothSettings_struct_vgroup_length",
"rna_ClothSettings_struct_vgroup_set"); "rna_ClothSettings_struct_vgroup_set");
RNA_def_property_ui_text(prop, "Structural Stiffness Vertex Group", RNA_def_property_ui_text(prop, "Structural Stiffness Vertex Group",
"Vertex group for fine control over structural stiffness"); "Vertex group for fine control over structural stiffness");
RNA_def_property_update(prop, 0, "rna_cloth_update"); RNA_def_property_update(prop, 0, "rna_cloth_update");
prop= RNA_def_property(srna, "bending_stiffness", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "bending_stiffness", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "bending"); RNA_def_property_float_sdna(prop, NULL, "bending");
RNA_def_property_range(prop, 0.0f, 10000.0f); RNA_def_property_range(prop, 0.0f, 10000.0f);
RNA_def_property_ui_text(prop, "Bending Stiffness", "Wrinkle coefficient (higher = less smaller but more big wrinkles)"); RNA_def_property_ui_text(prop, "Bending Stiffness", "Wrinkle coefficient (higher = less smaller but more big wrinkles)");
RNA_def_property_update(prop, 0, "rna_cloth_update"); RNA_def_property_update(prop, 0, "rna_cloth_update");
prop= RNA_def_property(srna, "bending_stiffness_max", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "bending_stiffness_max", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "max_bend"); RNA_def_property_float_sdna(prop, NULL, "max_bend");
RNA_def_property_range(prop, 0.0f, 10000.0f); RNA_def_property_range(prop, 0.0f, 10000.0f);
RNA_def_property_float_funcs(prop, NULL, "rna_ClothSettings_max_bend_set", NULL); RNA_def_property_float_funcs(prop, NULL, "rna_ClothSettings_max_bend_set", NULL);
RNA_def_property_ui_text(prop, "Bending Stiffness Maximum", "Maximum bending stiffness value"); RNA_def_property_ui_text(prop, "Bending Stiffness Maximum", "Maximum bending stiffness value");
RNA_def_property_update(prop, 0, "rna_cloth_update"); RNA_def_property_update(prop, 0, "rna_cloth_update");
prop= RNA_def_property(srna, "vertex_group_bending", PROP_STRING, PROP_NONE); prop = RNA_def_property(srna, "vertex_group_bending", PROP_STRING, PROP_NONE);
RNA_def_property_string_funcs(prop, "rna_ClothSettings_bend_vgroup_get", "rna_ClothSettings_bend_vgroup_length", RNA_def_property_string_funcs(prop, "rna_ClothSettings_bend_vgroup_get", "rna_ClothSettings_bend_vgroup_length",
"rna_ClothSettings_bend_vgroup_set"); "rna_ClothSettings_bend_vgroup_set");
RNA_def_property_ui_text(prop, "Bending Stiffness Vertex Group", "Vertex group for fine control over bending stiffness"); RNA_def_property_ui_text(prop, "Bending Stiffness Vertex Group", "Vertex group for fine control over bending stiffness");
RNA_def_property_update(prop, 0, "rna_cloth_update"); RNA_def_property_update(prop, 0, "rna_cloth_update");
prop= RNA_def_property(srna, "effector_weights", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "effector_weights", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "EffectorWeights"); RNA_def_property_struct_type(prop, "EffectorWeights");
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Effector Weights", ""); RNA_def_property_ui_text(prop, "Effector Weights", "");
prop= RNA_def_property(srna, "pre_roll", PROP_INT, PROP_NONE); prop = RNA_def_property(srna, "pre_roll", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "preroll"); RNA_def_property_int_sdna(prop, NULL, "preroll");
RNA_def_property_range(prop, 0, 200); RNA_def_property_range(prop, 0, 200);
RNA_def_property_ui_text(prop, "Pre Roll", "Simulation starts on this frame"); RNA_def_property_ui_text(prop, "Pre Roll", "Simulation starts on this frame");
RNA_def_property_update(prop, 0, "rna_cloth_reset"); RNA_def_property_update(prop, 0, "rna_cloth_reset");
prop= RNA_def_property(srna, "rest_shape_key", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "rest_shape_key", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "ShapeKey"); RNA_def_property_struct_type(prop, "ShapeKey");
RNA_def_property_pointer_funcs(prop, "rna_ClothSettings_rest_shape_key_get", RNA_def_property_pointer_funcs(prop, "rna_ClothSettings_rest_shape_key_get",
@@ -440,19 +440,19 @@ static void rna_def_cloth_collision_settings(BlenderRNA *brna)
/* general collision */ /* general collision */
prop= RNA_def_property(srna, "use_collision", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_collision", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", CLOTH_COLLSETTINGS_FLAG_ENABLED); RNA_def_property_boolean_sdna(prop, NULL, "flags", CLOTH_COLLSETTINGS_FLAG_ENABLED);
RNA_def_property_ui_text(prop, "Enable Collision", "Enable collisions with other objects"); RNA_def_property_ui_text(prop, "Enable Collision", "Enable collisions with other objects");
RNA_def_property_update(prop, 0, "rna_cloth_update"); RNA_def_property_update(prop, 0, "rna_cloth_update");
prop= RNA_def_property(srna, "repel_force", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "repel_force", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "repel_force"); RNA_def_property_float_sdna(prop, NULL, "repel_force");
RNA_def_property_range(prop, 0.0f, 20.0f); RNA_def_property_range(prop, 0.0f, 20.0f);
RNA_def_property_float_default(prop, 1.0f); RNA_def_property_float_default(prop, 1.0f);
RNA_def_property_ui_text(prop, "Repulsion Force", "Repulsion force to apply on cloth when close to colliding"); RNA_def_property_ui_text(prop, "Repulsion Force", "Repulsion force to apply on cloth when close to colliding");
RNA_def_property_update(prop, 0, "rna_cloth_update"); RNA_def_property_update(prop, 0, "rna_cloth_update");
prop= RNA_def_property(srna, "distance_repel", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "distance_repel", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "distance_repel"); RNA_def_property_float_sdna(prop, NULL, "distance_repel");
RNA_def_property_range(prop, 0.001f, 10.0f); RNA_def_property_range(prop, 0.001f, 10.0f);
RNA_def_property_float_default(prop, 0.005f); RNA_def_property_float_default(prop, 0.005f);
@@ -460,19 +460,19 @@ static void rna_def_cloth_collision_settings(BlenderRNA *brna)
"Maximum distance to apply repulsion force, must be greater than minimum distance"); "Maximum distance to apply repulsion force, must be greater than minimum distance");
RNA_def_property_update(prop, 0, "rna_cloth_update"); RNA_def_property_update(prop, 0, "rna_cloth_update");
prop= RNA_def_property(srna, "distance_min", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "distance_min", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "epsilon"); RNA_def_property_float_sdna(prop, NULL, "epsilon");
RNA_def_property_range(prop, 0.001f, 1.0f); RNA_def_property_range(prop, 0.001f, 1.0f);
RNA_def_property_ui_text(prop, "Minimum Distance", RNA_def_property_ui_text(prop, "Minimum Distance",
"Minimum distance between collision objects before collision response takes in"); "Minimum distance between collision objects before collision response takes in");
RNA_def_property_update(prop, 0, "rna_cloth_update"); RNA_def_property_update(prop, 0, "rna_cloth_update");
prop= RNA_def_property(srna, "friction", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "friction", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 80.0f); RNA_def_property_range(prop, 0.0f, 80.0f);
RNA_def_property_ui_text(prop, "Friction", "Friction force if a collision happened (higher = less movement)"); RNA_def_property_ui_text(prop, "Friction", "Friction force if a collision happened (higher = less movement)");
RNA_def_property_update(prop, 0, "rna_cloth_update"); RNA_def_property_update(prop, 0, "rna_cloth_update");
prop= RNA_def_property(srna, "collision_quality", PROP_INT, PROP_NONE); prop = RNA_def_property(srna, "collision_quality", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "loop_count"); RNA_def_property_int_sdna(prop, NULL, "loop_count");
RNA_def_property_range(prop, 1, 20); RNA_def_property_range(prop, 1, 20);
RNA_def_property_ui_text(prop, "Collision Quality", RNA_def_property_ui_text(prop, "Collision Quality",
@@ -481,30 +481,30 @@ static void rna_def_cloth_collision_settings(BlenderRNA *brna)
/* self collision */ /* self collision */
prop= RNA_def_property(srna, "use_self_collision", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_self_collision", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", CLOTH_COLLSETTINGS_FLAG_SELF); RNA_def_property_boolean_sdna(prop, NULL, "flags", CLOTH_COLLSETTINGS_FLAG_SELF);
RNA_def_property_ui_text(prop, "Enable Self Collision", "Enable self collisions"); RNA_def_property_ui_text(prop, "Enable Self Collision", "Enable self collisions");
RNA_def_property_update(prop, 0, "rna_cloth_update"); RNA_def_property_update(prop, 0, "rna_cloth_update");
prop= RNA_def_property(srna, "self_distance_min", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "self_distance_min", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "selfepsilon"); RNA_def_property_float_sdna(prop, NULL, "selfepsilon");
RNA_def_property_range(prop, 0.5f, 1.0f); RNA_def_property_range(prop, 0.5f, 1.0f);
RNA_def_property_ui_text(prop, "Self Minimum Distance", "0.5 means no distance at all, 1.0 is maximum distance"); RNA_def_property_ui_text(prop, "Self Minimum Distance", "0.5 means no distance at all, 1.0 is maximum distance");
RNA_def_property_update(prop, 0, "rna_cloth_update"); RNA_def_property_update(prop, 0, "rna_cloth_update");
prop= RNA_def_property(srna, "self_friction", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "self_friction", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 80.0f); RNA_def_property_range(prop, 0.0f, 80.0f);
RNA_def_property_ui_text(prop, "Self Friction", "Friction/damping with self contact"); RNA_def_property_ui_text(prop, "Self Friction", "Friction/damping with self contact");
RNA_def_property_update(prop, 0, "rna_cloth_update"); RNA_def_property_update(prop, 0, "rna_cloth_update");
prop= RNA_def_property(srna, "self_collision_quality", PROP_INT, PROP_NONE); prop = RNA_def_property(srna, "self_collision_quality", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "self_loop_count"); RNA_def_property_int_sdna(prop, NULL, "self_loop_count");
RNA_def_property_range(prop, 1, 10); RNA_def_property_range(prop, 1, 10);
RNA_def_property_ui_text(prop, "Self Collision Quality", RNA_def_property_ui_text(prop, "Self Collision Quality",
"How many self collision iterations should be done (higher is better quality but slower)"); "How many self collision iterations should be done (higher is better quality but slower)");
RNA_def_property_update(prop, 0, "rna_cloth_update"); RNA_def_property_update(prop, 0, "rna_cloth_update");
prop= RNA_def_property(srna, "group", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "group", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Collision Group", "Limit colliders to this Group"); RNA_def_property_ui_text(prop, "Collision Group", "Limit colliders to this Group");
RNA_def_property_update(prop, 0, "rna_cloth_update"); RNA_def_property_update(prop, 0, "rna_cloth_update");

View File

@@ -55,11 +55,11 @@
static int rna_CurveMapping_curves_length(PointerRNA *ptr) static int rna_CurveMapping_curves_length(PointerRNA *ptr)
{ {
CurveMapping *cumap= (CurveMapping*)ptr->data; CurveMapping *cumap = (CurveMapping*)ptr->data;
int len; int len;
for(len=0; len<CM_TOT; len++) for (len = 0; len<CM_TOT; len++)
if(!cumap->cm[len].curve) if (!cumap->cm[len].curve)
break; break;
return len; return len;
@@ -67,16 +67,16 @@ static int rna_CurveMapping_curves_length(PointerRNA *ptr)
static void rna_CurveMapping_curves_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) static void rna_CurveMapping_curves_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{ {
CurveMapping *cumap= (CurveMapping*)ptr->data; CurveMapping *cumap = (CurveMapping*)ptr->data;
rna_iterator_array_begin(iter, cumap->cm, sizeof(CurveMap), rna_CurveMapping_curves_length(ptr), 0, NULL); rna_iterator_array_begin(iter, cumap->cm, sizeof(CurveMap), rna_CurveMapping_curves_length(ptr), 0, NULL);
} }
static void rna_CurveMapping_clip_set(PointerRNA *ptr, int value) static void rna_CurveMapping_clip_set(PointerRNA *ptr, int value)
{ {
CurveMapping *cumap= (CurveMapping*)ptr->data; CurveMapping *cumap = (CurveMapping*)ptr->data;
if(value) cumap->flag |= CUMA_DO_CLIP; if (value) cumap->flag |= CUMA_DO_CLIP;
else cumap->flag &= ~CUMA_DO_CLIP; else cumap->flag &= ~CUMA_DO_CLIP;
curvemapping_changed(cumap, 0); curvemapping_changed(cumap, 0);
@@ -84,52 +84,52 @@ static void rna_CurveMapping_clip_set(PointerRNA *ptr, int value)
static void rna_CurveMapping_black_level_set(PointerRNA *ptr, const float *values) static void rna_CurveMapping_black_level_set(PointerRNA *ptr, const float *values)
{ {
CurveMapping *cumap= (CurveMapping*)ptr->data; CurveMapping *cumap = (CurveMapping*)ptr->data;
cumap->black[0]= values[0]; cumap->black[0] = values[0];
cumap->black[1]= values[1]; cumap->black[1] = values[1];
cumap->black[2]= values[2]; cumap->black[2] = values[2];
curvemapping_set_black_white(cumap, NULL, NULL); curvemapping_set_black_white(cumap, NULL, NULL);
} }
static void rna_CurveMapping_white_level_set(PointerRNA *ptr, const float *values) static void rna_CurveMapping_white_level_set(PointerRNA *ptr, const float *values)
{ {
CurveMapping *cumap= (CurveMapping*)ptr->data; CurveMapping *cumap = (CurveMapping*)ptr->data;
cumap->white[0]= values[0]; cumap->white[0] = values[0];
cumap->white[1]= values[1]; cumap->white[1] = values[1];
cumap->white[2]= values[2]; cumap->white[2] = values[2];
curvemapping_set_black_white(cumap, NULL, NULL); curvemapping_set_black_white(cumap, NULL, NULL);
} }
static void rna_CurveMapping_clipminx_range(PointerRNA *ptr, float *min, float *max) static void rna_CurveMapping_clipminx_range(PointerRNA *ptr, float *min, float *max)
{ {
CurveMapping *cumap= (CurveMapping*)ptr->data; CurveMapping *cumap = (CurveMapping*)ptr->data;
*min= -100.0f; *min = -100.0f;
*max= cumap->clipr.xmax; *max = cumap->clipr.xmax;
} }
static void rna_CurveMapping_clipminy_range(PointerRNA *ptr, float *min, float *max) static void rna_CurveMapping_clipminy_range(PointerRNA *ptr, float *min, float *max)
{ {
CurveMapping *cumap= (CurveMapping*)ptr->data; CurveMapping *cumap = (CurveMapping*)ptr->data;
*min= -100.0f; *min = -100.0f;
*max= cumap->clipr.ymax; *max = cumap->clipr.ymax;
} }
static void rna_CurveMapping_clipmaxx_range(PointerRNA *ptr, float *min, float *max) static void rna_CurveMapping_clipmaxx_range(PointerRNA *ptr, float *min, float *max)
{ {
CurveMapping *cumap= (CurveMapping*)ptr->data; CurveMapping *cumap = (CurveMapping*)ptr->data;
*min= cumap->clipr.xmin; *min = cumap->clipr.xmin;
*max= 100.0f; *max = 100.0f;
} }
static void rna_CurveMapping_clipmaxy_range(PointerRNA *ptr, float *min, float *max) static void rna_CurveMapping_clipmaxy_range(PointerRNA *ptr, float *min, float *max)
{ {
CurveMapping *cumap= (CurveMapping*)ptr->data; CurveMapping *cumap = (CurveMapping*)ptr->data;
*min= cumap->clipr.ymin; *min = cumap->clipr.ymin;
*max= 100.0f; *max = 100.0f;
} }
@@ -137,12 +137,12 @@ static char *rna_ColorRamp_path(PointerRNA *ptr)
{ {
/* handle the cases where a single datablock may have 2 ramp types */ /* handle the cases where a single datablock may have 2 ramp types */
if (ptr->id.data) { if (ptr->id.data) {
ID *id= ptr->id.data; ID *id = ptr->id.data;
switch (GS(id->name)) { switch (GS(id->name)) {
case ID_MA: /* material has 2 cases - diffuse and specular */ case ID_MA: /* material has 2 cases - diffuse and specular */
{ {
Material *ma= (Material*)id; Material *ma = (Material*)id;
if (ptr->data == ma->ramp_col) if (ptr->data == ma->ramp_col)
return BLI_strdup("diffuse_ramp"); return BLI_strdup("diffuse_ramp");
@@ -170,26 +170,26 @@ static char *rna_ColorRampElement_path(PointerRNA *ptr)
#define COLRAMP_GETPATH \ #define COLRAMP_GETPATH \
{ \ { \
prop= RNA_struct_find_property(&ramp_ptr, "elements"); \ prop = RNA_struct_find_property(&ramp_ptr, "elements"); \
if (prop) { \ if (prop) { \
index= RNA_property_collection_lookup_index(&ramp_ptr, prop, ptr); \ index = RNA_property_collection_lookup_index(&ramp_ptr, prop, ptr); \
if (index >= 0) { \ if (index >= 0) { \
char *texture_path= rna_ColorRamp_path(&ramp_ptr); \ char *texture_path = rna_ColorRamp_path(&ramp_ptr); \
path= BLI_sprintfN("%s.elements[%d]", texture_path, index); \ path = BLI_sprintfN("%s.elements[%d]", texture_path, index); \
MEM_freeN(texture_path); \ MEM_freeN(texture_path); \
} \ } \
} \ } \
} }
/* determine the path from the ID-block to the ramp */ /* determine the path from the ID-block to the ramp */
// FIXME: this is a very slow way to do it, but it will have to suffice... /* FIXME: this is a very slow way to do it, but it will have to suffice... */
if (ptr->id.data) { if (ptr->id.data) {
ID *id= ptr->id.data; ID *id = ptr->id.data;
switch (GS(id->name)) { switch (GS(id->name)) {
case ID_MA: /* 2 cases for material - diffuse and spec */ case ID_MA: /* 2 cases for material - diffuse and spec */
{ {
Material *ma= (Material *)id; Material *ma = (Material *)id;
/* try diffuse first */ /* try diffuse first */
if (ma->ramp_col) { if (ma->ramp_col) {
@@ -204,13 +204,13 @@ static char *rna_ColorRampElement_path(PointerRNA *ptr)
} }
break; break;
// TODO: node trees need special attention /* TODO: node trees need special attention */
case ID_NT: case ID_NT:
{ {
bNodeTree *ntree = (bNodeTree *)id; bNodeTree *ntree = (bNodeTree *)id;
bNode *node; bNode *node;
for(node=ntree->nodes.first; node; node=node->next) { for (node = ntree->nodes.first; node; node = node->next) {
if (ELEM3(node->type, SH_NODE_VALTORGB, CMP_NODE_VALTORGB, TEX_NODE_VALTORGB)) { if (ELEM3(node->type, SH_NODE_VALTORGB, CMP_NODE_VALTORGB, TEX_NODE_VALTORGB)) {
RNA_pointer_create(id, &RNA_ColorRamp, node->storage, &ramp_ptr); RNA_pointer_create(id, &RNA_ColorRamp, node->storage, &ramp_ptr);
COLRAMP_GETPATH; COLRAMP_GETPATH;
@@ -239,12 +239,12 @@ static char *rna_ColorRampElement_path(PointerRNA *ptr)
static void rna_ColorRamp_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) static void rna_ColorRamp_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
{ {
if (ptr->id.data) { if (ptr->id.data) {
ID *id= ptr->id.data; ID *id = ptr->id.data;
switch (GS(id->name)) { switch (GS(id->name)) {
case ID_MA: case ID_MA:
{ {
Material *ma= ptr->id.data; Material *ma = ptr->id.data;
DAG_id_tag_update(&ma->id, 0); DAG_id_tag_update(&ma->id, 0);
WM_main_add_notifier(NC_MATERIAL|ND_SHADING_DRAW, ma); WM_main_add_notifier(NC_MATERIAL|ND_SHADING_DRAW, ma);
@@ -255,7 +255,7 @@ static void rna_ColorRamp_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *
bNodeTree *ntree = (bNodeTree *)id; bNodeTree *ntree = (bNodeTree *)id;
bNode *node; bNode *node;
for(node=ntree->nodes.first; node; node=node->next) { for (node = ntree->nodes.first; node; node = node->next) {
if (ELEM3(node->type, SH_NODE_VALTORGB, CMP_NODE_VALTORGB, TEX_NODE_VALTORGB)) { if (ELEM3(node->type, SH_NODE_VALTORGB, CMP_NODE_VALTORGB, TEX_NODE_VALTORGB)) {
ED_node_generic_update(bmain, ntree, node); ED_node_generic_update(bmain, ntree, node);
} }
@@ -264,7 +264,7 @@ static void rna_ColorRamp_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *
break; break;
case ID_TE: case ID_TE:
{ {
Tex *tex= ptr->id.data; Tex *tex = ptr->id.data;
DAG_id_tag_update(&tex->id, 0); DAG_id_tag_update(&tex->id, 0);
WM_main_add_notifier(NC_TEXTURE, tex); WM_main_add_notifier(NC_TEXTURE, tex);
@@ -283,9 +283,9 @@ static void rna_ColorRamp_eval(struct ColorBand *coba, float position, float col
static CBData *rna_ColorRampElement_new(struct ColorBand *coba, ReportList *reports, float position) static CBData *rna_ColorRampElement_new(struct ColorBand *coba, ReportList *reports, float position)
{ {
CBData *element= colorband_element_add(coba, position); CBData *element = colorband_element_add(coba, position);
if(element==NULL) if (element == NULL)
BKE_reportf(reports, RPT_ERROR, "Unable to add element to colorband (limit %d)", MAXCOLORBAND); BKE_reportf(reports, RPT_ERROR, "Unable to add element to colorband (limit %d)", MAXCOLORBAND);
return element; return element;
@@ -294,14 +294,14 @@ static CBData *rna_ColorRampElement_new(struct ColorBand *coba, ReportList *repo
static void rna_ColorRampElement_remove(struct ColorBand *coba, ReportList *reports, CBData *element) static void rna_ColorRampElement_remove(struct ColorBand *coba, ReportList *reports, CBData *element)
{ {
int index = (int)(element - coba->data); int index = (int)(element - coba->data);
if(colorband_element_remove(coba, index) == 0) if (colorband_element_remove(coba, index) == 0)
BKE_report(reports, RPT_ERROR, "Element not found in element collection or last element"); BKE_report(reports, RPT_ERROR, "Element not found in element collection or last element");
} }
static void rna_Scopes_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) static void rna_Scopes_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{ {
Scopes *s= (Scopes*)ptr->data; Scopes *s = (Scopes*)ptr->data;
s->ok = 0; s->ok = 0;
} }
@@ -317,24 +317,24 @@ static void rna_def_curvemappoint(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL} {0, NULL, 0, NULL, NULL}
}; };
srna= RNA_def_struct(brna, "CurveMapPoint", NULL); srna = RNA_def_struct(brna, "CurveMapPoint", NULL);
RNA_def_struct_ui_text(srna, "CurveMapPoint", "Point of a curve used for a curve mapping"); RNA_def_struct_ui_text(srna, "CurveMapPoint", "Point of a curve used for a curve mapping");
/* not editable for now, need to have CurveMapping to do curvemapping_changed */ /* not editable for now, need to have CurveMapping to do curvemapping_changed */
prop= RNA_def_property(srna, "location", PROP_FLOAT, PROP_XYZ); prop = RNA_def_property(srna, "location", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "x"); RNA_def_property_float_sdna(prop, NULL, "x");
RNA_def_property_array(prop, 2); RNA_def_property_array(prop, 2);
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Location", "X/Y coordinates of the curve point"); RNA_def_property_ui_text(prop, "Location", "X/Y coordinates of the curve point");
prop= RNA_def_property(srna, "handle_type", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "handle_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
RNA_def_property_enum_items(prop, prop_handle_type_items); RNA_def_property_enum_items(prop, prop_handle_type_items);
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Handle Type", "Curve interpolation at this point: Bezier or vector"); RNA_def_property_ui_text(prop, "Handle Type", "Curve interpolation at this point: Bezier or vector");
prop= RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CUMA_SELECT); RNA_def_property_boolean_sdna(prop, NULL, "flag", CUMA_SELECT);
RNA_def_property_ui_text(prop, "Select", "Selection state of the curve point"); RNA_def_property_ui_text(prop, "Select", "Selection state of the curve point");
} }
@@ -349,18 +349,18 @@ static void rna_def_curvemap(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL} {0, NULL, 0, NULL, NULL}
}; };
srna= RNA_def_struct(brna, "CurveMap", NULL); srna = RNA_def_struct(brna, "CurveMap", NULL);
RNA_def_struct_ui_text(srna, "CurveMap", "Curve in a curve mapping"); RNA_def_struct_ui_text(srna, "CurveMap", "Curve in a curve mapping");
/* not editable for now, need to have CurveMapping to do curvemapping_changed */ /* not editable for now, need to have CurveMapping to do curvemapping_changed */
prop= RNA_def_property(srna, "extend", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "extend", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
RNA_def_property_enum_items(prop, prop_extend_items); RNA_def_property_enum_items(prop, prop_extend_items);
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Extend", "Extrapolate the curve or extend it horizontally"); RNA_def_property_ui_text(prop, "Extend", "Extrapolate the curve or extend it horizontally");
prop= RNA_def_property(srna, "points", PROP_COLLECTION, PROP_NONE); prop = RNA_def_property(srna, "points", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "curve", "totpoint"); RNA_def_property_collection_sdna(prop, NULL, "curve", "totpoint");
RNA_def_property_struct_type(prop, "CurveMapPoint"); RNA_def_property_struct_type(prop, "CurveMapPoint");
RNA_def_property_ui_text(prop, "Points", ""); RNA_def_property_ui_text(prop, "Points", "");
@@ -371,50 +371,50 @@ static void rna_def_curvemapping(BlenderRNA *brna)
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
srna= RNA_def_struct(brna, "CurveMapping", NULL); srna = RNA_def_struct(brna, "CurveMapping", NULL);
RNA_def_struct_ui_text(srna, "CurveMapping", "Curve mapping to map color, vector and scalar values to other values using a user defined curve"); RNA_def_struct_ui_text(srna, "CurveMapping", "Curve mapping to map color, vector and scalar values to other values using a user defined curve");
prop= RNA_def_property(srna, "use_clip", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_clip", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CUMA_DO_CLIP); RNA_def_property_boolean_sdna(prop, NULL, "flag", CUMA_DO_CLIP);
RNA_def_property_ui_text(prop, "Clip", "Force the curve view to fit a defined boundary"); RNA_def_property_ui_text(prop, "Clip", "Force the curve view to fit a defined boundary");
RNA_def_property_boolean_funcs(prop, NULL, "rna_CurveMapping_clip_set"); RNA_def_property_boolean_funcs(prop, NULL, "rna_CurveMapping_clip_set");
prop= RNA_def_property(srna, "clip_min_x", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "clip_min_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "clipr.xmin"); RNA_def_property_float_sdna(prop, NULL, "clipr.xmin");
RNA_def_property_range(prop, -100.0f, 100.0f); RNA_def_property_range(prop, -100.0f, 100.0f);
RNA_def_property_ui_text(prop, "Clip Min X", ""); RNA_def_property_ui_text(prop, "Clip Min X", "");
RNA_def_property_float_funcs(prop, NULL, NULL, "rna_CurveMapping_clipminx_range"); RNA_def_property_float_funcs(prop, NULL, NULL, "rna_CurveMapping_clipminx_range");
prop= RNA_def_property(srna, "clip_min_y", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "clip_min_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "clipr.ymin"); RNA_def_property_float_sdna(prop, NULL, "clipr.ymin");
RNA_def_property_range(prop, -100.0f, 100.0f); RNA_def_property_range(prop, -100.0f, 100.0f);
RNA_def_property_ui_text(prop, "Clip Min Y", ""); RNA_def_property_ui_text(prop, "Clip Min Y", "");
RNA_def_property_float_funcs(prop, NULL, NULL, "rna_CurveMapping_clipminy_range"); RNA_def_property_float_funcs(prop, NULL, NULL, "rna_CurveMapping_clipminy_range");
prop= RNA_def_property(srna, "clip_max_x", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "clip_max_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "clipr.xmax"); RNA_def_property_float_sdna(prop, NULL, "clipr.xmax");
RNA_def_property_range(prop, -100.0f, 100.0f); RNA_def_property_range(prop, -100.0f, 100.0f);
RNA_def_property_ui_text(prop, "Clip Max X", ""); RNA_def_property_ui_text(prop, "Clip Max X", "");
RNA_def_property_float_funcs(prop, NULL, NULL, "rna_CurveMapping_clipmaxx_range"); RNA_def_property_float_funcs(prop, NULL, NULL, "rna_CurveMapping_clipmaxx_range");
prop= RNA_def_property(srna, "clip_max_y", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "clip_max_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "clipr.ymax"); RNA_def_property_float_sdna(prop, NULL, "clipr.ymax");
RNA_def_property_range(prop, -100.0f, 100.0f); RNA_def_property_range(prop, -100.0f, 100.0f);
RNA_def_property_ui_text(prop, "Clip Max Y", ""); RNA_def_property_ui_text(prop, "Clip Max Y", "");
RNA_def_property_float_funcs(prop, NULL, NULL, "rna_CurveMapping_clipmaxy_range"); RNA_def_property_float_funcs(prop, NULL, NULL, "rna_CurveMapping_clipmaxy_range");
prop= RNA_def_property(srna, "curves", PROP_COLLECTION, PROP_NONE); prop = RNA_def_property(srna, "curves", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_funcs(prop, "rna_CurveMapping_curves_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_CurveMapping_curves_length", NULL, NULL, NULL); RNA_def_property_collection_funcs(prop, "rna_CurveMapping_curves_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_CurveMapping_curves_length", NULL, NULL, NULL);
RNA_def_property_struct_type(prop, "CurveMap"); RNA_def_property_struct_type(prop, "CurveMap");
RNA_def_property_ui_text(prop, "Curves", ""); RNA_def_property_ui_text(prop, "Curves", "");
prop= RNA_def_property(srna, "black_level", PROP_FLOAT, PROP_COLOR); prop = RNA_def_property(srna, "black_level", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "black"); RNA_def_property_float_sdna(prop, NULL, "black");
RNA_def_property_range(prop, -1000.0f, 1000.0f); RNA_def_property_range(prop, -1000.0f, 1000.0f);
RNA_def_property_ui_text(prop, "Black Level", "For RGB curves, the color that black is mapped to"); RNA_def_property_ui_text(prop, "Black Level", "For RGB curves, the color that black is mapped to");
RNA_def_property_float_funcs(prop, NULL, "rna_CurveMapping_black_level_set", NULL); RNA_def_property_float_funcs(prop, NULL, "rna_CurveMapping_black_level_set", NULL);
prop= RNA_def_property(srna, "white_level", PROP_FLOAT, PROP_COLOR); prop = RNA_def_property(srna, "white_level", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "white"); RNA_def_property_float_sdna(prop, NULL, "white");
RNA_def_property_range(prop, -1000.0f, 1000.0f); RNA_def_property_range(prop, -1000.0f, 1000.0f);
RNA_def_property_ui_text(prop, "White Level", "For RGB curves, the color that white is mapped to"); RNA_def_property_ui_text(prop, "White Level", "For RGB curves, the color that white is mapped to");
@@ -426,18 +426,18 @@ static void rna_def_color_ramp_element(BlenderRNA *brna)
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
srna= RNA_def_struct(brna, "ColorRampElement", NULL); srna = RNA_def_struct(brna, "ColorRampElement", NULL);
RNA_def_struct_sdna(srna, "CBData"); RNA_def_struct_sdna(srna, "CBData");
RNA_def_struct_path_func(srna, "rna_ColorRampElement_path"); RNA_def_struct_path_func(srna, "rna_ColorRampElement_path");
RNA_def_struct_ui_text(srna, "Color Ramp Element", "Element defining a color at a position in the color ramp"); RNA_def_struct_ui_text(srna, "Color Ramp Element", "Element defining a color at a position in the color ramp");
prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR); prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "r"); RNA_def_property_float_sdna(prop, NULL, "r");
RNA_def_property_array(prop, 4); RNA_def_property_array(prop, 4);
RNA_def_property_ui_text(prop, "Color", "Set color of selected color stop"); RNA_def_property_ui_text(prop, "Color", "Set color of selected color stop");
RNA_def_property_update(prop, 0, "rna_ColorRamp_update"); RNA_def_property_update(prop, 0, "rna_ColorRamp_update");
prop= RNA_def_property(srna, "position", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "position", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "pos"); RNA_def_property_float_sdna(prop, NULL, "pos");
RNA_def_property_range(prop, 0, 1); RNA_def_property_range(prop, 0, 1);
RNA_def_property_ui_text(prop, "Position", "Set position of selected color stop"); RNA_def_property_ui_text(prop, "Position", "Set position of selected color stop");
@@ -451,7 +451,7 @@ static void rna_def_color_ramp_element_api(BlenderRNA *brna, PropertyRNA *cprop)
FunctionRNA *func; FunctionRNA *func;
RNA_def_property_srna(cprop, "ColorRampElements"); RNA_def_property_srna(cprop, "ColorRampElements");
srna= RNA_def_struct(brna, "ColorRampElements", NULL); srna = RNA_def_struct(brna, "ColorRampElements", NULL);
RNA_def_struct_sdna(srna, "ColorBand"); RNA_def_struct_sdna(srna, "ColorBand");
RNA_def_struct_path_func(srna, "rna_ColorRampElement_path"); RNA_def_struct_path_func(srna, "rna_ColorRampElement_path");
RNA_def_struct_ui_text(srna, "Color Ramp Elements", "Collection of Color Ramp Elements"); RNA_def_struct_ui_text(srna, "Color Ramp Elements", "Collection of Color Ramp Elements");
@@ -460,16 +460,16 @@ static void rna_def_color_ramp_element_api(BlenderRNA *brna, PropertyRNA *cprop)
func = RNA_def_function(srna, "new", "rna_ColorRampElement_new"); func = RNA_def_function(srna, "new", "rna_ColorRampElement_new");
RNA_def_function_ui_description(func, "Add element to ColorRamp"); RNA_def_function_ui_description(func, "Add element to ColorRamp");
RNA_def_function_flag(func, FUNC_USE_REPORTS); RNA_def_function_flag(func, FUNC_USE_REPORTS);
parm= RNA_def_float(func, "position", 0.0f, 0.0f, 1.0f, "Position", "Position to add element", 0.0f, 1.0f); parm = RNA_def_float(func, "position", 0.0f, 0.0f, 1.0f, "Position", "Position to add element", 0.0f, 1.0f);
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
/* return type */ /* return type */
parm= RNA_def_pointer(func, "element", "ColorRampElement", "", "New element"); parm = RNA_def_pointer(func, "element", "ColorRampElement", "", "New element");
RNA_def_function_return(func, parm); RNA_def_function_return(func, parm);
func = RNA_def_function(srna, "remove", "rna_ColorRampElement_remove"); func = RNA_def_function(srna, "remove", "rna_ColorRampElement_remove");
RNA_def_function_ui_description(func, "Delete element from ColorRamp"); RNA_def_function_ui_description(func, "Delete element from ColorRamp");
RNA_def_function_flag(func, FUNC_USE_REPORTS); RNA_def_function_flag(func, FUNC_USE_REPORTS);
parm= RNA_def_pointer(func, "element", "ColorRampElement", "", "Element to remove"); parm = RNA_def_pointer(func, "element", "ColorRampElement", "", "Element to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
} }
@@ -487,26 +487,26 @@ static void rna_def_color_ramp(BlenderRNA *brna)
{4, "CONSTANT", 0, "Constant", ""}, {4, "CONSTANT", 0, "Constant", ""},
{0, NULL, 0, NULL, NULL}}; {0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "ColorRamp", NULL); srna = RNA_def_struct(brna, "ColorRamp", NULL);
RNA_def_struct_sdna(srna, "ColorBand"); RNA_def_struct_sdna(srna, "ColorBand");
RNA_def_struct_path_func(srna, "rna_ColorRamp_path"); RNA_def_struct_path_func(srna, "rna_ColorRamp_path");
RNA_def_struct_ui_text(srna, "Color Ramp", "Color ramp mapping a scalar value to a color"); RNA_def_struct_ui_text(srna, "Color Ramp", "Color ramp mapping a scalar value to a color");
prop= RNA_def_property(srna, "elements", PROP_COLLECTION, PROP_COLOR); prop = RNA_def_property(srna, "elements", PROP_COLLECTION, PROP_COLOR);
RNA_def_property_collection_sdna(prop, NULL, "data", "tot"); RNA_def_property_collection_sdna(prop, NULL, "data", "tot");
RNA_def_property_struct_type(prop, "ColorRampElement"); RNA_def_property_struct_type(prop, "ColorRampElement");
RNA_def_property_ui_text(prop, "Elements", ""); RNA_def_property_ui_text(prop, "Elements", "");
RNA_def_property_update(prop, 0, "rna_ColorRamp_update"); RNA_def_property_update(prop, 0, "rna_ColorRamp_update");
rna_def_color_ramp_element_api(brna, prop); rna_def_color_ramp_element_api(brna, prop);
prop= RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "ipotype"); RNA_def_property_enum_sdna(prop, NULL, "ipotype");
RNA_def_property_enum_items(prop, prop_interpolation_items); RNA_def_property_enum_items(prop, prop_interpolation_items);
RNA_def_property_ui_text(prop, "Interpolation", ""); RNA_def_property_ui_text(prop, "Interpolation", "");
RNA_def_property_update(prop, 0, "rna_ColorRamp_update"); RNA_def_property_update(prop, 0, "rna_ColorRamp_update");
#if 0 // use len(elements) #if 0 /* use len(elements) */
prop= RNA_def_property(srna, "total", PROP_INT, PROP_NONE); prop = RNA_def_property(srna, "total", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "tot"); RNA_def_property_int_sdna(prop, NULL, "tot");
/* needs a function to do the right thing when adding elements like colorband_add_cb() */ /* needs a function to do the right thing when adding elements like colorband_add_cb() */
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
@@ -517,7 +517,7 @@ static void rna_def_color_ramp(BlenderRNA *brna)
func = RNA_def_function(srna, "evaluate", "rna_ColorRamp_eval"); func = RNA_def_function(srna, "evaluate", "rna_ColorRamp_eval");
RNA_def_function_ui_description(func, "Evaluate ColorRamp"); RNA_def_function_ui_description(func, "Evaluate ColorRamp");
prop= RNA_def_float(func, "position", 1.0f, 0.0f, 1.0f, "Position", "Evaluate ColorRamp at position", 0.0f, 1.0f); prop = RNA_def_float(func, "position", 1.0f, 0.0f, 1.0f, "Position", "Evaluate ColorRamp at position", 0.0f, 1.0f);
RNA_def_property_flag(prop, PROP_REQUIRED); RNA_def_property_flag(prop, PROP_REQUIRED);
/* return */ /* return */
prop = RNA_def_float_color(func, "color", 4, NULL, -FLT_MAX, FLT_MAX, "Color", "Color at given position", -FLT_MAX, FLT_MAX); prop = RNA_def_float_color(func, "color", 4, NULL, -FLT_MAX, FLT_MAX, "Color", "Color at given position", -FLT_MAX, FLT_MAX);
@@ -538,10 +538,10 @@ static void rna_def_histogram(BlenderRNA *brna)
{HISTO_MODE_B, "B", ICON_COLOR, "Blue", ""}, {HISTO_MODE_B, "B", ICON_COLOR, "Blue", ""},
{0, NULL, 0, NULL, NULL}}; {0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "Histogram", NULL); srna = RNA_def_struct(brna, "Histogram", NULL);
RNA_def_struct_ui_text(srna, "Histogram", "Statistical view of the levels of color in an image"); RNA_def_struct_ui_text(srna, "Histogram", "Statistical view of the levels of color in an image");
prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "mode"); RNA_def_property_enum_sdna(prop, NULL, "mode");
RNA_def_property_enum_items(prop, prop_mode_items); RNA_def_property_enum_items(prop, prop_mode_items);
RNA_def_property_ui_text(prop, "Mode", "Channels to display when drawing the histogram"); RNA_def_property_ui_text(prop, "Mode", "Channels to display when drawing the histogram");
@@ -561,38 +561,38 @@ static void rna_def_scopes(BlenderRNA *brna)
{SCOPES_WAVEFRM_YCC_JPEG, "YCBCRJPG", ICON_COLOR, "YCbCr (Jpeg)", ""}, {SCOPES_WAVEFRM_YCC_JPEG, "YCBCRJPG", ICON_COLOR, "YCbCr (Jpeg)", ""},
{0, NULL, 0, NULL, NULL}}; {0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "Scopes", NULL); srna = RNA_def_struct(brna, "Scopes", NULL);
RNA_def_struct_ui_text(srna, "Scopes", "Scopes for statistical view of an image"); RNA_def_struct_ui_text(srna, "Scopes", "Scopes for statistical view of an image");
prop= RNA_def_property(srna, "use_full_resolution", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_full_resolution", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, "Scopes", "sample_full", 1); RNA_def_property_boolean_sdna(prop, "Scopes", "sample_full", 1);
RNA_def_property_ui_text(prop, "Full Sample", "Sample every pixel of the image"); RNA_def_property_ui_text(prop, "Full Sample", "Sample every pixel of the image");
RNA_def_property_update(prop, 0, "rna_Scopes_update"); RNA_def_property_update(prop, 0, "rna_Scopes_update");
prop= RNA_def_property(srna, "accuracy", PROP_FLOAT, PROP_PERCENTAGE); prop = RNA_def_property(srna, "accuracy", PROP_FLOAT, PROP_PERCENTAGE);
RNA_def_property_float_sdna(prop, "Scopes", "accuracy"); RNA_def_property_float_sdna(prop, "Scopes", "accuracy");
RNA_def_property_range(prop, 0.0, 100.0); RNA_def_property_range(prop, 0.0, 100.0);
RNA_def_property_ui_range(prop, 0.0, 100.0, 10, 1); RNA_def_property_ui_range(prop, 0.0, 100.0, 10, 1);
RNA_def_property_ui_text(prop, "Accuracy", "Proportion of original image source pixel lines to sample"); RNA_def_property_ui_text(prop, "Accuracy", "Proportion of original image source pixel lines to sample");
RNA_def_property_update(prop, 0, "rna_Scopes_update"); RNA_def_property_update(prop, 0, "rna_Scopes_update");
prop= RNA_def_property(srna, "histogram", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "histogram", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, "Scopes", "hist"); RNA_def_property_pointer_sdna(prop, "Scopes", "hist");
RNA_def_property_struct_type(prop, "Histogram"); RNA_def_property_struct_type(prop, "Histogram");
RNA_def_property_ui_text(prop, "Histogram", "Histogram for viewing image statistics"); RNA_def_property_ui_text(prop, "Histogram", "Histogram for viewing image statistics");
prop= RNA_def_property(srna, "waveform_mode", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "waveform_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, "Scopes", "wavefrm_mode"); RNA_def_property_enum_sdna(prop, "Scopes", "wavefrm_mode");
RNA_def_property_enum_items(prop, prop_wavefrm_mode_items); RNA_def_property_enum_items(prop, prop_wavefrm_mode_items);
RNA_def_property_ui_text(prop, "Waveform Mode", ""); RNA_def_property_ui_text(prop, "Waveform Mode", "");
RNA_def_property_update(prop, 0, "rna_Scopes_update"); RNA_def_property_update(prop, 0, "rna_Scopes_update");
prop= RNA_def_property(srna, "waveform_alpha", PROP_FLOAT, PROP_PERCENTAGE); prop = RNA_def_property(srna, "waveform_alpha", PROP_FLOAT, PROP_PERCENTAGE);
RNA_def_property_float_sdna(prop, "Scopes", "wavefrm_alpha"); RNA_def_property_float_sdna(prop, "Scopes", "wavefrm_alpha");
RNA_def_property_range(prop, 0, 1); RNA_def_property_range(prop, 0, 1);
RNA_def_property_ui_text(prop, "Waveform Opacity", "Opacity of the points"); RNA_def_property_ui_text(prop, "Waveform Opacity", "Opacity of the points");
prop= RNA_def_property(srna, "vectorscope_alpha", PROP_FLOAT, PROP_PERCENTAGE); prop = RNA_def_property(srna, "vectorscope_alpha", PROP_FLOAT, PROP_PERCENTAGE);
RNA_def_property_float_sdna(prop, "Scopes", "vecscope_alpha"); RNA_def_property_float_sdna(prop, "Scopes", "vecscope_alpha");
RNA_def_property_range(prop, 0, 1); RNA_def_property_range(prop, 0, 1);
RNA_def_property_ui_text(prop, "Vectorscope Opacity", "Opacity of the points"); RNA_def_property_ui_text(prop, "Vectorscope Opacity", "Opacity of the points");

File diff suppressed because it is too large Load Diff

View File

@@ -41,25 +41,25 @@
static PointerRNA rna_Context_manager_get(PointerRNA *ptr) static PointerRNA rna_Context_manager_get(PointerRNA *ptr)
{ {
bContext *C= (bContext*)ptr->data; bContext *C = (bContext*)ptr->data;
return rna_pointer_inherit_refine(ptr, &RNA_WindowManager, CTX_wm_manager(C)); return rna_pointer_inherit_refine(ptr, &RNA_WindowManager, CTX_wm_manager(C));
} }
static PointerRNA rna_Context_window_get(PointerRNA *ptr) static PointerRNA rna_Context_window_get(PointerRNA *ptr)
{ {
bContext *C= (bContext*)ptr->data; bContext *C = (bContext*)ptr->data;
return rna_pointer_inherit_refine(ptr, &RNA_Window, CTX_wm_window(C)); return rna_pointer_inherit_refine(ptr, &RNA_Window, CTX_wm_window(C));
} }
static PointerRNA rna_Context_screen_get(PointerRNA *ptr) static PointerRNA rna_Context_screen_get(PointerRNA *ptr)
{ {
bContext *C= (bContext*)ptr->data; bContext *C = (bContext*)ptr->data;
return rna_pointer_inherit_refine(ptr, &RNA_Screen, CTX_wm_screen(C)); return rna_pointer_inherit_refine(ptr, &RNA_Screen, CTX_wm_screen(C));
} }
static PointerRNA rna_Context_area_get(PointerRNA *ptr) static PointerRNA rna_Context_area_get(PointerRNA *ptr)
{ {
bContext *C= (bContext*)ptr->data; bContext *C = (bContext*)ptr->data;
PointerRNA newptr; PointerRNA newptr;
RNA_pointer_create((ID*)CTX_wm_screen(C), &RNA_Area, CTX_wm_area(C), &newptr); RNA_pointer_create((ID*)CTX_wm_screen(C), &RNA_Area, CTX_wm_area(C), &newptr);
return newptr; return newptr;
@@ -67,7 +67,7 @@ static PointerRNA rna_Context_area_get(PointerRNA *ptr)
static PointerRNA rna_Context_space_data_get(PointerRNA *ptr) static PointerRNA rna_Context_space_data_get(PointerRNA *ptr)
{ {
bContext *C= (bContext*)ptr->data; bContext *C = (bContext*)ptr->data;
PointerRNA newptr; PointerRNA newptr;
RNA_pointer_create((ID*)CTX_wm_screen(C), &RNA_Space, CTX_wm_space_data(C), &newptr); RNA_pointer_create((ID*)CTX_wm_screen(C), &RNA_Space, CTX_wm_space_data(C), &newptr);
return newptr; return newptr;
@@ -75,7 +75,7 @@ static PointerRNA rna_Context_space_data_get(PointerRNA *ptr)
static PointerRNA rna_Context_region_get(PointerRNA *ptr) static PointerRNA rna_Context_region_get(PointerRNA *ptr)
{ {
bContext *C= (bContext*)ptr->data; bContext *C = (bContext*)ptr->data;
PointerRNA newptr; PointerRNA newptr;
RNA_pointer_create((ID*)CTX_wm_screen(C), &RNA_Region, CTX_wm_region(C), &newptr); RNA_pointer_create((ID*)CTX_wm_screen(C), &RNA_Region, CTX_wm_region(C), &newptr);
return newptr; return newptr;
@@ -83,10 +83,10 @@ static PointerRNA rna_Context_region_get(PointerRNA *ptr)
static PointerRNA rna_Context_region_data_get(PointerRNA *ptr) static PointerRNA rna_Context_region_data_get(PointerRNA *ptr)
{ {
bContext *C= (bContext*)ptr->data; bContext *C = (bContext*)ptr->data;
/* only exists for one space still, no generic system yet */ /* only exists for one space still, no generic system yet */
if(CTX_wm_view3d(C)) { if (CTX_wm_view3d(C)) {
PointerRNA newptr; PointerRNA newptr;
RNA_pointer_create((ID*)CTX_wm_screen(C), &RNA_RegionView3D, CTX_wm_region_data(C), &newptr); RNA_pointer_create((ID*)CTX_wm_screen(C), &RNA_RegionView3D, CTX_wm_region_data(C), &newptr);
return newptr; return newptr;
@@ -97,20 +97,20 @@ static PointerRNA rna_Context_region_data_get(PointerRNA *ptr)
static PointerRNA rna_Context_main_get(PointerRNA *ptr) static PointerRNA rna_Context_main_get(PointerRNA *ptr)
{ {
bContext *C= (bContext*)ptr->data; bContext *C = (bContext*)ptr->data;
return rna_pointer_inherit_refine(ptr, &RNA_BlendData, CTX_data_main(C)); return rna_pointer_inherit_refine(ptr, &RNA_BlendData, CTX_data_main(C));
} }
static PointerRNA rna_Context_scene_get(PointerRNA *ptr) static PointerRNA rna_Context_scene_get(PointerRNA *ptr)
{ {
bContext *C= (bContext*)ptr->data; bContext *C = (bContext*)ptr->data;
return rna_pointer_inherit_refine(ptr, &RNA_Scene, CTX_data_scene(C)); return rna_pointer_inherit_refine(ptr, &RNA_Scene, CTX_data_scene(C));
} }
static PointerRNA rna_Context_tool_settings_get(PointerRNA *ptr) static PointerRNA rna_Context_tool_settings_get(PointerRNA *ptr)
{ {
bContext *C= (bContext*)ptr->data; bContext *C = (bContext*)ptr->data;
ptr->id.data= CTX_data_scene(C); ptr->id.data = CTX_data_scene(C);
return rna_pointer_inherit_refine(ptr, &RNA_ToolSettings, CTX_data_tool_settings(C)); return rna_pointer_inherit_refine(ptr, &RNA_ToolSettings, CTX_data_tool_settings(C));
} }
@@ -123,7 +123,7 @@ static PointerRNA rna_Context_user_preferences_get(PointerRNA *UNUSED(ptr))
static int rna_Context_mode_get(PointerRNA *ptr) static int rna_Context_mode_get(PointerRNA *ptr)
{ {
bContext *C= (bContext*)ptr->data; bContext *C = (bContext*)ptr->data;
return CTX_data_mode_enum(C); return CTX_data_mode_enum(C);
} }
@@ -139,7 +139,7 @@ void RNA_def_context(BlenderRNA *brna)
{CTX_MODE_EDIT_CURVE, "EDIT_CURVE", 0, "Curve Edit", ""}, {CTX_MODE_EDIT_CURVE, "EDIT_CURVE", 0, "Curve Edit", ""},
{CTX_MODE_EDIT_SURFACE, "EDIT_SURFACE", 0, "Surface Edit", ""}, {CTX_MODE_EDIT_SURFACE, "EDIT_SURFACE", 0, "Surface Edit", ""},
{CTX_MODE_EDIT_TEXT, "EDIT_TEXT", 0, "Edit Edit", ""}, {CTX_MODE_EDIT_TEXT, "EDIT_TEXT", 0, "Edit Edit", ""},
{CTX_MODE_EDIT_ARMATURE, "EDIT_ARMATURE", 0, "Armature Edit", ""}, // PARSKEL reuse will give issues {CTX_MODE_EDIT_ARMATURE, "EDIT_ARMATURE", 0, "Armature Edit", ""}, /* PARSKEL reuse will give issues */
{CTX_MODE_EDIT_METABALL, "EDIT_METABALL", 0, "Metaball Edit", ""}, {CTX_MODE_EDIT_METABALL, "EDIT_METABALL", 0, "Metaball Edit", ""},
{CTX_MODE_EDIT_LATTICE, "EDIT_LATTICE", 0, "Lattice Edit", ""}, {CTX_MODE_EDIT_LATTICE, "EDIT_LATTICE", 0, "Lattice Edit", ""},
{CTX_MODE_POSE, "POSE", 0, "Pose ", ""}, {CTX_MODE_POSE, "POSE", 0, "Pose ", ""},
@@ -151,68 +151,68 @@ void RNA_def_context(BlenderRNA *brna)
{CTX_MODE_OBJECT, "OBJECT", 0, "Object", ""}, {CTX_MODE_OBJECT, "OBJECT", 0, "Object", ""},
{0, NULL, 0, NULL, NULL}}; {0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "Context", NULL); srna = RNA_def_struct(brna, "Context", NULL);
RNA_def_struct_ui_text(srna, "Context", "Current windowmanager and data context"); RNA_def_struct_ui_text(srna, "Context", "Current windowmanager and data context");
RNA_def_struct_sdna(srna, "bContext"); RNA_def_struct_sdna(srna, "bContext");
/* WM */ /* WM */
prop= RNA_def_property(srna, "window_manager", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "window_manager", PROP_POINTER, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "WindowManager"); RNA_def_property_struct_type(prop, "WindowManager");
RNA_def_property_pointer_funcs(prop, "rna_Context_manager_get", NULL, NULL, NULL); RNA_def_property_pointer_funcs(prop, "rna_Context_manager_get", NULL, NULL, NULL);
prop= RNA_def_property(srna, "window", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "window", PROP_POINTER, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "Window"); RNA_def_property_struct_type(prop, "Window");
RNA_def_property_pointer_funcs(prop, "rna_Context_window_get", NULL, NULL, NULL); RNA_def_property_pointer_funcs(prop, "rna_Context_window_get", NULL, NULL, NULL);
prop= RNA_def_property(srna, "screen", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "screen", PROP_POINTER, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "Screen"); RNA_def_property_struct_type(prop, "Screen");
RNA_def_property_pointer_funcs(prop, "rna_Context_screen_get", NULL, NULL, NULL); RNA_def_property_pointer_funcs(prop, "rna_Context_screen_get", NULL, NULL, NULL);
prop= RNA_def_property(srna, "area", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "area", PROP_POINTER, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "Area"); RNA_def_property_struct_type(prop, "Area");
RNA_def_property_pointer_funcs(prop, "rna_Context_area_get", NULL, NULL, NULL); RNA_def_property_pointer_funcs(prop, "rna_Context_area_get", NULL, NULL, NULL);
prop= RNA_def_property(srna, "space_data", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "space_data", PROP_POINTER, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "Space"); RNA_def_property_struct_type(prop, "Space");
RNA_def_property_pointer_funcs(prop, "rna_Context_space_data_get", NULL, NULL, NULL); RNA_def_property_pointer_funcs(prop, "rna_Context_space_data_get", NULL, NULL, NULL);
prop= RNA_def_property(srna, "region", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "region", PROP_POINTER, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "Region"); RNA_def_property_struct_type(prop, "Region");
RNA_def_property_pointer_funcs(prop, "rna_Context_region_get", NULL, NULL, NULL); RNA_def_property_pointer_funcs(prop, "rna_Context_region_get", NULL, NULL, NULL);
prop= RNA_def_property(srna, "region_data", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "region_data", PROP_POINTER, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "RegionView3D"); RNA_def_property_struct_type(prop, "RegionView3D");
RNA_def_property_pointer_funcs(prop, "rna_Context_region_data_get", NULL, NULL, NULL); RNA_def_property_pointer_funcs(prop, "rna_Context_region_data_get", NULL, NULL, NULL);
/* Data */ /* Data */
prop= RNA_def_property(srna, "blend_data", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "blend_data", PROP_POINTER, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "BlendData"); RNA_def_property_struct_type(prop, "BlendData");
RNA_def_property_pointer_funcs(prop, "rna_Context_main_get", NULL, NULL, NULL); RNA_def_property_pointer_funcs(prop, "rna_Context_main_get", NULL, NULL, NULL);
prop= RNA_def_property(srna, "scene", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "scene", PROP_POINTER, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "Scene"); RNA_def_property_struct_type(prop, "Scene");
RNA_def_property_pointer_funcs(prop, "rna_Context_scene_get", NULL, NULL, NULL); RNA_def_property_pointer_funcs(prop, "rna_Context_scene_get", NULL, NULL, NULL);
prop= RNA_def_property(srna, "tool_settings", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "tool_settings", PROP_POINTER, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "ToolSettings"); RNA_def_property_struct_type(prop, "ToolSettings");
RNA_def_property_pointer_funcs(prop, "rna_Context_tool_settings_get", NULL, NULL, NULL); RNA_def_property_pointer_funcs(prop, "rna_Context_tool_settings_get", NULL, NULL, NULL);
prop= RNA_def_property(srna, "user_preferences", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "user_preferences", PROP_POINTER, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "UserPreferences"); RNA_def_property_struct_type(prop, "UserPreferences");
RNA_def_property_pointer_funcs(prop, "rna_Context_user_preferences_get", NULL, NULL, NULL); RNA_def_property_pointer_funcs(prop, "rna_Context_user_preferences_get", NULL, NULL, NULL);
prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, mode_items); RNA_def_property_enum_items(prop, mode_items);
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_enum_funcs(prop, "rna_Context_mode_get", NULL, NULL); RNA_def_property_enum_funcs(prop, "rna_Context_mode_get", NULL, NULL);

View File

@@ -34,7 +34,7 @@
#include "DNA_object_types.h" #include "DNA_object_types.h"
#include "DNA_controller_types.h" #include "DNA_controller_types.h"
EnumPropertyItem controller_type_items[] ={ EnumPropertyItem controller_type_items[] = {
{CONT_LOGIC_AND, "LOGIC_AND", 0, "And", "Logic And"}, {CONT_LOGIC_AND, "LOGIC_AND", 0, "And", "Logic And"},
{CONT_LOGIC_OR, "LOGIC_OR", 0, "Or", "Logic Or"}, {CONT_LOGIC_OR, "LOGIC_OR", 0, "Or", "Logic Or"},
{CONT_LOGIC_NAND, "LOGIC_NAND", 0, "Nand", "Logic Nand"}, {CONT_LOGIC_NAND, "LOGIC_NAND", 0, "Nand", "Logic Nand"},
@@ -52,9 +52,9 @@ EnumPropertyItem controller_type_items[] ={
static struct StructRNA* rna_Controller_refine(struct PointerRNA *ptr) static struct StructRNA* rna_Controller_refine(struct PointerRNA *ptr)
{ {
bController *controller= (bController*)ptr->data; bController *controller = (bController*)ptr->data;
switch(controller->type) { switch (controller->type) {
case CONT_LOGIC_AND: case CONT_LOGIC_AND:
return &RNA_AndController; return &RNA_AndController;
case CONT_LOGIC_OR: case CONT_LOGIC_OR:
@@ -78,19 +78,19 @@ static struct StructRNA* rna_Controller_refine(struct PointerRNA *ptr)
void rna_Constroller_name_set(PointerRNA *ptr, const char *value) void rna_Constroller_name_set(PointerRNA *ptr, const char *value)
{ {
bController *cont= (bController *)ptr->data; bController *cont = (bController *)ptr->data;
BLI_strncpy_utf8(cont->name, value, sizeof(cont->name)); BLI_strncpy_utf8(cont->name, value, sizeof(cont->name));
if (ptr->id.data) { if (ptr->id.data) {
Object *ob= (Object *)ptr->id.data; Object *ob = (Object *)ptr->id.data;
BLI_uniquename(&ob->controllers, cont, "Controller", '.', offsetof(bController, name), sizeof(cont->name)); BLI_uniquename(&ob->controllers, cont, "Controller", '.', offsetof(bController, name), sizeof(cont->name));
} }
} }
static void rna_Controller_type_set(struct PointerRNA *ptr, int value) static void rna_Controller_type_set(struct PointerRNA *ptr, int value)
{ {
bController *cont= (bController *)ptr->data; bController *cont = (bController *)ptr->data;
if (value != cont->type) if (value != cont->type)
{ {
cont->type = value; cont->type = value;
@@ -100,13 +100,13 @@ static void rna_Controller_type_set(struct PointerRNA *ptr, int value)
static void rna_Controller_mode_set(struct PointerRNA *ptr, int value) static void rna_Controller_mode_set(struct PointerRNA *ptr, int value)
{ {
bController *cont= (bController *)ptr->data; bController *cont = (bController *)ptr->data;
bPythonCont *pycon= (bPythonCont *)cont->data; bPythonCont *pycon = (bPythonCont *)cont->data;
// if mode changed and previous mode were Script /* if mode changed and previous mode were Script */
if (value != pycon->mode && pycon->mode == CONT_PY_SCRIPT) if (value != pycon->mode && pycon->mode == CONT_PY_SCRIPT)
{ {
// clear script to avoid it to get linked with the controller /* clear script to avoid it to get linked with the controller */
pycon->text = NULL; pycon->text = NULL;
} }
pycon->mode = value; pycon->mode = value;
@@ -114,10 +114,10 @@ static void rna_Controller_mode_set(struct PointerRNA *ptr, int value)
static int rna_Controller_state_number_get(struct PointerRNA *ptr) static int rna_Controller_state_number_get(struct PointerRNA *ptr)
{ {
bController *cont= (bController *)ptr->data; bController *cont = (bController *)ptr->data;
int bit; int bit;
for (bit=0; bit<32; bit++) { for (bit = 0; bit<32; bit++) {
if (cont->state_mask & (1<<bit)) if (cont->state_mask & (1<<bit))
return bit+1; return bit+1;
} }
@@ -126,7 +126,7 @@ static int rna_Controller_state_number_get(struct PointerRNA *ptr)
static void rna_Controller_state_number_set(struct PointerRNA *ptr, const int value) static void rna_Controller_state_number_set(struct PointerRNA *ptr, const int value)
{ {
bController *cont= (bController *)ptr->data; bController *cont = (bController *)ptr->data;
if (value < 1 || value > OB_MAX_STATES) if (value < 1 || value > OB_MAX_STATES)
return; return;
@@ -148,33 +148,33 @@ static int rna_Controller_actuators_length(PointerRNA *ptr)
#if 0 /* editable is set to false, comment for now. */ #if 0 /* editable is set to false, comment for now. */
static void rna_Controller_state_get(PointerRNA *ptr, int *values) static void rna_Controller_state_get(PointerRNA *ptr, int *values)
{ {
bController *cont= (bController *)ptr->data; bController *cont = (bController *)ptr->data;
int i; int i;
memset(values, 0, sizeof(int)*OB_MAX_STATES); memset(values, 0, sizeof(int)*OB_MAX_STATES);
for(i=0; i<OB_MAX_STATES; i++) for (i = 0; i<OB_MAX_STATES; i++)
values[i] = (cont->state_mask & (1<<i)); values[i] = (cont->state_mask & (1<<i));
} }
static void rna_Controller_state_set(PointerRNA *ptr, const int *values) static void rna_Controller_state_set(PointerRNA *ptr, const int *values)
{ {
bController *cont= (bController *)ptr->data; bController *cont = (bController *)ptr->data;
int i, tot= 0; int i, tot = 0;
/* ensure we always have some state selected */ /* ensure we always have some state selected */
for(i=0; i<OB_MAX_STATES; i++) for (i = 0; i<OB_MAX_STATES; i++)
if(values[i]) if (values[i])
tot++; tot++;
if(tot==0) if (tot == 0)
return; return;
/* only works for one state at once */ /* only works for one state at once */
if(tot>1) if (tot>1)
return; return;
for(i=0; i<OB_MAX_STATES; i++) { for (i = 0; i<OB_MAX_STATES; i++) {
if(values[i]) cont->state_mask |= (1<<i); if (values[i]) cont->state_mask |= (1<<i);
else cont->state_mask &= ~(1<<i); else cont->state_mask &= ~(1<<i);
} }
} }
@@ -187,45 +187,45 @@ void RNA_def_controller(BlenderRNA *brna)
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
static EnumPropertyItem python_controller_modes[] ={ static EnumPropertyItem python_controller_modes[] = {
{CONT_PY_SCRIPT, "SCRIPT", 0, "Script", ""}, {CONT_PY_SCRIPT, "SCRIPT", 0, "Script", ""},
{CONT_PY_MODULE, "MODULE", 0, "Module", ""}, {CONT_PY_MODULE, "MODULE", 0, "Module", ""},
{0, NULL, 0, NULL, NULL}}; {0, NULL, 0, NULL, NULL}};
/* Controller */ /* Controller */
srna= RNA_def_struct(brna, "Controller", NULL); srna = RNA_def_struct(brna, "Controller", NULL);
RNA_def_struct_sdna(srna, "bController"); RNA_def_struct_sdna(srna, "bController");
RNA_def_struct_refine_func(srna, "rna_Controller_refine"); RNA_def_struct_refine_func(srna, "rna_Controller_refine");
RNA_def_struct_ui_text(srna, "Controller", "Game engine logic brick to process events, connecting sensors to actuators"); RNA_def_struct_ui_text(srna, "Controller", "Game engine logic brick to process events, connecting sensors to actuators");
RNA_api_controller(srna); RNA_api_controller(srna);
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Name", ""); RNA_def_property_ui_text(prop, "Name", "");
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Constroller_name_set"); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Constroller_name_set");
RNA_def_struct_name_property(srna, prop); RNA_def_struct_name_property(srna, prop);
RNA_def_property_update(prop, NC_LOGIC, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_enum_funcs(prop, NULL, "rna_Controller_type_set", NULL); RNA_def_property_enum_funcs(prop, NULL, "rna_Controller_type_set", NULL);
RNA_def_property_enum_items(prop, controller_type_items); RNA_def_property_enum_items(prop, controller_type_items);
RNA_def_property_ui_text(prop, "Type", ""); RNA_def_property_ui_text(prop, "Type", "");
RNA_def_property_update(prop, NC_LOGIC, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CONT_SHOW); RNA_def_property_boolean_sdna(prop, NULL, "flag", CONT_SHOW);
RNA_def_property_ui_text(prop, "Expanded", "Set controller expanded in the user interface"); RNA_def_property_ui_text(prop, "Expanded", "Set controller expanded in the user interface");
RNA_def_property_ui_icon(prop, ICON_TRIA_RIGHT, 1); RNA_def_property_ui_icon(prop, ICON_TRIA_RIGHT, 1);
RNA_def_property_update(prop, NC_LOGIC, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "use_priority", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_priority", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CONT_PRIO); RNA_def_property_boolean_sdna(prop, NULL, "flag", CONT_PRIO);
RNA_def_property_ui_text(prop, "Priority", "Mark controller for execution before all non-marked controllers (good for startup scripts)"); RNA_def_property_ui_text(prop, "Priority", "Mark controller for execution before all non-marked controllers (good for startup scripts)");
RNA_def_property_ui_icon(prop, ICON_BOOKMARKS, 1); RNA_def_property_ui_icon(prop, ICON_BOOKMARKS, 1);
RNA_def_property_update(prop, NC_LOGIC, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "actuators", PROP_COLLECTION, PROP_NONE); prop = RNA_def_property(srna, "actuators", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "links", NULL); RNA_def_property_collection_sdna(prop, NULL, "links", NULL);
RNA_def_property_struct_type(prop, "Actuator"); RNA_def_property_struct_type(prop, "Actuator");
RNA_def_property_ui_text(prop, "Actuators", "The list containing the actuators connected to the controller"); RNA_def_property_ui_text(prop, "Actuators", "The list containing the actuators connected to the controller");
@@ -233,16 +233,16 @@ void RNA_def_controller(BlenderRNA *brna)
/* State */ /* State */
// array of OB_MAX_STATES /* array of OB_MAX_STATES */
//prop= RNA_def_property(srna, "states", PROP_BOOLEAN, PROP_LAYER_MEMBER); /*prop= RNA_def_property(srna, "states", PROP_BOOLEAN, PROP_LAYER_MEMBER); */
//RNA_def_property_array(prop, OB_MAX_STATES); /*RNA_def_property_array(prop, OB_MAX_STATES); */
//RNA_def_property_clear_flag(prop, PROP_EDITABLE); /*RNA_def_property_clear_flag(prop, PROP_EDITABLE); */
//RNA_def_property_ui_text(prop, "", "Set Controller state index (1 to 30)"); /*RNA_def_property_ui_text(prop, "", "Set Controller state index (1 to 30)"); */
//RNA_def_property_boolean_funcs(prop, "rna_Controller_state_get", "rna_Controller_state_set"); /*RNA_def_property_boolean_funcs(prop, "rna_Controller_state_get", "rna_Controller_state_set"); */
//RNA_def_property_update(prop, NC_LOGIC, NULL); /*RNA_def_property_update(prop, NC_LOGIC, NULL); */
// number of the state /* number of the state */
prop= RNA_def_property(srna, "states", PROP_INT, PROP_UNSIGNED); prop = RNA_def_property(srna, "states", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "state_mask"); RNA_def_property_int_sdna(prop, NULL, "state_mask");
RNA_def_property_range(prop, 1, OB_MAX_STATES); RNA_def_property_range(prop, 1, OB_MAX_STATES);
RNA_def_property_ui_text(prop, "", "Set Controller state index (1 to 30)"); RNA_def_property_ui_text(prop, "", "Set Controller state index (1 to 30)");
@@ -250,58 +250,58 @@ void RNA_def_controller(BlenderRNA *brna)
RNA_def_property_update(prop, NC_LOGIC, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL);
/* Expression Controller */ /* Expression Controller */
srna= RNA_def_struct(brna, "ExpressionController", "Controller"); srna = RNA_def_struct(brna, "ExpressionController", "Controller");
RNA_def_struct_sdna_from(srna, "bExpressionCont", "data"); RNA_def_struct_sdna_from(srna, "bExpressionCont", "data");
RNA_def_struct_ui_text(srna, "Expression Controller", "Controller passing on events based on the evaluation of an expression"); RNA_def_struct_ui_text(srna, "Expression Controller", "Controller passing on events based on the evaluation of an expression");
prop= RNA_def_property(srna, "expression", PROP_STRING, PROP_NONE); prop = RNA_def_property(srna, "expression", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "str"); RNA_def_property_string_sdna(prop, NULL, "str");
RNA_def_property_ui_text(prop, "Expression", ""); RNA_def_property_ui_text(prop, "Expression", "");
RNA_def_property_update(prop, NC_LOGIC, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL);
/* Python Controller */ /* Python Controller */
srna= RNA_def_struct(brna, "PythonController", "Controller" ); srna = RNA_def_struct(brna, "PythonController", "Controller" );
RNA_def_struct_sdna_from(srna, "bPythonCont", "data"); RNA_def_struct_sdna_from(srna, "bPythonCont", "data");
RNA_def_struct_ui_text(srna, "Python Controller", "Controller executing a python script"); RNA_def_struct_ui_text(srna, "Python Controller", "Controller executing a python script");
prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, python_controller_modes); RNA_def_property_enum_items(prop, python_controller_modes);
RNA_def_property_enum_funcs(prop, NULL, "rna_Controller_mode_set", NULL); RNA_def_property_enum_funcs(prop, NULL, "rna_Controller_mode_set", NULL);
RNA_def_property_ui_text(prop, "Execution Method", "Python script type (textblock or module - faster)"); RNA_def_property_ui_text(prop, "Execution Method", "Python script type (textblock or module - faster)");
RNA_def_property_update(prop, NC_LOGIC, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "text", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "text", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Text"); RNA_def_property_struct_type(prop, "Text");
RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Text", "Text datablock with the python script"); RNA_def_property_ui_text(prop, "Text", "Text datablock with the python script");
RNA_def_property_update(prop, NC_LOGIC, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "module", PROP_STRING, PROP_NONE); prop = RNA_def_property(srna, "module", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Module", "Module name and function to run, e.g. \"someModule.main\" (internal texts and external python files can be used)"); RNA_def_property_ui_text(prop, "Module", "Module name and function to run, e.g. \"someModule.main\" (internal texts and external python files can be used)");
RNA_def_property_update(prop, NC_LOGIC, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "use_debug", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_debug", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CONT_PY_DEBUG); RNA_def_property_boolean_sdna(prop, NULL, "flag", CONT_PY_DEBUG);
RNA_def_property_ui_text(prop, "D", "Continuously reload the module from disk for editing external modules without restarting"); RNA_def_property_ui_text(prop, "D", "Continuously reload the module from disk for editing external modules without restarting");
RNA_def_property_update(prop, NC_LOGIC, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL);
/* Other Controllers */ /* Other Controllers */
srna= RNA_def_struct(brna, "AndController", "Controller"); srna = RNA_def_struct(brna, "AndController", "Controller");
RNA_def_struct_ui_text(srna, "And Controller", "Controller passing on events based on a logical AND operation"); RNA_def_struct_ui_text(srna, "And Controller", "Controller passing on events based on a logical AND operation");
srna= RNA_def_struct(brna, "OrController", "Controller"); srna = RNA_def_struct(brna, "OrController", "Controller");
RNA_def_struct_ui_text(srna, "Or Controller", "Controller passing on events based on a logical OR operation"); RNA_def_struct_ui_text(srna, "Or Controller", "Controller passing on events based on a logical OR operation");
srna= RNA_def_struct(brna, "NorController", "Controller"); srna = RNA_def_struct(brna, "NorController", "Controller");
RNA_def_struct_ui_text(srna, "Nor Controller", "Controller passing on events based on a logical NOR operation"); RNA_def_struct_ui_text(srna, "Nor Controller", "Controller passing on events based on a logical NOR operation");
srna= RNA_def_struct(brna, "NandController", "Controller"); srna = RNA_def_struct(brna, "NandController", "Controller");
RNA_def_struct_ui_text(srna, "Nand Controller", "Controller passing on events based on a logical NAND operation"); RNA_def_struct_ui_text(srna, "Nand Controller", "Controller passing on events based on a logical NAND operation");
srna= RNA_def_struct(brna, "XorController", "Controller"); srna = RNA_def_struct(brna, "XorController", "Controller");
RNA_def_struct_ui_text(srna, "Xor Controller", "Controller passing on events based on a logical XOR operation"); RNA_def_struct_ui_text(srna, "Xor Controller", "Controller passing on events based on a logical XOR operation");
srna= RNA_def_struct(brna, "XnorController", "Controller"); srna = RNA_def_struct(brna, "XnorController", "Controller");
RNA_def_struct_ui_text(srna, "Xnor Controller", "Controller passing on events based on a logical XNOR operation"); RNA_def_struct_ui_text(srna, "Xnor Controller", "Controller passing on events based on a logical XNOR operation");
} }

View File

@@ -44,17 +44,17 @@
static void rna_Controller_link(bController *cont, bSensor *sens, bActuator *act) static void rna_Controller_link(bController *cont, bSensor *sens, bActuator *act)
{ {
if(sens) if (sens)
link_logicbricks((void **)&cont, (void ***)&(sens->links), &sens->totlinks, sizeof(bController *)); link_logicbricks((void **)&cont, (void ***)&(sens->links), &sens->totlinks, sizeof(bController *));
if(act) if (act)
link_logicbricks((void **)&act, (void ***)&(cont->links), &cont->totlinks, sizeof(bActuator *)); link_logicbricks((void **)&act, (void ***)&(cont->links), &cont->totlinks, sizeof(bActuator *));
} }
static void rna_Controller_unlink(bController *cont, bSensor *sens, bActuator *act) static void rna_Controller_unlink(bController *cont, bSensor *sens, bActuator *act)
{ {
if(sens) if (sens)
unlink_logicbricks((void **)&cont, (void ***)&(sens->links), &sens->totlinks); unlink_logicbricks((void **)&cont, (void ***)&(sens->links), &sens->totlinks);
if(act) if (act)
unlink_logicbricks((void **)&act, (void ***)&(cont->links), &cont->totlinks); unlink_logicbricks((void **)&act, (void ***)&(cont->links), &cont->totlinks);
} }
@@ -65,18 +65,18 @@ void RNA_api_controller(StructRNA *srna)
FunctionRNA *func; FunctionRNA *func;
PropertyRNA *parm; PropertyRNA *parm;
func= RNA_def_function(srna, "link", "rna_Controller_link"); func = RNA_def_function(srna, "link", "rna_Controller_link");
RNA_def_function_ui_description(func, "Link the controller with a sensor/actuator"); RNA_def_function_ui_description(func, "Link the controller with a sensor/actuator");
parm= RNA_def_pointer(func, "sensor", "Sensor", "", "Sensor to link the controller to"); parm = RNA_def_pointer(func, "sensor", "Sensor", "", "Sensor to link the controller to");
RNA_def_property_update(parm, NC_LOGIC, NULL); RNA_def_property_update(parm, NC_LOGIC, NULL);
parm= RNA_def_pointer(func, "actuator", "Actuator", "", "Actuator to link the controller to"); parm = RNA_def_pointer(func, "actuator", "Actuator", "", "Actuator to link the controller to");
RNA_def_property_update(parm, NC_LOGIC, NULL); RNA_def_property_update(parm, NC_LOGIC, NULL);
func= RNA_def_function(srna, "unlink", "rna_Controller_unlink"); func = RNA_def_function(srna, "unlink", "rna_Controller_unlink");
RNA_def_function_ui_description(func, "Unlink the controller from a sensor/actuator"); RNA_def_function_ui_description(func, "Unlink the controller from a sensor/actuator");
parm= RNA_def_pointer(func, "sensor", "Sensor", "", "Sensor to unlink the controller from"); parm = RNA_def_pointer(func, "sensor", "Sensor", "", "Sensor to unlink the controller from");
RNA_def_property_update(parm, NC_LOGIC, NULL); RNA_def_property_update(parm, NC_LOGIC, NULL);
parm= RNA_def_pointer(func, "actuator", "Actuator", "", "Actuator to unlink the controller from"); parm = RNA_def_pointer(func, "actuator", "Actuator", "", "Actuator to unlink the controller from");
RNA_def_property_update(parm, NC_LOGIC, NULL); RNA_def_property_update(parm, NC_LOGIC, NULL);
} }

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -45,7 +45,7 @@ EnumPropertyItem prop_dynamicpaint_type_items[] = {
static char *rna_DynamicPaintCanvasSettings_path(PointerRNA *ptr) static char *rna_DynamicPaintCanvasSettings_path(PointerRNA *ptr)
{ {
DynamicPaintCanvasSettings *settings = (DynamicPaintCanvasSettings*)ptr->data; DynamicPaintCanvasSettings *settings = (DynamicPaintCanvasSettings*)ptr->data;
ModifierData *md= (ModifierData *)settings->pmd; ModifierData *md = (ModifierData *)settings->pmd;
return BLI_sprintfN("modifiers[\"%s\"].canvas_settings", md->name); return BLI_sprintfN("modifiers[\"%s\"].canvas_settings", md->name);
} }
@@ -53,7 +53,7 @@ static char *rna_DynamicPaintCanvasSettings_path(PointerRNA *ptr)
static char *rna_DynamicPaintBrushSettings_path(PointerRNA *ptr) static char *rna_DynamicPaintBrushSettings_path(PointerRNA *ptr)
{ {
DynamicPaintBrushSettings *settings = (DynamicPaintBrushSettings*)ptr->data; DynamicPaintBrushSettings *settings = (DynamicPaintBrushSettings*)ptr->data;
ModifierData *md= (ModifierData *)settings->pmd; ModifierData *md = (ModifierData *)settings->pmd;
return BLI_sprintfN("modifiers[\"%s\"].brush_settings", md->name); return BLI_sprintfN("modifiers[\"%s\"].brush_settings", md->name);
} }
@@ -61,7 +61,7 @@ static char *rna_DynamicPaintBrushSettings_path(PointerRNA *ptr)
static char *rna_DynamicPaintSurface_path(PointerRNA *ptr) static char *rna_DynamicPaintSurface_path(PointerRNA *ptr)
{ {
DynamicPaintSurface *surface = (DynamicPaintSurface*)ptr->data; DynamicPaintSurface *surface = (DynamicPaintSurface*)ptr->data;
ModifierData *md= (ModifierData *)surface->canvas->pmd; ModifierData *md = (ModifierData *)surface->canvas->pmd;
return BLI_sprintfN("modifiers[\"%s\"].canvas_settings.canvas_surfaces[\"%s\"]", md->name, surface->name); return BLI_sprintfN("modifiers[\"%s\"].canvas_settings.canvas_surfaces[\"%s\"]", md->name, surface->name);
} }
@@ -103,8 +103,8 @@ static void rna_DynamicPaintSurface_changePreview(Main *bmain, Scene *scene, Poi
/* since only one color surface can show preview at time /* since only one color surface can show preview at time
* disable preview on other surfaces*/ * disable preview on other surfaces*/
for(; surface; surface=surface->next) { for (; surface; surface = surface->next) {
if(surface != act_surface) if (surface != act_surface)
surface->flags &= ~MOD_DPAINT_PREVIEW; surface->flags &= ~MOD_DPAINT_PREVIEW;
} }
rna_DynamicPaint_redoModifier(bmain, scene, ptr); rna_DynamicPaint_redoModifier(bmain, scene, ptr);
@@ -140,12 +140,12 @@ static void rna_DynamicPaint_resetDependancy(Main *bmain, Scene *scene, PointerR
static PointerRNA rna_PaintSurface_active_get(PointerRNA *ptr) static PointerRNA rna_PaintSurface_active_get(PointerRNA *ptr)
{ {
DynamicPaintCanvasSettings *canvas= (DynamicPaintCanvasSettings*)ptr->data; DynamicPaintCanvasSettings *canvas = (DynamicPaintCanvasSettings*)ptr->data;
DynamicPaintSurface *surface = canvas->surfaces.first; DynamicPaintSurface *surface = canvas->surfaces.first;
int id=0; int id = 0;
for(; surface; surface=surface->next) { for (; surface; surface = surface->next) {
if(id == canvas->active_sur) if (id == canvas->active_sur)
return rna_pointer_inherit_refine(ptr, &RNA_DynamicPaintSurface, surface); return rna_pointer_inherit_refine(ptr, &RNA_DynamicPaintSurface, surface);
id++; id++;
} }
@@ -154,41 +154,41 @@ static PointerRNA rna_PaintSurface_active_get(PointerRNA *ptr)
static void rna_DynamicPaint_surfaces_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) static void rna_DynamicPaint_surfaces_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{ {
DynamicPaintCanvasSettings *canvas= (DynamicPaintCanvasSettings*)ptr->data; DynamicPaintCanvasSettings *canvas = (DynamicPaintCanvasSettings*)ptr->data;
//rna_iterator_array_begin(iter, (void*)canvas->surfaces, sizeof(PaintSurface), canvas->totsur, 0, 0); /*rna_iterator_array_begin(iter, (void*)canvas->surfaces, sizeof(PaintSurface), canvas->totsur, 0, 0); */
rna_iterator_listbase_begin(iter, &canvas->surfaces, NULL); rna_iterator_listbase_begin(iter, &canvas->surfaces, NULL);
} }
static int rna_Surface_active_point_index_get(PointerRNA *ptr) static int rna_Surface_active_point_index_get(PointerRNA *ptr)
{ {
DynamicPaintCanvasSettings *canvas= (DynamicPaintCanvasSettings*)ptr->data; DynamicPaintCanvasSettings *canvas = (DynamicPaintCanvasSettings*)ptr->data;
return canvas->active_sur; return canvas->active_sur;
} }
static void rna_Surface_active_point_index_set(struct PointerRNA *ptr, int value) static void rna_Surface_active_point_index_set(struct PointerRNA *ptr, int value)
{ {
DynamicPaintCanvasSettings *canvas= (DynamicPaintCanvasSettings*)ptr->data; DynamicPaintCanvasSettings *canvas = (DynamicPaintCanvasSettings*)ptr->data;
canvas->active_sur = value; canvas->active_sur = value;
return; return;
} }
static void rna_Surface_active_point_range(PointerRNA *ptr, int *min, int *max) static void rna_Surface_active_point_range(PointerRNA *ptr, int *min, int *max)
{ {
DynamicPaintCanvasSettings *canvas= (DynamicPaintCanvasSettings*)ptr->data; DynamicPaintCanvasSettings *canvas = (DynamicPaintCanvasSettings*)ptr->data;
*min= 0; *min = 0;
*max= BLI_countlist(&canvas->surfaces)-1; *max = BLI_countlist(&canvas->surfaces)-1;
} }
/* uvlayer */ /* uvlayer */
static void rna_DynamicPaint_uvlayer_set(PointerRNA *ptr, const char *value) static void rna_DynamicPaint_uvlayer_set(PointerRNA *ptr, const char *value)
{ {
DynamicPaintCanvasSettings *canvas= ((DynamicPaintSurface*)ptr->data)->canvas; DynamicPaintCanvasSettings *canvas = ((DynamicPaintSurface*)ptr->data)->canvas;
DynamicPaintSurface *surface = canvas->surfaces.first; DynamicPaintSurface *surface = canvas->surfaces.first;
int id=0; int id = 0;
for(; surface; surface=surface->next) { for (; surface; surface = surface->next) {
if(id == canvas->active_sur) { if (id == canvas->active_sur) {
rna_object_uvlayer_name_set(ptr, value, surface->uvlayer_name, sizeof(surface->uvlayer_name)); rna_object_uvlayer_name_set(ptr, value, surface->uvlayer_name, sizeof(surface->uvlayer_name));
return; return;
} }
@@ -199,7 +199,7 @@ static void rna_DynamicPaint_uvlayer_set(PointerRNA *ptr, const char *value)
/* is point cache used */ /* is point cache used */
static int rna_DynamicPaint_is_cache_user_get(PointerRNA *ptr) static int rna_DynamicPaint_is_cache_user_get(PointerRNA *ptr)
{ {
DynamicPaintSurface *surface= (DynamicPaintSurface*)ptr->data; DynamicPaintSurface *surface = (DynamicPaintSurface*)ptr->data;
return (surface->format != MOD_DPAINT_SURFACE_F_IMAGESEQ) ? 1 : 0; return (surface->format != MOD_DPAINT_SURFACE_F_IMAGESEQ) ? 1 : 0;
} }
@@ -213,11 +213,11 @@ static int rna_DynamicPaint_is_output_exists(DynamicPaintSurface *surface, Objec
static EnumPropertyItem *rna_DynamicPaint_surface_type_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *free) static EnumPropertyItem *rna_DynamicPaint_surface_type_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *free)
{ {
DynamicPaintSurface *surface= (DynamicPaintSurface*)ptr->data; DynamicPaintSurface *surface = (DynamicPaintSurface*)ptr->data;
EnumPropertyItem *item= NULL; EnumPropertyItem *item = NULL;
EnumPropertyItem tmp= {0, "", 0, "", ""}; EnumPropertyItem tmp = {0, "", 0, "", ""};
int totitem= 0; int totitem = 0;
/* Paint type - available for all formats */ /* Paint type - available for all formats */
tmp.value = MOD_DPAINT_SURFACE_T_PAINT; tmp.value = MOD_DPAINT_SURFACE_T_PAINT;
@@ -265,16 +265,16 @@ static void rna_def_canvas_surfaces(BlenderRNA *brna, PropertyRNA *cprop)
PropertyRNA *prop; PropertyRNA *prop;
RNA_def_property_srna(cprop, "DynamicPaintSurfaces"); RNA_def_property_srna(cprop, "DynamicPaintSurfaces");
srna= RNA_def_struct(brna, "DynamicPaintSurfaces", NULL); srna = RNA_def_struct(brna, "DynamicPaintSurfaces", NULL);
RNA_def_struct_sdna(srna, "DynamicPaintCanvasSettings"); RNA_def_struct_sdna(srna, "DynamicPaintCanvasSettings");
RNA_def_struct_ui_text(srna, "Canvas Surfaces", "Collection of Dynamic Paint Canvas surfaces"); RNA_def_struct_ui_text(srna, "Canvas Surfaces", "Collection of Dynamic Paint Canvas surfaces");
prop= RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED); prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_int_funcs(prop, "rna_Surface_active_point_index_get", "rna_Surface_active_point_index_set", "rna_Surface_active_point_range"); RNA_def_property_int_funcs(prop, "rna_Surface_active_point_index_get", "rna_Surface_active_point_index_set", "rna_Surface_active_point_range");
RNA_def_property_ui_text(prop, "Active Point Cache Index", ""); RNA_def_property_ui_text(prop, "Active Point Cache Index", "");
prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "DynamicPaintSurface"); RNA_def_property_struct_type(prop, "DynamicPaintSurface");
RNA_def_property_pointer_funcs(prop, "rna_PaintSurface_active_get", NULL, NULL, NULL); RNA_def_property_pointer_funcs(prop, "rna_PaintSurface_active_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Active Surface", "Active Dynamic Paint surface being displayed"); RNA_def_property_ui_text(prop, "Active Surface", "Active Dynamic Paint surface being displayed");
@@ -291,7 +291,7 @@ static void rna_def_canvas_surface(BlenderRNA *brna)
/* Surface format */ /* Surface format */
static EnumPropertyItem prop_dynamicpaint_surface_format[] = { static EnumPropertyItem prop_dynamicpaint_surface_format[] = {
//{MOD_DPAINT_SURFACE_F_PTEX, "PTEX", ICON_TEXTURE_SHADED, "Ptex", ""}, /*{MOD_DPAINT_SURFACE_F_PTEX, "PTEX", ICON_TEXTURE_SHADED, "Ptex", ""}, */
{MOD_DPAINT_SURFACE_F_VERTEX, "VERTEX", ICON_OUTLINER_DATA_MESH, "Vertex", ""}, {MOD_DPAINT_SURFACE_F_VERTEX, "VERTEX", ICON_OUTLINER_DATA_MESH, "Vertex", ""},
{MOD_DPAINT_SURFACE_F_IMAGESEQ, "IMAGE", ICON_FILE_IMAGE, "Image Sequence", ""}, {MOD_DPAINT_SURFACE_F_IMAGESEQ, "IMAGE", ICON_FILE_IMAGE, "Image Sequence", ""},
{0, NULL, 0, NULL, NULL}}; {0, NULL, 0, NULL, NULL}};
@@ -340,19 +340,19 @@ static void rna_def_canvas_surface(BlenderRNA *brna)
/* Surface */ /* Surface */
srna= RNA_def_struct(brna, "DynamicPaintSurface", NULL); srna = RNA_def_struct(brna, "DynamicPaintSurface", NULL);
RNA_def_struct_sdna(srna, "DynamicPaintSurface"); RNA_def_struct_sdna(srna, "DynamicPaintSurface");
RNA_def_struct_ui_text(srna, "Paint Surface", "A canvas surface layer"); RNA_def_struct_ui_text(srna, "Paint Surface", "A canvas surface layer");
RNA_def_struct_path_func(srna, "rna_DynamicPaintSurface_path"); RNA_def_struct_path_func(srna, "rna_DynamicPaintSurface_path");
prop= RNA_def_property(srna, "surface_format", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "surface_format", PROP_ENUM, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_enum_sdna(prop, NULL, "format"); RNA_def_property_enum_sdna(prop, NULL, "format");
RNA_def_property_enum_items(prop, prop_dynamicpaint_surface_format); RNA_def_property_enum_items(prop, prop_dynamicpaint_surface_format);
RNA_def_property_ui_text(prop, "Format", "Surface Format"); RNA_def_property_ui_text(prop, "Format", "Surface Format");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaintSurfaces_changeFormat"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaintSurfaces_changeFormat");
prop= RNA_def_property(srna, "surface_type", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "surface_type", PROP_ENUM, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_enum_sdna(prop, NULL, "type"); RNA_def_property_enum_sdna(prop, NULL, "type");
RNA_def_property_enum_items(prop, prop_dynamicpaint_surface_type); RNA_def_property_enum_items(prop, prop_dynamicpaint_surface_type);
@@ -360,22 +360,22 @@ static void rna_def_canvas_surface(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Surface Type", "Surface Type"); RNA_def_property_ui_text(prop, "Surface Type", "Surface Type");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaintSurface_changeType"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaintSurface_changeType");
prop= RNA_def_property(srna, "is_active", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "is_active", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_ACTIVE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_ACTIVE);
RNA_def_property_ui_text(prop, "Is Active", "Toggle whether surface is processed or ignored"); RNA_def_property_ui_text(prop, "Is Active", "Toggle whether surface is processed or ignored");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
prop= RNA_def_property(srna, "show_preview", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "show_preview", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_PREVIEW); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_PREVIEW);
RNA_def_property_ui_text(prop, "Show Preview", "Display surface preview in 3D-views"); RNA_def_property_ui_text(prop, "Show Preview", "Display surface preview in 3D-views");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaintSurface_changePreview"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaintSurface_changePreview");
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Name", "Surface name"); RNA_def_property_ui_text(prop, "Name", "Surface name");
RNA_def_property_update(prop, NC_OBJECT, "rna_DynamicPaintSurface_uniqueName"); RNA_def_property_update(prop, NC_OBJECT, "rna_DynamicPaintSurface_uniqueName");
RNA_def_struct_name_property(srna, prop); RNA_def_struct_name_property(srna, prop);
prop= RNA_def_property(srna, "brush_group", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "brush_group", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Group"); RNA_def_property_struct_type(prop, "Group");
RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Brush Group", "Only use brush objects from this group"); RNA_def_property_ui_text(prop, "Brush Group", "Only use brush objects from this group");
@@ -386,21 +386,21 @@ static void rna_def_canvas_surface(BlenderRNA *brna)
* Paint, wet and displace * Paint, wet and displace
*/ */
prop= RNA_def_property(srna, "use_dissolve", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_dissolve", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_DISSOLVE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_DISSOLVE);
RNA_def_property_ui_text(prop, "Dissolve", "Enable to make surface changes disappear over time"); RNA_def_property_ui_text(prop, "Dissolve", "Enable to make surface changes disappear over time");
prop= RNA_def_property(srna, "dissolve_speed", PROP_INT, PROP_NONE); prop = RNA_def_property(srna, "dissolve_speed", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "diss_speed"); RNA_def_property_int_sdna(prop, NULL, "diss_speed");
RNA_def_property_range(prop, 1.0, 10000.0); RNA_def_property_range(prop, 1.0, 10000.0);
RNA_def_property_ui_range(prop, 1.0, 10000.0, 5, 0); RNA_def_property_ui_range(prop, 1.0, 10000.0, 5, 0);
RNA_def_property_ui_text(prop, "Dissolve Speed", "Approximately in how many frames should dissolve happen"); RNA_def_property_ui_text(prop, "Dissolve Speed", "Approximately in how many frames should dissolve happen");
prop= RNA_def_property(srna, "use_drying", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_drying", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_USE_DRYING); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_USE_DRYING);
RNA_def_property_ui_text(prop, "Dry", "Enable to make surface wetness dry over time"); RNA_def_property_ui_text(prop, "Dry", "Enable to make surface wetness dry over time");
prop= RNA_def_property(srna, "dry_speed", PROP_INT, PROP_NONE); prop = RNA_def_property(srna, "dry_speed", PROP_INT, PROP_NONE);
RNA_def_property_range(prop, 1.0, 10000.0); RNA_def_property_range(prop, 1.0, 10000.0);
RNA_def_property_ui_range(prop, 1.0, 10000.0, 5, 0); RNA_def_property_ui_range(prop, 1.0, 10000.0, 5, 0);
RNA_def_property_ui_text(prop, "Dry Speed", "Approximately in how many frames should drying happen"); RNA_def_property_ui_text(prop, "Dry Speed", "Approximately in how many frames should drying happen");
@@ -408,18 +408,18 @@ static void rna_def_canvas_surface(BlenderRNA *brna)
/* /*
* Simulation settings * Simulation settings
*/ */
prop= RNA_def_property(srna, "image_resolution", PROP_INT, PROP_NONE); prop = RNA_def_property(srna, "image_resolution", PROP_INT, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 16.0, 4096.0); RNA_def_property_range(prop, 16.0, 4096.0);
RNA_def_property_ui_range(prop, 16.0, 4096.0, 1, 0); RNA_def_property_ui_range(prop, 16.0, 4096.0, 1, 0);
RNA_def_property_ui_text(prop, "Resolution", "Output image resolution"); RNA_def_property_ui_text(prop, "Resolution", "Output image resolution");
prop= RNA_def_property(srna, "uv_layer", PROP_STRING, PROP_NONE); prop = RNA_def_property(srna, "uv_layer", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "uvlayer_name"); RNA_def_property_string_sdna(prop, NULL, "uvlayer_name");
RNA_def_property_ui_text(prop, "UV Map", "UV map name"); RNA_def_property_ui_text(prop, "UV Map", "UV map name");
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_DynamicPaint_uvlayer_set"); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_DynamicPaint_uvlayer_set");
prop= RNA_def_property(srna, "frame_start", PROP_INT, PROP_NONE); prop = RNA_def_property(srna, "frame_start", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "start_frame"); RNA_def_property_int_sdna(prop, NULL, "start_frame");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 1.0, 9999.0); RNA_def_property_range(prop, 1.0, 9999.0);
@@ -427,7 +427,7 @@ static void rna_def_canvas_surface(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Start Frame", "Simulation start frame"); RNA_def_property_ui_text(prop, "Start Frame", "Simulation start frame");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaintSurfaces_updateFrames"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaintSurfaces_updateFrames");
prop= RNA_def_property(srna, "frame_end", PROP_INT, PROP_NONE); prop = RNA_def_property(srna, "frame_end", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "end_frame"); RNA_def_property_int_sdna(prop, NULL, "end_frame");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 1.0, 9999.0); RNA_def_property_range(prop, 1.0, 9999.0);
@@ -435,26 +435,26 @@ static void rna_def_canvas_surface(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "End Frame", "Simulation end frame"); RNA_def_property_ui_text(prop, "End Frame", "Simulation end frame");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaintSurfaces_updateFrames"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaintSurfaces_updateFrames");
prop= RNA_def_property(srna, "frame_substeps", PROP_INT, PROP_NONE); prop = RNA_def_property(srna, "frame_substeps", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "substeps"); RNA_def_property_int_sdna(prop, NULL, "substeps");
RNA_def_property_range(prop, 0.0, 20.0); RNA_def_property_range(prop, 0.0, 20.0);
RNA_def_property_ui_range(prop, 0.0, 10, 1, 0); RNA_def_property_ui_range(prop, 0.0, 10, 1, 0);
RNA_def_property_ui_text(prop, "Sub-Steps", "Do extra frames between scene frames to ensure smooth motion"); RNA_def_property_ui_text(prop, "Sub-Steps", "Do extra frames between scene frames to ensure smooth motion");
prop= RNA_def_property(srna, "use_antialiasing", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_antialiasing", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_ANTIALIAS); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_ANTIALIAS);
RNA_def_property_ui_text(prop, "Anti-aliasing", "Use 5x multisampling to smoothen paint edges"); RNA_def_property_ui_text(prop, "Anti-aliasing", "Use 5x multisampling to smoothen paint edges");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaintSurface_reset"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaintSurface_reset");
prop= RNA_def_property(srna, "brush_influence_scale", PROP_FLOAT, PROP_FACTOR); prop = RNA_def_property(srna, "brush_influence_scale", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "influence_scale"); RNA_def_property_float_sdna(prop, NULL, "influence_scale");
RNA_def_property_range(prop, 0.0, 1.0); RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 2); RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 2);
RNA_def_property_ui_text(prop, "Influence Scale", "Adjust influence brush objects have on this surface"); RNA_def_property_ui_text(prop, "Influence Scale", "Adjust influence brush objects have on this surface");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
prop= RNA_def_property(srna, "brush_radius_scale", PROP_FLOAT, PROP_FACTOR); prop = RNA_def_property(srna, "brush_radius_scale", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "radius_scale"); RNA_def_property_float_sdna(prop, NULL, "radius_scale");
RNA_def_property_range(prop, 0.0, 10.0); RNA_def_property_range(prop, 0.0, 10.0);
RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 2); RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 2);
@@ -465,97 +465,97 @@ static void rna_def_canvas_surface(BlenderRNA *brna)
* Initial Color * Initial Color
*/ */
prop= RNA_def_property(srna, "init_color_type", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "init_color_type", PROP_ENUM, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_enum_items(prop, prop_dynamicpaint_init_color_type); RNA_def_property_enum_items(prop, prop_dynamicpaint_init_color_type);
RNA_def_property_ui_text(prop, "Initial Color", ""); RNA_def_property_ui_text(prop, "Initial Color", "");
RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW|ND_MODIFIER, "rna_DynamicPaintSurface_initialcolortype"); RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW|ND_MODIFIER, "rna_DynamicPaintSurface_initialcolortype");
prop= RNA_def_property(srna, "init_color", PROP_FLOAT, PROP_COLOR_GAMMA); prop = RNA_def_property(srna, "init_color", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_array(prop, 4); RNA_def_property_array(prop, 4);
RNA_def_property_ui_text(prop, "Color", "Initial color of the surface"); RNA_def_property_ui_text(prop, "Color", "Initial color of the surface");
RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW|ND_MODIFIER, "rna_DynamicPaintSurface_reset"); RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW|ND_MODIFIER, "rna_DynamicPaintSurface_reset");
prop= RNA_def_property(srna, "init_texture", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "init_texture", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Texture", ""); RNA_def_property_ui_text(prop, "Texture", "");
RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW|ND_MODIFIER, "rna_DynamicPaintSurface_reset"); RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW|ND_MODIFIER, "rna_DynamicPaintSurface_reset");
prop= RNA_def_property(srna, "init_layername", PROP_STRING, PROP_NONE); prop = RNA_def_property(srna, "init_layername", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Data Layer", ""); RNA_def_property_ui_text(prop, "Data Layer", "");
RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW|ND_MODIFIER, "rna_DynamicPaintSurface_reset"); RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW|ND_MODIFIER, "rna_DynamicPaintSurface_reset");
/* /*
* Effect Settings * Effect Settings
*/ */
prop= RNA_def_property(srna, "effect_ui", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "effect_ui", PROP_ENUM, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_enum_items(prop, prop_dynamicpaint_effecttype); RNA_def_property_enum_items(prop, prop_dynamicpaint_effecttype);
RNA_def_property_ui_text(prop, "Effect Type", ""); RNA_def_property_ui_text(prop, "Effect Type", "");
prop= RNA_def_property(srna, "use_dry_log", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_dry_log", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_DRY_LOG); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_DRY_LOG);
RNA_def_property_ui_text(prop, "Slow", "Use logarithmic drying (makes high values to dry faster than low values)"); RNA_def_property_ui_text(prop, "Slow", "Use logarithmic drying (makes high values to dry faster than low values)");
prop= RNA_def_property(srna, "use_dissolve_log", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_dissolve_log", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_DISSOLVE_LOG); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_DISSOLVE_LOG);
RNA_def_property_ui_text(prop, "Slow", "Use logarithmic dissolve (makes high values to fade faster than low values)"); RNA_def_property_ui_text(prop, "Slow", "Use logarithmic dissolve (makes high values to fade faster than low values)");
prop= RNA_def_property(srna, "use_spread", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_spread", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_boolean_sdna(prop, NULL, "effect", MOD_DPAINT_EFFECT_DO_SPREAD); RNA_def_property_boolean_sdna(prop, NULL, "effect", MOD_DPAINT_EFFECT_DO_SPREAD);
RNA_def_property_ui_text(prop, "Use Spread", "Process spread effect (spread wet paint around surface)"); RNA_def_property_ui_text(prop, "Use Spread", "Process spread effect (spread wet paint around surface)");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaintSurface_reset"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaintSurface_reset");
prop= RNA_def_property(srna, "spread_speed", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "spread_speed", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "spread_speed"); RNA_def_property_float_sdna(prop, NULL, "spread_speed");
RNA_def_property_range(prop, 0.001, 10.0); RNA_def_property_range(prop, 0.001, 10.0);
RNA_def_property_ui_range(prop, 0.01, 5.0, 1, 2); RNA_def_property_ui_range(prop, 0.01, 5.0, 1, 2);
RNA_def_property_ui_text(prop, "Spread Speed", "How fast spread effect moves on the canvas surface"); RNA_def_property_ui_text(prop, "Spread Speed", "How fast spread effect moves on the canvas surface");
prop= RNA_def_property(srna, "color_dry_threshold", PROP_FLOAT, PROP_FACTOR); prop = RNA_def_property(srna, "color_dry_threshold", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "color_dry_threshold"); RNA_def_property_float_sdna(prop, NULL, "color_dry_threshold");
RNA_def_property_range(prop, 0.0, 1.0); RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 2); RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 2);
RNA_def_property_ui_text(prop, "Color Dry", "The wetness level when colors start to shift to the background"); RNA_def_property_ui_text(prop, "Color Dry", "The wetness level when colors start to shift to the background");
prop= RNA_def_property(srna, "color_spread_speed", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "color_spread_speed", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "color_spread_speed"); RNA_def_property_float_sdna(prop, NULL, "color_spread_speed");
RNA_def_property_range(prop, 0.0, 2.0); RNA_def_property_range(prop, 0.0, 2.0);
RNA_def_property_ui_range(prop, 0.0, 2.0, 1, 2); RNA_def_property_ui_range(prop, 0.0, 2.0, 1, 2);
RNA_def_property_ui_text(prop, "Color Spread", "How fast colors get mixed within wet paint"); RNA_def_property_ui_text(prop, "Color Spread", "How fast colors get mixed within wet paint");
prop= RNA_def_property(srna, "use_drip", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_drip", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_boolean_sdna(prop, NULL, "effect", MOD_DPAINT_EFFECT_DO_DRIP); RNA_def_property_boolean_sdna(prop, NULL, "effect", MOD_DPAINT_EFFECT_DO_DRIP);
RNA_def_property_ui_text(prop, "Use Drip", "Process drip effect (drip wet paint to gravity direction)"); RNA_def_property_ui_text(prop, "Use Drip", "Process drip effect (drip wet paint to gravity direction)");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaintSurface_reset"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaintSurface_reset");
prop= RNA_def_property(srna, "use_shrink", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_shrink", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_boolean_sdna(prop, NULL, "effect", MOD_DPAINT_EFFECT_DO_SHRINK); RNA_def_property_boolean_sdna(prop, NULL, "effect", MOD_DPAINT_EFFECT_DO_SHRINK);
RNA_def_property_ui_text(prop, "Use Shrink", "Process shrink effect (shrink paint areas)"); RNA_def_property_ui_text(prop, "Use Shrink", "Process shrink effect (shrink paint areas)");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaintSurface_reset"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaintSurface_reset");
prop= RNA_def_property(srna, "shrink_speed", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "shrink_speed", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "shrink_speed"); RNA_def_property_float_sdna(prop, NULL, "shrink_speed");
RNA_def_property_range(prop, 0.001, 10.0); RNA_def_property_range(prop, 0.001, 10.0);
RNA_def_property_ui_range(prop, 0.01, 5.0, 1, 2); RNA_def_property_ui_range(prop, 0.01, 5.0, 1, 2);
RNA_def_property_ui_text(prop, "Shrink Speed", "How fast shrink effect moves on the canvas surface"); RNA_def_property_ui_text(prop, "Shrink Speed", "How fast shrink effect moves on the canvas surface");
prop= RNA_def_property(srna, "effector_weights", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "effector_weights", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "EffectorWeights"); RNA_def_property_struct_type(prop, "EffectorWeights");
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Effector Weights", ""); RNA_def_property_ui_text(prop, "Effector Weights", "");
prop= RNA_def_property(srna, "drip_velocity", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "drip_velocity", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "drip_vel"); RNA_def_property_float_sdna(prop, NULL, "drip_vel");
RNA_def_property_range(prop, -200.0f, 200.0f); RNA_def_property_range(prop, -200.0f, 200.0f);
RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3); RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
RNA_def_property_ui_text(prop, "Velocity", "How much surface velocity affects dripping"); RNA_def_property_ui_text(prop, "Velocity", "How much surface velocity affects dripping");
prop= RNA_def_property(srna, "drip_acceleration", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "drip_acceleration", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "drip_acc"); RNA_def_property_float_sdna(prop, NULL, "drip_acc");
RNA_def_property_range(prop, -200.0f, 200.0f); RNA_def_property_range(prop, -200.0f, 200.0f);
RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3); RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
@@ -564,34 +564,34 @@ static void rna_def_canvas_surface(BlenderRNA *brna)
/* /*
* Output settings * Output settings
*/ */
prop= RNA_def_property(srna, "use_premultiply", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_premultiply", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_MULALPHA); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_MULALPHA);
RNA_def_property_ui_text(prop, "Premultiply alpha", "Multiply color by alpha (recommended for Blender input)"); RNA_def_property_ui_text(prop, "Premultiply alpha", "Multiply color by alpha (recommended for Blender input)");
prop= RNA_def_property(srna, "image_output_path", PROP_STRING, PROP_DIRPATH); prop = RNA_def_property(srna, "image_output_path", PROP_STRING, PROP_DIRPATH);
RNA_def_property_string_sdna(prop, NULL, "image_output_path"); RNA_def_property_string_sdna(prop, NULL, "image_output_path");
RNA_def_property_ui_text(prop, "Output Path", "Directory to save the textures"); RNA_def_property_ui_text(prop, "Output Path", "Directory to save the textures");
/* output for primary surface data */ /* output for primary surface data */
prop= RNA_def_property(srna, "output_name_a", PROP_STRING, PROP_NONE); prop = RNA_def_property(srna, "output_name_a", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "output_name"); RNA_def_property_string_sdna(prop, NULL, "output_name");
RNA_def_property_ui_text(prop, "Output Name", "Name used to save output from this surface"); RNA_def_property_ui_text(prop, "Output Name", "Name used to save output from this surface");
prop= RNA_def_property(srna, "use_output_a", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_output_a", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_OUT1); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_OUT1);
RNA_def_property_ui_text(prop, "Use Output", "Save this output layer"); RNA_def_property_ui_text(prop, "Use Output", "Save this output layer");
/* output for secondary sufrace data */ /* output for secondary sufrace data */
prop= RNA_def_property(srna, "output_name_b", PROP_STRING, PROP_NONE); prop = RNA_def_property(srna, "output_name_b", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "output_name2"); RNA_def_property_string_sdna(prop, NULL, "output_name2");
RNA_def_property_ui_text(prop, "Output Name", "Name used to save output from this surface"); RNA_def_property_ui_text(prop, "Output Name", "Name used to save output from this surface");
prop= RNA_def_property(srna, "use_output_b", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_output_b", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_OUT2); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_OUT2);
RNA_def_property_ui_text(prop, "Use Output", "Save this output layer"); RNA_def_property_ui_text(prop, "Use Output", "Save this output layer");
prop= RNA_def_property(srna, "preview_id", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "preview_id", PROP_ENUM, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_enum_sdna(prop, NULL, "preview_id"); RNA_def_property_enum_sdna(prop, NULL, "preview_id");
RNA_def_property_enum_items(prop, prop_dynamicpaint_surface_preview); RNA_def_property_enum_items(prop, prop_dynamicpaint_surface_preview);
@@ -601,22 +601,22 @@ static void rna_def_canvas_surface(BlenderRNA *brna)
/* to check if output name exists */ /* to check if output name exists */
func = RNA_def_function(srna, "output_exists", "rna_DynamicPaint_is_output_exists"); func = RNA_def_function(srna, "output_exists", "rna_DynamicPaint_is_output_exists");
RNA_def_function_ui_description(func, "Checks if surface output layer of given name exists"); RNA_def_function_ui_description(func, "Checks if surface output layer of given name exists");
parm= RNA_def_pointer(func, "object", "Object", "", ""); parm = RNA_def_pointer(func, "object", "Object", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
parm= RNA_def_int(func, "index", 0, 0, 1, "Index", "", 0, 1); parm = RNA_def_int(func, "index", 0, 0, 1, "Index", "", 0, 1);
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
/* return type */ /* return type */
parm= RNA_def_boolean(func, "exists", 0, "", ""); parm = RNA_def_boolean(func, "exists", 0, "", "");
RNA_def_function_return(func, parm); RNA_def_function_return(func, parm);
prop= RNA_def_property(srna, "depth_clamp", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "depth_clamp", PROP_FLOAT, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 0.00, 50.0); RNA_def_property_range(prop, 0.00, 50.0);
RNA_def_property_ui_range(prop, 0.00, 5.0, 1, 2); RNA_def_property_ui_range(prop, 0.00, 5.0, 1, 2);
RNA_def_property_ui_text(prop, "Max Displace", "Maximum level of depth intersection in object space (use 0.0 to disable)"); RNA_def_property_ui_text(prop, "Max Displace", "Maximum level of depth intersection in object space (use 0.0 to disable)");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
prop= RNA_def_property(srna, "displace_factor", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "displace_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "disp_factor"); RNA_def_property_float_sdna(prop, NULL, "disp_factor");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, -50.0, 50.0); RNA_def_property_range(prop, -50.0, 50.0);
@@ -624,57 +624,57 @@ static void rna_def_canvas_surface(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Displace Factor", "Strength of displace when applied to the mesh"); RNA_def_property_ui_text(prop, "Displace Factor", "Strength of displace when applied to the mesh");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
prop= RNA_def_property(srna, "image_fileformat", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "image_fileformat", PROP_ENUM, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_enum_items(prop, prop_dynamicpaint_image_fileformat); RNA_def_property_enum_items(prop, prop_dynamicpaint_image_fileformat);
RNA_def_property_ui_text(prop, "File Format", ""); RNA_def_property_ui_text(prop, "File Format", "");
prop= RNA_def_property(srna, "displace_type", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "displace_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "disp_type"); RNA_def_property_enum_sdna(prop, NULL, "disp_type");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_enum_items(prop, prop_dynamicpaint_displace_type); RNA_def_property_enum_items(prop, prop_dynamicpaint_displace_type);
RNA_def_property_ui_text(prop, "Data Type", ""); RNA_def_property_ui_text(prop, "Data Type", "");
prop= RNA_def_property(srna, "use_incremental_displace", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_incremental_displace", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_DISP_INCREMENTAL); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_DISP_INCREMENTAL);
RNA_def_property_ui_text(prop, "Incremental", "New displace is added cumulatively on top of existing"); RNA_def_property_ui_text(prop, "Incremental", "New displace is added cumulatively on top of existing");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaintSurface_reset"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaintSurface_reset");
/* wave simulator settings */ /* wave simulator settings */
prop= RNA_def_property(srna, "wave_damping", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "wave_damping", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0, 1.0); RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_ui_range(prop, 0.01, 1.0, 1, 2); RNA_def_property_ui_range(prop, 0.01, 1.0, 1, 2);
RNA_def_property_ui_text(prop, "Damping", "Wave damping factor"); RNA_def_property_ui_text(prop, "Damping", "Wave damping factor");
prop= RNA_def_property(srna, "wave_speed", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "wave_speed", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.01, 5.0); RNA_def_property_range(prop, 0.01, 5.0);
RNA_def_property_ui_range(prop, 0.20, 4.0, 1, 2); RNA_def_property_ui_range(prop, 0.20, 4.0, 1, 2);
RNA_def_property_ui_text(prop, "Speed", "Wave propogation speed"); RNA_def_property_ui_text(prop, "Speed", "Wave propogation speed");
prop= RNA_def_property(srna, "wave_timescale", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "wave_timescale", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.01, 3.0); RNA_def_property_range(prop, 0.01, 3.0);
RNA_def_property_ui_range(prop, 0.01, 1.5, 1, 2); RNA_def_property_ui_range(prop, 0.01, 1.5, 1, 2);
RNA_def_property_ui_text(prop, "Timescale", "Wave time scaling factor"); RNA_def_property_ui_text(prop, "Timescale", "Wave time scaling factor");
prop= RNA_def_property(srna, "wave_spring", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "wave_spring", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0, 1.0); RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_ui_range(prop, 0.01, 1.0, 1, 2); RNA_def_property_ui_range(prop, 0.01, 1.0, 1, 2);
RNA_def_property_ui_text(prop, "Spring", "Spring force that pulls water level back to zero"); RNA_def_property_ui_text(prop, "Spring", "Spring force that pulls water level back to zero");
prop= RNA_def_property(srna, "use_wave_open_border", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_wave_open_border", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_WAVE_OPEN_BORDERS); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_WAVE_OPEN_BORDERS);
RNA_def_property_ui_text(prop, "Open Borders", "Pass waves through mesh edges"); RNA_def_property_ui_text(prop, "Open Borders", "Pass waves through mesh edges");
/* cache */ /* cache */
prop= RNA_def_property(srna, "point_cache", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "point_cache", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "pointcache"); RNA_def_property_pointer_sdna(prop, NULL, "pointcache");
RNA_def_property_ui_text(prop, "Point Cache", ""); RNA_def_property_ui_text(prop, "Point Cache", "");
/* is cache used */ /* is cache used */
prop= RNA_def_property(srna, "is_cache_user", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "is_cache_user", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_DynamicPaint_is_cache_user_get", NULL); RNA_def_property_boolean_funcs(prop, "rna_DynamicPaint_is_cache_user_get", NULL);
RNA_def_property_ui_text(prop, "Use Cache", ""); RNA_def_property_ui_text(prop, "Use Cache", "");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE|PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE|PROP_EDITABLE);
@@ -693,7 +693,7 @@ static void rna_def_dynamic_paint_canvas_settings(BlenderRNA *brna)
/* /*
* Surface Slots * Surface Slots
*/ */
prop= RNA_def_property(srna, "canvas_surfaces", PROP_COLLECTION, PROP_NONE); prop = RNA_def_property(srna, "canvas_surfaces", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_funcs(prop, "rna_DynamicPaint_surfaces_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", NULL, NULL, NULL, NULL); RNA_def_property_collection_funcs(prop, "rna_DynamicPaint_surfaces_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", NULL, NULL, NULL, NULL);
RNA_def_property_struct_type(prop, "DynamicPaintSurface"); RNA_def_property_struct_type(prop, "DynamicPaintSurface");
RNA_def_property_ui_text(prop, "Paint Surface List", "Paint surface list"); RNA_def_property_ui_text(prop, "Paint Surface List", "Paint surface list");
@@ -741,87 +741,87 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna)
/* /*
* Paint * Paint
*/ */
prop= RNA_def_property(srna, "paint_color", PROP_FLOAT, PROP_COLOR_GAMMA); prop = RNA_def_property(srna, "paint_color", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "r"); RNA_def_property_float_sdna(prop, NULL, "r");
RNA_def_property_array(prop, 3); RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Paint Color", "Color of the paint"); RNA_def_property_ui_text(prop, "Paint Color", "Color of the paint");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
prop= RNA_def_property(srna, "paint_alpha", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "paint_alpha", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "alpha"); RNA_def_property_float_sdna(prop, NULL, "alpha");
RNA_def_property_range(prop, 0.0, 1.0); RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_ui_range(prop, 0.0, 1.0, 5, 2); RNA_def_property_ui_range(prop, 0.0, 1.0, 5, 2);
RNA_def_property_ui_text(prop, "Paint Alpha", "Paint alpha"); RNA_def_property_ui_text(prop, "Paint Alpha", "Paint alpha");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
prop= RNA_def_property(srna, "use_material", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_material", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_USE_MATERIAL); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_USE_MATERIAL);
RNA_def_property_ui_text(prop, "Use object material", "Use object material to define color and influence"); RNA_def_property_ui_text(prop, "Use object material", "Use object material to define color and influence");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
prop= RNA_def_property(srna, "material", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "material", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "mat"); RNA_def_property_pointer_sdna(prop, NULL, "mat");
RNA_def_property_ui_text(prop, "Material", "Material to use (if not defined, material linked to the mesh is used)"); RNA_def_property_ui_text(prop, "Material", "Material to use (if not defined, material linked to the mesh is used)");
RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
prop= RNA_def_property(srna, "use_absolute_alpha", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_absolute_alpha", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_ABS_ALPHA); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_ABS_ALPHA);
RNA_def_property_ui_text(prop, "Absolute Alpha", "Only increase alpha value if paint alpha is higher than existing"); RNA_def_property_ui_text(prop, "Absolute Alpha", "Only increase alpha value if paint alpha is higher than existing");
prop= RNA_def_property(srna, "paint_wetness", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "paint_wetness", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "wetness"); RNA_def_property_float_sdna(prop, NULL, "wetness");
RNA_def_property_range(prop, 0.0, 1.0); RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_ui_range(prop, 0.0, 1.0, 5, 2); RNA_def_property_ui_range(prop, 0.0, 1.0, 5, 2);
RNA_def_property_ui_text(prop, "Paint Wetness", "Paint wetness, visible in wetmap (some effects only affect wet paint)"); RNA_def_property_ui_text(prop, "Paint Wetness", "Paint wetness, visible in wetmap (some effects only affect wet paint)");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
prop= RNA_def_property(srna, "use_paint_erase", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_paint_erase", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_ERASE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_ERASE);
RNA_def_property_ui_text(prop, "Erase Paint", "Erase / remove paint instead of adding it"); RNA_def_property_ui_text(prop, "Erase Paint", "Erase / remove paint instead of adding it");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
prop= RNA_def_property(srna, "wave_type", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "wave_type", PROP_ENUM, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_enum_items(prop, prop_dynamicpaint_brush_wave_type); RNA_def_property_enum_items(prop, prop_dynamicpaint_brush_wave_type);
RNA_def_property_ui_text(prop, "Wave Type", ""); RNA_def_property_ui_text(prop, "Wave Type", "");
prop= RNA_def_property(srna, "wave_factor", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "wave_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, -2.0, 2.0); RNA_def_property_range(prop, -2.0, 2.0);
RNA_def_property_ui_range(prop, -1.0, 1.0, 5, 2); RNA_def_property_ui_range(prop, -1.0, 1.0, 5, 2);
RNA_def_property_ui_text(prop, "Factor", "Multiplier for wave influence of this brush"); RNA_def_property_ui_text(prop, "Factor", "Multiplier for wave influence of this brush");
prop= RNA_def_property(srna, "wave_clamp", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "wave_clamp", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.00, 50.0); RNA_def_property_range(prop, 0.00, 50.0);
RNA_def_property_ui_range(prop, 0.00, 5.0, 1, 2); RNA_def_property_ui_range(prop, 0.00, 5.0, 1, 2);
RNA_def_property_ui_text(prop, "Clamp Waves", "Maximum level of surface intersection used to influence waves (use 0.0 to disable)"); RNA_def_property_ui_text(prop, "Clamp Waves", "Maximum level of surface intersection used to influence waves (use 0.0 to disable)");
prop= RNA_def_property(srna, "use_smudge", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_smudge", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_DO_SMUDGE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_DO_SMUDGE);
RNA_def_property_ui_text(prop, "Do Smudge", "Make this brush to smudge existing paint as it moves"); RNA_def_property_ui_text(prop, "Do Smudge", "Make this brush to smudge existing paint as it moves");
prop= RNA_def_property(srna, "smudge_strength", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "smudge_strength", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0, 1.0); RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_ui_range(prop, 0.0, 1.0, 5, 2); RNA_def_property_ui_range(prop, 0.0, 1.0, 5, 2);
RNA_def_property_ui_text(prop, "Smudge Strength", "Smudge effect strength"); RNA_def_property_ui_text(prop, "Smudge Strength", "Smudge effect strength");
prop= RNA_def_property(srna, "velocity_max", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "velocity_max", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "max_velocity"); RNA_def_property_float_sdna(prop, NULL, "max_velocity");
RNA_def_property_range(prop, 0.0001, 10.0); RNA_def_property_range(prop, 0.0001, 10.0);
RNA_def_property_ui_range(prop, 0.1, 2.0, 5, 2); RNA_def_property_ui_range(prop, 0.1, 2.0, 5, 2);
RNA_def_property_ui_text(prop, "Max Velocity", "Velocity considered as maximum influence (Blender units per frame)"); RNA_def_property_ui_text(prop, "Max Velocity", "Velocity considered as maximum influence (Blender units per frame)");
prop= RNA_def_property(srna, "use_velocity_alpha", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_velocity_alpha", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_VELOCITY_ALPHA); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_VELOCITY_ALPHA);
RNA_def_property_ui_text(prop, "Multiply Alpha", "Multiply brush influence by velocity color ramp alpha"); RNA_def_property_ui_text(prop, "Multiply Alpha", "Multiply brush influence by velocity color ramp alpha");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
prop= RNA_def_property(srna, "use_velocity_depth", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_velocity_depth", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_VELOCITY_DEPTH); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_VELOCITY_DEPTH);
RNA_def_property_ui_text(prop, "Multiply Depth", "Multiply brush intersection depth (displace, waves) by velocity ramp alpha"); RNA_def_property_ui_text(prop, "Multiply Depth", "Multiply brush intersection depth (displace, waves) by velocity ramp alpha");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
prop= RNA_def_property(srna, "use_velocity_color", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_velocity_color", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_VELOCITY_COLOR); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_VELOCITY_COLOR);
RNA_def_property_ui_text(prop, "Replace Color", "Replace brush color by velocity color ramp"); RNA_def_property_ui_text(prop, "Replace Color", "Replace brush color by velocity color ramp");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
@@ -829,49 +829,49 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna)
/* /*
* Paint Area / Collision * Paint Area / Collision
*/ */
prop= RNA_def_property(srna, "paint_source", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "paint_source", PROP_ENUM, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_enum_sdna(prop, NULL, "collision"); RNA_def_property_enum_sdna(prop, NULL, "collision");
RNA_def_property_enum_items(prop, prop_dynamicpaint_collisiontype); RNA_def_property_enum_items(prop, prop_dynamicpaint_collisiontype);
RNA_def_property_ui_text(prop, "Paint Source", ""); RNA_def_property_ui_text(prop, "Paint Source", "");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
prop= RNA_def_property(srna, "paint_distance", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "paint_distance", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "paint_distance"); RNA_def_property_float_sdna(prop, NULL, "paint_distance");
RNA_def_property_range(prop, 0.0, 500.0); RNA_def_property_range(prop, 0.0, 500.0);
RNA_def_property_ui_range(prop, 0.0, 500.0, 10, 3); RNA_def_property_ui_range(prop, 0.0, 500.0, 10, 3);
RNA_def_property_ui_text(prop, "Proximity Distance", "Maximum distance from brush to mesh surface to affect paint"); RNA_def_property_ui_text(prop, "Proximity Distance", "Maximum distance from brush to mesh surface to affect paint");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
prop= RNA_def_property(srna, "use_proximity_ramp_alpha", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_proximity_ramp_alpha", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_RAMP_ALPHA); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_RAMP_ALPHA);
RNA_def_property_ui_text(prop, "Only Use Alpha", "Only read color ramp alpha"); RNA_def_property_ui_text(prop, "Only Use Alpha", "Only read color ramp alpha");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
prop= RNA_def_property(srna, "proximity_falloff", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "proximity_falloff", PROP_ENUM, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_enum_sdna(prop, NULL, "proximity_falloff"); RNA_def_property_enum_sdna(prop, NULL, "proximity_falloff");
RNA_def_property_enum_items(prop, prop_dynamicpaint_prox_falloff); RNA_def_property_enum_items(prop, prop_dynamicpaint_prox_falloff);
RNA_def_property_ui_text(prop, "Falloff", "Proximity falloff type"); RNA_def_property_ui_text(prop, "Falloff", "Proximity falloff type");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
prop= RNA_def_property(srna, "use_proximity_project", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_proximity_project", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_PROX_PROJECT); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_PROX_PROJECT);
RNA_def_property_ui_text(prop, "Project", "Brush is projected to canvas from defined direction within brush proximity"); RNA_def_property_ui_text(prop, "Project", "Brush is projected to canvas from defined direction within brush proximity");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
prop= RNA_def_property(srna, "ray_direction", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "ray_direction", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "ray_dir"); RNA_def_property_enum_sdna(prop, NULL, "ray_dir");
RNA_def_property_enum_items(prop, prop_dynamicpaint_brush_ray_dir); RNA_def_property_enum_items(prop, prop_dynamicpaint_brush_ray_dir);
RNA_def_property_ui_text(prop, "Ray Direction", "Ray direction to use for projection (if brush object is located in that direction it's painted)"); RNA_def_property_ui_text(prop, "Ray Direction", "Ray direction to use for projection (if brush object is located in that direction it's painted)");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
prop= RNA_def_property(srna, "invert_proximity", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "invert_proximity", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_INVERSE_PROX); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_INVERSE_PROX);
RNA_def_property_ui_text(prop, "Inner Proximity", "Proximity falloff is applied inside the volume"); RNA_def_property_ui_text(prop, "Inner Proximity", "Proximity falloff is applied inside the volume");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
prop= RNA_def_property(srna, "use_negative_volume", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_negative_volume", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_NEGATE_VOLUME); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_NEGATE_VOLUME);
RNA_def_property_ui_text(prop, "Negate Volume", "Negate influence inside the volume"); RNA_def_property_ui_text(prop, "Negate Volume", "Negate influence inside the volume");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
@@ -880,7 +880,7 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna)
/* /*
* Particle * Particle
*/ */
prop= RNA_def_property(srna, "particle_system", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "particle_system", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "psys"); RNA_def_property_pointer_sdna(prop, NULL, "psys");
RNA_def_property_struct_type(prop, "ParticleSystem"); RNA_def_property_struct_type(prop, "ParticleSystem");
RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_flag(prop, PROP_EDITABLE);
@@ -888,19 +888,19 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna)
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_resetDependancy"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_resetDependancy");
prop= RNA_def_property(srna, "use_particle_radius", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_particle_radius", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_PART_RAD); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_PART_RAD);
RNA_def_property_ui_text(prop, "Use Particle Radius", "Use radius from particle settings"); RNA_def_property_ui_text(prop, "Use Particle Radius", "Use radius from particle settings");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
prop= RNA_def_property(srna, "solid_radius", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "solid_radius", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "particle_radius"); RNA_def_property_float_sdna(prop, NULL, "particle_radius");
RNA_def_property_range(prop, 0.01, 10.0); RNA_def_property_range(prop, 0.01, 10.0);
RNA_def_property_ui_range(prop, 0.01, 2.0, 5, 3); RNA_def_property_ui_range(prop, 0.01, 2.0, 5, 3);
RNA_def_property_ui_text(prop, "Solid Radius", "Radius that will be painted solid"); RNA_def_property_ui_text(prop, "Solid Radius", "Radius that will be painted solid");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
prop= RNA_def_property(srna, "smooth_radius", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "smooth_radius", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "particle_smooth"); RNA_def_property_float_sdna(prop, NULL, "particle_smooth");
RNA_def_property_range(prop, 0.0, 10.0); RNA_def_property_range(prop, 0.0, 10.0);
RNA_def_property_ui_range(prop, 0.0, 1.0, 5, 0); RNA_def_property_ui_range(prop, 0.0, 1.0, 5, 0);
@@ -911,13 +911,13 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna)
/* /*
* Color ramps * Color ramps
*/ */
prop= RNA_def_property(srna, "paint_ramp", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "paint_ramp", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "paint_ramp"); RNA_def_property_pointer_sdna(prop, NULL, "paint_ramp");
RNA_def_property_struct_type(prop, "ColorRamp"); RNA_def_property_struct_type(prop, "ColorRamp");
RNA_def_property_ui_text(prop, "Paint Color Ramp", "Color ramp used to define proximity falloff"); RNA_def_property_ui_text(prop, "Paint Color Ramp", "Color ramp used to define proximity falloff");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
prop= RNA_def_property(srna, "velocity_ramp", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "velocity_ramp", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "vel_ramp"); RNA_def_property_pointer_sdna(prop, NULL, "vel_ramp");
RNA_def_property_struct_type(prop, "ColorRamp"); RNA_def_property_struct_type(prop, "ColorRamp");
RNA_def_property_ui_text(prop, "Velocity Color Ramp", "Color ramp used to define brush velocity effect"); RNA_def_property_ui_text(prop, "Velocity Color Ramp", "Color ramp used to define brush velocity effect");

File diff suppressed because it is too large Load Diff

View File

@@ -49,8 +49,8 @@
void RNA_api_drivers(StructRNA *srna) void RNA_api_drivers(StructRNA *srna)
{ {
// FunctionRNA *func; /* FunctionRNA *func; */
// PropertyRNA *parm; /* PropertyRNA *parm; */
} }
#endif #endif

View File

@@ -53,9 +53,9 @@
static StructRNA* rna_FluidSettings_refine(struct PointerRNA *ptr) static StructRNA* rna_FluidSettings_refine(struct PointerRNA *ptr)
{ {
FluidsimSettings *fss= (FluidsimSettings*)ptr->data; FluidsimSettings *fss = (FluidsimSettings*)ptr->data;
switch(fss->type) { switch (fss->type) {
case OB_FLUIDSIM_DOMAIN: case OB_FLUIDSIM_DOMAIN:
return &RNA_DomainFluidSettings; return &RNA_DomainFluidSettings;
case OB_FLUIDSIM_FLUID: case OB_FLUIDSIM_FLUID:
@@ -77,7 +77,7 @@ static StructRNA* rna_FluidSettings_refine(struct PointerRNA *ptr)
static void rna_fluid_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) static void rna_fluid_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{ {
Object *ob= ptr->id.data; Object *ob = ptr->id.data;
DAG_id_tag_update(&ob->id, OB_RECALC_DATA); DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
WM_main_add_notifier(NC_OBJECT|ND_MODIFIER, ob); WM_main_add_notifier(NC_OBJECT|ND_MODIFIER, ob);
@@ -95,17 +95,17 @@ static int fluidsim_find_lastframe(Object *ob, FluidsimSettings *fss)
do { do {
BLI_strncpy(targetFileTest, targetFile, sizeof(targetFileTest)); BLI_strncpy(targetFileTest, targetFile, sizeof(targetFileTest));
BLI_path_frame(targetFileTest, curFrame++, 0); BLI_path_frame(targetFileTest, curFrame++, 0);
} while(BLI_exists(targetFileTest)); } while (BLI_exists(targetFileTest));
return curFrame - 1; return curFrame - 1;
} }
static void rna_fluid_find_enframe(Main *bmain, Scene *scene, PointerRNA *ptr) static void rna_fluid_find_enframe(Main *bmain, Scene *scene, PointerRNA *ptr)
{ {
Object *ob= ptr->id.data; Object *ob = ptr->id.data;
FluidsimModifierData *fluidmd= (FluidsimModifierData*)modifiers_findByType(ob, eModifierType_Fluidsim); FluidsimModifierData *fluidmd = (FluidsimModifierData*)modifiers_findByType(ob, eModifierType_Fluidsim);
if(fluidmd->fss->flag & OB_FLUIDSIM_REVERSE) { if (fluidmd->fss->flag & OB_FLUIDSIM_REVERSE) {
fluidmd->fss->lastgoodframe = fluidsim_find_lastframe(ob, fluidmd->fss); fluidmd->fss->lastgoodframe = fluidsim_find_lastframe(ob, fluidmd->fss);
} }
else { else {
@@ -116,46 +116,46 @@ static void rna_fluid_find_enframe(Main *bmain, Scene *scene, PointerRNA *ptr)
static void rna_FluidSettings_update_type(Main *bmain, Scene *scene, PointerRNA *ptr) static void rna_FluidSettings_update_type(Main *bmain, Scene *scene, PointerRNA *ptr)
{ {
Object *ob= (Object*)ptr->id.data; Object *ob = (Object*)ptr->id.data;
FluidsimModifierData *fluidmd; FluidsimModifierData *fluidmd;
ParticleSystemModifierData *psmd; ParticleSystemModifierData *psmd;
ParticleSystem *psys; ParticleSystem *psys;
ParticleSettings *part; ParticleSettings *part;
fluidmd= (FluidsimModifierData*)modifiers_findByType(ob, eModifierType_Fluidsim); fluidmd = (FluidsimModifierData*)modifiers_findByType(ob, eModifierType_Fluidsim);
fluidmd->fss->flag &= ~OB_FLUIDSIM_REVERSE; // clear flag fluidmd->fss->flag &= ~OB_FLUIDSIM_REVERSE; /* clear flag */
/* remove fluidsim particle system */ /* remove fluidsim particle system */
if(fluidmd->fss->type & OB_FLUIDSIM_PARTICLE) { if (fluidmd->fss->type & OB_FLUIDSIM_PARTICLE) {
for(psys=ob->particlesystem.first; psys; psys=psys->next) for (psys = ob->particlesystem.first; psys; psys = psys->next)
if(psys->part->type == PART_FLUID) if (psys->part->type == PART_FLUID)
break; break;
if(ob->type == OB_MESH && !psys) { if (ob->type == OB_MESH && !psys) {
/* add particle system */ /* add particle system */
part= psys_new_settings("ParticleSettings", bmain); part = psys_new_settings("ParticleSettings", bmain);
psys= MEM_callocN(sizeof(ParticleSystem), "particle_system"); psys = MEM_callocN(sizeof(ParticleSystem), "particle_system");
part->type= PART_FLUID; part->type = PART_FLUID;
psys->part= part; psys->part = part;
psys->pointcache= BKE_ptcache_add(&psys->ptcaches); psys->pointcache = BKE_ptcache_add(&psys->ptcaches);
psys->flag |= PSYS_ENABLED; psys->flag |= PSYS_ENABLED;
BLI_strncpy(psys->name, "FluidParticles", sizeof(psys->name)); BLI_strncpy(psys->name, "FluidParticles", sizeof(psys->name));
BLI_addtail(&ob->particlesystem,psys); BLI_addtail(&ob->particlesystem,psys);
/* add modifier */ /* add modifier */
psmd= (ParticleSystemModifierData*)modifier_new(eModifierType_ParticleSystem); psmd = (ParticleSystemModifierData*)modifier_new(eModifierType_ParticleSystem);
BLI_strncpy(psmd->modifier.name, "FluidParticleSystem", sizeof(psmd->modifier.name)); BLI_strncpy(psmd->modifier.name, "FluidParticleSystem", sizeof(psmd->modifier.name));
psmd->psys= psys; psmd->psys = psys;
BLI_addtail(&ob->modifiers, psmd); BLI_addtail(&ob->modifiers, psmd);
modifier_unique_name(&ob->modifiers, (ModifierData *)psmd); modifier_unique_name(&ob->modifiers, (ModifierData *)psmd);
} }
} }
else { else {
for(psys=ob->particlesystem.first; psys; psys=psys->next) { for (psys = ob->particlesystem.first; psys; psys = psys->next) {
if(psys->part->type == PART_FLUID) { if (psys->part->type == PART_FLUID) {
/* clear modifier */ /* clear modifier */
psmd= psys_get_modifier(ob, psys); psmd = psys_get_modifier(ob, psys);
BLI_remlink(&ob->modifiers, psmd); BLI_remlink(&ob->modifiers, psmd);
modifier_free((ModifierData *)psmd); modifier_free((ModifierData *)psmd);
@@ -173,10 +173,10 @@ static void rna_DomainFluidSettings_memory_estimate_get(PointerRNA *ptr, char *v
{ {
#ifndef WITH_MOD_FLUID #ifndef WITH_MOD_FLUID
(void)ptr; (void)ptr;
value[0]= '\0'; value[0] = '\0';
#else #else
Object *ob= (Object*)ptr->id.data; Object *ob = (Object*)ptr->id.data;
FluidsimSettings *fss= (FluidsimSettings*)ptr->data; FluidsimSettings *fss = (FluidsimSettings*)ptr->data;
fluid_estimate_memory(ob, fss, value); fluid_estimate_memory(ob, fss, value);
#endif #endif
@@ -194,7 +194,7 @@ static int rna_DomainFluidSettings_memory_estimate_length(PointerRNA *UNUSED(ptr
static char *rna_FluidSettings_path(PointerRNA *ptr) static char *rna_FluidSettings_path(PointerRNA *ptr)
{ {
FluidsimSettings *fss = (FluidsimSettings*)ptr->data; FluidsimSettings *fss = (FluidsimSettings*)ptr->data;
ModifierData *md= (ModifierData *)fss->fmd; ModifierData *md = (ModifierData *)fss->fmd;
return BLI_sprintfN("modifiers[\"%s\"].settings", md->name); return BLI_sprintfN("modifiers[\"%s\"].settings", md->name);
} }
@@ -223,13 +223,13 @@ static void rna_def_fluidsim_slip(StructRNA *srna)
{OB_FSBND_FREESLIP, "FREESLIP", 0, "Free Slip", "Obstacle only causes zero normal velocity (=not sticky, non moving objects only!)"}, {OB_FSBND_FREESLIP, "FREESLIP", 0, "Free Slip", "Obstacle only causes zero normal velocity (=not sticky, non moving objects only!)"},
{0, NULL, 0, NULL, NULL}}; {0, NULL, 0, NULL, NULL}};
prop= RNA_def_property(srna, "slip_type", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "slip_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "typeFlags"); RNA_def_property_enum_bitflag_sdna(prop, NULL, "typeFlags");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_enum_items(prop, slip_items); RNA_def_property_enum_items(prop, slip_items);
RNA_def_property_ui_text(prop, "Slip Type", ""); RNA_def_property_ui_text(prop, "Slip Type", "");
prop= RNA_def_property(srna, "partial_slip_factor", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "partial_slip_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "partSlipValue"); RNA_def_property_float_sdna(prop, NULL, "partSlipValue");
RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Partial Slip Amount", "Amount of mixing between no- and free-slip, 0 is no slip and 1 is free slip"); RNA_def_property_ui_text(prop, "Partial Slip Amount", "Amount of mixing between no- and free-slip, 0 is no slip and 1 is free slip");
@@ -240,12 +240,12 @@ static void rna_def_fluid_mesh_vertices(BlenderRNA *brna)
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
srna= RNA_def_struct(brna, "FluidMeshVertex", NULL); srna = RNA_def_struct(brna, "FluidMeshVertex", NULL);
RNA_def_struct_sdna(srna, "FluidVertexVelocity"); RNA_def_struct_sdna(srna, "FluidVertexVelocity");
RNA_def_struct_ui_text(srna, "Fluid Mesh Vertex", "Vertex of a simulated fluid mesh"); RNA_def_struct_ui_text(srna, "Fluid Mesh Vertex", "Vertex of a simulated fluid mesh");
RNA_def_struct_ui_icon(srna, ICON_VERTEXSEL); RNA_def_struct_ui_icon(srna, ICON_VERTEXSEL);
prop= RNA_def_property(srna, "velocity", PROP_FLOAT, PROP_VELOCITY); prop = RNA_def_property(srna, "velocity", PROP_FLOAT, PROP_VELOCITY);
RNA_def_property_array(prop, 3); RNA_def_property_array(prop, 3);
RNA_def_property_float_sdna(prop, NULL, "vel"); RNA_def_property_float_sdna(prop, NULL, "vel");
RNA_def_property_ui_text(prop, "Velocity", ""); RNA_def_property_ui_text(prop, "Velocity", "");
@@ -271,107 +271,107 @@ static void rna_def_fluidsim_domain(BlenderRNA *brna)
{4, "HONEY", 0, "Honey", "Viscosity of 2.0 * 10^-3"}, {4, "HONEY", 0, "Honey", "Viscosity of 2.0 * 10^-3"},
{0, NULL, 0, NULL, NULL}}; {0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "DomainFluidSettings", "FluidSettings"); srna = RNA_def_struct(brna, "DomainFluidSettings", "FluidSettings");
RNA_def_struct_sdna(srna, "FluidsimSettings"); RNA_def_struct_sdna(srna, "FluidsimSettings");
RNA_def_struct_ui_text(srna, "Domain Fluid Simulation Settings", "Fluid simulation settings for the domain of a fluid simulation"); RNA_def_struct_ui_text(srna, "Domain Fluid Simulation Settings", "Fluid simulation settings for the domain of a fluid simulation");
/* standard settings */ /* standard settings */
prop= RNA_def_property(srna, "resolution", PROP_INT, PROP_NONE); prop = RNA_def_property(srna, "resolution", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "resolutionxyz"); RNA_def_property_int_sdna(prop, NULL, "resolutionxyz");
RNA_def_property_range(prop, 1, 1024); RNA_def_property_range(prop, 1, 1024);
RNA_def_property_ui_text(prop, "Resolution", "Domain resolution in X,Y and Z direction"); RNA_def_property_ui_text(prop, "Resolution", "Domain resolution in X,Y and Z direction");
prop= RNA_def_property(srna, "preview_resolution", PROP_INT, PROP_NONE); prop = RNA_def_property(srna, "preview_resolution", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "previewresxyz"); RNA_def_property_int_sdna(prop, NULL, "previewresxyz");
RNA_def_property_range(prop, 1, 100); RNA_def_property_range(prop, 1, 100);
RNA_def_property_ui_text(prop, "Preview Resolution", "Preview resolution in X,Y and Z direction"); RNA_def_property_ui_text(prop, "Preview Resolution", "Preview resolution in X,Y and Z direction");
prop= RNA_def_property(srna, "viewport_display_mode", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "viewport_display_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "guiDisplayMode"); RNA_def_property_enum_sdna(prop, NULL, "guiDisplayMode");
RNA_def_property_enum_items(prop, quality_items); RNA_def_property_enum_items(prop, quality_items);
RNA_def_property_ui_text(prop, "Viewport Display Mode", "How to display the mesh in the viewport"); RNA_def_property_ui_text(prop, "Viewport Display Mode", "How to display the mesh in the viewport");
RNA_def_property_update(prop, 0, "rna_fluid_update"); RNA_def_property_update(prop, 0, "rna_fluid_update");
prop= RNA_def_property(srna, "render_display_mode", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "render_display_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "renderDisplayMode"); RNA_def_property_enum_sdna(prop, NULL, "renderDisplayMode");
RNA_def_property_enum_items(prop, quality_items); RNA_def_property_enum_items(prop, quality_items);
RNA_def_property_ui_text(prop, "Render Display Mode", "How to display the mesh for rendering"); RNA_def_property_ui_text(prop, "Render Display Mode", "How to display the mesh for rendering");
prop= RNA_def_property(srna, "use_reverse_frames", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_reverse_frames", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", OB_FLUIDSIM_REVERSE); RNA_def_property_boolean_sdna(prop, NULL, "flag", OB_FLUIDSIM_REVERSE);
RNA_def_property_ui_text(prop, "Reverse Frames", "Reverse fluid frames"); RNA_def_property_ui_text(prop, "Reverse Frames", "Reverse fluid frames");
RNA_def_property_update(prop, 0, "rna_fluid_find_enframe"); RNA_def_property_update(prop, 0, "rna_fluid_find_enframe");
prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH); prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
RNA_def_property_string_maxlength(prop, FILE_MAX); RNA_def_property_string_maxlength(prop, FILE_MAX);
RNA_def_property_string_sdna(prop, NULL, "surfdataPath"); RNA_def_property_string_sdna(prop, NULL, "surfdataPath");
RNA_def_property_ui_text(prop, "Path", "Directory (and/or filename prefix) to store baked fluid simulation files in"); RNA_def_property_ui_text(prop, "Path", "Directory (and/or filename prefix) to store baked fluid simulation files in");
RNA_def_property_update(prop, 0, "rna_fluid_update"); RNA_def_property_update(prop, 0, "rna_fluid_update");
prop= RNA_def_property(srna, "memory_estimate", PROP_STRING, PROP_NONE); prop = RNA_def_property(srna, "memory_estimate", PROP_STRING, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_string_funcs(prop, "rna_DomainFluidSettings_memory_estimate_get", "rna_DomainFluidSettings_memory_estimate_length", NULL); RNA_def_property_string_funcs(prop, "rna_DomainFluidSettings_memory_estimate_get", "rna_DomainFluidSettings_memory_estimate_length", NULL);
RNA_def_property_ui_text(prop, "Memory Estimate", "Estimated amount of memory needed for baking the domain"); RNA_def_property_ui_text(prop, "Memory Estimate", "Estimated amount of memory needed for baking the domain");
/* advanced settings */ /* advanced settings */
prop= RNA_def_property(srna, "gravity", PROP_FLOAT, PROP_ACCELERATION); prop = RNA_def_property(srna, "gravity", PROP_FLOAT, PROP_ACCELERATION);
RNA_def_property_float_sdna(prop, NULL, "grav"); RNA_def_property_float_sdna(prop, NULL, "grav");
RNA_def_property_array(prop, 3); RNA_def_property_array(prop, 3);
RNA_def_property_range(prop, -1000.1, 1000.1); RNA_def_property_range(prop, -1000.1, 1000.1);
RNA_def_property_ui_text(prop, "Gravity", "Gravity in X, Y and Z direction"); RNA_def_property_ui_text(prop, "Gravity", "Gravity in X, Y and Z direction");
prop= RNA_def_property(srna, "use_time_override", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_time_override", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", OB_FLUIDSIM_OVERRIDE_TIME); RNA_def_property_boolean_sdna(prop, NULL, "flag", OB_FLUIDSIM_OVERRIDE_TIME);
RNA_def_property_ui_text(prop, "Override Time", "Use a custom start and end time (in seconds) instead of the scene's timeline"); RNA_def_property_ui_text(prop, "Override Time", "Use a custom start and end time (in seconds) instead of the scene's timeline");
prop= RNA_def_property(srna, "start_time", PROP_FLOAT, PROP_TIME); prop = RNA_def_property(srna, "start_time", PROP_FLOAT, PROP_TIME);
RNA_def_property_float_sdna(prop, NULL, "animStart"); RNA_def_property_float_sdna(prop, NULL, "animStart");
RNA_def_property_range(prop, 0, 100); RNA_def_property_range(prop, 0, 100);
RNA_def_property_ui_text(prop, "Start Time", "Simulation time of the first blender frame (in seconds)"); RNA_def_property_ui_text(prop, "Start Time", "Simulation time of the first blender frame (in seconds)");
prop= RNA_def_property(srna, "end_time", PROP_FLOAT, PROP_TIME); prop = RNA_def_property(srna, "end_time", PROP_FLOAT, PROP_TIME);
RNA_def_property_float_sdna(prop, NULL, "animEnd"); RNA_def_property_float_sdna(prop, NULL, "animEnd");
RNA_def_property_range(prop, 0, 100); RNA_def_property_range(prop, 0, 100);
RNA_def_property_ui_text(prop, "End Time", "Simulation time of the last blender frame (in seconds)"); RNA_def_property_ui_text(prop, "End Time", "Simulation time of the last blender frame (in seconds)");
prop= RNA_def_property(srna, "frame_offset", PROP_INT, PROP_NONE); prop = RNA_def_property(srna, "frame_offset", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "frameOffset"); RNA_def_property_int_sdna(prop, NULL, "frameOffset");
RNA_def_property_ui_text(prop, "Cache Offset", "Offset when reading baked cache"); RNA_def_property_ui_text(prop, "Cache Offset", "Offset when reading baked cache");
RNA_def_property_update(prop, NC_OBJECT, "rna_fluid_update"); RNA_def_property_update(prop, NC_OBJECT, "rna_fluid_update");
prop= RNA_def_property(srna, "simulation_scale", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "simulation_scale", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "realsize"); RNA_def_property_float_sdna(prop, NULL, "realsize");
RNA_def_property_range(prop, 0.001, 10); RNA_def_property_range(prop, 0.001, 10);
RNA_def_property_ui_text(prop, "Real World Size", "Size of the simulation domain in metres"); RNA_def_property_ui_text(prop, "Real World Size", "Size of the simulation domain in metres");
prop= RNA_def_property(srna, "simulation_rate", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "simulation_rate", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "animRate"); RNA_def_property_float_sdna(prop, NULL, "animRate");
RNA_def_property_range(prop, 0.0, 100.0); RNA_def_property_range(prop, 0.0, 100.0);
RNA_def_property_ui_text(prop, "Simulation Speed", "Fluid motion rate (0 = stationary, 1 = normal speed)"); RNA_def_property_ui_text(prop, "Simulation Speed", "Fluid motion rate (0 = stationary, 1 = normal speed)");
prop= RNA_def_property(srna, "viscosity_preset", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "viscosity_preset", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "viscosityMode"); RNA_def_property_enum_sdna(prop, NULL, "viscosityMode");
RNA_def_property_enum_items(prop, viscosity_items); RNA_def_property_enum_items(prop, viscosity_items);
RNA_def_property_ui_text(prop, "Viscosity Preset", "Set viscosity of the fluid to a preset value, or use manual input"); RNA_def_property_ui_text(prop, "Viscosity Preset", "Set viscosity of the fluid to a preset value, or use manual input");
prop= RNA_def_property(srna, "viscosity_base", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "viscosity_base", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "viscosityValue"); RNA_def_property_float_sdna(prop, NULL, "viscosityValue");
RNA_def_property_range(prop, 0, 10); RNA_def_property_range(prop, 0, 10);
RNA_def_property_ui_text(prop, "Viscosity Base", "Viscosity setting: value that is multiplied by 10 to the power of (exponent*-1)"); RNA_def_property_ui_text(prop, "Viscosity Base", "Viscosity setting: value that is multiplied by 10 to the power of (exponent*-1)");
prop= RNA_def_property(srna, "viscosity_exponent", PROP_INT, PROP_NONE); prop = RNA_def_property(srna, "viscosity_exponent", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "viscosityExponent"); RNA_def_property_int_sdna(prop, NULL, "viscosityExponent");
RNA_def_property_range(prop, 0, 10); RNA_def_property_range(prop, 0, 10);
RNA_def_property_ui_text(prop, "Viscosity Exponent", "Negative exponent for the viscosity value (to simplify entering small values e.g. 5*10^-6)"); RNA_def_property_ui_text(prop, "Viscosity Exponent", "Negative exponent for the viscosity value (to simplify entering small values e.g. 5*10^-6)");
prop= RNA_def_property(srna, "grid_levels", PROP_INT, PROP_NONE); prop = RNA_def_property(srna, "grid_levels", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "maxRefine"); RNA_def_property_int_sdna(prop, NULL, "maxRefine");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, -1, 4); RNA_def_property_range(prop, -1, 4);
RNA_def_property_ui_text(prop, "Grid Levels", "Number of coarsened grids to use (-1 for automatic)"); RNA_def_property_ui_text(prop, "Grid Levels", "Number of coarsened grids to use (-1 for automatic)");
prop= RNA_def_property(srna, "compressibility", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "compressibility", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "gstar"); RNA_def_property_float_sdna(prop, NULL, "gstar");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 0.001, 0.1); RNA_def_property_range(prop, 0.001, 0.1);
@@ -381,45 +381,45 @@ static void rna_def_fluidsim_domain(BlenderRNA *brna)
rna_def_fluidsim_slip(srna); rna_def_fluidsim_slip(srna);
prop= RNA_def_property(srna, "surface_smooth", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "surface_smooth", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "surfaceSmoothing"); RNA_def_property_float_sdna(prop, NULL, "surfaceSmoothing");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 0.0, 5.0); RNA_def_property_range(prop, 0.0, 5.0);
RNA_def_property_ui_text(prop, "Surface Smoothing", "Amount of surface smoothing (a value of 0 is off, 1 is normal smoothing and more than 1 is extra smoothing)"); RNA_def_property_ui_text(prop, "Surface Smoothing", "Amount of surface smoothing (a value of 0 is off, 1 is normal smoothing and more than 1 is extra smoothing)");
prop= RNA_def_property(srna, "surface_subdivisions", PROP_INT, PROP_NONE); prop = RNA_def_property(srna, "surface_subdivisions", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "surfaceSubdivs"); RNA_def_property_int_sdna(prop, NULL, "surfaceSubdivs");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 0, 5); RNA_def_property_range(prop, 0, 5);
RNA_def_property_ui_text(prop, "Surface Subdivisions", "Number of isosurface subdivisions (this is necessary for the inclusion of particles into the surface generation - WARNING: can lead to longer computation times !)"); RNA_def_property_ui_text(prop, "Surface Subdivisions", "Number of isosurface subdivisions (this is necessary for the inclusion of particles into the surface generation - WARNING: can lead to longer computation times !)");
prop= RNA_def_property(srna, "use_speed_vectors", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_speed_vectors", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "domainNovecgen", 0); RNA_def_property_boolean_negative_sdna(prop, NULL, "domainNovecgen", 0);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Generate Speed Vectors", "Generate speed vectors for vector blur"); RNA_def_property_ui_text(prop, "Generate Speed Vectors", "Generate speed vectors for vector blur");
/* no collision object surface */ /* no collision object surface */
prop= RNA_def_property(srna, "surface_noobs", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "surface_noobs", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "typeFlags", OB_FSSG_NOOBS); RNA_def_property_boolean_sdna(prop, NULL, "typeFlags", OB_FSSG_NOOBS);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Hide fluid surface", ""); RNA_def_property_ui_text(prop, "Hide fluid surface", "");
/* particles */ /* particles */
prop= RNA_def_property(srna, "tracer_particles", PROP_INT, PROP_NONE); prop = RNA_def_property(srna, "tracer_particles", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "generateTracers"); RNA_def_property_int_sdna(prop, NULL, "generateTracers");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 0, 10000); RNA_def_property_range(prop, 0, 10000);
RNA_def_property_ui_text(prop, "Tracer Particles", "Number of tracer particles to generate"); RNA_def_property_ui_text(prop, "Tracer Particles", "Number of tracer particles to generate");
prop= RNA_def_property(srna, "generate_particles", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "generate_particles", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "generateParticles"); RNA_def_property_float_sdna(prop, NULL, "generateParticles");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 0.0, 10.0); RNA_def_property_range(prop, 0.0, 10.0);
RNA_def_property_ui_text(prop, "Generate Particles", "Amount of particles to generate (0=off, 1=normal, >1=more)"); RNA_def_property_ui_text(prop, "Generate Particles", "Amount of particles to generate (0=off, 1=normal, >1=more)");
/* simulated fluid mesh data */ /* simulated fluid mesh data */
prop= RNA_def_property(srna, "fluid_mesh_vertices", PROP_COLLECTION, PROP_NONE); prop = RNA_def_property(srna, "fluid_mesh_vertices", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "FluidMeshVertex"); RNA_def_property_struct_type(prop, "FluidMeshVertex");
RNA_def_property_ui_text(prop, "Fluid Mesh Vertices", "Vertices of the fluid mesh generated by simulation"); RNA_def_property_ui_text(prop, "Fluid Mesh Vertices", "Vertices of the fluid mesh generated by simulation");
RNA_def_property_collection_funcs(prop, "rna_FluidMeshVertex_data_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_FluidMeshVertex_data_length", NULL, NULL, NULL); RNA_def_property_collection_funcs(prop, "rna_FluidMeshVertex_data_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_FluidMeshVertex_data_length", NULL, NULL, NULL);
@@ -436,13 +436,13 @@ static void rna_def_fluidsim_volume(StructRNA *srna)
{3, "BOTH", 0, "Both", "Use both the inner volume and the outer shell of the mesh"}, {3, "BOTH", 0, "Both", "Use both the inner volume and the outer shell of the mesh"},
{0, NULL, 0, NULL, NULL}}; {0, NULL, 0, NULL, NULL}};
prop= RNA_def_property(srna, "volume_initialization", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "volume_initialization", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "volumeInitType"); RNA_def_property_enum_bitflag_sdna(prop, NULL, "volumeInitType");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_enum_items(prop, volume_type_items); RNA_def_property_enum_items(prop, volume_type_items);
RNA_def_property_ui_text(prop, "Volume Initialization", "Volume initialization type"); RNA_def_property_ui_text(prop, "Volume Initialization", "Volume initialization type");
prop= RNA_def_property(srna, "use_animated_mesh", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_animated_mesh", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "domainNovecgen", 0); RNA_def_property_boolean_sdna(prop, NULL, "domainNovecgen", 0);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Export Animated Mesh", "Export this mesh as an animated one (slower, only use if really necessary [e.g. armatures or parented objects], animated pos/rot/scale F-Curves do not require it)"); RNA_def_property_ui_text(prop, "Export Animated Mesh", "Export this mesh as an animated one (slower, only use if really necessary [e.g. armatures or parented objects], animated pos/rot/scale F-Curves do not require it)");
@@ -452,7 +452,7 @@ static void rna_def_fluidsim_active(StructRNA *srna)
{ {
PropertyRNA *prop; PropertyRNA *prop;
prop= RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", OB_FLUIDSIM_ACTIVE); RNA_def_property_boolean_sdna(prop, NULL, "flag", OB_FLUIDSIM_ACTIVE);
RNA_def_property_ui_text(prop, "Enabled", "Object contributes to the fluid simulation"); RNA_def_property_ui_text(prop, "Enabled", "Object contributes to the fluid simulation");
} }
@@ -462,14 +462,14 @@ static void rna_def_fluidsim_fluid(BlenderRNA *brna)
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
srna= RNA_def_struct(brna, "FluidFluidSettings", "FluidSettings"); srna = RNA_def_struct(brna, "FluidFluidSettings", "FluidSettings");
RNA_def_struct_sdna(srna, "FluidsimSettings"); RNA_def_struct_sdna(srna, "FluidsimSettings");
RNA_def_struct_ui_text(srna, "Fluid Fluid Simulation Settings", "Fluid simulation settings for the fluid in the simulation"); RNA_def_struct_ui_text(srna, "Fluid Fluid Simulation Settings", "Fluid simulation settings for the fluid in the simulation");
rna_def_fluidsim_active(srna); rna_def_fluidsim_active(srna);
rna_def_fluidsim_volume(srna); rna_def_fluidsim_volume(srna);
prop= RNA_def_property(srna, "initial_velocity", PROP_FLOAT, PROP_VELOCITY); prop = RNA_def_property(srna, "initial_velocity", PROP_FLOAT, PROP_VELOCITY);
RNA_def_property_float_sdna(prop, NULL, "iniVelx"); RNA_def_property_float_sdna(prop, NULL, "iniVelx");
RNA_def_property_array(prop, 3); RNA_def_property_array(prop, 3);
RNA_def_property_range(prop, -1000.1, 1000.1); RNA_def_property_range(prop, -1000.1, 1000.1);
@@ -481,7 +481,7 @@ static void rna_def_fluidsim_obstacle(BlenderRNA *brna)
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
srna= RNA_def_struct(brna, "ObstacleFluidSettings", "FluidSettings"); srna = RNA_def_struct(brna, "ObstacleFluidSettings", "FluidSettings");
RNA_def_struct_sdna(srna, "FluidsimSettings"); RNA_def_struct_sdna(srna, "FluidsimSettings");
RNA_def_struct_ui_text(srna, "Obstacle Fluid Simulation Settings", "Fluid simulation settings for obstacles in the simulation"); RNA_def_struct_ui_text(srna, "Obstacle Fluid Simulation Settings", "Fluid simulation settings for obstacles in the simulation");
@@ -489,7 +489,7 @@ static void rna_def_fluidsim_obstacle(BlenderRNA *brna)
rna_def_fluidsim_volume(srna); rna_def_fluidsim_volume(srna);
rna_def_fluidsim_slip(srna); rna_def_fluidsim_slip(srna);
prop= RNA_def_property(srna, "impact_factor", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "impact_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "surfaceSmoothing"); RNA_def_property_float_sdna(prop, NULL, "surfaceSmoothing");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, -2.0, 10.0); RNA_def_property_range(prop, -2.0, 10.0);
@@ -501,20 +501,20 @@ static void rna_def_fluidsim_inflow(BlenderRNA *brna)
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
srna= RNA_def_struct(brna, "InflowFluidSettings", "FluidSettings"); srna = RNA_def_struct(brna, "InflowFluidSettings", "FluidSettings");
RNA_def_struct_sdna(srna, "FluidsimSettings"); RNA_def_struct_sdna(srna, "FluidsimSettings");
RNA_def_struct_ui_text(srna, "Inflow Fluid Simulation Settings", "Fluid simulation settings for objects adding fluids in the simulation"); RNA_def_struct_ui_text(srna, "Inflow Fluid Simulation Settings", "Fluid simulation settings for objects adding fluids in the simulation");
rna_def_fluidsim_active(srna); rna_def_fluidsim_active(srna);
rna_def_fluidsim_volume(srna); rna_def_fluidsim_volume(srna);
prop= RNA_def_property(srna, "inflow_velocity", PROP_FLOAT, PROP_VELOCITY); prop = RNA_def_property(srna, "inflow_velocity", PROP_FLOAT, PROP_VELOCITY);
RNA_def_property_float_sdna(prop, NULL, "iniVelx"); RNA_def_property_float_sdna(prop, NULL, "iniVelx");
RNA_def_property_array(prop, 3); RNA_def_property_array(prop, 3);
RNA_def_property_range(prop, -1000.1, 1000.1); RNA_def_property_range(prop, -1000.1, 1000.1);
RNA_def_property_ui_text(prop, "Inflow Velocity", "Initial velocity of fluid"); RNA_def_property_ui_text(prop, "Inflow Velocity", "Initial velocity of fluid");
prop= RNA_def_property(srna, "use_local_coords", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_local_coords", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_boolean_sdna(prop, NULL, "typeFlags", OB_FSINFLOW_LOCALCOORD); RNA_def_property_boolean_sdna(prop, NULL, "typeFlags", OB_FSINFLOW_LOCALCOORD);
RNA_def_property_ui_text(prop, "Local Coordinates", "Use local coordinates for inflow (e.g. for rotating objects)"); RNA_def_property_ui_text(prop, "Local Coordinates", "Use local coordinates for inflow (e.g. for rotating objects)");
@@ -524,7 +524,7 @@ static void rna_def_fluidsim_outflow(BlenderRNA *brna)
{ {
StructRNA *srna; StructRNA *srna;
srna= RNA_def_struct(brna, "OutflowFluidSettings", "FluidSettings"); srna = RNA_def_struct(brna, "OutflowFluidSettings", "FluidSettings");
RNA_def_struct_sdna(srna, "FluidsimSettings"); RNA_def_struct_sdna(srna, "FluidsimSettings");
RNA_def_struct_ui_text(srna, "Outflow Fluid Simulation Settings", "Fluid simulation settings for objects removing fluids from the simulation"); RNA_def_struct_ui_text(srna, "Outflow Fluid Simulation Settings", "Fluid simulation settings for objects removing fluids from the simulation");
@@ -537,33 +537,33 @@ static void rna_def_fluidsim_particle(BlenderRNA *brna)
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
srna= RNA_def_struct(brna, "ParticleFluidSettings", "FluidSettings"); srna = RNA_def_struct(brna, "ParticleFluidSettings", "FluidSettings");
RNA_def_struct_sdna(srna, "FluidsimSettings"); RNA_def_struct_sdna(srna, "FluidsimSettings");
RNA_def_struct_ui_text(srna, "Particle Fluid Simulation Settings", "Fluid simulation settings for objects storing fluid particles generated by the simulation"); RNA_def_struct_ui_text(srna, "Particle Fluid Simulation Settings", "Fluid simulation settings for objects storing fluid particles generated by the simulation");
prop= RNA_def_property(srna, "use_drops", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_drops", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "typeFlags", OB_FSPART_DROP); RNA_def_property_boolean_sdna(prop, NULL, "typeFlags", OB_FSPART_DROP);
RNA_def_property_ui_text(prop, "Drops", "Show drop particles"); RNA_def_property_ui_text(prop, "Drops", "Show drop particles");
prop= RNA_def_property(srna, "use_floats", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_floats", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "typeFlags", OB_FSPART_FLOAT); RNA_def_property_boolean_sdna(prop, NULL, "typeFlags", OB_FSPART_FLOAT);
RNA_def_property_ui_text(prop, "Floats", "Show floating foam particles"); RNA_def_property_ui_text(prop, "Floats", "Show floating foam particles");
prop= RNA_def_property(srna, "show_tracer", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "show_tracer", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "typeFlags", OB_FSPART_TRACER); RNA_def_property_boolean_sdna(prop, NULL, "typeFlags", OB_FSPART_TRACER);
RNA_def_property_ui_text(prop, "Tracer", "Show tracer particles"); RNA_def_property_ui_text(prop, "Tracer", "Show tracer particles");
prop= RNA_def_property(srna, "particle_influence", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "particle_influence", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "particleInfSize"); RNA_def_property_float_sdna(prop, NULL, "particleInfSize");
RNA_def_property_range(prop, 0.0, 2.0); RNA_def_property_range(prop, 0.0, 2.0);
RNA_def_property_ui_text(prop, "Particle Influence", "Amount of particle size scaling: 0=off (all same size), 1=full (range 0.2-2.0), >1=stronger"); RNA_def_property_ui_text(prop, "Particle Influence", "Amount of particle size scaling: 0=off (all same size), 1=full (range 0.2-2.0), >1=stronger");
prop= RNA_def_property(srna, "alpha_influence", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "alpha_influence", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "particleInfAlpha"); RNA_def_property_float_sdna(prop, NULL, "particleInfAlpha");
RNA_def_property_range(prop, 0.0, 2.0); RNA_def_property_range(prop, 0.0, 2.0);
RNA_def_property_ui_text(prop, "Alpha Influence", "Amount of particle alpha change, inverse of size influence: 0=off (all same alpha), 1=full (large particles get lower alphas, smaller ones higher values)"); RNA_def_property_ui_text(prop, "Alpha Influence", "Amount of particle alpha change, inverse of size influence: 0=off (all same alpha), 1=full (large particles get lower alphas, smaller ones higher values)");
prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH); prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
RNA_def_property_string_maxlength(prop, FILE_MAX); RNA_def_property_string_maxlength(prop, FILE_MAX);
RNA_def_property_string_sdna(prop, NULL, "surfdataPath"); RNA_def_property_string_sdna(prop, NULL, "surfdataPath");
RNA_def_property_ui_text(prop, "Path", "Directory (and/or filename prefix) to store and load particles from"); RNA_def_property_ui_text(prop, "Path", "Directory (and/or filename prefix) to store and load particles from");
@@ -575,49 +575,49 @@ static void rna_def_fluidsim_control(BlenderRNA *brna)
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
srna= RNA_def_struct(brna, "ControlFluidSettings", "FluidSettings"); srna = RNA_def_struct(brna, "ControlFluidSettings", "FluidSettings");
RNA_def_struct_sdna(srna, "FluidsimSettings"); RNA_def_struct_sdna(srna, "FluidsimSettings");
RNA_def_struct_ui_text(srna, "Control Fluid Simulation Settings", "Fluid simulation settings for objects controlling the motion of fluid in the simulation"); RNA_def_struct_ui_text(srna, "Control Fluid Simulation Settings", "Fluid simulation settings for objects controlling the motion of fluid in the simulation");
rna_def_fluidsim_active(srna); rna_def_fluidsim_active(srna);
prop= RNA_def_property(srna, "start_time", PROP_FLOAT, PROP_TIME); prop = RNA_def_property(srna, "start_time", PROP_FLOAT, PROP_TIME);
RNA_def_property_float_sdna(prop, NULL, "cpsTimeStart"); RNA_def_property_float_sdna(prop, NULL, "cpsTimeStart");
RNA_def_property_range(prop, 0.0, 100.0); RNA_def_property_range(prop, 0.0, 100.0);
RNA_def_property_ui_text(prop, "Start Time", "Time when the control particles are activated"); RNA_def_property_ui_text(prop, "Start Time", "Time when the control particles are activated");
prop= RNA_def_property(srna, "end_time", PROP_FLOAT, PROP_TIME); prop = RNA_def_property(srna, "end_time", PROP_FLOAT, PROP_TIME);
RNA_def_property_float_sdna(prop, NULL, "cpsTimeEnd"); RNA_def_property_float_sdna(prop, NULL, "cpsTimeEnd");
RNA_def_property_range(prop, 0.0, 100.0); RNA_def_property_range(prop, 0.0, 100.0);
RNA_def_property_ui_text(prop, "End Time", "Time when the control particles are deactivated"); RNA_def_property_ui_text(prop, "End Time", "Time when the control particles are deactivated");
prop= RNA_def_property(srna, "attraction_strength", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "attraction_strength", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "attractforceStrength"); RNA_def_property_float_sdna(prop, NULL, "attractforceStrength");
RNA_def_property_range(prop, -10.0, 10.0); RNA_def_property_range(prop, -10.0, 10.0);
RNA_def_property_ui_text(prop, "Attraction Strength", "Force strength for directional attraction towards the control object"); RNA_def_property_ui_text(prop, "Attraction Strength", "Force strength for directional attraction towards the control object");
prop= RNA_def_property(srna, "attraction_radius", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "attraction_radius", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "attractforceRadius"); RNA_def_property_float_sdna(prop, NULL, "attractforceRadius");
RNA_def_property_range(prop, 0.0, 10.0); RNA_def_property_range(prop, 0.0, 10.0);
RNA_def_property_ui_text(prop, "Attraction Radius", "Force field radius around the control object"); RNA_def_property_ui_text(prop, "Attraction Radius", "Force field radius around the control object");
prop= RNA_def_property(srna, "velocity_strength", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "velocity_strength", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "velocityforceStrength"); RNA_def_property_float_sdna(prop, NULL, "velocityforceStrength");
RNA_def_property_range(prop, 0.0, 10.0); RNA_def_property_range(prop, 0.0, 10.0);
RNA_def_property_ui_text(prop, "Velocity Strength", "Force strength of how much of the control object's velocity is influencing the fluid velocity"); RNA_def_property_ui_text(prop, "Velocity Strength", "Force strength of how much of the control object's velocity is influencing the fluid velocity");
prop= RNA_def_property(srna, "velocity_radius", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "velocity_radius", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "velocityforceRadius"); RNA_def_property_float_sdna(prop, NULL, "velocityforceRadius");
RNA_def_property_range(prop, 0.0, 10.0); RNA_def_property_range(prop, 0.0, 10.0);
RNA_def_property_ui_text(prop, "Velocity Radius", "Force field radius around the control object"); RNA_def_property_ui_text(prop, "Velocity Radius", "Force field radius around the control object");
prop= RNA_def_property(srna, "quality", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "quality", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "cpsQuality"); RNA_def_property_float_sdna(prop, NULL, "cpsQuality");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 5.0, 100.0); RNA_def_property_range(prop, 5.0, 100.0);
RNA_def_property_ui_text(prop, "Quality", "Quality which is used for object sampling (higher = better but slower)"); RNA_def_property_ui_text(prop, "Quality", "Quality which is used for object sampling (higher = better but slower)");
prop= RNA_def_property(srna, "use_reverse_frames", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_reverse_frames", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", OB_FLUIDSIM_REVERSE); RNA_def_property_boolean_sdna(prop, NULL, "flag", OB_FLUIDSIM_REVERSE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Reverse Frames", "Reverse control object movement"); RNA_def_property_ui_text(prop, "Reverse Frames", "Reverse control object movement");
@@ -641,21 +641,21 @@ void RNA_def_fluidsim(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}}; {0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "FluidSettings", NULL); srna = RNA_def_struct(brna, "FluidSettings", NULL);
RNA_def_struct_sdna(srna, "FluidsimSettings"); RNA_def_struct_sdna(srna, "FluidsimSettings");
RNA_def_struct_refine_func(srna, "rna_FluidSettings_refine"); RNA_def_struct_refine_func(srna, "rna_FluidSettings_refine");
RNA_def_struct_path_func(srna, "rna_FluidSettings_path"); RNA_def_struct_path_func(srna, "rna_FluidSettings_path");
RNA_def_struct_ui_text(srna, "Fluid Simulation Settings", "Fluid simulation settings for an object taking part in the simulation"); RNA_def_struct_ui_text(srna, "Fluid Simulation Settings", "Fluid simulation settings for an object taking part in the simulation");
prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "type"); RNA_def_property_enum_bitflag_sdna(prop, NULL, "type");
RNA_def_property_enum_items(prop, prop_fluid_type_items); RNA_def_property_enum_items(prop, prop_fluid_type_items);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Type", "Type of participation in the fluid simulation"); RNA_def_property_ui_text(prop, "Type", "Type of participation in the fluid simulation");
RNA_def_property_update(prop, 0, "rna_FluidSettings_update_type"); RNA_def_property_update(prop, 0, "rna_FluidSettings_update_type");
//prop= RNA_def_property(srna, "ipo", PROP_POINTER, PROP_NONE); /*prop= RNA_def_property(srna, "ipo", PROP_POINTER, PROP_NONE); */
//RNA_def_property_ui_text(prop, "IPO Curves", "IPO curves used by fluid simulation settings"); /*RNA_def_property_ui_text(prop, "IPO Curves", "IPO curves used by fluid simulation settings"); */
/* types */ /* types */

View File

@@ -42,7 +42,7 @@
static int rna_GPencilLayer_active_frame_editable(PointerRNA *ptr) static int rna_GPencilLayer_active_frame_editable(PointerRNA *ptr)
{ {
bGPDlayer *gpl= (bGPDlayer *)ptr->data; bGPDlayer *gpl = (bGPDlayer *)ptr->data;
/* surely there must be other criteria too... */ /* surely there must be other criteria too... */
if (gpl->flag & GP_LAYER_LOCKED) if (gpl->flag & GP_LAYER_LOCKED)
@@ -53,18 +53,18 @@ static int rna_GPencilLayer_active_frame_editable(PointerRNA *ptr)
static PointerRNA rna_GPencil_active_layer_get(PointerRNA *ptr) static PointerRNA rna_GPencil_active_layer_get(PointerRNA *ptr)
{ {
bGPdata *gpd= ptr->id.data; bGPdata *gpd = ptr->id.data;
if (GS(gpd->id.name) == ID_GD) { /* why would this ever be not GD */ if (GS(gpd->id.name) == ID_GD) { /* why would this ever be not GD */
bGPDlayer *gl; bGPDlayer *gl;
for (gl= gpd->layers.first; gl; gl= gl->next) { for (gl = gpd->layers.first; gl; gl = gl->next) {
if(gl->flag & GP_LAYER_ACTIVE) { if (gl->flag & GP_LAYER_ACTIVE) {
break; break;
} }
} }
if(gl) { if (gl) {
return rna_pointer_inherit_refine(ptr, &RNA_GPencilLayer, gl); return rna_pointer_inherit_refine(ptr, &RNA_GPencilLayer, gl);
} }
} }
@@ -74,13 +74,13 @@ static PointerRNA rna_GPencil_active_layer_get(PointerRNA *ptr)
static void rna_GPencil_active_layer_set(PointerRNA *ptr, PointerRNA value) static void rna_GPencil_active_layer_set(PointerRNA *ptr, PointerRNA value)
{ {
bGPdata *gpd= ptr->id.data; bGPdata *gpd = ptr->id.data;
if (GS(gpd->id.name) == ID_GD) { /* why would this ever be not GD */ if (GS(gpd->id.name) == ID_GD) { /* why would this ever be not GD */
bGPDlayer *gl; bGPDlayer *gl;
for (gl= gpd->layers.first; gl; gl= gl->next) { for (gl = gpd->layers.first; gl; gl = gl->next) {
if(gl == value.data) { if (gl == value.data) {
gl->flag |= GP_LAYER_ACTIVE; gl->flag |= GP_LAYER_ACTIVE;
} }
else { else {
@@ -92,8 +92,8 @@ static void rna_GPencil_active_layer_set(PointerRNA *ptr, PointerRNA value)
void rna_GPencilLayer_info_set(PointerRNA *ptr, const char *value) void rna_GPencilLayer_info_set(PointerRNA *ptr, const char *value)
{ {
bGPdata *gpd= ptr->id.data; bGPdata *gpd = ptr->id.data;
bGPDlayer *gpl= ptr->data; bGPDlayer *gpl = ptr->data;
/* copy the new name into the name slot */ /* copy the new name into the name slot */
BLI_strncpy_utf8(gpl->info, value, sizeof(gpl->info)); BLI_strncpy_utf8(gpl->info, value, sizeof(gpl->info));
@@ -108,17 +108,17 @@ static void rna_def_gpencil_stroke_point(BlenderRNA *brna)
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
srna= RNA_def_struct(brna, "GPencilStrokePoint", NULL); srna = RNA_def_struct(brna, "GPencilStrokePoint", NULL);
RNA_def_struct_sdna(srna, "bGPDspoint"); RNA_def_struct_sdna(srna, "bGPDspoint");
RNA_def_struct_ui_text(srna, "Grease Pencil Stroke Point", "Data point for freehand stroke curve"); RNA_def_struct_ui_text(srna, "Grease Pencil Stroke Point", "Data point for freehand stroke curve");
prop= RNA_def_property(srna, "co", PROP_FLOAT, PROP_XYZ); prop = RNA_def_property(srna, "co", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "x"); RNA_def_property_float_sdna(prop, NULL, "x");
RNA_def_property_array(prop, 3); RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Coordinates", ""); RNA_def_property_ui_text(prop, "Coordinates", "");
RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL); RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL);
prop= RNA_def_property(srna, "pressure", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "pressure", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "pressure"); RNA_def_property_float_sdna(prop, NULL, "pressure");
RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Pressure", "Pressure of tablet at point when drawing it"); RNA_def_property_ui_text(prop, "Pressure", "Pressure of tablet at point when drawing it");
@@ -130,18 +130,18 @@ static void rna_def_gpencil_stroke(BlenderRNA *brna)
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
srna= RNA_def_struct(brna, "GPencilStroke", NULL); srna = RNA_def_struct(brna, "GPencilStroke", NULL);
RNA_def_struct_sdna(srna, "bGPDstroke"); RNA_def_struct_sdna(srna, "bGPDstroke");
RNA_def_struct_ui_text(srna, "Grease Pencil Stroke", "Freehand curve defining part of a sketch"); RNA_def_struct_ui_text(srna, "Grease Pencil Stroke", "Freehand curve defining part of a sketch");
/* Points */ /* Points */
prop= RNA_def_property(srna, "points", PROP_COLLECTION, PROP_NONE); prop = RNA_def_property(srna, "points", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "points", "totpoints"); RNA_def_property_collection_sdna(prop, NULL, "points", "totpoints");
RNA_def_property_struct_type(prop, "GPencilStrokePoint"); RNA_def_property_struct_type(prop, "GPencilStrokePoint");
RNA_def_property_ui_text(prop, "Stroke Points", "Stroke data points"); RNA_def_property_ui_text(prop, "Stroke Points", "Stroke data points");
/* Flags - Readonly type-info really... */ /* Flags - Readonly type-info really... */
// TODO... /* TODO... */
} }
static void rna_def_gpencil_frame(BlenderRNA *brna) static void rna_def_gpencil_frame(BlenderRNA *brna)
@@ -149,28 +149,28 @@ static void rna_def_gpencil_frame(BlenderRNA *brna)
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
srna= RNA_def_struct(brna, "GPencilFrame", NULL); srna = RNA_def_struct(brna, "GPencilFrame", NULL);
RNA_def_struct_sdna(srna, "bGPDframe"); RNA_def_struct_sdna(srna, "bGPDframe");
RNA_def_struct_ui_text(srna, "Grease Pencil Frame", "Collection of related sketches on a particular frame"); RNA_def_struct_ui_text(srna, "Grease Pencil Frame", "Collection of related sketches on a particular frame");
/* Strokes */ /* Strokes */
prop= RNA_def_property(srna, "strokes", PROP_COLLECTION, PROP_NONE); prop = RNA_def_property(srna, "strokes", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "strokes", NULL); RNA_def_property_collection_sdna(prop, NULL, "strokes", NULL);
RNA_def_property_struct_type(prop, "GPencilStroke"); RNA_def_property_struct_type(prop, "GPencilStroke");
RNA_def_property_ui_text(prop, "Strokes", "Freehand curves defining the sketch on this frame"); RNA_def_property_ui_text(prop, "Strokes", "Freehand curves defining the sketch on this frame");
/* Frame Number */ /* Frame Number */
prop= RNA_def_property(srna, "frame_number", PROP_INT, PROP_NONE); prop = RNA_def_property(srna, "frame_number", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "framenum"); RNA_def_property_int_sdna(prop, NULL, "framenum");
RNA_def_property_range(prop, MINFRAME, MAXFRAME); // XXX note: this cannot occur on the same frame as another sketch RNA_def_property_range(prop, MINFRAME, MAXFRAME); /* XXX note: this cannot occur on the same frame as another sketch */
RNA_def_property_ui_text(prop, "Frame Number", "The frame on which this sketch appears"); RNA_def_property_ui_text(prop, "Frame Number", "The frame on which this sketch appears");
/* Flags */ /* Flags */
prop= RNA_def_property(srna, "is_edited", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "is_edited", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_FRAME_PAINT); // XXX should it be editable? RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_FRAME_PAINT); /* XXX should it be editable? */
RNA_def_property_ui_text(prop, "Paint Lock", "Frame is being edited (painted on)"); RNA_def_property_ui_text(prop, "Paint Lock", "Frame is being edited (painted on)");
prop= RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_FRAME_SELECT); RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_FRAME_SELECT);
RNA_def_property_ui_text(prop, "Select", "Frame is selected for editing in the DopeSheet"); RNA_def_property_ui_text(prop, "Select", "Frame is selected for editing in the DopeSheet");
} }
@@ -180,55 +180,55 @@ static void rna_def_gpencil_layer(BlenderRNA *brna)
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
srna= RNA_def_struct(brna, "GPencilLayer", NULL); srna = RNA_def_struct(brna, "GPencilLayer", NULL);
RNA_def_struct_sdna(srna, "bGPDlayer"); RNA_def_struct_sdna(srna, "bGPDlayer");
RNA_def_struct_ui_text(srna, "Grease Pencil Layer", "Collection of related sketches"); RNA_def_struct_ui_text(srna, "Grease Pencil Layer", "Collection of related sketches");
/* Name */ /* Name */
prop= RNA_def_property(srna, "info", PROP_STRING, PROP_NONE); prop = RNA_def_property(srna, "info", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Info", "Layer name"); RNA_def_property_ui_text(prop, "Info", "Layer name");
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_GPencilLayer_info_set"); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_GPencilLayer_info_set");
RNA_def_struct_name_property(srna, prop); RNA_def_struct_name_property(srna, prop);
/* Frames */ /* Frames */
prop= RNA_def_property(srna, "frames", PROP_COLLECTION, PROP_NONE); prop = RNA_def_property(srna, "frames", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "frames", NULL); RNA_def_property_collection_sdna(prop, NULL, "frames", NULL);
RNA_def_property_struct_type(prop, "GPencilFrame"); RNA_def_property_struct_type(prop, "GPencilFrame");
RNA_def_property_ui_text(prop, "Frames", "Sketches for this layer on different frames"); RNA_def_property_ui_text(prop, "Frames", "Sketches for this layer on different frames");
/* Active Frame */ /* Active Frame */
prop= RNA_def_property(srna, "active_frame", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "active_frame", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "actframe"); RNA_def_property_pointer_sdna(prop, NULL, "actframe");
RNA_def_property_ui_text(prop, "Active Frame", "Frame currently being displayed for this layer"); RNA_def_property_ui_text(prop, "Active Frame", "Frame currently being displayed for this layer");
RNA_def_property_editable_func(prop, "rna_GPencilLayer_active_frame_editable"); RNA_def_property_editable_func(prop, "rna_GPencilLayer_active_frame_editable");
/* Drawing Color */ /* Drawing Color */
prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR); prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_array(prop, 3); RNA_def_property_array(prop, 3);
RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Color", "Color for all strokes in this layer"); RNA_def_property_ui_text(prop, "Color", "Color for all strokes in this layer");
RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL); RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL);
prop= RNA_def_property(srna, "alpha", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "alpha", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "color[3]"); RNA_def_property_float_sdna(prop, NULL, "color[3]");
RNA_def_property_range(prop, 0.3, 1.0f); RNA_def_property_range(prop, 0.3, 1.0f);
RNA_def_property_ui_text(prop, "Opacity", "Layer Opacity"); RNA_def_property_ui_text(prop, "Opacity", "Layer Opacity");
RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL); RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL);
/* Line Thickness */ /* Line Thickness */
prop= RNA_def_property(srna, "line_width", PROP_INT, PROP_NONE); prop = RNA_def_property(srna, "line_width", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "thickness"); RNA_def_property_int_sdna(prop, NULL, "thickness");
RNA_def_property_range(prop, 1, 10); RNA_def_property_range(prop, 1, 10);
RNA_def_property_ui_text(prop, "Thickness", "Thickness of strokes (in pixels)"); RNA_def_property_ui_text(prop, "Thickness", "Thickness of strokes (in pixels)");
RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL); RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL);
/* Onion-Skinning */ /* Onion-Skinning */
prop= RNA_def_property(srna, "use_onion_skinning", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_onion_skinning", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_ONIONSKIN); RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_ONIONSKIN);
RNA_def_property_ui_text(prop, "Onion Skinning", "Ghost frames on either side of frame"); RNA_def_property_ui_text(prop, "Onion Skinning", "Ghost frames on either side of frame");
RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL); RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL);
prop= RNA_def_property(srna, "ghost_range_max", PROP_INT, PROP_NONE); prop = RNA_def_property(srna, "ghost_range_max", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "gstep"); RNA_def_property_int_sdna(prop, NULL, "gstep");
RNA_def_property_range(prop, 0, 120); RNA_def_property_range(prop, 0, 120);
RNA_def_property_ui_text(prop, "Max Ghost Range", RNA_def_property_ui_text(prop, "Max Ghost Range",
@@ -237,17 +237,17 @@ static void rna_def_gpencil_layer(BlenderRNA *brna)
RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL); RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL);
/* Flags */ /* Flags */
prop= RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_HIDE); RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_HIDE);
RNA_def_property_ui_text(prop, "Hide", "Set layer Visibility"); RNA_def_property_ui_text(prop, "Hide", "Set layer Visibility");
RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL); RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL);
prop= RNA_def_property(srna, "lock", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "lock", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_LOCKED); RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_LOCKED);
RNA_def_property_ui_text(prop, "Locked", "Protect layer from further editing and/or frame changes"); RNA_def_property_ui_text(prop, "Locked", "Protect layer from further editing and/or frame changes");
RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL); RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL);
prop= RNA_def_property(srna, "lock_frame", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "lock_frame", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_FRAMELOCK); RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_FRAMELOCK);
RNA_def_property_ui_text(prop, "Frame Locked", "Lock current frame displayed by layer"); RNA_def_property_ui_text(prop, "Frame Locked", "Lock current frame displayed by layer");
RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL); RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL);
@@ -261,19 +261,19 @@ static void rna_def_gpencil_layer(BlenderRNA *brna)
RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL); RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL);
*/ */
prop= RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_SELECT); RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_SELECT);
RNA_def_property_ui_text(prop, "Select", "Layer is selected for editing in the DopeSheet"); RNA_def_property_ui_text(prop, "Select", "Layer is selected for editing in the DopeSheet");
RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL); RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL);
// XXX keep this option? /* XXX keep this option? */
prop= RNA_def_property(srna, "show_points", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "show_points", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_DRAWDEBUG); RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_DRAWDEBUG);
RNA_def_property_ui_text(prop, "Show Points", "Draw the points which make up the strokes (for debugging purposes)"); RNA_def_property_ui_text(prop, "Show Points", "Draw the points which make up the strokes (for debugging purposes)");
RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL); RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL);
/* X-Ray */ /* X-Ray */
prop= RNA_def_property(srna, "show_x_ray", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "show_x_ray", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GP_LAYER_NO_XRAY); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GP_LAYER_NO_XRAY);
RNA_def_property_ui_text(prop, "X Ray", "Make the layer draw in front of objects"); RNA_def_property_ui_text(prop, "X Ray", "Make the layer draw in front of objects");
RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL); RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL);
@@ -284,30 +284,30 @@ static void rna_def_gpencil_layers(BlenderRNA *brna, PropertyRNA *cprop)
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
// FunctionRNA *func; /* FunctionRNA *func; */
// PropertyRNA *parm; /* PropertyRNA *parm; */
RNA_def_property_srna(cprop, "GreasePencilLayers"); RNA_def_property_srna(cprop, "GreasePencilLayers");
srna= RNA_def_struct(brna, "GreasePencilLayers", NULL); srna = RNA_def_struct(brna, "GreasePencilLayers", NULL);
RNA_def_struct_sdna(srna, "bGPdata"); RNA_def_struct_sdna(srna, "bGPdata");
RNA_def_struct_ui_text(srna, "Grease Pencil Layers", "Collection of grease pencil layers"); RNA_def_struct_ui_text(srna, "Grease Pencil Layers", "Collection of grease pencil layers");
#if 0 #if 0
func= RNA_def_function(srna, "new", "rna_GPencil_layer_new"); func = RNA_def_function(srna, "new", "rna_GPencil_layer_new");
RNA_def_function_ui_description(func, "Add a new spline to the curve"); RNA_def_function_ui_description(func, "Add a new spline to the curve");
parm= RNA_def_enum(func, "type", curve_type_items, CU_POLY, "", "type for the new spline"); parm = RNA_def_enum(func, "type", curve_type_items, CU_POLY, "", "type for the new spline");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
parm= RNA_def_pointer(func, "spline", "Spline", "", "The newly created spline"); parm = RNA_def_pointer(func, "spline", "Spline", "", "The newly created spline");
RNA_def_function_return(func, parm); RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "remove", "rna_GPencil_layer_remove"); func = RNA_def_function(srna, "remove", "rna_GPencil_layer_remove");
RNA_def_function_ui_description(func, "Remove a spline from a curve"); RNA_def_function_ui_description(func, "Remove a spline from a curve");
RNA_def_function_flag(func, FUNC_USE_REPORTS); RNA_def_function_flag(func, FUNC_USE_REPORTS);
parm= RNA_def_pointer(func, "spline", "Spline", "", "The spline to remove"); parm = RNA_def_pointer(func, "spline", "Spline", "", "The spline to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
#endif #endif
prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "GreasePencil"); RNA_def_property_struct_type(prop, "GreasePencil");
RNA_def_property_pointer_funcs(prop, "rna_GPencil_active_layer_get", "rna_GPencil_active_layer_set", NULL, NULL); RNA_def_property_pointer_funcs(prop, "rna_GPencil_active_layer_get", "rna_GPencil_active_layer_set", NULL, NULL);
RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_flag(prop, PROP_EDITABLE);
@@ -326,25 +326,25 @@ static void rna_def_gpencil_data(BlenderRNA *brna)
{GP_DATA_VIEWALIGN|GP_DATA_DEPTH_STROKE, "STROKE", 0, "Stroke", "Stick stroke to other strokes"}, {GP_DATA_VIEWALIGN|GP_DATA_DEPTH_STROKE, "STROKE", 0, "Stroke", "Stick stroke to other strokes"},
{0, NULL, 0, NULL, NULL}}; {0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "GreasePencil", "ID"); srna = RNA_def_struct(brna, "GreasePencil", "ID");
RNA_def_struct_sdna(srna, "bGPdata"); RNA_def_struct_sdna(srna, "bGPdata");
RNA_def_struct_ui_text(srna, "Grease Pencil", "Freehand annotation sketchbook"); RNA_def_struct_ui_text(srna, "Grease Pencil", "Freehand annotation sketchbook");
RNA_def_struct_ui_icon(srna, ICON_GREASEPENCIL); RNA_def_struct_ui_icon(srna, ICON_GREASEPENCIL);
/* Layers */ /* Layers */
prop= RNA_def_property(srna, "layers", PROP_COLLECTION, PROP_NONE); prop = RNA_def_property(srna, "layers", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "layers", NULL); RNA_def_property_collection_sdna(prop, NULL, "layers", NULL);
RNA_def_property_struct_type(prop, "GPencilLayer"); RNA_def_property_struct_type(prop, "GPencilLayer");
RNA_def_property_ui_text(prop, "Layers", ""); RNA_def_property_ui_text(prop, "Layers", "");
rna_def_gpencil_layers(brna, prop); rna_def_gpencil_layers(brna, prop);
/* Flags */ /* Flags */
prop= RNA_def_property(srna, "draw_mode", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "draw_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
RNA_def_property_enum_items(prop, draw_mode_items); RNA_def_property_enum_items(prop, draw_mode_items);
RNA_def_property_ui_text(prop, "Draw Mode", ""); RNA_def_property_ui_text(prop, "Draw Mode", "");
prop= RNA_def_property(srna, "use_stroke_endpoints", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_stroke_endpoints", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_DATA_DEPTH_STROKE_ENDPOINTS); RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_DATA_DEPTH_STROKE_ENDPOINTS);
RNA_def_property_ui_text(prop, "Only Endpoints", "Only use the first and last parts of the stroke for snapping"); RNA_def_property_ui_text(prop, "Only Endpoints", "Only use the first and last parts of the stroke for snapping");

View File

@@ -45,7 +45,7 @@
static PointerRNA rna_Group_objects_get(CollectionPropertyIterator *iter) static PointerRNA rna_Group_objects_get(CollectionPropertyIterator *iter)
{ {
ListBaseIterator *internal= iter->internal; ListBaseIterator *internal = iter->internal;
/* we are actually iterating a GroupObject list, so override get */ /* we are actually iterating a GroupObject list, so override get */
return rna_pointer_inherit_refine(&iter->parent, &RNA_Object, ((GroupObject*)internal->link)->ob); return rna_pointer_inherit_refine(&iter->parent, &RNA_Object, ((GroupObject*)internal->link)->ob);
@@ -53,7 +53,7 @@ static PointerRNA rna_Group_objects_get(CollectionPropertyIterator *iter)
static void rna_Group_objects_link(Group *group, bContext *C, ReportList *reports, Object *object) static void rna_Group_objects_link(Group *group, bContext *C, ReportList *reports, Object *object)
{ {
if(!add_to_group(group, object, CTX_data_scene(C), NULL)) { if (!add_to_group(group, object, CTX_data_scene(C), NULL)) {
BKE_reportf(reports, RPT_ERROR, "Object \"%s\" already in group \"%s\"", object->id.name+2, group->id.name+2); BKE_reportf(reports, RPT_ERROR, "Object \"%s\" already in group \"%s\"", object->id.name+2, group->id.name+2);
return; return;
} }
@@ -63,7 +63,7 @@ static void rna_Group_objects_link(Group *group, bContext *C, ReportList *report
static void rna_Group_objects_unlink(Group *group, bContext *C, ReportList *reports, Object *object) static void rna_Group_objects_unlink(Group *group, bContext *C, ReportList *reports, Object *object)
{ {
if(!rem_from_group(group, object, CTX_data_scene(C), NULL)) { if (!rem_from_group(group, object, CTX_data_scene(C), NULL)) {
BKE_reportf(reports, RPT_ERROR, "Object \"%s\" not in group \"%s\"", object->id.name+2, group->id.name+2); BKE_reportf(reports, RPT_ERROR, "Object \"%s\" not in group \"%s\"", object->id.name+2, group->id.name+2);
return; return;
} }
@@ -77,30 +77,30 @@ static void rna_Group_objects_unlink(Group *group, bContext *C, ReportList *repo
static void rna_def_group_objects(BlenderRNA *brna, PropertyRNA *cprop) static void rna_def_group_objects(BlenderRNA *brna, PropertyRNA *cprop)
{ {
StructRNA *srna; StructRNA *srna;
// PropertyRNA *prop; /* PropertyRNA *prop; */
FunctionRNA *func; FunctionRNA *func;
PropertyRNA *parm; PropertyRNA *parm;
RNA_def_property_srna(cprop, "GroupObjects"); RNA_def_property_srna(cprop, "GroupObjects");
srna= RNA_def_struct(brna, "GroupObjects", NULL); srna = RNA_def_struct(brna, "GroupObjects", NULL);
RNA_def_struct_sdna(srna, "Group"); RNA_def_struct_sdna(srna, "Group");
RNA_def_struct_ui_text(srna, "Group Objects", "Collection of group objects"); RNA_def_struct_ui_text(srna, "Group Objects", "Collection of group objects");
/* add object */ /* add object */
func= RNA_def_function(srna, "link", "rna_Group_objects_link"); func = RNA_def_function(srna, "link", "rna_Group_objects_link");
RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS); RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Add this object to a group"); RNA_def_function_ui_description(func, "Add this object to a group");
/* object to add */ /* object to add */
parm= RNA_def_pointer(func, "object", "Object", "", "Object to add"); parm = RNA_def_pointer(func, "object", "Object", "", "Object to add");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
/* remove object */ /* remove object */
func= RNA_def_function(srna, "unlink", "rna_Group_objects_unlink"); func = RNA_def_function(srna, "unlink", "rna_Group_objects_unlink");
RNA_def_function_ui_description(func, "Remove this object to a group"); RNA_def_function_ui_description(func, "Remove this object to a group");
RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS); RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
/* object to remove */ /* object to remove */
parm= RNA_def_pointer(func, "object", "Object", "", "Object to remove"); parm = RNA_def_pointer(func, "object", "Object", "", "Object to remove");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
} }
@@ -110,23 +110,23 @@ void RNA_def_group(BlenderRNA *brna)
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
srna= RNA_def_struct(brna, "Group", "ID"); srna = RNA_def_struct(brna, "Group", "ID");
RNA_def_struct_ui_text(srna, "Group", "Group of Object datablocks"); RNA_def_struct_ui_text(srna, "Group", "Group of Object datablocks");
RNA_def_struct_ui_icon(srna, ICON_GROUP); RNA_def_struct_ui_icon(srna, ICON_GROUP);
RNA_def_struct_clear_flag(srna, STRUCT_ID_REFCOUNT); /* this is done on save/load in readfile.c, removed if no objects are in the group */ RNA_def_struct_clear_flag(srna, STRUCT_ID_REFCOUNT); /* this is done on save/load in readfile.c, removed if no objects are in the group */
prop= RNA_def_property(srna, "dupli_offset", PROP_FLOAT, PROP_TRANSLATION); prop = RNA_def_property(srna, "dupli_offset", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "dupli_ofs"); RNA_def_property_float_sdna(prop, NULL, "dupli_ofs");
RNA_def_property_ui_text(prop, "Dupli Offset", "Offset from the origin to use when instancing as DupliGroup"); RNA_def_property_ui_text(prop, "Dupli Offset", "Offset from the origin to use when instancing as DupliGroup");
RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 4); RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 4);
prop= RNA_def_property(srna, "layers", PROP_BOOLEAN, PROP_LAYER); prop = RNA_def_property(srna, "layers", PROP_BOOLEAN, PROP_LAYER);
RNA_def_property_boolean_sdna(prop, NULL, "layer", 1); RNA_def_property_boolean_sdna(prop, NULL, "layer", 1);
RNA_def_property_array(prop, 20); RNA_def_property_array(prop, 20);
RNA_def_property_ui_text(prop, "Dupli Layers", "Layers visible when this group is instanced as a dupli"); RNA_def_property_ui_text(prop, "Dupli Layers", "Layers visible when this group is instanced as a dupli");
prop= RNA_def_property(srna, "objects", PROP_COLLECTION, PROP_NONE); prop = RNA_def_property(srna, "objects", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "gobject", NULL); RNA_def_property_collection_sdna(prop, NULL, "gobject", NULL);
RNA_def_property_struct_type(prop, "Object"); RNA_def_property_struct_type(prop, "Object");
RNA_def_property_ui_text(prop, "Objects", "A collection of this groups objects"); RNA_def_property_ui_text(prop, "Objects", "A collection of this groups objects");

View File

@@ -42,7 +42,7 @@
#include "WM_types.h" #include "WM_types.h"
#include "WM_api.h" #include "WM_api.h"
static EnumPropertyItem image_source_items[]= { static EnumPropertyItem image_source_items[] = {
{IMA_SRC_FILE, "FILE", 0, "Single Image", "Single image file"}, {IMA_SRC_FILE, "FILE", 0, "Single Image", "Single image file"},
{IMA_SRC_SEQUENCE, "SEQUENCE", 0, "Image Sequence", "Multiple image files, as a sequence"}, {IMA_SRC_SEQUENCE, "SEQUENCE", 0, "Image Sequence", "Multiple image files, as a sequence"},
{IMA_SRC_MOVIE, "MOVIE", 0, "Movie", "Movie file"}, {IMA_SRC_MOVIE, "MOVIE", 0, "Movie", "Movie file"},
@@ -56,24 +56,24 @@ static EnumPropertyItem image_source_items[]= {
static void rna_Image_animated_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) static void rna_Image_animated_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{ {
Image *ima= (Image*)ptr->data; Image *ima = (Image*)ptr->data;
int nr; int nr;
if(ima->flag & IMA_TWINANIM) { if (ima->flag & IMA_TWINANIM) {
nr= ima->xrep*ima->yrep; nr = ima->xrep*ima->yrep;
if(ima->twsta>=nr) ima->twsta= 1; if (ima->twsta >= nr) ima->twsta = 1;
if(ima->twend>=nr) ima->twend= nr-1; if (ima->twend >= nr) ima->twend = nr-1;
if(ima->twsta>ima->twend) ima->twsta= 1; if (ima->twsta>ima->twend) ima->twsta = 1;
} }
} }
static int rna_Image_dirty_get(PointerRNA *ptr) static int rna_Image_dirty_get(PointerRNA *ptr)
{ {
Image *ima= (Image*)ptr->data; Image *ima = (Image*)ptr->data;
ImBuf *ibuf; ImBuf *ibuf;
for(ibuf=ima->ibufs.first; ibuf; ibuf=ibuf->next) for (ibuf = ima->ibufs.first; ibuf; ibuf = ibuf->next)
if(ibuf->userflags & IB_BITMAPDIRTY) if (ibuf->userflags & IB_BITMAPDIRTY)
return 1; return 1;
return 0; return 0;
@@ -81,26 +81,26 @@ static int rna_Image_dirty_get(PointerRNA *ptr)
static void rna_Image_source_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) static void rna_Image_source_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{ {
Image *ima= ptr->id.data; Image *ima = ptr->id.data;
BKE_image_signal(ima, NULL, IMA_SIGNAL_SRC_CHANGE); BKE_image_signal(ima, NULL, IMA_SIGNAL_SRC_CHANGE);
DAG_id_tag_update(&ima->id, 0); DAG_id_tag_update(&ima->id, 0);
} }
static void rna_Image_fields_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) static void rna_Image_fields_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{ {
Image *ima= ptr->id.data; Image *ima = ptr->id.data;
ImBuf *ibuf; ImBuf *ibuf;
void *lock; void *lock;
ibuf= BKE_image_acquire_ibuf(ima, NULL, &lock); ibuf = BKE_image_acquire_ibuf(ima, NULL, &lock);
if(ibuf) { if (ibuf) {
short nr= 0; short nr = 0;
if(!(ima->flag & IMA_FIELDS) && (ibuf->flags & IB_fields)) nr= 1; if (!(ima->flag & IMA_FIELDS) && (ibuf->flags & IB_fields)) nr = 1;
if((ima->flag & IMA_FIELDS) && !(ibuf->flags & IB_fields)) nr= 1; if ((ima->flag & IMA_FIELDS) && !(ibuf->flags & IB_fields)) nr = 1;
if(nr) if (nr)
BKE_image_signal(ima, NULL, IMA_SIGNAL_FREE); BKE_image_signal(ima, NULL, IMA_SIGNAL_FREE);
} }
@@ -109,7 +109,7 @@ static void rna_Image_fields_update(Main *UNUSED(bmain), Scene *UNUSED(scene), P
static void rna_Image_free_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) static void rna_Image_free_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{ {
Image *ima= ptr->id.data; Image *ima = ptr->id.data;
BKE_image_signal(ima, NULL, IMA_SIGNAL_FREE); BKE_image_signal(ima, NULL, IMA_SIGNAL_FREE);
WM_main_add_notifier(NC_IMAGE|NA_EDITED, &ima->id); WM_main_add_notifier(NC_IMAGE|NA_EDITED, &ima->id);
DAG_id_tag_update(&ima->id, 0); DAG_id_tag_update(&ima->id, 0);
@@ -118,7 +118,7 @@ static void rna_Image_free_update(Main *UNUSED(bmain), Scene *UNUSED(scene), Poi
static void rna_Image_reload_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) static void rna_Image_reload_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{ {
Image *ima= ptr->id.data; Image *ima = ptr->id.data;
BKE_image_signal(ima, NULL, IMA_SIGNAL_RELOAD); BKE_image_signal(ima, NULL, IMA_SIGNAL_RELOAD);
WM_main_add_notifier(NC_IMAGE|NA_EDITED, &ima->id); WM_main_add_notifier(NC_IMAGE|NA_EDITED, &ima->id);
DAG_id_tag_update(&ima->id, 0); DAG_id_tag_update(&ima->id, 0);
@@ -126,13 +126,13 @@ static void rna_Image_reload_update(Main *UNUSED(bmain), Scene *UNUSED(scene), P
static void rna_Image_generated_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) static void rna_Image_generated_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{ {
Image *ima= ptr->id.data; Image *ima = ptr->id.data;
BKE_image_signal(ima, NULL, IMA_SIGNAL_FREE); BKE_image_signal(ima, NULL, IMA_SIGNAL_FREE);
} }
static void rna_ImageUser_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr) static void rna_ImageUser_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr)
{ {
ImageUser *iuser= ptr->data; ImageUser *iuser = ptr->data;
BKE_image_user_calc_frame(iuser, scene->r.cfra, 0); BKE_image_user_calc_frame(iuser, scene->r.cfra, 0);
} }
@@ -141,9 +141,9 @@ static void rna_ImageUser_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *
char *rna_ImageUser_path(PointerRNA *ptr) char *rna_ImageUser_path(PointerRNA *ptr)
{ {
if (ptr->id.data) { if (ptr->id.data) {
// ImageUser *iuser= ptr->data; /* ImageUser *iuser= ptr->data; */
switch(GS(((ID *)ptr->id.data)->name)) { switch (GS(((ID *)ptr->id.data)->name)) {
case ID_TE: case ID_TE:
return BLI_strdup("image_user"); return BLI_strdup("image_user");
} }
@@ -154,11 +154,11 @@ char *rna_ImageUser_path(PointerRNA *ptr)
static EnumPropertyItem *rna_Image_source_itemf(bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *free) static EnumPropertyItem *rna_Image_source_itemf(bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *free)
{ {
Image *ima= (Image*)ptr->data; Image *ima = (Image*)ptr->data;
EnumPropertyItem *item= NULL; EnumPropertyItem *item = NULL;
int totitem= 0; int totitem = 0;
if(ima->source == IMA_SRC_VIEWER) { if (ima->source == IMA_SRC_VIEWER) {
RNA_enum_items_add_value(&item, &totitem, image_source_items, IMA_SRC_VIEWER); RNA_enum_items_add_value(&item, &totitem, image_source_items, IMA_SRC_VIEWER);
} }
else { else {
@@ -169,24 +169,24 @@ static EnumPropertyItem *rna_Image_source_itemf(bContext *UNUSED(C), PointerRNA
} }
RNA_enum_item_end(&item, &totitem); RNA_enum_item_end(&item, &totitem);
*free= 1; *free = 1;
return item; return item;
} }
static int rna_Image_file_format_get(PointerRNA *ptr) static int rna_Image_file_format_get(PointerRNA *ptr)
{ {
Image *image= (Image*)ptr->data; Image *image = (Image*)ptr->data;
ImBuf *ibuf= BKE_image_get_ibuf(image, NULL); ImBuf *ibuf = BKE_image_get_ibuf(image, NULL);
return BKE_ftype_to_imtype(ibuf ? ibuf->ftype : 0); return BKE_ftype_to_imtype(ibuf ? ibuf->ftype : 0);
} }
static void rna_Image_file_format_set(PointerRNA *ptr, int value) static void rna_Image_file_format_set(PointerRNA *ptr, int value)
{ {
Image *image= (Image*)ptr->data; Image *image = (Image*)ptr->data;
if(BKE_imtype_is_movie(value) == 0) { /* should be able to throw an error here */ if (BKE_imtype_is_movie(value) == 0) { /* should be able to throw an error here */
ImBuf *ibuf; ImBuf *ibuf;
int ftype= BKE_imtype_to_ftype(value); int ftype = BKE_imtype_to_ftype(value);
/* /*
ibuf= BKE_image_get_ibuf(image, NULL); ibuf= BKE_image_get_ibuf(image, NULL);
@@ -195,15 +195,15 @@ static void rna_Image_file_format_set(PointerRNA *ptr, int value)
*/ */
/* to be safe change all buffer file types */ /* to be safe change all buffer file types */
for(ibuf= image->ibufs.first; ibuf; ibuf= ibuf->next) { for (ibuf = image->ibufs.first; ibuf; ibuf = ibuf->next) {
ibuf->ftype= ftype; ibuf->ftype = ftype;
} }
} }
} }
static int rna_Image_has_data_get(PointerRNA *ptr) static int rna_Image_has_data_get(PointerRNA *ptr)
{ {
Image *im= (Image*)ptr->data; Image *im = (Image*)ptr->data;
if (im->ibufs.first) if (im->ibufs.first)
return 1; return 1;
@@ -213,18 +213,18 @@ static int rna_Image_has_data_get(PointerRNA *ptr)
static void rna_Image_size_get(PointerRNA *ptr,int *values) static void rna_Image_size_get(PointerRNA *ptr,int *values)
{ {
Image *im= (Image*)ptr->data; Image *im = (Image*)ptr->data;
ImBuf *ibuf; ImBuf *ibuf;
void *lock; void *lock;
ibuf = BKE_image_acquire_ibuf(im, NULL , &lock); ibuf = BKE_image_acquire_ibuf(im, NULL , &lock);
if (ibuf) { if (ibuf) {
values[0]= ibuf->x; values[0] = ibuf->x;
values[1]= ibuf->y; values[1] = ibuf->y;
} }
else { else {
values[0]= 0; values[0] = 0;
values[1]= 0; values[1] = 0;
} }
BKE_image_release_ibuf(im, lock); BKE_image_release_ibuf(im, lock);
@@ -232,18 +232,18 @@ static void rna_Image_size_get(PointerRNA *ptr,int *values)
static void rna_Image_resolution_get(PointerRNA *ptr, float *values) static void rna_Image_resolution_get(PointerRNA *ptr, float *values)
{ {
Image *im= (Image*)ptr->data; Image *im = (Image*)ptr->data;
ImBuf *ibuf; ImBuf *ibuf;
void *lock; void *lock;
ibuf = BKE_image_acquire_ibuf(im, NULL , &lock); ibuf = BKE_image_acquire_ibuf(im, NULL , &lock);
if (ibuf) { if (ibuf) {
values[0]= ibuf->ppm[0]; values[0] = ibuf->ppm[0];
values[1]= ibuf->ppm[1]; values[1] = ibuf->ppm[1];
} }
else { else {
values[0]= 0; values[0] = 0;
values[1]= 0; values[1] = 0;
} }
BKE_image_release_ibuf(im, lock); BKE_image_release_ibuf(im, lock);
@@ -251,14 +251,14 @@ static void rna_Image_resolution_get(PointerRNA *ptr, float *values)
static void rna_Image_resolution_set(PointerRNA *ptr, const float *values) static void rna_Image_resolution_set(PointerRNA *ptr, const float *values)
{ {
Image *im= (Image*)ptr->data; Image *im = (Image*)ptr->data;
ImBuf *ibuf; ImBuf *ibuf;
void *lock; void *lock;
ibuf = BKE_image_acquire_ibuf(im, NULL , &lock); ibuf = BKE_image_acquire_ibuf(im, NULL , &lock);
if (ibuf) { if (ibuf) {
ibuf->ppm[0]= values[0]; ibuf->ppm[0] = values[0];
ibuf->ppm[1]= values[1]; ibuf->ppm[1] = values[1];
} }
BKE_image_release_ibuf(im, lock); BKE_image_release_ibuf(im, lock);
@@ -266,19 +266,19 @@ static void rna_Image_resolution_set(PointerRNA *ptr, const float *values)
static int rna_Image_depth_get(PointerRNA *ptr) static int rna_Image_depth_get(PointerRNA *ptr)
{ {
Image *im= (Image*)ptr->data; Image *im = (Image*)ptr->data;
ImBuf *ibuf; ImBuf *ibuf;
void *lock; void *lock;
int planes; int planes;
ibuf= BKE_image_acquire_ibuf(im, NULL, &lock); ibuf = BKE_image_acquire_ibuf(im, NULL, &lock);
if(!ibuf) if (!ibuf)
planes= 0; planes = 0;
else if(ibuf->rect_float) else if (ibuf->rect_float)
planes= ibuf->planes * 4; planes = ibuf->planes * 4;
else else
planes= ibuf->planes; planes = ibuf->planes;
BKE_image_release_ibuf(im, lock); BKE_image_release_ibuf(im, lock);
@@ -287,16 +287,16 @@ static int rna_Image_depth_get(PointerRNA *ptr)
static int rna_Image_pixels_get_length(PointerRNA *ptr, int length[RNA_MAX_ARRAY_DIMENSION]) static int rna_Image_pixels_get_length(PointerRNA *ptr, int length[RNA_MAX_ARRAY_DIMENSION])
{ {
Image *ima= ptr->id.data; Image *ima = ptr->id.data;
ImBuf *ibuf; ImBuf *ibuf;
void *lock; void *lock;
ibuf= BKE_image_acquire_ibuf(ima, NULL, &lock); ibuf = BKE_image_acquire_ibuf(ima, NULL, &lock);
if(ibuf) if (ibuf)
length[0]= ibuf->x*ibuf->y*ibuf->channels; length[0] = ibuf->x*ibuf->y*ibuf->channels;
else else
length[0]= 0; length[0] = 0;
BKE_image_release_ibuf(ima, lock); BKE_image_release_ibuf(ima, lock);
@@ -305,21 +305,21 @@ static int rna_Image_pixels_get_length(PointerRNA *ptr, int length[RNA_MAX_ARRAY
static void rna_Image_pixels_get(PointerRNA *ptr, float *values) static void rna_Image_pixels_get(PointerRNA *ptr, float *values)
{ {
Image *ima= ptr->id.data; Image *ima = ptr->id.data;
ImBuf *ibuf; ImBuf *ibuf;
void *lock; void *lock;
int i, size; int i, size;
ibuf= BKE_image_acquire_ibuf(ima, NULL, &lock); ibuf = BKE_image_acquire_ibuf(ima, NULL, &lock);
if(ibuf) { if (ibuf) {
size= ibuf->x*ibuf->y*ibuf->channels; size = ibuf->x*ibuf->y*ibuf->channels;
if(ibuf->rect_float) { if (ibuf->rect_float) {
memcpy(values, ibuf->rect_float, sizeof(float)*size); memcpy(values, ibuf->rect_float, sizeof(float)*size);
} }
else { else {
for(i = 0; i < size; i++) for (i = 0; i < size; i++)
values[i] = ((unsigned char*)ibuf->rect)[i]*(1.0f/255.0f); values[i] = ((unsigned char*)ibuf->rect)[i]*(1.0f/255.0f);
} }
} }
@@ -329,21 +329,21 @@ static void rna_Image_pixels_get(PointerRNA *ptr, float *values)
static void rna_Image_pixels_set(PointerRNA *ptr, const float *values) static void rna_Image_pixels_set(PointerRNA *ptr, const float *values)
{ {
Image *ima= ptr->id.data; Image *ima = ptr->id.data;
ImBuf *ibuf; ImBuf *ibuf;
void *lock; void *lock;
int i, size; int i, size;
ibuf= BKE_image_acquire_ibuf(ima, NULL, &lock); ibuf = BKE_image_acquire_ibuf(ima, NULL, &lock);
if(ibuf) { if (ibuf) {
size= ibuf->x*ibuf->y*ibuf->channels; size = ibuf->x*ibuf->y*ibuf->channels;
if(ibuf->rect_float) { if (ibuf->rect_float) {
memcpy(ibuf->rect_float, values, sizeof(float)*size); memcpy(ibuf->rect_float, values, sizeof(float)*size);
} }
else { else {
for(i = 0; i < size; i++) for (i = 0; i < size; i++)
((unsigned char*)ibuf->rect)[i] = FTOCHAR(values[i]); ((unsigned char*)ibuf->rect)[i] = FTOCHAR(values[i]);
} }
@@ -360,51 +360,51 @@ static void rna_def_imageuser(BlenderRNA *brna)
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
srna= RNA_def_struct(brna, "ImageUser", NULL); srna = RNA_def_struct(brna, "ImageUser", NULL);
RNA_def_struct_ui_text(srna, "Image User", "Parameters defining how an Image datablock is used by another datablock"); RNA_def_struct_ui_text(srna, "Image User", "Parameters defining how an Image datablock is used by another datablock");
RNA_def_struct_path_func(srna, "rna_ImageUser_path"); RNA_def_struct_path_func(srna, "rna_ImageUser_path");
prop= RNA_def_property(srna, "use_auto_refresh", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_auto_refresh", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", IMA_ANIM_ALWAYS); RNA_def_property_boolean_sdna(prop, NULL, "flag", IMA_ANIM_ALWAYS);
RNA_def_property_ui_text(prop, "Auto Refresh", "Always refresh image on frame changes"); RNA_def_property_ui_text(prop, "Auto Refresh", "Always refresh image on frame changes");
RNA_def_property_update(prop, 0, "rna_ImageUser_update"); RNA_def_property_update(prop, 0, "rna_ImageUser_update");
/* animation */ /* animation */
prop= RNA_def_property(srna, "use_cyclic", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_cyclic", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "cycl", 0); RNA_def_property_boolean_sdna(prop, NULL, "cycl", 0);
RNA_def_property_ui_text(prop, "Cyclic", "Cycle the images in the movie"); RNA_def_property_ui_text(prop, "Cyclic", "Cycle the images in the movie");
RNA_def_property_update(prop, 0, "rna_ImageUser_update"); RNA_def_property_update(prop, 0, "rna_ImageUser_update");
prop= RNA_def_property(srna, "frame_duration", PROP_INT, PROP_NONE); prop = RNA_def_property(srna, "frame_duration", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "frames"); RNA_def_property_int_sdna(prop, NULL, "frames");
RNA_def_property_range(prop, 0, MAXFRAMEF); RNA_def_property_range(prop, 0, MAXFRAMEF);
RNA_def_property_ui_text(prop, "Frames", "Number of images of a movie to use"); RNA_def_property_ui_text(prop, "Frames", "Number of images of a movie to use");
RNA_def_property_update(prop, 0, "rna_ImageUser_update"); RNA_def_property_update(prop, 0, "rna_ImageUser_update");
prop= RNA_def_property(srna, "frame_offset", PROP_INT, PROP_NONE); prop = RNA_def_property(srna, "frame_offset", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "offset"); RNA_def_property_int_sdna(prop, NULL, "offset");
RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF); RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF);
RNA_def_property_ui_text(prop, "Offset", "Offset the number of the frame to use in the animation"); RNA_def_property_ui_text(prop, "Offset", "Offset the number of the frame to use in the animation");
RNA_def_property_update(prop, 0, "rna_ImageUser_update"); RNA_def_property_update(prop, 0, "rna_ImageUser_update");
prop= RNA_def_property(srna, "frame_start", PROP_INT, PROP_TIME); prop = RNA_def_property(srna, "frame_start", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "sfra"); RNA_def_property_int_sdna(prop, NULL, "sfra");
RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF); RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF);
RNA_def_property_ui_text(prop, "Start Frame", "Global starting frame of the movie/sequence, assuming first picture has a #1"); RNA_def_property_ui_text(prop, "Start Frame", "Global starting frame of the movie/sequence, assuming first picture has a #1");
RNA_def_property_update(prop, 0, "rna_ImageUser_update"); RNA_def_property_update(prop, 0, "rna_ImageUser_update");
prop= RNA_def_property(srna, "fields_per_frame", PROP_INT, PROP_NONE); prop = RNA_def_property(srna, "fields_per_frame", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "fie_ima"); RNA_def_property_int_sdna(prop, NULL, "fie_ima");
RNA_def_property_range(prop, 1, 200); RNA_def_property_range(prop, 1, 200);
RNA_def_property_ui_text(prop, "Fields per Frame", "Number of fields per rendered frame (2 fields is 1 image)"); RNA_def_property_ui_text(prop, "Fields per Frame", "Number of fields per rendered frame (2 fields is 1 image)");
RNA_def_property_update(prop, 0, "rna_ImageUser_update"); RNA_def_property_update(prop, 0, "rna_ImageUser_update");
prop= RNA_def_property(srna, "multilayer_layer", PROP_INT, PROP_UNSIGNED); prop = RNA_def_property(srna, "multilayer_layer", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "layer"); RNA_def_property_int_sdna(prop, NULL, "layer");
RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* image_multi_cb */ RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* image_multi_cb */
RNA_def_property_ui_text(prop, "Layer", "Layer in multilayer image"); RNA_def_property_ui_text(prop, "Layer", "Layer in multilayer image");
prop= RNA_def_property(srna, "multilayer_pass", PROP_INT, PROP_UNSIGNED); prop = RNA_def_property(srna, "multilayer_pass", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "pass"); RNA_def_property_int_sdna(prop, NULL, "pass");
RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* image_multi_cb */ RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* image_multi_cb */
RNA_def_property_ui_text(prop, "Pass", "Pass in multilayer image"); RNA_def_property_ui_text(prop, "Pass", "Pass in multilayer image");
@@ -414,178 +414,178 @@ static void rna_def_image(BlenderRNA *brna)
{ {
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
static const EnumPropertyItem prop_type_items[]= { static const EnumPropertyItem prop_type_items[] = {
{IMA_TYPE_IMAGE, "IMAGE", 0, "Image", ""}, {IMA_TYPE_IMAGE, "IMAGE", 0, "Image", ""},
{IMA_TYPE_MULTILAYER, "MULTILAYER", 0, "Multilayer", ""}, {IMA_TYPE_MULTILAYER, "MULTILAYER", 0, "Multilayer", ""},
{IMA_TYPE_UV_TEST, "UV_TEST", 0, "UV Test", ""}, {IMA_TYPE_UV_TEST, "UV_TEST", 0, "UV Test", ""},
{IMA_TYPE_R_RESULT, "RENDER_RESULT", 0, "Render Result", ""}, {IMA_TYPE_R_RESULT, "RENDER_RESULT", 0, "Render Result", ""},
{IMA_TYPE_COMPOSITE, "COMPOSITING", 0, "Compositing", ""}, {IMA_TYPE_COMPOSITE, "COMPOSITING", 0, "Compositing", ""},
{0, NULL, 0, NULL, NULL}}; {0, NULL, 0, NULL, NULL}};
static const EnumPropertyItem prop_generated_type_items[]= { static const EnumPropertyItem prop_generated_type_items[] = {
{0, "BLANK", 0, "Blank", "Generate a blank image"}, {0, "BLANK", 0, "Blank", "Generate a blank image"},
{1, "UV_GRID", 0, "UV Grid", "Generated grid to test UV mappings"}, {1, "UV_GRID", 0, "UV Grid", "Generated grid to test UV mappings"},
{2, "COLOR_GRID", 0, "Color Grid", "Generated improved UV grid to test UV mappings"}, {2, "COLOR_GRID", 0, "Color Grid", "Generated improved UV grid to test UV mappings"},
{0, NULL, 0, NULL, NULL}}; {0, NULL, 0, NULL, NULL}};
static const EnumPropertyItem prop_mapping_items[]= { static const EnumPropertyItem prop_mapping_items[] = {
{0, "UV", 0, "UV Coordinates", "Use UV coordinates for mapping the image"}, {0, "UV", 0, "UV Coordinates", "Use UV coordinates for mapping the image"},
{IMA_REFLECT, "REFLECTION", 0, "Reflection", "Use reflection mapping for mapping the image"}, {IMA_REFLECT, "REFLECTION", 0, "Reflection", "Use reflection mapping for mapping the image"},
{0, NULL, 0, NULL, NULL}}; {0, NULL, 0, NULL, NULL}};
static const EnumPropertyItem prop_field_order_items[]= { static const EnumPropertyItem prop_field_order_items[] = {
{0, "EVEN", 0, "Upper First", "Upper field first"}, {0, "EVEN", 0, "Upper First", "Upper field first"},
{IMA_STD_FIELD, "ODD", 0, "Lower First", "Lower field first"}, {IMA_STD_FIELD, "ODD", 0, "Lower First", "Lower field first"},
{0, NULL, 0, NULL, NULL}}; {0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "Image", "ID"); srna = RNA_def_struct(brna, "Image", "ID");
RNA_def_struct_ui_text(srna, "Image", "Image datablock referencing an external or packed image"); RNA_def_struct_ui_text(srna, "Image", "Image datablock referencing an external or packed image");
RNA_def_struct_ui_icon(srna, ICON_IMAGE_DATA); RNA_def_struct_ui_icon(srna, ICON_IMAGE_DATA);
prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH); prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
RNA_def_property_string_sdna(prop, NULL, "name"); RNA_def_property_string_sdna(prop, NULL, "name");
RNA_def_property_ui_text(prop, "File Name", "Image/Movie file name"); RNA_def_property_ui_text(prop, "File Name", "Image/Movie file name");
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_reload_update"); RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_reload_update");
/* eek. this is horrible but needed so we can save to a new name without blanking the data :( */ /* eek. this is horrible but needed so we can save to a new name without blanking the data :( */
prop= RNA_def_property(srna, "filepath_raw", PROP_STRING, PROP_FILEPATH); prop = RNA_def_property(srna, "filepath_raw", PROP_STRING, PROP_FILEPATH);
RNA_def_property_string_sdna(prop, NULL, "name"); RNA_def_property_string_sdna(prop, NULL, "name");
RNA_def_property_ui_text(prop, "File Name", "Image/Movie file name (without data refreshing)"); RNA_def_property_ui_text(prop, "File Name", "Image/Movie file name (without data refreshing)");
prop= RNA_def_property(srna, "file_format", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "file_format", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, image_type_items); RNA_def_property_enum_items(prop, image_type_items);
RNA_def_property_enum_funcs(prop, "rna_Image_file_format_get", "rna_Image_file_format_set", NULL); RNA_def_property_enum_funcs(prop, "rna_Image_file_format_get", "rna_Image_file_format_set", NULL);
RNA_def_property_ui_text(prop, "File Format", "Format used for re-saving this file"); RNA_def_property_ui_text(prop, "File Format", "Format used for re-saving this file");
prop= RNA_def_property(srna, "source", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "source", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, image_source_items); RNA_def_property_enum_items(prop, image_source_items);
RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Image_source_itemf"); RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Image_source_itemf");
RNA_def_property_ui_text(prop, "Source", "Where the image comes from"); RNA_def_property_ui_text(prop, "Source", "Where the image comes from");
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_source_update"); RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_source_update");
prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, prop_type_items); RNA_def_property_enum_items(prop, prop_type_items);
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Type", "How to generate the image"); RNA_def_property_ui_text(prop, "Type", "How to generate the image");
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
prop= RNA_def_property(srna, "packed_file", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "packed_file", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "packedfile"); RNA_def_property_pointer_sdna(prop, NULL, "packedfile");
RNA_def_property_ui_text(prop, "Packed File", ""); RNA_def_property_ui_text(prop, "Packed File", "");
prop= RNA_def_property(srna, "field_order", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "field_order", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
RNA_def_property_enum_items(prop, prop_field_order_items); RNA_def_property_enum_items(prop, prop_field_order_items);
RNA_def_property_ui_text(prop, "Field Order", "Order of video fields (select which lines are displayed first)"); RNA_def_property_ui_text(prop, "Field Order", "Order of video fields (select which lines are displayed first)");
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
/* booleans */ /* booleans */
prop= RNA_def_property(srna, "use_fields", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_fields", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", IMA_FIELDS); RNA_def_property_boolean_sdna(prop, NULL, "flag", IMA_FIELDS);
RNA_def_property_ui_text(prop, "Fields", "Use fields of the image"); RNA_def_property_ui_text(prop, "Fields", "Use fields of the image");
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_fields_update"); RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_fields_update");
prop= RNA_def_property(srna, "use_premultiply", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_premultiply", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", IMA_DO_PREMUL); RNA_def_property_boolean_sdna(prop, NULL, "flag", IMA_DO_PREMUL);
RNA_def_property_ui_text(prop, "Premultiply", "Convert RGB from key alpha to premultiplied alpha"); RNA_def_property_ui_text(prop, "Premultiply", "Convert RGB from key alpha to premultiplied alpha");
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_free_update"); RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_free_update");
prop= RNA_def_property(srna, "use_color_unpremultiply", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_color_unpremultiply", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", IMA_CM_PREDIVIDE); RNA_def_property_boolean_sdna(prop, NULL, "flag", IMA_CM_PREDIVIDE);
RNA_def_property_ui_text(prop, "Color Unpremultiply", "For premultiplied alpha images, do color space conversion on colors without alpha, to avoid fringing for images with light backgrounds"); RNA_def_property_ui_text(prop, "Color Unpremultiply", "For premultiplied alpha images, do color space conversion on colors without alpha, to avoid fringing for images with light backgrounds");
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_free_update"); RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_free_update");
prop= RNA_def_property(srna, "is_dirty", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "is_dirty", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_Image_dirty_get", NULL); RNA_def_property_boolean_funcs(prop, "rna_Image_dirty_get", NULL);
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Dirty", "Image has changed and is not saved"); RNA_def_property_ui_text(prop, "Dirty", "Image has changed and is not saved");
/* generated image (image_generated_change_cb) */ /* generated image (image_generated_change_cb) */
prop= RNA_def_property(srna, "generated_type", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "generated_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "gen_type"); RNA_def_property_enum_sdna(prop, NULL, "gen_type");
RNA_def_property_enum_items(prop, prop_generated_type_items); RNA_def_property_enum_items(prop, prop_generated_type_items);
RNA_def_property_ui_text(prop, "Generated Type", "Generated image type"); RNA_def_property_ui_text(prop, "Generated Type", "Generated image type");
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_generated_update"); RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_generated_update");
prop= RNA_def_property(srna, "generated_width", PROP_INT, PROP_NONE); prop = RNA_def_property(srna, "generated_width", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "gen_x"); RNA_def_property_int_sdna(prop, NULL, "gen_x");
RNA_def_property_range(prop, 1, 16384); RNA_def_property_range(prop, 1, 16384);
RNA_def_property_ui_text(prop, "Generated Width", "Generated image width"); RNA_def_property_ui_text(prop, "Generated Width", "Generated image width");
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_generated_update"); RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_generated_update");
prop= RNA_def_property(srna, "generated_height", PROP_INT, PROP_NONE); prop = RNA_def_property(srna, "generated_height", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "gen_y"); RNA_def_property_int_sdna(prop, NULL, "gen_y");
RNA_def_property_range(prop, 1, 16384); RNA_def_property_range(prop, 1, 16384);
RNA_def_property_ui_text(prop, "Generated Height", "Generated image height"); RNA_def_property_ui_text(prop, "Generated Height", "Generated image height");
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_generated_update"); RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_generated_update");
prop= RNA_def_property(srna, "use_generated_float", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_generated_float", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "gen_flag", IMA_GEN_FLOAT); RNA_def_property_boolean_sdna(prop, NULL, "gen_flag", IMA_GEN_FLOAT);
RNA_def_property_ui_text(prop, "Float Buffer", "Generate floating point buffer"); RNA_def_property_ui_text(prop, "Float Buffer", "Generate floating point buffer");
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_generated_update"); RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_generated_update");
/* realtime properties */ /* realtime properties */
prop= RNA_def_property(srna, "mapping", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "mapping", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
RNA_def_property_enum_items(prop, prop_mapping_items); RNA_def_property_enum_items(prop, prop_mapping_items);
RNA_def_property_ui_text(prop, "Mapping", "Mapping type to use for this image in the game engine"); RNA_def_property_ui_text(prop, "Mapping", "Mapping type to use for this image in the game engine");
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
prop= RNA_def_property(srna, "display_aspect", PROP_FLOAT, PROP_XYZ); prop = RNA_def_property(srna, "display_aspect", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "aspx"); RNA_def_property_float_sdna(prop, NULL, "aspx");
RNA_def_property_array(prop, 2); RNA_def_property_array(prop, 2);
RNA_def_property_range(prop, 0.1f, 5000.0f); RNA_def_property_range(prop, 0.1f, 5000.0f);
RNA_def_property_ui_text(prop, "Display Aspect", "Display Aspect for this image, does not affect rendering"); RNA_def_property_ui_text(prop, "Display Aspect", "Display Aspect for this image, does not affect rendering");
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
prop= RNA_def_property(srna, "use_animation", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_animation", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "tpageflag", IMA_TWINANIM); RNA_def_property_boolean_sdna(prop, NULL, "tpageflag", IMA_TWINANIM);
RNA_def_property_ui_text(prop, "Animated", "Use as animated texture in the game engine"); RNA_def_property_ui_text(prop, "Animated", "Use as animated texture in the game engine");
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_animated_update"); RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_animated_update");
prop= RNA_def_property(srna, "frame_start", PROP_INT, PROP_NONE); prop = RNA_def_property(srna, "frame_start", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "twsta"); RNA_def_property_int_sdna(prop, NULL, "twsta");
RNA_def_property_range(prop, 0, 128); RNA_def_property_range(prop, 0, 128);
RNA_def_property_ui_text(prop, "Animation Start", "Start frame of an animated texture"); RNA_def_property_ui_text(prop, "Animation Start", "Start frame of an animated texture");
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_animated_update"); RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_animated_update");
prop= RNA_def_property(srna, "frame_end", PROP_INT, PROP_NONE); prop = RNA_def_property(srna, "frame_end", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "twend"); RNA_def_property_int_sdna(prop, NULL, "twend");
RNA_def_property_range(prop, 0, 128); RNA_def_property_range(prop, 0, 128);
RNA_def_property_ui_text(prop, "Animation End", "End frame of an animated texture"); RNA_def_property_ui_text(prop, "Animation End", "End frame of an animated texture");
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_animated_update"); RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_animated_update");
prop= RNA_def_property(srna, "fps", PROP_INT, PROP_NONE); prop = RNA_def_property(srna, "fps", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "animspeed"); RNA_def_property_int_sdna(prop, NULL, "animspeed");
RNA_def_property_range(prop, 1, 100); RNA_def_property_range(prop, 1, 100);
RNA_def_property_ui_text(prop, "Animation Speed", "Speed of the animation in frames per second"); RNA_def_property_ui_text(prop, "Animation Speed", "Speed of the animation in frames per second");
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
prop= RNA_def_property(srna, "use_tiles", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_tiles", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "tpageflag", IMA_TILES); RNA_def_property_boolean_sdna(prop, NULL, "tpageflag", IMA_TILES);
RNA_def_property_ui_text(prop, "Tiles", "Use of tilemode for faces (default shift-LMB to pick the tile for selected faces)"); RNA_def_property_ui_text(prop, "Tiles", "Use of tilemode for faces (default shift-LMB to pick the tile for selected faces)");
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
prop= RNA_def_property(srna, "tiles_x", PROP_INT, PROP_NONE); prop = RNA_def_property(srna, "tiles_x", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "xrep"); RNA_def_property_int_sdna(prop, NULL, "xrep");
RNA_def_property_range(prop, 1, 16); RNA_def_property_range(prop, 1, 16);
RNA_def_property_ui_text(prop, "Tiles X", "Degree of repetition in the X direction"); RNA_def_property_ui_text(prop, "Tiles X", "Degree of repetition in the X direction");
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
prop= RNA_def_property(srna, "tiles_y", PROP_INT, PROP_NONE); prop = RNA_def_property(srna, "tiles_y", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "yrep"); RNA_def_property_int_sdna(prop, NULL, "yrep");
RNA_def_property_range(prop, 1, 16); RNA_def_property_range(prop, 1, 16);
RNA_def_property_ui_text(prop, "Tiles Y", "Degree of repetition in the Y direction"); RNA_def_property_ui_text(prop, "Tiles Y", "Degree of repetition in the Y direction");
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
prop= RNA_def_property(srna, "use_clamp_x", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_clamp_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "tpageflag", IMA_CLAMP_U); RNA_def_property_boolean_sdna(prop, NULL, "tpageflag", IMA_CLAMP_U);
RNA_def_property_ui_text(prop, "Clamp X", "Disable texture repeating horizontally"); RNA_def_property_ui_text(prop, "Clamp X", "Disable texture repeating horizontally");
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
prop= RNA_def_property(srna, "use_clamp_y", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_clamp_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "tpageflag", IMA_CLAMP_V); RNA_def_property_boolean_sdna(prop, NULL, "tpageflag", IMA_CLAMP_V);
RNA_def_property_ui_text(prop, "Clamp Y", "Disable texture repeating vertically"); RNA_def_property_ui_text(prop, "Clamp Y", "Disable texture repeating vertically");
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
prop= RNA_def_property(srna, "bindcode", PROP_INT, PROP_UNSIGNED); prop = RNA_def_property(srna, "bindcode", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "bindcode"); RNA_def_property_int_sdna(prop, NULL, "bindcode");
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Bindcode", "OpenGL bindcode"); RNA_def_property_ui_text(prop, "Bindcode", "OpenGL bindcode");
@@ -595,24 +595,24 @@ static void rna_def_image(BlenderRNA *brna)
Image.has_data and Image.depth are temporary, Image.has_data and Image.depth are temporary,
Update import_obj.py when they are replaced (Arystan) Update import_obj.py when they are replaced (Arystan)
*/ */
prop= RNA_def_property(srna, "has_data", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "has_data", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_Image_has_data_get", NULL); RNA_def_property_boolean_funcs(prop, "rna_Image_has_data_get", NULL);
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Has data", "True if this image has data"); RNA_def_property_ui_text(prop, "Has data", "True if this image has data");
prop= RNA_def_property(srna, "depth", PROP_INT, PROP_UNSIGNED); prop = RNA_def_property(srna, "depth", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_funcs(prop, "rna_Image_depth_get", NULL, NULL); RNA_def_property_int_funcs(prop, "rna_Image_depth_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Depth", "Image bit depth"); RNA_def_property_ui_text(prop, "Depth", "Image bit depth");
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
prop= RNA_def_int_vector(srna, "size" , 2 , NULL , 0, 0, "Size" , "Width and height in pixels, zero when image data cant be loaded" , 0 , 0); prop = RNA_def_int_vector(srna, "size" , 2 , NULL , 0, 0, "Size" , "Width and height in pixels, zero when image data cant be loaded" , 0 , 0);
RNA_def_property_int_funcs(prop, "rna_Image_size_get" , NULL, NULL); RNA_def_property_int_funcs(prop, "rna_Image_size_get" , NULL, NULL);
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
prop= RNA_def_float_vector(srna, "resolution" , 2 , NULL , 0, 0, "Resolution" , "X/Y pixels per meter" , 0 , 0); prop = RNA_def_float_vector(srna, "resolution" , 2 , NULL , 0, 0, "Resolution" , "X/Y pixels per meter" , 0 , 0);
RNA_def_property_float_funcs(prop, "rna_Image_resolution_get" , "rna_Image_resolution_set", NULL); RNA_def_property_float_funcs(prop, "rna_Image_resolution_get" , "rna_Image_resolution_set", NULL);
prop= RNA_def_property(srna, "pixels", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "pixels", PROP_FLOAT, PROP_NONE);
RNA_def_property_flag(prop, PROP_DYNAMIC); RNA_def_property_flag(prop, PROP_DYNAMIC);
RNA_def_property_multi_array(prop, 1, NULL); RNA_def_property_multi_array(prop, 1, NULL);
RNA_def_property_ui_text(prop, "Pixels", "Image pixels in floating point values"); RNA_def_property_ui_text(prop, "Pixels", "Image pixels in floating point values");

View File

@@ -82,15 +82,15 @@ static void rna_Image_save_render(Image *image, bContext *C, ReportList *reports
} }
else { else {
/* temp swap out the color */ /* temp swap out the color */
const unsigned char imb_planes_back= ibuf->planes; const unsigned char imb_planes_back = ibuf->planes;
const float dither_back= ibuf->dither; const float dither_back = ibuf->dither;
ibuf->planes= scene->r.im_format.planes; ibuf->planes = scene->r.im_format.planes;
ibuf->dither= scene->r.dither_intensity; ibuf->dither = scene->r.dither_intensity;
if (!BKE_write_ibuf(ibuf, path, &scene->r.im_format)) { if (!BKE_write_ibuf(ibuf, path, &scene->r.im_format)) {
BKE_reportf(reports, RPT_ERROR, "Couldn't write image: %s", path); BKE_reportf(reports, RPT_ERROR, "Couldn't write image: %s", path);
} }
ibuf->planes= imb_planes_back; ibuf->planes = imb_planes_back;
ibuf->dither= dither_back; ibuf->dither = dither_back;
} }
BKE_image_release_ibuf(image, lock); BKE_image_release_ibuf(image, lock);
@@ -101,22 +101,22 @@ static void rna_Image_save_render(Image *image, bContext *C, ReportList *reports
static void rna_Image_save(Image *image, ReportList *reports) static void rna_Image_save(Image *image, ReportList *reports)
{ {
ImBuf *ibuf= BKE_image_get_ibuf(image, NULL); ImBuf *ibuf = BKE_image_get_ibuf(image, NULL);
if(ibuf) { if (ibuf) {
char filename[FILE_MAX]; char filename[FILE_MAX];
BLI_strncpy(filename, image->name, sizeof(filename)); BLI_strncpy(filename, image->name, sizeof(filename));
BLI_path_abs(filename, G.main->name); BLI_path_abs(filename, G.main->name);
if(image->packedfile) { if (image->packedfile) {
if (writePackedFile(reports, image->name, image->packedfile, 0) != RET_OK) { if (writePackedFile(reports, image->name, image->packedfile, 0) != RET_OK) {
BKE_reportf(reports, RPT_ERROR, "Image \"%s\" could saved packed file to \"%s\"", image->id.name+2, image->name); BKE_reportf(reports, RPT_ERROR, "Image \"%s\" could saved packed file to \"%s\"", image->id.name+2, image->name);
} }
} }
else if (IMB_saveiff(ibuf, filename, ibuf->flags)) { else if (IMB_saveiff(ibuf, filename, ibuf->flags)) {
image->type= IMA_TYPE_IMAGE; image->type = IMA_TYPE_IMAGE;
if(image->source==IMA_SRC_GENERATED) if (image->source == IMA_SRC_GENERATED)
image->source= IMA_SRC_FILE; image->source = IMA_SRC_FILE;
ibuf->userflags &= ~IB_BITMAPDIRTY; ibuf->userflags &= ~IB_BITMAPDIRTY;
} }
@@ -137,11 +137,11 @@ static void rna_Image_pack(Image *image, ReportList *reports, int as_png)
BKE_reportf(reports, RPT_ERROR, "Can't pack edited image from disk, only as internal PNG"); BKE_reportf(reports, RPT_ERROR, "Can't pack edited image from disk, only as internal PNG");
} }
else { else {
if(as_png) { if (as_png) {
BKE_image_memorypack(image); BKE_image_memorypack(image);
} }
else { else {
image->packedfile= newPackedFile(reports, image->name, ID_BLEND_PATH(G.main, &image->id)); image->packedfile = newPackedFile(reports, image->name, ID_BLEND_PATH(G.main, &image->id));
} }
} }
} }
@@ -151,7 +151,7 @@ static void rna_Image_unpack(Image *image, ReportList *reports, int method)
if (!image->packedfile) { if (!image->packedfile) {
BKE_report(reports, RPT_ERROR, "Image not packed"); BKE_report(reports, RPT_ERROR, "Image not packed");
} }
else if (image->source==IMA_SRC_SEQUENCE || image->source==IMA_SRC_MOVIE) { else if (image->source == IMA_SRC_SEQUENCE || image->source == IMA_SRC_MOVIE) {
BKE_report(reports, RPT_ERROR, "Unpacking movies or image sequences not supported"); BKE_report(reports, RPT_ERROR, "Unpacking movies or image sequences not supported");
return; return;
} }
@@ -168,9 +168,9 @@ static void rna_Image_reload(Image *image)
static void rna_Image_update(Image *image, ReportList *reports) static void rna_Image_update(Image *image, ReportList *reports)
{ {
ImBuf *ibuf= BKE_image_get_ibuf(image, NULL); ImBuf *ibuf = BKE_image_get_ibuf(image, NULL);
if(ibuf == NULL) { if (ibuf == NULL) {
BKE_reportf(reports, RPT_ERROR, "Image \"%s\" does not have any image data", image->id.name+2); BKE_reportf(reports, RPT_ERROR, "Image \"%s\" does not have any image data", image->id.name+2);
return; return;
} }
@@ -184,12 +184,12 @@ static int rna_Image_gl_load(Image *image, ReportList *reports, int filter, int
unsigned int *bind = &image->bindcode; unsigned int *bind = &image->bindcode;
int error = GL_NO_ERROR; int error = GL_NO_ERROR;
if(*bind) if (*bind)
return error; return error;
ibuf= BKE_image_get_ibuf(image, NULL); ibuf = BKE_image_get_ibuf(image, NULL);
if(ibuf == NULL || ibuf->rect == NULL ) { if (ibuf == NULL || ibuf->rect == NULL ) {
BKE_reportf(reports, RPT_ERROR, "Image \"%s\" does not have any image data", image->id.name+2); BKE_reportf(reports, RPT_ERROR, "Image \"%s\" does not have any image data", image->id.name+2);
return (int)GL_INVALID_OPERATION; return (int)GL_INVALID_OPERATION;
} }
@@ -234,35 +234,35 @@ void RNA_api_image(StructRNA *srna)
FunctionRNA *func; FunctionRNA *func;
PropertyRNA *parm; PropertyRNA *parm;
func= RNA_def_function(srna, "save_render", "rna_Image_save_render"); func = RNA_def_function(srna, "save_render", "rna_Image_save_render");
RNA_def_function_ui_description(func, "Save image to a specific path using a scenes render settings"); RNA_def_function_ui_description(func, "Save image to a specific path using a scenes render settings");
RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS); RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
parm= RNA_def_string_file_path(func, "filepath", "", 0, "", "Save path"); parm = RNA_def_string_file_path(func, "filepath", "", 0, "", "Save path");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_pointer(func, "scene", "Scene", "", "Scene to take image parameters from"); RNA_def_pointer(func, "scene", "Scene", "", "Scene to take image parameters from");
func= RNA_def_function(srna, "save", "rna_Image_save"); func = RNA_def_function(srna, "save", "rna_Image_save");
RNA_def_function_ui_description(func, "Save image to its source path"); RNA_def_function_ui_description(func, "Save image to its source path");
RNA_def_function_flag(func, FUNC_USE_REPORTS); RNA_def_function_flag(func, FUNC_USE_REPORTS);
func= RNA_def_function(srna, "pack", "rna_Image_pack"); func = RNA_def_function(srna, "pack", "rna_Image_pack");
RNA_def_function_ui_description(func, "Pack an image as embedded data into the .blend file"); RNA_def_function_ui_description(func, "Pack an image as embedded data into the .blend file");
RNA_def_function_flag(func, FUNC_USE_REPORTS); RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_boolean(func, "as_png", 0, "as_png", "Pack the image as PNG (needed for generated/dirty images)"); RNA_def_boolean(func, "as_png", 0, "as_png", "Pack the image as PNG (needed for generated/dirty images)");
func= RNA_def_function(srna, "unpack", "rna_Image_unpack"); func = RNA_def_function(srna, "unpack", "rna_Image_unpack");
RNA_def_function_ui_description(func, "Save an image packed in the .blend file to disk"); RNA_def_function_ui_description(func, "Save an image packed in the .blend file to disk");
RNA_def_function_flag(func, FUNC_USE_REPORTS); RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_enum(func, "method", unpack_method_items, PF_USE_LOCAL, "method", "How to unpack"); RNA_def_enum(func, "method", unpack_method_items, PF_USE_LOCAL, "method", "How to unpack");
func= RNA_def_function(srna, "reload", "rna_Image_reload"); func = RNA_def_function(srna, "reload", "rna_Image_reload");
RNA_def_function_ui_description(func, "Reload the image from its source path"); RNA_def_function_ui_description(func, "Reload the image from its source path");
func= RNA_def_function(srna, "update", "rna_Image_update"); func = RNA_def_function(srna, "update", "rna_Image_update");
RNA_def_function_ui_description(func, "Update the display image from the floating point buffer"); RNA_def_function_ui_description(func, "Update the display image from the floating point buffer");
RNA_def_function_flag(func, FUNC_USE_REPORTS); RNA_def_function_flag(func, FUNC_USE_REPORTS);
func= RNA_def_function(srna, "gl_load", "rna_Image_gl_load"); func = RNA_def_function(srna, "gl_load", "rna_Image_gl_load");
RNA_def_function_ui_description(func, "Load the image into OpenGL graphics memory"); RNA_def_function_ui_description(func, "Load the image into OpenGL graphics memory");
RNA_def_function_flag(func, FUNC_USE_REPORTS); RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_int(func, "filter", GL_LINEAR_MIPMAP_NEAREST, -INT_MAX, INT_MAX, "Filter", RNA_def_int(func, "filter", GL_LINEAR_MIPMAP_NEAREST, -INT_MAX, INT_MAX, "Filter",
@@ -270,10 +270,10 @@ void RNA_api_image(StructRNA *srna)
RNA_def_int(func, "mag", GL_LINEAR, -INT_MAX, INT_MAX, "Magnification", RNA_def_int(func, "mag", GL_LINEAR, -INT_MAX, INT_MAX, "Magnification",
"The texture magnification function", -INT_MAX, INT_MAX); "The texture magnification function", -INT_MAX, INT_MAX);
/* return value */ /* return value */
parm= RNA_def_int(func, "error", 0, -INT_MAX, INT_MAX, "Error", "OpenGL error value", -INT_MAX, INT_MAX); parm = RNA_def_int(func, "error", 0, -INT_MAX, INT_MAX, "Error", "OpenGL error value", -INT_MAX, INT_MAX);
RNA_def_function_return(func, parm); RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "gl_free", "rna_Image_gl_free"); func = RNA_def_function(srna, "gl_free", "rna_Image_gl_free");
RNA_def_function_ui_description(func, "Free the image from OpenGL graphics memory"); RNA_def_function_ui_description(func, "Free the image from OpenGL graphics memory");
/* TODO, pack/unpack, maybe should be generic functions? */ /* TODO, pack/unpack, maybe should be generic functions? */

View File

@@ -377,7 +377,7 @@ PointerRNA rna_pointer_inherit_refine(struct PointerRNA *ptr, struct StructRNA *
int rna_parameter_size(struct PropertyRNA *parm); int rna_parameter_size(struct PropertyRNA *parm);
int rna_parameter_size_alloc(struct PropertyRNA *parm); int rna_parameter_size_alloc(struct PropertyRNA *parm);
// XXX, these should not need to be defined here~! /* XXX, these should not need to be defined here~! */
struct MTex *rna_mtex_texture_slots_add(struct ID *self, struct bContext *C, struct ReportList *reports); struct MTex *rna_mtex_texture_slots_add(struct ID *self, struct bContext *C, struct ReportList *reports);
struct MTex *rna_mtex_texture_slots_create(struct ID *self, struct bContext *C, struct ReportList *reports, int index); struct MTex *rna_mtex_texture_slots_create(struct ID *self, struct bContext *C, struct ReportList *reports, int index);
void rna_mtex_texture_slots_clear(struct ID *self, struct bContext *C, struct ReportList *reports, int index); void rna_mtex_texture_slots_clear(struct ID *self, struct bContext *C, struct ReportList *reports, int index);

View File

@@ -55,7 +55,7 @@
static Key *rna_ShapeKey_find_key(ID *id) static Key *rna_ShapeKey_find_key(ID *id)
{ {
switch(GS(id->name)) { switch (GS(id->name)) {
case ID_CU: return ((Curve*)id)->key; case ID_CU: return ((Curve*)id)->key;
case ID_KE: return (Key*)id; case ID_KE: return (Key*)id;
case ID_LT: return ((Lattice*)id)->key; case ID_LT: return ((Lattice*)id)->key;
@@ -67,7 +67,7 @@ static Key *rna_ShapeKey_find_key(ID *id)
void rna_ShapeKey_name_set(PointerRNA *ptr, const char *value) void rna_ShapeKey_name_set(PointerRNA *ptr, const char *value)
{ {
KeyBlock *kb= ptr->data; KeyBlock *kb = ptr->data;
char oldname[sizeof(kb->name)]; char oldname[sizeof(kb->name)];
/* make a copy of the old name first */ /* make a copy of the old name first */
@@ -78,7 +78,7 @@ void rna_ShapeKey_name_set(PointerRNA *ptr, const char *value)
/* make sure the name is truly unique */ /* make sure the name is truly unique */
if (ptr->id.data) { if (ptr->id.data) {
Key *key= rna_ShapeKey_find_key(ptr->id.data); Key *key = rna_ShapeKey_find_key(ptr->id.data);
BLI_uniquename(&key->block, kb, "Key", '.', offsetof(KeyBlock, name), sizeof(kb->name)); BLI_uniquename(&key->block, kb, "Key", '.', offsetof(KeyBlock, name), sizeof(kb->name));
} }
@@ -88,17 +88,17 @@ void rna_ShapeKey_name_set(PointerRNA *ptr, const char *value)
static void rna_ShapeKey_value_set(PointerRNA *ptr, float value) static void rna_ShapeKey_value_set(PointerRNA *ptr, float value)
{ {
KeyBlock *data= (KeyBlock*)ptr->data; KeyBlock *data = (KeyBlock*)ptr->data;
CLAMP(value, data->slidermin, data->slidermax); CLAMP(value, data->slidermin, data->slidermax);
data->curval= value; data->curval = value;
} }
static void rna_ShapeKey_value_range(PointerRNA *ptr, float *min, float *max) static void rna_ShapeKey_value_range(PointerRNA *ptr, float *min, float *max)
{ {
KeyBlock *data= (KeyBlock*)ptr->data; KeyBlock *data = (KeyBlock*)ptr->data;
*min= data->slidermin; *min = data->slidermin;
*max= data->slidermax; *max = data->slidermax;
} }
/* epsilon for how close one end of shapekey range can get to the other */ /* epsilon for how close one end of shapekey range can get to the other */
@@ -106,15 +106,15 @@ static void rna_ShapeKey_value_range(PointerRNA *ptr, float *min, float *max)
static void rna_ShapeKey_slider_min_range(PointerRNA *ptr, float *min, float *max) static void rna_ShapeKey_slider_min_range(PointerRNA *ptr, float *min, float *max)
{ {
KeyBlock *data= (KeyBlock*)ptr->data; KeyBlock *data = (KeyBlock*)ptr->data;
*min= -10.0f; *min = -10.0f;
*max= data->slidermax - SHAPEKEY_SLIDER_TOL; *max = data->slidermax - SHAPEKEY_SLIDER_TOL;
} }
static void rna_ShapeKey_slider_min_set(PointerRNA *ptr, float value) static void rna_ShapeKey_slider_min_set(PointerRNA *ptr, float value)
{ {
KeyBlock *data= (KeyBlock*)ptr->data; KeyBlock *data = (KeyBlock*)ptr->data;
float min, max; float min, max;
rna_ShapeKey_slider_min_range(ptr, &min, &max); rna_ShapeKey_slider_min_range(ptr, &min, &max);
@@ -124,15 +124,15 @@ static void rna_ShapeKey_slider_min_set(PointerRNA *ptr, float value)
static void rna_ShapeKey_slider_max_range(PointerRNA *ptr, float *min, float *max) static void rna_ShapeKey_slider_max_range(PointerRNA *ptr, float *min, float *max)
{ {
KeyBlock *data= (KeyBlock*)ptr->data; KeyBlock *data = (KeyBlock*)ptr->data;
*min= data->slidermin + SHAPEKEY_SLIDER_TOL; *min = data->slidermin + SHAPEKEY_SLIDER_TOL;
*max= 10.0f; *max = 10.0f;
} }
static void rna_ShapeKey_slider_max_set(PointerRNA *ptr, float value) static void rna_ShapeKey_slider_max_set(PointerRNA *ptr, float value)
{ {
KeyBlock *data= (KeyBlock*)ptr->data; KeyBlock *data = (KeyBlock*)ptr->data;
float min, max; float min, max;
rna_ShapeKey_slider_max_range(ptr, &min, &max); rna_ShapeKey_slider_max_range(ptr, &min, &max);
@@ -144,8 +144,8 @@ static void rna_ShapeKey_slider_max_set(PointerRNA *ptr, float value)
PointerRNA rna_object_shapekey_index_get(ID *id, int value) PointerRNA rna_object_shapekey_index_get(ID *id, int value)
{ {
Key *key= rna_ShapeKey_find_key(id); Key *key = rna_ShapeKey_find_key(id);
KeyBlock *kb= NULL; KeyBlock *kb = NULL;
PointerRNA ptr; PointerRNA ptr;
if (key && value < key->totkey) if (key && value < key->totkey)
@@ -158,7 +158,7 @@ PointerRNA rna_object_shapekey_index_get(ID *id, int value)
int rna_object_shapekey_index_set(ID *id, PointerRNA value, int current) int rna_object_shapekey_index_set(ID *id, PointerRNA value, int current)
{ {
Key *key= rna_ShapeKey_find_key(id); Key *key = rna_ShapeKey_find_key(id);
if (key) { if (key) {
int a = BLI_findindex(&key->block, value.data); int a = BLI_findindex(&key->block, value.data);
@@ -170,100 +170,100 @@ int rna_object_shapekey_index_set(ID *id, PointerRNA value, int current)
static PointerRNA rna_ShapeKey_relative_key_get(PointerRNA *ptr) static PointerRNA rna_ShapeKey_relative_key_get(PointerRNA *ptr)
{ {
KeyBlock *kb= (KeyBlock*)ptr->data; KeyBlock *kb = (KeyBlock*)ptr->data;
return rna_object_shapekey_index_get(ptr->id.data, kb->relative); return rna_object_shapekey_index_get(ptr->id.data, kb->relative);
} }
static void rna_ShapeKey_relative_key_set(PointerRNA *ptr, PointerRNA value) static void rna_ShapeKey_relative_key_set(PointerRNA *ptr, PointerRNA value)
{ {
KeyBlock *kb= (KeyBlock*)ptr->data; KeyBlock *kb = (KeyBlock*)ptr->data;
kb->relative= rna_object_shapekey_index_set(ptr->id.data, value, kb->relative); kb->relative = rna_object_shapekey_index_set(ptr->id.data, value, kb->relative);
} }
static void rna_ShapeKeyPoint_co_get(PointerRNA *ptr, float *values) static void rna_ShapeKeyPoint_co_get(PointerRNA *ptr, float *values)
{ {
float *vec= (float*)ptr->data; float *vec = (float*)ptr->data;
values[0]= vec[0]; values[0] = vec[0];
values[1]= vec[1]; values[1] = vec[1];
values[2]= vec[2]; values[2] = vec[2];
} }
static void rna_ShapeKeyPoint_co_set(PointerRNA *ptr, const float *values) static void rna_ShapeKeyPoint_co_set(PointerRNA *ptr, const float *values)
{ {
float *vec= (float*)ptr->data; float *vec = (float*)ptr->data;
vec[0]= values[0]; vec[0] = values[0];
vec[1]= values[1]; vec[1] = values[1];
vec[2]= values[2]; vec[2] = values[2];
} }
static float rna_ShapeKeyCurvePoint_tilt_get(PointerRNA *ptr) static float rna_ShapeKeyCurvePoint_tilt_get(PointerRNA *ptr)
{ {
float *vec= (float*)ptr->data; float *vec = (float*)ptr->data;
return vec[3]; return vec[3];
} }
static void rna_ShapeKeyCurvePoint_tilt_set(PointerRNA *ptr, float value) static void rna_ShapeKeyCurvePoint_tilt_set(PointerRNA *ptr, float value)
{ {
float *vec= (float*)ptr->data; float *vec = (float*)ptr->data;
vec[3]= value; vec[3] = value;
} }
static void rna_ShapeKeyBezierPoint_co_get(PointerRNA *ptr, float *values) static void rna_ShapeKeyBezierPoint_co_get(PointerRNA *ptr, float *values)
{ {
float *vec= (float*)ptr->data; float *vec = (float*)ptr->data;
values[0]= vec[0+3]; values[0] = vec[0+3];
values[1]= vec[1+3]; values[1] = vec[1+3];
values[2]= vec[2+3]; values[2] = vec[2+3];
} }
static void rna_ShapeKeyBezierPoint_co_set(PointerRNA *ptr, const float *values) static void rna_ShapeKeyBezierPoint_co_set(PointerRNA *ptr, const float *values)
{ {
float *vec= (float*)ptr->data; float *vec = (float*)ptr->data;
vec[0+3]= values[0]; vec[0+3] = values[0];
vec[1+3]= values[1]; vec[1+3] = values[1];
vec[2+3]= values[2]; vec[2+3] = values[2];
} }
static void rna_ShapeKeyBezierPoint_handle_1_co_get(PointerRNA *ptr, float *values) static void rna_ShapeKeyBezierPoint_handle_1_co_get(PointerRNA *ptr, float *values)
{ {
float *vec= (float*)ptr->data; float *vec = (float*)ptr->data;
values[0]= vec[0]; values[0] = vec[0];
values[1]= vec[1]; values[1] = vec[1];
values[2]= vec[2]; values[2] = vec[2];
} }
static void rna_ShapeKeyBezierPoint_handle_1_co_set(PointerRNA *ptr, const float *values) static void rna_ShapeKeyBezierPoint_handle_1_co_set(PointerRNA *ptr, const float *values)
{ {
float *vec= (float*)ptr->data; float *vec = (float*)ptr->data;
vec[0]= values[0]; vec[0] = values[0];
vec[1]= values[1]; vec[1] = values[1];
vec[2]= values[2]; vec[2] = values[2];
} }
static void rna_ShapeKeyBezierPoint_handle_2_co_get(PointerRNA *ptr, float *values) static void rna_ShapeKeyBezierPoint_handle_2_co_get(PointerRNA *ptr, float *values)
{ {
float *vec= (float*)ptr->data; float *vec = (float*)ptr->data;
values[0]= vec[6+0]; values[0] = vec[6+0];
values[1]= vec[6+1]; values[1] = vec[6+1];
values[2]= vec[6+2]; values[2] = vec[6+2];
} }
static void rna_ShapeKeyBezierPoint_handle_2_co_set(PointerRNA *ptr, const float *values) static void rna_ShapeKeyBezierPoint_handle_2_co_set(PointerRNA *ptr, const float *values)
{ {
float *vec= (float*)ptr->data; float *vec = (float*)ptr->data;
vec[6+0]= values[0]; vec[6+0] = values[0];
vec[6+1]= values[1]; vec[6+1] = values[1];
vec[6+2]= values[2]; vec[6+2] = values[2];
} }
/*static float rna_ShapeKeyBezierPoint_tilt_get(PointerRNA *ptr) /*static float rna_ShapeKeyBezierPoint_tilt_get(PointerRNA *ptr)
@@ -280,17 +280,17 @@ static void rna_ShapeKeyBezierPoint_tilt_set(PointerRNA *ptr, float value)
static void rna_ShapeKey_data_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) static void rna_ShapeKey_data_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{ {
Key *key= rna_ShapeKey_find_key(ptr->id.data); Key *key = rna_ShapeKey_find_key(ptr->id.data);
KeyBlock *kb= (KeyBlock*)ptr->data; KeyBlock *kb = (KeyBlock*)ptr->data;
Curve *cu; Curve *cu;
Nurb *nu; Nurb *nu;
int tot= kb->totelem, size= key->elemsize; int tot = kb->totelem, size = key->elemsize;
if(GS(key->from->name) == ID_CU) { if (GS(key->from->name) == ID_CU) {
cu= (Curve*)key->from; cu = (Curve*)key->from;
nu= cu->nurb.first; nu = cu->nurb.first;
if(nu->bezt) { if (nu->bezt) {
tot /= 3; tot /= 3;
size *= 3; size *= 3;
} }
@@ -301,17 +301,17 @@ static void rna_ShapeKey_data_begin(CollectionPropertyIterator *iter, PointerRNA
static int rna_ShapeKey_data_length(PointerRNA *ptr) static int rna_ShapeKey_data_length(PointerRNA *ptr)
{ {
Key *key= rna_ShapeKey_find_key(ptr->id.data); Key *key = rna_ShapeKey_find_key(ptr->id.data);
KeyBlock *kb= (KeyBlock*)ptr->data; KeyBlock *kb = (KeyBlock*)ptr->data;
Curve *cu; Curve *cu;
Nurb *nu; Nurb *nu;
int tot= kb->totelem; int tot = kb->totelem;
if(GS(key->from->name) == ID_CU) { if (GS(key->from->name) == ID_CU) {
cu= (Curve*)key->from; cu = (Curve*)key->from;
nu= cu->nurb.first; nu = cu->nurb.first;
if(nu->bezt) if (nu->bezt)
tot /= 3; tot /= 3;
} }
@@ -320,30 +320,30 @@ static int rna_ShapeKey_data_length(PointerRNA *ptr)
static PointerRNA rna_ShapeKey_data_get(CollectionPropertyIterator *iter) static PointerRNA rna_ShapeKey_data_get(CollectionPropertyIterator *iter)
{ {
Key *key= rna_ShapeKey_find_key(iter->parent.id.data); Key *key = rna_ShapeKey_find_key(iter->parent.id.data);
StructRNA *type; StructRNA *type;
Curve *cu; Curve *cu;
Nurb *nu; Nurb *nu;
if(GS(key->from->name) == ID_CU) { if (GS(key->from->name) == ID_CU) {
cu= (Curve*)key->from; cu = (Curve*)key->from;
nu= cu->nurb.first; nu = cu->nurb.first;
if(nu->bezt) if (nu->bezt)
type= &RNA_ShapeKeyBezierPoint; type = &RNA_ShapeKeyBezierPoint;
else else
type= &RNA_ShapeKeyCurvePoint; type = &RNA_ShapeKeyCurvePoint;
} }
else else
type= &RNA_ShapeKeyPoint; type = &RNA_ShapeKeyPoint;
return rna_pointer_inherit_refine(&iter->parent, type, rna_iterator_array_get(iter)); return rna_pointer_inherit_refine(&iter->parent, type, rna_iterator_array_get(iter));
} }
static char *rna_ShapeKey_path(PointerRNA *ptr) static char *rna_ShapeKey_path(PointerRNA *ptr)
{ {
KeyBlock *kb= (KeyBlock *)ptr->data; KeyBlock *kb = (KeyBlock *)ptr->data;
ID *id= ptr->id.data; ID *id = ptr->id.data;
if ((id) && (GS(id->name) != ID_KE)) if ((id) && (GS(id->name) != ID_KE))
return BLI_sprintfN("shape_keys.key_blocks[\"%s\"]", kb->name); return BLI_sprintfN("shape_keys.key_blocks[\"%s\"]", kb->name);
@@ -353,11 +353,11 @@ static char *rna_ShapeKey_path(PointerRNA *ptr)
static void rna_Key_update_data(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) static void rna_Key_update_data(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
{ {
Key *key= ptr->id.data; Key *key = ptr->id.data;
Object *ob; Object *ob;
for(ob=bmain->object.first; ob; ob= ob->id.next) { for (ob = bmain->object.first; ob; ob = ob->id.next) {
if(ob_get_key(ob) == key) { if (ob_get_key(ob) == key) {
DAG_id_tag_update(&ob->id, OB_RECALC_DATA); DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
WM_main_add_notifier(NC_OBJECT|ND_MODIFIER, ob); WM_main_add_notifier(NC_OBJECT|ND_MODIFIER, ob);
} }
@@ -437,7 +437,7 @@ static char *rna_ShapeKeyPoint_path(PointerRNA *ptr)
return BLI_sprintfN("shape_keys.key_blocks[\"%s\"].data[%d]", kb->name, index); return BLI_sprintfN("shape_keys.key_blocks[\"%s\"].data[%d]", kb->name, index);
} }
else else
return NULL; // XXX: there's really no way to resolve this... return NULL; /* XXX: there's really no way to resolve this... */
} }
#else #else
@@ -447,48 +447,48 @@ static void rna_def_keydata(BlenderRNA *brna)
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
srna= RNA_def_struct(brna, "ShapeKeyPoint", NULL); srna = RNA_def_struct(brna, "ShapeKeyPoint", NULL);
RNA_def_struct_ui_text(srna, "Shape Key Point", "Point in a shape key"); RNA_def_struct_ui_text(srna, "Shape Key Point", "Point in a shape key");
RNA_def_struct_path_func(srna, "rna_ShapeKeyPoint_path"); RNA_def_struct_path_func(srna, "rna_ShapeKeyPoint_path");
prop= RNA_def_property(srna, "co", PROP_FLOAT, PROP_TRANSLATION); prop = RNA_def_property(srna, "co", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_array(prop, 3); RNA_def_property_array(prop, 3);
RNA_def_property_float_funcs(prop, "rna_ShapeKeyPoint_co_get", "rna_ShapeKeyPoint_co_set", NULL); RNA_def_property_float_funcs(prop, "rna_ShapeKeyPoint_co_get", "rna_ShapeKeyPoint_co_set", NULL);
RNA_def_property_ui_text(prop, "Location", ""); RNA_def_property_ui_text(prop, "Location", "");
RNA_def_property_update(prop, 0, "rna_Key_update_data"); RNA_def_property_update(prop, 0, "rna_Key_update_data");
srna= RNA_def_struct(brna, "ShapeKeyCurvePoint", NULL); srna = RNA_def_struct(brna, "ShapeKeyCurvePoint", NULL);
RNA_def_struct_ui_text(srna, "Shape Key Curve Point", "Point in a shape key for curves"); RNA_def_struct_ui_text(srna, "Shape Key Curve Point", "Point in a shape key for curves");
RNA_def_struct_path_func(srna, "rna_ShapeKeyPoint_path"); /* there's nothing type specific here, so this is fine for now */ RNA_def_struct_path_func(srna, "rna_ShapeKeyPoint_path"); /* there's nothing type specific here, so this is fine for now */
prop= RNA_def_property(srna, "co", PROP_FLOAT, PROP_TRANSLATION); prop = RNA_def_property(srna, "co", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_array(prop, 3); RNA_def_property_array(prop, 3);
RNA_def_property_float_funcs(prop, "rna_ShapeKeyPoint_co_get", "rna_ShapeKeyPoint_co_set", NULL); RNA_def_property_float_funcs(prop, "rna_ShapeKeyPoint_co_get", "rna_ShapeKeyPoint_co_set", NULL);
RNA_def_property_ui_text(prop, "Location", ""); RNA_def_property_ui_text(prop, "Location", "");
RNA_def_property_update(prop, 0, "rna_Key_update_data"); RNA_def_property_update(prop, 0, "rna_Key_update_data");
prop= RNA_def_property(srna, "tilt", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "tilt", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_funcs(prop, "rna_ShapeKeyCurvePoint_tilt_get", "rna_ShapeKeyCurvePoint_tilt_set", NULL); RNA_def_property_float_funcs(prop, "rna_ShapeKeyCurvePoint_tilt_get", "rna_ShapeKeyCurvePoint_tilt_set", NULL);
RNA_def_property_ui_text(prop, "Tilt", ""); RNA_def_property_ui_text(prop, "Tilt", "");
RNA_def_property_update(prop, 0, "rna_Key_update_data"); RNA_def_property_update(prop, 0, "rna_Key_update_data");
srna= RNA_def_struct(brna, "ShapeKeyBezierPoint", NULL); srna = RNA_def_struct(brna, "ShapeKeyBezierPoint", NULL);
RNA_def_struct_ui_text(srna, "Shape Key Bezier Point", "Point in a shape key for Bezier curves"); RNA_def_struct_ui_text(srna, "Shape Key Bezier Point", "Point in a shape key for Bezier curves");
RNA_def_struct_path_func(srna, "rna_ShapeKeyPoint_path"); /* there's nothing type specific here, so this is fine for now */ RNA_def_struct_path_func(srna, "rna_ShapeKeyPoint_path"); /* there's nothing type specific here, so this is fine for now */
prop= RNA_def_property(srna, "co", PROP_FLOAT, PROP_TRANSLATION); prop = RNA_def_property(srna, "co", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_array(prop, 3); RNA_def_property_array(prop, 3);
RNA_def_property_float_funcs(prop, "rna_ShapeKeyBezierPoint_co_get", "rna_ShapeKeyBezierPoint_co_set", NULL); RNA_def_property_float_funcs(prop, "rna_ShapeKeyBezierPoint_co_get", "rna_ShapeKeyBezierPoint_co_set", NULL);
RNA_def_property_ui_text(prop, "Location", ""); RNA_def_property_ui_text(prop, "Location", "");
RNA_def_property_update(prop, 0, "rna_Key_update_data"); RNA_def_property_update(prop, 0, "rna_Key_update_data");
prop= RNA_def_property(srna, "handle_left", PROP_FLOAT, PROP_TRANSLATION); prop = RNA_def_property(srna, "handle_left", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_array(prop, 3); RNA_def_property_array(prop, 3);
RNA_def_property_float_funcs(prop, "rna_ShapeKeyBezierPoint_handle_1_co_get", "rna_ShapeKeyBezierPoint_handle_1_co_set", NULL); RNA_def_property_float_funcs(prop, "rna_ShapeKeyBezierPoint_handle_1_co_get", "rna_ShapeKeyBezierPoint_handle_1_co_set", NULL);
RNA_def_property_ui_text(prop, "Handle 1 Location", ""); RNA_def_property_ui_text(prop, "Handle 1 Location", "");
RNA_def_property_update(prop, 0, "rna_Key_update_data"); RNA_def_property_update(prop, 0, "rna_Key_update_data");
prop= RNA_def_property(srna, "handle_right", PROP_FLOAT, PROP_TRANSLATION); prop = RNA_def_property(srna, "handle_right", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_array(prop, 3); RNA_def_property_array(prop, 3);
RNA_def_property_float_funcs(prop, "rna_ShapeKeyBezierPoint_handle_2_co_get", "rna_ShapeKeyBezierPoint_handle_2_co_set", NULL); RNA_def_property_float_funcs(prop, "rna_ShapeKeyBezierPoint_handle_2_co_get", "rna_ShapeKeyBezierPoint_handle_2_co_set", NULL);
RNA_def_property_ui_text(prop, "Handle 2 Location", ""); RNA_def_property_ui_text(prop, "Handle 2 Location", "");
@@ -512,70 +512,70 @@ static void rna_def_keyblock(BlenderRNA *brna)
{KEY_BSPLINE, "KEY_BSPLINE", 0, "BSpline", ""}, {KEY_BSPLINE, "KEY_BSPLINE", 0, "BSpline", ""},
{0, NULL, 0, NULL, NULL}}; {0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "ShapeKey", NULL); srna = RNA_def_struct(brna, "ShapeKey", NULL);
RNA_def_struct_ui_text(srna, "Shape Key", "Shape key in a shape keys datablock"); RNA_def_struct_ui_text(srna, "Shape Key", "Shape key in a shape keys datablock");
RNA_def_struct_sdna(srna, "KeyBlock"); RNA_def_struct_sdna(srna, "KeyBlock");
RNA_def_struct_path_func(srna, "rna_ShapeKey_path"); RNA_def_struct_path_func(srna, "rna_ShapeKey_path");
RNA_def_struct_ui_icon(srna, ICON_SHAPEKEY_DATA); RNA_def_struct_ui_icon(srna, ICON_SHAPEKEY_DATA);
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Name", "Name of Shape Key"); RNA_def_property_ui_text(prop, "Name", "Name of Shape Key");
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_ShapeKey_name_set"); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_ShapeKey_name_set");
RNA_def_struct_name_property(srna, prop); RNA_def_struct_name_property(srna, prop);
/* keys need to be sorted to edit this */ /* keys need to be sorted to edit this */
prop= RNA_def_property(srna, "frame", PROP_FLOAT, PROP_TIME); prop = RNA_def_property(srna, "frame", PROP_FLOAT, PROP_TIME);
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_float_sdna(prop, NULL, "pos"); RNA_def_property_float_sdna(prop, NULL, "pos");
RNA_def_property_ui_text(prop, "Frame", "Frame for absolute keys"); RNA_def_property_ui_text(prop, "Frame", "Frame for absolute keys");
RNA_def_property_update(prop, 0, "rna_Key_update_data"); RNA_def_property_update(prop, 0, "rna_Key_update_data");
/* for now, this is editable directly, as users can set this even if they're not animating them (to test results) */ /* for now, this is editable directly, as users can set this even if they're not animating them (to test results) */
prop= RNA_def_property(srna, "value", PROP_FLOAT, PROP_FACTOR); prop = RNA_def_property(srna, "value", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "curval"); RNA_def_property_float_sdna(prop, NULL, "curval");
RNA_def_property_float_funcs(prop, NULL, "rna_ShapeKey_value_set", "rna_ShapeKey_value_range"); RNA_def_property_float_funcs(prop, NULL, "rna_ShapeKey_value_set", "rna_ShapeKey_value_range");
RNA_def_property_ui_range(prop, -10.0f, 10.0f, 10, 3); RNA_def_property_ui_range(prop, -10.0f, 10.0f, 10, 3);
RNA_def_property_ui_text(prop, "Value", "Value of shape key at the current frame"); RNA_def_property_ui_text(prop, "Value", "Value of shape key at the current frame");
RNA_def_property_update(prop, 0, "rna_Key_update_data"); RNA_def_property_update(prop, 0, "rna_Key_update_data");
prop= RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "type"); RNA_def_property_enum_sdna(prop, NULL, "type");
RNA_def_property_enum_items(prop, prop_keyblock_type_items); RNA_def_property_enum_items(prop, prop_keyblock_type_items);
RNA_def_property_ui_text(prop, "Interpolation", "Interpolation type"); RNA_def_property_ui_text(prop, "Interpolation", "Interpolation type");
RNA_def_property_update(prop, 0, "rna_Key_update_data"); RNA_def_property_update(prop, 0, "rna_Key_update_data");
prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE); prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "vgroup"); RNA_def_property_string_sdna(prop, NULL, "vgroup");
RNA_def_property_ui_text(prop, "Vertex Group", "Vertex weight group, to blend with basis shape"); RNA_def_property_ui_text(prop, "Vertex Group", "Vertex weight group, to blend with basis shape");
RNA_def_property_update(prop, 0, "rna_Key_update_data"); RNA_def_property_update(prop, 0, "rna_Key_update_data");
prop= RNA_def_property(srna, "relative_key", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "relative_key", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "ShapeKey"); RNA_def_property_struct_type(prop, "ShapeKey");
RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_pointer_funcs(prop, "rna_ShapeKey_relative_key_get", "rna_ShapeKey_relative_key_set", NULL, NULL); RNA_def_property_pointer_funcs(prop, "rna_ShapeKey_relative_key_get", "rna_ShapeKey_relative_key_set", NULL, NULL);
RNA_def_property_ui_text(prop, "Relative Key", "Shape used as a relative key"); RNA_def_property_ui_text(prop, "Relative Key", "Shape used as a relative key");
RNA_def_property_update(prop, 0, "rna_Key_update_data"); RNA_def_property_update(prop, 0, "rna_Key_update_data");
prop= RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", KEYBLOCK_MUTE); RNA_def_property_boolean_sdna(prop, NULL, "flag", KEYBLOCK_MUTE);
RNA_def_property_ui_text(prop, "Mute", "Mute this shape key"); RNA_def_property_ui_text(prop, "Mute", "Mute this shape key");
RNA_def_property_ui_icon(prop, ICON_RESTRICT_VIEW_OFF, 1); RNA_def_property_ui_icon(prop, ICON_RESTRICT_VIEW_OFF, 1);
RNA_def_property_update(prop, 0, "rna_Key_update_data"); RNA_def_property_update(prop, 0, "rna_Key_update_data");
prop= RNA_def_property(srna, "slider_min", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "slider_min", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "slidermin"); RNA_def_property_float_sdna(prop, NULL, "slidermin");
RNA_def_property_range(prop, -10.0f, 10.0f); RNA_def_property_range(prop, -10.0f, 10.0f);
RNA_def_property_float_funcs(prop, NULL, "rna_ShapeKey_slider_min_set", "rna_ShapeKey_slider_min_range"); RNA_def_property_float_funcs(prop, NULL, "rna_ShapeKey_slider_min_set", "rna_ShapeKey_slider_min_range");
RNA_def_property_ui_text(prop, "Slider Min", "Minimum for slider"); RNA_def_property_ui_text(prop, "Slider Min", "Minimum for slider");
prop= RNA_def_property(srna, "slider_max", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "slider_max", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "slidermax"); RNA_def_property_float_sdna(prop, NULL, "slidermax");
RNA_def_property_range(prop, -10.0f, 10.0f); RNA_def_property_range(prop, -10.0f, 10.0f);
RNA_def_property_float_default(prop, 1.0f); RNA_def_property_float_default(prop, 1.0f);
RNA_def_property_float_funcs(prop, NULL, "rna_ShapeKey_slider_max_set", "rna_ShapeKey_slider_max_range"); RNA_def_property_float_funcs(prop, NULL, "rna_ShapeKey_slider_max_set", "rna_ShapeKey_slider_max_range");
RNA_def_property_ui_text(prop, "Slider Max", "Maximum for slider"); RNA_def_property_ui_text(prop, "Slider Max", "Maximum for slider");
prop= RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE); prop = RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "data", "totelem"); RNA_def_property_collection_sdna(prop, NULL, "data", "totelem");
RNA_def_property_struct_type(prop, "UnknownType"); RNA_def_property_struct_type(prop, "UnknownType");
RNA_def_property_ui_text(prop, "Data", ""); RNA_def_property_ui_text(prop, "Data", "");
@@ -587,34 +587,34 @@ static void rna_def_key(BlenderRNA *brna)
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
srna= RNA_def_struct(brna, "Key", "ID"); srna = RNA_def_struct(brna, "Key", "ID");
RNA_def_struct_ui_text(srna, "Key", "Shape keys datablock containing different shapes of geometric datablocks"); RNA_def_struct_ui_text(srna, "Key", "Shape keys datablock containing different shapes of geometric datablocks");
RNA_def_struct_ui_icon(srna, ICON_SHAPEKEY_DATA); RNA_def_struct_ui_icon(srna, ICON_SHAPEKEY_DATA);
prop= RNA_def_property(srna, "reference_key", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "reference_key", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_pointer_sdna(prop, NULL, "refkey"); RNA_def_property_pointer_sdna(prop, NULL, "refkey");
RNA_def_property_ui_text(prop, "Reference Key", ""); RNA_def_property_ui_text(prop, "Reference Key", "");
prop= RNA_def_property(srna, "key_blocks", PROP_COLLECTION, PROP_NONE); prop = RNA_def_property(srna, "key_blocks", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "block", NULL); RNA_def_property_collection_sdna(prop, NULL, "block", NULL);
RNA_def_property_struct_type(prop, "ShapeKey"); RNA_def_property_struct_type(prop, "ShapeKey");
RNA_def_property_ui_text(prop, "Key Blocks", "Shape keys"); RNA_def_property_ui_text(prop, "Key Blocks", "Shape keys");
rna_def_animdata_common(srna); rna_def_animdata_common(srna);
prop= RNA_def_property(srna, "user", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "user", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "from"); RNA_def_property_pointer_sdna(prop, NULL, "from");
RNA_def_property_ui_text(prop, "User", "Datablock using these shape keys"); RNA_def_property_ui_text(prop, "User", "Datablock using these shape keys");
prop= RNA_def_property(srna, "use_relative", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_relative", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "type", KEY_RELATIVE); RNA_def_property_boolean_sdna(prop, NULL, "type", KEY_RELATIVE);
RNA_def_property_ui_text(prop, "Relative", "Make shape keys relative"); RNA_def_property_ui_text(prop, "Relative", "Make shape keys relative");
RNA_def_property_update(prop, 0, "rna_Key_update_data"); RNA_def_property_update(prop, 0, "rna_Key_update_data");
prop= RNA_def_property(srna, "slurph", PROP_INT, PROP_UNSIGNED); prop = RNA_def_property(srna, "slurph", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "slurph"); RNA_def_property_int_sdna(prop, NULL, "slurph");
RNA_def_property_range(prop, -500, 500); RNA_def_property_range(prop, -500, 500);
RNA_def_property_ui_text(prop, "Slurph", "Create a delay (in frames) in applying keypositions, first vertex goes first"); RNA_def_property_ui_text(prop, "Slurph", "Create a delay (in frames) in applying keypositions, first vertex goes first");

View File

@@ -52,10 +52,10 @@
static void rna_Lamp_buffer_size_set(PointerRNA *ptr, int value) static void rna_Lamp_buffer_size_set(PointerRNA *ptr, int value)
{ {
Lamp *la= (Lamp*)ptr->data; Lamp *la = (Lamp*)ptr->data;
CLAMP(value, 512, 10240); CLAMP(value, 512, 10240);
la->bufsize= value; la->bufsize = value;
la->bufsize &= (~15); /* round to multiple of 16 */ la->bufsize &= (~15); /* round to multiple of 16 */
} }
@@ -66,31 +66,31 @@ static PointerRNA rna_Lamp_sky_settings_get(PointerRNA *ptr)
static void rna_Lamp_mtex_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) static void rna_Lamp_mtex_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{ {
Lamp *la= (Lamp*)ptr->data; Lamp *la = (Lamp*)ptr->data;
rna_iterator_array_begin(iter, (void*)la->mtex, sizeof(MTex*), MAX_MTEX, 0, NULL); rna_iterator_array_begin(iter, (void*)la->mtex, sizeof(MTex*), MAX_MTEX, 0, NULL);
} }
static PointerRNA rna_Lamp_active_texture_get(PointerRNA *ptr) static PointerRNA rna_Lamp_active_texture_get(PointerRNA *ptr)
{ {
Lamp *la= (Lamp*)ptr->data; Lamp *la = (Lamp*)ptr->data;
Tex *tex; Tex *tex;
tex= give_current_lamp_texture(la); tex = give_current_lamp_texture(la);
return rna_pointer_inherit_refine(ptr, &RNA_Texture, tex); return rna_pointer_inherit_refine(ptr, &RNA_Texture, tex);
} }
static void rna_Lamp_active_texture_set(PointerRNA *ptr, PointerRNA value) static void rna_Lamp_active_texture_set(PointerRNA *ptr, PointerRNA value)
{ {
Lamp *la= (Lamp*)ptr->data; Lamp *la = (Lamp*)ptr->data;
set_current_lamp_texture(la, value.data); set_current_lamp_texture(la, value.data);
} }
static StructRNA* rna_Lamp_refine(struct PointerRNA *ptr) static StructRNA* rna_Lamp_refine(struct PointerRNA *ptr)
{ {
Lamp *la= (Lamp*)ptr->data; Lamp *la = (Lamp*)ptr->data;
switch(la->type) { switch (la->type) {
case LA_LOCAL: case LA_LOCAL:
return &RNA_PointLamp; return &RNA_PointLamp;
case LA_SUN: case LA_SUN:
@@ -108,10 +108,10 @@ static StructRNA* rna_Lamp_refine(struct PointerRNA *ptr)
static void rna_Lamp_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr) static void rna_Lamp_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr)
{ {
Lamp *la= ptr->id.data; Lamp *la = ptr->id.data;
DAG_id_tag_update(&la->id, 0); DAG_id_tag_update(&la->id, 0);
if(scene->gm.matmode == GAME_MAT_GLSL) if (scene->gm.matmode == GAME_MAT_GLSL)
WM_main_add_notifier(NC_LAMP|ND_LIGHTING_DRAW, la); WM_main_add_notifier(NC_LAMP|ND_LIGHTING_DRAW, la);
else else
WM_main_add_notifier(NC_LAMP|ND_LIGHTING, la); WM_main_add_notifier(NC_LAMP|ND_LIGHTING, la);
@@ -119,7 +119,7 @@ static void rna_Lamp_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr)
static void rna_Lamp_draw_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) static void rna_Lamp_draw_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{ {
Lamp *la= ptr->id.data; Lamp *la = ptr->id.data;
DAG_id_tag_update(&la->id, 0); DAG_id_tag_update(&la->id, 0);
WM_main_add_notifier(NC_LAMP|ND_LIGHTING_DRAW, la); WM_main_add_notifier(NC_LAMP|ND_LIGHTING_DRAW, la);
@@ -127,7 +127,7 @@ static void rna_Lamp_draw_update(Main *UNUSED(bmain), Scene *UNUSED(scene), Poin
static void rna_Lamp_sky_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) static void rna_Lamp_sky_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{ {
Lamp *la= ptr->id.data; Lamp *la = ptr->id.data;
DAG_id_tag_update(&la->id, 0); DAG_id_tag_update(&la->id, 0);
WM_main_add_notifier(NC_LAMP|ND_SKY, la); WM_main_add_notifier(NC_LAMP|ND_SKY, la);
@@ -136,21 +136,21 @@ static void rna_Lamp_sky_update(Main *UNUSED(bmain), Scene *UNUSED(scene), Point
/* only for rad/deg conversion! can remove later */ /* only for rad/deg conversion! can remove later */
static float rna_Lamp_spot_size_get(PointerRNA *ptr) static float rna_Lamp_spot_size_get(PointerRNA *ptr)
{ {
Lamp *la= ptr->id.data; Lamp *la = ptr->id.data;
return DEG2RADF(la->spotsize); return DEG2RADF(la->spotsize);
} }
static void rna_Lamp_spot_size_set(PointerRNA *ptr, float value) static void rna_Lamp_spot_size_set(PointerRNA *ptr, float value)
{ {
Lamp *la= ptr->id.data; Lamp *la = ptr->id.data;
la->spotsize= RAD2DEGF(value); la->spotsize = RAD2DEGF(value);
} }
static void rna_Lamp_use_nodes_update(Main *blain, Scene *scene, PointerRNA *ptr) static void rna_Lamp_use_nodes_update(Main *blain, Scene *scene, PointerRNA *ptr)
{ {
Lamp *la= (Lamp*)ptr->data; Lamp *la = (Lamp*)ptr->data;
if(la->use_nodes && la->nodetree==NULL) if (la->use_nodes && la->nodetree == NULL)
ED_node_shader_default(scene, &la->id); ED_node_shader_default(scene, &la->id);
rna_Lamp_update(blain, scene, ptr); rna_Lamp_update(blain, scene, ptr);
@@ -177,38 +177,38 @@ static void rna_def_lamp_mtex(BlenderRNA *brna)
{TEXCO_OBJECT, "OBJECT", 0, "Object", "Use linked object's coordinates for texture coordinates"}, {TEXCO_OBJECT, "OBJECT", 0, "Object", "Use linked object's coordinates for texture coordinates"},
{0, NULL, 0, NULL, NULL}}; {0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "LampTextureSlot", "TextureSlot"); srna = RNA_def_struct(brna, "LampTextureSlot", "TextureSlot");
RNA_def_struct_sdna(srna, "MTex"); RNA_def_struct_sdna(srna, "MTex");
RNA_def_struct_ui_text(srna, "Lamp Texture Slot", "Texture slot for textures in a Lamp datablock"); RNA_def_struct_ui_text(srna, "Lamp Texture Slot", "Texture slot for textures in a Lamp datablock");
prop= RNA_def_property(srna, "texture_coords", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "texture_coords", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "texco"); RNA_def_property_enum_sdna(prop, NULL, "texco");
RNA_def_property_enum_items(prop, prop_texture_coordinates_items); RNA_def_property_enum_items(prop, prop_texture_coordinates_items);
RNA_def_property_ui_text(prop, "Texture Coordinates", ""); RNA_def_property_ui_text(prop, "Texture Coordinates", "");
prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "object"); RNA_def_property_pointer_sdna(prop, NULL, "object");
RNA_def_property_struct_type(prop, "Object"); RNA_def_property_struct_type(prop, "Object");
RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Object", "Object to use for mapping with Object texture coordinates"); RNA_def_property_ui_text(prop, "Object", "Object to use for mapping with Object texture coordinates");
prop= RNA_def_property(srna, "use_map_color", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_map_color", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", LAMAP_COL); RNA_def_property_boolean_sdna(prop, NULL, "mapto", LAMAP_COL);
RNA_def_property_ui_text(prop, "Color", "Let the texture affect the basic color of the lamp"); RNA_def_property_ui_text(prop, "Color", "Let the texture affect the basic color of the lamp");
RNA_def_property_update(prop, 0, "rna_Lamp_update"); RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "use_map_shadow", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_map_shadow", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", LAMAP_SHAD); RNA_def_property_boolean_sdna(prop, NULL, "mapto", LAMAP_SHAD);
RNA_def_property_ui_text(prop, "Shadow", "Let the texture affect the shadow color of the lamp"); RNA_def_property_ui_text(prop, "Shadow", "Let the texture affect the shadow color of the lamp");
RNA_def_property_update(prop, 0, "rna_Lamp_update"); RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "color_factor", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "color_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "colfac"); RNA_def_property_float_sdna(prop, NULL, "colfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3); RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Color Factor", "Amount texture affects color values"); RNA_def_property_ui_text(prop, "Color Factor", "Amount texture affects color values");
RNA_def_property_update(prop, 0, "rna_Lamp_update"); RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "shadow_factor", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "shadow_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "shadowfac"); RNA_def_property_float_sdna(prop, NULL, "shadowfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3); RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Shadow Factor", "Amount texture affects shadow"); RNA_def_property_ui_text(prop, "Shadow Factor", "Amount texture affects shadow");
@@ -226,18 +226,18 @@ static void rna_def_lamp_sky_settings(BlenderRNA *brna)
{2, "CIE", 0, "CIE", ""}, {2, "CIE", 0, "CIE", ""},
{0, NULL, 0, NULL, NULL}}; {0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "LampSkySettings", NULL); srna = RNA_def_struct(brna, "LampSkySettings", NULL);
RNA_def_struct_sdna(srna, "Lamp"); RNA_def_struct_sdna(srna, "Lamp");
RNA_def_struct_nested(brna, srna, "SunLamp"); RNA_def_struct_nested(brna, srna, "SunLamp");
RNA_def_struct_ui_text(srna, "Lamp Sky Settings", "Sky related settings for a sun lamp"); RNA_def_struct_ui_text(srna, "Lamp Sky Settings", "Sky related settings for a sun lamp");
prop= RNA_def_property(srna, "sky_color_space", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "sky_color_space", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "sky_colorspace"); RNA_def_property_enum_sdna(prop, NULL, "sky_colorspace");
RNA_def_property_enum_items(prop, prop_skycolorspace_items); RNA_def_property_enum_items(prop, prop_skycolorspace_items);
RNA_def_property_ui_text(prop, "Sky Color Space", "Color space to use for internal XYZ->RGB color conversion"); RNA_def_property_ui_text(prop, "Sky Color Space", "Color space to use for internal XYZ->RGB color conversion");
RNA_def_property_update(prop, 0, "rna_Lamp_sky_update"); RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
prop= RNA_def_property(srna, "sky_blend_type", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "sky_blend_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "skyblendtype"); RNA_def_property_enum_sdna(prop, NULL, "skyblendtype");
RNA_def_property_enum_items(prop, ramp_blend_items); RNA_def_property_enum_items(prop, ramp_blend_items);
RNA_def_property_ui_text(prop, "Sky Blend Mode", "Blend mode for combining sun sky with world sky"); RNA_def_property_ui_text(prop, "Sky Blend Mode", "Blend mode for combining sun sky with world sky");
@@ -245,80 +245,80 @@ static void rna_def_lamp_sky_settings(BlenderRNA *brna)
/* Number values */ /* Number values */
prop= RNA_def_property(srna, "horizon_brightness", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "horizon_brightness", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 20.0f); RNA_def_property_range(prop, 0.0f, 20.0f);
RNA_def_property_ui_text(prop, "Horizon Brightness", "Horizon brightness"); RNA_def_property_ui_text(prop, "Horizon Brightness", "Horizon brightness");
RNA_def_property_update(prop, 0, "rna_Lamp_sky_update"); RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
prop= RNA_def_property(srna, "spread", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "spread", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 10.0f); RNA_def_property_range(prop, 0.0f, 10.0f);
RNA_def_property_ui_text(prop, "Horizon Spread", "Horizon Spread"); RNA_def_property_ui_text(prop, "Horizon Spread", "Horizon Spread");
RNA_def_property_update(prop, 0, "rna_Lamp_sky_update"); RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
prop= RNA_def_property(srna, "sun_brightness", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "sun_brightness", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 10.0f); RNA_def_property_range(prop, 0.0f, 10.0f);
RNA_def_property_ui_text(prop, "Sun Brightness", "Sun brightness"); RNA_def_property_ui_text(prop, "Sun Brightness", "Sun brightness");
RNA_def_property_update(prop, 0, "rna_Lamp_sky_update"); RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
prop= RNA_def_property(srna, "sun_size", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "sun_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 10.0f); RNA_def_property_range(prop, 0.0f, 10.0f);
RNA_def_property_ui_text(prop, "Sun Size", "Sun size"); RNA_def_property_ui_text(prop, "Sun Size", "Sun size");
RNA_def_property_update(prop, 0, "rna_Lamp_sky_update"); RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
prop= RNA_def_property(srna, "backscattered_light", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "backscattered_light", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, -1.0f, 1.0f); RNA_def_property_range(prop, -1.0f, 1.0f);
RNA_def_property_ui_text(prop, "Backscattered Light", "Backscattered light"); RNA_def_property_ui_text(prop, "Backscattered Light", "Backscattered light");
RNA_def_property_update(prop, 0, "rna_Lamp_sky_update"); RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
prop= RNA_def_property(srna, "sun_intensity", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "sun_intensity", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 10.0f); RNA_def_property_range(prop, 0.0f, 10.0f);
RNA_def_property_ui_text(prop, "Sun Intensity", "Sun intensity"); RNA_def_property_ui_text(prop, "Sun Intensity", "Sun intensity");
RNA_def_property_update(prop, 0, "rna_Lamp_sky_update"); RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
prop= RNA_def_property(srna, "atmosphere_turbidity", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "atmosphere_turbidity", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "atm_turbidity"); RNA_def_property_float_sdna(prop, NULL, "atm_turbidity");
RNA_def_property_range(prop, 1.0f, 30.0f); RNA_def_property_range(prop, 1.0f, 30.0f);
RNA_def_property_ui_range(prop, 2.0f, 10.0f, 1, 2); RNA_def_property_ui_range(prop, 2.0f, 10.0f, 1, 2);
RNA_def_property_ui_text(prop, "Atmosphere Turbidity", "Sky turbidity"); RNA_def_property_ui_text(prop, "Atmosphere Turbidity", "Sky turbidity");
RNA_def_property_update(prop, 0, "rna_Lamp_sky_update"); RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
prop= RNA_def_property(srna, "atmosphere_inscattering", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "atmosphere_inscattering", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "atm_inscattering_factor"); RNA_def_property_float_sdna(prop, NULL, "atm_inscattering_factor");
RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Atmosphere Inscatter", "Scatter contribution factor"); RNA_def_property_ui_text(prop, "Atmosphere Inscatter", "Scatter contribution factor");
RNA_def_property_update(prop, 0, "rna_Lamp_sky_update"); RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
prop= RNA_def_property(srna, "atmosphere_extinction", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "atmosphere_extinction", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "atm_extinction_factor"); RNA_def_property_float_sdna(prop, NULL, "atm_extinction_factor");
RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Atmosphere Extinction", "Extinction scattering contribution factor"); RNA_def_property_ui_text(prop, "Atmosphere Extinction", "Extinction scattering contribution factor");
RNA_def_property_update(prop, 0, "rna_Lamp_sky_update"); RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
prop= RNA_def_property(srna, "atmosphere_distance_factor", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "atmosphere_distance_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "atm_distance_factor"); RNA_def_property_float_sdna(prop, NULL, "atm_distance_factor");
RNA_def_property_range(prop, 0.0f, 500.0f); RNA_def_property_range(prop, 0.0f, 500.0f);
RNA_def_property_ui_text(prop, "Atmosphere Distance Factor", "Multiplier to convert blender units to physical distance"); RNA_def_property_ui_text(prop, "Atmosphere Distance Factor", "Multiplier to convert blender units to physical distance");
RNA_def_property_update(prop, 0, "rna_Lamp_sky_update"); RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
prop= RNA_def_property(srna, "sky_blend", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "sky_blend", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "skyblendfac"); RNA_def_property_float_sdna(prop, NULL, "skyblendfac");
RNA_def_property_range(prop, 0.0f, 2.0f); RNA_def_property_range(prop, 0.0f, 2.0f);
RNA_def_property_ui_text(prop, "Sky Blend", "Blend factor with sky"); RNA_def_property_ui_text(prop, "Sky Blend", "Blend factor with sky");
RNA_def_property_update(prop, 0, "rna_Lamp_sky_update"); RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
prop= RNA_def_property(srna, "sky_exposure", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "sky_exposure", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 20.0f); RNA_def_property_range(prop, 0.0f, 20.0f);
RNA_def_property_ui_text(prop, "Sky Exposure", "Strength of sky shading exponential exposure correction"); RNA_def_property_ui_text(prop, "Sky Exposure", "Strength of sky shading exponential exposure correction");
RNA_def_property_update(prop, 0, "rna_Lamp_sky_update"); RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
/* boolean */ /* boolean */
prop= RNA_def_property(srna, "use_sky", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_sky", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "sun_effect_type", LA_SUN_EFFECT_SKY); RNA_def_property_boolean_sdna(prop, NULL, "sun_effect_type", LA_SUN_EFFECT_SKY);
RNA_def_property_ui_text(prop, "Sky", "Apply sun effect on sky"); RNA_def_property_ui_text(prop, "Sky", "Apply sun effect on sky");
RNA_def_property_update(prop, 0, "rna_Lamp_sky_update"); RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
prop= RNA_def_property(srna, "use_atmosphere", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_atmosphere", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "sun_effect_type", LA_SUN_EFFECT_AP); RNA_def_property_boolean_sdna(prop, NULL, "sun_effect_type", LA_SUN_EFFECT_AP);
RNA_def_property_ui_text(prop, "Atmosphere", "Apply sun effect on atmosphere"); RNA_def_property_ui_text(prop, "Atmosphere", "Apply sun effect on atmosphere");
RNA_def_property_update(prop, 0, "rna_Lamp_sky_update"); RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
@@ -329,60 +329,60 @@ static void rna_def_lamp(BlenderRNA *brna)
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
srna= RNA_def_struct(brna, "Lamp", "ID"); srna = RNA_def_struct(brna, "Lamp", "ID");
RNA_def_struct_refine_func(srna, "rna_Lamp_refine"); RNA_def_struct_refine_func(srna, "rna_Lamp_refine");
RNA_def_struct_ui_text(srna, "Lamp", "Lamp datablock for lighting a scene"); RNA_def_struct_ui_text(srna, "Lamp", "Lamp datablock for lighting a scene");
RNA_def_struct_ui_icon(srna, ICON_LAMP_DATA); RNA_def_struct_ui_icon(srna, ICON_LAMP_DATA);
prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, lamp_type_items); RNA_def_property_enum_items(prop, lamp_type_items);
RNA_def_property_ui_text(prop, "Type", "Type of Lamp"); RNA_def_property_ui_text(prop, "Type", "Type of Lamp");
RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_DISTANCE); prop = RNA_def_property(srna, "distance", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "dist"); RNA_def_property_float_sdna(prop, NULL, "dist");
RNA_def_property_range(prop, 0, INT_MAX); RNA_def_property_range(prop, 0, INT_MAX);
RNA_def_property_ui_range(prop, 0, 1000, 1, 3); RNA_def_property_ui_range(prop, 0, 1000, 1, 3);
RNA_def_property_ui_text(prop, "Distance", "Falloff distance - the light is at half the original intensity at this point"); RNA_def_property_ui_text(prop, "Distance", "Falloff distance - the light is at half the original intensity at this point");
RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
prop= RNA_def_property(srna, "energy", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "energy", PROP_FLOAT, PROP_NONE);
RNA_def_property_ui_range(prop, 0, 10, 1, 3); RNA_def_property_ui_range(prop, 0, 10, 1, 3);
RNA_def_property_ui_text(prop, "Energy", "Amount of light that the lamp emits"); RNA_def_property_ui_text(prop, "Energy", "Amount of light that the lamp emits");
RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR); prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "r"); RNA_def_property_float_sdna(prop, NULL, "r");
RNA_def_property_array(prop, 3); RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Color", "Light color"); RNA_def_property_ui_text(prop, "Color", "Light color");
RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
prop= RNA_def_property(srna, "use_own_layer", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_own_layer", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_LAYER); RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_LAYER);
RNA_def_property_ui_text(prop, "Layer", "Illuminate objects only on the same layers the lamp is on"); RNA_def_property_ui_text(prop, "Layer", "Illuminate objects only on the same layers the lamp is on");
RNA_def_property_update(prop, 0, "rna_Lamp_update"); RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "use_negative", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_negative", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_NEG); RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_NEG);
RNA_def_property_ui_text(prop, "Negative", "Cast negative light"); RNA_def_property_ui_text(prop, "Negative", "Cast negative light");
RNA_def_property_update(prop, 0, "rna_Lamp_update"); RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "use_specular", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_specular", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "mode", LA_NO_SPEC); RNA_def_property_boolean_negative_sdna(prop, NULL, "mode", LA_NO_SPEC);
RNA_def_property_ui_text(prop, "Specular", "Create specular highlights"); RNA_def_property_ui_text(prop, "Specular", "Create specular highlights");
RNA_def_property_update(prop, 0, "rna_Lamp_update"); RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "use_diffuse", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_diffuse", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "mode", LA_NO_DIFF); RNA_def_property_boolean_negative_sdna(prop, NULL, "mode", LA_NO_DIFF);
RNA_def_property_ui_text(prop, "Diffuse", "Do diffuse shading"); RNA_def_property_ui_text(prop, "Diffuse", "Do diffuse shading");
RNA_def_property_update(prop, 0, "rna_Lamp_update"); RNA_def_property_update(prop, 0, "rna_Lamp_update");
/* nodes */ /* nodes */
prop= RNA_def_property(srna, "node_tree", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "node_tree", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "nodetree"); RNA_def_property_pointer_sdna(prop, NULL, "nodetree");
RNA_def_property_ui_text(prop, "Node Tree", "Node tree for node based lamps"); RNA_def_property_ui_text(prop, "Node Tree", "Node tree for node based lamps");
prop= RNA_def_property(srna, "use_nodes", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_nodes", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "use_nodes", 1); RNA_def_property_boolean_sdna(prop, NULL, "use_nodes", 1);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Use Nodes", "Use shader nodes to render the lamp"); RNA_def_property_ui_text(prop, "Use Nodes", "Use shader nodes to render the lamp");
@@ -408,28 +408,28 @@ static void rna_def_lamp_falloff(StructRNA *srna)
{LA_FALLOFF_SLIDERS, "LINEAR_QUADRATIC_WEIGHTED", 0, "Lin/Quad Weighted", ""}, {LA_FALLOFF_SLIDERS, "LINEAR_QUADRATIC_WEIGHTED", 0, "Lin/Quad Weighted", ""},
{0, NULL, 0, NULL, NULL}}; {0, NULL, 0, NULL, NULL}};
prop= RNA_def_property(srna, "falloff_type", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "falloff_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, prop_fallofftype_items); RNA_def_property_enum_items(prop, prop_fallofftype_items);
RNA_def_property_ui_text(prop, "Falloff Type", "Intensity Decay with distance"); RNA_def_property_ui_text(prop, "Falloff Type", "Intensity Decay with distance");
RNA_def_property_update(prop, 0, "rna_Lamp_update"); RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "falloff_curve", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "falloff_curve", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "curfalloff"); RNA_def_property_pointer_sdna(prop, NULL, "curfalloff");
RNA_def_property_ui_text(prop, "Falloff Curve", "Custom Lamp Falloff Curve"); RNA_def_property_ui_text(prop, "Falloff Curve", "Custom Lamp Falloff Curve");
RNA_def_property_update(prop, 0, "rna_Lamp_update"); RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "use_sphere", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_sphere", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_SPHERE); RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_SPHERE);
RNA_def_property_ui_text(prop, "Sphere", "Set light intensity to zero beyond lamp distance"); RNA_def_property_ui_text(prop, "Sphere", "Set light intensity to zero beyond lamp distance");
RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
prop= RNA_def_property(srna, "linear_attenuation", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "linear_attenuation", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "att1"); RNA_def_property_float_sdna(prop, NULL, "att1");
RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Linear Attenuation", "Linear distance attenuation"); RNA_def_property_ui_text(prop, "Linear Attenuation", "Linear distance attenuation");
RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
prop= RNA_def_property(srna, "quadratic_attenuation", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "quadratic_attenuation", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "att2"); RNA_def_property_float_sdna(prop, NULL, "att2");
RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Quadratic Attenuation", "Quadratic distance attenuation"); RNA_def_property_ui_text(prop, "Quadratic Attenuation", "Quadratic distance attenuation");
@@ -462,56 +462,56 @@ static void rna_def_lamp_shadow(StructRNA *srna, int spot, int area)
{LA_SAMP_CONSTANT, "CONSTANT_JITTERED", 0, "Constant Jittered", ""}, {LA_SAMP_CONSTANT, "CONSTANT_JITTERED", 0, "Constant Jittered", ""},
{0, NULL, 0, NULL, NULL}}; {0, NULL, 0, NULL, NULL}};
prop= RNA_def_property(srna, "shadow_method", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "shadow_method", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "mode"); RNA_def_property_enum_bitflag_sdna(prop, NULL, "mode");
RNA_def_property_enum_items(prop, (spot)? prop_spot_shadow_items: prop_shadow_items); RNA_def_property_enum_items(prop, (spot)? prop_spot_shadow_items: prop_shadow_items);
RNA_def_property_ui_text(prop, "Shadow Method", "Method to compute lamp shadow with"); RNA_def_property_ui_text(prop, "Shadow Method", "Method to compute lamp shadow with");
RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
prop= RNA_def_property(srna, "shadow_color", PROP_FLOAT, PROP_COLOR); prop = RNA_def_property(srna, "shadow_color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "shdwr"); RNA_def_property_float_sdna(prop, NULL, "shdwr");
RNA_def_property_array(prop, 3); RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Shadow Color", "Color of shadows cast by the lamp"); RNA_def_property_ui_text(prop, "Shadow Color", "Color of shadows cast by the lamp");
RNA_def_property_update(prop, 0, "rna_Lamp_update"); RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "use_only_shadow", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_only_shadow", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_ONLYSHADOW); RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_ONLYSHADOW);
RNA_def_property_ui_text(prop, "Only Shadow", "Cast shadows only, without illuminating objects"); RNA_def_property_ui_text(prop, "Only Shadow", "Cast shadows only, without illuminating objects");
RNA_def_property_update(prop, 0, "rna_Lamp_update"); RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "shadow_ray_sample_method", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "shadow_ray_sample_method", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "ray_samp_method"); RNA_def_property_enum_sdna(prop, NULL, "ray_samp_method");
RNA_def_property_enum_items(prop, (area)? prop_spot_ray_sampling_method_items: prop_ray_sampling_method_items); RNA_def_property_enum_items(prop, (area)? prop_spot_ray_sampling_method_items: prop_ray_sampling_method_items);
RNA_def_property_ui_text(prop, "Shadow Ray Sampling Method", "Method for generating shadow samples: Adaptive QMC is fastest, Constant QMC is less noisy but slower"); RNA_def_property_ui_text(prop, "Shadow Ray Sampling Method", "Method for generating shadow samples: Adaptive QMC is fastest, Constant QMC is less noisy but slower");
RNA_def_property_update(prop, 0, "rna_Lamp_update"); RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, (area)? "shadow_ray_samples_x": "shadow_ray_samples", PROP_INT, PROP_NONE); prop = RNA_def_property(srna, (area)? "shadow_ray_samples_x": "shadow_ray_samples", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "ray_samp"); RNA_def_property_int_sdna(prop, NULL, "ray_samp");
RNA_def_property_range(prop, 1, 64); RNA_def_property_range(prop, 1, 64);
RNA_def_property_ui_text(prop, (area)? "Shadow Ray Samples": "Shadow Ray Samples X","Number of samples taken extra (samples x samples)"); RNA_def_property_ui_text(prop, (area)? "Shadow Ray Samples": "Shadow Ray Samples X","Number of samples taken extra (samples x samples)");
RNA_def_property_update(prop, 0, "rna_Lamp_update"); RNA_def_property_update(prop, 0, "rna_Lamp_update");
if(area) { if (area) {
prop= RNA_def_property(srna, "shadow_ray_samples_y", PROP_INT, PROP_NONE); prop = RNA_def_property(srna, "shadow_ray_samples_y", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "ray_sampy"); RNA_def_property_int_sdna(prop, NULL, "ray_sampy");
RNA_def_property_range(prop, 1, 64); RNA_def_property_range(prop, 1, 64);
RNA_def_property_ui_text(prop, "Shadow Ray Samples Y", "Number of samples taken extra (samples x samples)"); RNA_def_property_ui_text(prop, "Shadow Ray Samples Y", "Number of samples taken extra (samples x samples)");
RNA_def_property_update(prop, 0, "rna_Lamp_update"); RNA_def_property_update(prop, 0, "rna_Lamp_update");
} }
prop= RNA_def_property(srna, "shadow_adaptive_threshold", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "shadow_adaptive_threshold", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "adapt_thresh"); RNA_def_property_float_sdna(prop, NULL, "adapt_thresh");
RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Shadow Adaptive Threshold", "Threshold for Adaptive Sampling (Raytraced shadows)"); RNA_def_property_ui_text(prop, "Shadow Adaptive Threshold", "Threshold for Adaptive Sampling (Raytraced shadows)");
RNA_def_property_update(prop, 0, "rna_Lamp_update"); RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "shadow_soft_size", PROP_FLOAT, PROP_DISTANCE); prop = RNA_def_property(srna, "shadow_soft_size", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "area_size"); RNA_def_property_float_sdna(prop, NULL, "area_size");
RNA_def_property_ui_range(prop, 0, 100, 0.1, 3); RNA_def_property_ui_range(prop, 0, 100, 0.1, 3);
RNA_def_property_ui_text(prop, "Shadow Soft Size", "Light size for ray shadow sampling (Raytraced shadows)"); RNA_def_property_ui_text(prop, "Shadow Soft Size", "Light size for ray shadow sampling (Raytraced shadows)");
RNA_def_property_update(prop, 0, "rna_Lamp_update"); RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "use_shadow_layer", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_shadow_layer", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_LAYER_SHADOW); RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_LAYER_SHADOW);
RNA_def_property_ui_text(prop, "Shadow Layer", "Objects on the same layers only cast shadows"); RNA_def_property_ui_text(prop, "Shadow Layer", "Objects on the same layers only cast shadows");
RNA_def_property_update(prop, 0, "rna_Lamp_update"); RNA_def_property_update(prop, 0, "rna_Lamp_update");
@@ -521,7 +521,7 @@ static void rna_def_point_lamp(BlenderRNA *brna)
{ {
StructRNA *srna; StructRNA *srna;
srna= RNA_def_struct(brna, "PointLamp", "Lamp"); srna = RNA_def_struct(brna, "PointLamp", "Lamp");
RNA_def_struct_sdna(srna, "Lamp"); RNA_def_struct_sdna(srna, "Lamp");
RNA_def_struct_ui_text(srna, "Point Lamp", "Omnidirectional point lamp"); RNA_def_struct_ui_text(srna, "Point Lamp", "Omnidirectional point lamp");
RNA_def_struct_ui_icon(srna, ICON_LAMP_POINT); RNA_def_struct_ui_icon(srna, ICON_LAMP_POINT);
@@ -540,47 +540,47 @@ static void rna_def_area_lamp(BlenderRNA *brna)
{LA_AREA_RECT, "RECTANGLE", 0, "Rectangle", ""}, {LA_AREA_RECT, "RECTANGLE", 0, "Rectangle", ""},
{0, NULL, 0, NULL, NULL}}; {0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "AreaLamp", "Lamp"); srna = RNA_def_struct(brna, "AreaLamp", "Lamp");
RNA_def_struct_sdna(srna, "Lamp"); RNA_def_struct_sdna(srna, "Lamp");
RNA_def_struct_ui_text(srna, "Area Lamp", "Directional area lamp"); RNA_def_struct_ui_text(srna, "Area Lamp", "Directional area lamp");
RNA_def_struct_ui_icon(srna, ICON_LAMP_AREA); RNA_def_struct_ui_icon(srna, ICON_LAMP_AREA);
rna_def_lamp_shadow(srna, 0, 1); rna_def_lamp_shadow(srna, 0, 1);
prop= RNA_def_property(srna, "use_umbra", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_umbra", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ray_samp_type", LA_SAMP_UMBRA); RNA_def_property_boolean_sdna(prop, NULL, "ray_samp_type", LA_SAMP_UMBRA);
RNA_def_property_ui_text(prop, "Umbra", "Emphasize parts that are fully shadowed (Constant Jittered sampling)"); RNA_def_property_ui_text(prop, "Umbra", "Emphasize parts that are fully shadowed (Constant Jittered sampling)");
RNA_def_property_update(prop, 0, "rna_Lamp_update"); RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "use_dither", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_dither", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ray_samp_type", LA_SAMP_DITHER); RNA_def_property_boolean_sdna(prop, NULL, "ray_samp_type", LA_SAMP_DITHER);
RNA_def_property_ui_text(prop, "Dither", "Use 2x2 dithering for sampling (Constant Jittered sampling)"); RNA_def_property_ui_text(prop, "Dither", "Use 2x2 dithering for sampling (Constant Jittered sampling)");
RNA_def_property_update(prop, 0, "rna_Lamp_update"); RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "use_jitter", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_jitter", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ray_samp_type", LA_SAMP_JITTER); RNA_def_property_boolean_sdna(prop, NULL, "ray_samp_type", LA_SAMP_JITTER);
RNA_def_property_ui_text(prop, "Jitter", "Use noise for sampling (Constant Jittered sampling)"); RNA_def_property_ui_text(prop, "Jitter", "Use noise for sampling (Constant Jittered sampling)");
RNA_def_property_update(prop, 0, "rna_Lamp_update"); RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "shape", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "shape", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "area_shape"); RNA_def_property_enum_sdna(prop, NULL, "area_shape");
RNA_def_property_enum_items(prop, prop_areashape_items); RNA_def_property_enum_items(prop, prop_areashape_items);
RNA_def_property_ui_text(prop, "Shape", "Shape of the area lamp"); RNA_def_property_ui_text(prop, "Shape", "Shape of the area lamp");
RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
prop= RNA_def_property(srna, "size", PROP_FLOAT, PROP_DISTANCE); prop = RNA_def_property(srna, "size", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "area_size"); RNA_def_property_float_sdna(prop, NULL, "area_size");
RNA_def_property_ui_range(prop, 0, 100, 0.1, 3); RNA_def_property_ui_range(prop, 0, 100, 0.1, 3);
RNA_def_property_ui_text(prop, "Size", "Size of the area of the area Lamp, X direction size for Rectangle shapes"); RNA_def_property_ui_text(prop, "Size", "Size of the area of the area Lamp, X direction size for Rectangle shapes");
RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
prop= RNA_def_property(srna, "size_y", PROP_FLOAT, PROP_DISTANCE); prop = RNA_def_property(srna, "size_y", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "area_sizey"); RNA_def_property_float_sdna(prop, NULL, "area_sizey");
RNA_def_property_ui_range(prop, 0, 100, 0.1, 3); RNA_def_property_ui_range(prop, 0, 100, 0.1, 3);
RNA_def_property_ui_text(prop, "Size Y", "Size of the area of the area Lamp in the Y direction for Rectangle shapes"); RNA_def_property_ui_text(prop, "Size Y", "Size of the area of the area Lamp in the Y direction for Rectangle shapes");
RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
prop= RNA_def_property(srna, "gamma", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "gamma", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "k"); RNA_def_property_float_sdna(prop, NULL, "k");
RNA_def_property_ui_range(prop, 0.001, 2.0, 0.1, 3); RNA_def_property_ui_range(prop, 0.001, 2.0, 0.1, 3);
RNA_def_property_ui_text(prop, "Gamma", "Light gamma correction value"); RNA_def_property_ui_text(prop, "Gamma", "Light gamma correction value");
@@ -611,7 +611,7 @@ static void rna_def_spot_lamp(BlenderRNA *brna)
{9, "BUFFERS_9", 0, "9", "Render 9 buffers for better AA, this uses nine times more memory"}, {9, "BUFFERS_9", 0, "9", "Render 9 buffers for better AA, this uses nine times more memory"},
{0, NULL, 0, NULL, NULL}}; {0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "SpotLamp", "Lamp"); srna = RNA_def_struct(brna, "SpotLamp", "Lamp");
RNA_def_struct_sdna(srna, "Lamp"); RNA_def_struct_sdna(srna, "Lamp");
RNA_def_struct_ui_text(srna, "Spot Lamp", "Directional cone lamp"); RNA_def_struct_ui_text(srna, "Spot Lamp", "Directional cone lamp");
RNA_def_struct_ui_icon(srna, ICON_LAMP_SPOT); RNA_def_struct_ui_icon(srna, ICON_LAMP_SPOT);
@@ -619,112 +619,112 @@ static void rna_def_spot_lamp(BlenderRNA *brna)
rna_def_lamp_falloff(srna); rna_def_lamp_falloff(srna);
rna_def_lamp_shadow(srna, 1, 0); rna_def_lamp_shadow(srna, 1, 0);
prop= RNA_def_property(srna, "use_square", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_square", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_SQUARE); RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_SQUARE);
RNA_def_property_ui_text(prop, "Square", "Cast a square spot light shape"); RNA_def_property_ui_text(prop, "Square", "Cast a square spot light shape");
RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
prop= RNA_def_property(srna, "use_halo", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_halo", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_HALO); RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_HALO);
RNA_def_property_ui_text(prop, "Halo", "Render spotlight with a volumetric halo"); RNA_def_property_ui_text(prop, "Halo", "Render spotlight with a volumetric halo");
RNA_def_property_update(prop, 0, "rna_Lamp_update"); RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "halo_intensity", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "halo_intensity", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "haint"); RNA_def_property_float_sdna(prop, NULL, "haint");
RNA_def_property_ui_range(prop, 0, 5.0, 0.1, 3); RNA_def_property_ui_range(prop, 0, 5.0, 0.1, 3);
RNA_def_property_ui_text(prop, "Halo Intensity", "Brightness of the spotlight's halo cone"); RNA_def_property_ui_text(prop, "Halo Intensity", "Brightness of the spotlight's halo cone");
RNA_def_property_update(prop, 0, "rna_Lamp_update"); RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "halo_step", PROP_INT, PROP_NONE); prop = RNA_def_property(srna, "halo_step", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "shadhalostep"); RNA_def_property_int_sdna(prop, NULL, "shadhalostep");
RNA_def_property_range(prop, 0, 12); RNA_def_property_range(prop, 0, 12);
RNA_def_property_ui_text(prop, "Halo Step", "Volumetric halo sampling frequency"); RNA_def_property_ui_text(prop, "Halo Step", "Volumetric halo sampling frequency");
RNA_def_property_update(prop, 0, "rna_Lamp_update"); RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "shadow_buffer_size", PROP_INT, PROP_NONE); prop = RNA_def_property(srna, "shadow_buffer_size", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "bufsize"); RNA_def_property_int_sdna(prop, NULL, "bufsize");
RNA_def_property_range(prop, 512, 10240); RNA_def_property_range(prop, 512, 10240);
RNA_def_property_ui_text(prop, "Shadow Buffer Size", "Resolution of the shadow buffer, higher values give crisper shadows but use more memory"); RNA_def_property_ui_text(prop, "Shadow Buffer Size", "Resolution of the shadow buffer, higher values give crisper shadows but use more memory");
RNA_def_property_int_funcs(prop, NULL, "rna_Lamp_buffer_size_set", NULL); RNA_def_property_int_funcs(prop, NULL, "rna_Lamp_buffer_size_set", NULL);
RNA_def_property_update(prop, 0, "rna_Lamp_update"); RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "shadow_filter_type", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "shadow_filter_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "filtertype"); RNA_def_property_enum_sdna(prop, NULL, "filtertype");
RNA_def_property_enum_items(prop, prop_shadbuffiltertype_items); RNA_def_property_enum_items(prop, prop_shadbuffiltertype_items);
RNA_def_property_ui_text(prop, "Shadow Filter Type", "Type of shadow filter (Buffer Shadows)"); RNA_def_property_ui_text(prop, "Shadow Filter Type", "Type of shadow filter (Buffer Shadows)");
RNA_def_property_update(prop, 0, "rna_Lamp_update"); RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "shadow_sample_buffers", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "shadow_sample_buffers", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "buffers"); RNA_def_property_enum_sdna(prop, NULL, "buffers");
RNA_def_property_enum_items(prop, prop_numbuffer_items); RNA_def_property_enum_items(prop, prop_numbuffer_items);
RNA_def_property_ui_text(prop, "Shadow Sample Buffers", "Number of shadow buffers to render for better AA, this increases memory usage"); RNA_def_property_ui_text(prop, "Shadow Sample Buffers", "Number of shadow buffers to render for better AA, this increases memory usage");
RNA_def_property_update(prop, 0, "rna_Lamp_update"); RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "spot_blend", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "spot_blend", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "spotblend"); RNA_def_property_float_sdna(prop, NULL, "spotblend");
RNA_def_property_range(prop, 0.0f ,1.0f); RNA_def_property_range(prop, 0.0f ,1.0f);
RNA_def_property_ui_text(prop, "Spot Blend", "The softness of the spotlight edge"); RNA_def_property_ui_text(prop, "Spot Blend", "The softness of the spotlight edge");
RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
prop= RNA_def_property(srna, "spot_size", PROP_FLOAT, PROP_ANGLE); prop = RNA_def_property(srna, "spot_size", PROP_FLOAT, PROP_ANGLE);
// RNA_def_property_float_sdna(prop, NULL, "spotsize"); /* RNA_def_property_float_sdna(prop, NULL, "spotsize"); */
RNA_def_property_range(prop, M_PI/180.0, M_PI); RNA_def_property_range(prop, M_PI/180.0, M_PI);
RNA_def_property_ui_text(prop, "Spot Size", "Angle of the spotlight beam"); RNA_def_property_ui_text(prop, "Spot Size", "Angle of the spotlight beam");
RNA_def_property_float_funcs(prop, "rna_Lamp_spot_size_get", "rna_Lamp_spot_size_set", NULL); /* only for deg/rad conversion */ RNA_def_property_float_funcs(prop, "rna_Lamp_spot_size_get", "rna_Lamp_spot_size_set", NULL); /* only for deg/rad conversion */
RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
prop= RNA_def_property(srna, "show_cone", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "show_cone", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_SHOW_CONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_SHOW_CONE);
RNA_def_property_ui_text(prop, "Show Cone", "Draw transparent cone in 3D view to visualize which objects are contained in it"); RNA_def_property_ui_text(prop, "Show Cone", "Draw transparent cone in 3D view to visualize which objects are contained in it");
RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
prop= RNA_def_property(srna, "shadow_buffer_clip_start", PROP_FLOAT, PROP_DISTANCE); prop = RNA_def_property(srna, "shadow_buffer_clip_start", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "clipsta"); RNA_def_property_float_sdna(prop, NULL, "clipsta");
RNA_def_property_range(prop, 0.0f, 9999.0f); RNA_def_property_range(prop, 0.0f, 9999.0f);
RNA_def_property_ui_text(prop, "Shadow Buffer Clip Start", "Shadow map clip start, below which objects will not generate shadows"); RNA_def_property_ui_text(prop, "Shadow Buffer Clip Start", "Shadow map clip start, below which objects will not generate shadows");
RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
prop= RNA_def_property(srna, "shadow_buffer_clip_end", PROP_FLOAT, PROP_DISTANCE); prop = RNA_def_property(srna, "shadow_buffer_clip_end", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "clipend"); RNA_def_property_float_sdna(prop, NULL, "clipend");
RNA_def_property_range(prop, 0.0f, 9999.0f); RNA_def_property_range(prop, 0.0f, 9999.0f);
RNA_def_property_ui_text(prop, "Shadow Buffer Clip End", "Shadow map clip end, beyond which objects will not generate shadows"); RNA_def_property_ui_text(prop, "Shadow Buffer Clip End", "Shadow map clip end, beyond which objects will not generate shadows");
RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
prop= RNA_def_property(srna, "shadow_buffer_bias", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "shadow_buffer_bias", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "bias"); RNA_def_property_float_sdna(prop, NULL, "bias");
RNA_def_property_range(prop, 0.001f, 5.0f); RNA_def_property_range(prop, 0.001f, 5.0f);
RNA_def_property_ui_text(prop, "Shadow Buffer Bias", "Shadow buffer sampling bias"); RNA_def_property_ui_text(prop, "Shadow Buffer Bias", "Shadow buffer sampling bias");
RNA_def_property_update(prop, 0, "rna_Lamp_update"); RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "shadow_buffer_soft", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "shadow_buffer_soft", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "soft"); RNA_def_property_float_sdna(prop, NULL, "soft");
RNA_def_property_range(prop, 0.0f, 100.0f); RNA_def_property_range(prop, 0.0f, 100.0f);
RNA_def_property_ui_text(prop, "Shadow Buffer Soft", "Size of shadow buffer sampling area"); RNA_def_property_ui_text(prop, "Shadow Buffer Soft", "Size of shadow buffer sampling area");
RNA_def_property_update(prop, 0, "rna_Lamp_update"); RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "shadow_buffer_samples", PROP_INT, PROP_NONE); prop = RNA_def_property(srna, "shadow_buffer_samples", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "samp"); RNA_def_property_int_sdna(prop, NULL, "samp");
RNA_def_property_range(prop, 1, 16); RNA_def_property_range(prop, 1, 16);
RNA_def_property_ui_text(prop, "Samples", "Number of shadow buffer samples"); RNA_def_property_ui_text(prop, "Samples", "Number of shadow buffer samples");
RNA_def_property_update(prop, 0, "rna_Lamp_update"); RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "shadow_buffer_type", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "shadow_buffer_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "buftype"); RNA_def_property_enum_sdna(prop, NULL, "buftype");
RNA_def_property_enum_items(prop, prop_shadbuftype_items); RNA_def_property_enum_items(prop, prop_shadbuftype_items);
RNA_def_property_ui_text(prop, "Shadow Buffer Type", "Type of shadow buffer"); RNA_def_property_ui_text(prop, "Shadow Buffer Type", "Type of shadow buffer");
RNA_def_property_update(prop, 0, "rna_Lamp_update"); RNA_def_property_update(prop, 0, "rna_Lamp_update");
prop= RNA_def_property(srna, "use_auto_clip_start", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_auto_clip_start", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "bufflag", LA_SHADBUF_AUTO_START); RNA_def_property_boolean_sdna(prop, NULL, "bufflag", LA_SHADBUF_AUTO_START);
RNA_def_property_ui_text(prop, "Autoclip Start", "Automatic calculation of clipping-start, based on visible vertices"); RNA_def_property_ui_text(prop, "Autoclip Start", "Automatic calculation of clipping-start, based on visible vertices");
RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
prop= RNA_def_property(srna, "use_auto_clip_end", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_auto_clip_end", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "bufflag", LA_SHADBUF_AUTO_END); RNA_def_property_boolean_sdna(prop, NULL, "bufflag", LA_SHADBUF_AUTO_END);
RNA_def_property_ui_text(prop, "Autoclip End", "Automatic calculation of clipping-end, based on visible vertices"); RNA_def_property_ui_text(prop, "Autoclip End", "Automatic calculation of clipping-end, based on visible vertices");
RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
prop= RNA_def_property(srna, "compression_threshold", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "compression_threshold", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "compressthresh"); RNA_def_property_float_sdna(prop, NULL, "compressthresh");
RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Compress", "Deep shadow map compression threshold"); RNA_def_property_ui_text(prop, "Compress", "Deep shadow map compression threshold");
@@ -736,7 +736,7 @@ static void rna_def_sun_lamp(BlenderRNA *brna)
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
srna= RNA_def_struct(brna, "SunLamp", "Lamp"); srna = RNA_def_struct(brna, "SunLamp", "Lamp");
RNA_def_struct_sdna(srna, "Lamp"); RNA_def_struct_sdna(srna, "Lamp");
RNA_def_struct_ui_text(srna, "Sun Lamp", "Constant direction parallel ray lamp"); RNA_def_struct_ui_text(srna, "Sun Lamp", "Constant direction parallel ray lamp");
RNA_def_struct_ui_icon(srna, ICON_LAMP_SUN); RNA_def_struct_ui_icon(srna, ICON_LAMP_SUN);
@@ -744,7 +744,7 @@ static void rna_def_sun_lamp(BlenderRNA *brna)
rna_def_lamp_shadow(srna, 0, 0); rna_def_lamp_shadow(srna, 0, 0);
/* sky */ /* sky */
prop= RNA_def_property(srna, "sky", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "sky", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "LampSkySettings"); RNA_def_property_struct_type(prop, "LampSkySettings");
RNA_def_property_pointer_funcs(prop, "rna_Lamp_sky_settings_get", NULL, NULL, NULL); RNA_def_property_pointer_funcs(prop, "rna_Lamp_sky_settings_get", NULL, NULL, NULL);
@@ -757,7 +757,7 @@ static void rna_def_hemi_lamp(BlenderRNA *brna)
{ {
StructRNA *srna; StructRNA *srna;
srna= RNA_def_struct(brna, "HemiLamp", "Lamp"); srna = RNA_def_struct(brna, "HemiLamp", "Lamp");
RNA_def_struct_sdna(srna, "Lamp"); RNA_def_struct_sdna(srna, "Lamp");
RNA_def_struct_ui_text(srna, "Hemi Lamp", "180 degree constant lamp"); RNA_def_struct_ui_text(srna, "Hemi Lamp", "180 degree constant lamp");
RNA_def_struct_ui_icon(srna, ICON_LAMP_HEMI); RNA_def_struct_ui_icon(srna, ICON_LAMP_HEMI);

View File

@@ -51,25 +51,25 @@
static void rna_LatticePoint_co_get(PointerRNA *ptr, float *values) static void rna_LatticePoint_co_get(PointerRNA *ptr, float *values)
{ {
Lattice *lt= (Lattice*)ptr->id.data; Lattice *lt = (Lattice*)ptr->id.data;
BPoint *bp= (BPoint*)ptr->data; BPoint *bp = (BPoint*)ptr->data;
int a= bp - lt->def; int a = bp - lt->def;
int x= a % lt->pntsu; int x = a % lt->pntsu;
int y= (a/lt->pntsu) % lt->pntsv; int y = (a/lt->pntsu) % lt->pntsv;
int z= (a/(lt->pntsu*lt->pntsv)); int z = (a/(lt->pntsu*lt->pntsv));
values[0]= lt->fu + x*lt->du; values[0] = lt->fu + x*lt->du;
values[1]= lt->fv + y*lt->dv; values[1] = lt->fv + y*lt->dv;
values[2]= lt->fw + z*lt->dw; values[2] = lt->fw + z*lt->dw;
} }
static void rna_LatticePoint_groups_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) static void rna_LatticePoint_groups_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{ {
Lattice *lt= (Lattice*)ptr->id.data; Lattice *lt = (Lattice*)ptr->id.data;
if(lt->dvert) { if (lt->dvert) {
BPoint *bp= (BPoint*)ptr->data; BPoint *bp = (BPoint*)ptr->data;
MDeformVert *dvert= lt->dvert + (bp-lt->def); MDeformVert *dvert = lt->dvert + (bp-lt->def);
rna_iterator_array_begin(iter, (void*)dvert->dw, sizeof(MDeformWeight), dvert->totweight, 0, NULL); rna_iterator_array_begin(iter, (void*)dvert->dw, sizeof(MDeformWeight), dvert->totweight, 0, NULL);
} }
@@ -79,12 +79,12 @@ static void rna_LatticePoint_groups_begin(CollectionPropertyIterator *iter, Poin
static void rna_Lattice_points_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) static void rna_Lattice_points_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{ {
Lattice *lt= (Lattice*)ptr->data; Lattice *lt = (Lattice*)ptr->data;
int tot= lt->pntsu*lt->pntsv*lt->pntsw; int tot = lt->pntsu*lt->pntsv*lt->pntsw;
if(lt->editlatt && lt->editlatt->latt->def) if (lt->editlatt && lt->editlatt->latt->def)
rna_iterator_array_begin(iter, (void*)lt->editlatt->latt->def, sizeof(BPoint), tot, 0, NULL); rna_iterator_array_begin(iter, (void*)lt->editlatt->latt->def, sizeof(BPoint), tot, 0, NULL);
else if(lt->def) else if (lt->def)
rna_iterator_array_begin(iter, (void*)lt->def, sizeof(BPoint), tot, 0, NULL); rna_iterator_array_begin(iter, (void*)lt->def, sizeof(BPoint), tot, 0, NULL);
else else
rna_iterator_array_begin(iter, NULL, 0, 0, 0, NULL); rna_iterator_array_begin(iter, NULL, 0, 0, 0, NULL);
@@ -92,7 +92,7 @@ static void rna_Lattice_points_begin(CollectionPropertyIterator *iter, PointerRN
static void rna_Lattice_update_data(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) static void rna_Lattice_update_data(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{ {
ID *id= ptr->id.data; ID *id = ptr->id.data;
DAG_id_tag_update(id, 0); DAG_id_tag_update(id, 0);
WM_main_add_notifier(NC_GEOM|ND_DATA, id); WM_main_add_notifier(NC_GEOM|ND_DATA, id);
@@ -100,29 +100,29 @@ static void rna_Lattice_update_data(Main *UNUSED(bmain), Scene *UNUSED(scene), P
static void rna_Lattice_update_size(Main *bmain, Scene *scene, PointerRNA *ptr) static void rna_Lattice_update_size(Main *bmain, Scene *scene, PointerRNA *ptr)
{ {
Lattice *lt= ptr->id.data; Lattice *lt = ptr->id.data;
Object *ob; Object *ob;
int newu, newv, neww; int newu, newv, neww;
/* we don't modify the actual pnts, but go through opnts instead */ /* we don't modify the actual pnts, but go through opnts instead */
newu= (lt->opntsu > 0)? lt->opntsu: lt->pntsu; newu = (lt->opntsu > 0)? lt->opntsu: lt->pntsu;
newv= (lt->opntsv > 0)? lt->opntsv: lt->pntsv; newv = (lt->opntsv > 0)? lt->opntsv: lt->pntsv;
neww= (lt->opntsw > 0)? lt->opntsw: lt->pntsw; neww = (lt->opntsw > 0)? lt->opntsw: lt->pntsw;
/* resizelattice needs an object, any object will have the same result */ /* resizelattice needs an object, any object will have the same result */
for(ob=bmain->object.first; ob; ob= ob->id.next) { for (ob = bmain->object.first; ob; ob = ob->id.next) {
if(ob->data == lt) { if (ob->data == lt) {
resizelattice(lt, newu, newv, neww, ob); resizelattice(lt, newu, newv, neww, ob);
if(lt->editlatt) if (lt->editlatt)
resizelattice(lt->editlatt->latt, newu, newv, neww, ob); resizelattice(lt->editlatt->latt, newu, newv, neww, ob);
break; break;
} }
} }
/* otherwise without, means old points are not repositioned */ /* otherwise without, means old points are not repositioned */
if(!ob) { if (!ob) {
resizelattice(lt, newu, newv, neww, NULL); resizelattice(lt, newu, newv, neww, NULL);
if(lt->editlatt) if (lt->editlatt)
resizelattice(lt->editlatt->latt, newu, newv, neww, NULL); resizelattice(lt->editlatt->latt, newu, newv, neww, NULL);
} }
@@ -131,15 +131,15 @@ static void rna_Lattice_update_size(Main *bmain, Scene *scene, PointerRNA *ptr)
static void rna_Lattice_use_outside_set(PointerRNA *ptr, int value) static void rna_Lattice_use_outside_set(PointerRNA *ptr, int value)
{ {
Lattice *lt= ptr->data; Lattice *lt = ptr->data;
if(value) lt->flag |= LT_OUTSIDE; if (value) lt->flag |= LT_OUTSIDE;
else lt->flag &= ~LT_OUTSIDE; else lt->flag &= ~LT_OUTSIDE;
outside_lattice(lt); outside_lattice(lt);
if(lt->editlatt) { if (lt->editlatt) {
if(value) lt->editlatt->latt->flag |= LT_OUTSIDE; if (value) lt->editlatt->latt->flag |= LT_OUTSIDE;
else lt->editlatt->latt->flag &= ~LT_OUTSIDE; else lt->editlatt->latt->flag &= ~LT_OUTSIDE;
outside_lattice(lt->editlatt->latt); outside_lattice(lt->editlatt->latt);
@@ -148,38 +148,38 @@ static void rna_Lattice_use_outside_set(PointerRNA *ptr, int value)
static int rna_Lattice_size_editable(PointerRNA *ptr) static int rna_Lattice_size_editable(PointerRNA *ptr)
{ {
Lattice *lt= (Lattice*)ptr->data; Lattice *lt = (Lattice*)ptr->data;
return lt->key == NULL; return lt->key == NULL;
} }
static void rna_Lattice_points_u_set(PointerRNA *ptr, int value) static void rna_Lattice_points_u_set(PointerRNA *ptr, int value)
{ {
Lattice *lt= (Lattice*)ptr->data; Lattice *lt = (Lattice*)ptr->data;
lt->opntsu= CLAMPIS(value, 1, 64); lt->opntsu = CLAMPIS(value, 1, 64);
} }
static void rna_Lattice_points_v_set(PointerRNA *ptr, int value) static void rna_Lattice_points_v_set(PointerRNA *ptr, int value)
{ {
Lattice *lt= (Lattice*)ptr->data; Lattice *lt = (Lattice*)ptr->data;
lt->opntsv= CLAMPIS(value, 1, 64); lt->opntsv = CLAMPIS(value, 1, 64);
} }
static void rna_Lattice_points_w_set(PointerRNA *ptr, int value) static void rna_Lattice_points_w_set(PointerRNA *ptr, int value)
{ {
Lattice *lt= (Lattice*)ptr->data; Lattice *lt = (Lattice*)ptr->data;
lt->opntsw= CLAMPIS(value, 1, 64); lt->opntsw = CLAMPIS(value, 1, 64);
} }
static void rna_Lattice_vg_name_set(PointerRNA *ptr, const char *value) static void rna_Lattice_vg_name_set(PointerRNA *ptr, const char *value)
{ {
Lattice *lt= ptr->data; Lattice *lt = ptr->data;
BLI_strncpy(lt->vgroup, value, sizeof(lt->vgroup)); BLI_strncpy(lt->vgroup, value, sizeof(lt->vgroup));
if(lt->editlatt) { if (lt->editlatt) {
BLI_strncpy(lt->editlatt->latt->vgroup, value, sizeof(lt->editlatt->latt->vgroup)); BLI_strncpy(lt->editlatt->latt->vgroup, value, sizeof(lt->editlatt->latt->vgroup));
} }
} }
@@ -187,8 +187,8 @@ static void rna_Lattice_vg_name_set(PointerRNA *ptr, const char *value)
/* annoying, but is a consequence of RNA structures... */ /* annoying, but is a consequence of RNA structures... */
static char *rna_LatticePoint_path(PointerRNA *ptr) static char *rna_LatticePoint_path(PointerRNA *ptr)
{ {
Lattice *lt= (Lattice*)ptr->id.data; Lattice *lt = (Lattice*)ptr->id.data;
void *point= ptr->data; void *point = ptr->data;
BPoint *points = NULL; BPoint *points = NULL;
if (lt->editlatt && lt->editlatt->latt->def) if (lt->editlatt && lt->editlatt->latt->def)
@@ -197,7 +197,7 @@ static char *rna_LatticePoint_path(PointerRNA *ptr)
points = lt->def; points = lt->def;
if (points && point) { if (points && point) {
int tot= lt->pntsu*lt->pntsv*lt->pntsw; int tot = lt->pntsu*lt->pntsv*lt->pntsw;
/* only return index if in range */ /* only return index if in range */
if ((point >= (void *)points) && (point < (void *)(points + tot))) { if ((point >= (void *)points) && (point < (void *)(points + tot))) {
@@ -218,24 +218,24 @@ static void rna_def_latticepoint(BlenderRNA *brna)
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
srna= RNA_def_struct(brna, "LatticePoint", NULL); srna = RNA_def_struct(brna, "LatticePoint", NULL);
RNA_def_struct_sdna(srna, "BPoint"); RNA_def_struct_sdna(srna, "BPoint");
RNA_def_struct_ui_text(srna, "LatticePoint", "Point in the lattice grid"); RNA_def_struct_ui_text(srna, "LatticePoint", "Point in the lattice grid");
RNA_def_struct_path_func(srna, "rna_LatticePoint_path"); RNA_def_struct_path_func(srna, "rna_LatticePoint_path");
prop= RNA_def_property(srna, "co", PROP_FLOAT, PROP_TRANSLATION); prop = RNA_def_property(srna, "co", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_array(prop, 3); RNA_def_property_array(prop, 3);
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_float_funcs(prop, "rna_LatticePoint_co_get", NULL, NULL); RNA_def_property_float_funcs(prop, "rna_LatticePoint_co_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Location", ""); RNA_def_property_ui_text(prop, "Location", "");
prop= RNA_def_property(srna, "co_deform", PROP_FLOAT, PROP_TRANSLATION); prop = RNA_def_property(srna, "co_deform", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "vec"); RNA_def_property_float_sdna(prop, NULL, "vec");
RNA_def_property_array(prop, 3); RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Deformed Location", ""); RNA_def_property_ui_text(prop, "Deformed Location", "");
RNA_def_property_update(prop, 0, "rna_Lattice_update_data"); RNA_def_property_update(prop, 0, "rna_Lattice_update_data");
prop= RNA_def_property(srna, "groups", PROP_COLLECTION, PROP_NONE); prop = RNA_def_property(srna, "groups", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_funcs(prop, "rna_LatticePoint_groups_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", NULL, NULL, NULL, NULL); RNA_def_property_collection_funcs(prop, "rna_LatticePoint_groups_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", NULL, NULL, NULL, NULL);
RNA_def_property_struct_type(prop, "VertexGroupElement"); RNA_def_property_struct_type(prop, "VertexGroupElement");
RNA_def_property_ui_text(prop, "Groups", "Weights for the vertex groups this point is member of"); RNA_def_property_ui_text(prop, "Groups", "Weights for the vertex groups this point is member of");
@@ -252,11 +252,11 @@ static void rna_def_lattice(BlenderRNA *brna)
{KEY_BSPLINE, "KEY_BSPLINE", 0, "BSpline", ""}, {KEY_BSPLINE, "KEY_BSPLINE", 0, "BSpline", ""},
{0, NULL, 0, NULL, NULL}}; {0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "Lattice", "ID"); srna = RNA_def_struct(brna, "Lattice", "ID");
RNA_def_struct_ui_text(srna, "Lattice", "Lattice datablock defining a grid for deforming other objects"); RNA_def_struct_ui_text(srna, "Lattice", "Lattice datablock defining a grid for deforming other objects");
RNA_def_struct_ui_icon(srna, ICON_LATTICE_DATA); RNA_def_struct_ui_icon(srna, ICON_LATTICE_DATA);
prop= RNA_def_property(srna, "points_u", PROP_INT, PROP_NONE); prop = RNA_def_property(srna, "points_u", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "pntsu"); RNA_def_property_int_sdna(prop, NULL, "pntsu");
RNA_def_property_int_funcs(prop, NULL, "rna_Lattice_points_u_set", NULL); RNA_def_property_int_funcs(prop, NULL, "rna_Lattice_points_u_set", NULL);
RNA_def_property_range(prop, 1, 64); RNA_def_property_range(prop, 1, 64);
@@ -264,7 +264,7 @@ static void rna_def_lattice(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_Lattice_update_size"); RNA_def_property_update(prop, 0, "rna_Lattice_update_size");
RNA_def_property_editable_func(prop, "rna_Lattice_size_editable"); RNA_def_property_editable_func(prop, "rna_Lattice_size_editable");
prop= RNA_def_property(srna, "points_v", PROP_INT, PROP_NONE); prop = RNA_def_property(srna, "points_v", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "pntsv"); RNA_def_property_int_sdna(prop, NULL, "pntsv");
RNA_def_property_int_funcs(prop, NULL, "rna_Lattice_points_v_set", NULL); RNA_def_property_int_funcs(prop, NULL, "rna_Lattice_points_v_set", NULL);
RNA_def_property_range(prop, 1, 64); RNA_def_property_range(prop, 1, 64);
@@ -272,7 +272,7 @@ static void rna_def_lattice(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_Lattice_update_size"); RNA_def_property_update(prop, 0, "rna_Lattice_update_size");
RNA_def_property_editable_func(prop, "rna_Lattice_size_editable"); RNA_def_property_editable_func(prop, "rna_Lattice_size_editable");
prop= RNA_def_property(srna, "points_w", PROP_INT, PROP_NONE); prop = RNA_def_property(srna, "points_w", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "pntsw"); RNA_def_property_int_sdna(prop, NULL, "pntsw");
RNA_def_property_int_funcs(prop, NULL, "rna_Lattice_points_w_set", NULL); RNA_def_property_int_funcs(prop, NULL, "rna_Lattice_points_w_set", NULL);
RNA_def_property_range(prop, 1, 64); RNA_def_property_range(prop, 1, 64);
@@ -280,41 +280,41 @@ static void rna_def_lattice(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_Lattice_update_size"); RNA_def_property_update(prop, 0, "rna_Lattice_update_size");
RNA_def_property_editable_func(prop, "rna_Lattice_size_editable"); RNA_def_property_editable_func(prop, "rna_Lattice_size_editable");
prop= RNA_def_property(srna, "interpolation_type_u", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "interpolation_type_u", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "typeu"); RNA_def_property_enum_sdna(prop, NULL, "typeu");
RNA_def_property_enum_items(prop, prop_keyblock_type_items); RNA_def_property_enum_items(prop, prop_keyblock_type_items);
RNA_def_property_ui_text(prop, "Interpolation Type U", ""); RNA_def_property_ui_text(prop, "Interpolation Type U", "");
RNA_def_property_update(prop, 0, "rna_Lattice_update_data"); RNA_def_property_update(prop, 0, "rna_Lattice_update_data");
prop= RNA_def_property(srna, "interpolation_type_v", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "interpolation_type_v", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "typev"); RNA_def_property_enum_sdna(prop, NULL, "typev");
RNA_def_property_enum_items(prop, prop_keyblock_type_items); RNA_def_property_enum_items(prop, prop_keyblock_type_items);
RNA_def_property_ui_text(prop, "Interpolation Type V", ""); RNA_def_property_ui_text(prop, "Interpolation Type V", "");
RNA_def_property_update(prop, 0, "rna_Lattice_update_data"); RNA_def_property_update(prop, 0, "rna_Lattice_update_data");
prop= RNA_def_property(srna, "interpolation_type_w", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "interpolation_type_w", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "typew"); RNA_def_property_enum_sdna(prop, NULL, "typew");
RNA_def_property_enum_items(prop, prop_keyblock_type_items); RNA_def_property_enum_items(prop, prop_keyblock_type_items);
RNA_def_property_ui_text(prop, "Interpolation Type W", ""); RNA_def_property_ui_text(prop, "Interpolation Type W", "");
RNA_def_property_update(prop, 0, "rna_Lattice_update_data"); RNA_def_property_update(prop, 0, "rna_Lattice_update_data");
prop= RNA_def_property(srna, "use_outside", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_outside", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", LT_OUTSIDE); RNA_def_property_boolean_sdna(prop, NULL, "flag", LT_OUTSIDE);
RNA_def_property_boolean_funcs(prop, NULL, "rna_Lattice_use_outside_set"); RNA_def_property_boolean_funcs(prop, NULL, "rna_Lattice_use_outside_set");
RNA_def_property_ui_text(prop, "Outside", "Only draw, and take into account, the outer vertices"); RNA_def_property_ui_text(prop, "Outside", "Only draw, and take into account, the outer vertices");
RNA_def_property_update(prop, 0, "rna_Lattice_update_data"); RNA_def_property_update(prop, 0, "rna_Lattice_update_data");
prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE); prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "vgroup"); RNA_def_property_string_sdna(prop, NULL, "vgroup");
RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group to apply the influence of the lattice"); RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group to apply the influence of the lattice");
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Lattice_vg_name_set"); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Lattice_vg_name_set");
RNA_def_property_update(prop, 0, "rna_Lattice_update_data"); RNA_def_property_update(prop, 0, "rna_Lattice_update_data");
prop= RNA_def_property(srna, "shape_keys", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "shape_keys", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "key"); RNA_def_property_pointer_sdna(prop, NULL, "key");
RNA_def_property_ui_text(prop, "Shape Keys", ""); RNA_def_property_ui_text(prop, "Shape Keys", "");
prop= RNA_def_property(srna, "points", PROP_COLLECTION, PROP_NONE); prop = RNA_def_property(srna, "points", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "LatticePoint"); RNA_def_property_struct_type(prop, "LatticePoint");
RNA_def_property_collection_funcs(prop, "rna_Lattice_points_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", NULL, NULL, NULL, NULL); RNA_def_property_collection_funcs(prop, "rna_Lattice_points_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", NULL, NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Points", "Points of the lattice"); RNA_def_property_ui_text(prop, "Points", "Points of the lattice");

View File

@@ -50,9 +50,9 @@ static int rna_Main_is_saved_get(PointerRNA *UNUSED(ptr))
static int rna_Main_is_dirty_get(PointerRNA *ptr) static int rna_Main_is_dirty_get(PointerRNA *ptr)
{ {
/* XXX, not totally nice to do it this way, should store in main ? */ /* XXX, not totally nice to do it this way, should store in main ? */
Main *bmain= (Main*)ptr->data; Main *bmain = (Main*)ptr->data;
wmWindowManager *wm; wmWindowManager *wm;
for(wm= bmain->wm.first; wm; wm= wm->id.next) { for (wm = bmain->wm.first; wm; wm = wm->id.next) {
return !wm->file_saved; return !wm->file_saved;
} }
@@ -61,195 +61,195 @@ static int rna_Main_is_dirty_get(PointerRNA *ptr)
static void rna_Main_filepath_get(PointerRNA *ptr, char *value) static void rna_Main_filepath_get(PointerRNA *ptr, char *value)
{ {
Main *bmain= (Main*)ptr->data; Main *bmain = (Main*)ptr->data;
BLI_strncpy(value, bmain->name, sizeof(bmain->name)); BLI_strncpy(value, bmain->name, sizeof(bmain->name));
} }
static int rna_Main_filepath_length(PointerRNA *ptr) static int rna_Main_filepath_length(PointerRNA *ptr)
{ {
Main *bmain= (Main*)ptr->data; Main *bmain = (Main*)ptr->data;
return strlen(bmain->name); return strlen(bmain->name);
} }
#if 0 #if 0
static void rna_Main_filepath_set(PointerRNA *ptr, const char *value) static void rna_Main_filepath_set(PointerRNA *ptr, const char *value)
{ {
Main *bmain= (Main*)ptr->data; Main *bmain = (Main*)ptr->data;
BLI_strncpy(bmain->name, value, sizeof(bmain->name)); BLI_strncpy(bmain->name, value, sizeof(bmain->name));
} }
#endif #endif
static void rna_Main_scene_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) static void rna_Main_scene_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{ {
Main *bmain= (Main*)ptr->data; Main *bmain = (Main*)ptr->data;
rna_iterator_listbase_begin(iter, &bmain->scene, NULL); rna_iterator_listbase_begin(iter, &bmain->scene, NULL);
} }
static void rna_Main_object_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) static void rna_Main_object_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{ {
Main *bmain= (Main*)ptr->data; Main *bmain = (Main*)ptr->data;
rna_iterator_listbase_begin(iter, &bmain->object, NULL); rna_iterator_listbase_begin(iter, &bmain->object, NULL);
} }
static void rna_Main_lamp_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) static void rna_Main_lamp_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{ {
Main *bmain= (Main*)ptr->data; Main *bmain = (Main*)ptr->data;
rna_iterator_listbase_begin(iter, &bmain->lamp, NULL); rna_iterator_listbase_begin(iter, &bmain->lamp, NULL);
} }
static void rna_Main_library_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) static void rna_Main_library_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{ {
Main *bmain= (Main*)ptr->data; Main *bmain = (Main*)ptr->data;
rna_iterator_listbase_begin(iter, &bmain->library, NULL); rna_iterator_listbase_begin(iter, &bmain->library, NULL);
} }
static void rna_Main_mesh_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) static void rna_Main_mesh_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{ {
Main *bmain= (Main*)ptr->data; Main *bmain = (Main*)ptr->data;
rna_iterator_listbase_begin(iter, &bmain->mesh, NULL); rna_iterator_listbase_begin(iter, &bmain->mesh, NULL);
} }
static void rna_Main_curve_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) static void rna_Main_curve_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{ {
Main *bmain= (Main*)ptr->data; Main *bmain = (Main*)ptr->data;
rna_iterator_listbase_begin(iter, &bmain->curve, NULL); rna_iterator_listbase_begin(iter, &bmain->curve, NULL);
} }
static void rna_Main_mball_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) static void rna_Main_mball_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{ {
Main *bmain= (Main*)ptr->data; Main *bmain = (Main*)ptr->data;
rna_iterator_listbase_begin(iter, &bmain->mball, NULL); rna_iterator_listbase_begin(iter, &bmain->mball, NULL);
} }
static void rna_Main_mat_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) static void rna_Main_mat_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{ {
Main *bmain= (Main*)ptr->data; Main *bmain = (Main*)ptr->data;
rna_iterator_listbase_begin(iter, &bmain->mat, NULL); rna_iterator_listbase_begin(iter, &bmain->mat, NULL);
} }
static void rna_Main_tex_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) static void rna_Main_tex_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{ {
Main *bmain= (Main*)ptr->data; Main *bmain = (Main*)ptr->data;
rna_iterator_listbase_begin(iter, &bmain->tex, NULL); rna_iterator_listbase_begin(iter, &bmain->tex, NULL);
} }
static void rna_Main_image_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) static void rna_Main_image_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{ {
Main *bmain= (Main*)ptr->data; Main *bmain = (Main*)ptr->data;
rna_iterator_listbase_begin(iter, &bmain->image, NULL); rna_iterator_listbase_begin(iter, &bmain->image, NULL);
} }
static void rna_Main_latt_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) static void rna_Main_latt_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{ {
Main *bmain= (Main*)ptr->data; Main *bmain = (Main*)ptr->data;
rna_iterator_listbase_begin(iter, &bmain->latt, NULL); rna_iterator_listbase_begin(iter, &bmain->latt, NULL);
} }
static void rna_Main_camera_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) static void rna_Main_camera_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{ {
Main *bmain= (Main*)ptr->data; Main *bmain = (Main*)ptr->data;
rna_iterator_listbase_begin(iter, &bmain->camera, NULL); rna_iterator_listbase_begin(iter, &bmain->camera, NULL);
} }
static void rna_Main_key_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) static void rna_Main_key_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{ {
Main *bmain= (Main*)ptr->data; Main *bmain = (Main*)ptr->data;
rna_iterator_listbase_begin(iter, &bmain->key, NULL); rna_iterator_listbase_begin(iter, &bmain->key, NULL);
} }
static void rna_Main_world_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) static void rna_Main_world_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{ {
Main *bmain= (Main*)ptr->data; Main *bmain = (Main*)ptr->data;
rna_iterator_listbase_begin(iter, &bmain->world, NULL); rna_iterator_listbase_begin(iter, &bmain->world, NULL);
} }
static void rna_Main_screen_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) static void rna_Main_screen_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{ {
Main *bmain= (Main*)ptr->data; Main *bmain = (Main*)ptr->data;
rna_iterator_listbase_begin(iter, &bmain->screen, NULL); rna_iterator_listbase_begin(iter, &bmain->screen, NULL);
} }
static void rna_Main_script_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) static void rna_Main_script_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{ {
Main *bmain= (Main*)ptr->data; Main *bmain = (Main*)ptr->data;
rna_iterator_listbase_begin(iter, &bmain->script, NULL); rna_iterator_listbase_begin(iter, &bmain->script, NULL);
} }
static void rna_Main_font_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) static void rna_Main_font_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{ {
Main *bmain= (Main*)ptr->data; Main *bmain = (Main*)ptr->data;
rna_iterator_listbase_begin(iter, &bmain->vfont, NULL); rna_iterator_listbase_begin(iter, &bmain->vfont, NULL);
} }
static void rna_Main_text_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) static void rna_Main_text_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{ {
Main *bmain= (Main*)ptr->data; Main *bmain = (Main*)ptr->data;
rna_iterator_listbase_begin(iter, &bmain->text, NULL); rna_iterator_listbase_begin(iter, &bmain->text, NULL);
} }
static void rna_Main_speaker_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) static void rna_Main_speaker_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{ {
Main *bmain= (Main*)ptr->data; Main *bmain = (Main*)ptr->data;
rna_iterator_listbase_begin(iter, &bmain->speaker, NULL); rna_iterator_listbase_begin(iter, &bmain->speaker, NULL);
} }
static void rna_Main_sound_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) static void rna_Main_sound_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{ {
Main *bmain= (Main*)ptr->data; Main *bmain = (Main*)ptr->data;
rna_iterator_listbase_begin(iter, &bmain->sound, NULL); rna_iterator_listbase_begin(iter, &bmain->sound, NULL);
} }
static void rna_Main_group_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) static void rna_Main_group_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{ {
Main *bmain= (Main*)ptr->data; Main *bmain = (Main*)ptr->data;
rna_iterator_listbase_begin(iter, &bmain->group, NULL); rna_iterator_listbase_begin(iter, &bmain->group, NULL);
} }
static void rna_Main_armature_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) static void rna_Main_armature_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{ {
Main *bmain= (Main*)ptr->data; Main *bmain = (Main*)ptr->data;
rna_iterator_listbase_begin(iter, &bmain->armature, NULL); rna_iterator_listbase_begin(iter, &bmain->armature, NULL);
} }
static void rna_Main_action_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) static void rna_Main_action_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{ {
Main *bmain= (Main*)ptr->data; Main *bmain = (Main*)ptr->data;
rna_iterator_listbase_begin(iter, &bmain->action, NULL); rna_iterator_listbase_begin(iter, &bmain->action, NULL);
} }
static void rna_Main_nodetree_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) static void rna_Main_nodetree_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{ {
Main *bmain= (Main*)ptr->data; Main *bmain = (Main*)ptr->data;
rna_iterator_listbase_begin(iter, &bmain->nodetree, NULL); rna_iterator_listbase_begin(iter, &bmain->nodetree, NULL);
} }
static void rna_Main_brush_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) static void rna_Main_brush_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{ {
Main *bmain= (Main*)ptr->data; Main *bmain = (Main*)ptr->data;
rna_iterator_listbase_begin(iter, &bmain->brush, NULL); rna_iterator_listbase_begin(iter, &bmain->brush, NULL);
} }
static void rna_Main_particle_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) static void rna_Main_particle_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{ {
Main *bmain= (Main*)ptr->data; Main *bmain = (Main*)ptr->data;
rna_iterator_listbase_begin(iter, &bmain->particle, NULL); rna_iterator_listbase_begin(iter, &bmain->particle, NULL);
} }
static void rna_Main_gpencil_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) static void rna_Main_gpencil_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{ {
Main *bmain= (Main*)ptr->data; Main *bmain = (Main*)ptr->data;
rna_iterator_listbase_begin(iter, &bmain->gpencil, NULL); rna_iterator_listbase_begin(iter, &bmain->gpencil, NULL);
} }
static void rna_Main_wm_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) static void rna_Main_wm_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{ {
Main *bmain= (Main*)ptr->data; Main *bmain = (Main*)ptr->data;
rna_iterator_listbase_begin(iter, &bmain->wm, NULL); rna_iterator_listbase_begin(iter, &bmain->wm, NULL);
} }
static void rna_Main_movieclips_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) static void rna_Main_movieclips_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{ {
Main *bmain= (Main*)ptr->data; Main *bmain = (Main*)ptr->data;
rna_iterator_listbase_begin(iter, &bmain->movieclip, NULL); rna_iterator_listbase_begin(iter, &bmain->movieclip, NULL);
} }
@@ -257,8 +257,8 @@ static void rna_Main_movieclips_begin(CollectionPropertyIterator *iter, PointerR
static PointerRNA rna_Test_test_get(PointerRNA *ptr) static PointerRNA rna_Test_test_get(PointerRNA *ptr)
{ {
PointerRNA ret= *ptr; PointerRNA ret = *ptr;
ret.type= &RNA_Test; ret.type = &RNA_Test;
return ret; return ret;
} }
@@ -286,7 +286,7 @@ void RNA_def_main(BlenderRNA *brna)
CollectionDefFunc *func; CollectionDefFunc *func;
/* plural must match idtypes in readblenentry.c */ /* plural must match idtypes in readblenentry.c */
MainCollectionDef lists[]= { MainCollectionDef lists[] = {
{"cameras", "Camera", "rna_Main_camera_begin", "Cameras", "Camera datablocks", RNA_def_main_cameras}, {"cameras", "Camera", "rna_Main_camera_begin", "Cameras", "Camera datablocks", RNA_def_main_cameras},
{"scenes", "Scene", "rna_Main_scene_begin", "Scenes", "Scene datablocks", RNA_def_main_scenes}, {"scenes", "Scene", "rna_Main_scene_begin", "Scenes", "Scene datablocks", RNA_def_main_scenes},
{"objects", "Object", "rna_Main_object_begin", "Objects", "Object datablocks", RNA_def_main_objects}, {"objects", "Object", "rna_Main_object_begin", "Objects", "Object datablocks", RNA_def_main_objects},
@@ -320,36 +320,36 @@ void RNA_def_main(BlenderRNA *brna)
int i; int i;
srna= RNA_def_struct(brna, "BlendData", NULL); srna = RNA_def_struct(brna, "BlendData", NULL);
RNA_def_struct_ui_text(srna, "Blendfile Data", "Main data structure representing a .blend file and all its datablocks"); RNA_def_struct_ui_text(srna, "Blendfile Data", "Main data structure representing a .blend file and all its datablocks");
RNA_def_struct_ui_icon(srna, ICON_BLENDER); RNA_def_struct_ui_icon(srna, ICON_BLENDER);
prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH); prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
RNA_def_property_string_maxlength(prop, FILE_MAX); RNA_def_property_string_maxlength(prop, FILE_MAX);
RNA_def_property_string_funcs(prop, "rna_Main_filepath_get", "rna_Main_filepath_length", "rna_Main_filepath_set"); RNA_def_property_string_funcs(prop, "rna_Main_filepath_get", "rna_Main_filepath_length", "rna_Main_filepath_set");
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Filename", "Path to the .blend file"); RNA_def_property_ui_text(prop, "Filename", "Path to the .blend file");
prop= RNA_def_property(srna, "is_dirty", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "is_dirty", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_funcs(prop, "rna_Main_is_dirty_get", NULL); RNA_def_property_boolean_funcs(prop, "rna_Main_is_dirty_get", NULL);
RNA_def_property_ui_text(prop, "File Has Unsaved Changes", "Have recent edits been saved to disk"); RNA_def_property_ui_text(prop, "File Has Unsaved Changes", "Have recent edits been saved to disk");
prop= RNA_def_property(srna, "is_saved", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "is_saved", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_funcs(prop, "rna_Main_is_saved_get", NULL); RNA_def_property_boolean_funcs(prop, "rna_Main_is_saved_get", NULL);
RNA_def_property_ui_text(prop, "File is Saved", "Has the current session been saved to disk as a .blend file"); RNA_def_property_ui_text(prop, "File is Saved", "Has the current session been saved to disk as a .blend file");
for(i=0; lists[i].name; i++) for (i = 0; lists[i].name; i++)
{ {
prop= RNA_def_property(srna, lists[i].identifier, PROP_COLLECTION, PROP_NONE); prop = RNA_def_property(srna, lists[i].identifier, PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, lists[i].type); RNA_def_property_struct_type(prop, lists[i].type);
RNA_def_property_collection_funcs(prop, lists[i].iter_begin, "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", NULL, NULL, NULL, NULL); RNA_def_property_collection_funcs(prop, lists[i].iter_begin, "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", NULL, NULL, NULL, NULL);
RNA_def_property_ui_text(prop, lists[i].name, lists[i].description); RNA_def_property_ui_text(prop, lists[i].name, lists[i].description);
/* collection functions */ /* collection functions */
func= lists[i].func; func = lists[i].func;
if(func) if (func)
func(brna, prop); func(brna, prop);
} }
@@ -359,7 +359,7 @@ void RNA_def_main(BlenderRNA *brna)
RNA_define_verify_sdna(0); RNA_define_verify_sdna(0);
prop= RNA_def_property(srna, "test", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "test", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Test"); RNA_def_property_struct_type(prop, "Test");
RNA_def_property_pointer_funcs(prop, "rna_Test_test_get", NULL, NULL, NULL); RNA_def_property_pointer_funcs(prop, "rna_Test_test_get", NULL, NULL, NULL);

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -44,8 +44,8 @@
void RNA_api_material(StructRNA *srna) void RNA_api_material(StructRNA *srna)
{ {
// FunctionRNA *func; /* FunctionRNA *func; */
// PropertyRNA *parm; /* PropertyRNA *parm; */
} }
#endif #endif

View File

@@ -57,31 +57,31 @@ void RNA_api_mesh(StructRNA *srna)
FunctionRNA *func; FunctionRNA *func;
PropertyRNA *parm; PropertyRNA *parm;
func= RNA_def_function(srna, "transform", "ED_mesh_transform"); func = RNA_def_function(srna, "transform", "ED_mesh_transform");
RNA_def_function_ui_description(func, "Transform mesh vertices by a matrix"); RNA_def_function_ui_description(func, "Transform mesh vertices by a matrix");
parm= RNA_def_float_matrix(func, "matrix", 4, 4, NULL, 0.0f, 0.0f, "", "Matrix", 0.0f, 0.0f); parm = RNA_def_float_matrix(func, "matrix", 4, 4, NULL, 0.0f, 0.0f, "", "Matrix", 0.0f, 0.0f);
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
func= RNA_def_function(srna, "calc_normals", "ED_mesh_calc_normals"); func = RNA_def_function(srna, "calc_normals", "ED_mesh_calc_normals");
RNA_def_function_ui_description(func, "Calculate vertex normals"); RNA_def_function_ui_description(func, "Calculate vertex normals");
func= RNA_def_function(srna, "update", "ED_mesh_update"); func = RNA_def_function(srna, "update", "ED_mesh_update");
RNA_def_boolean(func, "calc_edges", 0, "Calculate Edges", "Force recalculation of edges"); RNA_def_boolean(func, "calc_edges", 0, "Calculate Edges", "Force recalculation of edges");
RNA_def_boolean(func, "calc_tessface", 0, "Calculate Tessellation", "Force recalculation of tessellation faces"); RNA_def_boolean(func, "calc_tessface", 0, "Calculate Tessellation", "Force recalculation of tessellation faces");
RNA_def_function_flag(func, FUNC_USE_CONTEXT); RNA_def_function_flag(func, FUNC_USE_CONTEXT);
func= RNA_def_function(srna, "unit_test_compare", "rna_Mesh_unit_test_compare"); func = RNA_def_function(srna, "unit_test_compare", "rna_Mesh_unit_test_compare");
parm= RNA_def_pointer(func, "mesh", "Mesh", "", "Mesh to compare to"); parm = RNA_def_pointer(func, "mesh", "Mesh", "", "Mesh to compare to");
RNA_def_function_flag(func, FUNC_USE_CONTEXT); RNA_def_function_flag(func, FUNC_USE_CONTEXT);
/* return value */ /* return value */
parm= RNA_def_string(func, "result", "nothing", 64, "Return value", "String description of result of comparison"); parm = RNA_def_string(func, "result", "nothing", 64, "Return value", "String description of result of comparison");
RNA_def_function_return(func, parm); RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "validate", "BKE_mesh_validate"); func = RNA_def_function(srna, "validate", "BKE_mesh_validate");
RNA_def_function_ui_description(func, "validate geometry, return True when the mesh has had " RNA_def_function_ui_description(func, "validate geometry, return True when the mesh has had "
"invalid geometry corrected/removed"); "invalid geometry corrected/removed");
RNA_def_boolean(func, "verbose", 0, "Verbose", "Output information about the errors found"); RNA_def_boolean(func, "verbose", 0, "Verbose", "Output information about the errors found");
parm= RNA_def_boolean(func, "result", 0, "Result", ""); parm = RNA_def_boolean(func, "result", 0, "Result", "");
RNA_def_function_return(func, parm); RNA_def_function_return(func, parm);
} }

View File

@@ -39,7 +39,7 @@
\ \
static int rna_##collection_name##_check(CollectionPropertyIterator *iter, void *data) \ static int rna_##collection_name##_check(CollectionPropertyIterator *iter, void *data) \
{ \ { \
CustomDataLayer *layer= (CustomDataLayer*)data; \ CustomDataLayer *layer = (CustomDataLayer*)data; \
return (layer->type != layer_type); \ return (layer->type != layer_type); \
} \ } \
\ \
@@ -57,11 +57,11 @@
\ \
static void rna_Mesh_##collection_name##_index_range(PointerRNA *ptr, int *min, int *max) \ static void rna_Mesh_##collection_name##_index_range(PointerRNA *ptr, int *min, int *max) \
{ \ { \
CustomData *data= rna_mesh_##customdata_type(ptr); \ CustomData *data = rna_mesh_##customdata_type(ptr); \
\ \
*min= 0; \ *min = 0; \
*max= data ? CustomData_number_of_layers(data, layer_type) - 1 : 0; \ *max = data ? CustomData_number_of_layers(data, layer_type) - 1 : 0; \
*max= MAX2(0, *max); \ *max = MAX2(0, *max); \
} }
/* Define the accessors for special CustomDataLayers in the collection /* Define the accessors for special CustomDataLayers in the collection
@@ -71,8 +71,8 @@
static PointerRNA rna_Mesh_##collection_name##_##active_type##_get(PointerRNA *ptr) \ static PointerRNA rna_Mesh_##collection_name##_##active_type##_get(PointerRNA *ptr) \
{ \ { \
CustomData *data = rna_mesh_##customdata_type(ptr); \ CustomData *data = rna_mesh_##customdata_type(ptr); \
int index= CustomData_get_##active_type##_layer_index(data, layer_type); \ int index = CustomData_get_##active_type##_layer_index(data, layer_type); \
CustomDataLayer *cdl= (index == -1)? NULL: &data->layers[index]; \ CustomDataLayer *cdl = (index == -1)? NULL: &data->layers[index]; \
\ \
return rna_pointer_inherit_refine(ptr, &RNA_##layer_rna_type, cdl); \ return rna_pointer_inherit_refine(ptr, &RNA_##layer_rna_type, cdl); \
} \ } \
@@ -84,8 +84,8 @@
CustomDataLayer *cdl; \ CustomDataLayer *cdl; \
int a; \ int a; \
\ \
for(cdl=data->layers, a=0; a<data->totlayer; cdl++, a++) { \ for (cdl = data->layers, a = 0; a<data->totlayer; cdl++, a++) { \
if(value.data == cdl) { \ if (value.data == cdl) { \
CustomData_set_layer_##active_type##_index(data, layer_type, a); \ CustomData_set_layer_##active_type##_index(data, layer_type, a); \
mesh_update_customdata_pointers(me, TRUE); \ mesh_update_customdata_pointers(me, TRUE); \
return; \ return; \

View File

@@ -53,13 +53,13 @@
static int rna_Meta_texspace_editable(PointerRNA *ptr) static int rna_Meta_texspace_editable(PointerRNA *ptr)
{ {
MetaBall *mb= (MetaBall*)ptr->data; MetaBall *mb = (MetaBall*)ptr->data;
return (mb->texflag & MB_AUTOSPACE)? 0: PROP_EDITABLE; return (mb->texflag & MB_AUTOSPACE)? 0: PROP_EDITABLE;
} }
static void rna_Meta_texspace_loc_get(PointerRNA *ptr, float *values) static void rna_Meta_texspace_loc_get(PointerRNA *ptr, float *values)
{ {
MetaBall *mb= (MetaBall*)ptr->data; MetaBall *mb = (MetaBall*)ptr->data;
/* tex_space_mball() needs object.. ugh */ /* tex_space_mball() needs object.. ugh */
@@ -68,14 +68,14 @@ static void rna_Meta_texspace_loc_get(PointerRNA *ptr, float *values)
static void rna_Meta_texspace_loc_set(PointerRNA *ptr, const float *values) static void rna_Meta_texspace_loc_set(PointerRNA *ptr, const float *values)
{ {
MetaBall *mb= (MetaBall*)ptr->data; MetaBall *mb = (MetaBall*)ptr->data;
copy_v3_v3(mb->loc, values); copy_v3_v3(mb->loc, values);
} }
static void rna_Meta_texspace_size_get(PointerRNA *ptr, float *values) static void rna_Meta_texspace_size_get(PointerRNA *ptr, float *values)
{ {
MetaBall *mb= (MetaBall*)ptr->data; MetaBall *mb = (MetaBall*)ptr->data;
/* tex_space_mball() needs object.. ugh */ /* tex_space_mball() needs object.. ugh */
@@ -84,7 +84,7 @@ static void rna_Meta_texspace_size_get(PointerRNA *ptr, float *values)
static void rna_Meta_texspace_size_set(PointerRNA *ptr, const float *values) static void rna_Meta_texspace_size_set(PointerRNA *ptr, const float *values)
{ {
MetaBall *mb= (MetaBall*)ptr->data; MetaBall *mb = (MetaBall*)ptr->data;
copy_v3_v3(mb->size, values); copy_v3_v3(mb->size, values);
} }
@@ -92,13 +92,13 @@ static void rna_Meta_texspace_size_set(PointerRNA *ptr, const float *values)
static void rna_MetaBall_update_data(Main *bmain, Scene *scene, PointerRNA *ptr) static void rna_MetaBall_update_data(Main *bmain, Scene *scene, PointerRNA *ptr)
{ {
MetaBall *mb= ptr->id.data; MetaBall *mb = ptr->id.data;
Object *ob; Object *ob;
/* cheating way for importers to avoid slow updates */ /* cheating way for importers to avoid slow updates */
if(mb->id.us > 0) { if (mb->id.us > 0) {
for(ob=bmain->object.first; ob; ob= ob->id.next) for (ob = bmain->object.first; ob; ob = ob->id.next)
if(ob->data == mb) if (ob->data == mb)
copy_mball_properties(scene, ob); copy_mball_properties(scene, ob);
DAG_id_tag_update(&mb->id, 0); DAG_id_tag_update(&mb->id, 0);
@@ -108,17 +108,17 @@ static void rna_MetaBall_update_data(Main *bmain, Scene *scene, PointerRNA *ptr)
static void rna_MetaBall_update_rotation(Main *bmain, Scene *scene, PointerRNA *ptr) static void rna_MetaBall_update_rotation(Main *bmain, Scene *scene, PointerRNA *ptr)
{ {
MetaElem *ml= ptr->data; MetaElem *ml = ptr->data;
normalize_qt(ml->quat); normalize_qt(ml->quat);
rna_MetaBall_update_data(bmain, scene, ptr); rna_MetaBall_update_data(bmain, scene, ptr);
} }
static MetaElem *rna_MetaBall_elements_new(MetaBall *mb, int type) static MetaElem *rna_MetaBall_elements_new(MetaBall *mb, int type)
{ {
MetaElem *ml= add_metaball_element(mb, type); MetaElem *ml = add_metaball_element(mb, type);
/* cheating way for importers to avoid slow updates */ /* cheating way for importers to avoid slow updates */
if(mb->id.us > 0) { if (mb->id.us > 0) {
DAG_id_tag_update(&mb->id, 0); DAG_id_tag_update(&mb->id, 0);
WM_main_add_notifier(NC_GEOM|ND_DATA, &mb->id); WM_main_add_notifier(NC_GEOM|ND_DATA, &mb->id);
} }
@@ -128,11 +128,11 @@ static MetaElem *rna_MetaBall_elements_new(MetaBall *mb, int type)
static void rna_MetaBall_elements_remove(MetaBall *mb, ReportList *reports, MetaElem *ml) static void rna_MetaBall_elements_remove(MetaBall *mb, ReportList *reports, MetaElem *ml)
{ {
int found= 0; int found = 0;
found= BLI_remlink_safe(&mb->elems, ml); found = BLI_remlink_safe(&mb->elems, ml);
if(!found) { if (!found) {
BKE_reportf(reports, RPT_ERROR, "Metaball \"%s\" does not contain spline given", mb->id.name+2); BKE_reportf(reports, RPT_ERROR, "Metaball \"%s\" does not contain spline given", mb->id.name+2);
return; return;
} }
@@ -141,7 +141,7 @@ static void rna_MetaBall_elements_remove(MetaBall *mb, ReportList *reports, Meta
/* invalidate pointer!, no can do */ /* invalidate pointer!, no can do */
/* cheating way for importers to avoid slow updates */ /* cheating way for importers to avoid slow updates */
if(mb->id.us > 0) { if (mb->id.us > 0) {
DAG_id_tag_update(&mb->id, 0); DAG_id_tag_update(&mb->id, 0);
WM_main_add_notifier(NC_GEOM|ND_DATA, &mb->id); WM_main_add_notifier(NC_GEOM|ND_DATA, &mb->id);
} }
@@ -152,7 +152,7 @@ static void rna_MetaBall_elements_clear(MetaBall *mb)
BLI_freelistN(&mb->elems); BLI_freelistN(&mb->elems);
/* cheating way for importers to avoid slow updates */ /* cheating way for importers to avoid slow updates */
if(mb->id.us > 0) { if (mb->id.us > 0) {
DAG_id_tag_update(&mb->id, 0); DAG_id_tag_update(&mb->id, 0);
WM_main_add_notifier(NC_GEOM|ND_DATA, &mb->id); WM_main_add_notifier(NC_GEOM|ND_DATA, &mb->id);
} }
@@ -165,66 +165,66 @@ static void rna_def_metaelement(BlenderRNA *brna)
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
srna= RNA_def_struct(brna, "MetaElement", NULL); srna = RNA_def_struct(brna, "MetaElement", NULL);
RNA_def_struct_sdna(srna, "MetaElem"); RNA_def_struct_sdna(srna, "MetaElem");
RNA_def_struct_ui_text(srna, "Meta Element", "Blobby element in a Metaball datablock"); RNA_def_struct_ui_text(srna, "Meta Element", "Blobby element in a Metaball datablock");
RNA_def_struct_ui_icon(srna, ICON_OUTLINER_DATA_META); RNA_def_struct_ui_icon(srna, ICON_OUTLINER_DATA_META);
/* enums */ /* enums */
prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, metaelem_type_items); RNA_def_property_enum_items(prop, metaelem_type_items);
RNA_def_property_ui_text(prop, "Type", "Metaball types"); RNA_def_property_ui_text(prop, "Type", "Metaball types");
RNA_def_property_update(prop, 0, "rna_MetaBall_update_data"); RNA_def_property_update(prop, 0, "rna_MetaBall_update_data");
/* number values */ /* number values */
prop= RNA_def_property(srna, "co", PROP_FLOAT, PROP_TRANSLATION); prop = RNA_def_property(srna, "co", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "x"); RNA_def_property_float_sdna(prop, NULL, "x");
RNA_def_property_array(prop, 3); RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Location", ""); RNA_def_property_ui_text(prop, "Location", "");
RNA_def_property_update(prop, 0, "rna_MetaBall_update_data"); RNA_def_property_update(prop, 0, "rna_MetaBall_update_data");
prop= RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_QUATERNION); prop = RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_QUATERNION);
RNA_def_property_float_sdna(prop, NULL, "quat"); RNA_def_property_float_sdna(prop, NULL, "quat");
RNA_def_property_ui_text(prop, "Rotation", "Normalized quaternion rotation"); RNA_def_property_ui_text(prop, "Rotation", "Normalized quaternion rotation");
RNA_def_property_update(prop, 0, "rna_MetaBall_update_rotation"); RNA_def_property_update(prop, 0, "rna_MetaBall_update_rotation");
prop= RNA_def_property(srna, "radius", PROP_FLOAT, PROP_UNSIGNED|PROP_UNIT_LENGTH); prop = RNA_def_property(srna, "radius", PROP_FLOAT, PROP_UNSIGNED|PROP_UNIT_LENGTH);
RNA_def_property_float_sdna(prop, NULL, "rad"); RNA_def_property_float_sdna(prop, NULL, "rad");
RNA_def_property_ui_text(prop, "Radius", ""); RNA_def_property_ui_text(prop, "Radius", "");
RNA_def_property_range(prop, 0.0f, FLT_MAX); RNA_def_property_range(prop, 0.0f, FLT_MAX);
RNA_def_property_update(prop, 0, "rna_MetaBall_update_data"); RNA_def_property_update(prop, 0, "rna_MetaBall_update_data");
prop= RNA_def_property(srna, "size_x", PROP_FLOAT, PROP_DISTANCE); prop = RNA_def_property(srna, "size_x", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "expx"); RNA_def_property_float_sdna(prop, NULL, "expx");
RNA_def_property_range(prop, 0.0f, 20.0f); RNA_def_property_range(prop, 0.0f, 20.0f);
RNA_def_property_ui_text(prop, "Size X", "Size of element, use of components depends on element type"); RNA_def_property_ui_text(prop, "Size X", "Size of element, use of components depends on element type");
RNA_def_property_update(prop, 0, "rna_MetaBall_update_data"); RNA_def_property_update(prop, 0, "rna_MetaBall_update_data");
prop= RNA_def_property(srna, "size_y", PROP_FLOAT, PROP_DISTANCE); prop = RNA_def_property(srna, "size_y", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "expy"); RNA_def_property_float_sdna(prop, NULL, "expy");
RNA_def_property_range(prop, 0.0f, 20.0f); RNA_def_property_range(prop, 0.0f, 20.0f);
RNA_def_property_ui_text(prop, "Size Y", "Size of element, use of components depends on element type"); RNA_def_property_ui_text(prop, "Size Y", "Size of element, use of components depends on element type");
RNA_def_property_update(prop, 0, "rna_MetaBall_update_data"); RNA_def_property_update(prop, 0, "rna_MetaBall_update_data");
prop= RNA_def_property(srna, "size_z", PROP_FLOAT, PROP_DISTANCE); prop = RNA_def_property(srna, "size_z", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "expz"); RNA_def_property_float_sdna(prop, NULL, "expz");
RNA_def_property_range(prop, 0.0f, 20.0f); RNA_def_property_range(prop, 0.0f, 20.0f);
RNA_def_property_ui_text(prop, "Size Z", "Size of element, use of components depends on element type"); RNA_def_property_ui_text(prop, "Size Z", "Size of element, use of components depends on element type");
RNA_def_property_update(prop, 0, "rna_MetaBall_update_data"); RNA_def_property_update(prop, 0, "rna_MetaBall_update_data");
prop= RNA_def_property(srna, "stiffness", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "stiffness", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "s"); RNA_def_property_float_sdna(prop, NULL, "s");
RNA_def_property_range(prop, 0.0f, 10.0f); RNA_def_property_range(prop, 0.0f, 10.0f);
RNA_def_property_ui_text(prop, "Stiffness", "Stiffness defines how much of the element to fill"); RNA_def_property_ui_text(prop, "Stiffness", "Stiffness defines how much of the element to fill");
RNA_def_property_update(prop, 0, "rna_MetaBall_update_data"); RNA_def_property_update(prop, 0, "rna_MetaBall_update_data");
/* flags */ /* flags */
prop= RNA_def_property(srna, "use_negative", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_negative", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MB_NEGATIVE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MB_NEGATIVE);
RNA_def_property_ui_text(prop, "Negative", "Set metaball as negative one"); RNA_def_property_ui_text(prop, "Negative", "Set metaball as negative one");
RNA_def_property_update(prop, 0, "rna_MetaBall_update_data"); RNA_def_property_update(prop, 0, "rna_MetaBall_update_data");
prop= RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MB_HIDE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MB_HIDE);
RNA_def_property_ui_text(prop, "Hide", "Hide element"); RNA_def_property_ui_text(prop, "Hide", "Hide element");
RNA_def_property_update(prop, 0, "rna_MetaBall_update_data"); RNA_def_property_update(prop, 0, "rna_MetaBall_update_data");
@@ -240,26 +240,26 @@ static void rna_def_metaball_elements(BlenderRNA *brna, PropertyRNA *cprop)
PropertyRNA *parm; PropertyRNA *parm;
RNA_def_property_srna(cprop, "MetaBallElements"); RNA_def_property_srna(cprop, "MetaBallElements");
srna= RNA_def_struct(brna, "MetaBallElements", NULL); srna = RNA_def_struct(brna, "MetaBallElements", NULL);
RNA_def_struct_sdna(srna, "MetaBall"); RNA_def_struct_sdna(srna, "MetaBall");
RNA_def_struct_ui_text(srna, "Meta Elements", "Collection of metaball elements"); RNA_def_struct_ui_text(srna, "Meta Elements", "Collection of metaball elements");
func= RNA_def_function(srna, "new", "rna_MetaBall_elements_new"); func = RNA_def_function(srna, "new", "rna_MetaBall_elements_new");
RNA_def_function_ui_description(func, "Add a new element to the metaball"); RNA_def_function_ui_description(func, "Add a new element to the metaball");
RNA_def_enum(func, "type", metaelem_type_items, MB_BALL, "", "type for the new meta-element"); RNA_def_enum(func, "type", metaelem_type_items, MB_BALL, "", "type for the new meta-element");
parm= RNA_def_pointer(func, "element", "MetaElement", "", "The newly created meta-element"); parm = RNA_def_pointer(func, "element", "MetaElement", "", "The newly created meta-element");
RNA_def_function_return(func, parm); RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "remove", "rna_MetaBall_elements_remove"); func = RNA_def_function(srna, "remove", "rna_MetaBall_elements_remove");
RNA_def_function_ui_description(func, "Remove an element from the metaball"); RNA_def_function_ui_description(func, "Remove an element from the metaball");
RNA_def_function_flag(func, FUNC_USE_REPORTS); RNA_def_function_flag(func, FUNC_USE_REPORTS);
parm= RNA_def_pointer(func, "element", "MetaElement", "", "The element to remove"); parm = RNA_def_pointer(func, "element", "MetaElement", "", "The element to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
func= RNA_def_function(srna, "clear", "rna_MetaBall_elements_clear"); func = RNA_def_function(srna, "clear", "rna_MetaBall_elements_clear");
RNA_def_function_ui_description(func, "Remove all elements from the metaball"); RNA_def_function_ui_description(func, "Remove all elements from the metaball");
prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "lastelem"); RNA_def_property_pointer_sdna(prop, NULL, "lastelem");
RNA_def_property_ui_text(prop, "Active Element", "Last selected element"); RNA_def_property_ui_text(prop, "Active Element", "Last selected element");
} }
@@ -275,55 +275,55 @@ static void rna_def_metaball(BlenderRNA *brna)
{MB_UPDATE_NEVER, "NEVER", 0, "Never", "While editing, don't update metaball at all"}, {MB_UPDATE_NEVER, "NEVER", 0, "Never", "While editing, don't update metaball at all"},
{0, NULL, 0, NULL, NULL}}; {0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "MetaBall", "ID"); srna = RNA_def_struct(brna, "MetaBall", "ID");
RNA_def_struct_ui_text(srna, "MetaBall", "Metaball datablock to defined blobby surfaces"); RNA_def_struct_ui_text(srna, "MetaBall", "Metaball datablock to defined blobby surfaces");
RNA_def_struct_ui_icon(srna, ICON_META_DATA); RNA_def_struct_ui_icon(srna, ICON_META_DATA);
prop= RNA_def_property(srna, "elements", PROP_COLLECTION, PROP_NONE); prop = RNA_def_property(srna, "elements", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "elems", NULL); RNA_def_property_collection_sdna(prop, NULL, "elems", NULL);
RNA_def_property_struct_type(prop, "MetaElement"); RNA_def_property_struct_type(prop, "MetaElement");
RNA_def_property_ui_text(prop, "Elements", "Meta elements"); RNA_def_property_ui_text(prop, "Elements", "Meta elements");
rna_def_metaball_elements(brna, prop); rna_def_metaball_elements(brna, prop);
/* enums */ /* enums */
prop= RNA_def_property(srna, "update_method", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "update_method", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "flag"); RNA_def_property_enum_sdna(prop, NULL, "flag");
RNA_def_property_enum_items(prop, prop_update_items); RNA_def_property_enum_items(prop, prop_update_items);
RNA_def_property_ui_text(prop, "Update", "Metaball edit update behavior"); RNA_def_property_ui_text(prop, "Update", "Metaball edit update behavior");
RNA_def_property_update(prop, 0, "rna_MetaBall_update_data"); RNA_def_property_update(prop, 0, "rna_MetaBall_update_data");
/* number values */ /* number values */
prop= RNA_def_property(srna, "resolution", PROP_FLOAT, PROP_DISTANCE); prop = RNA_def_property(srna, "resolution", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "wiresize"); RNA_def_property_float_sdna(prop, NULL, "wiresize");
RNA_def_property_range(prop, 0.050f, 1.0f); RNA_def_property_range(prop, 0.050f, 1.0f);
RNA_def_property_ui_text(prop, "Wire Size", "Polygonization resolution in the 3D viewport"); RNA_def_property_ui_text(prop, "Wire Size", "Polygonization resolution in the 3D viewport");
RNA_def_property_update(prop, 0, "rna_MetaBall_update_data"); RNA_def_property_update(prop, 0, "rna_MetaBall_update_data");
prop= RNA_def_property(srna, "render_resolution", PROP_FLOAT, PROP_DISTANCE); prop = RNA_def_property(srna, "render_resolution", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "rendersize"); RNA_def_property_float_sdna(prop, NULL, "rendersize");
RNA_def_property_range(prop, 0.050f, 1.0f); RNA_def_property_range(prop, 0.050f, 1.0f);
RNA_def_property_ui_text(prop, "Render Size", "Polygonization resolution in rendering"); RNA_def_property_ui_text(prop, "Render Size", "Polygonization resolution in rendering");
RNA_def_property_update(prop, 0, "rna_MetaBall_update_data"); RNA_def_property_update(prop, 0, "rna_MetaBall_update_data");
prop= RNA_def_property(srna, "threshold", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "threshold", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "thresh"); RNA_def_property_float_sdna(prop, NULL, "thresh");
RNA_def_property_range(prop, 0.0f, 5.0f); RNA_def_property_range(prop, 0.0f, 5.0f);
RNA_def_property_ui_text(prop, "Threshold", "Influence of meta elements"); RNA_def_property_ui_text(prop, "Threshold", "Influence of meta elements");
RNA_def_property_update(prop, 0, "rna_MetaBall_update_data"); RNA_def_property_update(prop, 0, "rna_MetaBall_update_data");
/* texture space */ /* texture space */
prop= RNA_def_property(srna, "use_auto_texspace", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_auto_texspace", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "texflag", MB_AUTOSPACE); RNA_def_property_boolean_sdna(prop, NULL, "texflag", MB_AUTOSPACE);
RNA_def_property_ui_text(prop, "Auto Texture Space", "Adjust active object's texture space automatically when transforming object"); RNA_def_property_ui_text(prop, "Auto Texture Space", "Adjust active object's texture space automatically when transforming object");
prop= RNA_def_property(srna, "texspace_location", PROP_FLOAT, PROP_TRANSLATION); prop = RNA_def_property(srna, "texspace_location", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_array(prop, 3); RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Texture Space Location", "Texture space location"); RNA_def_property_ui_text(prop, "Texture Space Location", "Texture space location");
RNA_def_property_editable_func(prop, "rna_Meta_texspace_editable"); RNA_def_property_editable_func(prop, "rna_Meta_texspace_editable");
RNA_def_property_float_funcs(prop, "rna_Meta_texspace_loc_get", "rna_Meta_texspace_loc_set", NULL); RNA_def_property_float_funcs(prop, "rna_Meta_texspace_loc_get", "rna_Meta_texspace_loc_set", NULL);
RNA_def_property_update(prop, 0, "rna_MetaBall_update_data"); RNA_def_property_update(prop, 0, "rna_MetaBall_update_data");
prop= RNA_def_property(srna, "texspace_size", PROP_FLOAT, PROP_XYZ); prop = RNA_def_property(srna, "texspace_size", PROP_FLOAT, PROP_XYZ);
RNA_def_property_array(prop, 3); RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Texture Space Size", "Texture space size"); RNA_def_property_ui_text(prop, "Texture Space Size", "Texture space size");
RNA_def_property_editable_func(prop, "rna_Meta_texspace_editable"); RNA_def_property_editable_func(prop, "rna_Meta_texspace_editable");
@@ -339,7 +339,7 @@ static void rna_def_metaball(BlenderRNA *brna)
*/ */
/* materials */ /* materials */
prop= RNA_def_property(srna, "materials", PROP_COLLECTION, PROP_NONE); prop = RNA_def_property(srna, "materials", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "mat", "totcol"); RNA_def_property_collection_sdna(prop, NULL, "mat", "totcol");
RNA_def_property_struct_type(prop, "Material"); RNA_def_property_struct_type(prop, "Material");
RNA_def_property_ui_text(prop, "Materials", ""); RNA_def_property_ui_text(prop, "Materials", "");

File diff suppressed because it is too large Load Diff

View File

@@ -52,7 +52,7 @@
static void rna_MovieClip_reload_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) static void rna_MovieClip_reload_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{ {
MovieClip *clip= (MovieClip*)ptr->id.data; MovieClip *clip = (MovieClip*)ptr->id.data;
BKE_movieclip_reload(clip); BKE_movieclip_reload(clip);
DAG_id_tag_update(&clip->id, 0); DAG_id_tag_update(&clip->id, 0);
@@ -60,10 +60,10 @@ static void rna_MovieClip_reload_update(Main *UNUSED(bmain), Scene *UNUSED(scene
static void rna_MovieClip_size_get(PointerRNA *ptr, int *values) static void rna_MovieClip_size_get(PointerRNA *ptr, int *values)
{ {
MovieClip *clip= (MovieClip*)ptr->id.data; MovieClip *clip = (MovieClip*)ptr->id.data;
values[0]= clip->lastsize[0]; values[0] = clip->lastsize[0];
values[1]= clip->lastsize[1]; values[1] = clip->lastsize[1];
} }
#else #else
@@ -73,7 +73,7 @@ static void rna_def_movieclip_proxy(BlenderRNA *brna)
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
static const EnumPropertyItem clip_tc_items[]= { static const EnumPropertyItem clip_tc_items[] = {
{IMB_TC_NONE, "NONE", 0, "No TC in use", ""}, {IMB_TC_NONE, "NONE", 0, "No TC in use", ""},
{IMB_TC_RECORD_RUN, "RECORD_RUN", 0, "Record Run", "Use images in the order they are recorded"}, {IMB_TC_RECORD_RUN, "RECORD_RUN", 0, "Record Run", "Use images in the order they are recorded"},
{IMB_TC_FREE_RUN, "FREE_RUN", 0, "Free Run", "Use global timestamp written by recording device"}, {IMB_TC_FREE_RUN, "FREE_RUN", 0, "Free Run", "Use global timestamp written by recording device"},
@@ -86,70 +86,70 @@ static void rna_def_movieclip_proxy(BlenderRNA *brna)
RNA_def_struct_sdna(srna, "MovieClipProxy"); RNA_def_struct_sdna(srna, "MovieClipProxy");
/* build proxy sized */ /* build proxy sized */
prop= RNA_def_property(srna, "build_25", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "build_25", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "build_size_flag", MCLIP_PROXY_SIZE_25); RNA_def_property_boolean_sdna(prop, NULL, "build_size_flag", MCLIP_PROXY_SIZE_25);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "25%", "Build proxy resolution 25% of the original footage dimension"); RNA_def_property_ui_text(prop, "25%", "Build proxy resolution 25% of the original footage dimension");
prop= RNA_def_property(srna, "build_50", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "build_50", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "build_size_flag", MCLIP_PROXY_SIZE_50); RNA_def_property_boolean_sdna(prop, NULL, "build_size_flag", MCLIP_PROXY_SIZE_50);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "50%", "Build proxy resolution 50% of the original footage dimension"); RNA_def_property_ui_text(prop, "50%", "Build proxy resolution 50% of the original footage dimension");
prop= RNA_def_property(srna, "build_75", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "build_75", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "build_size_flag", MCLIP_PROXY_SIZE_75); RNA_def_property_boolean_sdna(prop, NULL, "build_size_flag", MCLIP_PROXY_SIZE_75);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "75%", "Build proxy resolution 75% of the original footage dimension"); RNA_def_property_ui_text(prop, "75%", "Build proxy resolution 75% of the original footage dimension");
prop= RNA_def_property(srna, "build_100", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "build_100", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "build_size_flag", MCLIP_PROXY_SIZE_100); RNA_def_property_boolean_sdna(prop, NULL, "build_size_flag", MCLIP_PROXY_SIZE_100);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "100%", "Build proxy resolution 100% of the original footage dimension"); RNA_def_property_ui_text(prop, "100%", "Build proxy resolution 100% of the original footage dimension");
prop= RNA_def_property(srna, "build_undistorted_25", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "build_undistorted_25", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "build_size_flag", MCLIP_PROXY_UNDISTORTED_SIZE_25); RNA_def_property_boolean_sdna(prop, NULL, "build_size_flag", MCLIP_PROXY_UNDISTORTED_SIZE_25);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "25%", "Build proxy resolution 25% of the original undistorted footage dimension"); RNA_def_property_ui_text(prop, "25%", "Build proxy resolution 25% of the original undistorted footage dimension");
prop= RNA_def_property(srna, "build_undistorted_50", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "build_undistorted_50", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "build_size_flag", MCLIP_PROXY_UNDISTORTED_SIZE_50); RNA_def_property_boolean_sdna(prop, NULL, "build_size_flag", MCLIP_PROXY_UNDISTORTED_SIZE_50);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "50%", "Build proxy resolution 50% of the original undistorted footage dimension"); RNA_def_property_ui_text(prop, "50%", "Build proxy resolution 50% of the original undistorted footage dimension");
prop= RNA_def_property(srna, "build_undistorted_75", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "build_undistorted_75", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "build_size_flag", MCLIP_PROXY_UNDISTORTED_SIZE_75); RNA_def_property_boolean_sdna(prop, NULL, "build_size_flag", MCLIP_PROXY_UNDISTORTED_SIZE_75);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "75%", "Build proxy resolution 75% of the original undistorted footage dimension"); RNA_def_property_ui_text(prop, "75%", "Build proxy resolution 75% of the original undistorted footage dimension");
prop= RNA_def_property(srna, "build_undistorted_100", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "build_undistorted_100", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "build_size_flag", MCLIP_PROXY_UNDISTORTED_SIZE_100); RNA_def_property_boolean_sdna(prop, NULL, "build_size_flag", MCLIP_PROXY_UNDISTORTED_SIZE_100);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "100%", "Build proxy resolution 100% of the original undistorted footage dimension"); RNA_def_property_ui_text(prop, "100%", "Build proxy resolution 100% of the original undistorted footage dimension");
/* build timecodes */ /* build timecodes */
prop= RNA_def_property(srna, "build_record_run", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "build_record_run", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "build_tc_flag", IMB_TC_RECORD_RUN); RNA_def_property_boolean_sdna(prop, NULL, "build_tc_flag", IMB_TC_RECORD_RUN);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Rec Run", "Build record run time code index"); RNA_def_property_ui_text(prop, "Rec Run", "Build record run time code index");
prop= RNA_def_property(srna, "build_free_run", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "build_free_run", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "build_tc_flag", IMB_TC_FREE_RUN); RNA_def_property_boolean_sdna(prop, NULL, "build_tc_flag", IMB_TC_FREE_RUN);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Free Run", "Build free run time code index"); RNA_def_property_ui_text(prop, "Free Run", "Build free run time code index");
prop= RNA_def_property(srna, "build_free_run_rec_date", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "build_free_run_rec_date", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "build_tc_flag", IMB_TC_INTERPOLATED_REC_DATE_FREE_RUN); RNA_def_property_boolean_sdna(prop, NULL, "build_tc_flag", IMB_TC_INTERPOLATED_REC_DATE_FREE_RUN);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Free Run (Rec Date)", "Build free run time code index using Record Date/Time"); RNA_def_property_ui_text(prop, "Free Run (Rec Date)", "Build free run time code index using Record Date/Time");
/* quality of proxied image */ /* quality of proxied image */
prop= RNA_def_property(srna, "quality", PROP_INT, PROP_UNSIGNED); prop = RNA_def_property(srna, "quality", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "quality"); RNA_def_property_int_sdna(prop, NULL, "quality");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Quality", "JPEG quality of proxy images"); RNA_def_property_ui_text(prop, "Quality", "JPEG quality of proxy images");
RNA_def_property_ui_range(prop, 1, 100, 1, 0); RNA_def_property_ui_range(prop, 1, 100, 1, 0);
prop= RNA_def_property(srna, "timecode", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "timecode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "tc"); RNA_def_property_enum_sdna(prop, NULL, "tc");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_enum_items(prop, clip_tc_items); RNA_def_property_enum_items(prop, clip_tc_items);
@@ -157,7 +157,7 @@ static void rna_def_movieclip_proxy(BlenderRNA *brna)
RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL); RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL);
/* directory */ /* directory */
prop= RNA_def_property(srna, "directory", PROP_STRING, PROP_DIRPATH); prop = RNA_def_property(srna, "directory", PROP_STRING, PROP_DIRPATH);
RNA_def_property_string_sdna(prop, NULL, "dir"); RNA_def_property_string_sdna(prop, NULL, "dir");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Directory", "Location to store the proxy files"); RNA_def_property_ui_text(prop, "Directory", "Location to store the proxy files");
@@ -177,24 +177,24 @@ static void rna_def_moviecliUser(BlenderRNA *brna)
{MCLIP_PROXY_RENDER_SIZE_FULL, "FULL", 0, "No proxy, full render", ""}, {MCLIP_PROXY_RENDER_SIZE_FULL, "FULL", 0, "No proxy, full render", ""},
{0, NULL, 0, NULL, NULL}}; {0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "MovieClipUser", NULL); srna = RNA_def_struct(brna, "MovieClipUser", NULL);
RNA_def_struct_ui_text(srna, "Movie Clip User", "Parameters defining how a MovieClip datablock is used by another datablock"); RNA_def_struct_ui_text(srna, "Movie Clip User", "Parameters defining how a MovieClip datablock is used by another datablock");
prop= RNA_def_property(srna, "current_frame", PROP_INT, PROP_TIME); prop = RNA_def_property(srna, "current_frame", PROP_INT, PROP_TIME);
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_int_sdna(prop, NULL, "framenr"); RNA_def_property_int_sdna(prop, NULL, "framenr");
RNA_def_property_range(prop, MINAFRAME, MAXFRAME); RNA_def_property_range(prop, MINAFRAME, MAXFRAME);
RNA_def_property_ui_text(prop, "Current Frame", "Current frame number in movie or image sequence"); RNA_def_property_ui_text(prop, "Current Frame", "Current frame number in movie or image sequence");
/* render size */ /* render size */
prop= RNA_def_property(srna, "proxy_render_size", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "proxy_render_size", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "render_size"); RNA_def_property_enum_sdna(prop, NULL, "render_size");
RNA_def_property_enum_items(prop, clip_render_size_items); RNA_def_property_enum_items(prop, clip_render_size_items);
RNA_def_property_ui_text(prop, "Proxy render size", "Draw preview using full resolution or different proxy resolutions"); RNA_def_property_ui_text(prop, "Proxy render size", "Draw preview using full resolution or different proxy resolutions");
RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL); RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL);
/* render undistorted */ /* render undistorted */
prop= RNA_def_property(srna, "use_render_undistorted", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_render_undistorted", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "render_flag", MCLIP_PROXY_RENDER_UNDISTORT); RNA_def_property_boolean_sdna(prop, NULL, "render_flag", MCLIP_PROXY_RENDER_UNDISTORT);
RNA_def_property_ui_text(prop, "Render Undistorted", "Render preview using undistorted proxy"); RNA_def_property_ui_text(prop, "Render Undistorted", "Render preview using undistorted proxy");
RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL); RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL);
@@ -204,7 +204,7 @@ static void rna_def_movieClipScopes(BlenderRNA *brna)
{ {
StructRNA *srna; StructRNA *srna;
srna= RNA_def_struct(brna, "MovieClipScopes", NULL); srna = RNA_def_struct(brna, "MovieClipScopes", NULL);
RNA_def_struct_ui_text(srna, "MovieClipScopes", "Scopes for statistical view of a movie clip"); RNA_def_struct_ui_text(srna, "MovieClipScopes", "Scopes for statistical view of a movie clip");
} }
@@ -214,38 +214,38 @@ static void rna_def_movieclip(BlenderRNA *brna)
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
static EnumPropertyItem clip_source_items[]= { static EnumPropertyItem clip_source_items[] = {
{MCLIP_SRC_SEQUENCE, "SEQUENCE", 0, "Image Sequence", "Multiple image files, as a sequence"}, {MCLIP_SRC_SEQUENCE, "SEQUENCE", 0, "Image Sequence", "Multiple image files, as a sequence"},
{MCLIP_SRC_MOVIE, "MOVIE", 0, "Movie File", "Movie file"}, {MCLIP_SRC_MOVIE, "MOVIE", 0, "Movie File", "Movie file"},
{0, NULL, 0, NULL, NULL}}; {0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "MovieClip", "ID"); srna = RNA_def_struct(brna, "MovieClip", "ID");
RNA_def_struct_ui_text(srna, "MovieClip", "MovieClip datablock referencing an external movie file"); RNA_def_struct_ui_text(srna, "MovieClip", "MovieClip datablock referencing an external movie file");
RNA_def_struct_ui_icon(srna, ICON_SEQUENCE); RNA_def_struct_ui_icon(srna, ICON_SEQUENCE);
prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH); prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
RNA_def_property_string_sdna(prop, NULL, "name"); RNA_def_property_string_sdna(prop, NULL, "name");
RNA_def_property_ui_text(prop, "File Path", "Filename of the movie or sequence file"); RNA_def_property_ui_text(prop, "File Path", "Filename of the movie or sequence file");
RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, "rna_MovieClip_reload_update"); RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, "rna_MovieClip_reload_update");
prop= RNA_def_property(srna, "tracking", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "tracking", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "MovieTracking"); RNA_def_property_struct_type(prop, "MovieTracking");
prop= RNA_def_property(srna, "proxy", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "proxy", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "MovieClipProxy"); RNA_def_property_struct_type(prop, "MovieClipProxy");
/* use proxy */ /* use proxy */
prop= RNA_def_property(srna, "use_proxy", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_proxy", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MCLIP_USE_PROXY); RNA_def_property_boolean_sdna(prop, NULL, "flag", MCLIP_USE_PROXY);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Use Proxy / Timecode", "Use a preview proxy and/or timecode index for this clip"); RNA_def_property_ui_text(prop, "Use Proxy / Timecode", "Use a preview proxy and/or timecode index for this clip");
RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL); RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL);
prop= RNA_def_int_vector(srna, "size" , 2 , NULL , 0, 0, "Size" , "Width and height in pixels, zero when image data cant be loaded" , 0 , 0); prop = RNA_def_int_vector(srna, "size" , 2 , NULL , 0, 0, "Size" , "Width and height in pixels, zero when image data cant be loaded" , 0 , 0);
RNA_def_property_int_funcs(prop, "rna_MovieClip_size_get" , NULL, NULL); RNA_def_property_int_funcs(prop, "rna_MovieClip_size_get" , NULL, NULL);
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
prop= RNA_def_property(srna, "display_aspect", PROP_FLOAT, PROP_XYZ); prop = RNA_def_property(srna, "display_aspect", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "aspx"); RNA_def_property_float_sdna(prop, NULL, "aspx");
RNA_def_property_array(prop, 2); RNA_def_property_array(prop, 2);
RNA_def_property_range(prop, 0.1f, 5000.0f); RNA_def_property_range(prop, 0.1f, 5000.0f);
@@ -254,20 +254,20 @@ static void rna_def_movieclip(BlenderRNA *brna)
RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL); RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL);
/* source */ /* source */
prop= RNA_def_property(srna, "source", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "source", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, clip_source_items); RNA_def_property_enum_items(prop, clip_source_items);
RNA_def_property_ui_text(prop, "Source", "Where the clip comes from"); RNA_def_property_ui_text(prop, "Source", "Where the clip comes from");
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
/* custom proxy directory */ /* custom proxy directory */
prop= RNA_def_property(srna, "use_proxy_custom_directory", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_proxy_custom_directory", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MCLIP_USE_PROXY_CUSTOM_DIR); RNA_def_property_boolean_sdna(prop, NULL, "flag", MCLIP_USE_PROXY_CUSTOM_DIR);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Proxy Custom Directory", "Create proxy images in a custom directory (default is movie location)"); RNA_def_property_ui_text(prop, "Proxy Custom Directory", "Create proxy images in a custom directory (default is movie location)");
RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, "rna_MovieClip_reload_update"); RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, "rna_MovieClip_reload_update");
/* grease pencil */ /* grease pencil */
prop= RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "gpd"); RNA_def_property_pointer_sdna(prop, NULL, "gpd");
RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "GreasePencil"); RNA_def_property_struct_type(prop, "GreasePencil");

View File

@@ -56,32 +56,32 @@
static void rna_NlaStrip_name_set(PointerRNA *ptr, const char *value) static void rna_NlaStrip_name_set(PointerRNA *ptr, const char *value)
{ {
NlaStrip *data= (NlaStrip *)ptr->data; NlaStrip *data = (NlaStrip *)ptr->data;
/* copy the name first */ /* copy the name first */
BLI_strncpy_utf8(data->name, value, sizeof(data->name)); BLI_strncpy_utf8(data->name, value, sizeof(data->name));
/* validate if there's enough info to do so */ /* validate if there's enough info to do so */
if (ptr->id.data) { if (ptr->id.data) {
AnimData *adt= BKE_animdata_from_id(ptr->id.data); AnimData *adt = BKE_animdata_from_id(ptr->id.data);
BKE_nlastrip_validate_name(adt, data); BKE_nlastrip_validate_name(adt, data);
} }
} }
static char *rna_NlaStrip_path(PointerRNA *ptr) static char *rna_NlaStrip_path(PointerRNA *ptr)
{ {
NlaStrip *strip= (NlaStrip *)ptr->data; NlaStrip *strip = (NlaStrip *)ptr->data;
AnimData *adt= BKE_animdata_from_id(ptr->id.data); AnimData *adt = BKE_animdata_from_id(ptr->id.data);
/* if we're attached to AnimData, try to resolve path back to AnimData */ /* if we're attached to AnimData, try to resolve path back to AnimData */
if (adt) { if (adt) {
NlaTrack *nlt; NlaTrack *nlt;
NlaStrip *nls; NlaStrip *nls;
for (nlt= adt->nla_tracks.first; nlt; nlt= nlt->next) { for (nlt = adt->nla_tracks.first; nlt; nlt = nlt->next) {
for (nls = nlt->strips.first; nls; nls = nls->next) { for (nls = nlt->strips.first; nls; nls = nls->next) {
if (nls == strip) { if (nls == strip) {
// XXX but if we animate like this, the control will never work... /* XXX but if we animate like this, the control will never work... */
return BLI_sprintfN("animation_data.nla_tracks[\"%s\"].strips[\"%s\"]", nlt->name, strip->name); return BLI_sprintfN("animation_data.nla_tracks[\"%s\"].strips[\"%s\"]", nlt->name, strip->name);
} }
} }
@@ -94,14 +94,14 @@ static char *rna_NlaStrip_path(PointerRNA *ptr)
static void rna_NlaStrip_transform_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) static void rna_NlaStrip_transform_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{ {
NlaStrip *strip= (NlaStrip*)ptr->data; NlaStrip *strip = (NlaStrip*)ptr->data;
BKE_nlameta_flush_transforms(strip); BKE_nlameta_flush_transforms(strip);
} }
static void rna_NlaStrip_start_frame_set(PointerRNA *ptr, float value) static void rna_NlaStrip_start_frame_set(PointerRNA *ptr, float value)
{ {
NlaStrip *data= (NlaStrip*)ptr->data; NlaStrip *data = (NlaStrip*)ptr->data;
/* clamp value to lie within valid limits /* clamp value to lie within valid limits
* - cannot start past the end of the strip + some flexibility threshold * - cannot start past the end of the strip + some flexibility threshold
@@ -115,7 +115,7 @@ static void rna_NlaStrip_start_frame_set(PointerRNA *ptr, float value)
CLAMP(value, data->prev->start+NLASTRIP_MIN_LEN_THRESH, data->end-NLASTRIP_MIN_LEN_THRESH); CLAMP(value, data->prev->start+NLASTRIP_MIN_LEN_THRESH, data->end-NLASTRIP_MIN_LEN_THRESH);
/* readjust the transition to stick to the endpoints of the action-clips */ /* readjust the transition to stick to the endpoints of the action-clips */
data->prev->end= value; data->prev->end = value;
} }
else { else {
CLAMP(value, data->prev->end, data->end-NLASTRIP_MIN_LEN_THRESH); CLAMP(value, data->prev->end, data->end-NLASTRIP_MIN_LEN_THRESH);
@@ -124,12 +124,12 @@ static void rna_NlaStrip_start_frame_set(PointerRNA *ptr, float value)
else { else {
CLAMP(value, MINAFRAME, data->end); CLAMP(value, MINAFRAME, data->end);
} }
data->start= value; data->start = value;
} }
static void rna_NlaStrip_end_frame_set(PointerRNA *ptr, float value) static void rna_NlaStrip_end_frame_set(PointerRNA *ptr, float value)
{ {
NlaStrip *data= (NlaStrip*)ptr->data; NlaStrip *data = (NlaStrip*)ptr->data;
/* clamp value to lie within valid limits /* clamp value to lie within valid limits
* - must not have zero or negative length strip, so cannot start before the first frame * - must not have zero or negative length strip, so cannot start before the first frame
@@ -143,7 +143,7 @@ static void rna_NlaStrip_end_frame_set(PointerRNA *ptr, float value)
CLAMP(value, data->start+NLASTRIP_MIN_LEN_THRESH, data->next->end-NLASTRIP_MIN_LEN_THRESH); CLAMP(value, data->start+NLASTRIP_MIN_LEN_THRESH, data->next->end-NLASTRIP_MIN_LEN_THRESH);
/* readjust the transition to stick to the endpoints of the action-clips */ /* readjust the transition to stick to the endpoints of the action-clips */
data->next->start= value; data->next->start = value;
} }
else { else {
CLAMP(value, data->start+NLASTRIP_MIN_LEN_THRESH, data->next->start); CLAMP(value, data->start+NLASTRIP_MIN_LEN_THRESH, data->next->start);
@@ -152,29 +152,29 @@ static void rna_NlaStrip_end_frame_set(PointerRNA *ptr, float value)
else { else {
CLAMP(value, data->start+NLASTRIP_MIN_LEN_THRESH, MAXFRAME); CLAMP(value, data->start+NLASTRIP_MIN_LEN_THRESH, MAXFRAME);
} }
data->end= value; data->end = value;
/* calculate the lengths the strip and its action (if applicable) */ /* calculate the lengths the strip and its action (if applicable) */
if (data->type == NLASTRIP_TYPE_CLIP) { if (data->type == NLASTRIP_TYPE_CLIP) {
float len, actlen; float len, actlen;
len= data->end - data->start; len = data->end - data->start;
actlen= data->actend - data->actstart; actlen = data->actend - data->actstart;
if (IS_EQF(actlen, 0.0f)) actlen= 1.0f; if (IS_EQF(actlen, 0.0f)) actlen = 1.0f;
/* now, adjust the 'scale' setting to reflect this (so that this change can be valid) */ /* now, adjust the 'scale' setting to reflect this (so that this change can be valid) */
data->scale= len / ((actlen) * data->repeat); data->scale = len / ((actlen) * data->repeat);
} }
} }
static void rna_NlaStrip_scale_set(PointerRNA *ptr, float value) static void rna_NlaStrip_scale_set(PointerRNA *ptr, float value)
{ {
NlaStrip *data= (NlaStrip*)ptr->data; NlaStrip *data = (NlaStrip*)ptr->data;
/* set scale value */ /* set scale value */
CLAMP(value, 0.0001f, 1000.0f); /* NOTE: these need to be synced with the values in the property definition in rna_def_nlastrip() */ CLAMP(value, 0.0001f, 1000.0f); /* NOTE: these need to be synced with the values in the property definition in rna_def_nlastrip() */
data->scale= value; data->scale = value;
/* adjust the strip extents in response to this */ /* adjust the strip extents in response to this */
BKE_nlastrip_recalculate_bounds(data); BKE_nlastrip_recalculate_bounds(data);
@@ -182,11 +182,11 @@ static void rna_NlaStrip_scale_set(PointerRNA *ptr, float value)
static void rna_NlaStrip_repeat_set(PointerRNA *ptr, float value) static void rna_NlaStrip_repeat_set(PointerRNA *ptr, float value)
{ {
NlaStrip *data= (NlaStrip*)ptr->data; NlaStrip *data = (NlaStrip*)ptr->data;
/* set repeat value */ /* set repeat value */
CLAMP(value, 0.01f, 1000.0f); /* NOTE: these need to be synced with the values in the property definition in rna_def_nlastrip() */ CLAMP(value, 0.01f, 1000.0f); /* NOTE: these need to be synced with the values in the property definition in rna_def_nlastrip() */
data->repeat= value; data->repeat = value;
/* adjust the strip extents in response to this */ /* adjust the strip extents in response to this */
BKE_nlastrip_recalculate_bounds(data); BKE_nlastrip_recalculate_bounds(data);
@@ -194,30 +194,30 @@ static void rna_NlaStrip_repeat_set(PointerRNA *ptr, float value)
static void rna_NlaStrip_blend_in_set(PointerRNA *ptr, float value) static void rna_NlaStrip_blend_in_set(PointerRNA *ptr, float value)
{ {
NlaStrip *data= (NlaStrip*)ptr->data; NlaStrip *data = (NlaStrip*)ptr->data;
float len; float len;
/* blend-in is limited to the length of the strip, and also cannot overlap with blendout */ /* blend-in is limited to the length of the strip, and also cannot overlap with blendout */
len= (data->end - data->start) - data->blendout; len = (data->end - data->start) - data->blendout;
CLAMP(value, 0, len); CLAMP(value, 0, len);
data->blendin= value; data->blendin = value;
} }
static void rna_NlaStrip_blend_out_set(PointerRNA *ptr, float value) static void rna_NlaStrip_blend_out_set(PointerRNA *ptr, float value)
{ {
NlaStrip *data= (NlaStrip*)ptr->data; NlaStrip *data = (NlaStrip*)ptr->data;
float len; float len;
/* blend-out is limited to the length of the strip */ /* blend-out is limited to the length of the strip */
len= (data->end - data->start); len = (data->end - data->start);
CLAMP(value, 0, len); CLAMP(value, 0, len);
/* it also cannot overlap with blendin */ /* it also cannot overlap with blendin */
if ((len - value) < data->blendin) if ((len - value) < data->blendin)
value= len - data->blendin; value = len - data->blendin;
data->blendout= value; data->blendout = value;
} }
static int rna_NlaStrip_action_editable(PointerRNA *ptr) static int rna_NlaStrip_action_editable(PointerRNA *ptr)
@@ -245,24 +245,24 @@ static int rna_NlaStrip_action_editable(PointerRNA *ptr)
static void rna_NlaStrip_action_start_frame_set(PointerRNA *ptr, float value) static void rna_NlaStrip_action_start_frame_set(PointerRNA *ptr, float value)
{ {
NlaStrip *data= (NlaStrip*)ptr->data; NlaStrip *data = (NlaStrip*)ptr->data;
/* prevent start frame from occurring after end of action */ /* prevent start frame from occurring after end of action */
CLAMP(value, MINAFRAME, data->actend); CLAMP(value, MINAFRAME, data->actend);
data->actstart= value; data->actstart = value;
/* adjust the strip extents in response to this */ /* adjust the strip extents in response to this */
// TODO: should the strip be moved backwards instead as a special case? /* TODO: should the strip be moved backwards instead as a special case? */
BKE_nlastrip_recalculate_bounds(data); BKE_nlastrip_recalculate_bounds(data);
} }
static void rna_NlaStrip_action_end_frame_set(PointerRNA *ptr, float value) static void rna_NlaStrip_action_end_frame_set(PointerRNA *ptr, float value)
{ {
NlaStrip *data= (NlaStrip*)ptr->data; NlaStrip *data = (NlaStrip*)ptr->data;
/* prevent end frame from starting before start of action */ /* prevent end frame from starting before start of action */
CLAMP(value, data->actstart, MAXFRAME); CLAMP(value, data->actstart, MAXFRAME);
data->actend= value; data->actend = value;
/* adjust the strip extents in response to this */ /* adjust the strip extents in response to this */
BKE_nlastrip_recalculate_bounds(data); BKE_nlastrip_recalculate_bounds(data);
@@ -270,7 +270,7 @@ static void rna_NlaStrip_action_end_frame_set(PointerRNA *ptr, float value)
static void rna_NlaStrip_animated_influence_set(PointerRNA *ptr, int value) static void rna_NlaStrip_animated_influence_set(PointerRNA *ptr, int value)
{ {
NlaStrip *data= (NlaStrip*)ptr->data; NlaStrip *data = (NlaStrip*)ptr->data;
if (value) { if (value) {
/* set the flag, then make sure a curve for this exists */ /* set the flag, then make sure a curve for this exists */
@@ -283,7 +283,7 @@ static void rna_NlaStrip_animated_influence_set(PointerRNA *ptr, int value)
static void rna_NlaStrip_animated_time_set(PointerRNA *ptr, int value) static void rna_NlaStrip_animated_time_set(PointerRNA *ptr, int value)
{ {
NlaStrip *data= (NlaStrip*)ptr->data; NlaStrip *data = (NlaStrip*)ptr->data;
if (value) { if (value) {
/* set the flag, then make sure a curve for this exists */ /* set the flag, then make sure a curve for this exists */
@@ -343,7 +343,7 @@ static NlaStrip *rna_NlaStrip_new(NlaTrack *track, bContext *C, ReportList *repo
static void rna_NlaStrip_remove(NlaTrack *track, bContext *C, ReportList *reports, NlaStrip *strip) static void rna_NlaStrip_remove(NlaTrack *track, bContext *C, ReportList *reports, NlaStrip *strip)
{ {
if(BLI_findindex(&track->strips, strip) == -1) { if (BLI_findindex(&track->strips, strip) == -1) {
BKE_reportf(reports, RPT_ERROR, "NLA's Strip '%s' not found in track '%s'", strip->name, track->name); BKE_reportf(reports, RPT_ERROR, "NLA's Strip '%s' not found in track '%s'", strip->name, track->name);
return; return;
} }
@@ -382,71 +382,71 @@ static void rna_def_nlastrip(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}}; {0, NULL, 0, NULL, NULL}};
/* struct definition */ /* struct definition */
srna= RNA_def_struct(brna, "NlaStrip", NULL); srna = RNA_def_struct(brna, "NlaStrip", NULL);
RNA_def_struct_ui_text(srna, "NLA Strip", "A container referencing an existing Action"); RNA_def_struct_ui_text(srna, "NLA Strip", "A container referencing an existing Action");
RNA_def_struct_path_func(srna, "rna_NlaStrip_path"); RNA_def_struct_path_func(srna, "rna_NlaStrip_path");
RNA_def_struct_ui_icon(srna, ICON_NLA); // XXX RNA_def_struct_ui_icon(srna, ICON_NLA); /* XXX */
/* name property */ /* name property */
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Name", ""); RNA_def_property_ui_text(prop, "Name", "");
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_NlaStrip_name_set"); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_NlaStrip_name_set");
RNA_def_struct_name_property(srna, prop); RNA_def_struct_name_property(srna, prop);
RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */ RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
/* Enums */ /* Enums */
prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "type"); RNA_def_property_enum_sdna(prop, NULL, "type");
RNA_def_property_clear_flag(prop, PROP_EDITABLE); // XXX for now, not editable, since this is dangerous RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* XXX for now, not editable, since this is dangerous */
RNA_def_property_enum_items(prop, prop_type_items); RNA_def_property_enum_items(prop, prop_type_items);
RNA_def_property_ui_text(prop, "Type", "Type of NLA Strip"); RNA_def_property_ui_text(prop, "Type", "Type of NLA Strip");
RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */ RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
prop= RNA_def_property(srna, "extrapolation", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "extrapolation", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "extendmode"); RNA_def_property_enum_sdna(prop, NULL, "extendmode");
RNA_def_property_enum_items(prop, nla_mode_extend_items); RNA_def_property_enum_items(prop, nla_mode_extend_items);
RNA_def_property_ui_text(prop, "Extrapolation", "Action to take for gaps past the strip extents"); RNA_def_property_ui_text(prop, "Extrapolation", "Action to take for gaps past the strip extents");
RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */ RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
prop= RNA_def_property(srna, "blend_type", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "blend_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "blendmode"); RNA_def_property_enum_sdna(prop, NULL, "blendmode");
RNA_def_property_enum_items(prop, nla_mode_blend_items); RNA_def_property_enum_items(prop, nla_mode_blend_items);
RNA_def_property_ui_text(prop, "Blending", "Method used for combining strip's result with accumulated result"); RNA_def_property_ui_text(prop, "Blending", "Method used for combining strip's result with accumulated result");
RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */ RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
/* Strip extents */ /* Strip extents */
prop= RNA_def_property(srna, "frame_start", PROP_FLOAT, PROP_TIME); prop = RNA_def_property(srna, "frame_start", PROP_FLOAT, PROP_TIME);
RNA_def_property_float_sdna(prop, NULL, "start"); RNA_def_property_float_sdna(prop, NULL, "start");
RNA_def_property_float_funcs(prop, NULL, "rna_NlaStrip_start_frame_set", NULL); RNA_def_property_float_funcs(prop, NULL, "rna_NlaStrip_start_frame_set", NULL);
RNA_def_property_ui_text(prop, "Start Frame", ""); RNA_def_property_ui_text(prop, "Start Frame", "");
RNA_def_property_update(prop, 0, "rna_NlaStrip_transform_update"); RNA_def_property_update(prop, 0, "rna_NlaStrip_transform_update");
prop= RNA_def_property(srna, "frame_end", PROP_FLOAT, PROP_TIME); prop = RNA_def_property(srna, "frame_end", PROP_FLOAT, PROP_TIME);
RNA_def_property_float_sdna(prop, NULL, "end"); RNA_def_property_float_sdna(prop, NULL, "end");
RNA_def_property_float_funcs(prop, NULL, "rna_NlaStrip_end_frame_set", NULL); RNA_def_property_float_funcs(prop, NULL, "rna_NlaStrip_end_frame_set", NULL);
RNA_def_property_ui_text(prop, "End Frame", ""); RNA_def_property_ui_text(prop, "End Frame", "");
RNA_def_property_update(prop, 0, "rna_NlaStrip_transform_update"); RNA_def_property_update(prop, 0, "rna_NlaStrip_transform_update");
/* Blending */ /* Blending */
prop= RNA_def_property(srna, "blend_in", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "blend_in", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "blendin"); RNA_def_property_float_sdna(prop, NULL, "blendin");
RNA_def_property_float_funcs(prop, NULL, "rna_NlaStrip_blend_in_set", NULL); RNA_def_property_float_funcs(prop, NULL, "rna_NlaStrip_blend_in_set", NULL);
RNA_def_property_ui_text(prop, "Blend In", "Number of frames at start of strip to fade in influence"); RNA_def_property_ui_text(prop, "Blend In", "Number of frames at start of strip to fade in influence");
RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */ RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
prop= RNA_def_property(srna, "blend_out", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "blend_out", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "blendout"); RNA_def_property_float_sdna(prop, NULL, "blendout");
RNA_def_property_float_funcs(prop, NULL, "rna_NlaStrip_blend_out_set", NULL); RNA_def_property_float_funcs(prop, NULL, "rna_NlaStrip_blend_out_set", NULL);
RNA_def_property_ui_text(prop, "Blend Out", ""); RNA_def_property_ui_text(prop, "Blend Out", "");
RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */ RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
prop= RNA_def_property(srna, "use_auto_blend", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_auto_blend", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_AUTO_BLENDS); RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_AUTO_BLENDS);
RNA_def_property_ui_text(prop, "Auto Blend In/Out", "Number of frames for Blending In/Out is automatically determined from overlapping strips"); RNA_def_property_ui_text(prop, "Auto Blend In/Out", "Number of frames for Blending In/Out is automatically determined from overlapping strips");
RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */ RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
/* Action */ /* Action */
prop= RNA_def_property(srna, "action", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "action", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "act"); RNA_def_property_pointer_sdna(prop, NULL, "act");
RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Action_id_poll"); RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Action_id_poll");
RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_flag(prop, PROP_EDITABLE);
@@ -455,27 +455,27 @@ static void rna_def_nlastrip(BlenderRNA *brna)
RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */ RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
/* Action extents */ /* Action extents */
prop= RNA_def_property(srna, "action_frame_start", PROP_FLOAT, PROP_TIME); prop = RNA_def_property(srna, "action_frame_start", PROP_FLOAT, PROP_TIME);
RNA_def_property_float_sdna(prop, NULL, "actstart"); RNA_def_property_float_sdna(prop, NULL, "actstart");
RNA_def_property_float_funcs(prop, NULL, "rna_NlaStrip_action_start_frame_set", NULL); RNA_def_property_float_funcs(prop, NULL, "rna_NlaStrip_action_start_frame_set", NULL);
RNA_def_property_ui_text(prop, "Action Start Frame", ""); RNA_def_property_ui_text(prop, "Action Start Frame", "");
RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */ RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
prop= RNA_def_property(srna, "action_frame_end", PROP_FLOAT, PROP_TIME); prop = RNA_def_property(srna, "action_frame_end", PROP_FLOAT, PROP_TIME);
RNA_def_property_float_sdna(prop, NULL, "actend"); RNA_def_property_float_sdna(prop, NULL, "actend");
RNA_def_property_float_funcs(prop, NULL, "rna_NlaStrip_action_end_frame_set", NULL); RNA_def_property_float_funcs(prop, NULL, "rna_NlaStrip_action_end_frame_set", NULL);
RNA_def_property_ui_text(prop, "Action End Frame", ""); RNA_def_property_ui_text(prop, "Action End Frame", "");
RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */ RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
/* Action Reuse */ /* Action Reuse */
prop= RNA_def_property(srna, "repeat", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "repeat", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "repeat"); RNA_def_property_float_sdna(prop, NULL, "repeat");
RNA_def_property_float_funcs(prop, NULL, "rna_NlaStrip_repeat_set", NULL); RNA_def_property_float_funcs(prop, NULL, "rna_NlaStrip_repeat_set", NULL);
RNA_def_property_range(prop, 0.1f, 1000.0f); /* these limits have currently be chosen arbitarily, but could be extended (minimum should still be > 0 though) if needed... */ RNA_def_property_range(prop, 0.1f, 1000.0f); /* these limits have currently be chosen arbitarily, but could be extended (minimum should still be > 0 though) if needed... */
RNA_def_property_ui_text(prop, "Repeat", "Number of times to repeat the action range"); RNA_def_property_ui_text(prop, "Repeat", "Number of times to repeat the action range");
RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */ RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
prop= RNA_def_property(srna, "scale", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "scale", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "scale"); RNA_def_property_float_sdna(prop, NULL, "scale");
RNA_def_property_float_funcs(prop, NULL, "rna_NlaStrip_scale_set", NULL); RNA_def_property_float_funcs(prop, NULL, "rna_NlaStrip_scale_set", NULL);
RNA_def_property_range(prop, 0.0001f, 1000.0f); /* these limits can be extended, but beyond this, we can get some crazy+annoying bugs due to numeric errors */ RNA_def_property_range(prop, 0.0001f, 1000.0f); /* these limits can be extended, but beyond this, we can get some crazy+annoying bugs due to numeric errors */
@@ -483,72 +483,72 @@ static void rna_def_nlastrip(BlenderRNA *brna)
RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */ RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
/* Strip's F-Curves */ /* Strip's F-Curves */
prop= RNA_def_property(srna, "fcurves", PROP_COLLECTION, PROP_NONE); prop = RNA_def_property(srna, "fcurves", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "FCurve"); RNA_def_property_struct_type(prop, "FCurve");
RNA_def_property_ui_text(prop, "F-Curves", "F-Curves for controlling the strip's influence and timing"); RNA_def_property_ui_text(prop, "F-Curves", "F-Curves for controlling the strip's influence and timing");
/* Strip's F-Modifiers */ /* Strip's F-Modifiers */
prop= RNA_def_property(srna, "modifiers", PROP_COLLECTION, PROP_NONE); prop = RNA_def_property(srna, "modifiers", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "FModifier"); RNA_def_property_struct_type(prop, "FModifier");
RNA_def_property_ui_text(prop, "Modifiers", "Modifiers affecting all the F-Curves in the referenced Action"); RNA_def_property_ui_text(prop, "Modifiers", "Modifiers affecting all the F-Curves in the referenced Action");
/* Strip's Sub-Strips (for Meta-Strips) */ /* Strip's Sub-Strips (for Meta-Strips) */
prop= RNA_def_property(srna, "strips", PROP_COLLECTION, PROP_NONE); prop = RNA_def_property(srna, "strips", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "NlaStrip"); RNA_def_property_struct_type(prop, "NlaStrip");
RNA_def_property_ui_text(prop, "NLA Strips", "NLA Strips that this strip acts as a container for (if it is of type Meta)"); RNA_def_property_ui_text(prop, "NLA Strips", "NLA Strips that this strip acts as a container for (if it is of type Meta)");
/* Settings - Values necessary for evaluation */ /* Settings - Values necessary for evaluation */
prop= RNA_def_property(srna, "influence", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "influence", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Influence", "Amount the strip contributes to the current result"); RNA_def_property_ui_text(prop, "Influence", "Amount the strip contributes to the current result");
RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */ RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
prop= RNA_def_property(srna, "strip_time", PROP_FLOAT, PROP_TIME); prop = RNA_def_property(srna, "strip_time", PROP_FLOAT, PROP_TIME);
RNA_def_property_ui_text(prop, "Strip Time", "Frame of referenced Action to evaluate"); RNA_def_property_ui_text(prop, "Strip Time", "Frame of referenced Action to evaluate");
RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */ RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
// TODO: should the animated_influence/time settings be animatable themselves? /* TODO: should the animated_influence/time settings be animatable themselves? */
prop= RNA_def_property(srna, "use_animated_influence", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_animated_influence", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_USR_INFLUENCE); RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_USR_INFLUENCE);
RNA_def_property_boolean_funcs(prop, NULL, "rna_NlaStrip_animated_influence_set"); RNA_def_property_boolean_funcs(prop, NULL, "rna_NlaStrip_animated_influence_set");
RNA_def_property_ui_text(prop, "Animated Influence", "Influence setting is controlled by an F-Curve rather than automatically determined"); RNA_def_property_ui_text(prop, "Animated Influence", "Influence setting is controlled by an F-Curve rather than automatically determined");
RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */ RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
prop= RNA_def_property(srna, "use_animated_time", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_animated_time", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_USR_TIME); RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_USR_TIME);
RNA_def_property_boolean_funcs(prop, NULL, "rna_NlaStrip_animated_time_set"); RNA_def_property_boolean_funcs(prop, NULL, "rna_NlaStrip_animated_time_set");
RNA_def_property_ui_text(prop, "Animated Strip Time", "Strip time is controlled by an F-Curve rather than automatically determined"); RNA_def_property_ui_text(prop, "Animated Strip Time", "Strip time is controlled by an F-Curve rather than automatically determined");
RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */ RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
prop= RNA_def_property(srna, "use_animated_time_cyclic", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_animated_time_cyclic", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_USR_TIME_CYCLIC); RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_USR_TIME_CYCLIC);
RNA_def_property_ui_text(prop, "Cyclic Strip Time", "Cycle the animated time within the action start & end"); RNA_def_property_ui_text(prop, "Cyclic Strip Time", "Cycle the animated time within the action start & end");
RNA_def_property_update(prop, 0, "rna_NlaStrip_transform_update"); // is there a better update flag? RNA_def_property_update(prop, 0, "rna_NlaStrip_transform_update"); /* is there a better update flag? */
/* settings */ /* settings */
prop= RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* can be made editable by hooking it up to the necessary NLA API methods */ RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* can be made editable by hooking it up to the necessary NLA API methods */
RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_ACTIVE); RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_ACTIVE);
RNA_def_property_ui_text(prop, "Active", "NLA Strip is active"); RNA_def_property_ui_text(prop, "Active", "NLA Strip is active");
RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */ RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
prop= RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_SELECT); RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_SELECT);
RNA_def_property_ui_text(prop, "Select", "NLA Strip is selected"); RNA_def_property_ui_text(prop, "Select", "NLA Strip is selected");
RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */ RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
prop= RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_MUTED); RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_MUTED);
RNA_def_property_ui_text(prop, "Muted", "NLA Strip is not evaluated"); RNA_def_property_ui_text(prop, "Muted", "NLA Strip is not evaluated");
RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */ RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
prop= RNA_def_property(srna, "use_reverse", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_reverse", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_REVERSE); RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_REVERSE);
RNA_def_property_ui_text(prop, "Reversed", "NLA Strip is played back in reverse order (only when timing is automatically determined)"); RNA_def_property_ui_text(prop, "Reversed", "NLA Strip is played back in reverse order (only when timing is automatically determined)");
RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */ RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
// TODO: /* TODO: */
// - sync length /* - sync length */
} }
static void rna_api_nlatrack_strips(BlenderRNA *brna, PropertyRNA *cprop) static void rna_api_nlatrack_strips(BlenderRNA *brna, PropertyRNA *cprop)
@@ -558,14 +558,14 @@ static void rna_api_nlatrack_strips(BlenderRNA *brna, PropertyRNA *cprop)
FunctionRNA *func; FunctionRNA *func;
RNA_def_property_srna(cprop, "NlaStrips"); RNA_def_property_srna(cprop, "NlaStrips");
srna= RNA_def_struct(brna, "NlaStrips", NULL); srna = RNA_def_struct(brna, "NlaStrips", NULL);
RNA_def_struct_sdna(srna, "NlaTrack"); RNA_def_struct_sdna(srna, "NlaTrack");
RNA_def_struct_ui_text(srna, "Nla Strips", "Collection of Nla Strips"); RNA_def_struct_ui_text(srna, "Nla Strips", "Collection of Nla Strips");
func = RNA_def_function(srna, "new", "rna_NlaStrip_new"); func = RNA_def_function(srna, "new", "rna_NlaStrip_new");
RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS); RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Add a new Action-Clip strip to the track"); RNA_def_function_ui_description(func, "Add a new Action-Clip strip to the track");
parm= RNA_def_string(func, "name", "NlaStrip", 0, "", "Name for the NLA Strips"); parm = RNA_def_string(func, "name", "NlaStrip", 0, "", "Name for the NLA Strips");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
parm = RNA_def_int(func, "start", 0, INT_MIN, INT_MAX, "Start Frame", "Start frame for this strip", INT_MIN, INT_MAX); parm = RNA_def_int(func, "start", 0, INT_MIN, INT_MAX, "Start Frame", "Start frame for this strip", INT_MIN, INT_MAX);
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
@@ -587,47 +587,47 @@ static void rna_def_nlatrack(BlenderRNA *brna)
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
srna= RNA_def_struct(brna, "NlaTrack", NULL); srna = RNA_def_struct(brna, "NlaTrack", NULL);
RNA_def_struct_ui_text(srna, "NLA Track", "A animation layer containing Actions referenced as NLA strips"); RNA_def_struct_ui_text(srna, "NLA Track", "A animation layer containing Actions referenced as NLA strips");
RNA_def_struct_ui_icon(srna, ICON_NLA); RNA_def_struct_ui_icon(srna, ICON_NLA);
/* strips collection */ /* strips collection */
prop= RNA_def_property(srna, "strips", PROP_COLLECTION, PROP_NONE); prop = RNA_def_property(srna, "strips", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "NlaStrip"); RNA_def_property_struct_type(prop, "NlaStrip");
RNA_def_property_ui_text(prop, "NLA Strips", "NLA Strips on this NLA-track"); RNA_def_property_ui_text(prop, "NLA Strips", "NLA Strips on this NLA-track");
rna_api_nlatrack_strips(brna, prop); rna_api_nlatrack_strips(brna, prop);
/* name property */ /* name property */
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Name", ""); RNA_def_property_ui_text(prop, "Name", "");
RNA_def_struct_name_property(srna, prop); RNA_def_struct_name_property(srna, prop);
RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */ RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
/* settings */ /* settings */
prop= RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* can be made editable by hooking it up to the necessary NLA API methods */ RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* can be made editable by hooking it up to the necessary NLA API methods */
RNA_def_property_boolean_sdna(prop, NULL, "flag", NLATRACK_ACTIVE); RNA_def_property_boolean_sdna(prop, NULL, "flag", NLATRACK_ACTIVE);
RNA_def_property_ui_text(prop, "Active", "NLA Track is active"); RNA_def_property_ui_text(prop, "Active", "NLA Track is active");
RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */ RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
prop= RNA_def_property(srna, "is_solo", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "is_solo", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* can be made editable by hooking it up to the necessary NLA API methods */ RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* can be made editable by hooking it up to the necessary NLA API methods */
RNA_def_property_boolean_sdna(prop, NULL, "flag", NLATRACK_SOLO); RNA_def_property_boolean_sdna(prop, NULL, "flag", NLATRACK_SOLO);
RNA_def_property_ui_text(prop, "Solo", "NLA Track is evaluated itself (i.e. active Action and all other NLA Tracks in the same AnimData block are disabled)"); RNA_def_property_ui_text(prop, "Solo", "NLA Track is evaluated itself (i.e. active Action and all other NLA Tracks in the same AnimData block are disabled)");
RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */ RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
prop= RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", NLATRACK_SELECTED); RNA_def_property_boolean_sdna(prop, NULL, "flag", NLATRACK_SELECTED);
RNA_def_property_ui_text(prop, "Select", "NLA Track is selected"); RNA_def_property_ui_text(prop, "Select", "NLA Track is selected");
RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */ RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
prop= RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", NLATRACK_MUTED); RNA_def_property_boolean_sdna(prop, NULL, "flag", NLATRACK_MUTED);
RNA_def_property_ui_text(prop, "Muted", "NLA Track is not evaluated"); RNA_def_property_ui_text(prop, "Muted", "NLA Track is not evaluated");
RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */ RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
prop= RNA_def_property(srna, "lock", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "lock", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", NLATRACK_PROTECTED); RNA_def_property_boolean_sdna(prop, NULL, "flag", NLATRACK_PROTECTED);
RNA_def_property_ui_text(prop, "Locked", "NLA Track is locked"); RNA_def_property_ui_text(prop, "Locked", "NLA Track is locked");
RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */ RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */

View File

@@ -187,7 +187,7 @@ static StructRNA *rna_Node_refine(struct PointerRNA *ptr)
{ {
bNode *node = (bNode*)ptr->data; bNode *node = (bNode*)ptr->data;
switch(node->type) { switch (node->type) {
#define DefNode(Category, ID, DefFunc, EnumName, StructName, UIName, UIDesc) \ #define DefNode(Category, ID, DefFunc, EnumName, StructName, UIName, UIDesc) \
case ID: return &RNA_##Category##StructName; case ID: return &RNA_##Category##StructName;
@@ -208,9 +208,9 @@ static StructRNA *rna_Node_refine(struct PointerRNA *ptr)
static StructRNA *rna_NodeTree_refine(struct PointerRNA *ptr) static StructRNA *rna_NodeTree_refine(struct PointerRNA *ptr)
{ {
bNodeTree *ntree= (bNodeTree*)ptr->data; bNodeTree *ntree = (bNodeTree*)ptr->data;
switch(ntree->type) { switch (ntree->type) {
case NTREE_SHADER: case NTREE_SHADER:
return &RNA_ShaderNodeTree; return &RNA_ShaderNodeTree;
case NTREE_COMPOSIT: case NTREE_COMPOSIT:
@@ -224,14 +224,14 @@ static StructRNA *rna_NodeTree_refine(struct PointerRNA *ptr)
static char *rna_Node_path(PointerRNA *ptr) static char *rna_Node_path(PointerRNA *ptr)
{ {
bNode *node= (bNode*)ptr->data; bNode *node = (bNode*)ptr->data;
return BLI_sprintfN("nodes[\"%s\"]", node->name); return BLI_sprintfN("nodes[\"%s\"]", node->name);
} }
static StructRNA *rna_NodeSocket_refine(PointerRNA *ptr) static StructRNA *rna_NodeSocket_refine(PointerRNA *ptr)
{ {
bNodeSocket *sock= (bNodeSocket*)ptr->data; bNodeSocket *sock = (bNodeSocket*)ptr->data;
if (sock->default_value) { if (sock->default_value) {
/* This returns the refined socket type with the full definition /* This returns the refined socket type with the full definition
@@ -240,8 +240,8 @@ static StructRNA *rna_NodeSocket_refine(PointerRNA *ptr)
#define SUBTYPE(socktype, stypename, id, idname) \ #define SUBTYPE(socktype, stypename, id, idname) \
{ \ { \
bNodeSocketValue##stypename *value= (bNodeSocketValue##stypename*)sock->default_value; \ bNodeSocketValue##stypename *value = (bNodeSocketValue##stypename*)sock->default_value; \
if (value->subtype==PROP_##id) \ if (value->subtype == PROP_##id) \
return &RNA_NodeSocket##stypename##idname; \ return &RNA_NodeSocket##stypename##idname; \
} }
@@ -277,8 +277,8 @@ static StructRNA *rna_NodeSocket_refine(PointerRNA *ptr)
static char *rna_NodeSocket_path(PointerRNA *ptr) static char *rna_NodeSocket_path(PointerRNA *ptr)
{ {
bNodeTree *ntree= (bNodeTree*)ptr->id.data; bNodeTree *ntree = (bNodeTree*)ptr->id.data;
bNodeSocket *sock= (bNodeSocket*)ptr->data; bNodeSocket *sock = (bNodeSocket*)ptr->data;
bNode *node; bNode *node;
int socketindex; int socketindex;
@@ -308,21 +308,21 @@ static char *rna_NodeSocket_path(PointerRNA *ptr)
/* Button Set Funcs for Matte Nodes */ /* Button Set Funcs for Matte Nodes */
static void rna_Matte_t1_set(PointerRNA *ptr, float value) static void rna_Matte_t1_set(PointerRNA *ptr, float value)
{ {
bNode *node= (bNode*)ptr->data; bNode *node = (bNode*)ptr->data;
NodeChroma *chroma = node->storage; NodeChroma *chroma = node->storage;
chroma->t1 = value; chroma->t1 = value;
if(value < chroma->t2) if (value < chroma->t2)
chroma->t2 = value; chroma->t2 = value;
} }
static void rna_Matte_t2_set(PointerRNA *ptr, float value) static void rna_Matte_t2_set(PointerRNA *ptr, float value)
{ {
bNode *node= (bNode*)ptr->data; bNode *node = (bNode*)ptr->data;
NodeChroma *chroma = node->storage; NodeChroma *chroma = node->storage;
if(value > chroma->t1) if (value > chroma->t1)
value = chroma->t1; value = chroma->t1;
chroma->t2 = value; chroma->t2 = value;
@@ -330,14 +330,14 @@ static void rna_Matte_t2_set(PointerRNA *ptr, float value)
static void rna_Node_scene_set(PointerRNA *ptr, PointerRNA value) static void rna_Node_scene_set(PointerRNA *ptr, PointerRNA value)
{ {
bNode *node= (bNode*)ptr->data; bNode *node = (bNode*)ptr->data;
if (node->id) { if (node->id) {
id_us_min(node->id); id_us_min(node->id);
node->id= NULL; node->id = NULL;
} }
node->id= value.data; node->id = value.data;
id_us_plus(node->id); id_us_plus(node->id);
} }
@@ -351,16 +351,16 @@ static void node_update(Main *bmain, Scene *UNUSED(scene), bNodeTree *ntree, bNo
static void rna_Node_update(Main *bmain, Scene *scene, PointerRNA *ptr) static void rna_Node_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{ {
bNodeTree *ntree= (bNodeTree*)ptr->id.data; bNodeTree *ntree = (bNodeTree*)ptr->id.data;
bNode *node= (bNode*)ptr->data; bNode *node = (bNode*)ptr->data;
node_update(bmain, scene, ntree, node); node_update(bmain, scene, ntree, node);
} }
static void rna_Node_image_update(Main *bmain, Scene *scene, PointerRNA *ptr) static void rna_Node_image_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{ {
bNodeTree *ntree= (bNodeTree*)ptr->id.data; bNodeTree *ntree = (bNodeTree*)ptr->id.data;
bNode *node= (bNode*)ptr->data; bNode *node = (bNode*)ptr->data;
node_update(bmain, scene, ntree, node); node_update(bmain, scene, ntree, node);
WM_main_add_notifier(NC_IMAGE, NULL); WM_main_add_notifier(NC_IMAGE, NULL);
@@ -368,10 +368,10 @@ static void rna_Node_image_update(Main *bmain, Scene *scene, PointerRNA *ptr)
static void rna_Node_material_update(Main *bmain, Scene *scene, PointerRNA *ptr) static void rna_Node_material_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{ {
bNodeTree *ntree= (bNodeTree*)ptr->id.data; bNodeTree *ntree = (bNodeTree*)ptr->id.data;
bNode *node= (bNode*)ptr->data; bNode *node = (bNode*)ptr->data;
if(node->id) if (node->id)
nodeSetActive(ntree, node); nodeSetActive(ntree, node);
node_update(bmain, scene, ntree, node); node_update(bmain, scene, ntree, node);
@@ -379,8 +379,8 @@ static void rna_Node_material_update(Main *bmain, Scene *scene, PointerRNA *ptr)
static void rna_NodeGroup_update(Main *bmain, Scene *scene, PointerRNA *ptr) static void rna_NodeGroup_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{ {
bNodeTree *ntree= (bNodeTree*)ptr->id.data; bNodeTree *ntree = (bNodeTree*)ptr->id.data;
bNode *node= (bNode*)ptr->data; bNode *node = (bNode*)ptr->data;
ntreeUpdateTree((bNodeTree *)node->id); ntreeUpdateTree((bNodeTree *)node->id);
@@ -389,8 +389,8 @@ static void rna_NodeGroup_update(Main *bmain, Scene *scene, PointerRNA *ptr)
static void rna_Node_name_set(PointerRNA *ptr, const char *value) static void rna_Node_name_set(PointerRNA *ptr, const char *value)
{ {
bNodeTree *ntree= (bNodeTree*)ptr->id.data; bNodeTree *ntree = (bNodeTree*)ptr->id.data;
bNode *node= (bNode*)ptr->data; bNode *node = (bNode*)ptr->data;
char oldname[sizeof(node->name)]; char oldname[sizeof(node->name)];
/* make a copy of the old name first */ /* make a copy of the old name first */
@@ -406,8 +406,8 @@ static void rna_Node_name_set(PointerRNA *ptr, const char *value)
static void rna_NodeSocket_update(Main *bmain, Scene *scene, PointerRNA *ptr) static void rna_NodeSocket_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{ {
bNodeTree *ntree= (bNodeTree*)ptr->id.data; bNodeTree *ntree = (bNodeTree*)ptr->id.data;
bNodeSocket *sock= (bNodeSocket*)ptr->data; bNodeSocket *sock = (bNodeSocket*)ptr->data;
bNode *node; bNode *node;
if (nodeFindNode(ntree, sock, &node, NULL, NULL)) if (nodeFindNode(ntree, sock, &node, NULL, NULL))
@@ -416,8 +416,8 @@ static void rna_NodeSocket_update(Main *bmain, Scene *scene, PointerRNA *ptr)
static void rna_NodeGroupSocket_update(Main *bmain, Scene *scene, PointerRNA *ptr) static void rna_NodeGroupSocket_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{ {
bNodeTree *ntree= (bNodeTree*)ptr->id.data; bNodeTree *ntree = (bNodeTree*)ptr->id.data;
bNodeSocket *sock= (bNodeSocket*)ptr->data; bNodeSocket *sock = (bNodeSocket*)ptr->data;
bNode *node; bNode *node;
ntreeUpdateTree(ntree); ntreeUpdateTree(ntree);
@@ -429,7 +429,7 @@ static void rna_NodeGroupSocket_update(Main *bmain, Scene *scene, PointerRNA *pt
#if 0 /* UNUSED */ #if 0 /* UNUSED */
static void rna_NodeLink_update(Main *bmain, Scene *scene, PointerRNA *ptr) static void rna_NodeLink_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{ {
bNodeTree *ntree= (bNodeTree*)ptr->id.data; bNodeTree *ntree = (bNodeTree*)ptr->id.data;
ntree->update |= NTREE_UPDATE_LINKS; ntree->update |= NTREE_UPDATE_LINKS;
ntreeUpdateTree(ntree); ntreeUpdateTree(ntree);
@@ -438,33 +438,33 @@ static void rna_NodeLink_update(Main *bmain, Scene *scene, PointerRNA *ptr)
static void rna_NodeSocketInt_range(PointerRNA *ptr, int *min, int *max) static void rna_NodeSocketInt_range(PointerRNA *ptr, int *min, int *max)
{ {
bNodeSocket *sock= (bNodeSocket*)ptr->data; bNodeSocket *sock = (bNodeSocket*)ptr->data;
bNodeSocketValueInt *val= (bNodeSocketValueInt*)sock->default_value; bNodeSocketValueInt *val = (bNodeSocketValueInt*)sock->default_value;
*min = val->min; *min = val->min;
*max = val->max; *max = val->max;
} }
static void rna_NodeSocketFloat_range(PointerRNA *ptr, float *min, float *max) static void rna_NodeSocketFloat_range(PointerRNA *ptr, float *min, float *max)
{ {
bNodeSocket *sock= (bNodeSocket*)ptr->data; bNodeSocket *sock = (bNodeSocket*)ptr->data;
bNodeSocketValueFloat *val= (bNodeSocketValueFloat*)sock->default_value; bNodeSocketValueFloat *val = (bNodeSocketValueFloat*)sock->default_value;
*min = val->min; *min = val->min;
*max = val->max; *max = val->max;
} }
static void rna_NodeSocketVector_range(PointerRNA *ptr, float *min, float *max) static void rna_NodeSocketVector_range(PointerRNA *ptr, float *min, float *max)
{ {
bNodeSocket *sock= (bNodeSocket*)ptr->data; bNodeSocket *sock = (bNodeSocket*)ptr->data;
bNodeSocketValueVector *val= (bNodeSocketValueVector*)sock->default_value; bNodeSocketValueVector *val = (bNodeSocketValueVector*)sock->default_value;
*min = val->min; *min = val->min;
*max = val->max; *max = val->max;
} }
static void rna_Node_image_layer_update(Main *bmain, Scene *scene, PointerRNA *ptr) static void rna_Node_image_layer_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{ {
bNode *node= (bNode*)ptr->data; bNode *node = (bNode*)ptr->data;
Image *ima = (Image *)node->id; Image *ima = (Image *)node->id;
ImageUser *iuser= node->storage; ImageUser *iuser = node->storage;
BKE_image_multilayer_index(ima->rr, iuser); BKE_image_multilayer_index(ima->rr, iuser);
BKE_image_signal(ima, iuser, IMA_SIGNAL_SRC_CHANGE); BKE_image_signal(ima, iuser, IMA_SIGNAL_SRC_CHANGE);
@@ -474,16 +474,16 @@ static void rna_Node_image_layer_update(Main *bmain, Scene *scene, PointerRNA *p
static EnumPropertyItem *renderresult_layers_add_enum(RenderLayer *rl) static EnumPropertyItem *renderresult_layers_add_enum(RenderLayer *rl)
{ {
EnumPropertyItem *item= NULL; EnumPropertyItem *item = NULL;
EnumPropertyItem tmp = {0, "", 0, "", ""}; EnumPropertyItem tmp = {0, "", 0, "", ""};
int i=0, totitem=0; int i = 0, totitem = 0;
while (rl) { while (rl) {
tmp.identifier = rl->name; tmp.identifier = rl->name;
tmp.name= rl->name; tmp.name = rl->name;
tmp.value = i++; tmp.value = i++;
RNA_enum_item_add(&item, &totitem, &tmp); RNA_enum_item_add(&item, &totitem, &tmp);
rl=rl->next; rl = rl->next;
} }
RNA_enum_item_end(&item, &totitem); RNA_enum_item_end(&item, &totitem);
@@ -493,9 +493,9 @@ static EnumPropertyItem *renderresult_layers_add_enum(RenderLayer *rl)
static EnumPropertyItem *rna_Node_image_layer_itemf(bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *free) static EnumPropertyItem *rna_Node_image_layer_itemf(bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *free)
{ {
bNode *node= (bNode*)ptr->data; bNode *node = (bNode*)ptr->data;
Image *ima = (Image *)node->id; Image *ima = (Image *)node->id;
EnumPropertyItem *item= NULL; EnumPropertyItem *item = NULL;
RenderLayer *rl; RenderLayer *rl;
if (!ima || !(ima->rr)) return NULL; if (!ima || !(ima->rr)) return NULL;
@@ -503,16 +503,16 @@ static EnumPropertyItem *rna_Node_image_layer_itemf(bContext *UNUSED(C), Pointer
rl = ima->rr->layers.first; rl = ima->rr->layers.first;
item = renderresult_layers_add_enum(rl); item = renderresult_layers_add_enum(rl);
*free= 1; *free = 1;
return item; return item;
} }
static EnumPropertyItem *rna_Node_scene_layer_itemf(bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *free) static EnumPropertyItem *rna_Node_scene_layer_itemf(bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *free)
{ {
bNode *node= (bNode*)ptr->data; bNode *node = (bNode*)ptr->data;
Scene *sce = (Scene *)node->id; Scene *sce = (Scene *)node->id;
EnumPropertyItem *item= NULL; EnumPropertyItem *item = NULL;
RenderLayer *rl; RenderLayer *rl;
if (!sce) return NULL; if (!sce) return NULL;
@@ -520,49 +520,49 @@ static EnumPropertyItem *rna_Node_scene_layer_itemf(bContext *UNUSED(C), Pointer
rl = sce->r.layers.first; rl = sce->r.layers.first;
item = renderresult_layers_add_enum(rl); item = renderresult_layers_add_enum(rl);
*free= 1; *free = 1;
return item; return item;
} }
static EnumPropertyItem *rna_Node_channel_itemf(bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *free) static EnumPropertyItem *rna_Node_channel_itemf(bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *free)
{ {
bNode *node= (bNode*)ptr->data; bNode *node = (bNode*)ptr->data;
EnumPropertyItem *item= NULL; EnumPropertyItem *item = NULL;
EnumPropertyItem tmp = {0, "", 0, "", ""}; EnumPropertyItem tmp = {0, "", 0, "", ""};
int totitem=0; int totitem = 0;
switch(node->custom1) { switch (node->custom1) {
case CMP_NODE_CHANNEL_MATTE_CS_RGB: case CMP_NODE_CHANNEL_MATTE_CS_RGB:
tmp.identifier= "R"; tmp.name= "R"; tmp.value= 1; tmp.identifier = "R"; tmp.name = "R"; tmp.value = 1;
RNA_enum_item_add(&item, &totitem, &tmp); RNA_enum_item_add(&item, &totitem, &tmp);
tmp.identifier= "G"; tmp.name= "G"; tmp.value= 2; tmp.identifier = "G"; tmp.name = "G"; tmp.value = 2;
RNA_enum_item_add(&item, &totitem, &tmp); RNA_enum_item_add(&item, &totitem, &tmp);
tmp.identifier= "B"; tmp.name= "B"; tmp.value= 3; tmp.identifier = "B"; tmp.name = "B"; tmp.value = 3;
RNA_enum_item_add(&item, &totitem, &tmp); RNA_enum_item_add(&item, &totitem, &tmp);
break; break;
case CMP_NODE_CHANNEL_MATTE_CS_HSV: case CMP_NODE_CHANNEL_MATTE_CS_HSV:
tmp.identifier= "H"; tmp.name= "H"; tmp.value= 1; tmp.identifier = "H"; tmp.name = "H"; tmp.value = 1;
RNA_enum_item_add(&item, &totitem, &tmp); RNA_enum_item_add(&item, &totitem, &tmp);
tmp.identifier= "S"; tmp.name= "S"; tmp.value= 2; tmp.identifier = "S"; tmp.name = "S"; tmp.value = 2;
RNA_enum_item_add(&item, &totitem, &tmp); RNA_enum_item_add(&item, &totitem, &tmp);
tmp.identifier= "V"; tmp.name= "V"; tmp.value= 3; tmp.identifier = "V"; tmp.name = "V"; tmp.value = 3;
RNA_enum_item_add(&item, &totitem, &tmp); RNA_enum_item_add(&item, &totitem, &tmp);
break; break;
case CMP_NODE_CHANNEL_MATTE_CS_YUV: case CMP_NODE_CHANNEL_MATTE_CS_YUV:
tmp.identifier= "Y"; tmp.name= "Y"; tmp.value= 1; tmp.identifier = "Y"; tmp.name = "Y"; tmp.value = 1;
RNA_enum_item_add(&item, &totitem, &tmp); RNA_enum_item_add(&item, &totitem, &tmp);
tmp.identifier= "G"; tmp.name= "U"; tmp.value= 2; tmp.identifier = "G"; tmp.name = "U"; tmp.value = 2;
RNA_enum_item_add(&item, &totitem, &tmp); RNA_enum_item_add(&item, &totitem, &tmp);
tmp.identifier= "V"; tmp.name= "V"; tmp.value= 3; tmp.identifier = "V"; tmp.name = "V"; tmp.value = 3;
RNA_enum_item_add(&item, &totitem, &tmp); RNA_enum_item_add(&item, &totitem, &tmp);
break; break;
case CMP_NODE_CHANNEL_MATTE_CS_YCC: case CMP_NODE_CHANNEL_MATTE_CS_YCC:
tmp.identifier= "Y"; tmp.name= "Y"; tmp.value= 1; tmp.identifier = "Y"; tmp.name = "Y"; tmp.value = 1;
RNA_enum_item_add(&item, &totitem, &tmp); RNA_enum_item_add(&item, &totitem, &tmp);
tmp.identifier= "CB"; tmp.name= "Cr"; tmp.value= 2; tmp.identifier = "CB"; tmp.name = "Cr"; tmp.value = 2;
RNA_enum_item_add(&item, &totitem, &tmp); RNA_enum_item_add(&item, &totitem, &tmp);
tmp.identifier= "CR"; tmp.name= "Cb"; tmp.value= 3; tmp.identifier = "CR"; tmp.name = "Cb"; tmp.value = 3;
RNA_enum_item_add(&item, &totitem, &tmp); RNA_enum_item_add(&item, &totitem, &tmp);
break; break;
default: default:
@@ -570,7 +570,7 @@ static EnumPropertyItem *rna_Node_channel_itemf(bContext *UNUSED(C), PointerRNA
} }
RNA_enum_item_end(&item, &totitem); RNA_enum_item_end(&item, &totitem);
*free= 1; *free = 1;
return item; return item;
} }
@@ -607,18 +607,18 @@ static bNode *rna_NodeTree_node_new(bNodeTree *ntree, bContext *UNUSED(C), Repor
static bNode *rna_NodeTree_node_composite_new(bNodeTree *ntree, bContext *C, ReportList *reports, int type, bNodeTree *group) static bNode *rna_NodeTree_node_composite_new(bNodeTree *ntree, bContext *C, ReportList *reports, int type, bNodeTree *group)
{ {
/* raises error on failure */ /* raises error on failure */
bNode *node= rna_NodeTree_node_new(ntree, C, reports, type, group); bNode *node = rna_NodeTree_node_new(ntree, C, reports, type, group);
if (node) { if (node) {
if(ELEM4(node->type, CMP_NODE_COMPOSITE, CMP_NODE_DEFOCUS, CMP_NODE_OUTPUT_FILE, CMP_NODE_R_LAYERS)) { if (ELEM4(node->type, CMP_NODE_COMPOSITE, CMP_NODE_DEFOCUS, CMP_NODE_OUTPUT_FILE, CMP_NODE_R_LAYERS)) {
/* annoying, find the node tree we are in, scene can be NULL */ /* annoying, find the node tree we are in, scene can be NULL */
Scene *scene; Scene *scene;
for(scene= CTX_data_main(C)->scene.first; scene; scene= scene->id.next) { for (scene = CTX_data_main(C)->scene.first; scene; scene = scene->id.next) {
if(scene->nodetree == ntree) { if (scene->nodetree == ntree) {
break; break;
} }
} }
node->id= (ID *)scene; node->id = (ID *)scene;
id_us_plus(node->id); id_us_plus(node->id);
} }
@@ -632,7 +632,7 @@ static bNode *rna_NodeTree_node_composite_new(bNodeTree *ntree, bContext *C, Rep
static bNode *rna_NodeTree_node_texture_new(bNodeTree *ntree, bContext *C, ReportList *reports, int type, bNodeTree *group) static bNode *rna_NodeTree_node_texture_new(bNodeTree *ntree, bContext *C, ReportList *reports, int type, bNodeTree *group)
{ {
/* raises error on failure */ /* raises error on failure */
bNode *node= rna_NodeTree_node_new(ntree, C, reports, type, group); bNode *node = rna_NodeTree_node_new(ntree, C, reports, type, group);
if (node) { if (node) {
ntreeTexCheckCyclics(ntree); ntreeTexCheckCyclics(ntree);
@@ -659,17 +659,17 @@ static void rna_NodeTree_node_remove(bNodeTree *ntree, ReportList *reports, bNod
static void rna_NodeTree_node_clear(bNodeTree *ntree) static void rna_NodeTree_node_clear(bNodeTree *ntree)
{ {
bNode *node= ntree->nodes.first; bNode *node = ntree->nodes.first;
while(node) { while (node) {
bNode *next_node= node->next; bNode *next_node = node->next;
if (node->id) if (node->id)
id_us_min(node->id); id_us_min(node->id);
nodeFreeNode(ntree, node); nodeFreeNode(ntree, node);
node= next_node; node = next_node;
} }
ntreeUpdateTree(ntree); /* update group node socket links*/ ntreeUpdateTree(ntree); /* update group node socket links*/
@@ -680,7 +680,7 @@ static void rna_NodeTree_node_clear(bNodeTree *ntree)
static bNodeLink *rna_NodeTree_link_new(bNodeTree *ntree, ReportList *reports, bNodeSocket *in, bNodeSocket *out) static bNodeLink *rna_NodeTree_link_new(bNodeTree *ntree, ReportList *reports, bNodeSocket *in, bNodeSocket *out)
{ {
bNodeLink *ret; bNodeLink *ret;
bNode *fromnode= NULL, *tonode= NULL; bNode *fromnode = NULL, *tonode = NULL;
int from_in_out, to_in_out; int from_in_out, to_in_out;
nodeFindNode(ntree, in, &fromnode, NULL, &from_in_out); nodeFindNode(ntree, in, &fromnode, NULL, &from_in_out);
@@ -694,9 +694,9 @@ static bNodeLink *rna_NodeTree_link_new(bNodeTree *ntree, ReportList *reports, b
/* unlink node input socket */ /* unlink node input socket */
nodeRemSocketLinks(ntree, out); nodeRemSocketLinks(ntree, out);
ret= nodeAddLink(ntree, fromnode, in, tonode, out); ret = nodeAddLink(ntree, fromnode, in, tonode, out);
if(ret) { if (ret) {
nodeUpdate(ntree, tonode); nodeUpdate(ntree, tonode);
ntreeUpdateTree(ntree); ntreeUpdateTree(ntree);
@@ -721,14 +721,14 @@ static void rna_NodeTree_link_remove(bNodeTree *ntree, ReportList *reports, bNod
static void rna_NodeTree_link_clear(bNodeTree *ntree) static void rna_NodeTree_link_clear(bNodeTree *ntree)
{ {
bNodeLink *link= ntree->links.first; bNodeLink *link = ntree->links.first;
while(link) { while (link) {
bNodeLink *next_link= link->next; bNodeLink *next_link = link->next;
nodeRemLink(ntree, link); nodeRemLink(ntree, link);
link= next_link; link = next_link;
} }
ntreeUpdateTree(ntree); ntreeUpdateTree(ntree);
@@ -738,7 +738,7 @@ static void rna_NodeTree_link_clear(bNodeTree *ntree)
static bNodeSocket *rna_NodeTree_input_new(bNodeTree *ntree, ReportList *UNUSED(reports), const char *name, int type) static bNodeSocket *rna_NodeTree_input_new(bNodeTree *ntree, ReportList *UNUSED(reports), const char *name, int type)
{ {
/* XXX should check if tree is a group here! no good way to do this currently. */ /* XXX should check if tree is a group here! no good way to do this currently. */
bNodeSocket *gsock= node_group_add_socket(ntree, name, type, SOCK_IN); bNodeSocket *gsock = node_group_add_socket(ntree, name, type, SOCK_IN);
ntree->update |= NTREE_UPDATE_GROUP_IN; ntree->update |= NTREE_UPDATE_GROUP_IN;
ntreeUpdateTree(ntree); ntreeUpdateTree(ntree);
@@ -749,7 +749,7 @@ static bNodeSocket *rna_NodeTree_input_new(bNodeTree *ntree, ReportList *UNUSED(
static bNodeSocket *rna_NodeTree_output_new(bNodeTree *ntree, ReportList *UNUSED(reports), const char *name, int type) static bNodeSocket *rna_NodeTree_output_new(bNodeTree *ntree, ReportList *UNUSED(reports), const char *name, int type)
{ {
/* XXX should check if tree is a group here! no good way to do this currently. */ /* XXX should check if tree is a group here! no good way to do this currently. */
bNodeSocket *gsock= node_group_add_socket(ntree, name, type, SOCK_OUT); bNodeSocket *gsock = node_group_add_socket(ntree, name, type, SOCK_OUT);
ntree->update |= NTREE_UPDATE_GROUP_OUT; ntree->update |= NTREE_UPDATE_GROUP_OUT;
ntreeUpdateTree(ntree); ntreeUpdateTree(ntree);
@@ -765,7 +765,7 @@ static bNodeSocket *rna_NodeTree_input_expose(bNodeTree *ntree, ReportList *repo
if (!nodeFindNode(ntree, sock, &node, &index, &in_out)) if (!nodeFindNode(ntree, sock, &node, &index, &in_out))
BKE_reportf(reports, RPT_ERROR, "Unable to locate socket in nodetree"); BKE_reportf(reports, RPT_ERROR, "Unable to locate socket in nodetree");
else if (in_out!=SOCK_IN) else if (in_out != SOCK_IN)
BKE_reportf(reports, RPT_ERROR, "Socket is not an input"); BKE_reportf(reports, RPT_ERROR, "Socket is not an input");
else { else {
/* XXX should check if tree is a group here! no good way to do this currently. */ /* XXX should check if tree is a group here! no good way to do this currently. */
@@ -789,7 +789,7 @@ static bNodeSocket *rna_NodeTree_output_expose(bNodeTree *ntree, ReportList *rep
if (!nodeFindNode(ntree, sock, &node, &index, &in_out)) if (!nodeFindNode(ntree, sock, &node, &index, &in_out))
BKE_reportf(reports, RPT_ERROR, "Unable to locate socket in nodetree"); BKE_reportf(reports, RPT_ERROR, "Unable to locate socket in nodetree");
else if (in_out!=SOCK_OUT) else if (in_out != SOCK_OUT)
BKE_reportf(reports, RPT_ERROR, "Socket is not an output"); BKE_reportf(reports, RPT_ERROR, "Socket is not an output");
else { else {
/* XXX should check if tree is a group here! no good way to do this currently. */ /* XXX should check if tree is a group here! no good way to do this currently. */
@@ -929,15 +929,15 @@ static void alloc_node_type_items(EnumPropertyItem *items, int category)
int count = 3; int count = 3;
EnumPropertyItem *item = items; EnumPropertyItem *item = items;
for(i=0; i<MaxNodes; i++) for (i = 0; i<MaxNodes; i++)
if(nodes[i].defined && nodes[i].category == category) if (nodes[i].defined && nodes[i].category == category)
count++; count++;
/*item = items = MEM_callocN(count * sizeof(EnumPropertyItem), "alloc_node_type_items");*/ /*item = items = MEM_callocN(count * sizeof(EnumPropertyItem), "alloc_node_type_items");*/
for(i=0; i<MaxNodes; i++) { for (i = 0; i<MaxNodes; i++) {
NodeInfo *node = nodes + i; NodeInfo *node = nodes + i;
if(node->defined && node->category == category) { if (node->defined && node->category == category) {
item->value = i; item->value = i;
item->identifier = node->enum_name; item->identifier = node->enum_name;
item->icon = node->icon; item->icon = node->icon;
@@ -1016,7 +1016,7 @@ static void def_whileloop(StructRNA *srna)
static void def_frame(StructRNA *srna) static void def_frame(StructRNA *srna)
{ {
// PropertyRNA *prop; /* PropertyRNA *prop; */
} }
@@ -1165,37 +1165,37 @@ static void def_sh_mapping(StructRNA *srna)
RNA_def_struct_sdna_from(srna, "TexMapping", "storage"); RNA_def_struct_sdna_from(srna, "TexMapping", "storage");
prop= RNA_def_property(srna, "location", PROP_FLOAT, PROP_TRANSLATION); prop = RNA_def_property(srna, "location", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "loc"); RNA_def_property_float_sdna(prop, NULL, "loc");
RNA_def_property_ui_text(prop, "Location", ""); RNA_def_property_ui_text(prop, "Location", "");
RNA_def_property_update(prop, 0, "rna_Mapping_Node_update"); RNA_def_property_update(prop, 0, "rna_Mapping_Node_update");
prop= RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_EULER); /* Not PROP_XYZ, this is now in radians, no more degrees */ prop = RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_EULER); /* Not PROP_XYZ, this is now in radians, no more degrees */
RNA_def_property_float_sdna(prop, NULL, "rot"); RNA_def_property_float_sdna(prop, NULL, "rot");
RNA_def_property_ui_text(prop, "Rotation", ""); RNA_def_property_ui_text(prop, "Rotation", "");
RNA_def_property_update(prop, 0, "rna_Mapping_Node_update"); RNA_def_property_update(prop, 0, "rna_Mapping_Node_update");
prop= RNA_def_property(srna, "scale", PROP_FLOAT, PROP_XYZ); prop = RNA_def_property(srna, "scale", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "size"); RNA_def_property_float_sdna(prop, NULL, "size");
RNA_def_property_ui_text(prop, "Scale", ""); RNA_def_property_ui_text(prop, "Scale", "");
RNA_def_property_update(prop, 0, "rna_Mapping_Node_update"); RNA_def_property_update(prop, 0, "rna_Mapping_Node_update");
prop= RNA_def_property(srna, "min", PROP_FLOAT, PROP_XYZ); prop = RNA_def_property(srna, "min", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "min"); RNA_def_property_float_sdna(prop, NULL, "min");
RNA_def_property_ui_text(prop, "Minimum", "Minimum value for clipping"); RNA_def_property_ui_text(prop, "Minimum", "Minimum value for clipping");
RNA_def_property_update(prop, 0, "rna_Mapping_Node_update"); RNA_def_property_update(prop, 0, "rna_Mapping_Node_update");
prop= RNA_def_property(srna, "max", PROP_FLOAT, PROP_XYZ); prop = RNA_def_property(srna, "max", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "max"); RNA_def_property_float_sdna(prop, NULL, "max");
RNA_def_property_ui_text(prop, "Maximum", "Maximum value for clipping"); RNA_def_property_ui_text(prop, "Maximum", "Maximum value for clipping");
RNA_def_property_update(prop, 0, "rna_Mapping_Node_update"); RNA_def_property_update(prop, 0, "rna_Mapping_Node_update");
prop= RNA_def_property(srna, "use_min", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_min", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TEXMAP_CLIP_MIN); RNA_def_property_boolean_sdna(prop, NULL, "flag", TEXMAP_CLIP_MIN);
RNA_def_property_ui_text(prop, "Has Minimum", "Whether to use minimum clipping value"); RNA_def_property_ui_text(prop, "Has Minimum", "Whether to use minimum clipping value");
RNA_def_property_update(prop, 0, "rna_Mapping_Node_update"); RNA_def_property_update(prop, 0, "rna_Mapping_Node_update");
prop= RNA_def_property(srna, "use_max", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_max", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TEXMAP_CLIP_MAX); RNA_def_property_boolean_sdna(prop, NULL, "flag", TEXMAP_CLIP_MAX);
RNA_def_property_ui_text(prop, "Has Maximum", "Whether to use maximum clipping value"); RNA_def_property_ui_text(prop, "Has Maximum", "Whether to use maximum clipping value");
RNA_def_property_update(prop, 0, "rna_Mapping_Node_update"); RNA_def_property_update(prop, 0, "rna_Mapping_Node_update");
@@ -1234,12 +1234,12 @@ static void def_sh_tex(StructRNA *srna)
{ {
PropertyRNA *prop; PropertyRNA *prop;
prop= RNA_def_property(srna, "texture_mapping", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "texture_mapping", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "base.tex_mapping"); RNA_def_property_pointer_sdna(prop, NULL, "base.tex_mapping");
RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_ui_text(prop, "Texture Mapping", "Texture coordinate mapping settings"); RNA_def_property_ui_text(prop, "Texture Mapping", "Texture coordinate mapping settings");
prop= RNA_def_property(srna, "color_mapping", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "color_mapping", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "base.color_mapping"); RNA_def_property_pointer_sdna(prop, NULL, "base.color_mapping");
RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_ui_text(prop, "Color Mapping", "Color mapping settings"); RNA_def_property_ui_text(prop, "Color Mapping", "Color mapping settings");
@@ -1263,7 +1263,7 @@ static void def_sh_tex_sky(StructRNA *srna)
static void def_sh_tex_environment(StructRNA *srna) static void def_sh_tex_environment(StructRNA *srna)
{ {
static const EnumPropertyItem prop_color_space_items[]= { static const EnumPropertyItem prop_color_space_items[] = {
{SHD_COLORSPACE_SRGB, "SRGB", 0, "sRGB", "Image is in sRGB color space"}, {SHD_COLORSPACE_SRGB, "SRGB", 0, "sRGB", "Image is in sRGB color space"},
{SHD_COLORSPACE_LINEAR, "LINEAR", 0, "Linear", "Image is in scene linear color space"}, {SHD_COLORSPACE_LINEAR, "LINEAR", 0, "Linear", "Image is in scene linear color space"},
{0, NULL, 0, NULL, NULL}}; {0, NULL, 0, NULL, NULL}};
@@ -1280,7 +1280,7 @@ static void def_sh_tex_environment(StructRNA *srna)
RNA_def_struct_sdna_from(srna, "NodeTexImage", "storage"); RNA_def_struct_sdna_from(srna, "NodeTexImage", "storage");
def_sh_tex(srna); def_sh_tex(srna);
prop= RNA_def_property(srna, "color_space", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "color_space", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, prop_color_space_items); RNA_def_property_enum_items(prop, prop_color_space_items);
RNA_def_property_ui_text(prop, "Color Space", "Image file color space"); RNA_def_property_ui_text(prop, "Color Space", "Image file color space");
RNA_def_property_update(prop, 0, "rna_Node_update"); RNA_def_property_update(prop, 0, "rna_Node_update");
@@ -1288,7 +1288,7 @@ static void def_sh_tex_environment(StructRNA *srna)
static void def_sh_tex_image(StructRNA *srna) static void def_sh_tex_image(StructRNA *srna)
{ {
static const EnumPropertyItem prop_color_space_items[]= { static const EnumPropertyItem prop_color_space_items[] = {
{SHD_COLORSPACE_LINEAR, "LINEAR", 0, "Linear", "Image is in scene linear color space"}, {SHD_COLORSPACE_LINEAR, "LINEAR", 0, "Linear", "Image is in scene linear color space"},
{SHD_COLORSPACE_SRGB, "SRGB", 0, "sRGB", "Image is in sRGB color space"}, {SHD_COLORSPACE_SRGB, "SRGB", 0, "sRGB", "Image is in sRGB color space"},
{0, NULL, 0, NULL, NULL}}; {0, NULL, 0, NULL, NULL}};
@@ -1305,7 +1305,7 @@ static void def_sh_tex_image(StructRNA *srna)
RNA_def_struct_sdna_from(srna, "NodeTexImage", "storage"); RNA_def_struct_sdna_from(srna, "NodeTexImage", "storage");
def_sh_tex(srna); def_sh_tex(srna);
prop= RNA_def_property(srna, "color_space", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "color_space", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, prop_color_space_items); RNA_def_property_enum_items(prop, prop_color_space_items);
RNA_def_property_ui_text(prop, "Color Space", "Image file color space"); RNA_def_property_ui_text(prop, "Color Space", "Image file color space");
RNA_def_property_update(prop, 0, "rna_Node_update"); RNA_def_property_update(prop, 0, "rna_Node_update");
@@ -1328,7 +1328,7 @@ static void def_sh_tex_gradient(StructRNA *srna)
RNA_def_struct_sdna_from(srna, "NodeTexGradient", "storage"); RNA_def_struct_sdna_from(srna, "NodeTexGradient", "storage");
def_sh_tex(srna); def_sh_tex(srna);
prop= RNA_def_property(srna, "gradient_type", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "gradient_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, prop_gradient_type); RNA_def_property_enum_items(prop, prop_gradient_type);
RNA_def_property_ui_text(prop, "Gradient Type", "Style of the color blending"); RNA_def_property_ui_text(prop, "Gradient Type", "Style of the color blending");
RNA_def_property_update(prop, 0, "rna_Node_update"); RNA_def_property_update(prop, 0, "rna_Node_update");
@@ -1353,7 +1353,7 @@ static void def_sh_tex_magic(StructRNA *srna)
RNA_def_struct_sdna_from(srna, "NodeTexMagic", "storage"); RNA_def_struct_sdna_from(srna, "NodeTexMagic", "storage");
def_sh_tex(srna); def_sh_tex(srna);
prop= RNA_def_property(srna, "turbulence_depth", PROP_INT, PROP_NONE); prop = RNA_def_property(srna, "turbulence_depth", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "depth"); RNA_def_property_int_sdna(prop, NULL, "depth");
RNA_def_property_range(prop, 0, 10); RNA_def_property_range(prop, 0, 10);
RNA_def_property_ui_text(prop, "Depth", "Level of detail in the added turbulent noise"); RNA_def_property_ui_text(prop, "Depth", "Level of detail in the added turbulent noise");
@@ -1375,7 +1375,7 @@ static void def_sh_tex_musgrave(StructRNA *srna)
RNA_def_struct_sdna_from(srna, "NodeTexMusgrave", "storage"); RNA_def_struct_sdna_from(srna, "NodeTexMusgrave", "storage");
def_sh_tex(srna); def_sh_tex(srna);
prop= RNA_def_property(srna, "musgrave_type", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "musgrave_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "musgrave_type"); RNA_def_property_enum_sdna(prop, NULL, "musgrave_type");
RNA_def_property_enum_items(prop, prop_musgrave_type); RNA_def_property_enum_items(prop, prop_musgrave_type);
RNA_def_property_ui_text(prop, "Type", ""); RNA_def_property_ui_text(prop, "Type", "");
@@ -1394,7 +1394,7 @@ static void def_sh_tex_voronoi(StructRNA *srna)
RNA_def_struct_sdna_from(srna, "NodeTexVoronoi", "storage"); RNA_def_struct_sdna_from(srna, "NodeTexVoronoi", "storage");
def_sh_tex(srna); def_sh_tex(srna);
prop= RNA_def_property(srna, "coloring", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "coloring", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "coloring"); RNA_def_property_enum_sdna(prop, NULL, "coloring");
RNA_def_property_enum_items(prop, prop_coloring_items); RNA_def_property_enum_items(prop, prop_coloring_items);
RNA_def_property_ui_text(prop, "Coloring", ""); RNA_def_property_ui_text(prop, "Coloring", "");
@@ -1413,7 +1413,7 @@ static void def_sh_tex_wave(StructRNA *srna)
RNA_def_struct_sdna_from(srna, "NodeTexWave", "storage"); RNA_def_struct_sdna_from(srna, "NodeTexWave", "storage");
def_sh_tex(srna); def_sh_tex(srna);
prop= RNA_def_property(srna, "wave_type", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "wave_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "wave_type"); RNA_def_property_enum_sdna(prop, NULL, "wave_type");
RNA_def_property_enum_items(prop, prop_wave_type_items); RNA_def_property_enum_items(prop, prop_wave_type_items);
RNA_def_property_ui_text(prop, "Wave Type", ""); RNA_def_property_ui_text(prop, "Wave Type", "");
@@ -1437,7 +1437,7 @@ static void def_cmp_alpha_over(StructRNA *srna)
{ {
PropertyRNA *prop; PropertyRNA *prop;
// XXX: Tooltip /* XXX: Tooltip */
prop = RNA_def_property(srna, "use_premultiply", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_premultiply", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "custom1", 1); RNA_def_property_boolean_sdna(prop, NULL, "custom1", 1);
RNA_def_property_ui_text(prop, "Convert Premul", ""); RNA_def_property_ui_text(prop, "Convert Premul", "");
@@ -1720,7 +1720,7 @@ static void def_cmp_image(StructRNA *srna)
RNA_def_property_ui_text(prop, "Auto-Refresh", "Always refresh image on frame changes"); /* copied from the rna_image.c */ RNA_def_property_ui_text(prop, "Auto-Refresh", "Always refresh image on frame changes"); /* copied from the rna_image.c */
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
prop= RNA_def_property(srna, "layer", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "layer", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "layer"); RNA_def_property_enum_sdna(prop, NULL, "layer");
RNA_def_property_enum_items(prop, prop_image_layer_items); RNA_def_property_enum_items(prop, prop_image_layer_items);
RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Node_image_layer_itemf"); RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Node_image_layer_itemf");
@@ -1740,7 +1740,7 @@ static void def_cmp_render_layers(StructRNA *srna)
RNA_def_property_ui_text(prop, "Scene", ""); RNA_def_property_ui_text(prop, "Scene", "");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
prop= RNA_def_property(srna, "layer", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "layer", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "custom1"); RNA_def_property_enum_sdna(prop, NULL, "custom1");
RNA_def_property_enum_items(prop, prop_scene_layer_items); RNA_def_property_enum_items(prop, prop_scene_layer_items);
RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Node_scene_layer_itemf"); RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Node_scene_layer_itemf");
@@ -2062,7 +2062,7 @@ static void def_cmp_channel_matte(StructRNA *srna)
RNA_def_property_ui_text(prop, "Color Space", ""); RNA_def_property_ui_text(prop, "Color Space", "");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
prop= RNA_def_property(srna, "matte_channel", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "matte_channel", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "custom2"); RNA_def_property_enum_sdna(prop, NULL, "custom2");
RNA_def_property_enum_items(prop, prop_tri_channel_items); RNA_def_property_enum_items(prop, prop_tri_channel_items);
RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Node_channel_itemf"); RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Node_channel_itemf");
@@ -2917,28 +2917,28 @@ static void rna_def_nodetree_link_api(BlenderRNA *brna, PropertyRNA *cprop)
FunctionRNA *func; FunctionRNA *func;
RNA_def_property_srna(cprop, "NodeLinks"); RNA_def_property_srna(cprop, "NodeLinks");
srna= RNA_def_struct(brna, "NodeLinks", NULL); srna = RNA_def_struct(brna, "NodeLinks", NULL);
RNA_def_struct_sdna(srna, "bNodeTree"); RNA_def_struct_sdna(srna, "bNodeTree");
RNA_def_struct_ui_text(srna, "Node Links", "Collection of Node Links"); RNA_def_struct_ui_text(srna, "Node Links", "Collection of Node Links");
func= RNA_def_function(srna, "new", "rna_NodeTree_link_new"); func = RNA_def_function(srna, "new", "rna_NodeTree_link_new");
RNA_def_function_ui_description(func, "Add a node link to this node tree"); RNA_def_function_ui_description(func, "Add a node link to this node tree");
RNA_def_function_flag(func, FUNC_USE_REPORTS); RNA_def_function_flag(func, FUNC_USE_REPORTS);
parm= RNA_def_pointer(func, "input", "NodeSocket", "", "The input socket"); parm = RNA_def_pointer(func, "input", "NodeSocket", "", "The input socket");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
parm= RNA_def_pointer(func, "output", "NodeSocket", "", "The output socket"); parm = RNA_def_pointer(func, "output", "NodeSocket", "", "The output socket");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
/* return */ /* return */
parm= RNA_def_pointer(func, "link", "NodeLink", "", "New node link"); parm = RNA_def_pointer(func, "link", "NodeLink", "", "New node link");
RNA_def_function_return(func, parm); RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "remove", "rna_NodeTree_link_remove"); func = RNA_def_function(srna, "remove", "rna_NodeTree_link_remove");
RNA_def_function_ui_description(func, "remove a node link from the node tree"); RNA_def_function_ui_description(func, "remove a node link from the node tree");
RNA_def_function_flag(func, FUNC_USE_REPORTS); RNA_def_function_flag(func, FUNC_USE_REPORTS);
parm= RNA_def_pointer(func, "link", "NodeLink", "", "The node link to remove"); parm = RNA_def_pointer(func, "link", "NodeLink", "", "The node link to remove");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
func= RNA_def_function(srna, "clear", "rna_NodeTree_link_clear"); func = RNA_def_function(srna, "clear", "rna_NodeTree_link_clear");
RNA_def_function_ui_description(func, "remove all node links from the node tree"); RNA_def_function_ui_description(func, "remove all node links from the node tree");
} }
@@ -2949,27 +2949,27 @@ static void rna_def_composite_nodetree_api(BlenderRNA *brna, PropertyRNA *cprop)
FunctionRNA *func; FunctionRNA *func;
RNA_def_property_srna(cprop, "CompositorNodes"); RNA_def_property_srna(cprop, "CompositorNodes");
srna= RNA_def_struct(brna, "CompositorNodes", NULL); srna = RNA_def_struct(brna, "CompositorNodes", NULL);
RNA_def_struct_sdna(srna, "bNodeTree"); RNA_def_struct_sdna(srna, "bNodeTree");
RNA_def_struct_ui_text(srna, "Compositor Nodes", "Collection of Compositor Nodes"); RNA_def_struct_ui_text(srna, "Compositor Nodes", "Collection of Compositor Nodes");
func= RNA_def_function(srna, "new", "rna_NodeTree_node_composite_new"); func = RNA_def_function(srna, "new", "rna_NodeTree_node_composite_new");
RNA_def_function_ui_description(func, "Add a node to this node tree"); RNA_def_function_ui_description(func, "Add a node to this node tree");
RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS); RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
parm= RNA_def_enum(func, "type", compositor_node_type_items, 0, "Type", "Type of node to add"); parm = RNA_def_enum(func, "type", compositor_node_type_items, 0, "Type", "Type of node to add");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_pointer(func, "group", "NodeTree", "", "The group tree"); RNA_def_pointer(func, "group", "NodeTree", "", "The group tree");
/* return value */ /* return value */
parm= RNA_def_pointer(func, "node", "Node", "", "New node"); parm = RNA_def_pointer(func, "node", "Node", "", "New node");
RNA_def_function_return(func, parm); RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "remove", "rna_NodeTree_node_remove"); func = RNA_def_function(srna, "remove", "rna_NodeTree_node_remove");
RNA_def_function_ui_description(func, "Remove a node from this node tree"); RNA_def_function_ui_description(func, "Remove a node from this node tree");
RNA_def_function_flag(func, FUNC_USE_REPORTS); RNA_def_function_flag(func, FUNC_USE_REPORTS);
parm= RNA_def_pointer(func, "node", "Node", "", "The node to remove"); parm = RNA_def_pointer(func, "node", "Node", "", "The node to remove");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
func= RNA_def_function(srna, "clear", "rna_NodeTree_node_clear"); func = RNA_def_function(srna, "clear", "rna_NodeTree_node_clear");
RNA_def_function_ui_description(func, "Remove all nodes from this node tree"); RNA_def_function_ui_description(func, "Remove all nodes from this node tree");
} }
@@ -2980,27 +2980,27 @@ static void rna_def_shader_nodetree_api(BlenderRNA *brna, PropertyRNA *cprop)
FunctionRNA *func; FunctionRNA *func;
RNA_def_property_srna(cprop, "ShaderNodes"); RNA_def_property_srna(cprop, "ShaderNodes");
srna= RNA_def_struct(brna, "ShaderNodes", NULL); srna = RNA_def_struct(brna, "ShaderNodes", NULL);
RNA_def_struct_sdna(srna, "bNodeTree"); RNA_def_struct_sdna(srna, "bNodeTree");
RNA_def_struct_ui_text(srna, "Shader Nodes", "Collection of Shader Nodes"); RNA_def_struct_ui_text(srna, "Shader Nodes", "Collection of Shader Nodes");
func= RNA_def_function(srna, "new", "rna_NodeTree_node_new"); func = RNA_def_function(srna, "new", "rna_NodeTree_node_new");
RNA_def_function_ui_description(func, "Add a node to this node tree"); RNA_def_function_ui_description(func, "Add a node to this node tree");
RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS); RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
parm= RNA_def_enum(func, "type", shader_node_type_items, 0, "Type", "Type of node to add"); parm = RNA_def_enum(func, "type", shader_node_type_items, 0, "Type", "Type of node to add");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_pointer(func, "group", "NodeTree", "", "The group tree"); RNA_def_pointer(func, "group", "NodeTree", "", "The group tree");
/* return value */ /* return value */
parm= RNA_def_pointer(func, "node", "Node", "", "New node"); parm = RNA_def_pointer(func, "node", "Node", "", "New node");
RNA_def_function_return(func, parm); RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "remove", "rna_NodeTree_node_remove"); func = RNA_def_function(srna, "remove", "rna_NodeTree_node_remove");
RNA_def_function_ui_description(func, "Remove a node from this node tree"); RNA_def_function_ui_description(func, "Remove a node from this node tree");
RNA_def_function_flag(func, FUNC_USE_REPORTS); RNA_def_function_flag(func, FUNC_USE_REPORTS);
parm= RNA_def_pointer(func, "node", "Node", "", "The node to remove"); parm = RNA_def_pointer(func, "node", "Node", "", "The node to remove");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
func= RNA_def_function(srna, "clear", "rna_NodeTree_node_clear"); func = RNA_def_function(srna, "clear", "rna_NodeTree_node_clear");
RNA_def_function_ui_description(func, "Remove all nodes from this node tree"); RNA_def_function_ui_description(func, "Remove all nodes from this node tree");
} }
@@ -3011,27 +3011,27 @@ static void rna_def_texture_nodetree_api(BlenderRNA *brna, PropertyRNA *cprop)
FunctionRNA *func; FunctionRNA *func;
RNA_def_property_srna(cprop, "TextureNodes"); RNA_def_property_srna(cprop, "TextureNodes");
srna= RNA_def_struct(brna, "TextureNodes", NULL); srna = RNA_def_struct(brna, "TextureNodes", NULL);
RNA_def_struct_sdna(srna, "bNodeTree"); RNA_def_struct_sdna(srna, "bNodeTree");
RNA_def_struct_ui_text(srna, "Texture Nodes", "Collection of Texture Nodes"); RNA_def_struct_ui_text(srna, "Texture Nodes", "Collection of Texture Nodes");
func= RNA_def_function(srna, "new", "rna_NodeTree_node_texture_new"); func = RNA_def_function(srna, "new", "rna_NodeTree_node_texture_new");
RNA_def_function_ui_description(func, "Add a node to this node tree"); RNA_def_function_ui_description(func, "Add a node to this node tree");
RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS); RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
parm= RNA_def_enum(func, "type", texture_node_type_items, 0, "Type", "Type of node to add"); parm = RNA_def_enum(func, "type", texture_node_type_items, 0, "Type", "Type of node to add");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_pointer(func, "group", "NodeTree", "", "The group tree"); RNA_def_pointer(func, "group", "NodeTree", "", "The group tree");
/* return value */ /* return value */
parm= RNA_def_pointer(func, "node", "Node", "", "New node"); parm = RNA_def_pointer(func, "node", "Node", "", "New node");
RNA_def_function_return(func, parm); RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "remove", "rna_NodeTree_node_remove"); func = RNA_def_function(srna, "remove", "rna_NodeTree_node_remove");
RNA_def_function_ui_description(func, "Remove a node from this node tree"); RNA_def_function_ui_description(func, "Remove a node from this node tree");
RNA_def_function_flag(func, FUNC_USE_REPORTS); RNA_def_function_flag(func, FUNC_USE_REPORTS);
parm= RNA_def_pointer(func, "node", "Node", "", "The node to remove"); parm = RNA_def_pointer(func, "node", "Node", "", "The node to remove");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
func= RNA_def_function(srna, "clear", "rna_NodeTree_node_clear"); func = RNA_def_function(srna, "clear", "rna_NodeTree_node_clear");
RNA_def_function_ui_description(func, "Remove all nodes from this node tree"); RNA_def_function_ui_description(func, "Remove all nodes from this node tree");
} }
@@ -3056,7 +3056,7 @@ static void rna_def_node_socket(BlenderRNA *brna)
prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
/* XXX must be editable for group sockets. if necessary use a special rna definition for these */ /* XXX must be editable for group sockets. if necessary use a special rna definition for these */
// RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* RNA_def_property_clear_flag(prop, PROP_EDITABLE); */
RNA_def_property_ui_text(prop, "Name", "Socket name"); RNA_def_property_ui_text(prop, "Name", "Socket name");
RNA_def_struct_name_property(srna, prop); RNA_def_struct_name_property(srna, prop);
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_NodeGroupSocket_update"); RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_NodeGroupSocket_update");
@@ -3075,8 +3075,8 @@ static void rna_def_node_socket(BlenderRNA *brna)
static void rna_def_node_socket_subtype(BlenderRNA *brna, int type, int subtype, const char *name, const char *ui_name) static void rna_def_node_socket_subtype(BlenderRNA *brna, int type, int subtype, const char *name, const char *ui_name)
{ {
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop=NULL; PropertyRNA *prop = NULL;
PropertySubType propsubtype= PROP_NONE; PropertySubType propsubtype = PROP_NONE;
#define SUBTYPE(socktype, stypename, id, idname) { PROP_##id, #socktype "_" #id, 0, #idname, ""}, #define SUBTYPE(socktype, stypename, id, idname) { PROP_##id, #socktype "_" #id, 0, #idname, ""},
static EnumPropertyItem subtype_items[] = { static EnumPropertyItem subtype_items[] = {
@@ -3252,28 +3252,28 @@ static void rna_def_group_sockets_api(BlenderRNA *brna, PropertyRNA *cprop, int
PropertyRNA *parm; PropertyRNA *parm;
FunctionRNA *func; FunctionRNA *func;
RNA_def_property_srna(cprop, (in_out==SOCK_IN ? "GroupInputs" : "GroupOutputs")); RNA_def_property_srna(cprop, (in_out == SOCK_IN ? "GroupInputs" : "GroupOutputs"));
srna= RNA_def_struct(brna, (in_out==SOCK_IN ? "GroupInputs" : "GroupOutputs"), NULL); srna = RNA_def_struct(brna, (in_out == SOCK_IN ? "GroupInputs" : "GroupOutputs"), NULL);
RNA_def_struct_sdna(srna, "bNodeTree"); RNA_def_struct_sdna(srna, "bNodeTree");
RNA_def_struct_ui_text(srna, "Group Sockets", "Collection of group sockets"); RNA_def_struct_ui_text(srna, "Group Sockets", "Collection of group sockets");
func= RNA_def_function(srna, "new", (in_out==SOCK_IN ? "rna_NodeTree_input_new" : "rna_NodeTree_output_new")); func = RNA_def_function(srna, "new", (in_out == SOCK_IN ? "rna_NodeTree_input_new" : "rna_NodeTree_output_new"));
RNA_def_function_ui_description(func, "Add a socket to the group tree"); RNA_def_function_ui_description(func, "Add a socket to the group tree");
RNA_def_function_flag(func, FUNC_USE_REPORTS); RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_string(func, "name", "Socket", MAX_NAME, "Name", "Name of the socket"); RNA_def_string(func, "name", "Socket", MAX_NAME, "Name", "Name of the socket");
RNA_def_enum(func, "type", node_socket_type_items, SOCK_FLOAT, "Type", "Type of socket"); RNA_def_enum(func, "type", node_socket_type_items, SOCK_FLOAT, "Type", "Type of socket");
/* return value */ /* return value */
parm= RNA_def_pointer(func, "socket", "NodeSocket", "", "New socket"); parm = RNA_def_pointer(func, "socket", "NodeSocket", "", "New socket");
RNA_def_function_return(func, parm); RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "expose", (in_out==SOCK_IN ? "rna_NodeTree_input_expose" : "rna_NodeTree_output_expose")); func = RNA_def_function(srna, "expose", (in_out == SOCK_IN ? "rna_NodeTree_input_expose" : "rna_NodeTree_output_expose"));
RNA_def_function_ui_description(func, "Expose an internal socket in the group tree"); RNA_def_function_ui_description(func, "Expose an internal socket in the group tree");
RNA_def_function_flag(func, FUNC_USE_REPORTS); RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_pointer(func, "sock", "NodeSocket", "Socket", "Internal node socket to expose"); RNA_def_pointer(func, "sock", "NodeSocket", "Socket", "Internal node socket to expose");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_boolean(func, "add_link", TRUE, "Add Link", "If TRUE, adds a link to the internal socket"); RNA_def_boolean(func, "add_link", TRUE, "Add Link", "If TRUE, adds a link to the internal socket");
/* return value */ /* return value */
parm= RNA_def_pointer(func, "socket", "NodeSocket", "", "New socket"); parm = RNA_def_pointer(func, "socket", "NodeSocket", "", "New socket");
RNA_def_function_return(func, parm); RNA_def_function_return(func, parm);
} }
@@ -3299,7 +3299,7 @@ static void rna_def_nodetree(BlenderRNA *brna)
rna_def_nodetree_link_api(brna, prop); rna_def_nodetree_link_api(brna, prop);
/* Grease Pencil */ /* Grease Pencil */
prop= RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "gpd"); RNA_def_property_pointer_sdna(prop, NULL, "gpd");
RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "GreasePencil"); RNA_def_property_struct_type(prop, "GreasePencil");
@@ -3386,7 +3386,7 @@ static void define_specific_node(BlenderRNA *brna, int id, void (*func)(StructRN
{ {
StructRNA *srna = def_node(brna, id); StructRNA *srna = def_node(brna, id);
if(func) if (func)
func(srna); func(srna);
} }

File diff suppressed because it is too large Load Diff

View File

@@ -39,9 +39,9 @@
#include "DNA_object_types.h" #include "DNA_object_types.h"
#include "DNA_modifier_types.h" #include "DNA_modifier_types.h"
// #include "BLO_sys_types.h" /* needed for intptr_t used in ED_mesh.h */ /* #include "BLO_sys_types.h" *//* needed for intptr_t used in ED_mesh.h */
// #include "ED_mesh.h" /* #include "ED_mesh.h" */
#ifdef RNA_RUNTIME #ifdef RNA_RUNTIME
@@ -92,12 +92,12 @@ Mesh *rna_Object_to_mesh(Object *ob, ReportList *reports, Scene *sce, int apply_
case OB_SURF: case OB_SURF:
/* copies object and modifiers (but not the data) */ /* copies object and modifiers (but not the data) */
tmpobj= copy_object(ob); tmpobj = copy_object(ob);
tmpcu = (Curve *)tmpobj->data; tmpcu = (Curve *)tmpobj->data;
tmpcu->id.us--; tmpcu->id.us--;
/* if getting the original caged mesh, delete object modifiers */ /* if getting the original caged mesh, delete object modifiers */
if( cage ) if ( cage )
object_free_modifiers(tmpobj); object_free_modifiers(tmpobj);
/* copies the data */ /* copies the data */
@@ -133,12 +133,12 @@ Mesh *rna_Object_to_mesh(Object *ob, ReportList *reports, Scene *sce, int apply_
/* todo, re-generatre for render-res */ /* todo, re-generatre for render-res */
/* metaball_polygonize(scene, ob) */ /* metaball_polygonize(scene, ob) */
if(ob != basis_ob) if (ob != basis_ob)
return NULL; /* only do basis metaball */ return NULL; /* only do basis metaball */
tmpmesh = add_mesh("Mesh"); tmpmesh = add_mesh("Mesh");
if(render) { if (render) {
ListBase disp = {NULL, NULL}; ListBase disp = {NULL, NULL};
makeDispListMBall_forRender(sce, ob, &disp); makeDispListMBall_forRender(sce, ob, &disp);
mball_to_mesh(&disp, tmpmesh); mball_to_mesh(&disp, tmpmesh);
@@ -187,8 +187,8 @@ Mesh *rna_Object_to_mesh(Object *ob, ReportList *reports, Scene *sce, int apply_
tmpmesh->totcol = tmpcu->totcol; tmpmesh->totcol = tmpcu->totcol;
/* free old material list (if it exists) and adjust user counts */ /* free old material list (if it exists) and adjust user counts */
if( tmpcu->mat ) { if ( tmpcu->mat ) {
for( i = tmpcu->totcol; i-- > 0; ) { for ( i = tmpcu->totcol; i-- > 0; ) {
/* are we an object material or data based? */ /* are we an object material or data based? */
tmpmesh->mat[i] = ob->matbits[i] ? ob->mat[i] : tmpcu->mat[i]; tmpmesh->mat[i] = ob->matbits[i] ? ob->mat[i] : tmpcu->mat[i];
@@ -207,8 +207,8 @@ Mesh *rna_Object_to_mesh(Object *ob, ReportList *reports, Scene *sce, int apply_
tmpmesh->totcol = tmpmb->totcol; tmpmesh->totcol = tmpmb->totcol;
/* free old material list (if it exists) and adjust user counts */ /* free old material list (if it exists) and adjust user counts */
if( tmpmb->mat ) { if ( tmpmb->mat ) {
for( i = tmpmb->totcol; i-- > 0; ) { for ( i = tmpmb->totcol; i-- > 0; ) {
tmpmesh->mat[i] = tmpmb->mat[i]; /* CRASH HERE ??? */ tmpmesh->mat[i] = tmpmb->mat[i]; /* CRASH HERE ??? */
if (tmpmesh->mat[i]) { if (tmpmesh->mat[i]) {
tmpmb->mat[i]->id.us++; tmpmb->mat[i]->id.us++;
@@ -220,13 +220,13 @@ Mesh *rna_Object_to_mesh(Object *ob, ReportList *reports, Scene *sce, int apply_
case OB_MESH: case OB_MESH:
if (!cage) { if (!cage) {
Mesh *origmesh= ob->data; Mesh *origmesh = ob->data;
tmpmesh->flag= origmesh->flag; tmpmesh->flag = origmesh->flag;
tmpmesh->mat = MEM_dupallocN(origmesh->mat); tmpmesh->mat = MEM_dupallocN(origmesh->mat);
tmpmesh->totcol = origmesh->totcol; tmpmesh->totcol = origmesh->totcol;
tmpmesh->smoothresh= origmesh->smoothresh; tmpmesh->smoothresh = origmesh->smoothresh;
if( origmesh->mat ) { if ( origmesh->mat ) {
for( i = origmesh->totcol; i-- > 0; ) { for ( i = origmesh->totcol; i-- > 0; ) {
/* are we an object material or data based? */ /* are we an object material or data based? */
tmpmesh->mat[i] = ob->matbits[i] ? ob->mat[i] : origmesh->mat[i]; tmpmesh->mat[i] = ob->matbits[i] ? ob->mat[i] : origmesh->mat[i];
@@ -264,35 +264,35 @@ static void dupli_render_particle_set(Scene *scene, Object *ob, int level, int e
unit_m4(mat); unit_m4(mat);
if(level >= MAX_DUPLI_RECUR) if (level >= MAX_DUPLI_RECUR)
return; return;
if(ob->transflag & OB_DUPLIPARTS) { if (ob->transflag & OB_DUPLIPARTS) {
for(psys=ob->particlesystem.first; psys; psys=psys->next) { for (psys = ob->particlesystem.first; psys; psys = psys->next) {
if(ELEM(psys->part->ren_as, PART_DRAW_OB, PART_DRAW_GR)) { if (ELEM(psys->part->ren_as, PART_DRAW_OB, PART_DRAW_GR)) {
if(enable) if (enable)
psys_render_set(ob, psys, mat, mat, 1, 1, 0.f); psys_render_set(ob, psys, mat, mat, 1, 1, 0.f);
else else
psys_render_restore(ob, psys); psys_render_restore(ob, psys);
} }
} }
if(level == 0 && enable) { if (level == 0 && enable) {
/* this is to make sure we get render level duplis in groups: /* this is to make sure we get render level duplis in groups:
* the derivedmesh must be created before init_render_mesh, * the derivedmesh must be created before init_render_mesh,
* since object_duplilist does dupliparticles before that */ * since object_duplilist does dupliparticles before that */
dm = mesh_create_derived_render(scene, ob, CD_MASK_BAREMESH|CD_MASK_MTFACE|CD_MASK_MCOL); dm = mesh_create_derived_render(scene, ob, CD_MASK_BAREMESH|CD_MASK_MTFACE|CD_MASK_MCOL);
dm->release(dm); dm->release(dm);
for(psys=ob->particlesystem.first; psys; psys=psys->next) for (psys = ob->particlesystem.first; psys; psys = psys->next)
psys_get_modifier(ob, psys)->flag &= ~eParticleSystemFlag_psys_updated; psys_get_modifier(ob, psys)->flag &= ~eParticleSystemFlag_psys_updated;
} }
} }
if(ob->dup_group==NULL) return; if (ob->dup_group == NULL) return;
group= ob->dup_group; group = ob->dup_group;
for(go= group->gobject.first; go; go= go->next) for (go = group->gobject.first; go; go = go->next)
dupli_render_particle_set(scene, go->ob, level+1, enable); dupli_render_particle_set(scene, go->ob, level+1, enable);
} }
/* When no longer needed, duplilist should be freed with Object.free_duplilist */ /* When no longer needed, duplilist should be freed with Object.free_duplilist */
@@ -308,12 +308,12 @@ void rna_Object_create_duplilist(Object *ob, ReportList *reports, Scene *sce)
BKE_reportf(reports, RPT_WARNING, "Object.dupli_list has not been freed"); BKE_reportf(reports, RPT_WARNING, "Object.dupli_list has not been freed");
free_object_duplilist(ob->duplilist); free_object_duplilist(ob->duplilist);
ob->duplilist= NULL; ob->duplilist = NULL;
} }
if(G.rendering) if (G.rendering)
dupli_render_particle_set(sce, ob, 0, 1); dupli_render_particle_set(sce, ob, 0, 1);
ob->duplilist= object_duplilist(sce, ob); ob->duplilist = object_duplilist(sce, ob);
if(G.rendering) if (G.rendering)
dupli_render_particle_set(sce, ob, 0, 0); dupli_render_particle_set(sce, ob, 0, 0);
/* ob->duplilist should now be freed with Object.free_duplilist */ /* ob->duplilist should now be freed with Object.free_duplilist */
} }
@@ -322,16 +322,16 @@ void rna_Object_free_duplilist(Object *ob)
{ {
if (ob->duplilist) { if (ob->duplilist) {
free_object_duplilist(ob->duplilist); free_object_duplilist(ob->duplilist);
ob->duplilist= NULL; ob->duplilist = NULL;
} }
} }
static PointerRNA rna_Object_shape_key_add(Object *ob, bContext *C, ReportList *reports, const char *name, int from_mix) static PointerRNA rna_Object_shape_key_add(Object *ob, bContext *C, ReportList *reports, const char *name, int from_mix)
{ {
Scene *scene= CTX_data_scene(C); Scene *scene = CTX_data_scene(C);
KeyBlock *kb= NULL; KeyBlock *kb = NULL;
if((kb=object_insert_shape_key(scene, ob, name, from_mix))) { if ((kb = object_insert_shape_key(scene, ob, name, from_mix))) {
PointerRNA keyptr; PointerRNA keyptr;
RNA_pointer_create((ID *)ob->data, &RNA_ShapeKey, kb, &keyptr); RNA_pointer_create((ID *)ob->data, &RNA_ShapeKey, kb, &keyptr);
@@ -350,7 +350,7 @@ int rna_Object_is_visible(Object *ob, Scene *sce)
return !(ob->restrictflag & OB_RESTRICT_VIEW) && (ob->lay & sce->lay); return !(ob->restrictflag & OB_RESTRICT_VIEW) && (ob->lay & sce->lay);
} }
/* #if 0
static void rna_Mesh_assign_verts_to_group(Object *ob, bDeformGroup *group, int *indices, int totindex, float weight, int assignmode) static void rna_Mesh_assign_verts_to_group(Object *ob, bDeformGroup *group, int *indices, int totindex, float weight, int assignmode)
{ {
if (ob->type != OB_MESH) { if (ob->type != OB_MESH) {
@@ -370,13 +370,13 @@ static void rna_Mesh_assign_verts_to_group(Object *ob, bDeformGroup *group, int
return; return;
} }
// makes a set of dVerts corresponding to the mVerts /* makes a set of dVerts corresponding to the mVerts */
if (!me->dvert) if (!me->dvert)
create_dverts(&me->id); create_dverts(&me->id);
// loop list adding verts to group /* loop list adding verts to group */
for (i= 0; i < totindex; i++) { for (i = 0; i < totindex; i++) {
if(i < 0 || i >= me->totvert) { if (i < 0 || i >= me->totvert) {
BKE_report(reports, RPT_ERROR, "Bad vertex index in list"); BKE_report(reports, RPT_ERROR, "Bad vertex index in list");
return; return;
} }
@@ -384,13 +384,13 @@ static void rna_Mesh_assign_verts_to_group(Object *ob, bDeformGroup *group, int
add_vert_defnr(ob, group_index, i, weight, assignmode); add_vert_defnr(ob, group_index, i, weight, assignmode);
} }
} }
*/ #endif
void rna_Object_ray_cast(Object *ob, ReportList *reports, float ray_start[3], float ray_end[3], float r_location[3], float r_normal[3], int *index) void rna_Object_ray_cast(Object *ob, ReportList *reports, float ray_start[3], float ray_end[3], float r_location[3], float r_normal[3], int *index)
{ {
BVHTreeFromMesh treeData= {NULL}; BVHTreeFromMesh treeData = {NULL};
if(ob->derivedFinal==NULL) { if (ob->derivedFinal == NULL) {
BKE_reportf(reports, RPT_ERROR, "object \"%s\" has no mesh data to be used for ray casting", ob->id.name+2); BKE_reportf(reports, RPT_ERROR, "object \"%s\" has no mesh data to be used for ray casting", ob->id.name+2);
return; return;
} }
@@ -398,7 +398,7 @@ void rna_Object_ray_cast(Object *ob, ReportList *reports, float ray_start[3], fl
/* no need to managing allocation or freeing of the BVH data. this is generated and freed as needed */ /* no need to managing allocation or freeing of the BVH data. this is generated and freed as needed */
bvhtree_from_mesh_faces(&treeData, ob->derivedFinal, 0.0f, 4, 6); bvhtree_from_mesh_faces(&treeData, ob->derivedFinal, 0.0f, 4, 6);
if(treeData.tree==NULL) { if (treeData.tree == NULL) {
BKE_reportf(reports, RPT_ERROR, "object \"%s\" could not create internal data for ray casting", ob->id.name+2); BKE_reportf(reports, RPT_ERROR, "object \"%s\" could not create internal data for ray casting", ob->id.name+2);
return; return;
} }
@@ -407,14 +407,14 @@ void rna_Object_ray_cast(Object *ob, ReportList *reports, float ray_start[3], fl
float ray_nor[3], dist; float ray_nor[3], dist;
sub_v3_v3v3(ray_nor, ray_end, ray_start); sub_v3_v3v3(ray_nor, ray_end, ray_start);
dist= hit.dist = normalize_v3(ray_nor); dist = hit.dist = normalize_v3(ray_nor);
hit.index = -1; hit.index = -1;
if(BLI_bvhtree_ray_cast(treeData.tree, ray_start, ray_nor, 0.0f, &hit, treeData.raycast_callback, &treeData) != -1) { if (BLI_bvhtree_ray_cast(treeData.tree, ray_start, ray_nor, 0.0f, &hit, treeData.raycast_callback, &treeData) != -1) {
if(hit.dist<=dist) { if (hit.dist <= dist) {
copy_v3_v3(r_location, hit.co); copy_v3_v3(r_location, hit.co);
copy_v3_v3(r_normal, hit.no); copy_v3_v3(r_normal, hit.no);
*index= hit.index; *index = hit.index;
return; return;
} }
} }
@@ -422,14 +422,14 @@ void rna_Object_ray_cast(Object *ob, ReportList *reports, float ray_start[3], fl
zero_v3(r_location); zero_v3(r_location);
zero_v3(r_normal); zero_v3(r_normal);
*index= -1; *index = -1;
} }
void rna_Object_closest_point_on_mesh(Object *ob, ReportList *reports, float point_co[3], float max_dist, float n_location[3], float n_normal[3], int *index) void rna_Object_closest_point_on_mesh(Object *ob, ReportList *reports, float point_co[3], float max_dist, float n_location[3], float n_normal[3], int *index)
{ {
BVHTreeFromMesh treeData= {NULL}; BVHTreeFromMesh treeData = {NULL};
if(ob->derivedFinal==NULL) { if (ob->derivedFinal == NULL) {
BKE_reportf(reports, RPT_ERROR, "object \"%s\" has no mesh data to be used for finding nearest point", ob->id.name+2); BKE_reportf(reports, RPT_ERROR, "object \"%s\" has no mesh data to be used for finding nearest point", ob->id.name+2);
return; return;
} }
@@ -437,7 +437,7 @@ void rna_Object_closest_point_on_mesh(Object *ob, ReportList *reports, float poi
/* no need to managing allocation or freeing of the BVH data. this is generated and freed as needed */ /* no need to managing allocation or freeing of the BVH data. this is generated and freed as needed */
bvhtree_from_mesh_faces(&treeData, ob->derivedFinal, 0.0f, 4, 6); bvhtree_from_mesh_faces(&treeData, ob->derivedFinal, 0.0f, 4, 6);
if(treeData.tree==NULL) { if (treeData.tree == NULL) {
BKE_reportf(reports, RPT_ERROR, "object \"%s\" could not create internal data for finding nearest point", ob->id.name+2); BKE_reportf(reports, RPT_ERROR, "object \"%s\" could not create internal data for finding nearest point", ob->id.name+2);
return; return;
} }
@@ -447,24 +447,24 @@ void rna_Object_closest_point_on_mesh(Object *ob, ReportList *reports, float poi
nearest.index = -1; nearest.index = -1;
nearest.dist = max_dist * max_dist; nearest.dist = max_dist * max_dist;
if(BLI_bvhtree_find_nearest(treeData.tree, point_co, &nearest, treeData.nearest_callback, &treeData) != -1) { if (BLI_bvhtree_find_nearest(treeData.tree, point_co, &nearest, treeData.nearest_callback, &treeData) != -1) {
copy_v3_v3(n_location, nearest.co); copy_v3_v3(n_location, nearest.co);
copy_v3_v3(n_normal, nearest.no); copy_v3_v3(n_normal, nearest.no);
*index= nearest.index; *index = nearest.index;
return; return;
} }
} }
zero_v3(n_location); zero_v3(n_location);
zero_v3(n_normal); zero_v3(n_normal);
*index= -1; *index = -1;
} }
/* ObjectBase */ /* ObjectBase */
void rna_ObjectBase_layers_from_view(Base *base, View3D *v3d) void rna_ObjectBase_layers_from_view(Base *base, View3D *v3d)
{ {
base->lay= base->object->lay= v3d->lay; base->lay = base->object->lay = v3d->lay;
} }
int rna_Object_is_modified(Object *ob, Scene *scene, int settings) int rna_Object_is_modified(Object *ob, Scene *scene, int settings)
@@ -481,7 +481,7 @@ void rna_Object_dm_info(struct Object *ob, int type, char *result)
result[0] = '\0'; result[0] = '\0';
switch(type) { switch (type) {
case 0: case 0:
if (ob->type == OB_MESH) { if (ob->type == OB_MESH) {
dm = CDDM_from_mesh(ob->data, ob); dm = CDDM_from_mesh(ob->data, ob);
@@ -533,118 +533,118 @@ void RNA_api_object(StructRNA *srna)
#endif #endif
/* mesh */ /* mesh */
func= RNA_def_function(srna, "to_mesh", "rna_Object_to_mesh"); func = RNA_def_function(srna, "to_mesh", "rna_Object_to_mesh");
RNA_def_function_ui_description(func, "Create a Mesh datablock with modifiers applied"); RNA_def_function_ui_description(func, "Create a Mesh datablock with modifiers applied");
RNA_def_function_flag(func, FUNC_USE_REPORTS); RNA_def_function_flag(func, FUNC_USE_REPORTS);
parm= RNA_def_pointer(func, "scene", "Scene", "", "Scene within which to evaluate modifiers"); parm = RNA_def_pointer(func, "scene", "Scene", "", "Scene within which to evaluate modifiers");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
parm= RNA_def_boolean(func, "apply_modifiers", 0, "", "Apply modifiers"); parm = RNA_def_boolean(func, "apply_modifiers", 0, "", "Apply modifiers");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
parm= RNA_def_enum(func, "settings", mesh_type_items, 0, "", "Modifier settings to apply"); parm = RNA_def_enum(func, "settings", mesh_type_items, 0, "", "Modifier settings to apply");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
parm= RNA_def_pointer(func, "mesh", "Mesh", "", "Mesh created from object, remove it if it is only used for export"); parm = RNA_def_pointer(func, "mesh", "Mesh", "", "Mesh created from object, remove it if it is only used for export");
RNA_def_function_return(func, parm); RNA_def_function_return(func, parm);
/* duplis */ /* duplis */
func= RNA_def_function(srna, "dupli_list_create", "rna_Object_create_duplilist"); func = RNA_def_function(srna, "dupli_list_create", "rna_Object_create_duplilist");
RNA_def_function_ui_description(func, "Create a list of dupli objects for this object, needs to " RNA_def_function_ui_description(func, "Create a list of dupli objects for this object, needs to "
"be freed manually with free_dupli_list to restore the " "be freed manually with free_dupli_list to restore the "
"objects real matrix and layers"); "objects real matrix and layers");
parm= RNA_def_pointer(func, "scene", "Scene", "", "Scene within which to evaluate duplis"); parm = RNA_def_pointer(func, "scene", "Scene", "", "Scene within which to evaluate duplis");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
RNA_def_function_flag(func, FUNC_USE_REPORTS); RNA_def_function_flag(func, FUNC_USE_REPORTS);
func= RNA_def_function(srna, "dupli_list_clear", "rna_Object_free_duplilist"); func = RNA_def_function(srna, "dupli_list_clear", "rna_Object_free_duplilist");
RNA_def_function_ui_description(func, "Free the list of dupli objects"); RNA_def_function_ui_description(func, "Free the list of dupli objects");
/* Armature */ /* Armature */
func= RNA_def_function(srna, "find_armature", "modifiers_isDeformedByArmature"); func = RNA_def_function(srna, "find_armature", "modifiers_isDeformedByArmature");
RNA_def_function_ui_description(func, "Find armature influencing this object as a parent or via a modifier"); RNA_def_function_ui_description(func, "Find armature influencing this object as a parent or via a modifier");
parm= RNA_def_pointer(func, "ob_arm", "Object", "", "Armature object influencing this object or NULL"); parm = RNA_def_pointer(func, "ob_arm", "Object", "", "Armature object influencing this object or NULL");
RNA_def_function_return(func, parm); RNA_def_function_return(func, parm);
/* Shape key */ /* Shape key */
func= RNA_def_function(srna, "shape_key_add", "rna_Object_shape_key_add"); func = RNA_def_function(srna, "shape_key_add", "rna_Object_shape_key_add");
RNA_def_function_ui_description(func, "Add shape key to an object"); RNA_def_function_ui_description(func, "Add shape key to an object");
RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS); RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
RNA_def_string(func, "name", "Key", 0, "", "Unique name for the new keylock"); /* optional */ RNA_def_string(func, "name", "Key", 0, "", "Unique name for the new keylock"); /* optional */
RNA_def_boolean(func, "from_mix", 1, "", "Create new shape from existing mix of shapes"); RNA_def_boolean(func, "from_mix", 1, "", "Create new shape from existing mix of shapes");
parm= RNA_def_pointer(func, "key", "ShapeKey", "", "New shape keyblock"); parm = RNA_def_pointer(func, "key", "ShapeKey", "", "New shape keyblock");
RNA_def_property_flag(parm, PROP_RNAPTR); RNA_def_property_flag(parm, PROP_RNAPTR);
RNA_def_function_return(func, parm); RNA_def_function_return(func, parm);
/* Ray Cast */ /* Ray Cast */
func= RNA_def_function(srna, "ray_cast", "rna_Object_ray_cast"); func = RNA_def_function(srna, "ray_cast", "rna_Object_ray_cast");
RNA_def_function_ui_description(func, "Cast a ray onto in object space"); RNA_def_function_ui_description(func, "Cast a ray onto in object space");
RNA_def_function_flag(func, FUNC_USE_REPORTS); RNA_def_function_flag(func, FUNC_USE_REPORTS);
/* ray start and end */ /* ray start and end */
parm= RNA_def_float_vector(func, "start", 3, NULL, -FLT_MAX, FLT_MAX, "", "", -1e4, 1e4); parm = RNA_def_float_vector(func, "start", 3, NULL, -FLT_MAX, FLT_MAX, "", "", -1e4, 1e4);
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
parm= RNA_def_float_vector(func, "end", 3, NULL, -FLT_MAX, FLT_MAX, "", "", -1e4, 1e4); parm = RNA_def_float_vector(func, "end", 3, NULL, -FLT_MAX, FLT_MAX, "", "", -1e4, 1e4);
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
/* return location and normal */ /* return location and normal */
parm= RNA_def_float_vector(func, "location", 3, NULL, -FLT_MAX, FLT_MAX, "Location", "The hit location of this ray cast", -1e4, 1e4); parm = RNA_def_float_vector(func, "location", 3, NULL, -FLT_MAX, FLT_MAX, "Location", "The hit location of this ray cast", -1e4, 1e4);
RNA_def_property_flag(parm, PROP_THICK_WRAP); RNA_def_property_flag(parm, PROP_THICK_WRAP);
RNA_def_function_output(func, parm); RNA_def_function_output(func, parm);
parm= RNA_def_float_vector(func, "normal", 3, NULL, -FLT_MAX, FLT_MAX, "Normal", "The face normal at the ray cast hit location", -1e4, 1e4); parm = RNA_def_float_vector(func, "normal", 3, NULL, -FLT_MAX, FLT_MAX, "Normal", "The face normal at the ray cast hit location", -1e4, 1e4);
RNA_def_property_flag(parm, PROP_THICK_WRAP); RNA_def_property_flag(parm, PROP_THICK_WRAP);
RNA_def_function_output(func, parm); RNA_def_function_output(func, parm);
parm= RNA_def_int(func, "index", 0, 0, 0, "", "The face index, -1 when no intersection is found", 0, 0); parm = RNA_def_int(func, "index", 0, 0, 0, "", "The face index, -1 when no intersection is found", 0, 0);
RNA_def_function_output(func, parm); RNA_def_function_output(func, parm);
/* Nearest Point */ /* Nearest Point */
func= RNA_def_function(srna, "closest_point_on_mesh", "rna_Object_closest_point_on_mesh"); func = RNA_def_function(srna, "closest_point_on_mesh", "rna_Object_closest_point_on_mesh");
RNA_def_function_ui_description(func, "Find the nearest point on the object"); RNA_def_function_ui_description(func, "Find the nearest point on the object");
RNA_def_function_flag(func, FUNC_USE_REPORTS); RNA_def_function_flag(func, FUNC_USE_REPORTS);
/* location of point for test and max distance */ /* location of point for test and max distance */
parm= RNA_def_float_vector(func, "point", 3, NULL, -FLT_MAX, FLT_MAX, "", "", -1e4, 1e4); parm = RNA_def_float_vector(func, "point", 3, NULL, -FLT_MAX, FLT_MAX, "", "", -1e4, 1e4);
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
/* default is sqrt(FLT_MAX) */ /* default is sqrt(FLT_MAX) */
RNA_def_float(func, "max_dist", 1.844674352395373e+19, 0.0, FLT_MAX, "", "", 0.0, FLT_MAX); RNA_def_float(func, "max_dist", 1.844674352395373e+19, 0.0, FLT_MAX, "", "", 0.0, FLT_MAX);
/* return location and normal */ /* return location and normal */
parm= RNA_def_float_vector(func, "location", 3, NULL, -FLT_MAX, FLT_MAX, "Location", "The location on the object closest to the point", -1e4, 1e4); parm = RNA_def_float_vector(func, "location", 3, NULL, -FLT_MAX, FLT_MAX, "Location", "The location on the object closest to the point", -1e4, 1e4);
RNA_def_property_flag(parm, PROP_THICK_WRAP); RNA_def_property_flag(parm, PROP_THICK_WRAP);
RNA_def_function_output(func, parm); RNA_def_function_output(func, parm);
parm= RNA_def_float_vector(func, "normal", 3, NULL, -FLT_MAX, FLT_MAX, "Normal", "The face normal at the closest point", -1e4, 1e4); parm = RNA_def_float_vector(func, "normal", 3, NULL, -FLT_MAX, FLT_MAX, "Normal", "The face normal at the closest point", -1e4, 1e4);
RNA_def_property_flag(parm, PROP_THICK_WRAP); RNA_def_property_flag(parm, PROP_THICK_WRAP);
RNA_def_function_output(func, parm); RNA_def_function_output(func, parm);
parm= RNA_def_int(func, "index", 0, 0, 0, "", "The face index, -1 when no closest point is found", 0, 0); parm = RNA_def_int(func, "index", 0, 0, 0, "", "The face index, -1 when no closest point is found", 0, 0);
RNA_def_function_output(func, parm); RNA_def_function_output(func, parm);
/* View */ /* View */
func= RNA_def_function(srna, "is_visible", "rna_Object_is_visible"); func = RNA_def_function(srna, "is_visible", "rna_Object_is_visible");
RNA_def_function_ui_description(func, "Determine if object is visible in a given scene"); RNA_def_function_ui_description(func, "Determine if object is visible in a given scene");
parm= RNA_def_pointer(func, "scene", "Scene", "", ""); parm = RNA_def_pointer(func, "scene", "Scene", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
parm= RNA_def_boolean(func, "result", 0, "", "Object visibility"); parm = RNA_def_boolean(func, "result", 0, "", "Object visibility");
RNA_def_function_return(func, parm); RNA_def_function_return(func, parm);
/* utility function for checking if the object is modified */ /* utility function for checking if the object is modified */
func= RNA_def_function(srna, "is_modified", "rna_Object_is_modified"); func = RNA_def_function(srna, "is_modified", "rna_Object_is_modified");
RNA_def_function_ui_description(func, "Determine if this object is modified from the base mesh data"); RNA_def_function_ui_description(func, "Determine if this object is modified from the base mesh data");
parm= RNA_def_pointer(func, "scene", "Scene", "", ""); parm = RNA_def_pointer(func, "scene", "Scene", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
parm= RNA_def_enum(func, "settings", mesh_type_items, 0, "", "Modifier settings to apply"); parm = RNA_def_enum(func, "settings", mesh_type_items, 0, "", "Modifier settings to apply");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
parm= RNA_def_boolean(func, "result", 0, "", "Object visibility"); parm = RNA_def_boolean(func, "result", 0, "", "Object visibility");
RNA_def_function_return(func, parm); RNA_def_function_return(func, parm);
#ifndef NDEBUG #ifndef NDEBUG
/* mesh */ /* mesh */
func= RNA_def_function(srna, "dm_info", "rna_Object_dm_info"); func = RNA_def_function(srna, "dm_info", "rna_Object_dm_info");
RNA_def_function_ui_description(func, "Returns a string for derived mesh data"); RNA_def_function_ui_description(func, "Returns a string for derived mesh data");
parm= RNA_def_enum(func, "type", mesh_dm_info_items, 0, "", "Modifier settings to apply"); parm = RNA_def_enum(func, "type", mesh_dm_info_items, 0, "", "Modifier settings to apply");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
/* weak!, no way to return dynamic string type */ /* weak!, no way to return dynamic string type */
parm= RNA_def_string(func, "result", "", 16384, "result", ""); parm = RNA_def_string(func, "result", "", 16384, "result", "");
RNA_def_property_flag(parm, PROP_THICK_WRAP); /* needed for string return value */ RNA_def_property_flag(parm, PROP_THICK_WRAP); /* needed for string return value */
RNA_def_function_output(func, parm); RNA_def_function_output(func, parm);
#endif /* NDEBUG */ #endif /* NDEBUG */
@@ -656,9 +656,9 @@ void RNA_api_object_base(StructRNA *srna)
FunctionRNA *func; FunctionRNA *func;
PropertyRNA *parm; PropertyRNA *parm;
func= RNA_def_function(srna, "layers_from_view", "rna_ObjectBase_layers_from_view"); func = RNA_def_function(srna, "layers_from_view", "rna_ObjectBase_layers_from_view");
RNA_def_function_ui_description(func, "Sets the object layers from a 3D View (use when adding an object in local view)"); RNA_def_function_ui_description(func, "Sets the object layers from a 3D View (use when adding an object in local view)");
parm= RNA_def_pointer(func, "view", "SpaceView3D", "", ""); parm = RNA_def_pointer(func, "view", "SpaceView3D", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
} }

File diff suppressed because it is too large Load Diff

View File

@@ -48,10 +48,10 @@ void RNA_def_packedfile(BlenderRNA *brna)
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
srna= RNA_def_struct(brna, "PackedFile", NULL); srna = RNA_def_struct(brna, "PackedFile", NULL);
RNA_def_struct_ui_text(srna, "Packed File", "External file packed into the .blend file"); RNA_def_struct_ui_text(srna, "Packed File", "External file packed into the .blend file");
prop= RNA_def_property(srna, "size", PROP_INT, PROP_NONE); prop = RNA_def_property(srna, "size", PROP_INT, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Size", "Size of packed file in bytes"); RNA_def_property_ui_text(prop, "Size", "Size of packed file in bytes");

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -68,13 +68,13 @@ void RNA_api_pose_channel(StructRNA *srna)
PropertyRNA *parm; PropertyRNA *parm;
FunctionRNA *func; FunctionRNA *func;
func= RNA_def_function(srna, "evaluate_envelope", "rna_PoseBone_do_envelope"); func = RNA_def_function(srna, "evaluate_envelope", "rna_PoseBone_do_envelope");
RNA_def_function_ui_description(func, "Calculate bone envelope at given point"); RNA_def_function_ui_description(func, "Calculate bone envelope at given point");
parm= RNA_def_float_vector_xyz(func, "point", 3, NULL, -FLT_MAX, FLT_MAX, "Point", parm = RNA_def_float_vector_xyz(func, "point", 3, NULL, -FLT_MAX, FLT_MAX, "Point",
"Position in 3d space to evaluate", -FLT_MAX, FLT_MAX); "Position in 3d space to evaluate", -FLT_MAX, FLT_MAX);
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
/* return value */ /* return value */
parm= RNA_def_float(func, "factor", 0, -FLT_MAX, FLT_MAX, "Factor", "Envelope factor", -FLT_MAX, FLT_MAX); parm = RNA_def_float(func, "factor", 0, -FLT_MAX, FLT_MAX, "Factor", "Envelope factor", -FLT_MAX, FLT_MAX);
RNA_def_function_return(func, parm); RNA_def_function_return(func, parm);
} }

View File

@@ -35,7 +35,7 @@
#include "WM_types.h" #include "WM_types.h"
EnumPropertyItem gameproperty_type_items[] ={ EnumPropertyItem gameproperty_type_items[] = {
{GPROP_BOOL, "BOOL", 0, "Boolean", "Boolean Property"}, {GPROP_BOOL, "BOOL", 0, "Boolean", "Boolean Property"},
{GPROP_INT, "INT", 0, "Integer", "Integer Property"}, {GPROP_INT, "INT", 0, "Integer", "Integer Property"},
{GPROP_FLOAT, "FLOAT", 0, "Float", "Floating-Point Property"}, {GPROP_FLOAT, "FLOAT", 0, "Float", "Floating-Point Property"},
@@ -50,9 +50,9 @@ EnumPropertyItem gameproperty_type_items[] ={
static StructRNA* rna_GameProperty_refine(struct PointerRNA *ptr) static StructRNA* rna_GameProperty_refine(struct PointerRNA *ptr)
{ {
bProperty *property= (bProperty*)ptr->data; bProperty *property = (bProperty*)ptr->data;
switch(property->type){ switch (property->type){
case GPROP_BOOL: case GPROP_BOOL:
return &RNA_GameBooleanProperty; return &RNA_GameBooleanProperty;
case GPROP_INT: case GPROP_INT:
@@ -71,30 +71,30 @@ static StructRNA* rna_GameProperty_refine(struct PointerRNA *ptr)
/* for both float and timer */ /* for both float and timer */
static float rna_GameFloatProperty_value_get(PointerRNA *ptr) static float rna_GameFloatProperty_value_get(PointerRNA *ptr)
{ {
bProperty *prop= (bProperty*)(ptr->data); bProperty *prop = (bProperty*)(ptr->data);
return *(float*)(&prop->data); return *(float*)(&prop->data);
} }
static void rna_GameFloatProperty_value_set(PointerRNA *ptr, float value) static void rna_GameFloatProperty_value_set(PointerRNA *ptr, float value)
{ {
bProperty *prop= (bProperty*)(ptr->data); bProperty *prop = (bProperty*)(ptr->data);
CLAMP(value, -10000.0f, 10000.0f); CLAMP(value, -10000.0f, 10000.0f);
*(float*)(&prop->data)= value; *(float*)(&prop->data) = value;
} }
static void rna_GameProperty_type_set(PointerRNA *ptr, int value) static void rna_GameProperty_type_set(PointerRNA *ptr, int value)
{ {
bProperty *prop= (bProperty*)(ptr->data); bProperty *prop = (bProperty*)(ptr->data);
if(prop->type != value) { if (prop->type != value) {
prop->type= value; prop->type = value;
init_property(prop); init_property(prop);
} }
} }
static void rna_GameProperty_name_set(PointerRNA *ptr, const char *value) static void rna_GameProperty_name_set(PointerRNA *ptr, const char *value)
{ {
bProperty *prop= (bProperty*)(ptr->data); bProperty *prop = (bProperty*)(ptr->data);
BLI_strncpy_utf8(prop->name, value, sizeof(prop->name)); BLI_strncpy_utf8(prop->name, value, sizeof(prop->name));
unique_property(NULL, prop, 1); unique_property(NULL, prop, 1);
} }
@@ -108,80 +108,80 @@ void RNA_def_gameproperty(BlenderRNA *brna)
PropertyRNA *prop; PropertyRNA *prop;
/* Base Struct for GameProperty */ /* Base Struct for GameProperty */
srna= RNA_def_struct(brna, "GameProperty", NULL); srna = RNA_def_struct(brna, "GameProperty", NULL);
RNA_def_struct_ui_text(srna , "Game Property", "Game engine user defined object property"); RNA_def_struct_ui_text(srna , "Game Property", "Game engine user defined object property");
RNA_def_struct_sdna(srna, "bProperty"); RNA_def_struct_sdna(srna, "bProperty");
RNA_def_struct_refine_func(srna, "rna_GameProperty_refine"); RNA_def_struct_refine_func(srna, "rna_GameProperty_refine");
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Name", "Available as GameObject attributes in the game engine's python API"); RNA_def_property_ui_text(prop, "Name", "Available as GameObject attributes in the game engine's python API");
RNA_def_struct_name_property(srna, prop); RNA_def_struct_name_property(srna, prop);
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_GameProperty_name_set"); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_GameProperty_name_set");
RNA_def_property_update(prop, NC_LOGIC, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, gameproperty_type_items); RNA_def_property_enum_items(prop, gameproperty_type_items);
RNA_def_property_ui_text(prop, "Type", ""); RNA_def_property_ui_text(prop, "Type", "");
RNA_def_property_enum_funcs(prop, NULL, "rna_GameProperty_type_set", NULL); RNA_def_property_enum_funcs(prop, NULL, "rna_GameProperty_type_set", NULL);
RNA_def_property_update(prop, NC_LOGIC, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "show_debug", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "show_debug", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PROP_DEBUG); RNA_def_property_boolean_sdna(prop, NULL, "flag", PROP_DEBUG);
RNA_def_property_ui_text(prop, "Debug", "Print debug information for this property"); RNA_def_property_ui_text(prop, "Debug", "Print debug information for this property");
RNA_def_property_update(prop, NC_LOGIC, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL);
/* GameBooleanProperty */ /* GameBooleanProperty */
srna= RNA_def_struct(brna, "GameBooleanProperty", "GameProperty"); srna = RNA_def_struct(brna, "GameBooleanProperty", "GameProperty");
RNA_def_struct_ui_text(srna , "Game Boolean Property", "Game engine user defined Boolean property"); RNA_def_struct_ui_text(srna , "Game Boolean Property", "Game engine user defined Boolean property");
RNA_def_struct_sdna(srna, "bProperty"); RNA_def_struct_sdna(srna, "bProperty");
RNA_def_property_update(prop, NC_LOGIC, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "value", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "value", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "data", 1); RNA_def_property_boolean_sdna(prop, NULL, "data", 1);
RNA_def_property_ui_text(prop, "Value", "Property value"); RNA_def_property_ui_text(prop, "Value", "Property value");
RNA_def_property_update(prop, NC_LOGIC, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL);
/* GameIntProperty */ /* GameIntProperty */
srna= RNA_def_struct(brna, "GameIntProperty", "GameProperty"); srna = RNA_def_struct(brna, "GameIntProperty", "GameProperty");
RNA_def_struct_ui_text(srna , "Game Integer Property", "Game engine user defined integer number property"); RNA_def_struct_ui_text(srna , "Game Integer Property", "Game engine user defined integer number property");
RNA_def_struct_sdna(srna, "bProperty"); RNA_def_struct_sdna(srna, "bProperty");
prop= RNA_def_property(srna, "value", PROP_INT, PROP_NONE); prop = RNA_def_property(srna, "value", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "data"); RNA_def_property_int_sdna(prop, NULL, "data");
RNA_def_property_ui_text(prop, "Value", "Property value"); RNA_def_property_ui_text(prop, "Value", "Property value");
RNA_def_property_range(prop, -10000, 10000); RNA_def_property_range(prop, -10000, 10000);
RNA_def_property_update(prop, NC_LOGIC, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL);
/* GameFloatProperty */ /* GameFloatProperty */
srna= RNA_def_struct(brna, "GameFloatProperty", "GameProperty"); srna = RNA_def_struct(brna, "GameFloatProperty", "GameProperty");
RNA_def_struct_ui_text(srna, "Game Float Property", "Game engine user defined floating point number property"); RNA_def_struct_ui_text(srna, "Game Float Property", "Game engine user defined floating point number property");
RNA_def_struct_sdna(srna, "bProperty"); RNA_def_struct_sdna(srna, "bProperty");
prop= RNA_def_property(srna, "value", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "value", PROP_FLOAT, PROP_NONE);
// RNA_def_property_float_sdna(prop, NULL, "data"); /* RNA_def_property_float_sdna(prop, NULL, "data"); */
RNA_def_property_ui_text(prop, "Value", "Property value"); RNA_def_property_ui_text(prop, "Value", "Property value");
RNA_def_property_range(prop, -10000, 10000); RNA_def_property_range(prop, -10000, 10000);
RNA_def_property_float_funcs(prop, "rna_GameFloatProperty_value_get", "rna_GameFloatProperty_value_set", NULL); RNA_def_property_float_funcs(prop, "rna_GameFloatProperty_value_get", "rna_GameFloatProperty_value_set", NULL);
RNA_def_property_update(prop, NC_LOGIC, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL);
/* GameTimerProperty */ /* GameTimerProperty */
srna= RNA_def_struct(brna, "GameTimerProperty", "GameProperty"); srna = RNA_def_struct(brna, "GameTimerProperty", "GameProperty");
RNA_def_struct_ui_text(srna, "Game Timer Property", "Game engine user defined timer property"); RNA_def_struct_ui_text(srna, "Game Timer Property", "Game engine user defined timer property");
RNA_def_struct_sdna(srna, "bProperty"); RNA_def_struct_sdna(srna, "bProperty");
prop= RNA_def_property(srna, "value", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "value", PROP_FLOAT, PROP_NONE);
// RNA_def_property_float_sdna(prop, NULL, "data"); /* RNA_def_property_float_sdna(prop, NULL, "data"); */
RNA_def_property_ui_text(prop, "Value", "Property value"); RNA_def_property_ui_text(prop, "Value", "Property value");
RNA_def_property_range(prop, -10000, 10000); RNA_def_property_range(prop, -10000, 10000);
RNA_def_property_float_funcs(prop, "rna_GameFloatProperty_value_get", "rna_GameFloatProperty_value_set", NULL); RNA_def_property_float_funcs(prop, "rna_GameFloatProperty_value_get", "rna_GameFloatProperty_value_set", NULL);
RNA_def_property_update(prop, NC_LOGIC, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL);
/* GameStringProperty */ /* GameStringProperty */
srna= RNA_def_struct(brna, "GameStringProperty", "GameProperty"); srna = RNA_def_struct(brna, "GameStringProperty", "GameProperty");
RNA_def_struct_ui_text(srna, "Game String Property", "Game engine user defined text string property"); RNA_def_struct_ui_text(srna, "Game String Property", "Game engine user defined text string property");
RNA_def_struct_sdna(srna, "bProperty"); RNA_def_struct_sdna(srna, "bProperty");
prop= RNA_def_property(srna, "value", PROP_STRING, PROP_NONE); prop = RNA_def_property(srna, "value", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "poin"); RNA_def_property_string_sdna(prop, NULL, "poin");
RNA_def_property_string_maxlength(prop, MAX_PROPSTRING); RNA_def_property_string_maxlength(prop, MAX_PROPSTRING);
RNA_def_property_ui_text(prop, "Value", "Property value"); RNA_def_property_ui_text(prop, "Value", "Property value");

View File

@@ -68,7 +68,7 @@ static void engine_update(RenderEngine *engine, Main *bmain, Scene *scene)
FunctionRNA *func; FunctionRNA *func;
RNA_pointer_create(NULL, engine->type->ext.srna, engine, &ptr); RNA_pointer_create(NULL, engine->type->ext.srna, engine, &ptr);
func= &rna_RenderEngine_update_func; func = &rna_RenderEngine_update_func;
RNA_parameter_list_create(&list, &ptr, func); RNA_parameter_list_create(&list, &ptr, func);
RNA_parameter_set_lookup(&list, "data", &bmain); RNA_parameter_set_lookup(&list, "data", &bmain);
@@ -86,7 +86,7 @@ static void engine_render(RenderEngine *engine, struct Scene *scene)
FunctionRNA *func; FunctionRNA *func;
RNA_pointer_create(NULL, engine->type->ext.srna, engine, &ptr); RNA_pointer_create(NULL, engine->type->ext.srna, engine, &ptr);
func= &rna_RenderEngine_render_func; func = &rna_RenderEngine_render_func;
RNA_parameter_list_create(&list, &ptr, func); RNA_parameter_list_create(&list, &ptr, func);
RNA_parameter_set_lookup(&list, "scene", &scene); RNA_parameter_set_lookup(&list, "scene", &scene);
@@ -103,7 +103,7 @@ static void engine_view_update(RenderEngine *engine, const struct bContext *cont
FunctionRNA *func; FunctionRNA *func;
RNA_pointer_create(NULL, engine->type->ext.srna, engine, &ptr); RNA_pointer_create(NULL, engine->type->ext.srna, engine, &ptr);
func= &rna_RenderEngine_view_update_func; func = &rna_RenderEngine_view_update_func;
RNA_parameter_list_create(&list, &ptr, func); RNA_parameter_list_create(&list, &ptr, func);
RNA_parameter_set_lookup(&list, "context", &context); RNA_parameter_set_lookup(&list, "context", &context);
@@ -120,7 +120,7 @@ static void engine_view_draw(RenderEngine *engine, const struct bContext *contex
FunctionRNA *func; FunctionRNA *func;
RNA_pointer_create(NULL, engine->type->ext.srna, engine, &ptr); RNA_pointer_create(NULL, engine->type->ext.srna, engine, &ptr);
func= &rna_RenderEngine_view_draw_func; func = &rna_RenderEngine_view_draw_func;
RNA_parameter_list_create(&list, &ptr, func); RNA_parameter_list_create(&list, &ptr, func);
RNA_parameter_set_lookup(&list, "context", &context); RNA_parameter_set_lookup(&list, "context", &context);
@@ -133,9 +133,9 @@ static void engine_view_draw(RenderEngine *engine, const struct bContext *contex
static void rna_RenderEngine_unregister(Main *UNUSED(bmain), StructRNA *type) static void rna_RenderEngine_unregister(Main *UNUSED(bmain), StructRNA *type)
{ {
RenderEngineType *et= RNA_struct_blender_type_get(type); RenderEngineType *et = RNA_struct_blender_type_get(type);
if(!et) if (!et)
return; return;
RNA_struct_free_extension(type, &et->ext); RNA_struct_free_extension(type, &et->ext);
@@ -146,47 +146,47 @@ static void rna_RenderEngine_unregister(Main *UNUSED(bmain), StructRNA *type)
static StructRNA *rna_RenderEngine_register(Main *bmain, ReportList *reports, void *data, const char *identifier, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free) static StructRNA *rna_RenderEngine_register(Main *bmain, ReportList *reports, void *data, const char *identifier, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free)
{ {
RenderEngineType *et, dummyet = {NULL}; RenderEngineType *et, dummyet = {NULL};
RenderEngine dummyengine= {NULL}; RenderEngine dummyengine = {NULL};
PointerRNA dummyptr; PointerRNA dummyptr;
int have_function[4]; int have_function[4];
/* setup dummy engine & engine type to store static properties in */ /* setup dummy engine & engine type to store static properties in */
dummyengine.type= &dummyet; dummyengine.type = &dummyet;
RNA_pointer_create(NULL, &RNA_RenderEngine, &dummyengine, &dummyptr); RNA_pointer_create(NULL, &RNA_RenderEngine, &dummyengine, &dummyptr);
/* validate the python class */ /* validate the python class */
if(validate(&dummyptr, data, have_function) != 0) if (validate(&dummyptr, data, have_function) != 0)
return NULL; return NULL;
if(strlen(identifier) >= sizeof(dummyet.idname)) { if (strlen(identifier) >= sizeof(dummyet.idname)) {
BKE_reportf(reports, RPT_ERROR, "registering render engine class: '%s' is too long, maximum length is %d", BKE_reportf(reports, RPT_ERROR, "registering render engine class: '%s' is too long, maximum length is %d",
identifier, (int)sizeof(dummyet.idname)); identifier, (int)sizeof(dummyet.idname));
return NULL; return NULL;
} }
/* check if we have registered this engine type before, and remove it */ /* check if we have registered this engine type before, and remove it */
for(et=R_engines.first; et; et=et->next) { for (et = R_engines.first; et; et = et->next) {
if(strcmp(et->idname, dummyet.idname) == 0) { if (strcmp(et->idname, dummyet.idname) == 0) {
if(et->ext.srna) if (et->ext.srna)
rna_RenderEngine_unregister(bmain, et->ext.srna); rna_RenderEngine_unregister(bmain, et->ext.srna);
break; break;
} }
} }
/* create a new engine type */ /* create a new engine type */
et= MEM_callocN(sizeof(RenderEngineType), "python render engine"); et = MEM_callocN(sizeof(RenderEngineType), "python render engine");
memcpy(et, &dummyet, sizeof(dummyet)); memcpy(et, &dummyet, sizeof(dummyet));
et->ext.srna= RNA_def_struct(&BLENDER_RNA, et->idname, "RenderEngine"); et->ext.srna = RNA_def_struct(&BLENDER_RNA, et->idname, "RenderEngine");
et->ext.data= data; et->ext.data = data;
et->ext.call= call; et->ext.call = call;
et->ext.free= free; et->ext.free = free;
RNA_struct_blender_type_set(et->ext.srna, et); RNA_struct_blender_type_set(et->ext.srna, et);
et->update= (have_function[0])? engine_update: NULL; et->update = (have_function[0])? engine_update: NULL;
et->render= (have_function[1])? engine_render: NULL; et->render = (have_function[1])? engine_render: NULL;
et->view_update= (have_function[2])? engine_view_update: NULL; et->view_update = (have_function[2])? engine_view_update: NULL;
et->view_draw= (have_function[3])? engine_view_draw: NULL; et->view_draw = (have_function[3])? engine_view_draw: NULL;
BLI_addtail(&R_engines, et); BLI_addtail(&R_engines, et);
@@ -201,67 +201,67 @@ static void **rna_RenderEngine_instance(PointerRNA *ptr)
static StructRNA* rna_RenderEngine_refine(PointerRNA *ptr) static StructRNA* rna_RenderEngine_refine(PointerRNA *ptr)
{ {
RenderEngine *engine= (RenderEngine*)ptr->data; RenderEngine *engine = (RenderEngine*)ptr->data;
return (engine->type && engine->type->ext.srna)? engine->type->ext.srna: &RNA_RenderEngine; return (engine->type && engine->type->ext.srna)? engine->type->ext.srna: &RNA_RenderEngine;
} }
static void rna_RenderResult_layers_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) static void rna_RenderResult_layers_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{ {
RenderResult *rr= (RenderResult*)ptr->data; RenderResult *rr = (RenderResult*)ptr->data;
rna_iterator_listbase_begin(iter, &rr->layers, NULL); rna_iterator_listbase_begin(iter, &rr->layers, NULL);
} }
static void rna_RenderLayer_passes_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) static void rna_RenderLayer_passes_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{ {
RenderLayer *rl= (RenderLayer*)ptr->data; RenderLayer *rl = (RenderLayer*)ptr->data;
rna_iterator_listbase_begin(iter, &rl->passes, NULL); rna_iterator_listbase_begin(iter, &rl->passes, NULL);
} }
static int rna_RenderLayer_rect_get_length(PointerRNA *ptr, int length[RNA_MAX_ARRAY_DIMENSION]) static int rna_RenderLayer_rect_get_length(PointerRNA *ptr, int length[RNA_MAX_ARRAY_DIMENSION])
{ {
RenderLayer *rl= (RenderLayer*)ptr->data; RenderLayer *rl = (RenderLayer*)ptr->data;
length[0]= rl->rectx*rl->recty; length[0] = rl->rectx*rl->recty;
length[1]= 4; length[1] = 4;
return length[0]*length[1]; return length[0]*length[1];
} }
static void rna_RenderLayer_rect_get(PointerRNA *ptr, float *values) static void rna_RenderLayer_rect_get(PointerRNA *ptr, float *values)
{ {
RenderLayer *rl= (RenderLayer*)ptr->data; RenderLayer *rl = (RenderLayer*)ptr->data;
memcpy(values, rl->rectf, sizeof(float)*rl->rectx*rl->recty*4); memcpy(values, rl->rectf, sizeof(float)*rl->rectx*rl->recty*4);
} }
void rna_RenderLayer_rect_set(PointerRNA *ptr, const float *values) void rna_RenderLayer_rect_set(PointerRNA *ptr, const float *values)
{ {
RenderLayer *rl= (RenderLayer*)ptr->data; RenderLayer *rl = (RenderLayer*)ptr->data;
memcpy(rl->rectf, values, sizeof(float)*rl->rectx*rl->recty*4); memcpy(rl->rectf, values, sizeof(float)*rl->rectx*rl->recty*4);
} }
static int rna_RenderPass_rect_get_length(PointerRNA *ptr, int length[RNA_MAX_ARRAY_DIMENSION]) static int rna_RenderPass_rect_get_length(PointerRNA *ptr, int length[RNA_MAX_ARRAY_DIMENSION])
{ {
RenderPass *rpass= (RenderPass*)ptr->data; RenderPass *rpass = (RenderPass*)ptr->data;
length[0]= rpass->rectx*rpass->recty; length[0] = rpass->rectx*rpass->recty;
length[1]= rpass->channels; length[1] = rpass->channels;
return length[0]*length[1]; return length[0]*length[1];
} }
static void rna_RenderPass_rect_get(PointerRNA *ptr, float *values) static void rna_RenderPass_rect_get(PointerRNA *ptr, float *values)
{ {
RenderPass *rpass= (RenderPass*)ptr->data; RenderPass *rpass = (RenderPass*)ptr->data;
memcpy(values, rpass->rect, sizeof(float)*rpass->rectx*rpass->recty*rpass->channels); memcpy(values, rpass->rect, sizeof(float)*rpass->rectx*rpass->recty*rpass->channels);
} }
void rna_RenderPass_rect_set(PointerRNA *ptr, const float *values) void rna_RenderPass_rect_set(PointerRNA *ptr, const float *values)
{ {
RenderPass *rpass= (RenderPass*)ptr->data; RenderPass *rpass = (RenderPass*)ptr->data;
memcpy(rpass->rect, values, sizeof(float)*rpass->rectx*rpass->recty*rpass->channels); memcpy(rpass->rect, values, sizeof(float)*rpass->rectx*rpass->recty*rpass->channels);
} }
#else // RNA_RUNTIME #else /* RNA_RUNTIME */
static void rna_def_render_engine(BlenderRNA *brna) static void rna_def_render_engine(BlenderRNA *brna)
{ {
@@ -269,31 +269,31 @@ static void rna_def_render_engine(BlenderRNA *brna)
PropertyRNA *prop; PropertyRNA *prop;
FunctionRNA *func; FunctionRNA *func;
srna= RNA_def_struct(brna, "RenderEngine", NULL); srna = RNA_def_struct(brna, "RenderEngine", NULL);
RNA_def_struct_sdna(srna, "RenderEngine"); RNA_def_struct_sdna(srna, "RenderEngine");
RNA_def_struct_ui_text(srna, "Render Engine", "Render engine"); RNA_def_struct_ui_text(srna, "Render Engine", "Render engine");
RNA_def_struct_refine_func(srna, "rna_RenderEngine_refine"); RNA_def_struct_refine_func(srna, "rna_RenderEngine_refine");
RNA_def_struct_register_funcs(srna, "rna_RenderEngine_register", "rna_RenderEngine_unregister", "rna_RenderEngine_instance"); RNA_def_struct_register_funcs(srna, "rna_RenderEngine_register", "rna_RenderEngine_unregister", "rna_RenderEngine_instance");
/* final render callbacks */ /* final render callbacks */
func= RNA_def_function(srna, "update", NULL); func = RNA_def_function(srna, "update", NULL);
RNA_def_function_ui_description(func, "Export scene data for render"); RNA_def_function_ui_description(func, "Export scene data for render");
RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL); RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL);
RNA_def_pointer(func, "data", "BlendData", "", ""); RNA_def_pointer(func, "data", "BlendData", "", "");
RNA_def_pointer(func, "scene", "Scene", "", ""); RNA_def_pointer(func, "scene", "Scene", "", "");
func= RNA_def_function(srna, "render", NULL); func = RNA_def_function(srna, "render", NULL);
RNA_def_function_ui_description(func, "Render scene into an image"); RNA_def_function_ui_description(func, "Render scene into an image");
RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL); RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL);
RNA_def_pointer(func, "scene", "Scene", "", ""); RNA_def_pointer(func, "scene", "Scene", "", "");
/* viewport render callbacks */ /* viewport render callbacks */
func= RNA_def_function(srna, "view_update", NULL); func = RNA_def_function(srna, "view_update", NULL);
RNA_def_function_ui_description(func, "Update on data changes for viewport render"); RNA_def_function_ui_description(func, "Update on data changes for viewport render");
RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL); RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL);
RNA_def_pointer(func, "context", "Context", "", ""); RNA_def_pointer(func, "context", "Context", "", "");
func= RNA_def_function(srna, "view_draw", NULL); func = RNA_def_function(srna, "view_draw", NULL);
RNA_def_function_ui_description(func, "Draw viewport render"); RNA_def_function_ui_description(func, "Draw viewport render");
RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL); RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL);
RNA_def_pointer(func, "context", "Context", "", ""); RNA_def_pointer(func, "context", "Context", "", "");
@@ -306,73 +306,73 @@ static void rna_def_render_engine(BlenderRNA *brna)
RNA_def_function(srna, "tag_update", "engine_tag_update"); RNA_def_function(srna, "tag_update", "engine_tag_update");
RNA_def_function_ui_description(func, "Request update call for viewport rendering"); RNA_def_function_ui_description(func, "Request update call for viewport rendering");
func= RNA_def_function(srna, "begin_result", "RE_engine_begin_result"); func = RNA_def_function(srna, "begin_result", "RE_engine_begin_result");
prop= RNA_def_int(func, "x", 0, 0, INT_MAX, "X", "", 0, INT_MAX); prop = RNA_def_int(func, "x", 0, 0, INT_MAX, "X", "", 0, INT_MAX);
RNA_def_property_flag(prop, PROP_REQUIRED); RNA_def_property_flag(prop, PROP_REQUIRED);
prop= RNA_def_int(func, "y", 0, 0, INT_MAX, "Y", "", 0, INT_MAX); prop = RNA_def_int(func, "y", 0, 0, INT_MAX, "Y", "", 0, INT_MAX);
RNA_def_property_flag(prop, PROP_REQUIRED); RNA_def_property_flag(prop, PROP_REQUIRED);
prop= RNA_def_int(func, "w", 0, 0, INT_MAX, "Width", "", 0, INT_MAX); prop = RNA_def_int(func, "w", 0, 0, INT_MAX, "Width", "", 0, INT_MAX);
RNA_def_property_flag(prop, PROP_REQUIRED); RNA_def_property_flag(prop, PROP_REQUIRED);
prop= RNA_def_int(func, "h", 0, 0, INT_MAX, "Height", "", 0, INT_MAX); prop = RNA_def_int(func, "h", 0, 0, INT_MAX, "Height", "", 0, INT_MAX);
RNA_def_property_flag(prop, PROP_REQUIRED); RNA_def_property_flag(prop, PROP_REQUIRED);
prop= RNA_def_pointer(func, "result", "RenderResult", "Result", ""); prop = RNA_def_pointer(func, "result", "RenderResult", "Result", "");
RNA_def_function_return(func, prop); RNA_def_function_return(func, prop);
func= RNA_def_function(srna, "update_result", "RE_engine_update_result"); func = RNA_def_function(srna, "update_result", "RE_engine_update_result");
prop= RNA_def_pointer(func, "result", "RenderResult", "Result", ""); prop = RNA_def_pointer(func, "result", "RenderResult", "Result", "");
RNA_def_property_flag(prop, PROP_REQUIRED); RNA_def_property_flag(prop, PROP_REQUIRED);
func= RNA_def_function(srna, "end_result", "RE_engine_end_result"); func = RNA_def_function(srna, "end_result", "RE_engine_end_result");
prop= RNA_def_pointer(func, "result", "RenderResult", "Result", ""); prop = RNA_def_pointer(func, "result", "RenderResult", "Result", "");
RNA_def_property_flag(prop, PROP_REQUIRED); RNA_def_property_flag(prop, PROP_REQUIRED);
func= RNA_def_function(srna, "test_break", "RE_engine_test_break"); func = RNA_def_function(srna, "test_break", "RE_engine_test_break");
prop= RNA_def_boolean(func, "do_break", 0, "Break", ""); prop = RNA_def_boolean(func, "do_break", 0, "Break", "");
RNA_def_function_return(func, prop); RNA_def_function_return(func, prop);
func= RNA_def_function(srna, "update_stats", "RE_engine_update_stats"); func = RNA_def_function(srna, "update_stats", "RE_engine_update_stats");
prop= RNA_def_string(func, "stats", "", 0, "Stats", ""); prop = RNA_def_string(func, "stats", "", 0, "Stats", "");
RNA_def_property_flag(prop, PROP_REQUIRED); RNA_def_property_flag(prop, PROP_REQUIRED);
prop= RNA_def_string(func, "info", "", 0, "Info", ""); prop = RNA_def_string(func, "info", "", 0, "Info", "");
RNA_def_property_flag(prop, PROP_REQUIRED); RNA_def_property_flag(prop, PROP_REQUIRED);
func= RNA_def_function(srna, "update_progress", "RE_engine_update_progress"); func = RNA_def_function(srna, "update_progress", "RE_engine_update_progress");
prop= RNA_def_float(func, "progress", 0, 0.0f, 1.0f, "", "Percentage of render that's done", 0.0f, 1.0f); prop = RNA_def_float(func, "progress", 0, 0.0f, 1.0f, "", "Percentage of render that's done", 0.0f, 1.0f);
RNA_def_property_flag(prop, PROP_REQUIRED); RNA_def_property_flag(prop, PROP_REQUIRED);
func= RNA_def_function(srna, "report", "RE_engine_report"); func = RNA_def_function(srna, "report", "RE_engine_report");
prop= RNA_def_enum_flag(func, "type", wm_report_items, 0, "Type", ""); prop = RNA_def_enum_flag(func, "type", wm_report_items, 0, "Type", "");
RNA_def_property_flag(prop, PROP_REQUIRED); RNA_def_property_flag(prop, PROP_REQUIRED);
prop= RNA_def_string(func, "message", "", 0, "Report Message", ""); prop = RNA_def_string(func, "message", "", 0, "Report Message", "");
RNA_def_property_flag(prop, PROP_REQUIRED); RNA_def_property_flag(prop, PROP_REQUIRED);
RNA_define_verify_sdna(0); RNA_define_verify_sdna(0);
prop= RNA_def_property(srna, "is_animation", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "is_animation", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", RE_ENGINE_ANIMATION); RNA_def_property_boolean_sdna(prop, NULL, "flag", RE_ENGINE_ANIMATION);
prop= RNA_def_property(srna, "is_preview", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "is_preview", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", RE_ENGINE_PREVIEW); RNA_def_property_boolean_sdna(prop, NULL, "flag", RE_ENGINE_PREVIEW);
/* registration */ /* registration */
prop= RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE); prop = RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "type->idname"); RNA_def_property_string_sdna(prop, NULL, "type->idname");
RNA_def_property_flag(prop, PROP_REGISTER|PROP_NEVER_CLAMP); RNA_def_property_flag(prop, PROP_REGISTER|PROP_NEVER_CLAMP);
prop= RNA_def_property(srna, "bl_label", PROP_STRING, PROP_TRANSLATE); prop = RNA_def_property(srna, "bl_label", PROP_STRING, PROP_TRANSLATE);
RNA_def_property_string_sdna(prop, NULL, "type->name"); RNA_def_property_string_sdna(prop, NULL, "type->name");
RNA_def_property_flag(prop, PROP_REGISTER); RNA_def_property_flag(prop, PROP_REGISTER);
prop= RNA_def_property(srna, "bl_use_preview", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "bl_use_preview", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "type->flag", RE_USE_PREVIEW); RNA_def_property_boolean_sdna(prop, NULL, "type->flag", RE_USE_PREVIEW);
RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL); RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL);
prop= RNA_def_property(srna, "bl_use_postprocess", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "bl_use_postprocess", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "type->flag", RE_USE_POSTPROCESS); RNA_def_property_boolean_negative_sdna(prop, NULL, "type->flag", RE_USE_POSTPROCESS);
RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL); RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL);
prop= RNA_def_property(srna, "bl_use_shading_nodes", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "bl_use_shading_nodes", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "type->flag", RE_USE_SHADING_NODES); RNA_def_property_boolean_sdna(prop, NULL, "type->flag", RE_USE_SHADING_NODES);
RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL); RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL);
@@ -385,27 +385,27 @@ static void rna_def_render_result(BlenderRNA *brna)
FunctionRNA *func; FunctionRNA *func;
PropertyRNA *parm; PropertyRNA *parm;
srna= RNA_def_struct(brna, "RenderResult", NULL); srna = RNA_def_struct(brna, "RenderResult", NULL);
RNA_def_struct_ui_text(srna, "Render Result", "Result of rendering, including all layers and passes"); RNA_def_struct_ui_text(srna, "Render Result", "Result of rendering, including all layers and passes");
func= RNA_def_function(srna, "load_from_file", "RE_result_load_from_file"); func = RNA_def_function(srna, "load_from_file", "RE_result_load_from_file");
RNA_def_function_ui_description(func, "Copies the pixels of this render result from an image file"); RNA_def_function_ui_description(func, "Copies the pixels of this render result from an image file");
RNA_def_function_flag(func, FUNC_USE_REPORTS); RNA_def_function_flag(func, FUNC_USE_REPORTS);
parm= RNA_def_string_file_name(func, "filename", "", FILE_MAX, "File Name", parm = RNA_def_string_file_name(func, "filename", "", FILE_MAX, "File Name",
"Filename to load into this render tile, must be no smaller than the render result"); "Filename to load into this render tile, must be no smaller than the render result");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_define_verify_sdna(0); RNA_define_verify_sdna(0);
parm= RNA_def_property(srna, "resolution_x", PROP_INT, PROP_NONE); parm = RNA_def_property(srna, "resolution_x", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(parm, NULL, "rectx"); RNA_def_property_int_sdna(parm, NULL, "rectx");
RNA_def_property_clear_flag(parm, PROP_EDITABLE); RNA_def_property_clear_flag(parm, PROP_EDITABLE);
parm= RNA_def_property(srna, "resolution_y", PROP_INT, PROP_NONE); parm = RNA_def_property(srna, "resolution_y", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(parm, NULL, "recty"); RNA_def_property_int_sdna(parm, NULL, "recty");
RNA_def_property_clear_flag(parm, PROP_EDITABLE); RNA_def_property_clear_flag(parm, PROP_EDITABLE);
parm= RNA_def_property(srna, "layers", PROP_COLLECTION, PROP_NONE); parm = RNA_def_property(srna, "layers", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(parm, "RenderLayer"); RNA_def_property_struct_type(parm, "RenderLayer");
RNA_def_property_collection_funcs(parm, "rna_RenderResult_layers_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", NULL, NULL, NULL, NULL); RNA_def_property_collection_funcs(parm, "rna_RenderResult_layers_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", NULL, NULL, NULL, NULL);
@@ -418,13 +418,13 @@ static void rna_def_render_layer(BlenderRNA *brna)
PropertyRNA *prop; PropertyRNA *prop;
FunctionRNA *func; FunctionRNA *func;
srna= RNA_def_struct(brna, "RenderLayer", NULL); srna = RNA_def_struct(brna, "RenderLayer", NULL);
RNA_def_struct_ui_text(srna, "Render Layer", ""); RNA_def_struct_ui_text(srna, "Render Layer", "");
func= RNA_def_function(srna, "load_from_file", "RE_layer_load_from_file"); func = RNA_def_function(srna, "load_from_file", "RE_layer_load_from_file");
RNA_def_function_ui_description(func, "Copies the pixels of this renderlayer from an image file"); RNA_def_function_ui_description(func, "Copies the pixels of this renderlayer from an image file");
RNA_def_function_flag(func, FUNC_USE_REPORTS); RNA_def_function_flag(func, FUNC_USE_REPORTS);
prop= RNA_def_string(func, "filename", "", 0, "Filename", prop = RNA_def_string(func, "filename", "", 0, "Filename",
"Filename to load into this render tile, must be no smaller than the renderlayer"); "Filename to load into this render tile, must be no smaller than the renderlayer");
RNA_def_property_flag(prop, PROP_REQUIRED); RNA_def_property_flag(prop, PROP_REQUIRED);
RNA_def_int(func, "x", 0, 0, INT_MAX, "Offset X", RNA_def_int(func, "x", 0, 0, INT_MAX, "Offset X",
@@ -436,11 +436,11 @@ static void rna_def_render_layer(BlenderRNA *brna)
rna_def_render_layer_common(srna, 0); rna_def_render_layer_common(srna, 0);
prop= RNA_def_property(srna, "passes", PROP_COLLECTION, PROP_NONE); prop = RNA_def_property(srna, "passes", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "RenderPass"); RNA_def_property_struct_type(prop, "RenderPass");
RNA_def_property_collection_funcs(prop, "rna_RenderLayer_passes_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", NULL, NULL, NULL, NULL); RNA_def_property_collection_funcs(prop, "rna_RenderLayer_passes_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", NULL, NULL, NULL, NULL);
prop= RNA_def_property(srna, "rect", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "rect", PROP_FLOAT, PROP_NONE);
RNA_def_property_flag(prop, PROP_DYNAMIC); RNA_def_property_flag(prop, PROP_DYNAMIC);
RNA_def_property_multi_array(prop, 2, NULL); RNA_def_property_multi_array(prop, 2, NULL);
RNA_def_property_dynamic_array_funcs(prop, "rna_RenderLayer_rect_get_length"); RNA_def_property_dynamic_array_funcs(prop, "rna_RenderLayer_rect_get_length");
@@ -454,7 +454,7 @@ static void rna_def_render_pass(BlenderRNA *brna)
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
static EnumPropertyItem pass_type_items[]= { static EnumPropertyItem pass_type_items[] = {
{SCE_PASS_COMBINED, "COMBINED", 0, "Combined", ""}, {SCE_PASS_COMBINED, "COMBINED", 0, "Combined", ""},
{SCE_PASS_Z, "Z", 0, "Z", ""}, {SCE_PASS_Z, "Z", 0, "Z", ""},
{SCE_PASS_RGBA, "COLOR", 0, "Color", ""}, {SCE_PASS_RGBA, "COLOR", 0, "Color", ""},
@@ -483,30 +483,30 @@ static void rna_def_render_pass(BlenderRNA *brna)
{SCE_PASS_TRANSM_COLOR, "TRANSMISSION_COLOR", 0, "Transmission Color", ""}, {SCE_PASS_TRANSM_COLOR, "TRANSMISSION_COLOR", 0, "Transmission Color", ""},
{0, NULL, 0, NULL, NULL}}; {0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "RenderPass", NULL); srna = RNA_def_struct(brna, "RenderPass", NULL);
RNA_def_struct_ui_text(srna, "Render Pass", ""); RNA_def_struct_ui_text(srna, "Render Pass", "");
RNA_define_verify_sdna(0); RNA_define_verify_sdna(0);
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "name"); RNA_def_property_string_sdna(prop, NULL, "name");
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_struct_name_property(srna, prop); RNA_def_struct_name_property(srna, prop);
prop= RNA_def_property(srna, "channel_id", PROP_STRING, PROP_NONE); prop = RNA_def_property(srna, "channel_id", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "chan_id"); RNA_def_property_string_sdna(prop, NULL, "chan_id");
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
prop= RNA_def_property(srna, "channels", PROP_INT, PROP_NONE); prop = RNA_def_property(srna, "channels", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "channels"); RNA_def_property_int_sdna(prop, NULL, "channels");
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "passtype"); RNA_def_property_enum_sdna(prop, NULL, "passtype");
RNA_def_property_enum_items(prop, pass_type_items); RNA_def_property_enum_items(prop, pass_type_items);
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
prop= RNA_def_property(srna, "rect", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "rect", PROP_FLOAT, PROP_NONE);
RNA_def_property_flag(prop, PROP_DYNAMIC); RNA_def_property_flag(prop, PROP_DYNAMIC);
RNA_def_property_multi_array(prop, 2, NULL); RNA_def_property_multi_array(prop, 2, NULL);
RNA_def_property_dynamic_array_funcs(prop, "rna_RenderPass_rect_get_length"); RNA_def_property_dynamic_array_funcs(prop, "rna_RenderPass_rect_get_length");
@@ -523,5 +523,5 @@ void RNA_def_render(BlenderRNA *brna)
rna_def_render_pass(brna); rna_def_render_pass(brna);
} }
#endif // RNA_RUNTIME #endif /* RNA_RUNTIME */

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -52,8 +52,8 @@
static void rna_Scene_frame_set(Scene *scene, int frame, float subframe) static void rna_Scene_frame_set(Scene *scene, int frame, float subframe)
{ {
scene->r.cfra= frame; scene->r.cfra = frame;
scene->r.subframe= subframe; scene->r.subframe = subframe;
CLAMP(scene->r.cfra, MINAFRAME, MAXFRAME); CLAMP(scene->r.cfra, MINAFRAME, MAXFRAME);
scene_update_for_newframe(G.main, scene, (1<<20) - 1); scene_update_for_newframe(G.main, scene, (1<<20) - 1);
@@ -74,10 +74,10 @@ static void rna_Scene_update_tagged(Scene *scene)
static void rna_SceneRender_get_frame_path(RenderData *rd, int frame, char *name) static void rna_SceneRender_get_frame_path(RenderData *rd, int frame, char *name)
{ {
if(BKE_imtype_is_movie(rd->im_format.imtype)) if (BKE_imtype_is_movie(rd->im_format.imtype))
BKE_makeanimstring(name, rd); BKE_makeanimstring(name, rd);
else else
BKE_makepicstring(name, rd->pic, G.main->name, (frame==INT_MIN) ? rd->cfra : frame, rd->im_format.imtype, rd->scemode & R_EXTENSION, TRUE); BKE_makepicstring(name, rd->pic, G.main->name, (frame == INT_MIN) ? rd->cfra : frame, rd->im_format.imtype, rd->scemode & R_EXTENSION, TRUE);
} }
#ifdef WITH_COLLADA #ifdef WITH_COLLADA
@@ -98,23 +98,23 @@ void RNA_api_scene(StructRNA *srna)
FunctionRNA *func; FunctionRNA *func;
PropertyRNA *parm; PropertyRNA *parm;
func= RNA_def_function(srna, "frame_set", "rna_Scene_frame_set"); func = RNA_def_function(srna, "frame_set", "rna_Scene_frame_set");
RNA_def_function_ui_description(func, "Set scene frame updating all objects immediately"); RNA_def_function_ui_description(func, "Set scene frame updating all objects immediately");
parm= RNA_def_int(func, "frame", 0, MINAFRAME, MAXFRAME, "", "Frame number to set", MINAFRAME, MAXFRAME); parm = RNA_def_int(func, "frame", 0, MINAFRAME, MAXFRAME, "", "Frame number to set", MINAFRAME, MAXFRAME);
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_float(func, "subframe", 0.0, 0.0, 1.0, "", "Sub-frame time, between 0.0 and 1.0", 0.0, 1.0); RNA_def_float(func, "subframe", 0.0, 0.0, 1.0, "", "Sub-frame time, between 0.0 and 1.0", 0.0, 1.0);
func= RNA_def_function(srna, "update", "rna_Scene_update_tagged"); func = RNA_def_function(srna, "update", "rna_Scene_update_tagged");
RNA_def_function_ui_description(func, "Update data tagged to be updated from previous access to data or operators"); RNA_def_function_ui_description(func, "Update data tagged to be updated from previous access to data or operators");
#ifdef WITH_COLLADA #ifdef WITH_COLLADA
/* don't remove this, as COLLADA exporting cannot be done through operators in render() callback. */ /* don't remove this, as COLLADA exporting cannot be done through operators in render() callback. */
func= RNA_def_function(srna, "collada_export", "rna_Scene_collada_export"); func = RNA_def_function(srna, "collada_export", "rna_Scene_collada_export");
parm= RNA_def_string(func, "filepath", "", FILE_MAX, "File Path", "File path to write Collada file"); parm = RNA_def_string(func, "filepath", "", FILE_MAX, "File Path", "File path to write Collada file");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_property_subtype(parm, PROP_FILEPATH); /* allow non utf8 */ RNA_def_property_subtype(parm, PROP_FILEPATH); /* allow non utf8 */
parm= RNA_def_boolean(func, "selected", 0, "Export only selected", "Export only selected elements"); parm = RNA_def_boolean(func, "selected", 0, "Export only selected", "Export only selected elements");
parm= RNA_def_boolean(func, "second_life", 0, "Export for Second Life", "Compatibility mode for Second Life"); parm = RNA_def_boolean(func, "second_life", 0, "Export for Second Life", "Compatibility mode for Second Life");
RNA_def_function_ui_description(func, "Export to collada file"); RNA_def_function_ui_description(func, "Export to collada file");
#endif #endif
} }
@@ -125,11 +125,11 @@ void RNA_api_scene_render(StructRNA *srna)
FunctionRNA *func; FunctionRNA *func;
PropertyRNA *parm; PropertyRNA *parm;
func= RNA_def_function(srna, "frame_path", "rna_SceneRender_get_frame_path"); func = RNA_def_function(srna, "frame_path", "rna_SceneRender_get_frame_path");
RNA_def_function_ui_description(func, "Return the absolute path to the filename to be written for a given frame"); RNA_def_function_ui_description(func, "Return the absolute path to the filename to be written for a given frame");
RNA_def_int(func, "frame", INT_MIN, INT_MIN, INT_MAX, "", RNA_def_int(func, "frame", INT_MIN, INT_MIN, INT_MAX, "",
"Frame number to use, if unset the current frame will be used", MINAFRAME, MAXFRAME); "Frame number to use, if unset the current frame will be used", MINAFRAME, MAXFRAME);
parm= RNA_def_string_file_path(func, "filepath", "", FILE_MAX, "File Path", parm = RNA_def_string_file_path(func, "filepath", "", FILE_MAX, "File Path",
"The resulting filepath from the scenes render settings"); "The resulting filepath from the scenes render settings");
RNA_def_property_flag(parm, PROP_THICK_WRAP); /* needed for string return value */ RNA_def_property_flag(parm, PROP_THICK_WRAP); /* needed for string return value */
RNA_def_function_output(func, parm); RNA_def_function_output(func, parm);

View File

@@ -58,33 +58,33 @@ EnumPropertyItem region_type_items[] = {
static void rna_Screen_scene_set(PointerRNA *ptr, PointerRNA value) static void rna_Screen_scene_set(PointerRNA *ptr, PointerRNA value)
{ {
bScreen *sc= (bScreen*)ptr->data; bScreen *sc = (bScreen*)ptr->data;
if(value.data == NULL) if (value.data == NULL)
return; return;
sc->newscene= value.data; sc->newscene = value.data;
} }
static void rna_Screen_scene_update(bContext *C, PointerRNA *ptr) static void rna_Screen_scene_update(bContext *C, PointerRNA *ptr)
{ {
bScreen *sc= (bScreen*)ptr->data; bScreen *sc = (bScreen*)ptr->data;
/* exception: must use context so notifier gets to the right window */ /* exception: must use context so notifier gets to the right window */
if(sc->newscene) { if (sc->newscene) {
ED_screen_set_scene(C, sc->newscene); ED_screen_set_scene(C, sc->newscene);
WM_event_add_notifier(C, NC_SCENE|ND_SCENEBROWSE, sc->newscene); WM_event_add_notifier(C, NC_SCENE|ND_SCENEBROWSE, sc->newscene);
if(G.f & G_DEBUG) if (G.f & G_DEBUG)
printf("scene set %p\n", sc->newscene); printf("scene set %p\n", sc->newscene);
sc->newscene= NULL; sc->newscene = NULL;
} }
} }
static void rna_Screen_redraw_update(Main *bmain, Scene *scene, PointerRNA *ptr) static void rna_Screen_redraw_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{ {
bScreen *screen= (bScreen*)ptr->data; bScreen *screen = (bScreen*)ptr->data;
/* the settings for this are currently only available from a menu in the TimeLine, hence refresh=SPACE_TIME */ /* the settings for this are currently only available from a menu in the TimeLine, hence refresh=SPACE_TIME */
ED_screen_animation_timer_update(screen, screen->redraws_flag, SPACE_TIME); ED_screen_animation_timer_update(screen, screen->redraws_flag, SPACE_TIME);
@@ -93,25 +93,25 @@ static void rna_Screen_redraw_update(Main *bmain, Scene *scene, PointerRNA *ptr)
static int rna_Screen_is_animation_playing_get(PointerRNA *ptr) static int rna_Screen_is_animation_playing_get(PointerRNA *ptr)
{ {
bScreen *sc= (bScreen*)ptr->data; bScreen *sc = (bScreen*)ptr->data;
return (sc->animtimer != NULL); return (sc->animtimer != NULL);
} }
static int rna_Screen_fullscreen_get(PointerRNA *ptr) static int rna_Screen_fullscreen_get(PointerRNA *ptr)
{ {
bScreen *sc= (bScreen*)ptr->data; bScreen *sc = (bScreen*)ptr->data;
return (sc->full != 0); return (sc->full != 0);
} }
static void rna_Area_type_set(PointerRNA *ptr, int value) static void rna_Area_type_set(PointerRNA *ptr, int value)
{ {
ScrArea *sa= (ScrArea*)ptr->data; ScrArea *sa = (ScrArea*)ptr->data;
sa->butspacetype= value; sa->butspacetype = value;
} }
static void rna_Area_type_update(bContext *C, PointerRNA *ptr) static void rna_Area_type_update(bContext *C, PointerRNA *ptr)
{ {
ScrArea *sa= (ScrArea*)ptr->data; ScrArea *sa = (ScrArea*)ptr->data;
ED_area_newspace(C, sa, sa->butspacetype); /* XXX - this uses the window */ ED_area_newspace(C, sa, sa->butspacetype); /* XXX - this uses the window */
ED_area_tag_redraw(sa); ED_area_tag_redraw(sa);
@@ -126,11 +126,11 @@ static void rna_def_area_spaces(BlenderRNA *brna, PropertyRNA *cprop)
PropertyRNA *prop; PropertyRNA *prop;
RNA_def_property_srna(cprop, "AreaSpaces"); RNA_def_property_srna(cprop, "AreaSpaces");
srna= RNA_def_struct(brna, "AreaSpaces", NULL); srna = RNA_def_struct(brna, "AreaSpaces", NULL);
RNA_def_struct_sdna(srna, "ScrArea"); RNA_def_struct_sdna(srna, "ScrArea");
RNA_def_struct_ui_text(srna, "Area Spaces", "Collection of spaces"); RNA_def_struct_ui_text(srna, "Area Spaces", "Collection of spaces");
prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "spacedata.first"); RNA_def_property_pointer_sdna(prop, NULL, "spacedata.first");
RNA_def_property_struct_type(prop, "Space"); RNA_def_property_struct_type(prop, "Space");
RNA_def_property_ui_text(prop, "Active Space", "Space currently being displayed in this area"); RNA_def_property_ui_text(prop, "Active Space", "Space currently being displayed in this area");
@@ -142,11 +142,11 @@ static void rna_def_area(BlenderRNA *brna)
PropertyRNA *prop; PropertyRNA *prop;
FunctionRNA *func; FunctionRNA *func;
srna= RNA_def_struct(brna, "Area", NULL); srna = RNA_def_struct(brna, "Area", NULL);
RNA_def_struct_ui_text(srna, "Area", "Area in a subdivided screen, containing an editor"); RNA_def_struct_ui_text(srna, "Area", "Area in a subdivided screen, containing an editor");
RNA_def_struct_sdna(srna, "ScrArea"); RNA_def_struct_sdna(srna, "ScrArea");
prop= RNA_def_property(srna, "spaces", PROP_COLLECTION, PROP_NONE); prop = RNA_def_property(srna, "spaces", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "spacedata", NULL); RNA_def_property_collection_sdna(prop, NULL, "spacedata", NULL);
RNA_def_property_struct_type(prop, "Space"); RNA_def_property_struct_type(prop, "Space");
RNA_def_property_ui_text(prop, "Spaces", RNA_def_property_ui_text(prop, "Spaces",
@@ -155,16 +155,16 @@ static void rna_def_area(BlenderRNA *brna)
"in a certain area to get the old view orientation)"); "in a certain area to get the old view orientation)");
rna_def_area_spaces(brna, prop); rna_def_area_spaces(brna, prop);
prop= RNA_def_property(srna, "regions", PROP_COLLECTION, PROP_NONE); prop = RNA_def_property(srna, "regions", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "regionbase", NULL); RNA_def_property_collection_sdna(prop, NULL, "regionbase", NULL);
RNA_def_property_struct_type(prop, "Region"); RNA_def_property_struct_type(prop, "Region");
RNA_def_property_ui_text(prop, "Regions", "Regions this area is subdivided in"); RNA_def_property_ui_text(prop, "Regions", "Regions this area is subdivided in");
prop= RNA_def_property(srna, "show_menus", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "show_menus", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", HEADER_NO_PULLDOWN); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", HEADER_NO_PULLDOWN);
RNA_def_property_ui_text(prop, "Show Menus", "Show menus in the header"); RNA_def_property_ui_text(prop, "Show Menus", "Show menus in the header");
prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "spacetype"); RNA_def_property_enum_sdna(prop, NULL, "spacetype");
RNA_def_property_enum_items(prop, space_type_items); RNA_def_property_enum_items(prop, space_type_items);
RNA_def_property_enum_funcs(prop, NULL, "rna_Area_type_set", NULL); RNA_def_property_enum_funcs(prop, NULL, "rna_Area_type_set", NULL);
@@ -172,19 +172,19 @@ static void rna_def_area(BlenderRNA *brna)
RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
RNA_def_property_update(prop, 0, "rna_Area_type_update"); RNA_def_property_update(prop, 0, "rna_Area_type_update");
prop= RNA_def_property(srna, "width", PROP_INT, PROP_UNSIGNED); prop = RNA_def_property(srna, "width", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "winx"); RNA_def_property_int_sdna(prop, NULL, "winx");
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Width", "Area width"); RNA_def_property_ui_text(prop, "Width", "Area width");
prop= RNA_def_property(srna, "height", PROP_INT, PROP_UNSIGNED); prop = RNA_def_property(srna, "height", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "winy"); RNA_def_property_int_sdna(prop, NULL, "winy");
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Height", "Area height"); RNA_def_property_ui_text(prop, "Height", "Area height");
RNA_def_function(srna, "tag_redraw", "ED_area_tag_redraw"); RNA_def_function(srna, "tag_redraw", "ED_area_tag_redraw");
func= RNA_def_function(srna, "header_text_set", "ED_area_headerprint"); func = RNA_def_function(srna, "header_text_set", "ED_area_headerprint");
RNA_def_function_ui_description(func, "Set the header text"); RNA_def_function_ui_description(func, "Set the header text");
RNA_def_string(func, "text", NULL, 0, "Text", "New string for the header, no argument clears the text"); RNA_def_string(func, "text", NULL, 0, "Text", "New string for the header, no argument clears the text");
} }
@@ -194,27 +194,27 @@ static void rna_def_region(BlenderRNA *brna)
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
srna= RNA_def_struct(brna, "Region", NULL); srna = RNA_def_struct(brna, "Region", NULL);
RNA_def_struct_ui_text(srna, "Region", "Region in a subdivided screen area"); RNA_def_struct_ui_text(srna, "Region", "Region in a subdivided screen area");
RNA_def_struct_sdna(srna, "ARegion"); RNA_def_struct_sdna(srna, "ARegion");
prop= RNA_def_property(srna, "id", PROP_INT, PROP_NONE); prop = RNA_def_property(srna, "id", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "swinid"); RNA_def_property_int_sdna(prop, NULL, "swinid");
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Region ID", "Unique ID for this region"); RNA_def_property_ui_text(prop, "Region ID", "Unique ID for this region");
prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "regiontype"); RNA_def_property_enum_sdna(prop, NULL, "regiontype");
RNA_def_property_enum_items(prop, region_type_items); RNA_def_property_enum_items(prop, region_type_items);
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Region Type", "Type of this region"); RNA_def_property_ui_text(prop, "Region Type", "Type of this region");
prop= RNA_def_property(srna, "width", PROP_INT, PROP_UNSIGNED); prop = RNA_def_property(srna, "width", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "winx"); RNA_def_property_int_sdna(prop, NULL, "winx");
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Width", "Region width"); RNA_def_property_ui_text(prop, "Width", "Region width");
prop= RNA_def_property(srna, "height", PROP_INT, PROP_UNSIGNED); prop = RNA_def_property(srna, "height", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "winy"); RNA_def_property_int_sdna(prop, NULL, "winy");
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Height", "Region height"); RNA_def_property_ui_text(prop, "Height", "Region height");
@@ -227,13 +227,13 @@ static void rna_def_screen(BlenderRNA *brna)
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
srna= RNA_def_struct(brna, "Screen", "ID"); srna = RNA_def_struct(brna, "Screen", "ID");
RNA_def_struct_sdna(srna, "Screen"); /* it is actually bScreen but for 2.5 the dna is patched! */ RNA_def_struct_sdna(srna, "Screen"); /* it is actually bScreen but for 2.5 the dna is patched! */
RNA_def_struct_ui_text(srna, "Screen", "Screen datablock, defining the layout of areas in a window"); RNA_def_struct_ui_text(srna, "Screen", "Screen datablock, defining the layout of areas in a window");
RNA_def_struct_ui_icon(srna, ICON_SPLITSCREEN); RNA_def_struct_ui_icon(srna, ICON_SPLITSCREEN);
/* pointers */ /* pointers */
prop= RNA_def_property(srna, "scene", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "scene", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_EDITABLE|PROP_NEVER_NULL); RNA_def_property_flag(prop, PROP_EDITABLE|PROP_NEVER_NULL);
RNA_def_property_pointer_funcs(prop, NULL, "rna_Screen_scene_set", NULL, NULL); RNA_def_property_pointer_funcs(prop, NULL, "rna_Screen_scene_set", NULL, NULL);
RNA_def_property_ui_text(prop, "Scene", "Active scene to be edited in the screen"); RNA_def_property_ui_text(prop, "Scene", "Active scene to be edited in the screen");
@@ -241,59 +241,59 @@ static void rna_def_screen(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_Screen_scene_update"); RNA_def_property_update(prop, 0, "rna_Screen_scene_update");
/* collections */ /* collections */
prop= RNA_def_property(srna, "areas", PROP_COLLECTION, PROP_NONE); prop = RNA_def_property(srna, "areas", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "areabase", NULL); RNA_def_property_collection_sdna(prop, NULL, "areabase", NULL);
RNA_def_property_struct_type(prop, "Area"); RNA_def_property_struct_type(prop, "Area");
RNA_def_property_ui_text(prop, "Areas", "Areas the screen is subdivided into"); RNA_def_property_ui_text(prop, "Areas", "Areas the screen is subdivided into");
/* readonly status indicators */ /* readonly status indicators */
prop= RNA_def_property(srna, "is_animation_playing", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "is_animation_playing", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_funcs(prop, "rna_Screen_is_animation_playing_get", NULL); RNA_def_property_boolean_funcs(prop, "rna_Screen_is_animation_playing_get", NULL);
RNA_def_property_ui_text(prop, "Animation Playing", "Animation playback is active"); RNA_def_property_ui_text(prop, "Animation Playing", "Animation playback is active");
prop= RNA_def_property(srna, "show_fullscreen", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "show_fullscreen", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_funcs(prop, "rna_Screen_fullscreen_get", NULL); RNA_def_property_boolean_funcs(prop, "rna_Screen_fullscreen_get", NULL);
RNA_def_property_ui_text(prop, "Fullscreen", "An area is maximised, filling this screen"); RNA_def_property_ui_text(prop, "Fullscreen", "An area is maximised, filling this screen");
/* Define Anim Playback Areas */ /* Define Anim Playback Areas */
prop= RNA_def_property(srna, "use_play_top_left_3d_editor", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_play_top_left_3d_editor", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "redraws_flag", TIME_REGION); RNA_def_property_boolean_sdna(prop, NULL, "redraws_flag", TIME_REGION);
RNA_def_property_ui_text(prop, "Top-Left 3D Editor", ""); RNA_def_property_ui_text(prop, "Top-Left 3D Editor", "");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_Screen_redraw_update"); RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_Screen_redraw_update");
prop= RNA_def_property(srna, "use_play_3d_editors", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_play_3d_editors", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "redraws_flag", TIME_ALL_3D_WIN); RNA_def_property_boolean_sdna(prop, NULL, "redraws_flag", TIME_ALL_3D_WIN);
RNA_def_property_ui_text(prop, "All 3D View Editors", ""); RNA_def_property_ui_text(prop, "All 3D View Editors", "");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_Screen_redraw_update"); RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_Screen_redraw_update");
prop= RNA_def_property(srna, "use_play_animation_editors", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_play_animation_editors", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "redraws_flag", TIME_ALL_ANIM_WIN); RNA_def_property_boolean_sdna(prop, NULL, "redraws_flag", TIME_ALL_ANIM_WIN);
RNA_def_property_ui_text(prop, "Animation Editors", ""); RNA_def_property_ui_text(prop, "Animation Editors", "");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_Screen_redraw_update"); RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_Screen_redraw_update");
prop= RNA_def_property(srna, "use_play_properties_editors", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_play_properties_editors", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "redraws_flag", TIME_ALL_BUTS_WIN); RNA_def_property_boolean_sdna(prop, NULL, "redraws_flag", TIME_ALL_BUTS_WIN);
RNA_def_property_ui_text(prop, "Property Editors", ""); RNA_def_property_ui_text(prop, "Property Editors", "");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_Screen_redraw_update"); RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_Screen_redraw_update");
prop= RNA_def_property(srna, "use_play_image_editors", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_play_image_editors", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "redraws_flag", TIME_ALL_IMAGE_WIN); RNA_def_property_boolean_sdna(prop, NULL, "redraws_flag", TIME_ALL_IMAGE_WIN);
RNA_def_property_ui_text(prop, "Image Editors", ""); RNA_def_property_ui_text(prop, "Image Editors", "");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_Screen_redraw_update"); RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_Screen_redraw_update");
prop= RNA_def_property(srna, "use_play_sequence_editors", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_play_sequence_editors", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "redraws_flag", TIME_SEQ); RNA_def_property_boolean_sdna(prop, NULL, "redraws_flag", TIME_SEQ);
RNA_def_property_ui_text(prop, "Sequencer Editors", ""); RNA_def_property_ui_text(prop, "Sequencer Editors", "");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_Screen_redraw_update"); RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_Screen_redraw_update");
prop= RNA_def_property(srna, "use_play_node_editors", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_play_node_editors", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "redraws_flag", TIME_NODES); RNA_def_property_boolean_sdna(prop, NULL, "redraws_flag", TIME_NODES);
RNA_def_property_ui_text(prop, "Node Editors", ""); RNA_def_property_ui_text(prop, "Node Editors", "");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_Screen_redraw_update"); RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_Screen_redraw_update");
prop= RNA_def_property(srna, "use_play_clip_editors", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_play_clip_editors", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "redraws_flag", TIME_CLIPS); RNA_def_property_boolean_sdna(prop, NULL, "redraws_flag", TIME_CLIPS);
RNA_def_property_ui_text(prop, "Clip Editors", ""); RNA_def_property_ui_text(prop, "Clip Editors", "");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_Screen_redraw_update"); RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_Screen_redraw_update");

View File

@@ -79,11 +79,11 @@ static EnumPropertyItem particle_edit_cache_brush_items[] = {
static PointerRNA rna_ParticleEdit_brush_get(PointerRNA *ptr) static PointerRNA rna_ParticleEdit_brush_get(PointerRNA *ptr)
{ {
ParticleEditSettings *pset= (ParticleEditSettings*)ptr->data; ParticleEditSettings *pset = (ParticleEditSettings*)ptr->data;
ParticleBrushData *brush= NULL; ParticleBrushData *brush = NULL;
if(pset->brushtype != PE_BRUSH_NONE) if (pset->brushtype != PE_BRUSH_NONE)
brush= &pset->brush[pset->brushtype]; brush = &pset->brush[pset->brushtype];
return rna_pointer_inherit_refine(ptr, &RNA_ParticleBrush, brush); return rna_pointer_inherit_refine(ptr, &RNA_ParticleBrush, brush);
} }
@@ -95,10 +95,10 @@ static PointerRNA rna_ParticleBrush_curve_get(PointerRNA *ptr)
static void rna_ParticleEdit_redo(Main *UNUSED(bmain), Scene *scene, PointerRNA *UNUSED(ptr)) static void rna_ParticleEdit_redo(Main *UNUSED(bmain), Scene *scene, PointerRNA *UNUSED(ptr))
{ {
Object *ob= (scene->basact)? scene->basact->object: NULL; Object *ob = (scene->basact)? scene->basact->object: NULL;
PTCacheEdit *edit = PE_get_current(scene, ob); PTCacheEdit *edit = PE_get_current(scene, ob);
if(!edit) if (!edit)
return; return;
psys_free_path_cache(edit->psys, edit); psys_free_path_cache(edit->psys, edit);
@@ -106,18 +106,18 @@ static void rna_ParticleEdit_redo(Main *UNUSED(bmain), Scene *scene, PointerRNA
static void rna_ParticleEdit_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *UNUSED(ptr)) static void rna_ParticleEdit_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *UNUSED(ptr))
{ {
Object *ob= (scene->basact)? scene->basact->object: NULL; Object *ob = (scene->basact)? scene->basact->object: NULL;
if(ob) DAG_id_tag_update(&ob->id, OB_RECALC_DATA); if (ob) DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
} }
static void rna_ParticleEdit_tool_set(PointerRNA *ptr, int value) static void rna_ParticleEdit_tool_set(PointerRNA *ptr, int value)
{ {
ParticleEditSettings *pset= (ParticleEditSettings*)ptr->data; ParticleEditSettings *pset = (ParticleEditSettings*)ptr->data;
/* redraw hair completely if weight brush is/was used */ /* redraw hair completely if weight brush is/was used */
if((pset->brushtype == PE_BRUSH_WEIGHT || value == PE_BRUSH_WEIGHT) && pset->scene) { if ((pset->brushtype == PE_BRUSH_WEIGHT || value == PE_BRUSH_WEIGHT) && pset->scene) {
Object *ob = (pset->scene->basact)? pset->scene->basact->object: NULL; Object *ob = (pset->scene->basact)? pset->scene->basact->object: NULL;
if(ob) { if (ob) {
DAG_id_tag_update(&ob->id, OB_RECALC_DATA); DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
WM_main_add_notifier(NC_OBJECT|ND_PARTICLE|NA_EDITED, NULL); WM_main_add_notifier(NC_OBJECT|ND_PARTICLE|NA_EDITED, NULL);
} }
@@ -128,20 +128,20 @@ static void rna_ParticleEdit_tool_set(PointerRNA *ptr, int value)
static EnumPropertyItem *rna_ParticleEdit_tool_itemf(bContext *C, PointerRNA *UNUSED(ptr), static EnumPropertyItem *rna_ParticleEdit_tool_itemf(bContext *C, PointerRNA *UNUSED(ptr),
PropertyRNA *UNUSED(prop), int *UNUSED(free)) PropertyRNA *UNUSED(prop), int *UNUSED(free))
{ {
Scene *scene= CTX_data_scene(C); Scene *scene = CTX_data_scene(C);
Object *ob= (scene->basact)? scene->basact->object: NULL; Object *ob = (scene->basact)? scene->basact->object: NULL;
#if 0 #if 0
PTCacheEdit *edit = PE_get_current(scene, ob); PTCacheEdit *edit = PE_get_current(scene, ob);
ParticleSystem *psys= edit ? edit->psys : NULL; ParticleSystem *psys = edit ? edit->psys : NULL;
#else #else
/* use this rather than PE_get_current() - because the editing cache is /* use this rather than PE_get_current() - because the editing cache is
* dependent on the cache being updated which can happen after this UI * dependent on the cache being updated which can happen after this UI
* draws causing a glitch [#28883] */ * draws causing a glitch [#28883] */
ParticleSystem *psys= psys_get_current(ob); ParticleSystem *psys = psys_get_current(ob);
#endif #endif
if(psys) { if (psys) {
if(psys->flag & PSYS_GLOBAL_HAIR) { if (psys->flag & PSYS_GLOBAL_HAIR) {
return particle_edit_disconnected_hair_brush_items; return particle_edit_disconnected_hair_brush_items;
} }
else { else {
@@ -154,15 +154,15 @@ static EnumPropertyItem *rna_ParticleEdit_tool_itemf(bContext *C, PointerRNA *UN
static int rna_ParticleEdit_editable_get(PointerRNA *ptr) static int rna_ParticleEdit_editable_get(PointerRNA *ptr)
{ {
ParticleEditSettings *pset= (ParticleEditSettings*)ptr->data; ParticleEditSettings *pset = (ParticleEditSettings*)ptr->data;
return (pset->object && pset->scene && PE_get_current(pset->scene, pset->object)); return (pset->object && pset->scene && PE_get_current(pset->scene, pset->object));
} }
static int rna_ParticleEdit_hair_get(PointerRNA *ptr) static int rna_ParticleEdit_hair_get(PointerRNA *ptr)
{ {
ParticleEditSettings *pset= (ParticleEditSettings*)ptr->data; ParticleEditSettings *pset = (ParticleEditSettings*)ptr->data;
if(pset->scene) { if (pset->scene) {
PTCacheEdit *edit = PE_get_current(pset->scene, pset->object); PTCacheEdit *edit = PE_get_current(pset->scene, pset->object);
return (edit && edit->psys); return (edit && edit->psys);
@@ -173,21 +173,21 @@ static int rna_ParticleEdit_hair_get(PointerRNA *ptr)
static int rna_Brush_mode_poll(PointerRNA *ptr, PointerRNA value) static int rna_Brush_mode_poll(PointerRNA *ptr, PointerRNA value)
{ {
Scene *scene= (Scene *)ptr->id.data; Scene *scene = (Scene *)ptr->id.data;
ToolSettings *ts = scene->toolsettings; ToolSettings *ts = scene->toolsettings;
Brush *brush= value.id.data; Brush *brush = value.id.data;
int mode = 0; int mode = 0;
/* check the origin of the Paint struct to see which paint /* check the origin of the Paint struct to see which paint
mode to select from */ mode to select from */
if(ptr->data == &ts->imapaint) if (ptr->data == &ts->imapaint)
mode = OB_MODE_TEXTURE_PAINT; mode = OB_MODE_TEXTURE_PAINT;
else if(ptr->data == ts->sculpt) else if (ptr->data == ts->sculpt)
mode = OB_MODE_SCULPT; mode = OB_MODE_SCULPT;
else if(ptr->data == ts->vpaint) else if (ptr->data == ts->vpaint)
mode = OB_MODE_VERTEX_PAINT; mode = OB_MODE_VERTEX_PAINT;
else if(ptr->data == ts->wpaint) else if (ptr->data == ts->wpaint)
mode = OB_MODE_WEIGHT_PAINT; mode = OB_MODE_WEIGHT_PAINT;
return brush->ob_mode & mode; return brush->ob_mode & mode;
@@ -195,9 +195,9 @@ static int rna_Brush_mode_poll(PointerRNA *ptr, PointerRNA value)
static void rna_Sculpt_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *UNUSED(ptr)) static void rna_Sculpt_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *UNUSED(ptr))
{ {
Object *ob= (scene->basact)? scene->basact->object: NULL; Object *ob = (scene->basact)? scene->basact->object: NULL;
if(ob) { if (ob) {
DAG_id_tag_update(&ob->id, OB_RECALC_DATA); DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
WM_main_add_notifier(NC_OBJECT|ND_MODIFIER, ob); WM_main_add_notifier(NC_OBJECT|ND_MODIFIER, ob);
} }
@@ -210,25 +210,25 @@ static void rna_def_paint(BlenderRNA *brna)
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
srna= RNA_def_struct(brna, "Paint", NULL); srna = RNA_def_struct(brna, "Paint", NULL);
RNA_def_struct_ui_text(srna, "Paint", ""); RNA_def_struct_ui_text(srna, "Paint", "");
/* Global Settings */ /* Global Settings */
prop= RNA_def_property(srna, "brush", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "brush", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Brush_mode_poll"); RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Brush_mode_poll");
RNA_def_property_ui_text(prop, "Brush", "Active Brush"); RNA_def_property_ui_text(prop, "Brush", "Active Brush");
RNA_def_property_update(prop, NC_BRUSH|NA_EDITED, NULL); RNA_def_property_update(prop, NC_BRUSH|NA_EDITED, NULL);
prop= RNA_def_property(srna, "show_brush", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "show_brush", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", PAINT_SHOW_BRUSH); RNA_def_property_boolean_sdna(prop, NULL, "flags", PAINT_SHOW_BRUSH);
RNA_def_property_ui_text(prop, "Show Brush", ""); RNA_def_property_ui_text(prop, "Show Brush", "");
prop= RNA_def_property(srna, "show_brush_on_surface", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "show_brush_on_surface", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", PAINT_SHOW_BRUSH_ON_SURFACE); RNA_def_property_boolean_sdna(prop, NULL, "flags", PAINT_SHOW_BRUSH_ON_SURFACE);
RNA_def_property_ui_text(prop, "Show Brush On Surface", ""); RNA_def_property_ui_text(prop, "Show Brush On Surface", "");
prop= RNA_def_property(srna, "show_low_resolution", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "show_low_resolution", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", PAINT_FAST_NAVIGATE); RNA_def_property_boolean_sdna(prop, NULL, "flags", PAINT_FAST_NAVIGATE);
RNA_def_property_ui_text(prop, "Fast Navigate", "For multires, show low resolution while navigating the view"); RNA_def_property_ui_text(prop, "Fast Navigate", "For multires, show low resolution while navigating the view");
} }
@@ -238,50 +238,50 @@ static void rna_def_sculpt(BlenderRNA *brna)
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
srna= RNA_def_struct(brna, "Sculpt", "Paint"); srna = RNA_def_struct(brna, "Sculpt", "Paint");
RNA_def_struct_ui_text(srna, "Sculpt", ""); RNA_def_struct_ui_text(srna, "Sculpt", "");
prop= RNA_def_property(srna, "radial_symmetry", PROP_INT, PROP_XYZ); prop = RNA_def_property(srna, "radial_symmetry", PROP_INT, PROP_XYZ);
RNA_def_property_int_sdna(prop, NULL, "radial_symm"); RNA_def_property_int_sdna(prop, NULL, "radial_symm");
RNA_def_property_int_default(prop, 1); RNA_def_property_int_default(prop, 1);
RNA_def_property_range(prop, 1, 64); RNA_def_property_range(prop, 1, 64);
RNA_def_property_ui_range(prop, 0, 32, 1, 1); RNA_def_property_ui_range(prop, 0, 32, 1, 1);
RNA_def_property_ui_text(prop, "Radial Symmetry Count X Axis", "Number of times to copy strokes across the surface"); RNA_def_property_ui_text(prop, "Radial Symmetry Count X Axis", "Number of times to copy strokes across the surface");
prop= RNA_def_property(srna, "use_symmetry_x", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_symmetry_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_SYMM_X); RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_SYMM_X);
RNA_def_property_ui_text(prop, "Symmetry X", "Mirror brush across the X axis"); RNA_def_property_ui_text(prop, "Symmetry X", "Mirror brush across the X axis");
prop= RNA_def_property(srna, "use_symmetry_y", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_symmetry_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_SYMM_Y); RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_SYMM_Y);
RNA_def_property_ui_text(prop, "Symmetry Y", "Mirror brush across the Y axis"); RNA_def_property_ui_text(prop, "Symmetry Y", "Mirror brush across the Y axis");
prop= RNA_def_property(srna, "use_symmetry_z", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_symmetry_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_SYMM_Z); RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_SYMM_Z);
RNA_def_property_ui_text(prop, "Symmetry Z", "Mirror brush across the Z axis"); RNA_def_property_ui_text(prop, "Symmetry Z", "Mirror brush across the Z axis");
prop= RNA_def_property(srna, "lock_x", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "lock_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_LOCK_X); RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_LOCK_X);
RNA_def_property_ui_text(prop, "Lock X", "Disallow changes to the X axis of vertices"); RNA_def_property_ui_text(prop, "Lock X", "Disallow changes to the X axis of vertices");
prop= RNA_def_property(srna, "lock_y", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "lock_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_LOCK_Y); RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_LOCK_Y);
RNA_def_property_ui_text(prop, "Lock Y", "Disallow changes to the Y axis of vertices"); RNA_def_property_ui_text(prop, "Lock Y", "Disallow changes to the Y axis of vertices");
prop= RNA_def_property(srna, "lock_z", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "lock_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_LOCK_Z); RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_LOCK_Z);
RNA_def_property_ui_text(prop, "Lock Z", "Disallow changes to the Z axis of vertices"); RNA_def_property_ui_text(prop, "Lock Z", "Disallow changes to the Z axis of vertices");
prop= RNA_def_property(srna, "use_symmetry_feather", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_symmetry_feather", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_SYMMETRY_FEATHER); RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_SYMMETRY_FEATHER);
RNA_def_property_ui_text(prop, "Symmetry Feathering", RNA_def_property_ui_text(prop, "Symmetry Feathering",
"Reduce the strength of the brush where it overlaps symmetrical daubs"); "Reduce the strength of the brush where it overlaps symmetrical daubs");
prop= RNA_def_property(srna, "use_threaded", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_threaded", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_USE_OPENMP); RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_USE_OPENMP);
RNA_def_property_ui_text(prop, "Use OpenMP", "Take advantage of multiple CPU cores to improve sculpting performance"); RNA_def_property_ui_text(prop, "Use OpenMP", "Take advantage of multiple CPU cores to improve sculpting performance");
prop= RNA_def_property(srna, "use_deform_only", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_deform_only", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_ONLY_DEFORM); RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_ONLY_DEFORM);
RNA_def_property_ui_text(prop, "Use Deform Only", RNA_def_property_ui_text(prop, "Use Deform Only",
"Use only deformation modifiers (temporary disable all " "Use only deformation modifiers (temporary disable all "
@@ -294,7 +294,7 @@ static void rna_def_uv_sculpt(BlenderRNA *brna)
{ {
StructRNA *srna; StructRNA *srna;
srna= RNA_def_struct(brna, "UvSculpt", "Paint"); srna = RNA_def_struct(brna, "UvSculpt", "Paint");
RNA_def_struct_ui_text(srna, "UV Sculpting", ""); RNA_def_struct_ui_text(srna, "UV Sculpting", "");
} }
@@ -305,25 +305,25 @@ static void rna_def_vertex_paint(BlenderRNA *brna)
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
srna= RNA_def_struct(brna, "VertexPaint", "Paint"); srna = RNA_def_struct(brna, "VertexPaint", "Paint");
RNA_def_struct_sdna(srna, "VPaint"); RNA_def_struct_sdna(srna, "VPaint");
RNA_def_struct_ui_text(srna, "Vertex Paint", "Properties of vertex and weight paint mode"); RNA_def_struct_ui_text(srna, "Vertex Paint", "Properties of vertex and weight paint mode");
/* vertex paint only */ /* vertex paint only */
prop= RNA_def_property(srna, "use_all_faces", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_all_faces", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", VP_AREA); RNA_def_property_boolean_sdna(prop, NULL, "flag", VP_AREA);
RNA_def_property_ui_text(prop, "All Faces", "Paint on all faces inside brush"); RNA_def_property_ui_text(prop, "All Faces", "Paint on all faces inside brush");
prop= RNA_def_property(srna, "use_normal", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_normal", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", VP_NORMALS); RNA_def_property_boolean_sdna(prop, NULL, "flag", VP_NORMALS);
RNA_def_property_ui_text(prop, "Normals", "Apply the vertex normal before painting"); RNA_def_property_ui_text(prop, "Normals", "Apply the vertex normal before painting");
prop= RNA_def_property(srna, "use_spray", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_spray", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", VP_SPRAY); RNA_def_property_boolean_sdna(prop, NULL, "flag", VP_SPRAY);
RNA_def_property_ui_text(prop, "Spray", "Keep applying paint effect while holding mouse"); RNA_def_property_ui_text(prop, "Spray", "Keep applying paint effect while holding mouse");
/* weight paint only */ /* weight paint only */
prop= RNA_def_property(srna, "use_group_restrict", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_group_restrict", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", VP_ONLYVGROUP); RNA_def_property_boolean_sdna(prop, NULL, "flag", VP_ONLYVGROUP);
RNA_def_property_ui_text(prop, "Restrict", "Restrict painting to verts already apart of the vertex group"); RNA_def_property_ui_text(prop, "Restrict", "Restrict painting to verts already apart of the vertex group");
} }
@@ -333,51 +333,51 @@ static void rna_def_image_paint(BlenderRNA *brna)
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
srna= RNA_def_struct(brna, "ImagePaint", "Paint"); srna = RNA_def_struct(brna, "ImagePaint", "Paint");
RNA_def_struct_sdna(srna, "ImagePaintSettings"); RNA_def_struct_sdna(srna, "ImagePaintSettings");
RNA_def_struct_ui_text(srna, "Image Paint", "Properties of image and texture painting mode"); RNA_def_struct_ui_text(srna, "Image Paint", "Properties of image and texture painting mode");
/* booleans */ /* booleans */
prop= RNA_def_property(srna, "use_projection", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_projection", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", IMAGEPAINT_PROJECT_DISABLE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", IMAGEPAINT_PROJECT_DISABLE);
RNA_def_property_ui_text(prop, "Project Paint", "Use projection painting for improved consistency in the brush strokes"); RNA_def_property_ui_text(prop, "Project Paint", "Use projection painting for improved consistency in the brush strokes");
prop= RNA_def_property(srna, "use_occlude", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_occlude", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", IMAGEPAINT_PROJECT_XRAY); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", IMAGEPAINT_PROJECT_XRAY);
RNA_def_property_ui_text(prop, "Occlude", "Only paint onto the faces directly under the brush (slower)"); RNA_def_property_ui_text(prop, "Occlude", "Only paint onto the faces directly under the brush (slower)");
prop= RNA_def_property(srna, "use_backface_culling", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_backface_culling", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", IMAGEPAINT_PROJECT_BACKFACE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", IMAGEPAINT_PROJECT_BACKFACE);
RNA_def_property_ui_text(prop, "Cull", "Ignore faces pointing away from the view (faster)"); RNA_def_property_ui_text(prop, "Cull", "Ignore faces pointing away from the view (faster)");
prop= RNA_def_property(srna, "use_normal_falloff", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_normal_falloff", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", IMAGEPAINT_PROJECT_FLAT); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", IMAGEPAINT_PROJECT_FLAT);
RNA_def_property_ui_text(prop, "Normal", "Paint most on faces pointing towards the view"); RNA_def_property_ui_text(prop, "Normal", "Paint most on faces pointing towards the view");
prop= RNA_def_property(srna, "use_stencil_layer", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_stencil_layer", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", IMAGEPAINT_PROJECT_LAYER_STENCIL); RNA_def_property_boolean_sdna(prop, NULL, "flag", IMAGEPAINT_PROJECT_LAYER_STENCIL);
RNA_def_property_ui_text(prop, "Stencil Layer", "Set the mask layer from the UV map buttons"); RNA_def_property_ui_text(prop, "Stencil Layer", "Set the mask layer from the UV map buttons");
prop= RNA_def_property(srna, "invert_stencil", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "invert_stencil", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", IMAGEPAINT_PROJECT_LAYER_STENCIL_INV); RNA_def_property_boolean_sdna(prop, NULL, "flag", IMAGEPAINT_PROJECT_LAYER_STENCIL_INV);
RNA_def_property_ui_text(prop, "Invert", "Invert the stencil layer"); RNA_def_property_ui_text(prop, "Invert", "Invert the stencil layer");
prop= RNA_def_property(srna, "use_clone_layer", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_clone_layer", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", IMAGEPAINT_PROJECT_LAYER_CLONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", IMAGEPAINT_PROJECT_LAYER_CLONE);
RNA_def_property_ui_text(prop, "Clone Map", RNA_def_property_ui_text(prop, "Clone Map",
"Use another UV map as clone source, otherwise use the 3D cursor as the source"); "Use another UV map as clone source, otherwise use the 3D cursor as the source");
/* integers */ /* integers */
prop= RNA_def_property(srna, "seam_bleed", PROP_INT, PROP_UNSIGNED); prop = RNA_def_property(srna, "seam_bleed", PROP_INT, PROP_UNSIGNED);
RNA_def_property_ui_range(prop, 0, 8, 0, 0); RNA_def_property_ui_range(prop, 0, 8, 0, 0);
RNA_def_property_ui_text(prop, "Bleed", "Extend paint beyond the faces UVs to reduce seams (in pixels, slower)"); RNA_def_property_ui_text(prop, "Bleed", "Extend paint beyond the faces UVs to reduce seams (in pixels, slower)");
prop= RNA_def_property(srna, "normal_angle", PROP_INT, PROP_UNSIGNED); prop = RNA_def_property(srna, "normal_angle", PROP_INT, PROP_UNSIGNED);
RNA_def_property_range(prop, 0, 90); RNA_def_property_range(prop, 0, 90);
RNA_def_property_ui_text(prop, "Angle", "Paint most on faces pointing towards the view according to this angle"); RNA_def_property_ui_text(prop, "Angle", "Paint most on faces pointing towards the view according to this angle");
prop= RNA_def_int_array(srna, "screen_grab_size", 2, NULL, 0, 0, "screen_grab_size", prop = RNA_def_int_array(srna, "screen_grab_size", 2, NULL, 0, 0, "screen_grab_size",
"Size to capture the image for re-projecting", 0, 0); "Size to capture the image for re-projecting", 0, 0);
RNA_def_property_range(prop, 512, 16384); RNA_def_property_range(prop, 512, 16384);
} }
@@ -403,7 +403,7 @@ static void rna_def_particle_edit(BlenderRNA *brna)
{1, "SHRINK", 0, "Shrink", "Make hairs shorter"}, {1, "SHRINK", 0, "Shrink", "Make hairs shorter"},
{0, NULL, 0, NULL, NULL}}; {0, NULL, 0, NULL, NULL}};
static EnumPropertyItem edit_type_items[]= { static EnumPropertyItem edit_type_items[] = {
{PE_TYPE_PARTICLES, "PARTICLES", 0, "Particles", ""}, {PE_TYPE_PARTICLES, "PARTICLES", 0, "Particles", ""},
{PE_TYPE_SOFTBODY, "SOFT_BODY", 0, "Soft body", ""}, {PE_TYPE_SOFTBODY, "SOFT_BODY", 0, "Soft body", ""},
{PE_TYPE_CLOTH, "CLOTH", 0, "Cloth", ""}, {PE_TYPE_CLOTH, "CLOTH", 0, "Cloth", ""},
@@ -413,142 +413,142 @@ static void rna_def_particle_edit(BlenderRNA *brna)
/* edit */ /* edit */
srna= RNA_def_struct(brna, "ParticleEdit", NULL); srna = RNA_def_struct(brna, "ParticleEdit", NULL);
RNA_def_struct_sdna(srna, "ParticleEditSettings"); RNA_def_struct_sdna(srna, "ParticleEditSettings");
RNA_def_struct_ui_text(srna, "Particle Edit", "Properties of particle editing mode"); RNA_def_struct_ui_text(srna, "Particle Edit", "Properties of particle editing mode");
prop= RNA_def_property(srna, "tool", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "tool", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "brushtype"); RNA_def_property_enum_sdna(prop, NULL, "brushtype");
RNA_def_property_enum_items(prop, particle_edit_hair_brush_items); RNA_def_property_enum_items(prop, particle_edit_hair_brush_items);
RNA_def_property_enum_funcs(prop, NULL, "rna_ParticleEdit_tool_set", "rna_ParticleEdit_tool_itemf"); RNA_def_property_enum_funcs(prop, NULL, "rna_ParticleEdit_tool_set", "rna_ParticleEdit_tool_itemf");
RNA_def_property_ui_text(prop, "Tool", ""); RNA_def_property_ui_text(prop, "Tool", "");
prop= RNA_def_property(srna, "select_mode", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "select_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "selectmode"); RNA_def_property_enum_bitflag_sdna(prop, NULL, "selectmode");
RNA_def_property_enum_items(prop, select_mode_items); RNA_def_property_enum_items(prop, select_mode_items);
RNA_def_property_ui_text(prop, "Selection Mode", "Particle select and display mode"); RNA_def_property_ui_text(prop, "Selection Mode", "Particle select and display mode");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_ParticleEdit_update"); RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_ParticleEdit_update");
prop= RNA_def_property(srna, "use_preserve_length", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_preserve_length", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_KEEP_LENGTHS); RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_KEEP_LENGTHS);
RNA_def_property_ui_text(prop, "Keep Lengths", "Keep path lengths constant"); RNA_def_property_ui_text(prop, "Keep Lengths", "Keep path lengths constant");
prop= RNA_def_property(srna, "use_preserve_root", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_preserve_root", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_LOCK_FIRST); RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_LOCK_FIRST);
RNA_def_property_ui_text(prop, "Keep Root", "Keep root keys unmodified"); RNA_def_property_ui_text(prop, "Keep Root", "Keep root keys unmodified");
prop= RNA_def_property(srna, "use_emitter_deflect", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_emitter_deflect", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_DEFLECT_EMITTER); RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_DEFLECT_EMITTER);
RNA_def_property_ui_text(prop, "Deflect Emitter", "Keep paths from intersecting the emitter"); RNA_def_property_ui_text(prop, "Deflect Emitter", "Keep paths from intersecting the emitter");
prop= RNA_def_property(srna, "emitter_distance", PROP_FLOAT, PROP_UNSIGNED); prop = RNA_def_property(srna, "emitter_distance", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_float_sdna(prop, NULL, "emitterdist"); RNA_def_property_float_sdna(prop, NULL, "emitterdist");
RNA_def_property_ui_range(prop, 0.0f, 10.0f, 10, 3); RNA_def_property_ui_range(prop, 0.0f, 10.0f, 10, 3);
RNA_def_property_ui_text(prop, "Emitter Distance", "Distance to keep particles away from the emitter"); RNA_def_property_ui_text(prop, "Emitter Distance", "Distance to keep particles away from the emitter");
prop= RNA_def_property(srna, "use_fade_time", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_fade_time", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_FADE_TIME); RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_FADE_TIME);
RNA_def_property_ui_text(prop, "Fade Time", "Fade paths and keys further away from current frame"); RNA_def_property_ui_text(prop, "Fade Time", "Fade paths and keys further away from current frame");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_ParticleEdit_update"); RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_ParticleEdit_update");
prop= RNA_def_property(srna, "use_auto_velocity", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_auto_velocity", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_AUTO_VELOCITY); RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_AUTO_VELOCITY);
RNA_def_property_ui_text(prop, "Auto Velocity", "Calculate point velocities automatically"); RNA_def_property_ui_text(prop, "Auto Velocity", "Calculate point velocities automatically");
prop= RNA_def_property(srna, "show_particles", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "show_particles", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_DRAW_PART); RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_DRAW_PART);
RNA_def_property_ui_text(prop, "Draw Particles", "Draw actual particles"); RNA_def_property_ui_text(prop, "Draw Particles", "Draw actual particles");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_ParticleEdit_redo"); RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_ParticleEdit_redo");
prop= RNA_def_property(srna, "use_default_interpolate", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_default_interpolate", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_INTERPOLATE_ADDED); RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_INTERPOLATE_ADDED);
RNA_def_property_ui_text(prop, "Interpolate", "Interpolate new particles from the existing ones"); RNA_def_property_ui_text(prop, "Interpolate", "Interpolate new particles from the existing ones");
prop= RNA_def_property(srna, "default_key_count", PROP_INT, PROP_NONE); prop = RNA_def_property(srna, "default_key_count", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "totaddkey"); RNA_def_property_int_sdna(prop, NULL, "totaddkey");
RNA_def_property_range(prop, 2, SHRT_MAX); RNA_def_property_range(prop, 2, SHRT_MAX);
RNA_def_property_ui_range(prop, 2, 20, 10, 3); RNA_def_property_ui_range(prop, 2, 20, 10, 3);
RNA_def_property_ui_text(prop, "Keys", "How many keys to make new particles with"); RNA_def_property_ui_text(prop, "Keys", "How many keys to make new particles with");
prop= RNA_def_property(srna, "brush", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "brush", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "ParticleBrush"); RNA_def_property_struct_type(prop, "ParticleBrush");
RNA_def_property_pointer_funcs(prop, "rna_ParticleEdit_brush_get", NULL, NULL, NULL); RNA_def_property_pointer_funcs(prop, "rna_ParticleEdit_brush_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Brush", ""); RNA_def_property_ui_text(prop, "Brush", "");
prop= RNA_def_property(srna, "draw_step", PROP_INT, PROP_NONE); prop = RNA_def_property(srna, "draw_step", PROP_INT, PROP_NONE);
RNA_def_property_range(prop, 1, 10); RNA_def_property_range(prop, 1, 10);
RNA_def_property_ui_text(prop, "Steps", "How many steps to draw the path with"); RNA_def_property_ui_text(prop, "Steps", "How many steps to draw the path with");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_ParticleEdit_redo"); RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_ParticleEdit_redo");
prop= RNA_def_property(srna, "fade_frames", PROP_INT, PROP_NONE); prop = RNA_def_property(srna, "fade_frames", PROP_INT, PROP_NONE);
RNA_def_property_range(prop, 1, 100); RNA_def_property_range(prop, 1, 100);
RNA_def_property_ui_text(prop, "Frames", "How many frames to fade"); RNA_def_property_ui_text(prop, "Frames", "How many frames to fade");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_ParticleEdit_update"); RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_ParticleEdit_update");
prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "edittype"); RNA_def_property_enum_sdna(prop, NULL, "edittype");
RNA_def_property_enum_items(prop, edit_type_items); RNA_def_property_enum_items(prop, edit_type_items);
RNA_def_property_ui_text(prop, "Type", ""); RNA_def_property_ui_text(prop, "Type", "");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_ParticleEdit_redo"); RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_ParticleEdit_redo");
prop= RNA_def_property(srna, "is_editable", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "is_editable", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_ParticleEdit_editable_get", NULL); RNA_def_property_boolean_funcs(prop, "rna_ParticleEdit_editable_get", NULL);
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Editable", "A valid edit mode exists"); RNA_def_property_ui_text(prop, "Editable", "A valid edit mode exists");
prop= RNA_def_property(srna, "is_hair", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "is_hair", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_ParticleEdit_hair_get", NULL); RNA_def_property_boolean_funcs(prop, "rna_ParticleEdit_hair_get", NULL);
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Hair", "Editing hair"); RNA_def_property_ui_text(prop, "Hair", "Editing hair");
prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Object", "The edited object"); RNA_def_property_ui_text(prop, "Object", "The edited object");
/* brush */ /* brush */
srna= RNA_def_struct(brna, "ParticleBrush", NULL); srna = RNA_def_struct(brna, "ParticleBrush", NULL);
RNA_def_struct_sdna(srna, "ParticleBrushData"); RNA_def_struct_sdna(srna, "ParticleBrushData");
RNA_def_struct_ui_text(srna, "Particle Brush", "Particle editing brush"); RNA_def_struct_ui_text(srna, "Particle Brush", "Particle editing brush");
prop= RNA_def_property(srna, "size", PROP_INT, PROP_DISTANCE); prop = RNA_def_property(srna, "size", PROP_INT, PROP_DISTANCE);
RNA_def_property_range(prop, 1, SHRT_MAX); RNA_def_property_range(prop, 1, SHRT_MAX);
RNA_def_property_ui_range(prop, 1, 100, 10, 3); RNA_def_property_ui_range(prop, 1, 100, 10, 3);
RNA_def_property_ui_text(prop, "Radius", "Radius of the brush in pixels"); RNA_def_property_ui_text(prop, "Radius", "Radius of the brush in pixels");
prop= RNA_def_property(srna, "strength", PROP_FLOAT, PROP_FACTOR); prop = RNA_def_property(srna, "strength", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_range(prop, 0.001, 1.0); RNA_def_property_range(prop, 0.001, 1.0);
RNA_def_property_ui_text(prop, "Strength", "Brush strength"); RNA_def_property_ui_text(prop, "Strength", "Brush strength");
prop= RNA_def_property(srna, "count", PROP_INT, PROP_NONE); prop = RNA_def_property(srna, "count", PROP_INT, PROP_NONE);
RNA_def_property_range(prop, 1, 1000); RNA_def_property_range(prop, 1, 1000);
RNA_def_property_ui_range(prop, 1, 100, 10, 3); RNA_def_property_ui_range(prop, 1, 100, 10, 3);
RNA_def_property_ui_text(prop, "Count", "Particle count"); RNA_def_property_ui_text(prop, "Count", "Particle count");
prop= RNA_def_property(srna, "steps", PROP_INT, PROP_NONE); prop = RNA_def_property(srna, "steps", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "step"); RNA_def_property_int_sdna(prop, NULL, "step");
RNA_def_property_range(prop, 1, SHRT_MAX); RNA_def_property_range(prop, 1, SHRT_MAX);
RNA_def_property_ui_range(prop, 1, 50, 10, 3); RNA_def_property_ui_range(prop, 1, 50, 10, 3);
RNA_def_property_ui_text(prop, "Steps", "Brush steps"); RNA_def_property_ui_text(prop, "Steps", "Brush steps");
prop= RNA_def_property(srna, "puff_mode", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "puff_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "invert"); RNA_def_property_enum_sdna(prop, NULL, "invert");
RNA_def_property_enum_items(prop, puff_mode); RNA_def_property_enum_items(prop, puff_mode);
RNA_def_property_ui_text(prop, "Puff Mode", ""); RNA_def_property_ui_text(prop, "Puff Mode", "");
prop= RNA_def_property(srna, "use_puff_volume", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_puff_volume", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_BRUSH_DATA_PUFF_VOLUME); RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_BRUSH_DATA_PUFF_VOLUME);
RNA_def_property_ui_text(prop, "Puff Volume", RNA_def_property_ui_text(prop, "Puff Volume",
"Apply puff to unselected end-points (helps maintain hair volume when puffing root)"); "Apply puff to unselected end-points (helps maintain hair volume when puffing root)");
prop= RNA_def_property(srna, "length_mode", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "length_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "invert"); RNA_def_property_enum_sdna(prop, NULL, "invert");
RNA_def_property_enum_items(prop, length_mode); RNA_def_property_enum_items(prop, length_mode);
RNA_def_property_ui_text(prop, "Length Mode", ""); RNA_def_property_ui_text(prop, "Length Mode", "");
/* dummy */ /* dummy */
prop= RNA_def_property(srna, "curve", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "curve", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "CurveMapping"); RNA_def_property_struct_type(prop, "CurveMapping");
RNA_def_property_pointer_funcs(prop, "rna_ParticleBrush_curve_get", NULL, NULL, NULL); RNA_def_property_pointer_funcs(prop, "rna_ParticleBrush_curve_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Curve", ""); RNA_def_property_ui_text(prop, "Curve", "");

View File

@@ -40,7 +40,7 @@
#include "WM_types.h" #include "WM_types.h"
/* Always keep in alphabetical order */ /* Always keep in alphabetical order */
EnumPropertyItem sensor_type_items[] ={ EnumPropertyItem sensor_type_items[] = {
{SENS_ACTUATOR, "ACTUATOR", 0, "Actuator", ""}, {SENS_ACTUATOR, "ACTUATOR", 0, "Actuator", ""},
{SENS_ALWAYS, "ALWAYS", 0, "Always", ""}, {SENS_ALWAYS, "ALWAYS", 0, "Always", ""},
{SENS_ARMATURE, "ARMATURE", 0, "Armature", ""}, {SENS_ARMATURE, "ARMATURE", 0, "Armature", ""},
@@ -65,9 +65,9 @@ EnumPropertyItem sensor_type_items[] ={
static StructRNA* rna_Sensor_refine(struct PointerRNA *ptr) static StructRNA* rna_Sensor_refine(struct PointerRNA *ptr)
{ {
bSensor *sensor= (bSensor*)ptr->data; bSensor *sensor = (bSensor*)ptr->data;
switch(sensor->type) { switch (sensor->type) {
case SENS_ALWAYS: case SENS_ALWAYS:
return &RNA_AlwaysSensor; return &RNA_AlwaysSensor;
case SENS_TOUCH: case SENS_TOUCH:
@@ -105,19 +105,19 @@ static StructRNA* rna_Sensor_refine(struct PointerRNA *ptr)
void rna_Sensor_name_set(PointerRNA *ptr, const char *value) void rna_Sensor_name_set(PointerRNA *ptr, const char *value)
{ {
bSensor *sens= (bSensor *)ptr->data; bSensor *sens = (bSensor *)ptr->data;
BLI_strncpy_utf8(sens->name, value, sizeof(sens->name)); BLI_strncpy_utf8(sens->name, value, sizeof(sens->name));
if (ptr->id.data) { if (ptr->id.data) {
Object *ob= (Object *)ptr->id.data; Object *ob = (Object *)ptr->id.data;
BLI_uniquename(&ob->sensors, sens, "Sensor", '.', offsetof(bSensor, name), sizeof(sens->name)); BLI_uniquename(&ob->sensors, sens, "Sensor", '.', offsetof(bSensor, name), sizeof(sens->name));
} }
} }
static void rna_Sensor_type_set(struct PointerRNA *ptr, int value) static void rna_Sensor_type_set(struct PointerRNA *ptr, int value)
{ {
bSensor *sens= (bSensor *)ptr->data; bSensor *sens = (bSensor *)ptr->data;
if (value != sens->type) if (value != sens->type)
{ {
sens->type = value; sens->type = value;
@@ -141,9 +141,9 @@ static int rna_Sensor_controllers_length(PointerRNA *ptr)
EnumPropertyItem *rna_Sensor_type_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *free) EnumPropertyItem *rna_Sensor_type_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *free)
{ {
EnumPropertyItem *item= NULL; EnumPropertyItem *item = NULL;
Object *ob=NULL; Object *ob = NULL;
int totitem= 0; int totitem = 0;
if (ptr->type == &RNA_Sensor || RNA_struct_is_a(ptr->type, &RNA_Sensor)) { if (ptr->type == &RNA_Sensor || RNA_struct_is_a(ptr->type, &RNA_Sensor)) {
ob = (Object *)ptr->id.data; ob = (Object *)ptr->id.data;
@@ -156,7 +156,7 @@ EnumPropertyItem *rna_Sensor_type_itemf(bContext *C, PointerRNA *ptr, PropertyRN
RNA_enum_items_add_value(&item, &totitem, sensor_type_items, SENS_ALWAYS); RNA_enum_items_add_value(&item, &totitem, sensor_type_items, SENS_ALWAYS);
if (ob != NULL) { if (ob != NULL) {
if (ob->type==OB_ARMATURE) { if (ob->type == OB_ARMATURE) {
RNA_enum_items_add_value(&item, &totitem, sensor_type_items, SENS_ARMATURE); RNA_enum_items_add_value(&item, &totitem, sensor_type_items, SENS_ARMATURE);
} }
} }
@@ -174,14 +174,14 @@ EnumPropertyItem *rna_Sensor_type_itemf(bContext *C, PointerRNA *ptr, PropertyRN
RNA_enum_items_add_value(&item, &totitem, sensor_type_items, SENS_TOUCH); RNA_enum_items_add_value(&item, &totitem, sensor_type_items, SENS_TOUCH);
RNA_enum_item_end(&item, &totitem); RNA_enum_item_end(&item, &totitem);
*free= 1; *free = 1;
return item; return item;
} }
static void rna_Sensor_keyboard_key_set(struct PointerRNA *ptr, int value) static void rna_Sensor_keyboard_key_set(struct PointerRNA *ptr, int value)
{ {
bSensor *sens= (bSensor *)ptr->data; bSensor *sens = (bSensor *)ptr->data;
bKeyboardSensor *ks = (bKeyboardSensor *)sens->data; bKeyboardSensor *ks = (bKeyboardSensor *)sens->data;
if (ISKEYBOARD(value)) if (ISKEYBOARD(value))
@@ -192,7 +192,7 @@ static void rna_Sensor_keyboard_key_set(struct PointerRNA *ptr, int value)
static void rna_Sensor_keyboard_modifier_set(struct PointerRNA *ptr, int value) static void rna_Sensor_keyboard_modifier_set(struct PointerRNA *ptr, int value)
{ {
bSensor *sens= (bSensor *)ptr->data; bSensor *sens = (bSensor *)ptr->data;
bKeyboardSensor *ks = (bKeyboardSensor *)sens->data; bKeyboardSensor *ks = (bKeyboardSensor *)sens->data;
if (ISKEYBOARD(value)) if (ISKEYBOARD(value))
@@ -203,7 +203,7 @@ static void rna_Sensor_keyboard_modifier_set(struct PointerRNA *ptr, int value)
static void rna_Sensor_keyboard_modifier2_set(struct PointerRNA *ptr, int value) static void rna_Sensor_keyboard_modifier2_set(struct PointerRNA *ptr, int value)
{ {
bSensor *sens= (bSensor *)ptr->data; bSensor *sens = (bSensor *)ptr->data;
bKeyboardSensor *ks = (bKeyboardSensor *)sens->data; bKeyboardSensor *ks = (bKeyboardSensor *)sens->data;
if (ISKEYBOARD(value)) if (ISKEYBOARD(value))
@@ -214,40 +214,40 @@ static void rna_Sensor_keyboard_modifier2_set(struct PointerRNA *ptr, int value)
static void rna_Sensor_tap_set(struct PointerRNA *ptr, int value) static void rna_Sensor_tap_set(struct PointerRNA *ptr, int value)
{ {
bSensor *sens= (bSensor*)ptr->data; bSensor *sens = (bSensor*)ptr->data;
sens->tap = value; sens->tap = value;
if(sens->tap == 1) if (sens->tap == 1)
sens->level = 0; sens->level = 0;
} }
static void rna_Sensor_level_set(struct PointerRNA *ptr, int value) static void rna_Sensor_level_set(struct PointerRNA *ptr, int value)
{ {
bSensor *sens= (bSensor*)ptr->data; bSensor *sens = (bSensor*)ptr->data;
sens->level = value; sens->level = value;
if(sens->level == 1) if (sens->level == 1)
sens->tap = 0; sens->tap = 0;
} }
static void rna_Sensor_Armature_update(Main *bmain, Scene *scene, PointerRNA *ptr) static void rna_Sensor_Armature_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{ {
bSensor *sens= (bSensor *)ptr->data; bSensor *sens = (bSensor *)ptr->data;
bArmatureSensor *as = sens->data; bArmatureSensor *as = sens->data;
Object *ob = (Object *)ptr->id.data; Object *ob = (Object *)ptr->id.data;
char *posechannel= as->posechannel; char *posechannel = as->posechannel;
char *constraint= as->constraint; char *constraint = as->constraint;
/* check that bone exist in the active object */ /* check that bone exist in the active object */
if (ob->type == OB_ARMATURE && ob->pose) { if (ob->type == OB_ARMATURE && ob->pose) {
bPoseChannel *pchan; bPoseChannel *pchan;
bPose *pose = ob->pose; bPose *pose = ob->pose;
for (pchan=pose->chanbase.first; pchan; pchan=pchan->next) { for (pchan = pose->chanbase.first; pchan; pchan = pchan->next) {
if (!strcmp(pchan->name, posechannel)) { if (!strcmp(pchan->name, posechannel)) {
/* found it, now look for constraint channel */ /* found it, now look for constraint channel */
bConstraint *con; bConstraint *con;
for (con=pchan->constraints.first; con; con=con->next) { for (con = pchan->constraints.first; con; con = con->next) {
if (!strcmp(con->name, constraint)) { if (!strcmp(con->name, constraint)) {
/* found it, all ok */ /* found it, all ok */
return; return;
@@ -279,69 +279,69 @@ static void rna_def_sensor(BlenderRNA *brna)
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
srna= RNA_def_struct(brna, "Sensor", NULL); srna = RNA_def_struct(brna, "Sensor", NULL);
RNA_def_struct_ui_text(srna, "Sensor", "Game engine logic brick to detect events"); RNA_def_struct_ui_text(srna, "Sensor", "Game engine logic brick to detect events");
RNA_def_struct_sdna(srna, "bSensor"); RNA_def_struct_sdna(srna, "bSensor");
RNA_def_struct_refine_func(srna, "rna_Sensor_refine"); RNA_def_struct_refine_func(srna, "rna_Sensor_refine");
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Name", "Sensor name"); RNA_def_property_ui_text(prop, "Name", "Sensor name");
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Sensor_name_set"); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Sensor_name_set");
RNA_def_struct_name_property(srna, prop); RNA_def_struct_name_property(srna, prop);
RNA_def_property_update(prop, NC_LOGIC, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_enum_items(prop, sensor_type_items); RNA_def_property_enum_items(prop, sensor_type_items);
RNA_def_property_enum_funcs(prop, NULL, "rna_Sensor_type_set", "rna_Sensor_type_itemf"); RNA_def_property_enum_funcs(prop, NULL, "rna_Sensor_type_set", "rna_Sensor_type_itemf");
RNA_def_property_ui_text(prop, "Type", ""); RNA_def_property_ui_text(prop, "Type", "");
RNA_def_property_update(prop, NC_LOGIC, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "pin", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "pin", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SENS_PIN); RNA_def_property_boolean_sdna(prop, NULL, "flag", SENS_PIN);
RNA_def_property_ui_text(prop, "Pinned", "Display when not linked to a visible states controller"); RNA_def_property_ui_text(prop, "Pinned", "Display when not linked to a visible states controller");
RNA_def_property_ui_icon(prop, ICON_UNPINNED, 1); RNA_def_property_ui_icon(prop, ICON_UNPINNED, 1);
RNA_def_property_update(prop, NC_LOGIC, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SENS_SHOW); RNA_def_property_boolean_sdna(prop, NULL, "flag", SENS_SHOW);
RNA_def_property_ui_text(prop, "Expanded", "Set sensor expanded in the user interface"); RNA_def_property_ui_text(prop, "Expanded", "Set sensor expanded in the user interface");
RNA_def_property_ui_icon(prop, ICON_TRIA_RIGHT, 1); RNA_def_property_ui_icon(prop, ICON_TRIA_RIGHT, 1);
RNA_def_property_update(prop, NC_LOGIC, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "invert", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "invert", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_ui_text(prop, "Invert Output", "Invert the level(output) of this sensor"); RNA_def_property_ui_text(prop, "Invert Output", "Invert the level(output) of this sensor");
RNA_def_property_update(prop, NC_LOGIC, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "use_level", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_level", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "level", 1); RNA_def_property_boolean_sdna(prop, NULL, "level", 1);
RNA_def_property_ui_text(prop, "Level", "Level detector, trigger controllers of new states(only applicable upon logic state transition)"); RNA_def_property_ui_text(prop, "Level", "Level detector, trigger controllers of new states(only applicable upon logic state transition)");
RNA_def_property_boolean_funcs(prop, NULL, "rna_Sensor_level_set"); RNA_def_property_boolean_funcs(prop, NULL, "rna_Sensor_level_set");
RNA_def_property_update(prop, NC_LOGIC, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "use_pulse_true_level", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_pulse_true_level", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "pulse", SENS_PULSE_REPEAT); RNA_def_property_boolean_sdna(prop, NULL, "pulse", SENS_PULSE_REPEAT);
RNA_def_property_ui_text(prop, "Pulse True Level", "Activate TRUE level triggering (pulse mode)"); RNA_def_property_ui_text(prop, "Pulse True Level", "Activate TRUE level triggering (pulse mode)");
RNA_def_property_update(prop, NC_LOGIC, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "use_pulse_false_level", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_pulse_false_level", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "pulse", SENS_NEG_PULSE_MODE); RNA_def_property_boolean_sdna(prop, NULL, "pulse", SENS_NEG_PULSE_MODE);
RNA_def_property_ui_text(prop, "Pulse False Level", "Activate FALSE level triggering (pulse mode)"); RNA_def_property_ui_text(prop, "Pulse False Level", "Activate FALSE level triggering (pulse mode)");
RNA_def_property_update(prop, NC_LOGIC, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "frequency", PROP_INT, PROP_NONE); prop = RNA_def_property(srna, "frequency", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "freq"); RNA_def_property_int_sdna(prop, NULL, "freq");
RNA_def_property_ui_text(prop, "Frequency", "Delay between repeated pulses(in logic tics, 0=no delay)"); RNA_def_property_ui_text(prop, "Frequency", "Delay between repeated pulses(in logic tics, 0=no delay)");
RNA_def_property_range(prop, 0, 10000); RNA_def_property_range(prop, 0, 10000);
RNA_def_property_update(prop, NC_LOGIC, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "use_tap", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_tap", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "tap", 1); RNA_def_property_boolean_sdna(prop, NULL, "tap", 1);
RNA_def_property_boolean_funcs(prop, NULL, "rna_Sensor_tap_set"); RNA_def_property_boolean_funcs(prop, NULL, "rna_Sensor_tap_set");
RNA_def_property_ui_text(prop, "Tap", "Trigger controllers only for an instant, even while the sensor remains true"); RNA_def_property_ui_text(prop, "Tap", "Trigger controllers only for an instant, even while the sensor remains true");
RNA_def_property_update(prop, NC_LOGIC, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "controllers", PROP_COLLECTION, PROP_NONE); prop = RNA_def_property(srna, "controllers", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "links", NULL); RNA_def_property_collection_sdna(prop, NULL, "links", NULL);
RNA_def_property_struct_type(prop, "Controller"); RNA_def_property_struct_type(prop, "Controller");
RNA_def_property_ui_text(prop, "Controllers", "The list containing the controllers connected to the sensor"); RNA_def_property_ui_text(prop, "Controllers", "The list containing the controllers connected to the sensor");
@@ -354,7 +354,7 @@ static void rna_def_sensor(BlenderRNA *brna)
static void rna_def_always_sensor(BlenderRNA *brna) static void rna_def_always_sensor(BlenderRNA *brna)
{ {
StructRNA *srna; StructRNA *srna;
srna= RNA_def_struct(brna, "AlwaysSensor", "Sensor"); srna = RNA_def_struct(brna, "AlwaysSensor", "Sensor");
RNA_def_struct_ui_text(srna, "Always Sensor", "Sensor to generate continuous pulses"); RNA_def_struct_ui_text(srna, "Always Sensor", "Sensor to generate continuous pulses");
} }
@@ -363,22 +363,22 @@ static void rna_def_near_sensor(BlenderRNA *brna)
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
srna= RNA_def_struct(brna, "NearSensor", "Sensor"); srna = RNA_def_struct(brna, "NearSensor", "Sensor");
RNA_def_struct_ui_text(srna , "Near Sensor", "Sensor to detect nearby objects"); RNA_def_struct_ui_text(srna , "Near Sensor", "Sensor to detect nearby objects");
RNA_def_struct_sdna_from(srna, "bNearSensor", "data"); RNA_def_struct_sdna_from(srna, "bNearSensor", "data");
prop= RNA_def_property(srna, "property", PROP_STRING, PROP_NONE); prop = RNA_def_property(srna, "property", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "name"); RNA_def_property_string_sdna(prop, NULL, "name");
RNA_def_property_ui_text(prop, "Property", "Only look for objects with this property (blank = all objects)"); RNA_def_property_ui_text(prop, "Property", "Only look for objects with this property (blank = all objects)");
RNA_def_property_update(prop, NC_LOGIC, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "distance", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "dist"); RNA_def_property_float_sdna(prop, NULL, "dist");
RNA_def_property_ui_text(prop, "Distance", "Trigger distance"); RNA_def_property_ui_text(prop, "Distance", "Trigger distance");
RNA_def_property_range(prop, 0.0f, 10000.0f); RNA_def_property_range(prop, 0.0f, 10000.0f);
RNA_def_property_update(prop, NC_LOGIC, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "reset_distance", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "reset_distance", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "resetdist"); RNA_def_property_float_sdna(prop, NULL, "resetdist");
RNA_def_property_ui_text(prop, "Reset Distance", "The distance where the sensor forgets the actor"); RNA_def_property_ui_text(prop, "Reset Distance", "The distance where the sensor forgets the actor");
RNA_def_property_range(prop, 0.0f, 10000.0f); RNA_def_property_range(prop, 0.0f, 10000.0f);
@@ -390,7 +390,7 @@ static void rna_def_mouse_sensor(BlenderRNA *brna)
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
static EnumPropertyItem mouse_event_items[] ={ static EnumPropertyItem mouse_event_items[] = {
{BL_SENS_MOUSE_LEFT_BUTTON, "LEFTCLICK", 0, "Left Button", ""}, {BL_SENS_MOUSE_LEFT_BUTTON, "LEFTCLICK", 0, "Left Button", ""},
{BL_SENS_MOUSE_MIDDLE_BUTTON, "MIDDLECLICK", 0, "Middle Button", ""}, {BL_SENS_MOUSE_MIDDLE_BUTTON, "MIDDLECLICK", 0, "Middle Button", ""},
{BL_SENS_MOUSE_RIGHT_BUTTON, "RIGHTCLICK", 0, "Right Button", ""}, {BL_SENS_MOUSE_RIGHT_BUTTON, "RIGHTCLICK", 0, "Right Button", ""},
@@ -401,11 +401,11 @@ static void rna_def_mouse_sensor(BlenderRNA *brna)
{BL_SENS_MOUSE_MOUSEOVER_ANY, "MOUSEOVERANY", 0, "Mouse Over Any", ""}, {BL_SENS_MOUSE_MOUSEOVER_ANY, "MOUSEOVERANY", 0, "Mouse Over Any", ""},
{0, NULL, 0, NULL, NULL}}; {0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "MouseSensor", "Sensor"); srna = RNA_def_struct(brna, "MouseSensor", "Sensor");
RNA_def_struct_ui_text(srna, "Mouse Sensor", "Sensor to detect mouse events"); RNA_def_struct_ui_text(srna, "Mouse Sensor", "Sensor to detect mouse events");
RNA_def_struct_sdna_from(srna, "bMouseSensor", "data"); RNA_def_struct_sdna_from(srna, "bMouseSensor", "data");
prop= RNA_def_property(srna, "mouse_event", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "mouse_event", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "type"); RNA_def_property_enum_sdna(prop, NULL, "type");
RNA_def_property_enum_items(prop, mouse_event_items); RNA_def_property_enum_items(prop, mouse_event_items);
RNA_def_property_ui_text(prop, "Mouse Event", "Type of event this mouse sensor should trigger on"); RNA_def_property_ui_text(prop, "Mouse Event", "Type of event this mouse sensor should trigger on");
@@ -417,11 +417,11 @@ static void rna_def_touch_sensor(BlenderRNA *brna)
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
srna= RNA_def_struct(brna, "TouchSensor", "Sensor"); srna = RNA_def_struct(brna, "TouchSensor", "Sensor");
RNA_def_struct_ui_text(srna, "Touch Sensor", "Sensor to detect objects colliding with the current object"); RNA_def_struct_ui_text(srna, "Touch Sensor", "Sensor to detect objects colliding with the current object");
RNA_def_struct_sdna_from(srna, "bTouchSensor", "data"); RNA_def_struct_sdna_from(srna, "bTouchSensor", "data");
prop= RNA_def_property(srna, "material", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "material", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Material"); RNA_def_property_struct_type(prop, "Material");
RNA_def_property_pointer_sdna(prop, NULL, "ma"); RNA_def_property_pointer_sdna(prop, NULL, "ma");
RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_flag(prop, PROP_EDITABLE);
@@ -436,42 +436,42 @@ static void rna_def_keyboard_sensor(BlenderRNA *brna)
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
srna= RNA_def_struct(brna, "KeyboardSensor", "Sensor"); srna = RNA_def_struct(brna, "KeyboardSensor", "Sensor");
RNA_def_struct_ui_text(srna, "Keyboard Sensor", "Sensor to detect keyboard events"); RNA_def_struct_ui_text(srna, "Keyboard Sensor", "Sensor to detect keyboard events");
RNA_def_struct_sdna_from(srna, "bKeyboardSensor", "data"); RNA_def_struct_sdna_from(srna, "bKeyboardSensor", "data");
prop= RNA_def_property(srna, "key", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "key", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "key"); RNA_def_property_enum_sdna(prop, NULL, "key");
RNA_def_property_enum_items(prop, event_type_items); RNA_def_property_enum_items(prop, event_type_items);
RNA_def_property_enum_funcs(prop, NULL, "rna_Sensor_keyboard_key_set", NULL); RNA_def_property_enum_funcs(prop, NULL, "rna_Sensor_keyboard_key_set", NULL);
RNA_def_property_ui_text(prop, "Key", ""); RNA_def_property_ui_text(prop, "Key", "");
RNA_def_property_update(prop, NC_LOGIC, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "modifier_key_1", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "modifier_key_1", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "qual"); RNA_def_property_enum_sdna(prop, NULL, "qual");
RNA_def_property_enum_items(prop, event_type_items); RNA_def_property_enum_items(prop, event_type_items);
RNA_def_property_enum_funcs(prop, NULL, "rna_Sensor_keyboard_modifier_set", NULL); RNA_def_property_enum_funcs(prop, NULL, "rna_Sensor_keyboard_modifier_set", NULL);
RNA_def_property_ui_text(prop, "Modifier Key", "Modifier key code"); RNA_def_property_ui_text(prop, "Modifier Key", "Modifier key code");
RNA_def_property_update(prop, NC_LOGIC, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "modifier_key_2", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "modifier_key_2", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "qual2"); RNA_def_property_enum_sdna(prop, NULL, "qual2");
RNA_def_property_enum_items(prop, event_type_items); RNA_def_property_enum_items(prop, event_type_items);
RNA_def_property_enum_funcs(prop, NULL, "rna_Sensor_keyboard_modifier2_set", NULL); RNA_def_property_enum_funcs(prop, NULL, "rna_Sensor_keyboard_modifier2_set", NULL);
RNA_def_property_ui_text(prop, "Second Modifier Key", "Modifier key code"); RNA_def_property_ui_text(prop, "Second Modifier Key", "Modifier key code");
RNA_def_property_update(prop, NC_LOGIC, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "target", PROP_STRING, PROP_NONE); prop = RNA_def_property(srna, "target", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "targetName"); RNA_def_property_string_sdna(prop, NULL, "targetName");
RNA_def_property_ui_text(prop, "Target", "Property that receives the keystrokes in case a string is logged"); RNA_def_property_ui_text(prop, "Target", "Property that receives the keystrokes in case a string is logged");
RNA_def_property_update(prop, NC_LOGIC, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "log", PROP_STRING, PROP_NONE); prop = RNA_def_property(srna, "log", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "toggleName"); RNA_def_property_string_sdna(prop, NULL, "toggleName");
RNA_def_property_ui_text(prop, "Log Toggle", "Property that indicates whether to log keystrokes as a string"); RNA_def_property_ui_text(prop, "Log Toggle", "Property that indicates whether to log keystrokes as a string");
RNA_def_property_update(prop, NC_LOGIC, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "use_all_keys", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_all_keys", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "type", 1); RNA_def_property_boolean_sdna(prop, NULL, "type", 1);
RNA_def_property_ui_text(prop, "All Keys", "Trigger this sensor on any keystroke"); RNA_def_property_ui_text(prop, "All Keys", "Trigger this sensor on any keystroke");
RNA_def_property_update(prop, NC_LOGIC, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL);
@@ -481,7 +481,7 @@ static void rna_def_property_sensor(BlenderRNA *brna)
{ {
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
static EnumPropertyItem prop_type_items[] ={ static EnumPropertyItem prop_type_items[] = {
{SENS_PROP_EQUAL, "PROPEQUAL", 0, "Equal", ""}, {SENS_PROP_EQUAL, "PROPEQUAL", 0, "Equal", ""},
{SENS_PROP_NEQUAL, "PROPNEQUAL", 0, "Not Equal", ""}, {SENS_PROP_NEQUAL, "PROPNEQUAL", 0, "Not Equal", ""},
{SENS_PROP_INTERVAL, "PROPINTERVAL", 0, "Interval", ""}, {SENS_PROP_INTERVAL, "PROPINTERVAL", 0, "Interval", ""},
@@ -489,32 +489,32 @@ static void rna_def_property_sensor(BlenderRNA *brna)
/* {SENS_PROP_EXPRESSION, "PROPEXPRESSION", 0, "Expression", ""}, NOT_USED_IN_UI */ /* {SENS_PROP_EXPRESSION, "PROPEXPRESSION", 0, "Expression", ""}, NOT_USED_IN_UI */
{0, NULL, 0, NULL, NULL}}; {0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "PropertySensor", "Sensor"); srna = RNA_def_struct(brna, "PropertySensor", "Sensor");
RNA_def_struct_ui_text(srna, "Property Sensor", "Sensor to detect values and changes in values of properties"); RNA_def_struct_ui_text(srna, "Property Sensor", "Sensor to detect values and changes in values of properties");
RNA_def_struct_sdna_from(srna, "bPropertySensor", "data"); RNA_def_struct_sdna_from(srna, "bPropertySensor", "data");
prop= RNA_def_property(srna, "evaluation_type", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "evaluation_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "type"); RNA_def_property_enum_sdna(prop, NULL, "type");
RNA_def_property_enum_items(prop, prop_type_items); RNA_def_property_enum_items(prop, prop_type_items);
RNA_def_property_ui_text(prop, "Evaluation Type", "Type of property evaluation"); RNA_def_property_ui_text(prop, "Evaluation Type", "Type of property evaluation");
RNA_def_property_update(prop, NC_LOGIC, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "property", PROP_STRING, PROP_NONE); prop = RNA_def_property(srna, "property", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "name"); RNA_def_property_string_sdna(prop, NULL, "name");
RNA_def_property_ui_text(prop, "Property", ""); RNA_def_property_ui_text(prop, "Property", "");
RNA_def_property_update(prop, NC_LOGIC, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "value", PROP_STRING, PROP_NONE); prop = RNA_def_property(srna, "value", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "value"); RNA_def_property_string_sdna(prop, NULL, "value");
RNA_def_property_ui_text(prop, "Value", "Check for this value in types in Equal or Not Equal types"); RNA_def_property_ui_text(prop, "Value", "Check for this value in types in Equal or Not Equal types");
RNA_def_property_update(prop, NC_LOGIC, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "value_min", PROP_STRING, PROP_NONE); prop = RNA_def_property(srna, "value_min", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "value"); RNA_def_property_string_sdna(prop, NULL, "value");
RNA_def_property_ui_text(prop, "Minimum Value", "Minimum value in Interval type"); RNA_def_property_ui_text(prop, "Minimum Value", "Minimum value in Interval type");
RNA_def_property_update(prop, NC_LOGIC, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "value_max", PROP_STRING, PROP_NONE); prop = RNA_def_property(srna, "value_max", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "maxvalue"); RNA_def_property_string_sdna(prop, NULL, "maxvalue");
RNA_def_property_ui_text(prop, "Maximum Value", "Maximum value in Interval type"); RNA_def_property_ui_text(prop, "Maximum Value", "Maximum value in Interval type");
RNA_def_property_update(prop, NC_LOGIC, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL);
@@ -524,7 +524,7 @@ static void rna_def_armature_sensor(BlenderRNA *brna)
{ {
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
static EnumPropertyItem prop_type_items[] ={ static EnumPropertyItem prop_type_items[] = {
{SENS_ARM_STATE_CHANGED, "STATECHG", 0, "State Changed", ""}, {SENS_ARM_STATE_CHANGED, "STATECHG", 0, "State Changed", ""},
{SENS_ARM_LIN_ERROR_BELOW, "LINERRORBELOW", 0, "Lin error below", ""}, {SENS_ARM_LIN_ERROR_BELOW, "LINERRORBELOW", 0, "Lin error below", ""},
{SENS_ARM_LIN_ERROR_ABOVE, "LINERRORABOVE", 0, "Lin error above", ""}, {SENS_ARM_LIN_ERROR_ABOVE, "LINERRORABOVE", 0, "Lin error above", ""},
@@ -532,27 +532,27 @@ static void rna_def_armature_sensor(BlenderRNA *brna)
{SENS_ARM_ROT_ERROR_ABOVE, "ROTERRORABOVE", 0, "Rot error above", ""}, {SENS_ARM_ROT_ERROR_ABOVE, "ROTERRORABOVE", 0, "Rot error above", ""},
{0, NULL, 0, NULL, NULL}}; {0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "ArmatureSensor", "Sensor"); srna = RNA_def_struct(brna, "ArmatureSensor", "Sensor");
RNA_def_struct_ui_text(srna, "Armature Sensor", "Sensor to detect values and changes in values of IK solver"); RNA_def_struct_ui_text(srna, "Armature Sensor", "Sensor to detect values and changes in values of IK solver");
RNA_def_struct_sdna_from(srna, "bArmatureSensor", "data"); RNA_def_struct_sdna_from(srna, "bArmatureSensor", "data");
prop= RNA_def_property(srna, "test_type", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "test_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "type"); RNA_def_property_enum_sdna(prop, NULL, "type");
RNA_def_property_enum_items(prop, prop_type_items); RNA_def_property_enum_items(prop, prop_type_items);
RNA_def_property_ui_text(prop, "Test", "Type of value and test"); RNA_def_property_ui_text(prop, "Test", "Type of value and test");
RNA_def_property_update(prop, NC_LOGIC, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "bone", PROP_STRING, PROP_NONE); prop = RNA_def_property(srna, "bone", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "posechannel"); RNA_def_property_string_sdna(prop, NULL, "posechannel");
RNA_def_property_ui_text(prop, "Bone Name", "Identify the bone to check value from"); RNA_def_property_ui_text(prop, "Bone Name", "Identify the bone to check value from");
RNA_def_property_update(prop, NC_LOGIC, "rna_Sensor_Armature_update"); RNA_def_property_update(prop, NC_LOGIC, "rna_Sensor_Armature_update");
prop= RNA_def_property(srna, "constraint", PROP_STRING, PROP_NONE); prop = RNA_def_property(srna, "constraint", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "constraint"); RNA_def_property_string_sdna(prop, NULL, "constraint");
RNA_def_property_ui_text(prop, "Constraint Name", "Identify the bone constraint to check value from"); RNA_def_property_ui_text(prop, "Constraint Name", "Identify the bone constraint to check value from");
RNA_def_property_update(prop, NC_LOGIC, "rna_Sensor_Armature_update"); RNA_def_property_update(prop, NC_LOGIC, "rna_Sensor_Armature_update");
prop= RNA_def_property(srna, "value", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "value", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "value"); RNA_def_property_float_sdna(prop, NULL, "value");
RNA_def_property_ui_text(prop, "Compare Value", "Value to be used in comparison"); RNA_def_property_ui_text(prop, "Compare Value", "Value to be used in comparison");
RNA_def_property_update(prop, NC_LOGIC, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL);
@@ -563,12 +563,12 @@ static void rna_def_actuator_sensor(BlenderRNA *brna)
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
srna= RNA_def_struct(brna, "ActuatorSensor", "Sensor"); srna = RNA_def_struct(brna, "ActuatorSensor", "Sensor");
RNA_def_struct_ui_text(srna, "Actuator Sensor", "Sensor to detect state modifications of actuators"); RNA_def_struct_ui_text(srna, "Actuator Sensor", "Sensor to detect state modifications of actuators");
RNA_def_struct_sdna_from(srna, "bActuatorSensor", "data"); RNA_def_struct_sdna_from(srna, "bActuatorSensor", "data");
// XXX if eventually have Logics using RNA 100%, we could use the actuator datablock isntead of its name /* XXX if eventually have Logics using RNA 100%, we could use the actuator datablock isntead of its name */
prop= RNA_def_property(srna, "actuator", PROP_STRING, PROP_NONE); prop = RNA_def_property(srna, "actuator", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "name"); RNA_def_property_string_sdna(prop, NULL, "name");
RNA_def_property_ui_text(prop, "Actuator", "Actuator name, actuator active state modifications will be detected"); RNA_def_property_ui_text(prop, "Actuator", "Actuator name, actuator active state modifications will be detected");
RNA_def_property_update(prop, NC_LOGIC, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL);
@@ -579,21 +579,21 @@ static void rna_def_delay_sensor(BlenderRNA *brna)
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
srna= RNA_def_struct(brna, "DelaySensor", "Sensor"); srna = RNA_def_struct(brna, "DelaySensor", "Sensor");
RNA_def_struct_ui_text(srna, "Delay Sensor", "Sensor to send delayed events"); RNA_def_struct_ui_text(srna, "Delay Sensor", "Sensor to send delayed events");
RNA_def_struct_sdna_from(srna, "bDelaySensor", "data"); RNA_def_struct_sdna_from(srna, "bDelaySensor", "data");
prop= RNA_def_property(srna, "delay", PROP_INT, PROP_NONE); prop = RNA_def_property(srna, "delay", PROP_INT, PROP_NONE);
RNA_def_property_ui_text(prop, "Delay", "Delay in number of logic tics before the positive trigger (default 60 per second)"); RNA_def_property_ui_text(prop, "Delay", "Delay in number of logic tics before the positive trigger (default 60 per second)");
RNA_def_property_range(prop, 0, 5000); RNA_def_property_range(prop, 0, 5000);
RNA_def_property_update(prop, NC_LOGIC, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "duration", PROP_INT, PROP_NONE); prop = RNA_def_property(srna, "duration", PROP_INT, PROP_NONE);
RNA_def_property_ui_text(prop, "Duration", "If >0, delay in number of logic tics before the negative trigger following the positive trigger"); RNA_def_property_ui_text(prop, "Duration", "If >0, delay in number of logic tics before the negative trigger following the positive trigger");
RNA_def_property_range(prop, 0, 5000); RNA_def_property_range(prop, 0, 5000);
RNA_def_property_update(prop, NC_LOGIC, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "use_repeat", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_repeat", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SENS_DELAY_REPEAT); RNA_def_property_boolean_sdna(prop, NULL, "flag", SENS_DELAY_REPEAT);
RNA_def_property_ui_text(prop, "Repeat", "Toggle repeat option (if selected, the sensor restarts after Delay+Duration logic tics)"); RNA_def_property_ui_text(prop, "Repeat", "Toggle repeat option (if selected, the sensor restarts after Delay+Duration logic tics)");
RNA_def_property_update(prop, NC_LOGIC, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL);
@@ -604,46 +604,47 @@ static void rna_def_collision_sensor(BlenderRNA *brna)
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
srna= RNA_def_struct(brna, "CollisionSensor", "Sensor"); srna = RNA_def_struct(brna, "CollisionSensor", "Sensor");
RNA_def_struct_ui_text(srna, "Collision Sensor", "Sensor to detect objects colliding with the current object, with more settings than the Touch sensor"); RNA_def_struct_ui_text(srna, "Collision Sensor", "Sensor to detect objects colliding with the current object, with more settings than the Touch sensor");
RNA_def_struct_sdna_from(srna, "bCollisionSensor", "data"); RNA_def_struct_sdna_from(srna, "bCollisionSensor", "data");
prop= RNA_def_property(srna, "use_pulse", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_pulse", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", SENS_COLLISION_PULSE); RNA_def_property_boolean_sdna(prop, NULL, "mode", SENS_COLLISION_PULSE);
RNA_def_property_ui_text(prop, "Pulse", "Change to the set of colliding objects generates pulse"); RNA_def_property_ui_text(prop, "Pulse", "Change to the set of colliding objects generates pulse");
RNA_def_property_update(prop, NC_LOGIC, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "use_material", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_material", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", SENS_COLLISION_MATERIAL); RNA_def_property_boolean_sdna(prop, NULL, "mode", SENS_COLLISION_MATERIAL);
RNA_def_property_ui_text(prop, "M/P", "Toggle collision on material or property"); RNA_def_property_ui_text(prop, "M/P", "Toggle collision on material or property");
RNA_def_property_update(prop, NC_LOGIC, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "property", PROP_STRING, PROP_NONE); prop = RNA_def_property(srna, "property", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "name"); RNA_def_property_string_sdna(prop, NULL, "name");
RNA_def_property_ui_text(prop, "Property", "Only look for objects with this property (blank = all objects)"); RNA_def_property_ui_text(prop, "Property", "Only look for objects with this property (blank = all objects)");
RNA_def_property_update(prop, NC_LOGIC, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL);
//XXX to make a setFunction to create a lookup with all materials in Blend File (not only this object mat.) /*XXX to make a setFunction to create a lookup with all materials in Blend File (not only this object mat.) */
prop= RNA_def_property(srna, "material", PROP_STRING, PROP_NONE); prop = RNA_def_property(srna, "material", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "materialName"); RNA_def_property_string_sdna(prop, NULL, "materialName");
RNA_def_property_ui_text(prop, "Material", "Only look for objects with this material (blank = all objects)"); RNA_def_property_ui_text(prop, "Material", "Only look for objects with this material (blank = all objects)");
RNA_def_property_update(prop, NC_LOGIC, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL);
/*//XXX either use a datablock look up to store the string name (material) #if 0
// or to do a doversion and use a material pointer. /* XXX either use a datablock look up to store the string name (material)
prop= RNA_def_property(srna, "material", PROP_POINTER, PROP_NONE); * or to do a doversion and use a material pointer. */
prop = RNA_def_property(srna, "material", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Material"); RNA_def_property_struct_type(prop, "Material");
RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_pointer_sdna(prop, NULL, "ma"); RNA_def_property_pointer_sdna(prop, NULL, "ma");
RNA_def_property_ui_text(prop, "Material", "Only look for objects with this material (blank = all objects)"); RNA_def_property_ui_text(prop, "Material", "Only look for objects with this material (blank = all objects)");
*/ #endif
} }
static void rna_def_radar_sensor(BlenderRNA *brna) static void rna_def_radar_sensor(BlenderRNA *brna)
{ {
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
static EnumPropertyItem axis_items[] ={ static EnumPropertyItem axis_items[] = {
{SENS_RADAR_X_AXIS, "XAXIS", 0, "+X axis", ""}, {SENS_RADAR_X_AXIS, "XAXIS", 0, "+X axis", ""},
{SENS_RADAR_Y_AXIS, "YAXIS", 0, "+Y axis", ""}, {SENS_RADAR_Y_AXIS, "YAXIS", 0, "+Y axis", ""},
{SENS_RADAR_Z_AXIS, "ZAXIS", 0, "+Z axis", ""}, {SENS_RADAR_Z_AXIS, "ZAXIS", 0, "+Z axis", ""},
@@ -652,27 +653,27 @@ static void rna_def_radar_sensor(BlenderRNA *brna)
{SENS_RADAR_NEG_Z_AXIS, "NEGZAXIS", 0, "-Z axis", ""}, {SENS_RADAR_NEG_Z_AXIS, "NEGZAXIS", 0, "-Z axis", ""},
{0, NULL, 0, NULL, NULL}}; {0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "RadarSensor", "Sensor"); srna = RNA_def_struct(brna, "RadarSensor", "Sensor");
RNA_def_struct_ui_text(srna, "Radar Sensor", "Sensor to detect objects in a cone shaped radar emanating from the current object"); RNA_def_struct_ui_text(srna, "Radar Sensor", "Sensor to detect objects in a cone shaped radar emanating from the current object");
RNA_def_struct_sdna_from(srna, "bRadarSensor", "data"); RNA_def_struct_sdna_from(srna, "bRadarSensor", "data");
prop= RNA_def_property(srna, "property", PROP_STRING, PROP_NONE); prop = RNA_def_property(srna, "property", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "name"); RNA_def_property_string_sdna(prop, NULL, "name");
RNA_def_property_ui_text(prop, "Property", "Only look for objects with this property (blank = all objects)"); RNA_def_property_ui_text(prop, "Property", "Only look for objects with this property (blank = all objects)");
RNA_def_property_update(prop, NC_LOGIC, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "axis", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "axis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, axis_items); RNA_def_property_enum_items(prop, axis_items);
RNA_def_property_ui_text(prop, "Axis", "Along which axis the radar cone is cast"); RNA_def_property_ui_text(prop, "Axis", "Along which axis the radar cone is cast");
RNA_def_property_update(prop, NC_LOGIC, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL);
//XXX TODO - use radians internally then change to PROP_ANGLE /*XXX TODO - use radians internally then change to PROP_ANGLE */
prop= RNA_def_property(srna, "angle", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "angle", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0, 179.9); RNA_def_property_range(prop, 0.0, 179.9);
RNA_def_property_ui_text(prop, "Angle", "Opening angle of the radar cone (in degrees)"); RNA_def_property_ui_text(prop, "Angle", "Opening angle of the radar cone (in degrees)");
RNA_def_property_update(prop, NC_LOGIC, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "distance", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "range"); RNA_def_property_float_sdna(prop, NULL, "range");
RNA_def_property_range(prop, 0.0, 10000.0); RNA_def_property_range(prop, 0.0, 10000.0);
RNA_def_property_ui_text(prop, "Distance", "Depth of the radar cone"); RNA_def_property_ui_text(prop, "Distance", "Depth of the radar cone");
@@ -684,11 +685,11 @@ static void rna_def_random_sensor(BlenderRNA *brna)
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
srna= RNA_def_struct(brna, "RandomSensor", "Sensor"); srna = RNA_def_struct(brna, "RandomSensor", "Sensor");
RNA_def_struct_ui_text(srna, "Random Sensor", "Sensor to send random events"); RNA_def_struct_ui_text(srna, "Random Sensor", "Sensor to send random events");
RNA_def_struct_sdna_from(srna, "bRandomSensor", "data"); RNA_def_struct_sdna_from(srna, "bRandomSensor", "data");
prop= RNA_def_property(srna, "seed", PROP_INT, PROP_NONE); prop = RNA_def_property(srna, "seed", PROP_INT, PROP_NONE);
RNA_def_property_range(prop, 0, 1000); RNA_def_property_range(prop, 0, 1000);
RNA_def_property_ui_text(prop, "Seed", "Initial seed of the generator (choose 0 for not random)"); RNA_def_property_ui_text(prop, "Seed", "Initial seed of the generator (choose 0 for not random)");
RNA_def_property_update(prop, NC_LOGIC, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL);
@@ -698,7 +699,7 @@ static void rna_def_ray_sensor(BlenderRNA *brna)
{ {
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
static EnumPropertyItem axis_items[] ={ static EnumPropertyItem axis_items[] = {
{SENS_RAY_X_AXIS, "XAXIS", 0, "+X axis", ""}, {SENS_RAY_X_AXIS, "XAXIS", 0, "+X axis", ""},
{SENS_RAY_Y_AXIS, "YAXIS", 0, "+Y axis", ""}, {SENS_RAY_Y_AXIS, "YAXIS", 0, "+Y axis", ""},
{SENS_RAY_Z_AXIS, "ZAXIS", 0, "+Z axis", ""}, {SENS_RAY_Z_AXIS, "ZAXIS", 0, "+Z axis", ""},
@@ -707,51 +708,52 @@ static void rna_def_ray_sensor(BlenderRNA *brna)
{SENS_RAY_NEG_Z_AXIS, "NEGZAXIS", 0, "-Z axis", ""}, {SENS_RAY_NEG_Z_AXIS, "NEGZAXIS", 0, "-Z axis", ""},
{0, NULL, 0, NULL, NULL}}; {0, NULL, 0, NULL, NULL}};
static const EnumPropertyItem prop_ray_type_items[]= { static const EnumPropertyItem prop_ray_type_items[] = {
{SENS_COLLISION_PROPERTY, "PROPERTY", ICON_LOGIC, "Property", "Use a material for ray intersections"}, {SENS_COLLISION_PROPERTY, "PROPERTY", ICON_LOGIC, "Property", "Use a material for ray intersections"},
{SENS_COLLISION_MATERIAL, "MATERIAL", ICON_MATERIAL_DATA, "Material", "Use a property for ray intersections"}, {SENS_COLLISION_MATERIAL, "MATERIAL", ICON_MATERIAL_DATA, "Material", "Use a property for ray intersections"},
{0, NULL, 0, NULL, NULL}}; {0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "RaySensor", "Sensor"); srna = RNA_def_struct(brna, "RaySensor", "Sensor");
RNA_def_struct_ui_text(srna, "Ray Sensor", "Sensor to detect intersections with a ray emanating from the current object"); RNA_def_struct_ui_text(srna, "Ray Sensor", "Sensor to detect intersections with a ray emanating from the current object");
RNA_def_struct_sdna_from(srna, "bRaySensor", "data"); RNA_def_struct_sdna_from(srna, "bRaySensor", "data");
prop= RNA_def_property(srna, "ray_type", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "ray_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "mode"); RNA_def_property_enum_bitflag_sdna(prop, NULL, "mode");
RNA_def_property_enum_items(prop, prop_ray_type_items); RNA_def_property_enum_items(prop, prop_ray_type_items);
RNA_def_property_ui_text(prop, "Ray Type", "Toggle collision on material or property"); RNA_def_property_ui_text(prop, "Ray Type", "Toggle collision on material or property");
RNA_def_property_update(prop, NC_LOGIC, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "property", PROP_STRING, PROP_NONE); prop = RNA_def_property(srna, "property", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "propname"); RNA_def_property_string_sdna(prop, NULL, "propname");
RNA_def_property_ui_text(prop, "Property", "Only look for objects with this property (blank = all objects)"); RNA_def_property_ui_text(prop, "Property", "Only look for objects with this property (blank = all objects)");
RNA_def_property_update(prop, NC_LOGIC, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "material", PROP_STRING, PROP_NONE); prop = RNA_def_property(srna, "material", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "matname"); RNA_def_property_string_sdna(prop, NULL, "matname");
RNA_def_property_ui_text(prop, "Material", "Only look for objects with this material (blank = all objects)"); RNA_def_property_ui_text(prop, "Material", "Only look for objects with this material (blank = all objects)");
RNA_def_property_update(prop, NC_LOGIC, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL);
/* //XXX either use a datablock look up to store the string name (material) #if 0
// or to do a doversion and use a material pointer. /* XXX either use a datablock look up to store the string name (material)
prop= RNA_def_property(srna, "material", PROP_POINTER, PROP_NONE); * or to do a doversion and use a material pointer. */
prop = RNA_def_property(srna, "material", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Material"); RNA_def_property_struct_type(prop, "Material");
RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_pointer_sdna(prop, NULL, "ma"); RNA_def_property_pointer_sdna(prop, NULL, "ma");
RNA_def_property_ui_text(prop, "Material", "Only look for objects with this material (blank = all objects)"); RNA_def_property_ui_text(prop, "Material", "Only look for objects with this material (blank = all objects)");
*/ #endif
prop= RNA_def_property(srna, "use_x_ray", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_x_ray", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", SENS_RAY_XRAY); RNA_def_property_boolean_sdna(prop, NULL, "mode", SENS_RAY_XRAY);
RNA_def_property_ui_text(prop, "X-Ray Mode", "Toggle X-Ray option (see through objects that don't have the property)"); RNA_def_property_ui_text(prop, "X-Ray Mode", "Toggle X-Ray option (see through objects that don't have the property)");
RNA_def_property_update(prop, NC_LOGIC, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "range", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "range", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.01, 10000.0); RNA_def_property_range(prop, 0.01, 10000.0);
RNA_def_property_ui_text(prop, "Range", "Sense objects no farther than this distance"); RNA_def_property_ui_text(prop, "Range", "Sense objects no farther than this distance");
RNA_def_property_update(prop, NC_LOGIC, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "axis", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "axis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "axisflag"); RNA_def_property_enum_sdna(prop, NULL, "axisflag");
RNA_def_property_enum_items(prop, axis_items); RNA_def_property_enum_items(prop, axis_items);
RNA_def_property_ui_text(prop, "Axis", "Along which axis the ray is cast"); RNA_def_property_ui_text(prop, "Axis", "Along which axis the ray is cast");
@@ -763,11 +765,11 @@ static void rna_def_message_sensor(BlenderRNA *brna)
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
srna= RNA_def_struct(brna, "MessageSensor", "Sensor"); srna = RNA_def_struct(brna, "MessageSensor", "Sensor");
RNA_def_struct_ui_text(srna, "Message Sensor", "Sensor to detect incoming messages"); RNA_def_struct_ui_text(srna, "Message Sensor", "Sensor to detect incoming messages");
RNA_def_struct_sdna_from(srna, "bMessageSensor", "data"); RNA_def_struct_sdna_from(srna, "bMessageSensor", "data");
prop= RNA_def_property(srna, "subject", PROP_STRING, PROP_NONE); prop = RNA_def_property(srna, "subject", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Subject", "Optional subject filter: only accept messages with this subject, or empty to accept all"); RNA_def_property_ui_text(prop, "Subject", "Optional subject filter: only accept messages with this subject, or empty to accept all");
RNA_def_property_update(prop, NC_LOGIC, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL);
} }
@@ -777,21 +779,21 @@ static void rna_def_joystick_sensor(BlenderRNA *brna)
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
static EnumPropertyItem event_type_items[] ={ static EnumPropertyItem event_type_items[] = {
{SENS_JOY_BUTTON, "BUTTON", 0, "Button", ""}, {SENS_JOY_BUTTON, "BUTTON", 0, "Button", ""},
{SENS_JOY_AXIS, "AXIS", 0, "Axis", ""}, {SENS_JOY_AXIS, "AXIS", 0, "Axis", ""},
{SENS_JOY_HAT, "HAT", 0, "Hat", ""}, {SENS_JOY_HAT, "HAT", 0, "Hat", ""},
{SENS_JOY_AXIS_SINGLE, "AXIS_SINGLE", 0, "Single Axis", ""}, {SENS_JOY_AXIS_SINGLE, "AXIS_SINGLE", 0, "Single Axis", ""},
{0, NULL, 0, NULL, NULL}}; {0, NULL, 0, NULL, NULL}};
static EnumPropertyItem axis_direction_items[] ={ static EnumPropertyItem axis_direction_items[] = {
{SENS_JOY_X_AXIS, "RIGHTAXIS", 0, "Right Axis", ""}, {SENS_JOY_X_AXIS, "RIGHTAXIS", 0, "Right Axis", ""},
{SENS_JOY_Y_AXIS, "UPAXIS", 0, "Up Axis", ""}, {SENS_JOY_Y_AXIS, "UPAXIS", 0, "Up Axis", ""},
{SENS_JOY_NEG_X_AXIS, "LEFTAXIS", 0, "Left Axis", ""}, {SENS_JOY_NEG_X_AXIS, "LEFTAXIS", 0, "Left Axis", ""},
{SENS_JOY_NEG_Y_AXIS, "DOWNAXIS", 0, "Down Axis", ""}, {SENS_JOY_NEG_Y_AXIS, "DOWNAXIS", 0, "Down Axis", ""},
{0, NULL, 0, NULL, NULL}}; {0, NULL, 0, NULL, NULL}};
static EnumPropertyItem hat_direction_items[] ={ static EnumPropertyItem hat_direction_items[] = {
{SENS_JOY_HAT_UP, "UP", 0, "Up", ""}, {SENS_JOY_HAT_UP, "UP", 0, "Up", ""},
{SENS_JOY_HAT_DOWN, "DOWN", 0, "Down", ""}, {SENS_JOY_HAT_DOWN, "DOWN", 0, "Down", ""},
{SENS_JOY_HAT_LEFT, "LEFT", 0, "Left", ""}, {SENS_JOY_HAT_LEFT, "LEFT", 0, "Left", ""},
@@ -803,68 +805,68 @@ static void rna_def_joystick_sensor(BlenderRNA *brna)
{SENS_JOY_HAT_DOWN_RIGHT, "DOWNRIGHT", 0, "Down/Right", ""}, {SENS_JOY_HAT_DOWN_RIGHT, "DOWNRIGHT", 0, "Down/Right", ""},
{0, NULL, 0, NULL, NULL}}; {0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "JoystickSensor", "Sensor"); srna = RNA_def_struct(brna, "JoystickSensor", "Sensor");
RNA_def_struct_ui_text(srna, "Joystick Sensor", "Sensor to detect joystick events"); RNA_def_struct_ui_text(srna, "Joystick Sensor", "Sensor to detect joystick events");
RNA_def_struct_sdna_from(srna, "bJoystickSensor", "data"); RNA_def_struct_sdna_from(srna, "bJoystickSensor", "data");
prop= RNA_def_property(srna, "joystick_index", PROP_INT, PROP_NONE); prop = RNA_def_property(srna, "joystick_index", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "joyindex"); RNA_def_property_int_sdna(prop, NULL, "joyindex");
RNA_def_property_ui_text(prop, "Index", "Which joystick to use"); RNA_def_property_ui_text(prop, "Index", "Which joystick to use");
RNA_def_property_range(prop, 0, SENS_JOY_MAXINDEX-1); RNA_def_property_range(prop, 0, SENS_JOY_MAXINDEX-1);
RNA_def_property_update(prop, NC_LOGIC, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "event_type", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "event_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "type"); RNA_def_property_enum_sdna(prop, NULL, "type");
RNA_def_property_enum_items(prop, event_type_items); RNA_def_property_enum_items(prop, event_type_items);
RNA_def_property_ui_text(prop, "Event Type", "The type of event this joystick sensor is triggered on"); RNA_def_property_ui_text(prop, "Event Type", "The type of event this joystick sensor is triggered on");
RNA_def_property_update(prop, NC_LOGIC, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "use_all_events", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_all_events", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SENS_JOY_ANY_EVENT); RNA_def_property_boolean_sdna(prop, NULL, "flag", SENS_JOY_ANY_EVENT);
RNA_def_property_ui_text(prop, "All Events", "Triggered by all events on this joystick's current type (axis/button/hat)"); RNA_def_property_ui_text(prop, "All Events", "Triggered by all events on this joystick's current type (axis/button/hat)");
RNA_def_property_update(prop, NC_LOGIC, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL);
/* Button */ /* Button */
prop= RNA_def_property(srna, "button_number", PROP_INT, PROP_NONE); prop = RNA_def_property(srna, "button_number", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "button"); RNA_def_property_int_sdna(prop, NULL, "button");
RNA_def_property_ui_text(prop, "Button Number", "Which button to use"); RNA_def_property_ui_text(prop, "Button Number", "Which button to use");
RNA_def_property_range(prop, 0, 18); RNA_def_property_range(prop, 0, 18);
RNA_def_property_update(prop, NC_LOGIC, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL);
/* Axis */ /* Axis */
prop= RNA_def_property(srna, "axis_number", PROP_INT, PROP_NONE); prop = RNA_def_property(srna, "axis_number", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "axis"); RNA_def_property_int_sdna(prop, NULL, "axis");
RNA_def_property_ui_text(prop, "Axis Number", "Which axis pair to use, 1 is usually the main direction input"); RNA_def_property_ui_text(prop, "Axis Number", "Which axis pair to use, 1 is usually the main direction input");
RNA_def_property_range(prop, 1, 8); RNA_def_property_range(prop, 1, 8);
RNA_def_property_update(prop, NC_LOGIC, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "axis_threshold", PROP_INT, PROP_NONE); prop = RNA_def_property(srna, "axis_threshold", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "precision"); RNA_def_property_int_sdna(prop, NULL, "precision");
RNA_def_property_ui_text(prop, "Axis Threshold", "Precision of the axis"); RNA_def_property_ui_text(prop, "Axis Threshold", "Precision of the axis");
RNA_def_property_range(prop, 0, 32768); RNA_def_property_range(prop, 0, 32768);
RNA_def_property_update(prop, NC_LOGIC, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "axis_direction", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "axis_direction", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "axisf"); RNA_def_property_enum_sdna(prop, NULL, "axisf");
RNA_def_property_enum_items(prop, axis_direction_items); RNA_def_property_enum_items(prop, axis_direction_items);
RNA_def_property_ui_text(prop, "Axis Direction", "The direction of the axis"); RNA_def_property_ui_text(prop, "Axis Direction", "The direction of the axis");
RNA_def_property_update(prop, NC_LOGIC, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL);
/* Single Axis */ /* Single Axis */
prop= RNA_def_property(srna, "single_axis_number", PROP_INT, PROP_NONE); prop = RNA_def_property(srna, "single_axis_number", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "axis_single"); RNA_def_property_int_sdna(prop, NULL, "axis_single");
RNA_def_property_ui_text(prop, "Axis Number", "Single axis (vertical/horizontal/other) to detect"); RNA_def_property_ui_text(prop, "Axis Number", "Single axis (vertical/horizontal/other) to detect");
RNA_def_property_range(prop, 1, 16); RNA_def_property_range(prop, 1, 16);
RNA_def_property_update(prop, NC_LOGIC, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL);
/* Hat */ /* Hat */
prop= RNA_def_property(srna, "hat_number", PROP_INT, PROP_NONE); prop = RNA_def_property(srna, "hat_number", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "hat"); RNA_def_property_int_sdna(prop, NULL, "hat");
RNA_def_property_ui_text(prop, "Hat Number", "Which hat to use"); RNA_def_property_ui_text(prop, "Hat Number", "Which hat to use");
RNA_def_property_range(prop, 1, 2); RNA_def_property_range(prop, 1, 2);
RNA_def_property_update(prop, NC_LOGIC, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "hat_direction", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "hat_direction", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "hatf"); RNA_def_property_enum_sdna(prop, NULL, "hatf");
RNA_def_property_enum_items(prop, hat_direction_items); RNA_def_property_enum_items(prop, hat_direction_items);
RNA_def_property_ui_text(prop, "Hat Direction", "Hat direction"); RNA_def_property_ui_text(prop, "Hat Direction", "Hat direction");

View File

@@ -58,15 +58,15 @@ void RNA_api_sensor(StructRNA *srna)
FunctionRNA *func; FunctionRNA *func;
PropertyRNA *parm; PropertyRNA *parm;
func= RNA_def_function(srna, "link", "rna_Sensor_link"); func = RNA_def_function(srna, "link", "rna_Sensor_link");
RNA_def_function_ui_description(func, "Link the sensor to a controller"); RNA_def_function_ui_description(func, "Link the sensor to a controller");
parm= RNA_def_pointer(func, "controller", "Controller", "", "Controller to link to"); parm = RNA_def_pointer(func, "controller", "Controller", "", "Controller to link to");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_property_update(parm, NC_LOGIC, NULL); RNA_def_property_update(parm, NC_LOGIC, NULL);
func= RNA_def_function(srna, "unlink", "rna_Sensor_unlink"); func = RNA_def_function(srna, "unlink", "rna_Sensor_unlink");
RNA_def_function_ui_description(func, "Unlink the sensor from a controller"); RNA_def_function_ui_description(func, "Unlink the sensor from a controller");
parm= RNA_def_pointer(func, "controller", "Controller", "", "Controller to unlink from"); parm = RNA_def_pointer(func, "controller", "Controller", "", "Controller to unlink from");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_property_update(parm, NC_LOGIC, NULL); RNA_def_property_update(parm, NC_LOGIC, NULL);
} }

File diff suppressed because it is too large Load Diff

View File

@@ -51,7 +51,7 @@ static void rna_Sequence_swap_internal(Sequence *seq_self, ReportList *reports,
{ {
const char *error_msg; const char *error_msg;
if(seq_swap(seq_self, seq_other, &error_msg) == 0) if (seq_swap(seq_self, seq_other, &error_msg) == 0)
BKE_report(reports, RPT_ERROR, error_msg); BKE_report(reports, RPT_ERROR, error_msg);
} }
@@ -62,16 +62,16 @@ void RNA_api_sequence_strip(StructRNA *srna)
FunctionRNA *func; FunctionRNA *func;
PropertyRNA *parm; PropertyRNA *parm;
func= RNA_def_function(srna, "getStripElem", "give_stripelem"); func = RNA_def_function(srna, "getStripElem", "give_stripelem");
RNA_def_function_ui_description(func, "Return the strip element from a given frame or None"); RNA_def_function_ui_description(func, "Return the strip element from a given frame or None");
parm= RNA_def_int(func, "frame", 0, -MAXFRAME, MAXFRAME, "Frame", parm = RNA_def_int(func, "frame", 0, -MAXFRAME, MAXFRAME, "Frame",
"The frame to get the strip element from", -MAXFRAME, MAXFRAME); "The frame to get the strip element from", -MAXFRAME, MAXFRAME);
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_function_return(func, RNA_def_pointer(func, "elem", "SequenceElement", "", "strip element of the current frame")); RNA_def_function_return(func, RNA_def_pointer(func, "elem", "SequenceElement", "", "strip element of the current frame"));
func= RNA_def_function(srna, "swap", "rna_Sequence_swap_internal"); func = RNA_def_function(srna, "swap", "rna_Sequence_swap_internal");
RNA_def_function_flag(func, FUNC_USE_REPORTS); RNA_def_function_flag(func, FUNC_USE_REPORTS);
parm= RNA_def_pointer(func, "other", "Sequence", "Other", ""); parm = RNA_def_pointer(func, "other", "Sequence", "Other", "");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
} }

View File

@@ -68,7 +68,7 @@ static void rna_Smoke_reset(Main *bmain, Scene *scene, PointerRNA *ptr)
smokeModifier_reset(settings->smd); smokeModifier_reset(settings->smd);
if(settings->smd && settings->smd->domain) if (settings->smd && settings->smd->domain)
settings->point_cache[0]->flag |= PTCACHE_OUTDATED; settings->point_cache[0]->flag |= PTCACHE_OUTDATED;
rna_Smoke_update(bmain, scene, ptr); rna_Smoke_update(bmain, scene, ptr);
@@ -80,7 +80,7 @@ static void rna_Smoke_reset_dependancy(Main *bmain, Scene *scene, PointerRNA *pt
smokeModifier_reset(settings->smd); smokeModifier_reset(settings->smd);
if(settings->smd && settings->smd->domain) if (settings->smd && settings->smd->domain)
settings->smd->domain->point_cache[0]->flag |= PTCACHE_OUTDATED; settings->smd->domain->point_cache[0]->flag |= PTCACHE_OUTDATED;
rna_Smoke_dependency_update(bmain, scene, ptr); rna_Smoke_dependency_update(bmain, scene, ptr);
@@ -89,7 +89,7 @@ static void rna_Smoke_reset_dependancy(Main *bmain, Scene *scene, PointerRNA *pt
static char *rna_SmokeDomainSettings_path(PointerRNA *ptr) static char *rna_SmokeDomainSettings_path(PointerRNA *ptr)
{ {
SmokeDomainSettings *settings = (SmokeDomainSettings*)ptr->data; SmokeDomainSettings *settings = (SmokeDomainSettings*)ptr->data;
ModifierData *md= (ModifierData *)settings->smd; ModifierData *md = (ModifierData *)settings->smd;
return BLI_sprintfN("modifiers[\"%s\"].domain_settings", md->name); return BLI_sprintfN("modifiers[\"%s\"].domain_settings", md->name);
} }
@@ -97,7 +97,7 @@ static char *rna_SmokeDomainSettings_path(PointerRNA *ptr)
static char *rna_SmokeFlowSettings_path(PointerRNA *ptr) static char *rna_SmokeFlowSettings_path(PointerRNA *ptr)
{ {
SmokeFlowSettings *settings = (SmokeFlowSettings*)ptr->data; SmokeFlowSettings *settings = (SmokeFlowSettings*)ptr->data;
ModifierData *md= (ModifierData *)settings->smd; ModifierData *md = (ModifierData *)settings->smd;
return BLI_sprintfN("modifiers[\"%s\"].flow_settings", md->name); return BLI_sprintfN("modifiers[\"%s\"].flow_settings", md->name);
} }
@@ -105,7 +105,7 @@ static char *rna_SmokeFlowSettings_path(PointerRNA *ptr)
static char *rna_SmokeCollSettings_path(PointerRNA *ptr) static char *rna_SmokeCollSettings_path(PointerRNA *ptr)
{ {
SmokeCollSettings *settings = (SmokeCollSettings*)ptr->data; SmokeCollSettings *settings = (SmokeCollSettings*)ptr->data;
ModifierData *md= (ModifierData *)settings->smd; ModifierData *md = (ModifierData *)settings->smd;
return BLI_sprintfN("modifiers[\"%s\"].coll_settings", md->name); return BLI_sprintfN("modifiers[\"%s\"].coll_settings", md->name);
} }
@@ -141,129 +141,129 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna)
RNA_def_struct_sdna(srna, "SmokeDomainSettings"); RNA_def_struct_sdna(srna, "SmokeDomainSettings");
RNA_def_struct_path_func(srna, "rna_SmokeDomainSettings_path"); RNA_def_struct_path_func(srna, "rna_SmokeDomainSettings_path");
prop= RNA_def_property(srna, "resolution_max", PROP_INT, PROP_NONE); prop = RNA_def_property(srna, "resolution_max", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "maxres"); RNA_def_property_int_sdna(prop, NULL, "maxres");
RNA_def_property_range(prop, 24, 512); RNA_def_property_range(prop, 24, 512);
RNA_def_property_ui_range(prop, 24, 512, 2, 0); RNA_def_property_ui_range(prop, 24, 512, 2, 0);
RNA_def_property_ui_text(prop, "Max Res", "Maximal resolution used in the fluid domain"); RNA_def_property_ui_text(prop, "Max Res", "Maximal resolution used in the fluid domain");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
prop= RNA_def_property(srna, "amplify", PROP_INT, PROP_NONE); prop = RNA_def_property(srna, "amplify", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "amplify"); RNA_def_property_int_sdna(prop, NULL, "amplify");
RNA_def_property_range(prop, 1, 10); RNA_def_property_range(prop, 1, 10);
RNA_def_property_ui_range(prop, 1, 10, 1, 0); RNA_def_property_ui_range(prop, 1, 10, 1, 0);
RNA_def_property_ui_text(prop, "Amplification", "Enhance the resolution of smoke by this factor using noise"); RNA_def_property_ui_text(prop, "Amplification", "Enhance the resolution of smoke by this factor using noise");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
prop= RNA_def_property(srna, "use_high_resolution", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_high_resolution", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_HIGHRES); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_HIGHRES);
RNA_def_property_ui_text(prop, "High res", "Enable high resolution (using amplification)"); RNA_def_property_ui_text(prop, "High res", "Enable high resolution (using amplification)");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
prop= RNA_def_property(srna, "show_high_resolution", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "show_high_resolution", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "viewsettings", MOD_SMOKE_VIEW_SHOWBIG); RNA_def_property_boolean_sdna(prop, NULL, "viewsettings", MOD_SMOKE_VIEW_SHOWBIG);
RNA_def_property_ui_text(prop, "Show High Resolution", "Show high resolution (using amplification)"); RNA_def_property_ui_text(prop, "Show High Resolution", "Show high resolution (using amplification)");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
prop= RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "noise"); RNA_def_property_enum_sdna(prop, NULL, "noise");
RNA_def_property_enum_items(prop, prop_noise_type_items); RNA_def_property_enum_items(prop, prop_noise_type_items);
RNA_def_property_ui_text(prop, "Noise Method", "Noise method which is used for creating the high resolution"); RNA_def_property_ui_text(prop, "Noise Method", "Noise method which is used for creating the high resolution");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
prop= RNA_def_property(srna, "alpha", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "alpha", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "alpha"); RNA_def_property_float_sdna(prop, NULL, "alpha");
RNA_def_property_range(prop, -5.0, 5.0); RNA_def_property_range(prop, -5.0, 5.0);
RNA_def_property_ui_range(prop, -5.0, 5.0, 0.02, 5); RNA_def_property_ui_range(prop, -5.0, 5.0, 0.02, 5);
RNA_def_property_ui_text(prop, "Density", "How much density affects smoke motion (higher value results in faster rising smoke)"); RNA_def_property_ui_text(prop, "Density", "How much density affects smoke motion (higher value results in faster rising smoke)");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
prop= RNA_def_property(srna, "beta", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "beta", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "beta"); RNA_def_property_float_sdna(prop, NULL, "beta");
RNA_def_property_range(prop, -5.0, 5.0); RNA_def_property_range(prop, -5.0, 5.0);
RNA_def_property_ui_range(prop, -5.0, 5.0, 0.02, 5); RNA_def_property_ui_range(prop, -5.0, 5.0, 0.02, 5);
RNA_def_property_ui_text(prop, "Heat", "How much heat affects smoke motion (higher value results in faster rising smoke)"); RNA_def_property_ui_text(prop, "Heat", "How much heat affects smoke motion (higher value results in faster rising smoke)");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
prop= RNA_def_property(srna, "collision_group", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "collision_group", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "coll_group"); RNA_def_property_pointer_sdna(prop, NULL, "coll_group");
RNA_def_property_struct_type(prop, "Group"); RNA_def_property_struct_type(prop, "Group");
RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Collision Group", "Limit collisions to this group"); RNA_def_property_ui_text(prop, "Collision Group", "Limit collisions to this group");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset_dependancy"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset_dependancy");
prop= RNA_def_property(srna, "fluid_group", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "fluid_group", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "fluid_group"); RNA_def_property_pointer_sdna(prop, NULL, "fluid_group");
RNA_def_property_struct_type(prop, "Group"); RNA_def_property_struct_type(prop, "Group");
RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Fluid Group", "Limit fluid objects to this group"); RNA_def_property_ui_text(prop, "Fluid Group", "Limit fluid objects to this group");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset_dependancy"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset_dependancy");
prop= RNA_def_property(srna, "effector_group", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "effector_group", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "eff_group"); RNA_def_property_pointer_sdna(prop, NULL, "eff_group");
RNA_def_property_struct_type(prop, "Group"); RNA_def_property_struct_type(prop, "Group");
RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Effector Group", "Limit effectors to this group"); RNA_def_property_ui_text(prop, "Effector Group", "Limit effectors to this group");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset_dependancy"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset_dependancy");
prop= RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "strength"); RNA_def_property_float_sdna(prop, NULL, "strength");
RNA_def_property_range(prop, 0.0, 10.0); RNA_def_property_range(prop, 0.0, 10.0);
RNA_def_property_ui_range(prop, 0.0, 10.0, 1, 2); RNA_def_property_ui_range(prop, 0.0, 10.0, 1, 2);
RNA_def_property_ui_text(prop, "Strength", "Strength of noise"); RNA_def_property_ui_text(prop, "Strength", "Strength of noise");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
prop= RNA_def_property(srna, "dissolve_speed", PROP_INT, PROP_NONE); prop = RNA_def_property(srna, "dissolve_speed", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "diss_speed"); RNA_def_property_int_sdna(prop, NULL, "diss_speed");
RNA_def_property_range(prop, 1.0, 10000.0); RNA_def_property_range(prop, 1.0, 10000.0);
RNA_def_property_ui_range(prop, 1.0, 10000.0, 1, 0); RNA_def_property_ui_range(prop, 1.0, 10000.0, 1, 0);
RNA_def_property_ui_text(prop, "Dissolve Speed", "Dissolve Speed"); RNA_def_property_ui_text(prop, "Dissolve Speed", "Dissolve Speed");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
prop= RNA_def_property(srna, "use_dissolve_smoke", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_dissolve_smoke", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_DISSOLVE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_DISSOLVE);
RNA_def_property_ui_text(prop, "Dissolve Smoke", "Enable smoke to disappear over time"); RNA_def_property_ui_text(prop, "Dissolve Smoke", "Enable smoke to disappear over time");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
prop= RNA_def_property(srna, "use_dissolve_smoke_log", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_dissolve_smoke_log", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_DISSOLVE_LOG); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_DISSOLVE_LOG);
RNA_def_property_ui_text(prop, "Logarithmic dissolve", "Using 1/x "); RNA_def_property_ui_text(prop, "Logarithmic dissolve", "Using 1/x ");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
prop= RNA_def_property(srna, "point_cache", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "point_cache", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "point_cache[0]"); RNA_def_property_pointer_sdna(prop, NULL, "point_cache[0]");
RNA_def_property_ui_text(prop, "Point Cache", ""); RNA_def_property_ui_text(prop, "Point Cache", "");
prop= RNA_def_property(srna, "point_cache_compress_type", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "point_cache_compress_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "cache_comp"); RNA_def_property_enum_sdna(prop, NULL, "cache_comp");
RNA_def_property_enum_items(prop, smoke_cache_comp_items); RNA_def_property_enum_items(prop, smoke_cache_comp_items);
RNA_def_property_ui_text(prop, "Cache Compression", "Compression method to be used"); RNA_def_property_ui_text(prop, "Cache Compression", "Compression method to be used");
prop= RNA_def_property(srna, "collision_extents", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "collision_extents", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "border_collisions"); RNA_def_property_enum_sdna(prop, NULL, "border_collisions");
RNA_def_property_enum_items(prop, smoke_domain_colli_items); RNA_def_property_enum_items(prop, smoke_domain_colli_items);
RNA_def_property_ui_text(prop, "Border Collisions", "Select which domain border will be treated as collision object"); RNA_def_property_ui_text(prop, "Border Collisions", "Select which domain border will be treated as collision object");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
prop= RNA_def_property(srna, "effector_weights", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "effector_weights", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "EffectorWeights"); RNA_def_property_struct_type(prop, "EffectorWeights");
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Effector Weights", ""); RNA_def_property_ui_text(prop, "Effector Weights", "");
prop= RNA_def_property(srna, "smooth_emitter", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "smooth_emitter", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_HIGH_SMOOTH); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_HIGH_SMOOTH);
RNA_def_property_ui_text(prop, "Smooth Emitter", "Smoothen emitted smoke to avoid blockiness"); RNA_def_property_ui_text(prop, "Smooth Emitter", "Smoothen emitted smoke to avoid blockiness");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
prop= RNA_def_property(srna, "time_scale", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "time_scale", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "time_scale"); RNA_def_property_float_sdna(prop, NULL, "time_scale");
RNA_def_property_range(prop, 0.2, 1.5); RNA_def_property_range(prop, 0.2, 1.5);
RNA_def_property_ui_range(prop, 0.2, 1.5, 0.02, 5); RNA_def_property_ui_range(prop, 0.2, 1.5, 0.02, 5);
RNA_def_property_ui_text(prop, "Time Scale", "Adjust simulation speed"); RNA_def_property_ui_text(prop, "Time Scale", "Adjust simulation speed");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
prop= RNA_def_property(srna, "vorticity", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "vorticity", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "vorticity"); RNA_def_property_float_sdna(prop, NULL, "vorticity");
RNA_def_property_range(prop, 0.01, 4.0); RNA_def_property_range(prop, 0.01, 4.0);
RNA_def_property_ui_range(prop, 0.01, 4.0, 0.02, 5); RNA_def_property_ui_range(prop, 0.01, 4.0, 0.02, 5);
@@ -282,43 +282,43 @@ static void rna_def_smoke_flow_settings(BlenderRNA *brna)
RNA_def_struct_sdna(srna, "SmokeFlowSettings"); RNA_def_struct_sdna(srna, "SmokeFlowSettings");
RNA_def_struct_path_func(srna, "rna_SmokeFlowSettings_path"); RNA_def_struct_path_func(srna, "rna_SmokeFlowSettings_path");
prop= RNA_def_property(srna, "density", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "density", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "density"); RNA_def_property_float_sdna(prop, NULL, "density");
RNA_def_property_range(prop, 0.001, 1); RNA_def_property_range(prop, 0.001, 1);
RNA_def_property_ui_range(prop, 0.001, 1.0, 1.0, 4); RNA_def_property_ui_range(prop, 0.001, 1.0, 1.0, 4);
RNA_def_property_ui_text(prop, "Density", ""); RNA_def_property_ui_text(prop, "Density", "");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
prop= RNA_def_property(srna, "temperature", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "temperature", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "temp"); RNA_def_property_float_sdna(prop, NULL, "temp");
RNA_def_property_range(prop, -10, 10); RNA_def_property_range(prop, -10, 10);
RNA_def_property_ui_range(prop, -10, 10, 1, 1); RNA_def_property_ui_range(prop, -10, 10, 1, 1);
RNA_def_property_ui_text(prop, "Temp. Diff.", "Temperature difference to ambient temperature"); RNA_def_property_ui_text(prop, "Temp. Diff.", "Temperature difference to ambient temperature");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
prop= RNA_def_property(srna, "particle_system", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "particle_system", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "psys"); RNA_def_property_pointer_sdna(prop, NULL, "psys");
RNA_def_property_struct_type(prop, "ParticleSystem"); RNA_def_property_struct_type(prop, "ParticleSystem");
RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Particle Systems", "Particle systems emitted from the object"); RNA_def_property_ui_text(prop, "Particle Systems", "Particle systems emitted from the object");
RNA_def_property_update(prop, 0, "rna_Smoke_reset_dependancy"); RNA_def_property_update(prop, 0, "rna_Smoke_reset_dependancy");
prop= RNA_def_property(srna, "use_outflow", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_outflow", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "type", MOD_SMOKE_FLOW_TYPE_OUTFLOW); RNA_def_property_boolean_sdna(prop, NULL, "type", MOD_SMOKE_FLOW_TYPE_OUTFLOW);
RNA_def_property_ui_text(prop, "Outflow", "Delete smoke from simulation"); RNA_def_property_ui_text(prop, "Outflow", "Delete smoke from simulation");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
prop= RNA_def_property(srna, "use_absolute", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_absolute", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_FLOW_ABSOLUTE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_FLOW_ABSOLUTE);
RNA_def_property_ui_text(prop, "Absolute Density", "Only allow given density value in emitter area"); RNA_def_property_ui_text(prop, "Absolute Density", "Only allow given density value in emitter area");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
prop= RNA_def_property(srna, "initial_velocity", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "initial_velocity", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_FLOW_INITVELOCITY); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_FLOW_INITVELOCITY);
RNA_def_property_ui_text(prop, "Initial Velocity", "Smoke inherits its velocity from the emitter particle"); RNA_def_property_ui_text(prop, "Initial Velocity", "Smoke inherits its velocity from the emitter particle");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
prop= RNA_def_property(srna, "velocity_factor", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "velocity_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "vel_multi"); RNA_def_property_float_sdna(prop, NULL, "vel_multi");
RNA_def_property_range(prop, -2.0, 2.0); RNA_def_property_range(prop, -2.0, 2.0);
RNA_def_property_ui_range(prop, -2.0, 2.0, 0.05, 5); RNA_def_property_ui_range(prop, -2.0, 2.0, 0.05, 5);

View File

@@ -53,7 +53,7 @@ static int rna_Sound_caching_get(PointerRNA *ptr)
static void rna_Sound_caching_set(PointerRNA *ptr, const int value) static void rna_Sound_caching_set(PointerRNA *ptr, const int value)
{ {
bSound *sound = (bSound*)(ptr->data); bSound *sound = (bSound*)(ptr->data);
if(value) if (value)
sound_cache(sound); sound_cache(sound);
else else
sound_delete_cache(sound); sound_delete_cache(sound);
@@ -71,28 +71,28 @@ static void rna_def_sound(BlenderRNA *brna)
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
srna= RNA_def_struct(brna, "Sound", "ID"); srna = RNA_def_struct(brna, "Sound", "ID");
RNA_def_struct_sdna(srna, "bSound"); RNA_def_struct_sdna(srna, "bSound");
RNA_def_struct_ui_text(srna, "Sound", "Sound datablock referencing an external or packed sound file"); RNA_def_struct_ui_text(srna, "Sound", "Sound datablock referencing an external or packed sound file");
RNA_def_struct_ui_icon(srna, ICON_SOUND); RNA_def_struct_ui_icon(srna, ICON_SOUND);
//rna_def_ipo_common(srna); /*rna_def_ipo_common(srna); */
prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH); prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
RNA_def_property_string_sdna(prop, NULL, "name"); RNA_def_property_string_sdna(prop, NULL, "name");
RNA_def_property_ui_text(prop, "File Path", "Sound sample file used by this Sound datablock"); RNA_def_property_ui_text(prop, "File Path", "Sound sample file used by this Sound datablock");
RNA_def_property_update(prop, 0, "rna_Sound_update"); RNA_def_property_update(prop, 0, "rna_Sound_update");
prop= RNA_def_property(srna, "packed_file", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "packed_file", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "packedfile"); RNA_def_property_pointer_sdna(prop, NULL, "packedfile");
RNA_def_property_ui_text(prop, "Packed File", ""); RNA_def_property_ui_text(prop, "Packed File", "");
prop= RNA_def_property(srna, "use_memory_cache", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_memory_cache", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_Sound_caching_get", "rna_Sound_caching_set"); RNA_def_property_boolean_funcs(prop, "rna_Sound_caching_get", "rna_Sound_caching_set");
RNA_def_property_ui_text(prop, "Caching", "The sound file is decoded and loaded into RAM"); RNA_def_property_ui_text(prop, "Caching", "The sound file is decoded and loaded into RAM");
RNA_def_property_update(prop, 0, "rna_Sound_caching_update"); RNA_def_property_update(prop, 0, "rna_Sound_caching_update");
prop= RNA_def_property(srna, "use_mono", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_mono", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", SOUND_FLAGS_MONO); RNA_def_property_boolean_sdna(prop, NULL, "flags", SOUND_FLAGS_MONO);
RNA_def_property_ui_text(prop, "Mono", "If the file contains multiple audio channels they are rendered to a single one"); RNA_def_property_ui_text(prop, "Mono", "If the file contains multiple audio channels they are rendered to a single one");
RNA_def_property_update(prop, 0, "rna_Sound_update"); RNA_def_property_update(prop, 0, "rna_Sound_update");

File diff suppressed because it is too large Load Diff

View File

@@ -53,112 +53,113 @@ static void rna_def_speaker(BlenderRNA *brna)
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
srna= RNA_def_struct(brna, "Speaker", "ID"); srna = RNA_def_struct(brna, "Speaker", "ID");
RNA_def_struct_ui_text(srna, "Speaker", "Speaker datablock for 3D audio speaker objects"); RNA_def_struct_ui_text(srna, "Speaker", "Speaker datablock for 3D audio speaker objects");
RNA_def_struct_ui_icon(srna, ICON_SPEAKER); RNA_def_struct_ui_icon(srna, ICON_SPEAKER);
prop= RNA_def_property(srna, "muted", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "muted", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SPK_MUTED); RNA_def_property_boolean_sdna(prop, NULL, "flag", SPK_MUTED);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Mute", "Mute the speaker"); RNA_def_property_ui_text(prop, "Mute", "Mute the speaker");
// RNA_def_property_update(prop, 0, "rna_Speaker_update"); /* RNA_def_property_update(prop, 0, "rna_Speaker_update"); */
/* This shouldn't be changed actually, hiding it! #if 0 /* This shouldn't be changed actually, hiding it! */
prop= RNA_def_property(srna, "relative", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "relative", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SPK_RELATIVE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SPK_RELATIVE);
RNA_def_property_ui_text(prop, "Relative", "Whether the source is relative to the camera or not"); RNA_def_property_ui_text(prop, "Relative", "Whether the source is relative to the camera or not");
// RNA_def_property_update(prop, 0, "rna_Speaker_update");*/ /* RNA_def_property_update(prop, 0, "rna_Speaker_update"); */
#endif
prop= RNA_def_property(srna, "sound", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "sound", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "sound"); RNA_def_property_pointer_sdna(prop, NULL, "sound");
RNA_def_property_struct_type(prop, "Sound"); RNA_def_property_struct_type(prop, "Sound");
RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Sound", "Sound datablock used by this speaker"); RNA_def_property_ui_text(prop, "Sound", "Sound datablock used by this speaker");
// RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_sound_set", NULL); /* RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_sound_set", NULL); */
// RNA_def_property_update(prop, 0, "rna_Speaker_update"); /* RNA_def_property_update(prop, 0, "rna_Speaker_update"); */
prop= RNA_def_property(srna, "volume_max", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "volume_max", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "volume_max"); RNA_def_property_float_sdna(prop, NULL, "volume_max");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Maximum Volume", "Maximum volume, no matter how near the object is"); RNA_def_property_ui_text(prop, "Maximum Volume", "Maximum volume, no matter how near the object is");
// RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_volume_max_set", NULL); /* RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_volume_max_set", NULL); */
// RNA_def_property_update(prop, 0, "rna_Speaker_update"); /* RNA_def_property_update(prop, 0, "rna_Speaker_update"); */
prop= RNA_def_property(srna, "volume_min", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "volume_min", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "volume_min"); RNA_def_property_float_sdna(prop, NULL, "volume_min");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Minimum Volume", "Minimum volume, no matter how far away the object is"); RNA_def_property_ui_text(prop, "Minimum Volume", "Minimum volume, no matter how far away the object is");
// RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_volume_min_set", NULL); /* RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_volume_min_set", NULL); */
// RNA_def_property_update(prop, 0, "rna_Speaker_update"); /* RNA_def_property_update(prop, 0, "rna_Speaker_update"); */
prop= RNA_def_property(srna, "distance_max", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "distance_max", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "distance_max"); RNA_def_property_float_sdna(prop, NULL, "distance_max");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 0.0f, FLT_MAX); RNA_def_property_range(prop, 0.0f, FLT_MAX);
RNA_def_property_ui_text(prop, "Maximum Distance", RNA_def_property_ui_text(prop, "Maximum Distance",
"Maximum distance for volume calculation, no matter how far away the object is"); "Maximum distance for volume calculation, no matter how far away the object is");
// RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_distance_max_set", NULL); /* RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_distance_max_set", NULL); */
// RNA_def_property_update(prop, 0, "rna_Speaker_update"); /* RNA_def_property_update(prop, 0, "rna_Speaker_update"); */
prop= RNA_def_property(srna, "distance_reference", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "distance_reference", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "distance_reference"); RNA_def_property_float_sdna(prop, NULL, "distance_reference");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 0.0f, FLT_MAX); RNA_def_property_range(prop, 0.0f, FLT_MAX);
RNA_def_property_ui_text(prop, "Reference Distance", "Reference distance at which volume is 100 %"); RNA_def_property_ui_text(prop, "Reference Distance", "Reference distance at which volume is 100 %");
// RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_distance_reference_set", NULL); /* RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_distance_reference_set", NULL); */
// RNA_def_property_update(prop, 0, "rna_Speaker_update"); /* RNA_def_property_update(prop, 0, "rna_Speaker_update"); */
prop= RNA_def_property(srna, "attenuation", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "attenuation", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "attenuation"); RNA_def_property_float_sdna(prop, NULL, "attenuation");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 0.0f, FLT_MAX); RNA_def_property_range(prop, 0.0f, FLT_MAX);
RNA_def_property_ui_text(prop, "Attenuation", "How strong the distance affects volume, depending on distance model"); RNA_def_property_ui_text(prop, "Attenuation", "How strong the distance affects volume, depending on distance model");
// RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_attenuation_set", NULL); /* RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_attenuation_set", NULL); */
// RNA_def_property_update(prop, 0, "rna_Speaker_update"); /* RNA_def_property_update(prop, 0, "rna_Speaker_update"); */
prop= RNA_def_property(srna, "cone_angle_outer", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "cone_angle_outer", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "cone_angle_outer"); RNA_def_property_float_sdna(prop, NULL, "cone_angle_outer");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 0.0f, 360.0f); RNA_def_property_range(prop, 0.0f, 360.0f);
RNA_def_property_ui_text(prop, "Outer Cone Angle", RNA_def_property_ui_text(prop, "Outer Cone Angle",
"Angle of the outer cone, in degrees, outside this cone the volume is " "Angle of the outer cone, in degrees, outside this cone the volume is "
"the outer cone volume, between inner and outer cone the volume is interpolated"); "the outer cone volume, between inner and outer cone the volume is interpolated");
// RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_cone_angle_outer_set", NULL); /* RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_cone_angle_outer_set", NULL); */
// RNA_def_property_update(prop, 0, "rna_Speaker_update"); /* RNA_def_property_update(prop, 0, "rna_Speaker_update"); */
prop= RNA_def_property(srna, "cone_angle_inner", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "cone_angle_inner", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "cone_angle_inner"); RNA_def_property_float_sdna(prop, NULL, "cone_angle_inner");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 0.0f, 360.0f); RNA_def_property_range(prop, 0.0f, 360.0f);
RNA_def_property_ui_text(prop, "Inner Cone Angle", RNA_def_property_ui_text(prop, "Inner Cone Angle",
"Angle of the inner cone, in degrees, inside the cone the volume is 100 %"); "Angle of the inner cone, in degrees, inside the cone the volume is 100 %");
// RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_cone_angle_inner_set", NULL); /* RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_cone_angle_inner_set", NULL); */
// RNA_def_property_update(prop, 0, "rna_Speaker_update"); /* RNA_def_property_update(prop, 0, "rna_Speaker_update"); */
prop= RNA_def_property(srna, "cone_volume_outer", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "cone_volume_outer", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "cone_volume_outer"); RNA_def_property_float_sdna(prop, NULL, "cone_volume_outer");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Outer Cone Volume", "Volume outside the outer cone"); RNA_def_property_ui_text(prop, "Outer Cone Volume", "Volume outside the outer cone");
// RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_cone_volume_outer_set", NULL); /* RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_cone_volume_outer_set", NULL); */
// RNA_def_property_update(prop, 0, "rna_Speaker_update"); /* RNA_def_property_update(prop, 0, "rna_Speaker_update"); */
prop= RNA_def_property(srna, "volume", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "volume", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "volume"); RNA_def_property_float_sdna(prop, NULL, "volume");
RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Volume", "How loud the sound is"); RNA_def_property_ui_text(prop, "Volume", "How loud the sound is");
// RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_volume_set", NULL); /* RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_volume_set", NULL); */
// RNA_def_property_update(prop, 0, "rna_Speaker_update"); /* RNA_def_property_update(prop, 0, "rna_Speaker_update"); */
prop= RNA_def_property(srna, "pitch", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "pitch", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "pitch"); RNA_def_property_float_sdna(prop, NULL, "pitch");
RNA_def_property_range(prop, 0.1f, 10.0f); RNA_def_property_range(prop, 0.1f, 10.0f);
RNA_def_property_ui_text(prop, "Pitch", "Playback pitch of the sound"); RNA_def_property_ui_text(prop, "Pitch", "Playback pitch of the sound");
// RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_pitch_set", NULL); /* RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_pitch_set", NULL); */
// RNA_def_property_update(prop, 0, "rna_Speaker_update"); /* RNA_def_property_update(prop, 0, "rna_Speaker_update"); */
/* common */ /* common */
rna_def_animdata_common(srna); rna_def_animdata_common(srna);

View File

@@ -50,10 +50,10 @@
#define DEF_VARS(type, prefix) \ #define DEF_VARS(type, prefix) \
static type prefix ## arr[ARRAY_SIZE]; \ static type prefix ## arr[ARRAY_SIZE]; \
static type prefix ## darr[DYNAMIC_ARRAY_SIZE]; \ static type prefix ## darr[DYNAMIC_ARRAY_SIZE]; \
static int prefix ## darr_len= ARRAY_SIZE; \ static int prefix ## darr_len = ARRAY_SIZE; \
static type prefix ## marr MARRAY_DIM; \ static type prefix ## marr MARRAY_DIM; \
static type prefix ## dmarr DYNAMIC_MARRAY_DIM; \ static type prefix ## dmarr DYNAMIC_MARRAY_DIM; \
static int prefix ## dmarr_len= sizeof(prefix ## dmarr); static int prefix ## dmarr_len = sizeof(prefix ## dmarr);
#define DEF_GET_SET(type, arr) \ #define DEF_GET_SET(type, arr) \
void rna_Test_ ## arr ## _get(PointerRNA *ptr, type *values) \ void rna_Test_ ## arr ## _get(PointerRNA *ptr, type *values) \
@@ -77,7 +77,7 @@
if (length > max) \ if (length > max) \
return 0; \ return 0; \
\ \
arr ## _len= length; \ arr ## _len = length; \
\ \
return 1; \ return 1; \
} \ } \
@@ -117,66 +117,66 @@ void RNA_def_test(BlenderRNA *brna)
#ifdef UNIT_TEST #ifdef UNIT_TEST
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
unsigned short dimsize[]= {MARRAY_DIMSIZE}; unsigned short dimsize[] = {MARRAY_DIMSIZE};
srna= RNA_def_struct(brna, "Test", NULL); srna = RNA_def_struct(brna, "Test", NULL);
RNA_def_struct_sdna(srna, "Test"); RNA_def_struct_sdna(srna, "Test");
prop= RNA_def_float_array(srna, "farr", ARRAY_SIZE, NULL, 0.0f, 0.0f, "farr", "float array", 0.0f, 0.0f); prop = RNA_def_float_array(srna, "farr", ARRAY_SIZE, NULL, 0.0f, 0.0f, "farr", "float array", 0.0f, 0.0f);
RNA_def_property_float_funcs(prop, "rna_Test_farr_get", "rna_Test_farr_set", NULL); RNA_def_property_float_funcs(prop, "rna_Test_farr_get", "rna_Test_farr_set", NULL);
prop= RNA_def_int_array(srna, "iarr", ARRAY_SIZE, NULL, 0, 0, "iarr", "int array", 0, 0); prop = RNA_def_int_array(srna, "iarr", ARRAY_SIZE, NULL, 0, 0, "iarr", "int array", 0, 0);
RNA_def_property_int_funcs(prop, "rna_Test_iarr_get", "rna_Test_iarr_set", NULL); RNA_def_property_int_funcs(prop, "rna_Test_iarr_get", "rna_Test_iarr_set", NULL);
prop= RNA_def_boolean_array(srna, "barr", ARRAY_SIZE, NULL, "barr", "boolean array"); prop = RNA_def_boolean_array(srna, "barr", ARRAY_SIZE, NULL, "barr", "boolean array");
RNA_def_property_boolean_funcs(prop, "rna_Test_barr_get", "rna_Test_barr_set"); RNA_def_property_boolean_funcs(prop, "rna_Test_barr_get", "rna_Test_barr_set");
/* dynamic arrays */ /* dynamic arrays */
prop= RNA_def_float_array(srna, "fdarr", DYNAMIC_ARRAY_SIZE, NULL, 0.0f, 0.0f, "fdarr", "dynamic float array", 0.0f, 0.0f); prop = RNA_def_float_array(srna, "fdarr", DYNAMIC_ARRAY_SIZE, NULL, 0.0f, 0.0f, "fdarr", "dynamic float array", 0.0f, 0.0f);
RNA_def_property_flag(prop, PROP_DYNAMIC); RNA_def_property_flag(prop, PROP_DYNAMIC);
RNA_def_property_dynamic_array_funcs(prop, "rna_Test_fdarr_get_length", "rna_Test_fdarr_set_length"); RNA_def_property_dynamic_array_funcs(prop, "rna_Test_fdarr_get_length", "rna_Test_fdarr_set_length");
RNA_def_property_float_funcs(prop, "rna_Test_fdarr_get", "rna_Test_fdarr_set", NULL); RNA_def_property_float_funcs(prop, "rna_Test_fdarr_get", "rna_Test_fdarr_set", NULL);
prop= RNA_def_int_array(srna, "idarr", DYNAMIC_ARRAY_SIZE, NULL, 0, 0, "idarr", "int array", 0, 0); prop = RNA_def_int_array(srna, "idarr", DYNAMIC_ARRAY_SIZE, NULL, 0, 0, "idarr", "int array", 0, 0);
RNA_def_property_flag(prop, PROP_DYNAMIC); RNA_def_property_flag(prop, PROP_DYNAMIC);
RNA_def_property_dynamic_array_funcs(prop, "rna_Test_idarr_get_length", "rna_Test_idarr_set_length"); RNA_def_property_dynamic_array_funcs(prop, "rna_Test_idarr_get_length", "rna_Test_idarr_set_length");
RNA_def_property_int_funcs(prop, "rna_Test_idarr_get", "rna_Test_idarr_set", NULL); RNA_def_property_int_funcs(prop, "rna_Test_idarr_get", "rna_Test_idarr_set", NULL);
prop= RNA_def_boolean_array(srna, "bdarr", DYNAMIC_ARRAY_SIZE, NULL, "bdarr", "boolean array"); prop = RNA_def_boolean_array(srna, "bdarr", DYNAMIC_ARRAY_SIZE, NULL, "bdarr", "boolean array");
RNA_def_property_flag(prop, PROP_DYNAMIC); RNA_def_property_flag(prop, PROP_DYNAMIC);
RNA_def_property_dynamic_array_funcs(prop, "rna_Test_bdarr_get_length", "rna_Test_bdarr_set_length"); RNA_def_property_dynamic_array_funcs(prop, "rna_Test_bdarr_get_length", "rna_Test_bdarr_set_length");
RNA_def_property_boolean_funcs(prop, "rna_Test_bdarr_get", "rna_Test_bdarr_set"); RNA_def_property_boolean_funcs(prop, "rna_Test_bdarr_get", "rna_Test_bdarr_set");
/* multidimensional arrays */ /* multidimensional arrays */
prop= RNA_def_property(srna, "fmarr", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "fmarr", PROP_FLOAT, PROP_NONE);
RNA_def_property_multidimensional_array(prop, MARRAY_SIZE(float), MARRAY_TOTDIM, dimsize); RNA_def_property_multidimensional_array(prop, MARRAY_SIZE(float), MARRAY_TOTDIM, dimsize);
RNA_def_property_float_funcs(prop, "rna_Test_fmarr_get", "rna_Test_fmarr_set", NULL); RNA_def_property_float_funcs(prop, "rna_Test_fmarr_get", "rna_Test_fmarr_set", NULL);
prop= RNA_def_property(srna, "imarr", PROP_INT, PROP_NONE); prop = RNA_def_property(srna, "imarr", PROP_INT, PROP_NONE);
RNA_def_property_multidimensional_array(prop, MARRAY_SIZE(int), MARRAY_TOTDIM, dimsize); RNA_def_property_multidimensional_array(prop, MARRAY_SIZE(int), MARRAY_TOTDIM, dimsize);
RNA_def_property_int_funcs(prop, "rna_Test_imarr_get", "rna_Test_imarr_set", NULL); RNA_def_property_int_funcs(prop, "rna_Test_imarr_get", "rna_Test_imarr_set", NULL);
prop= RNA_def_property(srna, "bmarr", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "bmarr", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_multidimensional_array(prop, MARRAY_SIZE(int), MARRAY_TOTDIM, dimsize); RNA_def_property_multidimensional_array(prop, MARRAY_SIZE(int), MARRAY_TOTDIM, dimsize);
RNA_def_property_boolean_funcs(prop, "rna_Test_bmarr_get", "rna_Test_bmarr_set"); RNA_def_property_boolean_funcs(prop, "rna_Test_bmarr_get", "rna_Test_bmarr_set");
/* dynamic multidimensional arrays */ /* dynamic multidimensional arrays */
prop= RNA_def_property(srna, "fdmarr", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "fdmarr", PROP_FLOAT, PROP_NONE);
RNA_def_property_multidimensional_array(prop, DYNAMIC_MARRAY_SIZE(float), MARRAY_TOTDIM, dimsize); RNA_def_property_multidimensional_array(prop, DYNAMIC_MARRAY_SIZE(float), MARRAY_TOTDIM, dimsize);
RNA_def_property_flag(prop, PROP_DYNAMIC); RNA_def_property_flag(prop, PROP_DYNAMIC);
RNA_def_property_dynamic_array_funcs(prop, "rna_Test_fdmarr_get_length", "rna_Test_fdmarr_set_length"); RNA_def_property_dynamic_array_funcs(prop, "rna_Test_fdmarr_get_length", "rna_Test_fdmarr_set_length");
RNA_def_property_float_funcs(prop, "rna_Test_fdmarr_get", "rna_Test_fdmarr_set", NULL); RNA_def_property_float_funcs(prop, "rna_Test_fdmarr_get", "rna_Test_fdmarr_set", NULL);
prop= RNA_def_property(srna, "idmarr", PROP_INT, PROP_NONE); prop = RNA_def_property(srna, "idmarr", PROP_INT, PROP_NONE);
RNA_def_property_multidimensional_array(prop, DYNAMIC_MARRAY_SIZE(int), MARRAY_TOTDIM, dimsize); RNA_def_property_multidimensional_array(prop, DYNAMIC_MARRAY_SIZE(int), MARRAY_TOTDIM, dimsize);
RNA_def_property_flag(prop, PROP_DYNAMIC); RNA_def_property_flag(prop, PROP_DYNAMIC);
RNA_def_property_dynamic_array_funcs(prop, "rna_Test_idmarr_get_length", "rna_Test_idmarr_set_length"); RNA_def_property_dynamic_array_funcs(prop, "rna_Test_idmarr_get_length", "rna_Test_idmarr_set_length");
RNA_def_property_int_funcs(prop, "rna_Test_idmarr_get", "rna_Test_idmarr_set", NULL); RNA_def_property_int_funcs(prop, "rna_Test_idmarr_get", "rna_Test_idmarr_set", NULL);
prop= RNA_def_property(srna, "bdmarr", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "bdmarr", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_multidimensional_array(prop, DYNAMIC_MARRAY_SIZE(int), MARRAY_TOTDIM, dimsize); RNA_def_property_multidimensional_array(prop, DYNAMIC_MARRAY_SIZE(int), MARRAY_TOTDIM, dimsize);
RNA_def_property_flag(prop, PROP_DYNAMIC); RNA_def_property_flag(prop, PROP_DYNAMIC);
RNA_def_property_dynamic_array_funcs(prop, "rna_Test_bdmarr_get_length", "rna_Test_bdmarr_set_length"); RNA_def_property_dynamic_array_funcs(prop, "rna_Test_bdmarr_get_length", "rna_Test_bdmarr_set_length");

View File

@@ -46,70 +46,70 @@ int text_file_modified(Text *text); /* XXX bad level call */
static void rna_Text_filename_get(PointerRNA *ptr, char *value) static void rna_Text_filename_get(PointerRNA *ptr, char *value)
{ {
Text *text= (Text*)ptr->data; Text *text = (Text*)ptr->data;
if(text->name) if (text->name)
strcpy(value, text->name); strcpy(value, text->name);
else else
value[0]= '\0'; value[0] = '\0';
} }
static int rna_Text_filename_length(PointerRNA *ptr) static int rna_Text_filename_length(PointerRNA *ptr)
{ {
Text *text= (Text*)ptr->data; Text *text = (Text*)ptr->data;
return (text->name)? strlen(text->name): 0; return (text->name)? strlen(text->name): 0;
} }
static void rna_Text_filename_set(PointerRNA *ptr, const char *value) static void rna_Text_filename_set(PointerRNA *ptr, const char *value)
{ {
Text *text= (Text*)ptr->data; Text *text = (Text*)ptr->data;
if(text->name) if (text->name)
MEM_freeN(text->name); MEM_freeN(text->name);
if(value[0]) if (value[0])
text->name= BLI_strdup(value); text->name = BLI_strdup(value);
else else
text->name= NULL; text->name = NULL;
} }
static int rna_Text_modified_get(PointerRNA *ptr) static int rna_Text_modified_get(PointerRNA *ptr)
{ {
Text *text= (Text*)ptr->data; Text *text = (Text*)ptr->data;
return text_file_modified(text); return text_file_modified(text);
} }
static void rna_TextLine_body_get(PointerRNA *ptr, char *value) static void rna_TextLine_body_get(PointerRNA *ptr, char *value)
{ {
TextLine *line= (TextLine*)ptr->data; TextLine *line = (TextLine*)ptr->data;
if(line->line) if (line->line)
strcpy(value, line->line); strcpy(value, line->line);
else else
value[0]= '\0'; value[0] = '\0';
} }
static int rna_TextLine_body_length(PointerRNA *ptr) static int rna_TextLine_body_length(PointerRNA *ptr)
{ {
TextLine *line= (TextLine*)ptr->data; TextLine *line = (TextLine*)ptr->data;
return line->len; return line->len;
} }
static void rna_TextLine_body_set(PointerRNA *ptr, const char *value) static void rna_TextLine_body_set(PointerRNA *ptr, const char *value)
{ {
TextLine *line= (TextLine*)ptr->data; TextLine *line = (TextLine*)ptr->data;
int len= strlen(value); int len = strlen(value);
if(line->line) if (line->line)
MEM_freeN(line->line); MEM_freeN(line->line);
line->line= MEM_mallocN((len + 1) * sizeof(char), "rna_text_body"); line->line = MEM_mallocN((len + 1) * sizeof(char), "rna_text_body");
line->len= len; line->len = len;
memcpy(line->line, value, len + 1); memcpy(line->line, value, len + 1);
if(line->format) { if (line->format) {
MEM_freeN(line->format); MEM_freeN(line->format);
line->format= NULL; line->format = NULL;
} }
} }
@@ -123,7 +123,7 @@ static void rna_def_text_line(BlenderRNA *brna)
srna = RNA_def_struct(brna, "TextLine", NULL); srna = RNA_def_struct(brna, "TextLine", NULL);
RNA_def_struct_ui_text(srna, "Text Line", "Line of text in a Text datablock"); RNA_def_struct_ui_text(srna, "Text Line", "Line of text in a Text datablock");
prop= RNA_def_property(srna, "body", PROP_STRING, PROP_NONE); prop = RNA_def_property(srna, "body", PROP_STRING, PROP_NONE);
RNA_def_property_string_funcs(prop, "rna_TextLine_body_get", "rna_TextLine_body_length", "rna_TextLine_body_set"); RNA_def_property_string_funcs(prop, "rna_TextLine_body_get", "rna_TextLine_body_length", "rna_TextLine_body_set");
RNA_def_property_ui_text(prop, "Line", "Text in the line"); RNA_def_property_ui_text(prop, "Line", "Text in the line");
RNA_def_property_update(prop, NC_TEXT|NA_EDITED, NULL); RNA_def_property_update(prop, NC_TEXT|NA_EDITED, NULL);
@@ -137,37 +137,37 @@ static void rna_def_text_marker(BlenderRNA *brna)
srna = RNA_def_struct(brna, "TextMarker", NULL); srna = RNA_def_struct(brna, "TextMarker", NULL);
RNA_def_struct_ui_text(srna, "Text Marker", "Marker highlighting a portion of text in a Text datablock"); RNA_def_struct_ui_text(srna, "Text Marker", "Marker highlighting a portion of text in a Text datablock");
prop= RNA_def_property(srna, "line", PROP_INT, PROP_UNSIGNED); prop = RNA_def_property(srna, "line", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "lineno"); RNA_def_property_int_sdna(prop, NULL, "lineno");
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Line", "Line in which the marker is located"); RNA_def_property_ui_text(prop, "Line", "Line in which the marker is located");
prop= RNA_def_property(srna, "character_index_start", PROP_INT, PROP_UNSIGNED); prop = RNA_def_property(srna, "character_index_start", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "start"); RNA_def_property_int_sdna(prop, NULL, "start");
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Start", "Start position of the marker in the line"); RNA_def_property_ui_text(prop, "Start", "Start position of the marker in the line");
prop= RNA_def_property(srna, "character_index_end", PROP_INT, PROP_UNSIGNED); prop = RNA_def_property(srna, "character_index_end", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "end"); RNA_def_property_int_sdna(prop, NULL, "end");
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "End", "Start position of the marker in the line"); RNA_def_property_ui_text(prop, "End", "Start position of the marker in the line");
prop= RNA_def_property(srna, "group", PROP_INT, PROP_UNSIGNED); prop = RNA_def_property(srna, "group", PROP_INT, PROP_UNSIGNED);
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_range(prop, 0, (int)0xFFFF); RNA_def_property_range(prop, 0, (int)0xFFFF);
RNA_def_property_ui_text(prop, "Group", ""); RNA_def_property_ui_text(prop, "Group", "");
prop= RNA_def_property(srna, "is_temporary", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "is_temporary", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", TMARK_TEMP); RNA_def_property_boolean_sdna(prop, NULL, "flags", TMARK_TEMP);
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Temporary", "Marker is temporary"); RNA_def_property_ui_text(prop, "Temporary", "Marker is temporary");
prop= RNA_def_property(srna, "use_edit_all", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_edit_all", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", TMARK_EDITALL); RNA_def_property_boolean_sdna(prop, NULL, "flags", TMARK_EDITALL);
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Edit All", "Edit all markers of the same group as one"); RNA_def_property_ui_text(prop, "Edit All", "Edit all markers of the same group as one");
prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR_GAMMA); prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Color", "Color to display the marker with"); RNA_def_property_ui_text(prop, "Color", "Color to display the marker with");
} }
@@ -182,62 +182,62 @@ static void rna_def_text(BlenderRNA *brna)
RNA_def_struct_ui_icon(srna, ICON_TEXT); RNA_def_struct_ui_icon(srna, ICON_TEXT);
RNA_def_struct_clear_flag(srna, STRUCT_ID_REFCOUNT); RNA_def_struct_clear_flag(srna, STRUCT_ID_REFCOUNT);
prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_NONE); prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_NONE);
RNA_def_property_string_funcs(prop, "rna_Text_filename_get", "rna_Text_filename_length", "rna_Text_filename_set"); RNA_def_property_string_funcs(prop, "rna_Text_filename_get", "rna_Text_filename_length", "rna_Text_filename_set");
RNA_def_property_ui_text(prop, "File Path", "Filename of the text file"); RNA_def_property_ui_text(prop, "File Path", "Filename of the text file");
prop= RNA_def_property(srna, "is_dirty", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "is_dirty", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", TXT_ISDIRTY); RNA_def_property_boolean_sdna(prop, NULL, "flags", TXT_ISDIRTY);
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Dirty", "Text file has been edited since last save"); RNA_def_property_ui_text(prop, "Dirty", "Text file has been edited since last save");
prop= RNA_def_property(srna, "is_modified", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "is_modified", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_funcs(prop, "rna_Text_modified_get", NULL); RNA_def_property_boolean_funcs(prop, "rna_Text_modified_get", NULL);
RNA_def_property_ui_text(prop, "Modified", "Text file on disk is different than the one in memory"); RNA_def_property_ui_text(prop, "Modified", "Text file on disk is different than the one in memory");
prop= RNA_def_property(srna, "is_in_memory", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "is_in_memory", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", TXT_ISMEM); RNA_def_property_boolean_sdna(prop, NULL, "flags", TXT_ISMEM);
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Memory", "Text file is in memory, without a corresponding file on disk"); RNA_def_property_ui_text(prop, "Memory", "Text file is in memory, without a corresponding file on disk");
prop= RNA_def_property(srna, "use_module", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_module", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", TXT_ISSCRIPT); RNA_def_property_boolean_sdna(prop, NULL, "flags", TXT_ISSCRIPT);
RNA_def_property_ui_text(prop, "Register", "Register this text as a module on loading, Text name must end with \".py\""); RNA_def_property_ui_text(prop, "Register", "Register this text as a module on loading, Text name must end with \".py\"");
prop= RNA_def_property(srna, "use_tabs_as_spaces", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_tabs_as_spaces", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", TXT_TABSTOSPACES); RNA_def_property_boolean_sdna(prop, NULL, "flags", TXT_TABSTOSPACES);
RNA_def_property_ui_text(prop, "Tabs as Spaces", "Automatically converts all new tabs into spaces"); RNA_def_property_ui_text(prop, "Tabs as Spaces", "Automatically converts all new tabs into spaces");
prop= RNA_def_property(srna, "lines", PROP_COLLECTION, PROP_NONE); prop = RNA_def_property(srna, "lines", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "TextLine"); RNA_def_property_struct_type(prop, "TextLine");
RNA_def_property_ui_text(prop, "Lines", "Lines of text"); RNA_def_property_ui_text(prop, "Lines", "Lines of text");
prop= RNA_def_property(srna, "current_line", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "current_line", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "curl"); RNA_def_property_pointer_sdna(prop, NULL, "curl");
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "TextLine"); RNA_def_property_struct_type(prop, "TextLine");
RNA_def_property_ui_text(prop, "Current Line", "Current line, and start line of selection if one exists"); RNA_def_property_ui_text(prop, "Current Line", "Current line, and start line of selection if one exists");
prop= RNA_def_property(srna, "current_character", PROP_INT, PROP_UNSIGNED); prop = RNA_def_property(srna, "current_character", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "curc"); RNA_def_property_int_sdna(prop, NULL, "curc");
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Current Character", "Index of current character in current line, and also start index of character in selection if one exists"); RNA_def_property_ui_text(prop, "Current Character", "Index of current character in current line, and also start index of character in selection if one exists");
prop= RNA_def_property(srna, "select_end_line", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "select_end_line", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "sell"); RNA_def_property_pointer_sdna(prop, NULL, "sell");
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "TextLine"); RNA_def_property_struct_type(prop, "TextLine");
RNA_def_property_ui_text(prop, "Selection End Line", "End line of selection"); RNA_def_property_ui_text(prop, "Selection End Line", "End line of selection");
prop= RNA_def_property(srna, "select_end_character", PROP_INT, PROP_UNSIGNED); prop = RNA_def_property(srna, "select_end_character", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "selc"); RNA_def_property_int_sdna(prop, NULL, "selc");
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Selection End Character", "Index of character after end of selection in the selection end line"); RNA_def_property_ui_text(prop, "Selection End Character", "Index of character after end of selection in the selection end line");
prop= RNA_def_property(srna, "markers", PROP_COLLECTION, PROP_NONE); prop = RNA_def_property(srna, "markers", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "TextMarker"); RNA_def_property_struct_type(prop, "TextMarker");
RNA_def_property_ui_text(prop, "Markers", "Text markers highlighting part of the text"); RNA_def_property_ui_text(prop, "Markers", "Text markers highlighting part of the text");

View File

@@ -54,12 +54,12 @@ void RNA_api_text(StructRNA *srna)
FunctionRNA *func; FunctionRNA *func;
PropertyRNA *prop; PropertyRNA *prop;
func= RNA_def_function(srna, "clear", "rna_Text_clear"); func = RNA_def_function(srna, "clear", "rna_Text_clear");
RNA_def_function_ui_description(func, "clear the text block"); RNA_def_function_ui_description(func, "clear the text block");
func= RNA_def_function(srna, "write", "rna_Text_write"); func = RNA_def_function(srna, "write", "rna_Text_write");
RNA_def_function_ui_description(func, "write text at the cursor location and advance to the end of the text block"); RNA_def_function_ui_description(func, "write text at the cursor location and advance to the end of the text block");
prop= RNA_def_string(func, "text", "Text", 0, "", "New text for this datablock"); prop = RNA_def_string(func, "text", "Text", 0, "", "New text for this datablock");
RNA_def_property_flag(prop, PROP_REQUIRED); RNA_def_property_flag(prop, PROP_REQUIRED);
} }

File diff suppressed because it is too large Load Diff

View File

@@ -59,7 +59,7 @@ void clear_envmap(struct EnvMap *env, bContext *C)
BKE_free_envmapdata(env); BKE_free_envmapdata(env);
for (tex=bmain->tex.first; tex; tex=tex->id.next) for (tex = bmain->tex.first; tex; tex = tex->id.next)
if (tex->env == env) { if (tex->env == env) {
WM_event_add_notifier(C, NC_TEXTURE|NA_EDITED, tex); WM_event_add_notifier(C, NC_TEXTURE|NA_EDITED, tex);
break; break;
@@ -68,7 +68,7 @@ void clear_envmap(struct EnvMap *env, bContext *C)
void texture_evaluate(struct Tex *tex, float value[3], float color_r[4]) void texture_evaluate(struct Tex *tex, float value[3], float color_r[4])
{ {
TexResult texres= {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0, NULL}; TexResult texres = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0, NULL};
multitex_ext(tex, value, NULL, NULL, 1, &texres); multitex_ext(tex, value, NULL, NULL, 1, &texres);
color_r[0] = texres.tr; color_r[0] = texres.tr;
@@ -84,14 +84,14 @@ void RNA_api_texture(StructRNA *srna)
FunctionRNA *func; FunctionRNA *func;
PropertyRNA *parm; PropertyRNA *parm;
func= RNA_def_function(srna, "evaluate", "texture_evaluate"); func = RNA_def_function(srna, "evaluate", "texture_evaluate");
RNA_def_function_ui_description(func, "Evaluate the texture at the coordinates given"); RNA_def_function_ui_description(func, "Evaluate the texture at the coordinates given");
parm= RNA_def_float_vector(func, "value", 3, NULL, -FLT_MAX, FLT_MAX, "", "", -1e4, 1e4); parm = RNA_def_float_vector(func, "value", 3, NULL, -FLT_MAX, FLT_MAX, "", "", -1e4, 1e4);
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
/* return location and normal */ /* return location and normal */
parm= RNA_def_float_vector(func, "result", 4, NULL, -FLT_MAX, FLT_MAX, "Result", NULL, -1e4, 1e4); parm = RNA_def_float_vector(func, "result", 4, NULL, -FLT_MAX, FLT_MAX, "Result", NULL, -1e4, 1e4);
RNA_def_property_flag(parm, PROP_THICK_WRAP); RNA_def_property_flag(parm, PROP_THICK_WRAP);
RNA_def_function_output(func, parm); RNA_def_function_output(func, parm);
@@ -104,16 +104,16 @@ void RNA_api_environment_map(StructRNA *srna)
static const float default_layout[] = { 0,0, 1,0, 2,0, 0,1, 1,1, 2,1 }; static const float default_layout[] = { 0,0, 1,0, 2,0, 0,1, 1,1, 2,1 };
func= RNA_def_function(srna, "clear", "clear_envmap"); func = RNA_def_function(srna, "clear", "clear_envmap");
RNA_def_function_ui_description(func, "Discard the environment map and free it from memory"); RNA_def_function_ui_description(func, "Discard the environment map and free it from memory");
RNA_def_function_flag(func, FUNC_USE_CONTEXT); RNA_def_function_flag(func, FUNC_USE_CONTEXT);
func= RNA_def_function(srna,"save", "save_envmap"); func = RNA_def_function(srna,"save", "save_envmap");
RNA_def_function_ui_description(func, "Save the environment map to disc using the scene render settings"); RNA_def_function_ui_description(func, "Save the environment map to disc using the scene render settings");
RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS); RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
parm= RNA_def_string_file_name(func,"filepath","",FILE_MAX,"File path","Location of the output file"); parm = RNA_def_string_file_name(func,"filepath","",FILE_MAX,"File path","Location of the output file");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_pointer(func, "scene", "Scene", "", "Overrides the scene from which image parameters are taken"); RNA_def_pointer(func, "scene", "Scene", "", "Overrides the scene from which image parameters are taken");

View File

@@ -44,27 +44,27 @@ static void rna_def_timeline_marker(BlenderRNA *brna)
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
srna= RNA_def_struct(brna, "TimelineMarker", NULL); srna = RNA_def_struct(brna, "TimelineMarker", NULL);
RNA_def_struct_sdna(srna, "TimeMarker"); RNA_def_struct_sdna(srna, "TimeMarker");
RNA_def_struct_ui_text(srna, "Marker", "Marker for noting points in the timeline"); RNA_def_struct_ui_text(srna, "Marker", "Marker for noting points in the timeline");
/* String values */ /* String values */
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Name", ""); RNA_def_property_ui_text(prop, "Name", "");
RNA_def_struct_name_property(srna, prop); RNA_def_struct_name_property(srna, prop);
RNA_def_property_update(prop, NC_ANIMATION, NULL); RNA_def_property_update(prop, NC_ANIMATION, NULL);
prop= RNA_def_property(srna, "frame", PROP_INT, PROP_TIME); prop = RNA_def_property(srna, "frame", PROP_INT, PROP_TIME);
RNA_def_property_ui_text(prop, "Frame", "The frame on which the timeline marker appears"); RNA_def_property_ui_text(prop, "Frame", "The frame on which the timeline marker appears");
RNA_def_property_update(prop, NC_ANIMATION, NULL); RNA_def_property_update(prop, NC_ANIMATION, NULL);
prop= RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", 1 /*SELECT*/); RNA_def_property_boolean_sdna(prop, NULL, "flag", 1 /*SELECT*/);
RNA_def_property_ui_text(prop, "Select", "Marker selection state"); RNA_def_property_ui_text(prop, "Select", "Marker selection state");
RNA_def_property_update(prop, NC_ANIMATION, NULL); RNA_def_property_update(prop, NC_ANIMATION, NULL);
#ifdef DURIAN_CAMERA_SWITCH #ifdef DURIAN_CAMERA_SWITCH
prop= RNA_def_property(srna, "camera", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "camera", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Object"); RNA_def_property_struct_type(prop, "Object");
RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK); RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
RNA_def_property_ui_text(prop, "Camera", "Camera this timeline sets to active"); RNA_def_property_ui_text(prop, "Camera", "Camera this timeline sets to active");

File diff suppressed because it is too large Load Diff

View File

@@ -75,15 +75,15 @@ static ARegionType *region_type_find(ReportList *reports, int space_type, int re
SpaceType *st; SpaceType *st;
ARegionType *art; ARegionType *art;
st= BKE_spacetype_from_id(space_type); st = BKE_spacetype_from_id(space_type);
for(art= (st)? st->regiontypes.first: NULL; art; art= art->next) { for (art = (st)? st->regiontypes.first: NULL; art; art = art->next) {
if (art->regionid==region_type) if (art->regionid == region_type)
break; break;
} }
/* region type not found? abort */ /* region type not found? abort */
if (art==NULL) { if (art == NULL) {
BKE_report(reports, RPT_ERROR, "Region not found in spacetype"); BKE_report(reports, RPT_ERROR, "Region not found in spacetype");
return NULL; return NULL;
} }
@@ -104,14 +104,14 @@ static int panel_poll(const bContext *C, PanelType *pt)
int visible; int visible;
RNA_pointer_create(NULL, pt->ext.srna, NULL, &ptr); /* dummy */ RNA_pointer_create(NULL, pt->ext.srna, NULL, &ptr); /* dummy */
func= &rna_Panel_poll_func; /* RNA_struct_find_function(&ptr, "poll"); */ func = &rna_Panel_poll_func; /* RNA_struct_find_function(&ptr, "poll"); */
RNA_parameter_list_create(&list, &ptr, func); RNA_parameter_list_create(&list, &ptr, func);
RNA_parameter_set_lookup(&list, "context", &C); RNA_parameter_set_lookup(&list, "context", &C);
pt->ext.call((bContext *)C, &ptr, func, &list); pt->ext.call((bContext *)C, &ptr, func, &list);
RNA_parameter_get_lookup(&list, "visible", &ret); RNA_parameter_get_lookup(&list, "visible", &ret);
visible= *(int*)ret; visible = *(int*)ret;
RNA_parameter_list_free(&list); RNA_parameter_list_free(&list);
@@ -127,7 +127,7 @@ static void panel_draw(const bContext *C, Panel *pnl)
FunctionRNA *func; FunctionRNA *func;
RNA_pointer_create(&CTX_wm_screen(C)->id, pnl->type->ext.srna, pnl, &ptr); RNA_pointer_create(&CTX_wm_screen(C)->id, pnl->type->ext.srna, pnl, &ptr);
func= &rna_Panel_draw_func;/* RNA_struct_find_function(&ptr, "draw"); */ func = &rna_Panel_draw_func;/* RNA_struct_find_function(&ptr, "draw"); */
RNA_parameter_list_create(&list, &ptr, func); RNA_parameter_list_create(&list, &ptr, func);
RNA_parameter_set_lookup(&list, "context", &C); RNA_parameter_set_lookup(&list, "context", &C);
@@ -145,7 +145,7 @@ static void panel_draw_header(const bContext *C, Panel *pnl)
FunctionRNA *func; FunctionRNA *func;
RNA_pointer_create(&CTX_wm_screen(C)->id, pnl->type->ext.srna, pnl, &ptr); RNA_pointer_create(&CTX_wm_screen(C)->id, pnl->type->ext.srna, pnl, &ptr);
func= &rna_Panel_draw_header_func; /* RNA_struct_find_function(&ptr, "draw_header"); */ func = &rna_Panel_draw_header_func; /* RNA_struct_find_function(&ptr, "draw_header"); */
RNA_parameter_list_create(&list, &ptr, func); RNA_parameter_list_create(&list, &ptr, func);
RNA_parameter_set_lookup(&list, "context", &C); RNA_parameter_set_lookup(&list, "context", &C);
@@ -157,11 +157,11 @@ static void panel_draw_header(const bContext *C, Panel *pnl)
static void rna_Panel_unregister(Main *UNUSED(bmain), StructRNA *type) static void rna_Panel_unregister(Main *UNUSED(bmain), StructRNA *type)
{ {
ARegionType *art; ARegionType *art;
PanelType *pt= RNA_struct_blender_type_get(type); PanelType *pt = RNA_struct_blender_type_get(type);
if(!pt) if (!pt)
return; return;
if(!(art=region_type_find(NULL, pt->space_type, pt->region_type))) if (!(art = region_type_find(NULL, pt->space_type, pt->region_type)))
return; return;
RNA_struct_free_extension(type, &pt->ext); RNA_struct_free_extension(type, &pt->ext);
@@ -178,31 +178,31 @@ static StructRNA *rna_Panel_register(Main *bmain, ReportList *reports, void *dat
{ {
ARegionType *art; ARegionType *art;
PanelType *pt, dummypt = {NULL}; PanelType *pt, dummypt = {NULL};
Panel dummypanel= {NULL}; Panel dummypanel = {NULL};
PointerRNA dummyptr; PointerRNA dummyptr;
int have_function[3]; int have_function[3];
/* setup dummy panel & panel type to store static properties in */ /* setup dummy panel & panel type to store static properties in */
dummypanel.type= &dummypt; dummypanel.type = &dummypt;
RNA_pointer_create(NULL, &RNA_Panel, &dummypanel, &dummyptr); RNA_pointer_create(NULL, &RNA_Panel, &dummypanel, &dummyptr);
/* validate the python class */ /* validate the python class */
if(validate(&dummyptr, data, have_function) != 0) if (validate(&dummyptr, data, have_function) != 0)
return NULL; return NULL;
if(strlen(identifier) >= sizeof(dummypt.idname)) { if (strlen(identifier) >= sizeof(dummypt.idname)) {
BKE_reportf(reports, RPT_ERROR, "registering panel class: '%s' is too long, maximum length is %d", BKE_reportf(reports, RPT_ERROR, "registering panel class: '%s' is too long, maximum length is %d",
identifier, (int)sizeof(dummypt.idname)); identifier, (int)sizeof(dummypt.idname));
return NULL; return NULL;
} }
if(!(art=region_type_find(reports, dummypt.space_type, dummypt.region_type))) if (!(art = region_type_find(reports, dummypt.space_type, dummypt.region_type)))
return NULL; return NULL;
/* check if we have registered this panel type before, and remove it */ /* check if we have registered this panel type before, and remove it */
for(pt=art->paneltypes.first; pt; pt=pt->next) { for (pt = art->paneltypes.first; pt; pt = pt->next) {
if(strcmp(pt->idname, dummypt.idname) == 0) { if (strcmp(pt->idname, dummypt.idname) == 0) {
if(pt->ext.srna) if (pt->ext.srna)
rna_Panel_unregister(bmain, pt->ext.srna); rna_Panel_unregister(bmain, pt->ext.srna);
else else
BLI_freelinkN(&art->paneltypes, pt); BLI_freelinkN(&art->paneltypes, pt);
@@ -211,27 +211,27 @@ static StructRNA *rna_Panel_register(Main *bmain, ReportList *reports, void *dat
} }
/* create a new panel type */ /* create a new panel type */
pt= MEM_callocN(sizeof(PanelType), "python buttons panel"); pt = MEM_callocN(sizeof(PanelType), "python buttons panel");
memcpy(pt, &dummypt, sizeof(dummypt)); memcpy(pt, &dummypt, sizeof(dummypt));
pt->ext.srna= RNA_def_struct(&BLENDER_RNA, pt->idname, "Panel"); pt->ext.srna = RNA_def_struct(&BLENDER_RNA, pt->idname, "Panel");
pt->ext.data= data; pt->ext.data = data;
pt->ext.call= call; pt->ext.call = call;
pt->ext.free= free; pt->ext.free = free;
RNA_struct_blender_type_set(pt->ext.srna, pt); RNA_struct_blender_type_set(pt->ext.srna, pt);
RNA_def_struct_flag(pt->ext.srna, STRUCT_NO_IDPROPERTIES); RNA_def_struct_flag(pt->ext.srna, STRUCT_NO_IDPROPERTIES);
pt->poll= (have_function[0])? panel_poll: NULL; pt->poll = (have_function[0])? panel_poll: NULL;
pt->draw= (have_function[1])? panel_draw: NULL; pt->draw = (have_function[1])? panel_draw: NULL;
pt->draw_header= (have_function[2])? panel_draw_header: NULL; pt->draw_header = (have_function[2])? panel_draw_header: NULL;
/* XXX use "no header" flag for some ordering of panels until we have real panel ordering */ /* XXX use "no header" flag for some ordering of panels until we have real panel ordering */
if(pt->flag & PNL_NO_HEADER) { if (pt->flag & PNL_NO_HEADER) {
PanelType *pth = art->paneltypes.first; PanelType *pth = art->paneltypes.first;
while(pth && pth->flag & PNL_NO_HEADER) while (pth && pth->flag & PNL_NO_HEADER)
pth=pth->next; pth = pth->next;
if(pth) if (pth)
BLI_insertlinkbefore(&art->paneltypes, pth, pt); BLI_insertlinkbefore(&art->paneltypes, pth, pt);
else else
BLI_addtail(&art->paneltypes, pt); BLI_addtail(&art->paneltypes, pt);
@@ -247,7 +247,7 @@ static StructRNA *rna_Panel_register(Main *bmain, ReportList *reports, void *dat
static StructRNA* rna_Panel_refine(PointerRNA *ptr) static StructRNA* rna_Panel_refine(PointerRNA *ptr)
{ {
Panel *hdr= (Panel*)ptr->data; Panel *hdr = (Panel*)ptr->data;
return (hdr->type && hdr->type->ext.srna)? hdr->type->ext.srna: &RNA_Panel; return (hdr->type && hdr->type->ext.srna)? hdr->type->ext.srna: &RNA_Panel;
} }
@@ -262,7 +262,7 @@ static void header_draw(const bContext *C, Header *hdr)
FunctionRNA *func; FunctionRNA *func;
RNA_pointer_create(&CTX_wm_screen(C)->id, hdr->type->ext.srna, hdr, &htr); RNA_pointer_create(&CTX_wm_screen(C)->id, hdr->type->ext.srna, hdr, &htr);
func= &rna_Header_draw_func; /* RNA_struct_find_function(&htr, "draw"); */ func = &rna_Header_draw_func; /* RNA_struct_find_function(&htr, "draw"); */
RNA_parameter_list_create(&list, &htr, func); RNA_parameter_list_create(&list, &htr, func);
RNA_parameter_set_lookup(&list, "context", &C); RNA_parameter_set_lookup(&list, "context", &C);
@@ -274,11 +274,11 @@ static void header_draw(const bContext *C, Header *hdr)
static void rna_Header_unregister(Main *UNUSED(bmain), StructRNA *type) static void rna_Header_unregister(Main *UNUSED(bmain), StructRNA *type)
{ {
ARegionType *art; ARegionType *art;
HeaderType *ht= RNA_struct_blender_type_get(type); HeaderType *ht = RNA_struct_blender_type_get(type);
if(!ht) if (!ht)
return; return;
if(!(art=region_type_find(NULL, ht->space_type, RGN_TYPE_HEADER))) if (!(art = region_type_find(NULL, ht->space_type, RGN_TYPE_HEADER)))
return; return;
RNA_struct_free_extension(type, &ht->ext); RNA_struct_free_extension(type, &ht->ext);
@@ -295,47 +295,47 @@ static StructRNA *rna_Header_register(Main *bmain, ReportList *reports, void *da
{ {
ARegionType *art; ARegionType *art;
HeaderType *ht, dummyht = {NULL}; HeaderType *ht, dummyht = {NULL};
Header dummyheader= {NULL}; Header dummyheader = {NULL};
PointerRNA dummyhtr; PointerRNA dummyhtr;
int have_function[1]; int have_function[1];
/* setup dummy header & header type to store static properties in */ /* setup dummy header & header type to store static properties in */
dummyheader.type= &dummyht; dummyheader.type = &dummyht;
RNA_pointer_create(NULL, &RNA_Header, &dummyheader, &dummyhtr); RNA_pointer_create(NULL, &RNA_Header, &dummyheader, &dummyhtr);
/* validate the python class */ /* validate the python class */
if(validate(&dummyhtr, data, have_function) != 0) if (validate(&dummyhtr, data, have_function) != 0)
return NULL; return NULL;
if(strlen(identifier) >= sizeof(dummyht.idname)) { if (strlen(identifier) >= sizeof(dummyht.idname)) {
BKE_reportf(reports, RPT_ERROR, "registering header class: '%s' is too long, maximum length is %d", BKE_reportf(reports, RPT_ERROR, "registering header class: '%s' is too long, maximum length is %d",
identifier, (int)sizeof(dummyht.idname)); identifier, (int)sizeof(dummyht.idname));
return NULL; return NULL;
} }
if(!(art=region_type_find(reports, dummyht.space_type, RGN_TYPE_HEADER))) if (!(art = region_type_find(reports, dummyht.space_type, RGN_TYPE_HEADER)))
return NULL; return NULL;
/* check if we have registered this header type before, and remove it */ /* check if we have registered this header type before, and remove it */
for(ht=art->headertypes.first; ht; ht=ht->next) { for (ht = art->headertypes.first; ht; ht = ht->next) {
if(strcmp(ht->idname, dummyht.idname) == 0) { if (strcmp(ht->idname, dummyht.idname) == 0) {
if(ht->ext.srna) if (ht->ext.srna)
rna_Header_unregister(bmain, ht->ext.srna); rna_Header_unregister(bmain, ht->ext.srna);
break; break;
} }
} }
/* create a new header type */ /* create a new header type */
ht= MEM_callocN(sizeof(HeaderType), "python buttons header"); ht = MEM_callocN(sizeof(HeaderType), "python buttons header");
memcpy(ht, &dummyht, sizeof(dummyht)); memcpy(ht, &dummyht, sizeof(dummyht));
ht->ext.srna= RNA_def_struct(&BLENDER_RNA, ht->idname, "Header"); ht->ext.srna = RNA_def_struct(&BLENDER_RNA, ht->idname, "Header");
ht->ext.data= data; ht->ext.data = data;
ht->ext.call= call; ht->ext.call = call;
ht->ext.free= free; ht->ext.free = free;
RNA_struct_blender_type_set(ht->ext.srna, ht); RNA_struct_blender_type_set(ht->ext.srna, ht);
ht->draw= (have_function[0])? header_draw: NULL; ht->draw = (have_function[0])? header_draw: NULL;
BLI_addtail(&art->headertypes, ht); BLI_addtail(&art->headertypes, ht);
@@ -347,7 +347,7 @@ static StructRNA *rna_Header_register(Main *bmain, ReportList *reports, void *da
static StructRNA* rna_Header_refine(PointerRNA *htr) static StructRNA* rna_Header_refine(PointerRNA *htr)
{ {
Header *hdr= (Header*)htr->data; Header *hdr = (Header*)htr->data;
return (hdr->type && hdr->type->ext.srna)? hdr->type->ext.srna: &RNA_Header; return (hdr->type && hdr->type->ext.srna)? hdr->type->ext.srna: &RNA_Header;
} }
@@ -364,14 +364,14 @@ static int menu_poll(const bContext *C, MenuType *pt)
int visible; int visible;
RNA_pointer_create(NULL, pt->ext.srna, NULL, &ptr); /* dummy */ RNA_pointer_create(NULL, pt->ext.srna, NULL, &ptr); /* dummy */
func= &rna_Menu_poll_func; /* RNA_struct_find_function(&ptr, "poll"); */ func = &rna_Menu_poll_func; /* RNA_struct_find_function(&ptr, "poll"); */
RNA_parameter_list_create(&list, &ptr, func); RNA_parameter_list_create(&list, &ptr, func);
RNA_parameter_set_lookup(&list, "context", &C); RNA_parameter_set_lookup(&list, "context", &C);
pt->ext.call((bContext *)C, &ptr, func, &list); pt->ext.call((bContext *)C, &ptr, func, &list);
RNA_parameter_get_lookup(&list, "visible", &ret); RNA_parameter_get_lookup(&list, "visible", &ret);
visible= *(int*)ret; visible = *(int*)ret;
RNA_parameter_list_free(&list); RNA_parameter_list_free(&list);
@@ -387,7 +387,7 @@ static void menu_draw(const bContext *C, Menu *hdr)
FunctionRNA *func; FunctionRNA *func;
RNA_pointer_create(&CTX_wm_screen(C)->id, hdr->type->ext.srna, hdr, &mtr); RNA_pointer_create(&CTX_wm_screen(C)->id, hdr->type->ext.srna, hdr, &mtr);
func= &rna_Menu_draw_func; /* RNA_struct_find_function(&mtr, "draw"); */ func = &rna_Menu_draw_func; /* RNA_struct_find_function(&mtr, "draw"); */
RNA_parameter_list_create(&list, &mtr, func); RNA_parameter_list_create(&list, &mtr, func);
RNA_parameter_set_lookup(&list, "context", &C); RNA_parameter_set_lookup(&list, "context", &C);
@@ -398,9 +398,9 @@ static void menu_draw(const bContext *C, Menu *hdr)
static void rna_Menu_unregister(Main *UNUSED(bmain), StructRNA *type) static void rna_Menu_unregister(Main *UNUSED(bmain), StructRNA *type)
{ {
MenuType *mt= RNA_struct_blender_type_get(type); MenuType *mt = RNA_struct_blender_type_get(type);
if(!mt) if (!mt)
return; return;
RNA_struct_free_extension(type, &mt->ext); RNA_struct_free_extension(type, &mt->ext);
@@ -418,59 +418,59 @@ static StructRNA *rna_Menu_register(Main *bmain, ReportList *reports, void *data
StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free) StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free)
{ {
MenuType *mt, dummymt = {NULL}; MenuType *mt, dummymt = {NULL};
Menu dummymenu= {NULL}; Menu dummymenu = {NULL};
PointerRNA dummymtr; PointerRNA dummymtr;
int have_function[2]; int have_function[2];
size_t over_alloc= 0; /* warning, if this becomes a bess, we better do another alloc */ size_t over_alloc = 0; /* warning, if this becomes a bess, we better do another alloc */
size_t description_size= 0; size_t description_size = 0;
/* setup dummy menu & menu type to store static properties in */ /* setup dummy menu & menu type to store static properties in */
dummymenu.type= &dummymt; dummymenu.type = &dummymt;
dummymenu.type->description= _menu_descr; dummymenu.type->description = _menu_descr;
RNA_pointer_create(NULL, &RNA_Menu, &dummymenu, &dummymtr); RNA_pointer_create(NULL, &RNA_Menu, &dummymenu, &dummymtr);
/* clear incase they are left unset */ /* clear incase they are left unset */
_menu_descr[0]= '\0'; _menu_descr[0] = '\0';
/* validate the python class */ /* validate the python class */
if(validate(&dummymtr, data, have_function) != 0) if (validate(&dummymtr, data, have_function) != 0)
return NULL; return NULL;
if(strlen(identifier) >= sizeof(dummymt.idname)) { if (strlen(identifier) >= sizeof(dummymt.idname)) {
BKE_reportf(reports, RPT_ERROR, "registering menu class: '%s' is too long, maximum length is %d", BKE_reportf(reports, RPT_ERROR, "registering menu class: '%s' is too long, maximum length is %d",
identifier, (int)sizeof(dummymt.idname)); identifier, (int)sizeof(dummymt.idname));
return NULL; return NULL;
} }
/* check if we have registered this menu type before, and remove it */ /* check if we have registered this menu type before, and remove it */
mt= WM_menutype_find(dummymt.idname, TRUE); mt = WM_menutype_find(dummymt.idname, TRUE);
if(mt && mt->ext.srna) if (mt && mt->ext.srna)
rna_Menu_unregister(bmain, mt->ext.srna); rna_Menu_unregister(bmain, mt->ext.srna);
/* create a new menu type */ /* create a new menu type */
if (_menu_descr[0]) { if (_menu_descr[0]) {
description_size= strlen(_menu_descr) + 1; description_size = strlen(_menu_descr) + 1;
over_alloc += description_size; over_alloc += description_size;
} }
mt= MEM_callocN(sizeof(MenuType) + over_alloc, "python buttons menu"); mt = MEM_callocN(sizeof(MenuType) + over_alloc, "python buttons menu");
memcpy(mt, &dummymt, sizeof(dummymt)); memcpy(mt, &dummymt, sizeof(dummymt));
if (_menu_descr[0]) { if (_menu_descr[0]) {
char *buf= (char *)(mt + 1); char *buf = (char *)(mt + 1);
memcpy(buf, _menu_descr, description_size); memcpy(buf, _menu_descr, description_size);
mt->description= buf; mt->description = buf;
} }
mt->ext.srna= RNA_def_struct(&BLENDER_RNA, mt->idname, "Menu"); mt->ext.srna = RNA_def_struct(&BLENDER_RNA, mt->idname, "Menu");
mt->ext.data= data; mt->ext.data = data;
mt->ext.call= call; mt->ext.call = call;
mt->ext.free= free; mt->ext.free = free;
RNA_struct_blender_type_set(mt->ext.srna, mt); RNA_struct_blender_type_set(mt->ext.srna, mt);
RNA_def_struct_flag(mt->ext.srna, STRUCT_NO_IDPROPERTIES); RNA_def_struct_flag(mt->ext.srna, STRUCT_NO_IDPROPERTIES);
mt->poll= (have_function[0])? menu_poll: NULL; mt->poll = (have_function[0])? menu_poll: NULL;
mt->draw= (have_function[1])? menu_draw: NULL; mt->draw = (have_function[1])? menu_draw: NULL;
WM_menutype_add(mt); WM_menutype_add(mt);
@@ -482,15 +482,15 @@ static StructRNA *rna_Menu_register(Main *bmain, ReportList *reports, void *data
static StructRNA* rna_Menu_refine(PointerRNA *mtr) static StructRNA* rna_Menu_refine(PointerRNA *mtr)
{ {
Menu *hdr= (Menu*)mtr->data; Menu *hdr = (Menu*)mtr->data;
return (hdr->type && hdr->type->ext.srna)? hdr->type->ext.srna: &RNA_Menu; return (hdr->type && hdr->type->ext.srna)? hdr->type->ext.srna: &RNA_Menu;
} }
static void rna_Menu_bl_description_set(PointerRNA *ptr, const char *value) static void rna_Menu_bl_description_set(PointerRNA *ptr, const char *value)
{ {
Menu *data= (Menu*)(ptr->data); Menu *data = (Menu*)(ptr->data);
char *str= (char *)data->type->description; char *str = (char *)data->type->description;
if(!str[0]) BLI_strncpy(str, value, RNA_DYN_DESCR_MAX); /* utf8 already ensured */ if (!str[0]) BLI_strncpy(str, value, RNA_DYN_DESCR_MAX); /* utf8 already ensured */
else assert(!"setting the bl_description on a non-builtin menu"); else assert(!"setting the bl_description on a non-builtin menu");
} }
@@ -586,7 +586,7 @@ static void rna_UILayout_scale_y_set(PointerRNA *ptr, float value)
uiLayoutSetScaleY(ptr->data, value); uiLayoutSetScaleY(ptr->data, value);
} }
#else // RNA_RUNTIME #else /* RNA_RUNTIME */
static void rna_def_ui_layout(BlenderRNA *brna) static void rna_def_ui_layout(BlenderRNA *brna)
{ {
@@ -602,38 +602,38 @@ static void rna_def_ui_layout(BlenderRNA *brna)
/* layout */ /* layout */
srna= RNA_def_struct(brna, "UILayout", NULL); srna = RNA_def_struct(brna, "UILayout", NULL);
RNA_def_struct_sdna(srna, "uiLayout"); RNA_def_struct_sdna(srna, "uiLayout");
RNA_def_struct_ui_text(srna, "UI Layout", "User interface layout in a panel or header"); RNA_def_struct_ui_text(srna, "UI Layout", "User interface layout in a panel or header");
prop= RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_UILayout_active_get", "rna_UILayout_active_set"); RNA_def_property_boolean_funcs(prop, "rna_UILayout_active_get", "rna_UILayout_active_set");
prop= RNA_def_property(srna, "operator_context", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "operator_context", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, operator_context_items); RNA_def_property_enum_items(prop, operator_context_items);
RNA_def_property_enum_funcs(prop, "rna_UILayout_op_context_get", "rna_UILayout_op_context_set", NULL); RNA_def_property_enum_funcs(prop, "rna_UILayout_op_context_get", "rna_UILayout_op_context_set", NULL);
prop= RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_UILayout_enabled_get", "rna_UILayout_enabled_set"); RNA_def_property_boolean_funcs(prop, "rna_UILayout_enabled_get", "rna_UILayout_enabled_set");
RNA_def_property_ui_text(prop, "Enabled", "When false, this (sub)layout is greyed out"); RNA_def_property_ui_text(prop, "Enabled", "When false, this (sub)layout is greyed out");
prop= RNA_def_property(srna, "alert", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "alert", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_UILayout_alert_get", "rna_UILayout_alert_set"); RNA_def_property_boolean_funcs(prop, "rna_UILayout_alert_get", "rna_UILayout_alert_set");
prop= RNA_def_property(srna, "alignment", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "alignment", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, alignment_items); RNA_def_property_enum_items(prop, alignment_items);
RNA_def_property_enum_funcs(prop, "rna_UILayout_alignment_get", "rna_UILayout_alignment_set", NULL); RNA_def_property_enum_funcs(prop, "rna_UILayout_alignment_get", "rna_UILayout_alignment_set", NULL);
#if 0 #if 0
prop= RNA_def_property(srna, "keep_aspect", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "keep_aspect", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_UILayout_keep_aspect_get", "rna_UILayout_keep_aspect_set"); RNA_def_property_boolean_funcs(prop, "rna_UILayout_keep_aspect_get", "rna_UILayout_keep_aspect_set");
#endif #endif
prop= RNA_def_property(srna, "scale_x", PROP_FLOAT, PROP_UNSIGNED); prop = RNA_def_property(srna, "scale_x", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_float_funcs(prop, "rna_UILayout_scale_x_get", "rna_UILayout_scale_x_set", NULL); RNA_def_property_float_funcs(prop, "rna_UILayout_scale_x_get", "rna_UILayout_scale_x_set", NULL);
RNA_def_property_ui_text(prop, "Scale X", "Scale factor along the X for items in this (sub)layout"); RNA_def_property_ui_text(prop, "Scale X", "Scale factor along the X for items in this (sub)layout");
prop= RNA_def_property(srna, "scale_y", PROP_FLOAT, PROP_UNSIGNED); prop = RNA_def_property(srna, "scale_y", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_float_funcs(prop, "rna_UILayout_scale_y_get", "rna_UILayout_scale_y_set", NULL); RNA_def_property_float_funcs(prop, "rna_UILayout_scale_y_get", "rna_UILayout_scale_y_set", NULL);
RNA_def_property_ui_text(prop, "Scale Y", "Scale factor along the Y for items in this (sub)layout"); RNA_def_property_ui_text(prop, "Scale Y", "Scale factor along the Y for items in this (sub)layout");
RNA_api_ui_layout(srna); RNA_api_ui_layout(srna);
@@ -654,43 +654,43 @@ static void rna_def_panel(BlenderRNA *brna)
"arrow to collapse the panel and the label (see bl_label)"}, "arrow to collapse the panel and the label (see bl_label)"},
{0, NULL, 0, NULL, NULL}}; {0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "Panel", NULL); srna = RNA_def_struct(brna, "Panel", NULL);
RNA_def_struct_ui_text(srna, "Panel", "Panel containing UI elements"); RNA_def_struct_ui_text(srna, "Panel", "Panel containing UI elements");
RNA_def_struct_sdna(srna, "Panel"); RNA_def_struct_sdna(srna, "Panel");
RNA_def_struct_refine_func(srna, "rna_Panel_refine"); RNA_def_struct_refine_func(srna, "rna_Panel_refine");
RNA_def_struct_register_funcs(srna, "rna_Panel_register", "rna_Panel_unregister", NULL); RNA_def_struct_register_funcs(srna, "rna_Panel_register", "rna_Panel_unregister", NULL);
/* poll */ /* poll */
func= RNA_def_function(srna, "poll", NULL); func = RNA_def_function(srna, "poll", NULL);
RNA_def_function_ui_description(func, "If this method returns a non-null output, then the panel can be drawn"); RNA_def_function_ui_description(func, "If this method returns a non-null output, then the panel can be drawn");
RNA_def_function_flag(func, FUNC_NO_SELF|FUNC_REGISTER_OPTIONAL); RNA_def_function_flag(func, FUNC_NO_SELF|FUNC_REGISTER_OPTIONAL);
RNA_def_function_return(func, RNA_def_boolean(func, "visible", 1, "", "")); RNA_def_function_return(func, RNA_def_boolean(func, "visible", 1, "", ""));
parm= RNA_def_pointer(func, "context", "Context", "", ""); parm = RNA_def_pointer(func, "context", "Context", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
/* draw */ /* draw */
func= RNA_def_function(srna, "draw", NULL); func = RNA_def_function(srna, "draw", NULL);
RNA_def_function_ui_description(func, "Draw UI elements into the panel UI layout"); RNA_def_function_ui_description(func, "Draw UI elements into the panel UI layout");
RNA_def_function_flag(func, FUNC_REGISTER); RNA_def_function_flag(func, FUNC_REGISTER);
parm= RNA_def_pointer(func, "context", "Context", "", ""); parm = RNA_def_pointer(func, "context", "Context", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
func= RNA_def_function(srna, "draw_header", NULL); func = RNA_def_function(srna, "draw_header", NULL);
RNA_def_function_ui_description(func, "Draw UI elements into the panel's header UI layout"); RNA_def_function_ui_description(func, "Draw UI elements into the panel's header UI layout");
RNA_def_function_flag(func, FUNC_REGISTER); RNA_def_function_flag(func, FUNC_REGISTER);
parm= RNA_def_pointer(func, "context", "Context", "", ""); parm = RNA_def_pointer(func, "context", "Context", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
prop= RNA_def_property(srna, "layout", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "layout", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "UILayout"); RNA_def_property_struct_type(prop, "UILayout");
RNA_def_property_ui_text(prop, "Layout", "Defines the structure of the panel in the UI"); RNA_def_property_ui_text(prop, "Layout", "Defines the structure of the panel in the UI");
prop= RNA_def_property(srna, "text", PROP_STRING, PROP_NONE); prop = RNA_def_property(srna, "text", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "drawname"); RNA_def_property_string_sdna(prop, NULL, "drawname");
RNA_def_property_ui_text(prop, "Text", "XXX todo"); RNA_def_property_ui_text(prop, "Text", "XXX todo");
/* registration */ /* registration */
prop= RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE); prop = RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "type->idname"); RNA_def_property_string_sdna(prop, NULL, "type->idname");
RNA_def_property_flag(prop, PROP_REGISTER|PROP_NEVER_CLAMP); RNA_def_property_flag(prop, PROP_REGISTER|PROP_NEVER_CLAMP);
RNA_def_property_ui_text(prop, "ID Name", RNA_def_property_ui_text(prop, "ID Name",
@@ -702,33 +702,33 @@ static void rna_def_panel(BlenderRNA *brna)
/* panel's label indeed doesn't need PROP_TRANSLATE flag: translation of label happens in runtime /* panel's label indeed doesn't need PROP_TRANSLATE flag: translation of label happens in runtime
* when drawing panel and having this flag set will make runtime switching of language much more tricky * when drawing panel and having this flag set will make runtime switching of language much more tricky
* because label will be stored translated */ * because label will be stored translated */
prop= RNA_def_property(srna, "bl_label", PROP_STRING, PROP_NONE); prop = RNA_def_property(srna, "bl_label", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "type->label"); RNA_def_property_string_sdna(prop, NULL, "type->label");
RNA_def_property_flag(prop, PROP_REGISTER); RNA_def_property_flag(prop, PROP_REGISTER);
RNA_def_property_ui_text(prop, "Label", RNA_def_property_ui_text(prop, "Label",
"The panel label, shows up in the panel header at the right of the " "The panel label, shows up in the panel header at the right of the "
"triangle used to collapse the panel"); "triangle used to collapse the panel");
prop= RNA_def_property(srna, "bl_space_type", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "bl_space_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "type->space_type"); RNA_def_property_enum_sdna(prop, NULL, "type->space_type");
RNA_def_property_enum_items(prop, space_type_items); RNA_def_property_enum_items(prop, space_type_items);
RNA_def_property_flag(prop, PROP_REGISTER); RNA_def_property_flag(prop, PROP_REGISTER);
RNA_def_property_ui_text(prop, "Space type", "The space where the panel is going to be used in"); RNA_def_property_ui_text(prop, "Space type", "The space where the panel is going to be used in");
prop= RNA_def_property(srna, "bl_region_type", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "bl_region_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "type->region_type"); RNA_def_property_enum_sdna(prop, NULL, "type->region_type");
RNA_def_property_enum_items(prop, region_type_items); RNA_def_property_enum_items(prop, region_type_items);
RNA_def_property_flag(prop, PROP_REGISTER); RNA_def_property_flag(prop, PROP_REGISTER);
RNA_def_property_ui_text(prop, "Region Type", "The region where the panel is going to be used in"); RNA_def_property_ui_text(prop, "Region Type", "The region where the panel is going to be used in");
prop= RNA_def_property(srna, "bl_context", PROP_STRING, PROP_NONE); prop = RNA_def_property(srna, "bl_context", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "type->context"); RNA_def_property_string_sdna(prop, NULL, "type->context");
RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL); /* should this be optional? - Campbell */ RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL); /* should this be optional? - Campbell */
RNA_def_property_ui_text(prop, "Context", RNA_def_property_ui_text(prop, "Context",
"The context in which the panel belongs to. (TODO: explain the " "The context in which the panel belongs to. (TODO: explain the "
"possible combinations bl_context/bl_region_type/bl_space_type)"); "possible combinations bl_context/bl_region_type/bl_space_type)");
prop= RNA_def_property(srna, "bl_options", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "bl_options", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "type->flag"); RNA_def_property_enum_sdna(prop, NULL, "type->flag");
RNA_def_property_enum_items(prop, panel_flag_items); RNA_def_property_enum_items(prop, panel_flag_items);
RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL|PROP_ENUM_FLAG); RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL|PROP_ENUM_FLAG);
@@ -742,28 +742,28 @@ static void rna_def_header(BlenderRNA *brna)
PropertyRNA *parm; PropertyRNA *parm;
FunctionRNA *func; FunctionRNA *func;
srna= RNA_def_struct(brna, "Header", NULL); srna = RNA_def_struct(brna, "Header", NULL);
RNA_def_struct_ui_text(srna, "Header", "Editor header containing UI elements"); RNA_def_struct_ui_text(srna, "Header", "Editor header containing UI elements");
RNA_def_struct_sdna(srna, "Header"); RNA_def_struct_sdna(srna, "Header");
RNA_def_struct_refine_func(srna, "rna_Header_refine"); RNA_def_struct_refine_func(srna, "rna_Header_refine");
RNA_def_struct_register_funcs(srna, "rna_Header_register", "rna_Header_unregister", NULL); RNA_def_struct_register_funcs(srna, "rna_Header_register", "rna_Header_unregister", NULL);
/* draw */ /* draw */
func= RNA_def_function(srna, "draw", NULL); func = RNA_def_function(srna, "draw", NULL);
RNA_def_function_ui_description(func, "Draw UI elements into the header UI layout"); RNA_def_function_ui_description(func, "Draw UI elements into the header UI layout");
RNA_def_function_flag(func, FUNC_REGISTER); RNA_def_function_flag(func, FUNC_REGISTER);
parm= RNA_def_pointer(func, "context", "Context", "", ""); parm = RNA_def_pointer(func, "context", "Context", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_define_verify_sdna(0); // not in sdna RNA_define_verify_sdna(0); /* not in sdna */
prop= RNA_def_property(srna, "layout", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "layout", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "layout"); RNA_def_property_pointer_sdna(prop, NULL, "layout");
RNA_def_property_struct_type(prop, "UILayout"); RNA_def_property_struct_type(prop, "UILayout");
RNA_def_property_ui_text(prop, "Layout", "Structure of the header in the UI"); RNA_def_property_ui_text(prop, "Layout", "Structure of the header in the UI");
/* registration */ /* registration */
prop= RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE); prop = RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "type->idname"); RNA_def_property_string_sdna(prop, NULL, "type->idname");
RNA_def_property_flag(prop, PROP_REGISTER|PROP_NEVER_CLAMP); RNA_def_property_flag(prop, PROP_REGISTER|PROP_NEVER_CLAMP);
RNA_def_property_ui_text(prop, "ID Name", RNA_def_property_ui_text(prop, "ID Name",
@@ -772,7 +772,7 @@ static void rna_def_header(BlenderRNA *brna)
"class name is \"OBJECT_HT_hello\", and bl_idname is not set by the " "class name is \"OBJECT_HT_hello\", and bl_idname is not set by the "
"script, then bl_idname = \"OBJECT_HT_hello\""); "script, then bl_idname = \"OBJECT_HT_hello\"");
prop= RNA_def_property(srna, "bl_space_type", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "bl_space_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "type->space_type"); RNA_def_property_enum_sdna(prop, NULL, "type->space_type");
RNA_def_property_enum_items(prop, space_type_items); RNA_def_property_enum_items(prop, space_type_items);
RNA_def_property_flag(prop, PROP_REGISTER); RNA_def_property_flag(prop, PROP_REGISTER);
@@ -788,36 +788,36 @@ static void rna_def_menu(BlenderRNA *brna)
PropertyRNA *parm; PropertyRNA *parm;
FunctionRNA *func; FunctionRNA *func;
srna= RNA_def_struct(brna, "Menu", NULL); srna = RNA_def_struct(brna, "Menu", NULL);
RNA_def_struct_ui_text(srna, "Menu", "Editor menu containing buttons"); RNA_def_struct_ui_text(srna, "Menu", "Editor menu containing buttons");
RNA_def_struct_sdna(srna, "Menu"); RNA_def_struct_sdna(srna, "Menu");
RNA_def_struct_refine_func(srna, "rna_Menu_refine"); RNA_def_struct_refine_func(srna, "rna_Menu_refine");
RNA_def_struct_register_funcs(srna, "rna_Menu_register", "rna_Menu_unregister", NULL); RNA_def_struct_register_funcs(srna, "rna_Menu_register", "rna_Menu_unregister", NULL);
/* poll */ /* poll */
func= RNA_def_function(srna, "poll", NULL); func = RNA_def_function(srna, "poll", NULL);
RNA_def_function_ui_description(func, "If this method returns a non-null output, then the menu can be drawn"); RNA_def_function_ui_description(func, "If this method returns a non-null output, then the menu can be drawn");
RNA_def_function_flag(func, FUNC_NO_SELF|FUNC_REGISTER_OPTIONAL); RNA_def_function_flag(func, FUNC_NO_SELF|FUNC_REGISTER_OPTIONAL);
RNA_def_function_return(func, RNA_def_boolean(func, "visible", 1, "", "")); RNA_def_function_return(func, RNA_def_boolean(func, "visible", 1, "", ""));
parm= RNA_def_pointer(func, "context", "Context", "", ""); parm = RNA_def_pointer(func, "context", "Context", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
/* draw */ /* draw */
func= RNA_def_function(srna, "draw", NULL); func = RNA_def_function(srna, "draw", NULL);
RNA_def_function_ui_description(func, "Draw UI elements into the menu UI layout"); RNA_def_function_ui_description(func, "Draw UI elements into the menu UI layout");
RNA_def_function_flag(func, FUNC_REGISTER); RNA_def_function_flag(func, FUNC_REGISTER);
parm= RNA_def_pointer(func, "context", "Context", "", ""); parm = RNA_def_pointer(func, "context", "Context", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_define_verify_sdna(0); // not in sdna RNA_define_verify_sdna(0); /* not in sdna */
prop= RNA_def_property(srna, "layout", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "layout", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "layout"); RNA_def_property_pointer_sdna(prop, NULL, "layout");
RNA_def_property_struct_type(prop, "UILayout"); RNA_def_property_struct_type(prop, "UILayout");
RNA_def_property_ui_text(prop, "Layout", "Defines the structure of the menu in the UI"); RNA_def_property_ui_text(prop, "Layout", "Defines the structure of the menu in the UI");
/* registration */ /* registration */
prop= RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE); prop = RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "type->idname"); RNA_def_property_string_sdna(prop, NULL, "type->idname");
RNA_def_property_flag(prop, PROP_REGISTER|PROP_NEVER_CLAMP); RNA_def_property_flag(prop, PROP_REGISTER|PROP_NEVER_CLAMP);
RNA_def_property_ui_text(prop, "ID Name", RNA_def_property_ui_text(prop, "ID Name",
@@ -829,16 +829,16 @@ static void rna_def_menu(BlenderRNA *brna)
/* menu's label indeed doesn't need PROP_TRANSLATE flag: translation of label happens in runtime /* menu's label indeed doesn't need PROP_TRANSLATE flag: translation of label happens in runtime
* when drawing panel and having this flag set will make runtime switching of language much more tricky * when drawing panel and having this flag set will make runtime switching of language much more tricky
* because label will be stored translated */ * because label will be stored translated */
prop= RNA_def_property(srna, "bl_label", PROP_STRING, PROP_NONE); prop = RNA_def_property(srna, "bl_label", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "type->label"); RNA_def_property_string_sdna(prop, NULL, "type->label");
RNA_def_property_flag(prop, PROP_REGISTER); RNA_def_property_flag(prop, PROP_REGISTER);
RNA_def_property_ui_text(prop, "Label", "The menu label"); RNA_def_property_ui_text(prop, "Label", "The menu label");
prop= RNA_def_property(srna, "bl_description", PROP_STRING, PROP_TRANSLATE); prop = RNA_def_property(srna, "bl_description", PROP_STRING, PROP_TRANSLATE);
RNA_def_property_string_sdna(prop, NULL, "type->description"); RNA_def_property_string_sdna(prop, NULL, "type->description");
RNA_def_property_string_maxlength(prop, RNA_DYN_DESCR_MAX); /* else it uses the pointer size! */ RNA_def_property_string_maxlength(prop, RNA_DYN_DESCR_MAX); /* else it uses the pointer size! */
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Menu_bl_description_set"); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Menu_bl_description_set");
// RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* RNA_def_property_clear_flag(prop, PROP_EDITABLE); */
RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL); RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL);
RNA_define_verify_sdna(1); RNA_define_verify_sdna(1);
@@ -852,5 +852,5 @@ void RNA_def_ui(BlenderRNA *brna)
rna_def_menu(brna); rna_def_menu(brna);
} }
#endif // RNA_RUNTIME #endif /* RNA_RUNTIME */

View File

@@ -40,10 +40,10 @@
static void rna_uiItemR(uiLayout *layout, PointerRNA *ptr, const char *propname, const char *name, int icon, int expand, int slider, int toggle, int icon_only, int event, int full_event, int emboss, int index) static void rna_uiItemR(uiLayout *layout, PointerRNA *ptr, const char *propname, const char *name, int icon, int expand, int slider, int toggle, int icon_only, int event, int full_event, int emboss, int index)
{ {
PropertyRNA *prop= RNA_struct_find_property(ptr, propname); PropertyRNA *prop = RNA_struct_find_property(ptr, propname);
int flag= 0; int flag = 0;
if(!prop) { if (!prop) {
RNA_warning("property not found: %s.%s", RNA_struct_identifier(ptr->type), propname); RNA_warning("property not found: %s.%s", RNA_struct_identifier(ptr->type), propname);
return; return;
} }
@@ -61,7 +61,7 @@ static void rna_uiItemR(uiLayout *layout, PointerRNA *ptr, const char *propname,
static PointerRNA rna_uiItemO(uiLayout *layout, const char *opname, const char *name, int icon, int emboss) static PointerRNA rna_uiItemO(uiLayout *layout, const char *opname, const char *name, int icon, int emboss)
{ {
int flag= UI_ITEM_O_RETURN_PROPS; int flag = UI_ITEM_O_RETURN_PROPS;
flag |= (emboss)? 0: UI_ITEM_R_NO_BG; flag |= (emboss)? 0: UI_ITEM_R_NO_BG;
return uiItemFullO(layout, opname, name, icon, NULL, uiLayoutGetOperatorContext(layout), flag); return uiItemFullO(layout, opname, name, icon, NULL, uiLayoutGetOperatorContext(layout), flag);
} }
@@ -84,7 +84,7 @@ static void api_ui_item_common(FunctionRNA *func)
RNA_def_string_translate(func, "text", "", 0, "", "Override automatic text of the item"); RNA_def_string_translate(func, "text", "", 0, "", "Override automatic text of the item");
prop= RNA_def_property(func, "icon", PROP_ENUM, PROP_NONE); prop = RNA_def_property(func, "icon", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, icon_items); RNA_def_property_enum_items(prop, icon_items);
RNA_def_property_ui_text(prop, "Icon", "Override automatic icon of the item"); RNA_def_property_ui_text(prop, "Icon", "Override automatic icon of the item");
@@ -93,7 +93,7 @@ static void api_ui_item_common(FunctionRNA *func)
static void api_ui_item_op(FunctionRNA *func) static void api_ui_item_op(FunctionRNA *func)
{ {
PropertyRNA *parm; PropertyRNA *parm;
parm= RNA_def_string(func, "operator", "", 0, "", "Identifier of the operator"); parm = RNA_def_string(func, "operator", "", 0, "", "Identifier of the operator");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
} }
@@ -107,9 +107,9 @@ static void api_ui_item_rna_common(FunctionRNA *func)
{ {
PropertyRNA *parm; PropertyRNA *parm;
parm= RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property"); parm = RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL);
parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in data"); parm = RNA_def_string(func, "property", "", 0, "", "Identifier of property in data");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
} }
@@ -131,40 +131,40 @@ void RNA_api_ui_layout(StructRNA *srna)
{0, NULL, 0, NULL, NULL}}; {0, NULL, 0, NULL, NULL}};
/* simple layout specifiers */ /* simple layout specifiers */
func= RNA_def_function(srna, "row", "uiLayoutRow"); func = RNA_def_function(srna, "row", "uiLayoutRow");
parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in"); parm = RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in");
RNA_def_function_return(func, parm); RNA_def_function_return(func, parm);
RNA_def_function_ui_description(func, "Sub-layout. Items placed in this sublayout are placed next to each other in a row"); RNA_def_function_ui_description(func, "Sub-layout. Items placed in this sublayout are placed next to each other in a row");
RNA_def_boolean(func, "align", 0, "", "Align buttons to each other"); RNA_def_boolean(func, "align", 0, "", "Align buttons to each other");
func= RNA_def_function(srna, "column", "uiLayoutColumn"); func = RNA_def_function(srna, "column", "uiLayoutColumn");
parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in"); parm = RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in");
RNA_def_function_return(func, parm); RNA_def_function_return(func, parm);
RNA_def_function_ui_description(func, "Sub-layout. Items placed in this sublayout are placed under each other in a column"); RNA_def_function_ui_description(func, "Sub-layout. Items placed in this sublayout are placed under each other in a column");
RNA_def_boolean(func, "align", 0, "", "Align buttons to each other"); RNA_def_boolean(func, "align", 0, "", "Align buttons to each other");
func= RNA_def_function(srna, "column_flow", "uiLayoutColumnFlow"); func = RNA_def_function(srna, "column_flow", "uiLayoutColumnFlow");
RNA_def_int(func, "columns", 0, 0, INT_MAX, "", "Number of columns, 0 is automatic", 0, INT_MAX); RNA_def_int(func, "columns", 0, 0, INT_MAX, "", "Number of columns, 0 is automatic", 0, INT_MAX);
parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in"); parm = RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in");
RNA_def_function_return(func, parm); RNA_def_function_return(func, parm);
RNA_def_boolean(func, "align", 0, "", "Align buttons to each other"); RNA_def_boolean(func, "align", 0, "", "Align buttons to each other");
/* box layout */ /* box layout */
func= RNA_def_function(srna, "box", "uiLayoutBox"); func = RNA_def_function(srna, "box", "uiLayoutBox");
parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in"); parm = RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in");
RNA_def_function_return(func, parm); RNA_def_function_return(func, parm);
RNA_def_function_ui_description(func, "Sublayout (items placed in this sublayout are placed " RNA_def_function_ui_description(func, "Sublayout (items placed in this sublayout are placed "
"under each other in a column and are surrounded by a box)"); "under each other in a column and are surrounded by a box)");
/* split layout */ /* split layout */
func= RNA_def_function(srna, "split", "uiLayoutSplit"); func = RNA_def_function(srna, "split", "uiLayoutSplit");
parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in"); parm = RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in");
RNA_def_function_return(func, parm); RNA_def_function_return(func, parm);
RNA_def_float(func, "percentage", 0.0f, 0.0f, 1.0f, "Percentage", "Percentage of width to split at", 0.0f, 1.0f); RNA_def_float(func, "percentage", 0.0f, 0.0f, 1.0f, "Percentage", "Percentage of width to split at", 0.0f, 1.0f);
RNA_def_boolean(func, "align", 0, "", "Align buttons to each other"); RNA_def_boolean(func, "align", 0, "", "Align buttons to each other");
/* items */ /* items */
func= RNA_def_function(srna, "prop", "rna_uiItemR"); func = RNA_def_function(srna, "prop", "rna_uiItemR");
RNA_def_function_ui_description(func, "Item. Exposes an RNA item and places it into the layout"); RNA_def_function_ui_description(func, "Item. Exposes an RNA item and places it into the layout");
api_ui_item_rna_common(func); api_ui_item_rna_common(func);
api_ui_item_common(func); api_ui_item_common(func);
@@ -179,31 +179,31 @@ void RNA_api_ui_layout(StructRNA *srna)
"The index of this button, when set a single member of an array can be accessed, " "The index of this button, when set a single member of an array can be accessed, "
"when set to -1 all array members are used", -2, INT_MAX); /* RNA_NO_INDEX == -1 */ "when set to -1 all array members are used", -2, INT_MAX); /* RNA_NO_INDEX == -1 */
func= RNA_def_function(srna, "props_enum", "uiItemsEnumR"); func = RNA_def_function(srna, "props_enum", "uiItemsEnumR");
api_ui_item_rna_common(func); api_ui_item_rna_common(func);
func= RNA_def_function(srna, "prop_menu_enum", "uiItemMenuEnumR"); func = RNA_def_function(srna, "prop_menu_enum", "uiItemMenuEnumR");
api_ui_item_rna_common(func); api_ui_item_rna_common(func);
api_ui_item_common(func); api_ui_item_common(func);
func= RNA_def_function(srna, "prop_enum", "uiItemEnumR_string"); func = RNA_def_function(srna, "prop_enum", "uiItemEnumR_string");
api_ui_item_rna_common(func); api_ui_item_rna_common(func);
parm= RNA_def_string(func, "value", "", 0, "", "Enum property value"); parm = RNA_def_string(func, "value", "", 0, "", "Enum property value");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
api_ui_item_common(func); api_ui_item_common(func);
func= RNA_def_function(srna, "prop_search", "uiItemPointerR"); func = RNA_def_function(srna, "prop_search", "uiItemPointerR");
api_ui_item_rna_common(func); api_ui_item_rna_common(func);
parm= RNA_def_pointer(func, "search_data", "AnyType", "", "Data from which to take collection to search in"); parm = RNA_def_pointer(func, "search_data", "AnyType", "", "Data from which to take collection to search in");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL);
parm= RNA_def_string(func, "search_property", "", 0, "", "Identifier of search collection property"); parm = RNA_def_string(func, "search_property", "", 0, "", "Identifier of search collection property");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
api_ui_item_common(func); api_ui_item_common(func);
func= RNA_def_function(srna, "operator", "rna_uiItemO"); func = RNA_def_function(srna, "operator", "rna_uiItemO");
api_ui_item_op_common(func); api_ui_item_op_common(func);
RNA_def_boolean(func, "emboss", 1, "", "Draw the button itself, just the icon/text"); RNA_def_boolean(func, "emboss", 1, "", "Draw the button itself, just the icon/text");
parm= RNA_def_pointer(func, "properties", "OperatorProperties", "", parm = RNA_def_pointer(func, "properties", "OperatorProperties", "",
"Operator properties to fill in, return when 'properties' is set to true"); "Operator properties to fill in, return when 'properties' is set to true");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR);
RNA_def_function_return(func, parm); RNA_def_function_return(func, parm);
@@ -216,15 +216,15 @@ void RNA_api_ui_layout(StructRNA *srna)
parm= RNA_def_string(func, "value", "", 0, "", "Enum property value"); parm= RNA_def_string(func, "value", "", 0, "", "Enum property value");
RNA_def_property_flag(parm, PROP_REQUIRED); */ RNA_def_property_flag(parm, PROP_REQUIRED); */
func= RNA_def_function(srna, "operator_enum", "uiItemsEnumO"); func = RNA_def_function(srna, "operator_enum", "uiItemsEnumO");
parm= RNA_def_string(func, "operator", "", 0, "", "Identifier of the operator"); parm = RNA_def_string(func, "operator", "", 0, "", "Identifier of the operator");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator"); parm = RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
func= RNA_def_function(srna, "operator_menu_enum", "uiItemMenuEnumO"); func = RNA_def_function(srna, "operator_menu_enum", "uiItemMenuEnumO");
api_ui_item_op(func); /* cant use api_ui_item_op_common because property must come right after */ api_ui_item_op(func); /* cant use api_ui_item_op_common because property must come right after */
parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator"); parm = RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
api_ui_item_common(func); api_ui_item_common(func);
@@ -258,39 +258,39 @@ void RNA_api_ui_layout(StructRNA *srna)
parm= RNA_def_string(func, "value", "", 0, "", "Value of the property to call the operator with"); parm= RNA_def_string(func, "value", "", 0, "", "Value of the property to call the operator with");
RNA_def_property_flag(parm, PROP_REQUIRED); */ RNA_def_property_flag(parm, PROP_REQUIRED); */
func= RNA_def_function(srna, "label", "uiItemL"); func = RNA_def_function(srna, "label", "uiItemL");
RNA_def_function_ui_description(func, "Item. Display text in the layout"); RNA_def_function_ui_description(func, "Item. Display text in the layout");
api_ui_item_common(func); api_ui_item_common(func);
func= RNA_def_function(srna, "menu", "uiItemM"); func = RNA_def_function(srna, "menu", "uiItemM");
RNA_def_function_flag(func, FUNC_USE_CONTEXT); RNA_def_function_flag(func, FUNC_USE_CONTEXT);
parm= RNA_def_string(func, "menu", "", 0, "", "Identifier of the menu"); parm = RNA_def_string(func, "menu", "", 0, "", "Identifier of the menu");
api_ui_item_common(func); api_ui_item_common(func);
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
func= RNA_def_function(srna, "separator", "uiItemS"); func = RNA_def_function(srna, "separator", "uiItemS");
RNA_def_function_ui_description(func, "Item. Inserts empty space into the layout between items"); RNA_def_function_ui_description(func, "Item. Inserts empty space into the layout between items");
/* context */ /* context */
func= RNA_def_function(srna, "context_pointer_set", "uiLayoutSetContextPointer"); func = RNA_def_function(srna, "context_pointer_set", "uiLayoutSetContextPointer");
parm= RNA_def_string(func, "name", "", 0, "Name", "Name of entry in the context"); parm = RNA_def_string(func, "name", "", 0, "Name", "Name of entry in the context");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
parm= RNA_def_pointer(func, "data", "AnyType", "", "Pointer to put in context"); parm = RNA_def_pointer(func, "data", "AnyType", "", "Pointer to put in context");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR);
/* templates */ /* templates */
func= RNA_def_function(srna, "template_header", "uiTemplateHeader"); func = RNA_def_function(srna, "template_header", "uiTemplateHeader");
RNA_def_function_flag(func, FUNC_USE_CONTEXT); RNA_def_function_flag(func, FUNC_USE_CONTEXT);
RNA_def_boolean(func, "menus", 1, "", "The header has menus, and should show menu expander"); RNA_def_boolean(func, "menus", 1, "", "The header has menus, and should show menu expander");
func= RNA_def_function(srna, "template_ID", "uiTemplateID"); func = RNA_def_function(srna, "template_ID", "uiTemplateID");
RNA_def_function_flag(func, FUNC_USE_CONTEXT); RNA_def_function_flag(func, FUNC_USE_CONTEXT);
api_ui_item_rna_common(func); api_ui_item_rna_common(func);
RNA_def_string(func, "new", "", 0, "", "Operator identifier to create a new ID block"); RNA_def_string(func, "new", "", 0, "", "Operator identifier to create a new ID block");
RNA_def_string(func, "open", "", 0, "", "Operator identifier to open a file for creating a new ID block"); RNA_def_string(func, "open", "", 0, "", "Operator identifier to open a file for creating a new ID block");
RNA_def_string(func, "unlink", "", 0, "", "Operator identifier to unlink the ID block"); RNA_def_string(func, "unlink", "", 0, "", "Operator identifier to unlink the ID block");
func= RNA_def_function(srna, "template_ID_preview", "uiTemplateIDPreview"); func = RNA_def_function(srna, "template_ID_preview", "uiTemplateIDPreview");
RNA_def_function_flag(func, FUNC_USE_CONTEXT); RNA_def_function_flag(func, FUNC_USE_CONTEXT);
api_ui_item_rna_common(func); api_ui_item_rna_common(func);
RNA_def_string(func, "new", "", 0, "", "Operator identifier to create a new ID block"); RNA_def_string(func, "new", "", 0, "", "Operator identifier to create a new ID block");
@@ -299,82 +299,82 @@ void RNA_api_ui_layout(StructRNA *srna)
RNA_def_int(func, "rows", 0, 0, INT_MAX, "Number of thumbnail preview rows to display", "", 0, INT_MAX); RNA_def_int(func, "rows", 0, 0, INT_MAX, "Number of thumbnail preview rows to display", "", 0, INT_MAX);
RNA_def_int(func, "cols", 0, 0, INT_MAX, "Number of thumbnail preview columns to display", "", 0, INT_MAX); RNA_def_int(func, "cols", 0, 0, INT_MAX, "Number of thumbnail preview columns to display", "", 0, INT_MAX);
func= RNA_def_function(srna, "template_any_ID", "uiTemplateAnyID"); func = RNA_def_function(srna, "template_any_ID", "uiTemplateAnyID");
parm= RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property"); parm = RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL);
parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in data"); parm = RNA_def_string(func, "property", "", 0, "", "Identifier of property in data");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
parm= RNA_def_string(func, "type_property", "", 0, "", parm = RNA_def_string(func, "type_property", "", 0, "",
"Identifier of property in data giving the type of the ID-blocks to use"); "Identifier of property in data giving the type of the ID-blocks to use");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_string_translate(func, "text", "", 0, "", "Custom label to display in UI"); RNA_def_string_translate(func, "text", "", 0, "", "Custom label to display in UI");
func= RNA_def_function(srna, "template_path_builder", "uiTemplatePathBuilder"); func = RNA_def_function(srna, "template_path_builder", "uiTemplatePathBuilder");
parm= RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property"); parm = RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL);
parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in data"); parm = RNA_def_string(func, "property", "", 0, "", "Identifier of property in data");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
parm= RNA_def_pointer(func, "root", "ID", "", "ID-block from which path is evaluated from"); parm = RNA_def_pointer(func, "root", "ID", "", "ID-block from which path is evaluated from");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR);
RNA_def_string_translate(func, "text", "", 0, "", "Custom label to display in UI"); RNA_def_string_translate(func, "text", "", 0, "", "Custom label to display in UI");
func= RNA_def_function(srna, "template_modifier", "uiTemplateModifier"); func = RNA_def_function(srna, "template_modifier", "uiTemplateModifier");
RNA_def_function_flag(func, FUNC_USE_CONTEXT); RNA_def_function_flag(func, FUNC_USE_CONTEXT);
RNA_def_function_ui_description(func, "Layout . Generates the UI layout for modifiers"); RNA_def_function_ui_description(func, "Layout . Generates the UI layout for modifiers");
parm= RNA_def_pointer(func, "data", "Modifier", "", "Modifier data"); parm = RNA_def_pointer(func, "data", "Modifier", "", "Modifier data");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL);
parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in"); parm = RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in");
RNA_def_function_return(func, parm); RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "template_constraint", "uiTemplateConstraint"); func = RNA_def_function(srna, "template_constraint", "uiTemplateConstraint");
RNA_def_function_ui_description(func, "Layout . Generates the UI layout for constraints"); RNA_def_function_ui_description(func, "Layout . Generates the UI layout for constraints");
parm= RNA_def_pointer(func, "data", "Constraint", "", "Constraint data"); parm = RNA_def_pointer(func, "data", "Constraint", "", "Constraint data");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL);
parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in"); parm = RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in");
RNA_def_function_return(func, parm); RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "template_preview", "uiTemplatePreview"); func = RNA_def_function(srna, "template_preview", "uiTemplatePreview");
RNA_def_function_ui_description(func, "Item. A preview window for materials, textures, lamps, etc"); RNA_def_function_ui_description(func, "Item. A preview window for materials, textures, lamps, etc");
parm= RNA_def_pointer(func, "id", "ID", "", "ID datablock"); parm = RNA_def_pointer(func, "id", "ID", "", "ID datablock");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_boolean(func, "show_buttons", 1, "", "Show preview buttons?"); RNA_def_boolean(func, "show_buttons", 1, "", "Show preview buttons?");
RNA_def_pointer(func, "parent", "ID", "", "ID datablock"); RNA_def_pointer(func, "parent", "ID", "", "ID datablock");
RNA_def_pointer(func, "slot", "TextureSlot", "", "Texture slot"); RNA_def_pointer(func, "slot", "TextureSlot", "", "Texture slot");
func= RNA_def_function(srna, "template_curve_mapping", "uiTemplateCurveMapping"); func = RNA_def_function(srna, "template_curve_mapping", "uiTemplateCurveMapping");
RNA_def_function_ui_description(func, "Item. A curve mapping widget used for e.g falloff curves for lamps"); RNA_def_function_ui_description(func, "Item. A curve mapping widget used for e.g falloff curves for lamps");
api_ui_item_rna_common(func); api_ui_item_rna_common(func);
RNA_def_enum(func, "type", curve_type_items, 0, "Type", "Type of curves to display"); RNA_def_enum(func, "type", curve_type_items, 0, "Type", "Type of curves to display");
RNA_def_boolean(func, "levels", 0, "", "Show black/white levels"); RNA_def_boolean(func, "levels", 0, "", "Show black/white levels");
RNA_def_boolean(func, "brush", 0, "", "Show brush options"); RNA_def_boolean(func, "brush", 0, "", "Show brush options");
func= RNA_def_function(srna, "template_color_ramp", "uiTemplateColorRamp"); func = RNA_def_function(srna, "template_color_ramp", "uiTemplateColorRamp");
RNA_def_function_ui_description(func, "Item. A color ramp widget"); RNA_def_function_ui_description(func, "Item. A color ramp widget");
api_ui_item_rna_common(func); api_ui_item_rna_common(func);
RNA_def_boolean(func, "expand", 0, "", "Expand button to show more detail"); RNA_def_boolean(func, "expand", 0, "", "Expand button to show more detail");
func= RNA_def_function(srna, "template_histogram", "uiTemplateHistogram"); func = RNA_def_function(srna, "template_histogram", "uiTemplateHistogram");
RNA_def_function_ui_description(func, "Item. A histogramm widget to analyze imaga data"); RNA_def_function_ui_description(func, "Item. A histogramm widget to analyze imaga data");
api_ui_item_rna_common(func); api_ui_item_rna_common(func);
func= RNA_def_function(srna, "template_waveform", "uiTemplateWaveform"); func = RNA_def_function(srna, "template_waveform", "uiTemplateWaveform");
RNA_def_function_ui_description(func, "Item. A waveform widget to analyze imaga data"); RNA_def_function_ui_description(func, "Item. A waveform widget to analyze imaga data");
api_ui_item_rna_common(func); api_ui_item_rna_common(func);
func= RNA_def_function(srna, "template_vectorscope", "uiTemplateVectorscope"); func = RNA_def_function(srna, "template_vectorscope", "uiTemplateVectorscope");
RNA_def_function_ui_description(func, "Item. A vectorscope widget to analyze imaga data"); RNA_def_function_ui_description(func, "Item. A vectorscope widget to analyze imaga data");
api_ui_item_rna_common(func); api_ui_item_rna_common(func);
func= RNA_def_function(srna, "template_layers", "uiTemplateLayers"); func = RNA_def_function(srna, "template_layers", "uiTemplateLayers");
api_ui_item_rna_common(func); api_ui_item_rna_common(func);
parm= RNA_def_pointer(func, "used_layers_data", "AnyType", "", "Data from which to take property"); parm = RNA_def_pointer(func, "used_layers_data", "AnyType", "", "Data from which to take property");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR);
parm= RNA_def_string(func, "used_layers_property", "", 0, "", "Identifier of property in data"); parm = RNA_def_string(func, "used_layers_property", "", 0, "", "Identifier of property in data");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
parm= RNA_def_int(func, "active_layer", 0, 0, INT_MAX, "Active Layer", "", 0, INT_MAX); parm = RNA_def_int(func, "active_layer", 0, 0, INT_MAX, "Active Layer", "", 0, INT_MAX);
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
func= RNA_def_function(srna, "template_color_wheel", "uiTemplateColorWheel"); func = RNA_def_function(srna, "template_color_wheel", "uiTemplateColorWheel");
RNA_def_function_ui_description(func, "Item. A color wheel widget to pick colors"); RNA_def_function_ui_description(func, "Item. A color wheel widget to pick colors");
api_ui_item_rna_common(func); api_ui_item_rna_common(func);
RNA_def_boolean(func, "value_slider", 0, "", "Display the value slider to the right of the color wheel"); RNA_def_boolean(func, "value_slider", 0, "", "Display the value slider to the right of the color wheel");
@@ -382,55 +382,55 @@ void RNA_api_ui_layout(StructRNA *srna)
RNA_def_boolean(func, "lock_luminosity", 0, "", "Keep the color at its original vector length"); RNA_def_boolean(func, "lock_luminosity", 0, "", "Keep the color at its original vector length");
RNA_def_boolean(func, "cubic", 1, "", "Cubic saturation for picking values close to white"); RNA_def_boolean(func, "cubic", 1, "", "Cubic saturation for picking values close to white");
func= RNA_def_function(srna, "template_image_layers", "uiTemplateImageLayers"); func = RNA_def_function(srna, "template_image_layers", "uiTemplateImageLayers");
RNA_def_function_flag(func, FUNC_USE_CONTEXT); RNA_def_function_flag(func, FUNC_USE_CONTEXT);
parm= RNA_def_pointer(func, "image", "Image", "", ""); parm = RNA_def_pointer(func, "image", "Image", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
parm= RNA_def_pointer(func, "image_user", "ImageUser", "", ""); parm = RNA_def_pointer(func, "image_user", "ImageUser", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
func= RNA_def_function(srna, "template_image", "uiTemplateImage"); func = RNA_def_function(srna, "template_image", "uiTemplateImage");
RNA_def_function_ui_description(func, "Item(s). User interface for selecting images and their source paths"); RNA_def_function_ui_description(func, "Item(s). User interface for selecting images and their source paths");
RNA_def_function_flag(func, FUNC_USE_CONTEXT); RNA_def_function_flag(func, FUNC_USE_CONTEXT);
api_ui_item_rna_common(func); api_ui_item_rna_common(func);
parm= RNA_def_pointer(func, "image_user", "ImageUser", "", ""); parm = RNA_def_pointer(func, "image_user", "ImageUser", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL);
RNA_def_boolean(func, "compact", 0, "", "Use more compact layout"); RNA_def_boolean(func, "compact", 0, "", "Use more compact layout");
func= RNA_def_function(srna, "template_image_settings", "uiTemplateImageSettings"); func = RNA_def_function(srna, "template_image_settings", "uiTemplateImageSettings");
RNA_def_function_ui_description(func, "User interface for setting image format options"); RNA_def_function_ui_description(func, "User interface for setting image format options");
parm= RNA_def_pointer(func, "image_settings", "ImageFormatSettings", "", ""); parm = RNA_def_pointer(func, "image_settings", "ImageFormatSettings", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL);
func= RNA_def_function(srna, "template_movieclip", "uiTemplateMovieClip"); func = RNA_def_function(srna, "template_movieclip", "uiTemplateMovieClip");
RNA_def_function_ui_description(func, "Item(s). User interface for selecting movie clips and their source paths"); RNA_def_function_ui_description(func, "Item(s). User interface for selecting movie clips and their source paths");
RNA_def_function_flag(func, FUNC_USE_CONTEXT); RNA_def_function_flag(func, FUNC_USE_CONTEXT);
api_ui_item_rna_common(func); api_ui_item_rna_common(func);
RNA_def_boolean(func, "compact", 0, "", "Use more compact layout"); RNA_def_boolean(func, "compact", 0, "", "Use more compact layout");
func= RNA_def_function(srna, "template_track", "uiTemplateTrack"); func = RNA_def_function(srna, "template_track", "uiTemplateTrack");
RNA_def_function_ui_description(func, "Item. A movie-track widget to preview tracking image."); RNA_def_function_ui_description(func, "Item. A movie-track widget to preview tracking image.");
api_ui_item_rna_common(func); api_ui_item_rna_common(func);
func= RNA_def_function(srna, "template_marker", "uiTemplateMarker"); func = RNA_def_function(srna, "template_marker", "uiTemplateMarker");
RNA_def_function_ui_description(func, "Item. A widget to control single marker settings."); RNA_def_function_ui_description(func, "Item. A widget to control single marker settings.");
api_ui_item_rna_common(func); api_ui_item_rna_common(func);
parm= RNA_def_pointer(func, "clip_user", "MovieClipUser", "", ""); parm = RNA_def_pointer(func, "clip_user", "MovieClipUser", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL);
parm= RNA_def_pointer(func, "track", "MovieTrackingTrack", "", ""); parm = RNA_def_pointer(func, "track", "MovieTrackingTrack", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL);
RNA_def_boolean(func, "compact", 0, "", "Use more compact layout"); RNA_def_boolean(func, "compact", 0, "", "Use more compact layout");
func= RNA_def_function(srna, "template_list", "uiTemplateList"); func = RNA_def_function(srna, "template_list", "uiTemplateList");
RNA_def_function_ui_description(func, "Item. A list widget to display data. e.g. vertexgroups"); RNA_def_function_ui_description(func, "Item. A list widget to display data. e.g. vertexgroups");
RNA_def_function_flag(func, FUNC_USE_CONTEXT); RNA_def_function_flag(func, FUNC_USE_CONTEXT);
parm= RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property"); parm = RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR);
parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in data"); parm = RNA_def_string(func, "property", "", 0, "", "Identifier of property in data");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
parm= RNA_def_pointer(func, "active_data", "AnyType", "", "Data from which to take property for the active element"); parm = RNA_def_pointer(func, "active_data", "AnyType", "", "Data from which to take property for the active element");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL);
parm= RNA_def_string(func, "active_property", "", 0, "", "Identifier of property in data, for the active element"); parm = RNA_def_string(func, "active_property", "", 0, "", "Identifier of property in data, for the active element");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_string(func, "prop_list", "", 0, "", RNA_def_string(func, "prop_list", "", 0, "",
"Identifier of a string property in each data member, specifying which " "Identifier of a string property in each data member, specifying which "
@@ -440,46 +440,46 @@ void RNA_api_ui_layout(StructRNA *srna)
RNA_def_int(func, "maxrows", 5, 0, INT_MAX, "", "Maximum number of rows to display", 0, INT_MAX); RNA_def_int(func, "maxrows", 5, 0, INT_MAX, "", "Maximum number of rows to display", 0, INT_MAX);
RNA_def_enum(func, "type", list_type_items, 0, "Type", "Type of list to use"); RNA_def_enum(func, "type", list_type_items, 0, "Type", "Type of list to use");
func= RNA_def_function(srna, "template_running_jobs", "uiTemplateRunningJobs"); func = RNA_def_function(srna, "template_running_jobs", "uiTemplateRunningJobs");
RNA_def_function_flag(func, FUNC_USE_CONTEXT); RNA_def_function_flag(func, FUNC_USE_CONTEXT);
RNA_def_function(srna, "template_operator_search", "uiTemplateOperatorSearch"); RNA_def_function(srna, "template_operator_search", "uiTemplateOperatorSearch");
func= RNA_def_function(srna, "template_header_3D", "uiTemplateHeader3D"); func = RNA_def_function(srna, "template_header_3D", "uiTemplateHeader3D");
RNA_def_function_flag(func, FUNC_USE_CONTEXT); RNA_def_function_flag(func, FUNC_USE_CONTEXT);
func= RNA_def_function(srna, "template_edit_mode_selection", "uiTemplateEditModeSelection"); func = RNA_def_function(srna, "template_edit_mode_selection", "uiTemplateEditModeSelection");
RNA_def_function_flag(func, FUNC_USE_CONTEXT); RNA_def_function_flag(func, FUNC_USE_CONTEXT);
func= RNA_def_function(srna, "template_reports_banner", "uiTemplateReportsBanner"); func = RNA_def_function(srna, "template_reports_banner", "uiTemplateReportsBanner");
RNA_def_function_flag(func, FUNC_USE_CONTEXT); RNA_def_function_flag(func, FUNC_USE_CONTEXT);
func= RNA_def_function(srna, "template_node_link", "uiTemplateNodeLink"); func = RNA_def_function(srna, "template_node_link", "uiTemplateNodeLink");
parm= RNA_def_pointer(func, "ntree", "NodeTree", "", ""); parm = RNA_def_pointer(func, "ntree", "NodeTree", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
parm= RNA_def_pointer(func, "node", "Node", "", ""); parm = RNA_def_pointer(func, "node", "Node", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
parm= RNA_def_pointer(func, "socket", "NodeSocket", "", ""); parm = RNA_def_pointer(func, "socket", "NodeSocket", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
func= RNA_def_function(srna, "template_node_view", "uiTemplateNodeView"); func = RNA_def_function(srna, "template_node_view", "uiTemplateNodeView");
RNA_def_function_flag(func, FUNC_USE_CONTEXT); RNA_def_function_flag(func, FUNC_USE_CONTEXT);
parm= RNA_def_pointer(func, "ntree", "NodeTree", "", ""); parm = RNA_def_pointer(func, "ntree", "NodeTree", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
parm= RNA_def_pointer(func, "node", "Node", "", ""); parm = RNA_def_pointer(func, "node", "Node", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
parm= RNA_def_pointer(func, "socket", "NodeSocket", "", ""); parm = RNA_def_pointer(func, "socket", "NodeSocket", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
func= RNA_def_function(srna, "template_texture_user", "uiTemplateTextureUser"); func = RNA_def_function(srna, "template_texture_user", "uiTemplateTextureUser");
RNA_def_function_flag(func, FUNC_USE_CONTEXT); RNA_def_function_flag(func, FUNC_USE_CONTEXT);
func= RNA_def_function(srna, "template_keymap_item_properties", "uiTemplateKeymapItemProperties"); func = RNA_def_function(srna, "template_keymap_item_properties", "uiTemplateKeymapItemProperties");
parm= RNA_def_pointer(func, "item", "KeyMapItem", "", ""); parm = RNA_def_pointer(func, "item", "KeyMapItem", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL);
func= RNA_def_function(srna, "introspect", "uiLayoutIntrospect"); func = RNA_def_function(srna, "introspect", "uiLayoutIntrospect");
parm= RNA_def_string(func, "string", "", 1024*1024, "Descr", "DESCR"); parm = RNA_def_string(func, "string", "", 1024*1024, "Descr", "DESCR");
RNA_def_function_return(func, parm); RNA_def_function_return(func, parm);
} }
#endif #endif

File diff suppressed because it is too large Load Diff

View File

@@ -42,17 +42,17 @@ void RNA_def_vfont(BlenderRNA *brna)
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
srna= RNA_def_struct(brna, "VectorFont", "ID"); srna = RNA_def_struct(brna, "VectorFont", "ID");
RNA_def_struct_ui_text(srna, "Vector Font", "Vector font for Text objects"); RNA_def_struct_ui_text(srna, "Vector Font", "Vector font for Text objects");
RNA_def_struct_sdna(srna, "VFont"); RNA_def_struct_sdna(srna, "VFont");
RNA_def_struct_ui_icon(srna, ICON_FILE_FONT); RNA_def_struct_ui_icon(srna, ICON_FILE_FONT);
prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH); prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_string_sdna(prop, NULL, "name"); RNA_def_property_string_sdna(prop, NULL, "name");
RNA_def_property_ui_text(prop, "File Path", ""); RNA_def_property_ui_text(prop, "File Path", "");
prop= RNA_def_property(srna, "packed_file", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "packed_file", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "packedfile"); RNA_def_property_pointer_sdna(prop, NULL, "packedfile");
RNA_def_property_ui_text(prop, "Packed File", ""); RNA_def_property_ui_text(prop, "Packed File", "");
} }

File diff suppressed because it is too large Load Diff

View File

@@ -84,9 +84,9 @@ void rna_event_timer_remove(struct wmWindowManager *wm, wmTimer *timer)
static wmKeyMapItem *rna_KeyMap_item_new(wmKeyMap *km, ReportList *reports, const char *idname, int type, int value, int any, int shift, int ctrl, int alt, int oskey, int keymodifier) static wmKeyMapItem *rna_KeyMap_item_new(wmKeyMap *km, ReportList *reports, const char *idname, int type, int value, int any, int shift, int ctrl, int alt, int oskey, int keymodifier)
{ {
// wmWindowManager *wm = CTX_wm_manager(C); /* wmWindowManager *wm = CTX_wm_manager(C); */
char idname_bl[OP_MAX_TYPENAME]; char idname_bl[OP_MAX_TYPENAME];
int modifier= 0; int modifier = 0;
/* only on non-modal maps */ /* only on non-modal maps */
if (km->flag & KEYMAP_MODAL) { if (km->flag & KEYMAP_MODAL) {
@@ -96,19 +96,19 @@ static wmKeyMapItem *rna_KeyMap_item_new(wmKeyMap *km, ReportList *reports, cons
WM_operator_bl_idname(idname_bl, idname); WM_operator_bl_idname(idname_bl, idname);
if(shift) modifier |= KM_SHIFT; if (shift) modifier |= KM_SHIFT;
if(ctrl) modifier |= KM_CTRL; if (ctrl) modifier |= KM_CTRL;
if(alt) modifier |= KM_ALT; if (alt) modifier |= KM_ALT;
if(oskey) modifier |= KM_OSKEY; if (oskey) modifier |= KM_OSKEY;
if(any) modifier = KM_ANY; if (any) modifier = KM_ANY;
return WM_keymap_add_item(km, idname_bl, type, value, modifier, keymodifier); return WM_keymap_add_item(km, idname_bl, type, value, modifier, keymodifier);
} }
static wmKeyMapItem *rna_KeyMap_item_new_modal(wmKeyMap *km, ReportList *reports, const char *propvalue_str, int type, int value, int any, int shift, int ctrl, int alt, int oskey, int keymodifier) static wmKeyMapItem *rna_KeyMap_item_new_modal(wmKeyMap *km, ReportList *reports, const char *propvalue_str, int type, int value, int any, int shift, int ctrl, int alt, int oskey, int keymodifier)
{ {
int modifier= 0; int modifier = 0;
int propvalue = 0; int propvalue = 0;
/* only modal maps */ /* only modal maps */
@@ -123,16 +123,16 @@ static wmKeyMapItem *rna_KeyMap_item_new_modal(wmKeyMap *km, ReportList *reports
} }
if(RNA_enum_value_from_id(km->modal_items, propvalue_str, &propvalue)==0) { if (RNA_enum_value_from_id(km->modal_items, propvalue_str, &propvalue) == 0) {
BKE_report(reports, RPT_WARNING, "Property value not in enumeration"); BKE_report(reports, RPT_WARNING, "Property value not in enumeration");
} }
if(shift) modifier |= KM_SHIFT; if (shift) modifier |= KM_SHIFT;
if(ctrl) modifier |= KM_CTRL; if (ctrl) modifier |= KM_CTRL;
if(alt) modifier |= KM_ALT; if (alt) modifier |= KM_ALT;
if(oskey) modifier |= KM_OSKEY; if (oskey) modifier |= KM_OSKEY;
if(any) modifier = KM_ANY; if (any) modifier = KM_ANY;
return WM_modalkeymap_add_item(km, type, value, modifier, keymodifier, propvalue); return WM_modalkeymap_add_item(km, type, value, modifier, keymodifier, propvalue);
} }
@@ -172,21 +172,21 @@ static void rna_generic_op_invoke(FunctionRNA *func, int flag)
PropertyRNA *parm; PropertyRNA *parm;
RNA_def_function_flag(func, FUNC_NO_SELF|FUNC_USE_CONTEXT); RNA_def_function_flag(func, FUNC_NO_SELF|FUNC_USE_CONTEXT);
parm= RNA_def_pointer(func, "operator", "Operator", "", "Operator to call"); parm = RNA_def_pointer(func, "operator", "Operator", "", "Operator to call");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
if(flag & WM_GEN_INVOKE_EVENT) { if (flag & WM_GEN_INVOKE_EVENT) {
parm= RNA_def_pointer(func, "event", "Event", "", "Event"); parm = RNA_def_pointer(func, "event", "Event", "", "Event");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
} }
if(flag & WM_GEN_INVOKE_SIZE) { if (flag & WM_GEN_INVOKE_SIZE) {
RNA_def_int(func, "width", 300, 0, INT_MAX, "", "Width of the popup", 0, INT_MAX); RNA_def_int(func, "width", 300, 0, INT_MAX, "", "Width of the popup", 0, INT_MAX);
RNA_def_int(func, "height", 20, 0, INT_MAX, "", "Height of the popup", 0, INT_MAX); RNA_def_int(func, "height", 20, 0, INT_MAX, "", "Height of the popup", 0, INT_MAX);
} }
if(flag & WM_GEN_INVOKE_RETURN) { if (flag & WM_GEN_INVOKE_RETURN) {
parm= RNA_def_enum_flag(func, "result", operator_return_items, OPERATOR_CANCELLED, "result", ""); parm = RNA_def_enum_flag(func, "result", operator_return_items, OPERATOR_CANCELLED, "result", "");
RNA_def_function_return(func, parm); RNA_def_function_return(func, parm);
} }
} }
@@ -196,54 +196,54 @@ void RNA_api_wm(StructRNA *srna)
FunctionRNA *func; FunctionRNA *func;
PropertyRNA *parm; PropertyRNA *parm;
func= RNA_def_function(srna, "fileselect_add", "WM_event_add_fileselect"); func = RNA_def_function(srna, "fileselect_add", "WM_event_add_fileselect");
RNA_def_function_ui_description(func, "Opens a file selector with an operator. " RNA_def_function_ui_description(func, "Opens a file selector with an operator. "
"The string properties 'filepath', 'filename', 'directory' and a 'files' collection " "The string properties 'filepath', 'filename', 'directory' and a 'files' collection "
"are assigned when present in the operator"); "are assigned when present in the operator");
rna_generic_op_invoke(func, 0); rna_generic_op_invoke(func, 0);
func= RNA_def_function(srna, "modal_handler_add", "rna_event_modal_handler_add"); func = RNA_def_function(srna, "modal_handler_add", "rna_event_modal_handler_add");
RNA_def_function_flag(func, FUNC_NO_SELF|FUNC_USE_CONTEXT); RNA_def_function_flag(func, FUNC_NO_SELF|FUNC_USE_CONTEXT);
parm= RNA_def_pointer(func, "operator", "Operator", "", "Operator to call"); parm = RNA_def_pointer(func, "operator", "Operator", "", "Operator to call");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_function_return(func, RNA_def_boolean(func, "handle", 1, "", "")); RNA_def_function_return(func, RNA_def_boolean(func, "handle", 1, "", ""));
func= RNA_def_function(srna, "event_timer_add", "rna_event_timer_add"); func = RNA_def_function(srna, "event_timer_add", "rna_event_timer_add");
parm= RNA_def_property(func, "time_step", PROP_FLOAT, PROP_NONE); parm = RNA_def_property(func, "time_step", PROP_FLOAT, PROP_NONE);
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_property_range(parm, 0.0, FLT_MAX); RNA_def_property_range(parm, 0.0, FLT_MAX);
RNA_def_property_ui_text(parm, "Time Step", "Interval in seconds between timer events"); RNA_def_property_ui_text(parm, "Time Step", "Interval in seconds between timer events");
RNA_def_pointer(func, "window", "Window", "", "Window to attach the timer to or None"); RNA_def_pointer(func, "window", "Window", "", "Window to attach the timer to or None");
parm= RNA_def_pointer(func, "result", "Timer", "", ""); parm = RNA_def_pointer(func, "result", "Timer", "", "");
RNA_def_function_return(func, parm); RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "event_timer_remove", "rna_event_timer_remove"); func = RNA_def_function(srna, "event_timer_remove", "rna_event_timer_remove");
parm= RNA_def_pointer(func, "timer", "Timer", "", ""); parm = RNA_def_pointer(func, "timer", "Timer", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
/* invoke functions, for use with python */ /* invoke functions, for use with python */
func= RNA_def_function(srna, "invoke_props_popup", "WM_operator_props_popup"); func = RNA_def_function(srna, "invoke_props_popup", "WM_operator_props_popup");
RNA_def_function_ui_description(func, "Operator popup invoke"); RNA_def_function_ui_description(func, "Operator popup invoke");
rna_generic_op_invoke(func, WM_GEN_INVOKE_EVENT|WM_GEN_INVOKE_RETURN); rna_generic_op_invoke(func, WM_GEN_INVOKE_EVENT|WM_GEN_INVOKE_RETURN);
/* invoked dialog opens popup with OK button, does not auto-exec operator. */ /* invoked dialog opens popup with OK button, does not auto-exec operator. */
func= RNA_def_function(srna, "invoke_props_dialog", "WM_operator_props_dialog_popup"); func = RNA_def_function(srna, "invoke_props_dialog", "WM_operator_props_dialog_popup");
RNA_def_function_ui_description(func, "Operator dialog (non-autoexec popup) invoke"); RNA_def_function_ui_description(func, "Operator dialog (non-autoexec popup) invoke");
rna_generic_op_invoke(func, WM_GEN_INVOKE_SIZE|WM_GEN_INVOKE_RETURN); rna_generic_op_invoke(func, WM_GEN_INVOKE_SIZE|WM_GEN_INVOKE_RETURN);
/* invoke enum */ /* invoke enum */
func= RNA_def_function(srna, "invoke_search_popup", "rna_Operator_enum_search_invoke"); func = RNA_def_function(srna, "invoke_search_popup", "rna_Operator_enum_search_invoke");
rna_generic_op_invoke(func, 0); rna_generic_op_invoke(func, 0);
/* invoke functions, for use with python */ /* invoke functions, for use with python */
func= RNA_def_function(srna, "invoke_popup", "WM_operator_ui_popup"); func = RNA_def_function(srna, "invoke_popup", "WM_operator_ui_popup");
RNA_def_function_ui_description(func, "Operator popup invoke"); RNA_def_function_ui_description(func, "Operator popup invoke");
rna_generic_op_invoke(func, WM_GEN_INVOKE_SIZE|WM_GEN_INVOKE_RETURN); rna_generic_op_invoke(func, WM_GEN_INVOKE_SIZE|WM_GEN_INVOKE_RETURN);
func= RNA_def_function(srna, "invoke_confirm", "WM_operator_confirm"); func = RNA_def_function(srna, "invoke_confirm", "WM_operator_confirm");
RNA_def_function_ui_description(func, "Operator confirmation"); RNA_def_function_ui_description(func, "Operator confirmation");
rna_generic_op_invoke(func, WM_GEN_INVOKE_EVENT|WM_GEN_INVOKE_RETURN); rna_generic_op_invoke(func, WM_GEN_INVOKE_EVENT|WM_GEN_INVOKE_RETURN);
@@ -255,81 +255,81 @@ void RNA_api_operator(StructRNA *srna)
PropertyRNA *parm; PropertyRNA *parm;
/* utility, not for registering */ /* utility, not for registering */
func= RNA_def_function(srna, "report", "rna_Operator_report"); func = RNA_def_function(srna, "report", "rna_Operator_report");
parm= RNA_def_enum_flag(func, "type", wm_report_items, 0, "Type", ""); parm = RNA_def_enum_flag(func, "type", wm_report_items, 0, "Type", "");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
parm= RNA_def_string(func, "message", "", 0, "Report Message", ""); parm = RNA_def_string(func, "message", "", 0, "Report Message", "");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
/* Registration */ /* Registration */
/* poll */ /* poll */
func= RNA_def_function(srna, "poll", NULL); func = RNA_def_function(srna, "poll", NULL);
RNA_def_function_ui_description(func, "Test if the operator can be called or not"); RNA_def_function_ui_description(func, "Test if the operator can be called or not");
RNA_def_function_flag(func, FUNC_NO_SELF|FUNC_REGISTER_OPTIONAL); RNA_def_function_flag(func, FUNC_NO_SELF|FUNC_REGISTER_OPTIONAL);
RNA_def_function_return(func, RNA_def_boolean(func, "visible", 1, "", "")); RNA_def_function_return(func, RNA_def_boolean(func, "visible", 1, "", ""));
parm= RNA_def_pointer(func, "context", "Context", "", ""); parm = RNA_def_pointer(func, "context", "Context", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
/* exec */ /* exec */
func= RNA_def_function(srna, "execute", NULL); func = RNA_def_function(srna, "execute", NULL);
RNA_def_function_ui_description(func, "Execute the operator"); RNA_def_function_ui_description(func, "Execute the operator");
RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL); RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL);
parm= RNA_def_pointer(func, "context", "Context", "", ""); parm = RNA_def_pointer(func, "context", "Context", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
parm= RNA_def_enum_flag(func, "result", operator_return_items, OPERATOR_CANCELLED, "result", ""); // better name? parm = RNA_def_enum_flag(func, "result", operator_return_items, OPERATOR_CANCELLED, "result", ""); /* better name? */
RNA_def_function_return(func, parm); RNA_def_function_return(func, parm);
/* check */ /* check */
func= RNA_def_function(srna, "check", NULL); func = RNA_def_function(srna, "check", NULL);
RNA_def_function_ui_description(func, "Check the operator settings, return True to signal a change to redraw"); RNA_def_function_ui_description(func, "Check the operator settings, return True to signal a change to redraw");
RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL); RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL);
parm= RNA_def_pointer(func, "context", "Context", "", ""); parm = RNA_def_pointer(func, "context", "Context", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
parm= RNA_def_boolean(func, "result", 0, "result", ""); // better name? parm = RNA_def_boolean(func, "result", 0, "result", ""); /* better name? */
RNA_def_function_return(func, parm); RNA_def_function_return(func, parm);
/* invoke */ /* invoke */
func= RNA_def_function(srna, "invoke", NULL); func = RNA_def_function(srna, "invoke", NULL);
RNA_def_function_ui_description(func, "Invoke the operator"); RNA_def_function_ui_description(func, "Invoke the operator");
RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL); RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL);
parm= RNA_def_pointer(func, "context", "Context", "", ""); parm = RNA_def_pointer(func, "context", "Context", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
parm= RNA_def_pointer(func, "event", "Event", "", ""); parm = RNA_def_pointer(func, "event", "Event", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
parm= RNA_def_enum_flag(func, "result", operator_return_items, OPERATOR_CANCELLED, "result", ""); // better name? parm = RNA_def_enum_flag(func, "result", operator_return_items, OPERATOR_CANCELLED, "result", ""); /* better name? */
RNA_def_function_return(func, parm); RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "modal", NULL); /* same as invoke */ func = RNA_def_function(srna, "modal", NULL); /* same as invoke */
RNA_def_function_ui_description(func, "Modal operator function"); RNA_def_function_ui_description(func, "Modal operator function");
RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL); RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL);
parm= RNA_def_pointer(func, "context", "Context", "", ""); parm = RNA_def_pointer(func, "context", "Context", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
parm= RNA_def_pointer(func, "event", "Event", "", ""); parm = RNA_def_pointer(func, "event", "Event", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
parm= RNA_def_enum_flag(func, "result", operator_return_items, OPERATOR_CANCELLED, "result", ""); // better name? parm = RNA_def_enum_flag(func, "result", operator_return_items, OPERATOR_CANCELLED, "result", ""); /* better name? */
RNA_def_function_return(func, parm); RNA_def_function_return(func, parm);
/* draw */ /* draw */
func= RNA_def_function(srna, "draw", NULL); func = RNA_def_function(srna, "draw", NULL);
RNA_def_function_ui_description(func, "Draw function for the operator"); RNA_def_function_ui_description(func, "Draw function for the operator");
RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL); RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL);
parm= RNA_def_pointer(func, "context", "Context", "", ""); parm = RNA_def_pointer(func, "context", "Context", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
/* cancel */ /* cancel */
func= RNA_def_function(srna, "cancel", NULL); func = RNA_def_function(srna, "cancel", NULL);
RNA_def_function_ui_description(func, "Called when the operator is cancelled"); RNA_def_function_ui_description(func, "Called when the operator is cancelled");
RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL); RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL);
parm= RNA_def_pointer(func, "context", "Context", "", ""); parm = RNA_def_pointer(func, "context", "Context", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
parm= RNA_def_enum_flag(func, "result", operator_return_items, OPERATOR_CANCELLED, "result", ""); // better name? parm = RNA_def_enum_flag(func, "result", operator_return_items, OPERATOR_CANCELLED, "result", ""); /* better name? */
RNA_def_function_return(func, parm); RNA_def_function_return(func, parm);
} }
@@ -339,35 +339,35 @@ void RNA_api_macro(StructRNA *srna)
PropertyRNA *parm; PropertyRNA *parm;
/* utility, not for registering */ /* utility, not for registering */
func= RNA_def_function(srna, "report", "rna_Operator_report"); func = RNA_def_function(srna, "report", "rna_Operator_report");
parm= RNA_def_enum_flag(func, "type", wm_report_items, 0, "Type", ""); parm = RNA_def_enum_flag(func, "type", wm_report_items, 0, "Type", "");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
parm= RNA_def_string(func, "message", "", 0, "Report Message", ""); parm = RNA_def_string(func, "message", "", 0, "Report Message", "");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
/* Registration */ /* Registration */
/* poll */ /* poll */
func= RNA_def_function(srna, "poll", NULL); func = RNA_def_function(srna, "poll", NULL);
RNA_def_function_ui_description(func, "Test if the operator can be called or not"); RNA_def_function_ui_description(func, "Test if the operator can be called or not");
RNA_def_function_flag(func, FUNC_NO_SELF|FUNC_REGISTER_OPTIONAL); RNA_def_function_flag(func, FUNC_NO_SELF|FUNC_REGISTER_OPTIONAL);
RNA_def_function_return(func, RNA_def_boolean(func, "visible", 1, "", "")); RNA_def_function_return(func, RNA_def_boolean(func, "visible", 1, "", ""));
parm= RNA_def_pointer(func, "context", "Context", "", ""); parm = RNA_def_pointer(func, "context", "Context", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
/* draw */ /* draw */
func= RNA_def_function(srna, "draw", NULL); func = RNA_def_function(srna, "draw", NULL);
RNA_def_function_ui_description(func, "Draw function for the operator"); RNA_def_function_ui_description(func, "Draw function for the operator");
RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL); RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL);
parm= RNA_def_pointer(func, "context", "Context", "", ""); parm = RNA_def_pointer(func, "context", "Context", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
} }
void RNA_api_keyconfig(StructRNA *srna) void RNA_api_keyconfig(StructRNA *srna)
{ {
// FunctionRNA *func; /* FunctionRNA *func; */
// PropertyRNA *parm; /* PropertyRNA *parm; */
} }
void RNA_api_keymap(StructRNA *srna) void RNA_api_keymap(StructRNA *srna)
@@ -375,17 +375,17 @@ void RNA_api_keymap(StructRNA *srna)
FunctionRNA *func; FunctionRNA *func;
PropertyRNA *parm; PropertyRNA *parm;
func= RNA_def_function(srna, "active", "rna_keymap_active"); func = RNA_def_function(srna, "active", "rna_keymap_active");
RNA_def_function_flag(func, FUNC_USE_CONTEXT); RNA_def_function_flag(func, FUNC_USE_CONTEXT);
parm= RNA_def_pointer(func, "keymap", "KeyMap", "Key Map", "Active key map"); parm = RNA_def_pointer(func, "keymap", "KeyMap", "Key Map", "Active key map");
RNA_def_function_return(func, parm); RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "restore_to_default", "WM_keymap_restore_to_default"); func = RNA_def_function(srna, "restore_to_default", "WM_keymap_restore_to_default");
RNA_def_function_flag(func, FUNC_USE_CONTEXT); RNA_def_function_flag(func, FUNC_USE_CONTEXT);
func= RNA_def_function(srna, "restore_item_to_default", "rna_keymap_restore_item_to_default"); func = RNA_def_function(srna, "restore_item_to_default", "rna_keymap_restore_item_to_default");
RNA_def_function_flag(func, FUNC_USE_CONTEXT); RNA_def_function_flag(func, FUNC_USE_CONTEXT);
parm= RNA_def_pointer(func, "item", "KeyMapItem", "Item", ""); parm = RNA_def_pointer(func, "item", "KeyMapItem", "Item", "");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
} }
@@ -394,10 +394,10 @@ void RNA_api_keymapitem(StructRNA *srna)
FunctionRNA *func; FunctionRNA *func;
PropertyRNA *parm; PropertyRNA *parm;
func= RNA_def_function(srna, "compare", "WM_keymap_item_compare"); func = RNA_def_function(srna, "compare", "WM_keymap_item_compare");
parm= RNA_def_pointer(func, "item", "KeyMapItem", "Item", ""); parm = RNA_def_pointer(func, "item", "KeyMapItem", "Item", "");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
parm= RNA_def_boolean(func, "result", 0, "Comparison result", ""); parm = RNA_def_boolean(func, "result", 0, "Comparison result", "");
RNA_def_function_return(func, parm); RNA_def_function_return(func, parm);
} }
@@ -406,13 +406,13 @@ void RNA_api_keymapitems(StructRNA *srna)
FunctionRNA *func; FunctionRNA *func;
PropertyRNA *parm; PropertyRNA *parm;
func= RNA_def_function(srna, "new", "rna_KeyMap_item_new"); func = RNA_def_function(srna, "new", "rna_KeyMap_item_new");
RNA_def_function_flag(func, FUNC_USE_REPORTS); RNA_def_function_flag(func, FUNC_USE_REPORTS);
parm= RNA_def_string(func, "idname", "", 0, "Operator Identifier", ""); parm = RNA_def_string(func, "idname", "", 0, "Operator Identifier", "");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
parm= RNA_def_enum(func, "type", event_type_items, 0, "Type", ""); parm = RNA_def_enum(func, "type", event_type_items, 0, "Type", "");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
parm= RNA_def_enum(func, "value", event_value_items, 0, "Value", ""); parm = RNA_def_enum(func, "value", event_value_items, 0, "Value", "");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_boolean(func, "any", 0, "Any", ""); RNA_def_boolean(func, "any", 0, "Any", "");
RNA_def_boolean(func, "shift", 0, "Shift", ""); RNA_def_boolean(func, "shift", 0, "Shift", "");
@@ -420,16 +420,16 @@ void RNA_api_keymapitems(StructRNA *srna)
RNA_def_boolean(func, "alt", 0, "Alt", ""); RNA_def_boolean(func, "alt", 0, "Alt", "");
RNA_def_boolean(func, "oskey", 0, "OS Key", ""); RNA_def_boolean(func, "oskey", 0, "OS Key", "");
RNA_def_enum(func, "key_modifier", event_type_items, 0, "Key Modifier", ""); RNA_def_enum(func, "key_modifier", event_type_items, 0, "Key Modifier", "");
parm= RNA_def_pointer(func, "item", "KeyMapItem", "Item", "Added key map item"); parm = RNA_def_pointer(func, "item", "KeyMapItem", "Item", "Added key map item");
RNA_def_function_return(func, parm); RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "new_modal", "rna_KeyMap_item_new_modal"); func = RNA_def_function(srna, "new_modal", "rna_KeyMap_item_new_modal");
RNA_def_function_flag(func, FUNC_USE_REPORTS); RNA_def_function_flag(func, FUNC_USE_REPORTS);
parm= RNA_def_string(func, "propvalue", "", 0, "Property Value", ""); parm = RNA_def_string(func, "propvalue", "", 0, "Property Value", "");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
parm= RNA_def_enum(func, "type", event_type_items, 0, "Type", ""); parm = RNA_def_enum(func, "type", event_type_items, 0, "Type", "");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
parm= RNA_def_enum(func, "value", event_value_items, 0, "Value", ""); parm = RNA_def_enum(func, "value", event_value_items, 0, "Value", "");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_boolean(func, "any", 0, "Any", ""); RNA_def_boolean(func, "any", 0, "Any", "");
RNA_def_boolean(func, "shift", 0, "Shift", ""); RNA_def_boolean(func, "shift", 0, "Shift", "");
@@ -437,18 +437,18 @@ void RNA_api_keymapitems(StructRNA *srna)
RNA_def_boolean(func, "alt", 0, "Alt", ""); RNA_def_boolean(func, "alt", 0, "Alt", "");
RNA_def_boolean(func, "oskey", 0, "OS Key", ""); RNA_def_boolean(func, "oskey", 0, "OS Key", "");
RNA_def_enum(func, "key_modifier", event_type_items, 0, "Key Modifier", ""); RNA_def_enum(func, "key_modifier", event_type_items, 0, "Key Modifier", "");
parm= RNA_def_pointer(func, "item", "KeyMapItem", "Item", "Added key map item"); parm = RNA_def_pointer(func, "item", "KeyMapItem", "Item", "Added key map item");
RNA_def_function_return(func, parm); RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "remove", "WM_keymap_remove_item"); func = RNA_def_function(srna, "remove", "WM_keymap_remove_item");
parm= RNA_def_pointer(func, "item", "KeyMapItem", "Item", ""); parm = RNA_def_pointer(func, "item", "KeyMapItem", "Item", "");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
func= RNA_def_function(srna, "from_id", "WM_keymap_item_find_id"); func = RNA_def_function(srna, "from_id", "WM_keymap_item_find_id");
parm= RNA_def_property(func, "id", PROP_INT, PROP_NONE); parm = RNA_def_property(func, "id", PROP_INT, PROP_NONE);
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_property_ui_text(parm, "id", "ID of the item"); RNA_def_property_ui_text(parm, "id", "ID of the item");
parm= RNA_def_pointer(func, "item", "KeyMapItem", "Item", ""); parm = RNA_def_pointer(func, "item", "KeyMapItem", "Item", "");
RNA_def_function_return(func, parm); RNA_def_function_return(func, parm);
} }
@@ -457,27 +457,27 @@ void RNA_api_keymaps(StructRNA *srna)
FunctionRNA *func; FunctionRNA *func;
PropertyRNA *parm; PropertyRNA *parm;
func= RNA_def_function(srna, "new", "rna_keymap_new"); // add_keymap func = RNA_def_function(srna, "new", "rna_keymap_new"); /* add_keymap */
parm= RNA_def_string(func, "name", "", 0, "Name", ""); parm = RNA_def_string(func, "name", "", 0, "Name", "");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_enum(func, "space_type", space_type_items, SPACE_EMPTY, "Space Type", ""); RNA_def_enum(func, "space_type", space_type_items, SPACE_EMPTY, "Space Type", "");
RNA_def_enum(func, "region_type", region_type_items, RGN_TYPE_WINDOW, "Region Type", ""); RNA_def_enum(func, "region_type", region_type_items, RGN_TYPE_WINDOW, "Region Type", "");
RNA_def_boolean(func, "modal", 0, "Modal", ""); RNA_def_boolean(func, "modal", 0, "Modal", "");
parm= RNA_def_pointer(func, "keymap", "KeyMap", "Key Map", "Added key map"); parm = RNA_def_pointer(func, "keymap", "KeyMap", "Key Map", "Added key map");
RNA_def_function_return(func, parm); RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "find", "rna_keymap_find"); // find_keymap func = RNA_def_function(srna, "find", "rna_keymap_find"); /* find_keymap */
parm= RNA_def_string(func, "name", "", 0, "Name", ""); parm = RNA_def_string(func, "name", "", 0, "Name", "");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_enum(func, "space_type", space_type_items, SPACE_EMPTY, "Space Type", ""); RNA_def_enum(func, "space_type", space_type_items, SPACE_EMPTY, "Space Type", "");
RNA_def_enum(func, "region_type", region_type_items, RGN_TYPE_WINDOW, "Region Type", ""); RNA_def_enum(func, "region_type", region_type_items, RGN_TYPE_WINDOW, "Region Type", "");
parm= RNA_def_pointer(func, "keymap", "KeyMap", "Key Map", "Corresponding key map"); parm = RNA_def_pointer(func, "keymap", "KeyMap", "Key Map", "Corresponding key map");
RNA_def_function_return(func, parm); RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "find_modal", "rna_keymap_find_modal"); // find_keymap_modal func = RNA_def_function(srna, "find_modal", "rna_keymap_find_modal"); /* find_keymap_modal */
parm= RNA_def_string(func, "name", "", 0, "Operator Name", ""); parm = RNA_def_string(func, "name", "", 0, "Operator Name", "");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
parm= RNA_def_pointer(func, "keymap", "KeyMap", "Key Map", "Corresponding key map"); parm = RNA_def_pointer(func, "keymap", "KeyMap", "Key Map", "Corresponding key map");
RNA_def_function_return(func, parm); RNA_def_function_return(func, parm);
} }
@@ -486,14 +486,14 @@ void RNA_api_keyconfigs(StructRNA *srna)
FunctionRNA *func; FunctionRNA *func;
PropertyRNA *parm; PropertyRNA *parm;
func= RNA_def_function(srna, "new", "WM_keyconfig_new_user"); // add_keyconfig func = RNA_def_function(srna, "new", "WM_keyconfig_new_user"); /* add_keyconfig */
parm= RNA_def_string(func, "name", "", 0, "Name", ""); parm = RNA_def_string(func, "name", "", 0, "Name", "");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
parm= RNA_def_pointer(func, "keyconfig", "KeyConfig", "Key Configuration", "Added key configuration"); parm = RNA_def_pointer(func, "keyconfig", "KeyConfig", "Key Configuration", "Added key configuration");
RNA_def_function_return(func, parm); RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "remove", "WM_keyconfig_remove"); // remove_keyconfig func = RNA_def_function(srna, "remove", "WM_keyconfig_remove"); /* remove_keyconfig */
parm= RNA_def_pointer(func, "keyconfig", "KeyConfig", "Key Configuration", "Removed key configuration"); parm = RNA_def_pointer(func, "keyconfig", "KeyConfig", "Key Configuration", "Removed key configuration");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
} }

View File

@@ -67,29 +67,29 @@ static PointerRNA rna_World_mist_get(PointerRNA *ptr)
static void rna_World_mtex_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) static void rna_World_mtex_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{ {
World *wo= (World*)ptr->data; World *wo = (World*)ptr->data;
rna_iterator_array_begin(iter, (void*)wo->mtex, sizeof(MTex*), MAX_MTEX, 0, NULL); rna_iterator_array_begin(iter, (void*)wo->mtex, sizeof(MTex*), MAX_MTEX, 0, NULL);
} }
static PointerRNA rna_World_active_texture_get(PointerRNA *ptr) static PointerRNA rna_World_active_texture_get(PointerRNA *ptr)
{ {
World *wo= (World*)ptr->data; World *wo = (World*)ptr->data;
Tex *tex; Tex *tex;
tex= give_current_world_texture(wo); tex = give_current_world_texture(wo);
return rna_pointer_inherit_refine(ptr, &RNA_Texture, tex); return rna_pointer_inherit_refine(ptr, &RNA_Texture, tex);
} }
static void rna_World_active_texture_set(PointerRNA *ptr, PointerRNA value) static void rna_World_active_texture_set(PointerRNA *ptr, PointerRNA value)
{ {
World *wo= (World*)ptr->data; World *wo = (World*)ptr->data;
set_current_world_texture(wo, value.data); set_current_world_texture(wo, value.data);
} }
static void rna_World_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) static void rna_World_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{ {
World *wo= ptr->id.data; World *wo = ptr->id.data;
DAG_id_tag_update(&wo->id, 0); DAG_id_tag_update(&wo->id, 0);
WM_main_add_notifier(NC_WORLD, wo); WM_main_add_notifier(NC_WORLD, wo);
@@ -97,7 +97,7 @@ static void rna_World_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerR
static void rna_World_draw_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) static void rna_World_draw_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{ {
World *wo= ptr->id.data; World *wo = ptr->id.data;
DAG_id_tag_update(&wo->id, 0); DAG_id_tag_update(&wo->id, 0);
WM_main_add_notifier(NC_WORLD|ND_WORLD_DRAW, wo); WM_main_add_notifier(NC_WORLD|ND_WORLD_DRAW, wo);
@@ -106,7 +106,7 @@ static void rna_World_draw_update(Main *UNUSED(bmain), Scene *UNUSED(scene), Poi
/* so camera mist limits redraw */ /* so camera mist limits redraw */
static void rna_World_draw_mist_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) static void rna_World_draw_mist_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{ {
World *wo= ptr->id.data; World *wo = ptr->id.data;
DAG_id_tag_update(&wo->id, 0); DAG_id_tag_update(&wo->id, 0);
WM_main_add_notifier(NC_WORLD|ND_WORLD_DRAW, wo); WM_main_add_notifier(NC_WORLD|ND_WORLD_DRAW, wo);
@@ -115,7 +115,7 @@ static void rna_World_draw_mist_update(Main *UNUSED(bmain), Scene *UNUSED(scene)
static void rna_World_stars_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) static void rna_World_stars_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{ {
World *wo= ptr->id.data; World *wo = ptr->id.data;
DAG_id_tag_update(&wo->id, 0); DAG_id_tag_update(&wo->id, 0);
WM_main_add_notifier(NC_WORLD|ND_WORLD_STARS, wo); WM_main_add_notifier(NC_WORLD|ND_WORLD_STARS, wo);
@@ -123,9 +123,9 @@ static void rna_World_stars_update(Main *UNUSED(bmain), Scene *UNUSED(scene), Po
static void rna_World_use_nodes_update(Main *bmain, Scene *scene, PointerRNA *ptr) static void rna_World_use_nodes_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{ {
World *wrld= (World*)ptr->data; World *wrld = (World*)ptr->data;
if(wrld->use_nodes && wrld->nodetree==NULL) if (wrld->use_nodes && wrld->nodetree == NULL)
ED_node_shader_default(scene, &wrld->id); ED_node_shader_default(scene, &wrld->id);
rna_World_update(bmain, scene, ptr); rna_World_update(bmain, scene, ptr);
@@ -148,63 +148,63 @@ static void rna_def_world_mtex(BlenderRNA *brna)
{TEXCO_OBJECT, "OBJECT", 0, "Object", "Use linked object's coordinates for texture coordinates"}, {TEXCO_OBJECT, "OBJECT", 0, "Object", "Use linked object's coordinates for texture coordinates"},
{0, NULL, 0, NULL, NULL}}; {0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "WorldTextureSlot", "TextureSlot"); srna = RNA_def_struct(brna, "WorldTextureSlot", "TextureSlot");
RNA_def_struct_sdna(srna, "MTex"); RNA_def_struct_sdna(srna, "MTex");
RNA_def_struct_ui_text(srna, "World Texture Slot", "Texture slot for textures in a World datablock"); RNA_def_struct_ui_text(srna, "World Texture Slot", "Texture slot for textures in a World datablock");
/* map to */ /* map to */
prop= RNA_def_property(srna, "use_map_blend", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_map_blend", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", WOMAP_BLEND); RNA_def_property_boolean_sdna(prop, NULL, "mapto", WOMAP_BLEND);
RNA_def_property_ui_text(prop, "Blend", "Affect the color progression of the background"); RNA_def_property_ui_text(prop, "Blend", "Affect the color progression of the background");
RNA_def_property_update(prop, 0, "rna_World_update"); RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "use_map_horizon", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_map_horizon", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", WOMAP_HORIZ); RNA_def_property_boolean_sdna(prop, NULL, "mapto", WOMAP_HORIZ);
RNA_def_property_ui_text(prop, "Horizon", "Affect the color of the horizon"); RNA_def_property_ui_text(prop, "Horizon", "Affect the color of the horizon");
RNA_def_property_update(prop, 0, "rna_World_update"); RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "use_map_zenith_up", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_map_zenith_up", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", WOMAP_ZENUP); RNA_def_property_boolean_sdna(prop, NULL, "mapto", WOMAP_ZENUP);
RNA_def_property_ui_text(prop, "Zenith Up", "Affect the color of the zenith above"); RNA_def_property_ui_text(prop, "Zenith Up", "Affect the color of the zenith above");
RNA_def_property_update(prop, 0, "rna_World_update"); RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "use_map_zenith_down", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_map_zenith_down", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", WOMAP_ZENDOWN); RNA_def_property_boolean_sdna(prop, NULL, "mapto", WOMAP_ZENDOWN);
RNA_def_property_ui_text(prop, "Zenith Down", "Affect the color of the zenith below"); RNA_def_property_ui_text(prop, "Zenith Down", "Affect the color of the zenith below");
RNA_def_property_update(prop, 0, "rna_World_update"); RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "texture_coords", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "texture_coords", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "texco"); RNA_def_property_enum_sdna(prop, NULL, "texco");
RNA_def_property_enum_items(prop, texco_items); RNA_def_property_enum_items(prop, texco_items);
RNA_def_property_ui_text(prop, "Texture Coordinates", "Texture coordinates used to map the texture onto the background"); RNA_def_property_ui_text(prop, "Texture Coordinates", "Texture coordinates used to map the texture onto the background");
RNA_def_property_update(prop, 0, "rna_World_update"); RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "object"); RNA_def_property_pointer_sdna(prop, NULL, "object");
RNA_def_property_struct_type(prop, "Object"); RNA_def_property_struct_type(prop, "Object");
RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Object", "Object to use for mapping with Object texture coordinates"); RNA_def_property_ui_text(prop, "Object", "Object to use for mapping with Object texture coordinates");
RNA_def_property_update(prop, 0, "rna_World_update"); RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "blend_factor", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "blend_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "blendfac"); RNA_def_property_float_sdna(prop, NULL, "blendfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3); RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Blend Factor", "Amount texture affects color progression of the background"); RNA_def_property_ui_text(prop, "Blend Factor", "Amount texture affects color progression of the background");
RNA_def_property_update(prop, 0, "rna_World_update"); RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "horizon_factor", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "horizon_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "colfac"); RNA_def_property_float_sdna(prop, NULL, "colfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3); RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Horizon Factor", "Amount texture affects color of the horizon"); RNA_def_property_ui_text(prop, "Horizon Factor", "Amount texture affects color of the horizon");
RNA_def_property_update(prop, 0, "rna_World_update"); RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "zenith_up_factor", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "zenith_up_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "zenupfac"); RNA_def_property_float_sdna(prop, NULL, "zenupfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3); RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Zenith Up Factor", "Amount texture affects color of the zenith above"); RNA_def_property_ui_text(prop, "Zenith Up Factor", "Amount texture affects color of the zenith above");
RNA_def_property_update(prop, 0, "rna_World_update"); RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "zenith_down_factor", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "zenith_down_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "zendownfac"); RNA_def_property_float_sdna(prop, NULL, "zendownfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3); RNA_def_property_ui_range(prop, 0, 1, 10, 3);
RNA_def_property_ui_text(prop, "Zenith Down Factor", "Amount texture affects color of the zenith below"); RNA_def_property_ui_text(prop, "Zenith Down Factor", "Amount texture affects color of the zenith below");
@@ -238,138 +238,138 @@ static void rna_def_lighting(BlenderRNA *brna)
{WO_AOGATHER_APPROX, "APPROXIMATE", 0, "Approximate", "Inaccurate, but faster and without noise"}, {WO_AOGATHER_APPROX, "APPROXIMATE", 0, "Approximate", "Inaccurate, but faster and without noise"},
{0, NULL, 0, NULL, NULL}}; {0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "WorldLighting", NULL); srna = RNA_def_struct(brna, "WorldLighting", NULL);
RNA_def_struct_sdna(srna, "World"); RNA_def_struct_sdna(srna, "World");
RNA_def_struct_nested(brna, srna, "World"); RNA_def_struct_nested(brna, srna, "World");
RNA_def_struct_ui_text(srna, "Lighting", "Lighting for a World datablock"); RNA_def_struct_ui_text(srna, "Lighting", "Lighting for a World datablock");
/* ambient occlusion */ /* ambient occlusion */
prop= RNA_def_property(srna, "use_ambient_occlusion", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_ambient_occlusion", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", WO_AMB_OCC); RNA_def_property_boolean_sdna(prop, NULL, "mode", WO_AMB_OCC);
RNA_def_property_ui_text(prop, "Use Ambient Occlusion", "Use Ambient Occlusion to add shadowing based on distance between objects"); RNA_def_property_ui_text(prop, "Use Ambient Occlusion", "Use Ambient Occlusion to add shadowing based on distance between objects");
RNA_def_property_update(prop, 0, "rna_World_update"); RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "ao_factor", PROP_FLOAT, PROP_FACTOR); prop = RNA_def_property(srna, "ao_factor", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "aoenergy"); RNA_def_property_float_sdna(prop, NULL, "aoenergy");
RNA_def_property_range(prop, 0, INT_MAX); RNA_def_property_range(prop, 0, INT_MAX);
RNA_def_property_ui_range(prop, 0, 1, 0.1, 2); RNA_def_property_ui_range(prop, 0, 1, 0.1, 2);
RNA_def_property_ui_text(prop, "Factor", "Factor for ambient occlusion blending"); RNA_def_property_ui_text(prop, "Factor", "Factor for ambient occlusion blending");
RNA_def_property_update(prop, 0, "rna_World_update"); RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "ao_blend_type", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "ao_blend_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "aomix"); RNA_def_property_enum_sdna(prop, NULL, "aomix");
RNA_def_property_enum_items(prop, blend_mode_items); RNA_def_property_enum_items(prop, blend_mode_items);
RNA_def_property_ui_text(prop, "Blend Mode", "Defines how AO mixes with material shading"); RNA_def_property_ui_text(prop, "Blend Mode", "Defines how AO mixes with material shading");
RNA_def_property_update(prop, 0, "rna_World_update"); RNA_def_property_update(prop, 0, "rna_World_update");
/* environment lighting */ /* environment lighting */
prop= RNA_def_property(srna, "use_environment_light", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_environment_light", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", WO_ENV_LIGHT); RNA_def_property_boolean_sdna(prop, NULL, "mode", WO_ENV_LIGHT);
RNA_def_property_ui_text(prop, "Use Environment Lighting", "Add light coming from the environment"); RNA_def_property_ui_text(prop, "Use Environment Lighting", "Add light coming from the environment");
RNA_def_property_update(prop, 0, "rna_World_update"); RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "environment_energy", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "environment_energy", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ao_env_energy"); RNA_def_property_float_sdna(prop, NULL, "ao_env_energy");
RNA_def_property_ui_range(prop, 0, FLT_MAX, 1, 3); RNA_def_property_ui_range(prop, 0, FLT_MAX, 1, 3);
RNA_def_property_ui_text(prop, "Environment Color", "Defines the strength of environment light"); RNA_def_property_ui_text(prop, "Environment Color", "Defines the strength of environment light");
RNA_def_property_update(prop, 0, "rna_World_update"); RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "environment_color", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "environment_color", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "aocolor"); RNA_def_property_enum_sdna(prop, NULL, "aocolor");
RNA_def_property_enum_items(prop, prop_color_items); RNA_def_property_enum_items(prop, prop_color_items);
RNA_def_property_ui_text(prop, "Environment Color", "Defines where the color of the environment light comes from"); RNA_def_property_ui_text(prop, "Environment Color", "Defines where the color of the environment light comes from");
RNA_def_property_update(prop, 0, "rna_World_update"); RNA_def_property_update(prop, 0, "rna_World_update");
/* indirect lighting */ /* indirect lighting */
prop= RNA_def_property(srna, "use_indirect_light", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_indirect_light", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", WO_INDIRECT_LIGHT); RNA_def_property_boolean_sdna(prop, NULL, "mode", WO_INDIRECT_LIGHT);
RNA_def_property_ui_text(prop, "Use Indirect Lighting", "Add indirect light bouncing of surrounding objects"); RNA_def_property_ui_text(prop, "Use Indirect Lighting", "Add indirect light bouncing of surrounding objects");
RNA_def_property_update(prop, 0, "rna_World_update"); RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "indirect_factor", PROP_FLOAT, PROP_FACTOR); prop = RNA_def_property(srna, "indirect_factor", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "ao_indirect_energy"); RNA_def_property_float_sdna(prop, NULL, "ao_indirect_energy");
RNA_def_property_range(prop, 0, INT_MAX); RNA_def_property_range(prop, 0, INT_MAX);
RNA_def_property_ui_range(prop, 0, 1, 0.1, 2); RNA_def_property_ui_range(prop, 0, 1, 0.1, 2);
RNA_def_property_ui_text(prop, "Indirect Factor", "Factor for how much surrounding objects contribute to light"); RNA_def_property_ui_text(prop, "Indirect Factor", "Factor for how much surrounding objects contribute to light");
RNA_def_property_update(prop, 0, "rna_World_update"); RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "indirect_bounces", PROP_INT, PROP_UNSIGNED); prop = RNA_def_property(srna, "indirect_bounces", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "ao_indirect_bounces"); RNA_def_property_int_sdna(prop, NULL, "ao_indirect_bounces");
RNA_def_property_range(prop, 1, SHRT_MAX); RNA_def_property_range(prop, 1, SHRT_MAX);
RNA_def_property_ui_text(prop, "Bounces", "Number of indirect diffuse light bounces"); RNA_def_property_ui_text(prop, "Bounces", "Number of indirect diffuse light bounces");
RNA_def_property_update(prop, 0, "rna_World_update"); RNA_def_property_update(prop, 0, "rna_World_update");
/* gathering parameters */ /* gathering parameters */
prop= RNA_def_property(srna, "gather_method", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "gather_method", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "ao_gather_method"); RNA_def_property_enum_sdna(prop, NULL, "ao_gather_method");
RNA_def_property_enum_items(prop, prop_gather_method_items); RNA_def_property_enum_items(prop, prop_gather_method_items);
RNA_def_property_ui_text(prop, "Gather Method", ""); RNA_def_property_ui_text(prop, "Gather Method", "");
RNA_def_property_update(prop, 0, "rna_World_update"); RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "passes", PROP_INT, PROP_NONE); prop = RNA_def_property(srna, "passes", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "ao_approx_passes"); RNA_def_property_int_sdna(prop, NULL, "ao_approx_passes");
RNA_def_property_range(prop, 0, 10); RNA_def_property_range(prop, 0, 10);
RNA_def_property_ui_text(prop, "Passes", "Number of preprocessing passes to reduce overocclusion"); RNA_def_property_ui_text(prop, "Passes", "Number of preprocessing passes to reduce overocclusion");
RNA_def_property_update(prop, 0, "rna_World_update"); RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_DISTANCE); prop = RNA_def_property(srna, "distance", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "aodist"); RNA_def_property_float_sdna(prop, NULL, "aodist");
RNA_def_property_ui_text(prop, "Distance", "Length of rays, defines how far away other faces give occlusion effect"); RNA_def_property_ui_text(prop, "Distance", "Length of rays, defines how far away other faces give occlusion effect");
RNA_def_property_update(prop, 0, "rna_World_update"); RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "falloff_strength", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "falloff_strength", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "aodistfac"); RNA_def_property_float_sdna(prop, NULL, "aodistfac");
RNA_def_property_ui_text(prop, "Strength", "Attenuation falloff strength, the higher, the less influence distant objects have"); RNA_def_property_ui_text(prop, "Strength", "Attenuation falloff strength, the higher, the less influence distant objects have");
RNA_def_property_update(prop, 0, "rna_World_update"); RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "bias", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "bias", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "aobias"); RNA_def_property_float_sdna(prop, NULL, "aobias");
RNA_def_property_range(prop, 0, 0.5); RNA_def_property_range(prop, 0, 0.5);
RNA_def_property_ui_text(prop, "Bias", "Bias (in radians) to prevent smoothed faces from showing banding (for Raytrace Constant Jittered)"); RNA_def_property_ui_text(prop, "Bias", "Bias (in radians) to prevent smoothed faces from showing banding (for Raytrace Constant Jittered)");
RNA_def_property_update(prop, 0, "rna_World_update"); RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "threshold", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "threshold", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ao_adapt_thresh"); RNA_def_property_float_sdna(prop, NULL, "ao_adapt_thresh");
RNA_def_property_range(prop, 0, 1); RNA_def_property_range(prop, 0, 1);
RNA_def_property_ui_text(prop, "Threshold", "Samples below this threshold will be considered fully shadowed/unshadowed and skipped (for Raytrace Adaptive QMC)"); RNA_def_property_ui_text(prop, "Threshold", "Samples below this threshold will be considered fully shadowed/unshadowed and skipped (for Raytrace Adaptive QMC)");
RNA_def_property_update(prop, 0, "rna_World_update"); RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "adapt_to_speed", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "adapt_to_speed", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ao_adapt_speed_fac"); RNA_def_property_float_sdna(prop, NULL, "ao_adapt_speed_fac");
RNA_def_property_range(prop, 0, 1); RNA_def_property_range(prop, 0, 1);
RNA_def_property_ui_text(prop, "Adapt To Speed", "Use the speed vector pass to reduce AO samples in fast moving pixels. Higher values result in more aggressive sample reduction. Requires Vec pass enabled (for Raytrace Adaptive QMC)"); RNA_def_property_ui_text(prop, "Adapt To Speed", "Use the speed vector pass to reduce AO samples in fast moving pixels. Higher values result in more aggressive sample reduction. Requires Vec pass enabled (for Raytrace Adaptive QMC)");
RNA_def_property_update(prop, 0, "rna_World_update"); RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "error_threshold", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "error_threshold", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ao_approx_error"); RNA_def_property_float_sdna(prop, NULL, "ao_approx_error");
RNA_def_property_range(prop, 0.0001, 10); RNA_def_property_range(prop, 0.0001, 10);
RNA_def_property_ui_text(prop, "Error Tolerance", "Low values are slower and higher quality"); RNA_def_property_ui_text(prop, "Error Tolerance", "Low values are slower and higher quality");
RNA_def_property_update(prop, 0, "rna_World_update"); RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "correction", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "correction", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ao_approx_correction"); RNA_def_property_float_sdna(prop, NULL, "ao_approx_correction");
RNA_def_property_range(prop, 0, 1); RNA_def_property_range(prop, 0, 1);
RNA_def_property_ui_range(prop, 0, 1, 0.1, 2); RNA_def_property_ui_range(prop, 0, 1, 0.1, 2);
RNA_def_property_ui_text(prop, "Correction", "Ad-hoc correction for over-occlusion due to the approximation"); RNA_def_property_ui_text(prop, "Correction", "Ad-hoc correction for over-occlusion due to the approximation");
RNA_def_property_update(prop, 0, "rna_World_update"); RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "use_falloff", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_falloff", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "aomode", WO_AODIST); RNA_def_property_boolean_sdna(prop, NULL, "aomode", WO_AODIST);
RNA_def_property_ui_text(prop, "Falloff", "Distance will be used to attenuate shadows"); RNA_def_property_ui_text(prop, "Falloff", "Distance will be used to attenuate shadows");
RNA_def_property_update(prop, 0, "rna_World_update"); RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "use_cache", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_cache", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "aomode", WO_AOCACHE); RNA_def_property_boolean_sdna(prop, NULL, "aomode", WO_AOCACHE);
RNA_def_property_ui_text(prop, "Pixel Cache", "Cache AO results in pixels and interpolate over neighboring pixels for speedup"); RNA_def_property_ui_text(prop, "Pixel Cache", "Cache AO results in pixels and interpolate over neighboring pixels for speedup");
RNA_def_property_update(prop, 0, "rna_World_update"); RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "samples", PROP_INT, PROP_NONE); prop = RNA_def_property(srna, "samples", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "aosamp"); RNA_def_property_int_sdna(prop, NULL, "aosamp");
RNA_def_property_range(prop, 1, 128); RNA_def_property_range(prop, 1, 128);
RNA_def_property_ui_text(prop, "Samples", "Amount of ray samples. Higher values give smoother results and longer rendering times"); RNA_def_property_ui_text(prop, "Samples", "Amount of ray samples. Higher values give smoother results and longer rendering times");
RNA_def_property_update(prop, 0, "rna_World_update"); RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "sample_method", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "sample_method", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "ao_samp_method"); RNA_def_property_enum_sdna(prop, NULL, "ao_samp_method");
RNA_def_property_enum_items(prop, prop_sample_method_items); RNA_def_property_enum_items(prop, prop_sample_method_items);
RNA_def_property_ui_text(prop, "Sample Method", "Method for generating shadow samples (for Raytrace)"); RNA_def_property_ui_text(prop, "Sample Method", "Method for generating shadow samples (for Raytrace)");
@@ -387,43 +387,43 @@ static void rna_def_world_mist(BlenderRNA *brna)
{2, "INVERSE_QUADRATIC", 0, "Inverse Quadratic", "Use inverse quadratic progression"}, {2, "INVERSE_QUADRATIC", 0, "Inverse Quadratic", "Use inverse quadratic progression"},
{0, NULL, 0, NULL, NULL}}; {0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "WorldMistSettings", NULL); srna = RNA_def_struct(brna, "WorldMistSettings", NULL);
RNA_def_struct_sdna(srna, "World"); RNA_def_struct_sdna(srna, "World");
RNA_def_struct_nested(brna, srna, "World"); RNA_def_struct_nested(brna, srna, "World");
RNA_def_struct_ui_text(srna, "World Mist", "Mist settings for a World data-block"); RNA_def_struct_ui_text(srna, "World Mist", "Mist settings for a World data-block");
prop= RNA_def_property(srna, "use_mist", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_mist", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", WO_MIST); RNA_def_property_boolean_sdna(prop, NULL, "mode", WO_MIST);
RNA_def_property_ui_text(prop, "Use Mist", "Occlude objects with the environment color as they are further away"); RNA_def_property_ui_text(prop, "Use Mist", "Occlude objects with the environment color as they are further away");
RNA_def_property_update(prop, 0, "rna_World_draw_update"); RNA_def_property_update(prop, 0, "rna_World_draw_update");
prop= RNA_def_property(srna, "intensity", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "intensity", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "misi"); RNA_def_property_float_sdna(prop, NULL, "misi");
RNA_def_property_range(prop, 0, 1); RNA_def_property_range(prop, 0, 1);
RNA_def_property_ui_text(prop, "Minimum", "Overall minimum intensity of the mist effect"); RNA_def_property_ui_text(prop, "Minimum", "Overall minimum intensity of the mist effect");
RNA_def_property_update(prop, 0, "rna_World_update"); RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "start", PROP_FLOAT, PROP_DISTANCE); prop = RNA_def_property(srna, "start", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "miststa"); RNA_def_property_float_sdna(prop, NULL, "miststa");
RNA_def_property_range(prop, 0, FLT_MAX); RNA_def_property_range(prop, 0, FLT_MAX);
RNA_def_property_ui_range(prop, 0, 10000, 10, 2); RNA_def_property_ui_range(prop, 0, 10000, 10, 2);
RNA_def_property_ui_text(prop, "Start", "Starting distance of the mist, measured from the camera"); RNA_def_property_ui_text(prop, "Start", "Starting distance of the mist, measured from the camera");
RNA_def_property_update(prop, 0, "rna_World_draw_mist_update"); RNA_def_property_update(prop, 0, "rna_World_draw_mist_update");
prop= RNA_def_property(srna, "depth", PROP_FLOAT, PROP_DISTANCE); prop = RNA_def_property(srna, "depth", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "mistdist"); RNA_def_property_float_sdna(prop, NULL, "mistdist");
RNA_def_property_range(prop, 0, FLT_MAX); RNA_def_property_range(prop, 0, FLT_MAX);
RNA_def_property_ui_range(prop, 0, 10000, 10, 2); RNA_def_property_ui_range(prop, 0, 10000, 10, 2);
RNA_def_property_ui_text(prop, "Depth", "Distance over which the mist effect fades in"); RNA_def_property_ui_text(prop, "Depth", "Distance over which the mist effect fades in");
RNA_def_property_update(prop, 0, "rna_World_draw_mist_update"); RNA_def_property_update(prop, 0, "rna_World_draw_mist_update");
prop= RNA_def_property(srna, "height", PROP_FLOAT, PROP_DISTANCE); prop = RNA_def_property(srna, "height", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "misthi"); RNA_def_property_float_sdna(prop, NULL, "misthi");
RNA_def_property_range(prop, 0, 100); RNA_def_property_range(prop, 0, 100);
RNA_def_property_ui_text(prop, "Height", "Control how much mist density decreases with height"); RNA_def_property_ui_text(prop, "Height", "Control how much mist density decreases with height");
RNA_def_property_update(prop, 0, "rna_World_update"); RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "falloff", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "falloff", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "mistype"); RNA_def_property_enum_sdna(prop, NULL, "mistype");
RNA_def_property_enum_items(prop, falloff_items); RNA_def_property_enum_items(prop, falloff_items);
RNA_def_property_ui_text(prop, "Falloff", "Type of transition used to fade mist"); RNA_def_property_ui_text(prop, "Falloff", "Type of transition used to fade mist");
@@ -435,35 +435,35 @@ static void rna_def_world_stars(BlenderRNA *brna)
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
srna= RNA_def_struct(brna, "WorldStarsSettings", NULL); srna = RNA_def_struct(brna, "WorldStarsSettings", NULL);
RNA_def_struct_sdna(srna, "World"); RNA_def_struct_sdna(srna, "World");
RNA_def_struct_nested(brna, srna, "World"); RNA_def_struct_nested(brna, srna, "World");
RNA_def_struct_ui_text(srna, "World Stars", "Stars settings for a World data-block"); RNA_def_struct_ui_text(srna, "World Stars", "Stars settings for a World data-block");
prop= RNA_def_property(srna, "use_stars", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_stars", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", WO_STARS); RNA_def_property_boolean_sdna(prop, NULL, "mode", WO_STARS);
RNA_def_property_ui_text(prop, "Use Stars", "Enable starfield generation"); RNA_def_property_ui_text(prop, "Use Stars", "Enable starfield generation");
RNA_def_property_update(prop, 0, "rna_World_stars_update"); RNA_def_property_update(prop, 0, "rna_World_stars_update");
prop= RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "starsize"); RNA_def_property_float_sdna(prop, NULL, "starsize");
RNA_def_property_range(prop, 0, 10); RNA_def_property_range(prop, 0, 10);
RNA_def_property_ui_text(prop, "Size", "Average screen dimension of stars"); RNA_def_property_ui_text(prop, "Size", "Average screen dimension of stars");
RNA_def_property_update(prop, 0, "rna_World_draw_update"); /* use normal update since this isnt visualized */ RNA_def_property_update(prop, 0, "rna_World_draw_update"); /* use normal update since this isnt visualized */
prop= RNA_def_property(srna, "distance_min", PROP_FLOAT, PROP_DISTANCE); prop = RNA_def_property(srna, "distance_min", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "starmindist"); RNA_def_property_float_sdna(prop, NULL, "starmindist");
RNA_def_property_range(prop, 0, 1000); RNA_def_property_range(prop, 0, 1000);
RNA_def_property_ui_text(prop, "Minimum Distance", "Minimum distance to the camera for stars"); RNA_def_property_ui_text(prop, "Minimum Distance", "Minimum distance to the camera for stars");
RNA_def_property_update(prop, 0, "rna_World_stars_update"); RNA_def_property_update(prop, 0, "rna_World_stars_update");
prop= RNA_def_property(srna, "average_separation", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "average_separation", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "stardist"); RNA_def_property_float_sdna(prop, NULL, "stardist");
RNA_def_property_range(prop, 2, 1000); RNA_def_property_range(prop, 2, 1000);
RNA_def_property_ui_text(prop, "Average Separation", "Average distance between any two stars"); RNA_def_property_ui_text(prop, "Average Separation", "Average distance between any two stars");
RNA_def_property_update(prop, 0, "rna_World_stars_update"); RNA_def_property_update(prop, 0, "rna_World_stars_update");
prop= RNA_def_property(srna, "color_random", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "color_random", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "starcolnoise"); RNA_def_property_float_sdna(prop, NULL, "starcolnoise");
RNA_def_property_range(prop, 0, 1); RNA_def_property_range(prop, 0, 1);
RNA_def_property_ui_text(prop, "Color Randomization", "Randomize star colors"); RNA_def_property_ui_text(prop, "Color Randomization", "Randomize star colors");
@@ -475,18 +475,18 @@ void RNA_def_world(BlenderRNA *brna)
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
/* #if 0
static EnumPropertyItem physics_engine_items[] = { static EnumPropertyItem physics_engine_items[] = {
{WOPHY_NONE, "NONE", 0, "None", ""}, {WOPHY_NONE, "NONE", 0, "None", ""},
//{WOPHY_ENJI, "ENJI", 0, "Enji", ""}, /*{WOPHY_ENJI, "ENJI", 0, "Enji", ""}, */
//{WOPHY_SUMO, "SUMO", 0, "Sumo (Deprecated)", ""}, /*{WOPHY_SUMO, "SUMO", 0, "Sumo (Deprecated)", ""}, */
//{WOPHY_DYNAMO, "DYNAMO", 0, "Dynamo", ""}, /*{WOPHY_DYNAMO, "DYNAMO", 0, "Dynamo", ""}, */
//{WOPHY_ODE, "ODE", 0, "ODE", ""}, /*{WOPHY_ODE, "ODE", 0, "ODE", ""}, */
{WOPHY_BULLET, "BULLET", 0, "Bullet", ""}, {WOPHY_BULLET, "BULLET", 0, "Bullet", ""},
{0, NULL, 0, NULL, NULL}}; {0, NULL, 0, NULL, NULL}};
*/ #endif
srna= RNA_def_struct(brna, "World", "ID"); srna = RNA_def_struct(brna, "World", "ID");
RNA_def_struct_ui_text(srna, "World", "World datablock describing the environment and ambient lighting of a scene"); RNA_def_struct_ui_text(srna, "World", "World datablock describing the environment and ambient lighting of a scene");
RNA_def_struct_ui_icon(srna, ICON_WORLD_DATA); RNA_def_struct_ui_icon(srna, ICON_WORLD_DATA);
@@ -495,7 +495,7 @@ void RNA_def_world(BlenderRNA *brna)
"rna_World_active_texture_set", NULL, "WorldTextureSlot", "WorldTextureSlots", "rna_World_update"); "rna_World_active_texture_set", NULL, "WorldTextureSlot", "WorldTextureSlots", "rna_World_update");
/* colors */ /* colors */
prop= RNA_def_property(srna, "horizon_color", PROP_FLOAT, PROP_COLOR); prop = RNA_def_property(srna, "horizon_color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "horr"); RNA_def_property_float_sdna(prop, NULL, "horr");
RNA_def_property_array(prop, 3); RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Horizon Color", "Color at the horizon"); RNA_def_property_ui_text(prop, "Horizon Color", "Color at the horizon");
@@ -504,72 +504,72 @@ void RNA_def_world(BlenderRNA *brna)
RNA_def_property_update(prop, NC_WORLD|ND_WORLD_DRAW, "rna_World_update"); RNA_def_property_update(prop, NC_WORLD|ND_WORLD_DRAW, "rna_World_update");
prop= RNA_def_property(srna, "zenith_color", PROP_FLOAT, PROP_COLOR); prop = RNA_def_property(srna, "zenith_color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "zenr"); RNA_def_property_float_sdna(prop, NULL, "zenr");
RNA_def_property_array(prop, 3); RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Zenith Color", "Color at the zenith"); RNA_def_property_ui_text(prop, "Zenith Color", "Color at the zenith");
RNA_def_property_update(prop, 0, "rna_World_update"); RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "ambient_color", PROP_FLOAT, PROP_COLOR); prop = RNA_def_property(srna, "ambient_color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "ambr"); RNA_def_property_float_sdna(prop, NULL, "ambr");
RNA_def_property_array(prop, 3); RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Ambient Color", "Ambient color of the world"); RNA_def_property_ui_text(prop, "Ambient Color", "Ambient color of the world");
RNA_def_property_update(prop, 0, "rna_World_update"); RNA_def_property_update(prop, 0, "rna_World_update");
/* exp, range */ /* exp, range */
prop= RNA_def_property(srna, "exposure", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "exposure", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "exp"); RNA_def_property_float_sdna(prop, NULL, "exp");
RNA_def_property_range(prop, 0.0, 1.0); RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_ui_text(prop, "Exposure", "Amount of exponential color correction for light"); RNA_def_property_ui_text(prop, "Exposure", "Amount of exponential color correction for light");
RNA_def_property_update(prop, 0, "rna_World_update"); RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "color_range", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "color_range", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "range"); RNA_def_property_float_sdna(prop, NULL, "range");
RNA_def_property_range(prop, 0.2, 5.0); RNA_def_property_range(prop, 0.2, 5.0);
RNA_def_property_ui_text(prop, "Range", "The color range that will be mapped to 0-1"); RNA_def_property_ui_text(prop, "Range", "The color range that will be mapped to 0-1");
RNA_def_property_update(prop, 0, "rna_World_update"); RNA_def_property_update(prop, 0, "rna_World_update");
/* sky type */ /* sky type */
prop= RNA_def_property(srna, "use_sky_blend", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_sky_blend", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "skytype", WO_SKYBLEND); RNA_def_property_boolean_sdna(prop, NULL, "skytype", WO_SKYBLEND);
RNA_def_property_ui_text(prop, "Blend Sky", "Render background with natural progression from horizon to zenith"); RNA_def_property_ui_text(prop, "Blend Sky", "Render background with natural progression from horizon to zenith");
RNA_def_property_update(prop, 0, "rna_World_update"); RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "use_sky_paper", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_sky_paper", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "skytype", WO_SKYPAPER); RNA_def_property_boolean_sdna(prop, NULL, "skytype", WO_SKYPAPER);
RNA_def_property_ui_text(prop, "Paper Sky", "Flatten blend or texture coordinates"); RNA_def_property_ui_text(prop, "Paper Sky", "Flatten blend or texture coordinates");
RNA_def_property_update(prop, 0, "rna_World_update"); RNA_def_property_update(prop, 0, "rna_World_update");
prop= RNA_def_property(srna, "use_sky_real", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_sky_real", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "skytype", WO_SKYREAL); RNA_def_property_boolean_sdna(prop, NULL, "skytype", WO_SKYREAL);
RNA_def_property_ui_text(prop, "Real Sky", "Render background with a real horizon, relative to the camera angle"); RNA_def_property_ui_text(prop, "Real Sky", "Render background with a real horizon, relative to the camera angle");
RNA_def_property_update(prop, 0, "rna_World_update"); RNA_def_property_update(prop, 0, "rna_World_update");
/* nested structs */ /* nested structs */
prop= RNA_def_property(srna, "light_settings", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "light_settings", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "WorldLighting"); RNA_def_property_struct_type(prop, "WorldLighting");
RNA_def_property_pointer_funcs(prop, "rna_World_lighting_get", NULL, NULL, NULL); RNA_def_property_pointer_funcs(prop, "rna_World_lighting_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Lighting", "World lighting settings"); RNA_def_property_ui_text(prop, "Lighting", "World lighting settings");
prop= RNA_def_property(srna, "mist_settings", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "mist_settings", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "WorldMistSettings"); RNA_def_property_struct_type(prop, "WorldMistSettings");
RNA_def_property_pointer_funcs(prop, "rna_World_mist_get", NULL, NULL, NULL); RNA_def_property_pointer_funcs(prop, "rna_World_mist_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Mist", "World mist settings"); RNA_def_property_ui_text(prop, "Mist", "World mist settings");
prop= RNA_def_property(srna, "star_settings", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "star_settings", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "WorldStarsSettings"); RNA_def_property_struct_type(prop, "WorldStarsSettings");
RNA_def_property_pointer_funcs(prop, "rna_World_stars_get", NULL, NULL, NULL); RNA_def_property_pointer_funcs(prop, "rna_World_stars_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Stars", "World stars settings"); RNA_def_property_ui_text(prop, "Stars", "World stars settings");
/* nodes */ /* nodes */
prop= RNA_def_property(srna, "node_tree", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "node_tree", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "nodetree"); RNA_def_property_pointer_sdna(prop, NULL, "nodetree");
RNA_def_property_ui_text(prop, "Node Tree", "Node tree for node based worlds"); RNA_def_property_ui_text(prop, "Node Tree", "Node tree for node based worlds");
prop= RNA_def_property(srna, "use_nodes", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_nodes", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "use_nodes", 1); RNA_def_property_boolean_sdna(prop, NULL, "use_nodes", 1);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Use Nodes", "Use shader nodes to render the world"); RNA_def_property_ui_text(prop, "Use Nodes", "Use shader nodes to render the world");