style cleanup: mostly whitespace in rna

This commit is contained in:
2012-05-12 11:01:29 +00:00
parent 68e27b749e
commit a9f6e54384
73 changed files with 5321 additions and 4937 deletions

View File

@@ -201,7 +201,7 @@ typedef struct _AviMovie {
} AviMovie;
typedef enum {
AVI_ERROR_NONE=0,
AVI_ERROR_NONE = 0,
AVI_ERROR_COMPRESSION,
AVI_ERROR_OPEN,
AVI_ERROR_READING,
@@ -214,7 +214,7 @@ typedef enum {
/* belongs to the option-setting function. */
typedef enum {
AVI_OPTION_WIDTH=0,
AVI_OPTION_WIDTH = 0,
AVI_OPTION_HEIGHT,
AVI_OPTION_QUALITY,
AVI_OPTION_FRAMERATE
@@ -230,7 +230,7 @@ typedef enum {
/**
* This is a sort of MAKE_ID thing. Used in imbuf :( It is used
* through options in the AVI header (AviStreamHeader). */
#define FCC(ch4) (ch4[0] | ch4[1]<<8 | ch4[2]<<16 | ch4[3] << 24)
#define FCC(ch4) (ch4[0] | ch4[1] << 8 | ch4[2] << 16 | ch4[3] << 24)
/**
* Test whether this is an avi-format.

View File

@@ -54,7 +54,7 @@
#endif
#ifdef __APPLE__
/* XXX BIG WARNING: carbon.h can not be included in blender code, it conflicts with struct ID */
/* XXX BIG WARNING: carbon.h can not be included in blender code, it conflicts with struct ID */
# define ID ID_
# include <CoreServices/CoreServices.h>
#endif /* __APPLE__ */
@@ -68,7 +68,7 @@
/* FSMENU HANDLING */
/* FSMenuEntry's without paths indicate seperators */
/* FSMenuEntry's without paths indicate seperators */
typedef struct _FSMenuEntry FSMenuEntry;
struct _FSMenuEntry {
FSMenuEntry *next;
@@ -77,8 +77,7 @@ struct _FSMenuEntry {
short save;
};
typedef struct FSMenu
{
typedef struct FSMenu {
FSMenuEntry *fsmenu_system;
FSMenuEntry *fsmenu_bookmarks;
FSMenuEntry *fsmenu_recent;
@@ -87,15 +86,15 @@ typedef struct FSMenu
static FSMenu *g_fsmenu = NULL;
struct FSMenu* fsmenu_get(void)
FSMenu *fsmenu_get(void)
{
if (!g_fsmenu) {
g_fsmenu=MEM_callocN(sizeof(struct FSMenu), "fsmenu");
g_fsmenu = MEM_callocN(sizeof(struct FSMenu), "fsmenu");
}
return g_fsmenu;
}
static FSMenuEntry *fsmenu_get_category(struct FSMenu* fsmenu, FSMenuCategory category)
static FSMenuEntry *fsmenu_get_category(struct FSMenu *fsmenu, FSMenuCategory category)
{
FSMenuEntry *fsms = NULL;
@@ -113,7 +112,7 @@ static FSMenuEntry *fsmenu_get_category(struct FSMenu* fsmenu, FSMenuCategory ca
return fsms;
}
static void fsmenu_set_category(struct FSMenu* fsmenu, FSMenuCategory category, FSMenuEntry *fsms)
static void fsmenu_set_category(struct FSMenu *fsmenu, FSMenuCategory category, FSMenuEntry *fsms)
{
switch (category) {
case FS_CATEGORY_SYSTEM:
@@ -128,49 +127,49 @@ static void fsmenu_set_category(struct FSMenu* fsmenu, FSMenuCategory category,
}
}
int fsmenu_get_nentries(struct FSMenu* fsmenu, FSMenuCategory category)
int fsmenu_get_nentries(struct FSMenu *fsmenu, FSMenuCategory category)
{
FSMenuEntry *fsme;
int count= 0;
int count = 0;
for (fsme= fsmenu_get_category(fsmenu, category); fsme; fsme= fsme->next)
for (fsme = fsmenu_get_category(fsmenu, category); fsme; fsme = fsme->next)
count++;
return count;
}
char *fsmenu_get_entry(struct FSMenu* fsmenu, FSMenuCategory category, int idx)
char *fsmenu_get_entry(struct FSMenu *fsmenu, FSMenuCategory category, int idx)
{
FSMenuEntry *fsme;
for (fsme= fsmenu_get_category(fsmenu, category); fsme && idx; fsme= fsme->next)
for (fsme = fsmenu_get_category(fsmenu, category); fsme && idx; fsme = fsme->next)
idx--;
return fsme?fsme->path:NULL;
return fsme ? fsme->path : NULL;
}
short fsmenu_can_save (struct FSMenu* fsmenu, FSMenuCategory category, int idx)
short fsmenu_can_save(struct FSMenu *fsmenu, FSMenuCategory category, int idx)
{
FSMenuEntry *fsme;
for (fsme= fsmenu_get_category(fsmenu, category); fsme && idx; fsme= fsme->next)
for (fsme = fsmenu_get_category(fsmenu, category); fsme && idx; fsme = fsme->next)
idx--;
return fsme?fsme->save:0;
return fsme ? fsme->save : 0;
}
void fsmenu_insert_entry(struct FSMenu* fsmenu, FSMenuCategory category, const char *path, int sorted, short save)
void fsmenu_insert_entry(struct FSMenu *fsmenu, FSMenuCategory category, const char *path, int sorted, short save)
{
FSMenuEntry *prev;
FSMenuEntry *fsme;
FSMenuEntry *fsms;
fsms = fsmenu_get_category(fsmenu, category);
prev= fsme= fsms;
prev = fsme = fsms;
for (; fsme; prev= fsme, fsme= fsme->next) {
for (; fsme; prev = fsme, fsme = fsme->next) {
if (fsme->path) {
const int cmp_ret= BLI_path_cmp(path, fsme->path);
const int cmp_ret = BLI_path_cmp(path, fsme->path);
if (cmp_ret == 0) {
return;
}
@@ -188,26 +187,26 @@ void fsmenu_insert_entry(struct FSMenu* fsmenu, FSMenuCategory category, const c
}
}
fsme= MEM_mallocN(sizeof(*fsme), "fsme");
fsme->path= BLI_strdup(path);
fsme = MEM_mallocN(sizeof(*fsme), "fsme");
fsme->path = BLI_strdup(path);
fsme->save = save;
if (prev) {
fsme->next= prev->next;
prev->next= fsme;
fsme->next = prev->next;
prev->next = fsme;
}
else {
fsme->next= fsms;
fsme->next = fsms;
fsmenu_set_category(fsmenu, category, fsme);
}
}
void fsmenu_remove_entry(struct FSMenu* fsmenu, FSMenuCategory category, int idx)
void fsmenu_remove_entry(struct FSMenu *fsmenu, FSMenuCategory category, int idx)
{
FSMenuEntry *prev= NULL, *fsme= NULL;
FSMenuEntry *prev = NULL, *fsme = NULL;
FSMenuEntry *fsms = fsmenu_get_category(fsmenu, category);
for (fsme= fsms; fsme && idx; prev= fsme, fsme= fsme->next)
for (fsme = fsms; fsme && idx; prev = fsme, fsme = fsme->next)
idx--;
if (fsme) {
@@ -218,10 +217,10 @@ void fsmenu_remove_entry(struct FSMenu* fsmenu, FSMenuCategory category, int idx
/* remove fsme from list */
if (prev) {
prev->next= fsme->next;
prev->next = fsme->next;
}
else {
fsms= fsme->next;
fsms = fsme->next;
fsmenu_set_category(fsmenu, category, fsms);
}
/* free entry */
@@ -231,16 +230,16 @@ void fsmenu_remove_entry(struct FSMenu* fsmenu, FSMenuCategory category, int idx
}
}
void fsmenu_write_file(struct FSMenu* fsmenu, const char *filename)
void fsmenu_write_file(struct FSMenu *fsmenu, const char *filename)
{
FSMenuEntry *fsme= NULL;
int nskip= 0;
FSMenuEntry *fsme = NULL;
int nskip = 0;
FILE *fp = BLI_fopen(filename, "w");
if (!fp) return;
fprintf(fp, "[Bookmarks]\n");
for (fsme= fsmenu_get_category(fsmenu, FS_CATEGORY_BOOKMARKS); fsme; fsme= fsme->next) {
for (fsme = fsmenu_get_category(fsmenu, FS_CATEGORY_BOOKMARKS); fsme; fsme = fsme->next) {
if (fsme->path && fsme->save) {
fprintf(fp, "%s\n", fsme->path);
}
@@ -248,10 +247,10 @@ void fsmenu_write_file(struct FSMenu* fsmenu, const char *filename)
fprintf(fp, "[Recent]\n");
nskip = fsmenu_get_nentries(fsmenu, FS_CATEGORY_RECENT) - FSMENU_RECENT_MAX;
// skip first entries if list too long
for (fsme= fsmenu_get_category(fsmenu, FS_CATEGORY_RECENT); fsme && (nskip>0); fsme= fsme->next, --nskip) {
for (fsme = fsmenu_get_category(fsmenu, FS_CATEGORY_RECENT); fsme && (nskip > 0); fsme = fsme->next, --nskip) {
/* pass */
}
for (; fsme; fsme= fsme->next) {
for (; fsme; fsme = fsme->next) {
if (fsme->path && fsme->save) {
fprintf(fp, "%s\n", fsme->path);
}
@@ -259,7 +258,7 @@ void fsmenu_write_file(struct FSMenu* fsmenu, const char *filename)
fclose(fp);
}
void fsmenu_read_bookmarks(struct FSMenu* fsmenu, const char *filename)
void fsmenu_read_bookmarks(struct FSMenu *fsmenu, const char *filename)
{
char line[256];
FSMenuCategory category = FS_CATEGORY_BOOKMARKS;
@@ -268,11 +267,11 @@ void fsmenu_read_bookmarks(struct FSMenu* fsmenu, const char *filename)
fp = BLI_fopen(filename, "r");
if (!fp) return;
while ( fgets ( line, 256, fp ) != NULL ) { /* read a line */
if (strncmp(line, "[Bookmarks]", 11)==0) {
while (fgets(line, 256, fp) != NULL) { /* read a line */
if (strncmp(line, "[Bookmarks]", 11) == 0) {
category = FS_CATEGORY_BOOKMARKS;
}
else if (strncmp(line, "[Recent]", 8)==0) {
else if (strncmp(line, "[Recent]", 8) == 0) {
category = FS_CATEGORY_RECENT;
}
else {
@@ -296,7 +295,7 @@ void fsmenu_read_bookmarks(struct FSMenu* fsmenu, const char *filename)
fclose(fp);
}
void fsmenu_read_system(struct FSMenu* fsmenu)
void fsmenu_read_system(struct FSMenu *fsmenu)
{
char line[256];
#ifdef WIN32
@@ -306,14 +305,14 @@ void fsmenu_read_system(struct FSMenu* fsmenu)
char tmps[4];
int i;
tmp= GetLogicalDrives();
tmp = GetLogicalDrives();
for (i=0; i < 26; i++) {
if ((tmp>>i) & 1) {
tmps[0]='A'+i;
tmps[1]=':';
tmps[2]='\\';
tmps[3]=0;
for (i = 0; i < 26; i++) {
if ((tmp >> i) & 1) {
tmps[0] = 'A' + i;
tmps[1] = ':';
tmps[2] = '\\';
tmps[3] = 0;
fsmenu_insert_entry(fsmenu, FS_CATEGORY_SYSTEM, tmps, 1, 0);
}
@@ -329,7 +328,7 @@ void fsmenu_read_system(struct FSMenu* fsmenu)
#ifdef __APPLE__
{
#if (MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4)
OSErr err=noErr;
OSErr err = noErr;
int i;
const char *home;
@@ -343,7 +342,7 @@ void fsmenu_read_system(struct FSMenu* fsmenu)
continue;
FSRefMakePath(&dir, path, FILE_MAX);
if (strcmp((char*)path, "/home") && strcmp((char*)path, "/net")) {
if (strcmp((char *)path, "/home") && strcmp((char *)path, "/net")) {
/* /net and /home are meaningless on OSX, home folders are stored in /Users */
fsmenu_insert_entry(fsmenu, FS_CATEGORY_SYSTEM, (char *)path, 1, 0);
}
@@ -393,13 +392,13 @@ void fsmenu_read_system(struct FSMenu* fsmenu)
pathesArray = LSSharedFileListCopySnapshot(list, &seed);
pathesCount = CFArrayGetCount(pathesArray);
for (i=0; i<pathesCount; i++) {
for (i = 0; i < pathesCount; i++) {
itemRef = (LSSharedFileListItemRef)CFArrayGetValueAtIndex(pathesArray, i);
err = LSSharedFileListItemResolve(itemRef,
kLSSharedFileListNoUserInteraction |
kLSSharedFileListNoUserInteraction |
kLSSharedFileListDoNotMountVolumes,
&cfURL, NULL);
&cfURL, NULL);
if (err != noErr)
continue;
@@ -418,7 +417,7 @@ void fsmenu_read_system(struct FSMenu* fsmenu)
/* Then get network volumes */
err = noErr;
for (i=1; err!=nsvErr; i++) {
for (i = 1; err != nsvErr; i++) {
FSRef dir;
FSVolumeRefNum volRefNum;
struct GetVolParmsInfoBuffer volParmsBuffer;
@@ -442,13 +441,13 @@ void fsmenu_read_system(struct FSMenu* fsmenu)
pathesArray = LSSharedFileListCopySnapshot(list, &seed);
pathesCount = CFArrayGetCount(pathesArray);
for (i=0; i<pathesCount; i++) {
for (i = 0; i < pathesCount; i++) {
itemRef = (LSSharedFileListItemRef)CFArrayGetValueAtIndex(pathesArray, i);
err = LSSharedFileListItemResolve(itemRef,
kLSSharedFileListNoUserInteraction |
kLSSharedFileListNoUserInteraction |
kLSSharedFileListDoNotMountVolumes,
&cfURL, NULL);
&cfURL, NULL);
if (err != noErr)
continue;
@@ -469,7 +468,7 @@ void fsmenu_read_system(struct FSMenu* fsmenu)
#else
/* unix */
{
const char *home= getenv("HOME");
const char *home = getenv("HOME");
if (home) {
BLI_snprintf(line, FILE_MAXDIR, "%s/", home);
@@ -481,34 +480,34 @@ void fsmenu_read_system(struct FSMenu* fsmenu)
}
{
int found= 0;
int found = 0;
#ifdef __linux__
/* loop over mount points */
struct mntent *mnt;
int len;
FILE *fp;
fp = setmntent (MOUNTED, "r");
fp = setmntent(MOUNTED, "r");
if (fp == NULL) {
fprintf(stderr, "could not get a list of mounted filesystemts\n");
}
else {
while ((mnt = getmntent (fp))) {
while ((mnt = getmntent(fp))) {
/* not sure if this is right, but seems to give the relevant mnts */
if (strncmp(mnt->mnt_fsname, "/dev", 4))
continue;
len= strlen(mnt->mnt_dir);
if (len && mnt->mnt_dir[len-1] != '/') {
len = strlen(mnt->mnt_dir);
if (len && mnt->mnt_dir[len - 1] != '/') {
BLI_snprintf(line, FILE_MAXDIR, "%s/", mnt->mnt_dir);
fsmenu_insert_entry(fsmenu, FS_CATEGORY_SYSTEM, line, 1, 0);
}
else
fsmenu_insert_entry(fsmenu, FS_CATEGORY_SYSTEM, mnt->mnt_dir, 1, 0);
found= 1;
found = 1;
}
if (endmntent (fp) == 0) {
if (endmntent(fp) == 0) {
fprintf(stderr, "could not close the list of mounted filesystemts\n");
}
}
@@ -524,25 +523,24 @@ void fsmenu_read_system(struct FSMenu* fsmenu)
}
static void fsmenu_free_category(struct FSMenu* fsmenu, FSMenuCategory category)
static void fsmenu_free_category(struct FSMenu *fsmenu, FSMenuCategory category)
{
FSMenuEntry *fsme= fsmenu_get_category(fsmenu, category);
FSMenuEntry *fsme = fsmenu_get_category(fsmenu, category);
while (fsme) {
FSMenuEntry *n= fsme->next;
FSMenuEntry *n = fsme->next;
if (fsme->path) MEM_freeN(fsme->path);
MEM_freeN(fsme);
fsme= n;
fsme = n;
}
}
void fsmenu_free(struct FSMenu* fsmenu)
void fsmenu_free(struct FSMenu *fsmenu)
{
fsmenu_free_category(fsmenu, FS_CATEGORY_SYSTEM);
fsmenu_free_category(fsmenu, FS_CATEGORY_BOOKMARKS);
fsmenu_free_category(fsmenu, FS_CATEGORY_RECENT);
MEM_freeN(fsmenu);
}

View File

@@ -80,15 +80,15 @@ typedef enum PropertyType {
/* also update rna_property_subtype_unit when you change this */
typedef enum PropertyUnit {
PROP_UNIT_NONE = (0<<16),
PROP_UNIT_LENGTH = (1<<16), /* m */
PROP_UNIT_AREA = (2<<16), /* m^2 */
PROP_UNIT_VOLUME = (3<<16), /* m^3 */
PROP_UNIT_MASS = (4<<16), /* kg */
PROP_UNIT_ROTATION = (5<<16), /* radians */
PROP_UNIT_TIME = (6<<16), /* frame */
PROP_UNIT_VELOCITY = (7<<16), /* m/s */
PROP_UNIT_ACCELERATION = (8<<16) /* m/(s^2) */
PROP_UNIT_NONE = (0 << 16),
PROP_UNIT_LENGTH = (1 << 16), /* m */
PROP_UNIT_AREA = (2 << 16), /* m^2 */
PROP_UNIT_VOLUME = (3 << 16), /* m^3 */
PROP_UNIT_MASS = (4 << 16), /* kg */
PROP_UNIT_ROTATION = (5 << 16), /* radians */
PROP_UNIT_TIME = (6 << 16), /* frame */
PROP_UNIT_VELOCITY = (7 << 16), /* m/s */
PROP_UNIT_ACCELERATION = (8 << 16) /* m/(s^2) */
} PropertyUnit;
#define RNA_SUBTYPE_UNIT(subtype) ((subtype) & 0x00FF0000)
@@ -118,22 +118,22 @@ typedef enum PropertySubType {
PROP_UNSIGNED = 13,
PROP_PERCENTAGE = 14,
PROP_FACTOR = 15,
PROP_ANGLE = 16|PROP_UNIT_ROTATION,
PROP_TIME = 17|PROP_UNIT_TIME,
PROP_DISTANCE = 18|PROP_UNIT_LENGTH,
PROP_ANGLE = 16 | PROP_UNIT_ROTATION,
PROP_TIME = 17 | PROP_UNIT_TIME,
PROP_DISTANCE = 18 | PROP_UNIT_LENGTH,
/* number arrays */
PROP_COLOR = 20,
PROP_TRANSLATION = 21|PROP_UNIT_LENGTH,
PROP_TRANSLATION = 21 | PROP_UNIT_LENGTH,
PROP_DIRECTION = 22,
PROP_VELOCITY = 23|PROP_UNIT_VELOCITY,
PROP_ACCELERATION = 24|PROP_UNIT_ACCELERATION,
PROP_VELOCITY = 23 | PROP_UNIT_VELOCITY,
PROP_ACCELERATION = 24 | PROP_UNIT_ACCELERATION,
PROP_MATRIX = 25,
PROP_EULER = 26|PROP_UNIT_ROTATION,
PROP_EULER = 26 | PROP_UNIT_ROTATION,
PROP_QUATERNION = 27,
PROP_AXISANGLE = 28,
PROP_XYZ = 29,
PROP_XYZ_LENGTH = 29|PROP_UNIT_LENGTH,
PROP_XYZ_LENGTH = 29 | PROP_UNIT_LENGTH,
PROP_COLOR_GAMMA = 30,
PROP_COORDS = 31, /* generic array, no units applied, only that x/y/z/w are used (python vec) */
@@ -147,49 +147,49 @@ typedef enum PropertyFlag {
/* editable means the property is editable in the user
* interface, properties are editable by default except
* for pointers and collections. */
PROP_EDITABLE = (1<<0),
PROP_EDITABLE = (1 << 0),
/* this property is editable even if it is lib linked,
* meaning it will get lost on reload, but it's useful
* for editing. */
PROP_LIB_EXCEPTION = (1<<16),
PROP_LIB_EXCEPTION = (1 << 16),
/* animatable means the property can be driven by some
* other input, be it animation curves, expressions, ..
* properties are animatable by default except for pointers
* and collections */
PROP_ANIMATABLE = (1<<1),
PROP_ANIMATABLE = (1 << 1),
/* icon */
PROP_ICONS_CONSECUTIVE = (1<<12),
PROP_ICONS_CONSECUTIVE = (1 << 12),
/* hidden in the user interface */
PROP_HIDDEN = (1<<19),
PROP_HIDDEN = (1 << 19),
/* do not write in presets */
PROP_SKIP_SAVE = (1<<28),
PROP_SKIP_SAVE = (1 << 28),
/* function paramater flags */
PROP_REQUIRED = (1<<2),
PROP_OUTPUT = (1<<3),
PROP_RNAPTR = (1<<11),
PROP_REQUIRED = (1 << 2),
PROP_OUTPUT = (1 << 3),
PROP_RNAPTR = (1 << 11),
/* registering */
PROP_REGISTER = (1<<4),
PROP_REGISTER_OPTIONAL = (1<<4)|(1<<5),
PROP_REGISTER = (1 << 4),
PROP_REGISTER_OPTIONAL = (1 << 4) | (1 << 5),
/* pointers */
PROP_ID_REFCOUNT = (1<<6),
PROP_ID_REFCOUNT = (1 << 6),
/* disallow assigning a variable to its self, eg an object tracking its self
* only apply this to types that are derived from an ID ()*/
PROP_ID_SELF_CHECK = (1<<20),
PROP_ID_SELF_CHECK = (1 << 20),
/* use for...
* - pointers: in the UI and python so unsetting or setting to None won't work
* - strings: so our internal generated get/length/set functions know to do NULL checks before access [#30865] */
PROP_NEVER_NULL = (1<<18),
PROP_NEVER_NULL = (1 << 18),
/* currently only used for UI, this is similar to PROP_NEVER_NULL
* except that the value may be NULL at times, used for ObData, where an Empty's will be NULL
* but setting NULL on a mesh object is not possible. So, if its not NULL, setting NULL cant be done! */
PROP_NEVER_UNLINK = (1<<25),
PROP_NEVER_UNLINK = (1 << 25),
/* flag contains multiple enums.
* note: not to be confused with prop->enumbitflags
@@ -197,32 +197,32 @@ typedef enum PropertyFlag {
*
* note: these can't be animated so use with care.
*/
PROP_ENUM_FLAG = (1<<21),
PROP_ENUM_FLAG = (1 << 21),
/* need context for update function */
PROP_CONTEXT_UPDATE = (1<<22),
PROP_CONTEXT_PROPERTY_UPDATE = (1<<22)|(1<<27),
PROP_CONTEXT_UPDATE = (1 << 22),
PROP_CONTEXT_PROPERTY_UPDATE = (1 << 22) | (1 << 27),
/* Use for arrays or for any data that should not have a referene kept
* most common case is functions that return arrays where the array */
PROP_THICK_WRAP = (1<<23),
PROP_THICK_WRAP = (1 << 23),
/* Reject values outside limits, use for python api only so far
* this is for use when silently clamping string length will give
* bad behavior later. Could also enforce this for INT's and other types.
* note: currently no support for function arguments or non utf8 paths (filepaths) */
PROP_NEVER_CLAMP = (1<<26),
PROP_NEVER_CLAMP = (1 << 26),
/* internal flags */
PROP_BUILTIN = (1<<7),
PROP_EXPORT = (1<<8),
PROP_RUNTIME = (1<<9),
PROP_IDPROPERTY = (1<<10),
PROP_RAW_ACCESS = (1<<13),
PROP_RAW_ARRAY = (1<<14),
PROP_FREE_POINTERS = (1<<15),
PROP_DYNAMIC = (1<<17), /* for dynamic arrays, and retvals of type string */
PROP_ENUM_NO_CONTEXT = (1<<24) /* for enum that shouldn't be contextual */
PROP_BUILTIN = (1 << 7),
PROP_EXPORT = (1 << 8),
PROP_RUNTIME = (1 << 9),
PROP_IDPROPERTY = (1 << 10),
PROP_RAW_ACCESS = (1 << 13),
PROP_RAW_ARRAY = (1 << 14),
PROP_FREE_POINTERS = (1 << 15),
PROP_DYNAMIC = (1 << 17), /* for dynamic arrays, and retvals of type string */
PROP_ENUM_NO_CONTEXT = (1 << 24) /* for enum that shouldn't be contextual */
} PropertyFlag;
typedef struct CollectionPropertyIterator {
@@ -245,7 +245,7 @@ typedef struct CollectionPointerLink {
} CollectionPointerLink;
typedef enum RawPropertyType {
PROP_RAW_UNSET=-1,
PROP_RAW_UNSET = -1,
PROP_RAW_INT, // XXX - abused for types that are not set, eg. MFace.verts, needs fixing.
PROP_RAW_SHORT,
PROP_RAW_CHAR,
@@ -315,7 +315,7 @@ typedef enum FunctionFlag {
/* registering */
FUNC_REGISTER = 16,
FUNC_REGISTER_OPTIONAL = 16|32,
FUNC_REGISTER_OPTIONAL = 16 | 32,
/* internal flags */
FUNC_BUILTIN = 128,

File diff suppressed because it is too large Load Diff

View File

@@ -71,7 +71,8 @@ EnumPropertyItem id_type_items[] = {
{ID_TE, "TEXTURE", ICON_TEXTURE_DATA, "Texture", ""},
{ID_WO, "WORLD", ICON_WORLD_DATA, "World", ""},
{ID_WM, "WINDOWMANAGER", ICON_FULLSCREEN, "Window Manager", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
#ifdef RNA_RUNTIME
@@ -84,26 +85,26 @@ EnumPropertyItem id_type_items[] = {
/* name functions that ignore the first two ID characters */
void rna_ID_name_get(PointerRNA *ptr, char *value)
{
ID *id = (ID*)ptr->data;
BLI_strncpy(value, id->name+2, sizeof(id->name)-2);
ID *id = (ID *)ptr->data;
BLI_strncpy(value, id->name + 2, sizeof(id->name) - 2);
}
int rna_ID_name_length(PointerRNA *ptr)
{
ID *id = (ID*)ptr->data;
return strlen(id->name+2);
ID *id = (ID *)ptr->data;
return strlen(id->name + 2);
}
void rna_ID_name_set(PointerRNA *ptr, const char *value)
{
ID *id = (ID*)ptr->data;
BLI_strncpy_utf8(id->name+2, value, sizeof(id->name)-2);
test_idbutton(id->name+2);
ID *id = (ID *)ptr->data;
BLI_strncpy_utf8(id->name + 2, value, sizeof(id->name) - 2);
test_idbutton(id->name + 2);
}
static int rna_ID_name_editable(PointerRNA *ptr)
{
ID *id = (ID*)ptr->data;
ID *id = (ID *)ptr->data;
if (GS(id->name) == ID_VF) {
VFont *vf = (VFont *)id;
@@ -185,7 +186,7 @@ StructRNA *ID_code_to_RNA_type(short idcode)
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));
}
@@ -197,7 +198,7 @@ IDProperty *rna_ID_idprops(PointerRNA *ptr, int create)
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)) {
id->flag |= LIB_FAKEUSER;
@@ -238,14 +239,14 @@ StructRNA *rna_PropertyGroup_register(Main *UNUSED(bmain), ReportList *reports,
* is running. */
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);
STRINGIFY(MAX_IDPROP_NAME), identifier);
return NULL;
}
return RNA_def_struct(&BLENDER_RNA, identifier, "PropertyGroup"); /* XXX */
}
StructRNA* rna_PropertyGroup_refine(PointerRNA *ptr)
StructRNA *rna_PropertyGroup_refine(PointerRNA *ptr)
{
return ptr->type;
}
@@ -279,24 +280,24 @@ static void rna_ID_update_tag(ID *id, ReportList *reports, int flag)
else {
/* ensure flag us correct for the type */
switch (GS(id->name)) {
case ID_OB:
if (flag & ~(OB_RECALC_ALL)) {
BKE_report(reports, RPT_ERROR, "'refresh' incompatible with Object ID type");
return;
}
break;
/* Could add particle updates later */
case ID_OB:
if (flag & ~(OB_RECALC_ALL)) {
BKE_report(reports, RPT_ERROR, "'refresh' incompatible with Object ID type");
return;
}
break;
/* Could add particle updates later */
#if 0
case ID_PA:
if (flag & ~(OB_RECALC_ALL|PSYS_RECALC)) {
BKE_report(reports, RPT_ERROR, "'refresh' incompatible with ParticleSettings ID type");
return;
}
break;
case ID_PA:
if (flag & ~(OB_RECALC_ALL | PSYS_RECALC)) {
BKE_report(reports, RPT_ERROR, "'refresh' incompatible with ParticleSettings ID type");
return;
}
break;
#endif
default:
BKE_report(reports, RPT_ERROR, "This ID type is not compatible with any 'refresh' options");
return;
default:
BKE_report(reports, RPT_ERROR, "This ID type is not compatible with any 'refresh' options");
return;
}
}
@@ -337,7 +338,7 @@ int rna_IDMaterials_assign_int(PointerRNA *ptr, int key, const PointerRNA *assig
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);
}
@@ -356,52 +357,52 @@ static void rna_def_ID_properties(BlenderRNA *brna)
/* IDP_STRING */
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 */
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);
RNA_def_property_flag(prop, PROP_EXPORT|PROP_IDPROPERTY);
RNA_def_property_flag(prop, PROP_EXPORT | PROP_IDPROPERTY);
RNA_def_property_array(prop, 1);
/* IDP_FLOAT */
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);
RNA_def_property_flag(prop, PROP_EXPORT|PROP_IDPROPERTY);
RNA_def_property_flag(prop, PROP_EXPORT | PROP_IDPROPERTY);
RNA_def_property_array(prop, 1);
/* IDP_DOUBLE */
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);
RNA_def_property_flag(prop, PROP_EXPORT|PROP_IDPROPERTY);
RNA_def_property_flag(prop, PROP_EXPORT | PROP_IDPROPERTY);
RNA_def_property_array(prop, 1);
/* IDP_GROUP */
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_struct_type(prop, "PropertyGroup");
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");
prop = RNA_def_property(srna, "idp_array", PROP_COLLECTION, PROP_NONE);
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_flag(prop, PROP_EXPORT|PROP_IDPROPERTY);
RNA_def_property_flag(prop, PROP_EXPORT | PROP_IDPROPERTY);
/* never tested, maybe its useful to have this? */
#if 0
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_ui_text(prop, "Name", "Unique name used in the code and scripting");
RNA_def_struct_name_property(srna, prop);
@@ -423,7 +424,7 @@ static void rna_def_ID_properties(BlenderRNA *brna)
* however this isn't 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 */
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_ui_text(prop, "Name", "Unique name used in the code and scripting");
RNA_def_struct_name_property(srna, prop);
@@ -465,22 +466,23 @@ static void rna_def_ID(BlenderRNA *brna)
{OB_RECALC_OB, "OBJECT", 0, "Object", ""},
{OB_RECALC_DATA, "DATA", 0, "Data", ""},
{OB_RECALC_TIME, "TIME", 0, "Time", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, 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_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_idprops_func(srna, "rna_ID_idprops");
prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
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_maxlength(prop, MAX_ID_NAME-2);
RNA_def_property_string_maxlength(prop, MAX_ID_NAME - 2);
RNA_def_property_editable_func(prop, "rna_ID_name_editable");
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);
prop = RNA_def_property(srna, "users", PROP_INT, PROP_UNSIGNED);
@@ -521,7 +523,7 @@ static void rna_def_ID(BlenderRNA *brna)
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, "
"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");
RNA_def_function_ui_description(func, "Create animation data to this ID, note that not all ID types support this");

File diff suppressed because it is too large Load Diff

View File

@@ -51,12 +51,12 @@
static void rna_ActionGroup_channels_next(CollectionPropertyIterator *iter)
{
ListBaseIterator *internal = iter->internal;
FCurve *fcu = (FCurve*)internal->link;
FCurve *fcu = (FCurve *)internal->link;
bActionGroup *grp = fcu->grp;
/* only continue if the next F-Curve (if existant) belongs in the same group */
if ((fcu->next) && (fcu->next->grp == grp))
internal->link = (Link*)fcu->next;
internal->link = (Link *)fcu->next;
else
internal->link = NULL;
@@ -74,7 +74,7 @@ static void rna_Action_groups_remove(bAction *act, ReportList *reports, bActionG
/* try to remove the F-Curve from the action */
if (!BLI_remlink_safe(&act->groups, agrp)) {
BKE_reportf(reports, RPT_ERROR, "ActionGroup '%s' not found in action '%s'", agrp->name, act->id.name+2);
BKE_reportf(reports, RPT_ERROR, "ActionGroup '%s' not found in action '%s'", agrp->name, act->id.name + 2);
return;
}
@@ -96,7 +96,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)
{
if (group && group[0] =='\0') group = NULL;
if (group && group[0] == '\0') group = NULL;
if (data_path[0] == '\0') {
BKE_report(reports, RPT_ERROR, "F-Curve data path empty, invalid argument");
@@ -106,7 +106,7 @@ static FCurve *rna_Action_fcurve_new(bAction *act, ReportList *reports, const ch
/* annoying, check if this exists */
if (verify_fcurve(act, group, data_path, index, 0)) {
BKE_reportf(reports, RPT_ERROR, "F-Curve '%s[%d]' already exists in action '%s'", data_path,
index, act->id.name+2);
index, act->id.name + 2);
return NULL;
}
return verify_fcurve(act, group, data_path, index, 1);
@@ -117,7 +117,7 @@ static void rna_Action_fcurve_remove(bAction *act, ReportList *reports, FCurve *
if (fcu->grp) {
if (BLI_findindex(&act->groups, fcu->grp) == -1) {
BKE_reportf(reports, RPT_ERROR, "F-Curve's ActionGroup '%s' not found in action '%s'",
fcu->grp->name, act->id.name+2);
fcu->grp->name, act->id.name + 2);
return;
}
@@ -126,7 +126,7 @@ static void rna_Action_fcurve_remove(bAction *act, ReportList *reports, FCurve *
}
else {
if (BLI_findindex(&act->curves, fcu) == -1) {
BKE_reportf(reports, RPT_ERROR, "F-Curve not found in action '%s'", act->id.name+2);
BKE_reportf(reports, RPT_ERROR, "F-Curve not found in action '%s'", act->id.name + 2);
return;
}
@@ -148,7 +148,7 @@ static TimeMarker *rna_Action_pose_markers_new(bAction *act, const char name[])
static void rna_Action_pose_markers_remove(bAction *act, ReportList *reports, TimeMarker *marker)
{
if (!BLI_remlink_safe(&act->markers, marker)) {
BKE_reportf(reports, RPT_ERROR, "TimelineMarker '%s' not found in Action '%s'", marker->name, act->id.name+2);
BKE_reportf(reports, RPT_ERROR, "TimelineMarker '%s' not found in Action '%s'", marker->name, act->id.name + 2);
return;
}
@@ -158,43 +158,43 @@ static void rna_Action_pose_markers_remove(bAction *act, ReportList *reports, Ti
static PointerRNA rna_Action_active_pose_marker_get(PointerRNA *ptr)
{
bAction *act = (bAction*)ptr->data;
return rna_pointer_inherit_refine(ptr, &RNA_TimelineMarker, BLI_findlink(&act->markers, act->active_marker-1));
bAction *act = (bAction *)ptr->data;
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)
{
bAction *act = (bAction*)ptr->data;
bAction *act = (bAction *)ptr->data;
act->active_marker = BLI_findindex(&act->markers, value.data) + 1;
}
static int rna_Action_active_pose_marker_index_get(PointerRNA *ptr)
{
bAction *act = (bAction*)ptr->data;
return MAX2(act->active_marker-1, 0);
bAction *act = (bAction *)ptr->data;
return MAX2(act->active_marker - 1, 0);
}
static void rna_Action_active_pose_marker_index_set(PointerRNA *ptr, int value)
{
bAction *act = (bAction*)ptr->data;
act->active_marker = value+1;
bAction *act = (bAction *)ptr->data;
act->active_marker = value + 1;
}
static void rna_Action_active_pose_marker_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax)
{
bAction *act = (bAction*)ptr->data;
bAction *act = (bAction *)ptr->data;
*min = 0;
*max = BLI_countlist(&act->markers)-1;
*max = BLI_countlist(&act->markers) - 1;
*max = MAX2(0, *max);
}
static void rna_Action_frame_range_get(PointerRNA *ptr, float *values)
{ /* don't include modifiers because they too easily can have very large
{ /* don't include modifiers because they too easily can have very large
* ranges: MINAFRAMEF to MAXFRAMEF. */
calc_action_range(ptr->id.data, values, values+1, FALSE);
calc_action_range(ptr->id.data, values, values + 1, FALSE);
}
@@ -272,20 +272,20 @@ static void rna_def_dopesheet(BlenderRNA *brna)
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_update(prop, NC_ANIMATION|ND_ANIMCHAN, NULL);
RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN, NULL);
/* General Filtering Settings */
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_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_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);
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_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 */
prop = RNA_def_property(srna, "show_only_group_objects", PROP_BOOLEAN, PROP_NONE);
@@ -293,13 +293,13 @@ static void rna_def_dopesheet(BlenderRNA *brna)
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_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);
RNA_def_property_pointer_sdna(prop, NULL, "filter_grp");
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_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 */
prop = RNA_def_property(srna, "show_only_matching_fcurves", PROP_BOOLEAN, PROP_NONE);
@@ -307,12 +307,12 @@ static void rna_def_dopesheet(BlenderRNA *brna)
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_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);
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_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL);
/* NLA Specific Settings */
prop = RNA_def_property(srna, "show_missing_nla", PROP_BOOLEAN, PROP_NONE);
@@ -320,20 +320,20 @@ static void rna_def_dopesheet(BlenderRNA *brna)
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_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) */
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_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_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);
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_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 */
@@ -342,97 +342,97 @@ static void rna_def_dopesheet(BlenderRNA *brna)
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_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);
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_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);
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_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);
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_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);
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_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);
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_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);
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_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);
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_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);
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_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);
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_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);
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_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);
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_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);
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_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);
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_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);
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_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);
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_icon(prop, ICON_SPEAKER, 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);
}
static void rna_def_action_group(BlenderRNA *brna)
@@ -447,7 +447,7 @@ static void rna_def_action_group(BlenderRNA *brna)
prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Name", "");
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);
/* WARNING: be very careful when working with this list, since the endpoint is not
* defined like a standard ListBase. Adding/removing channels from this list needs
@@ -468,22 +468,22 @@ static void rna_def_action_group(BlenderRNA *brna)
prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", AGRP_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);
RNA_def_property_boolean_sdna(prop, NULL, "flag", AGRP_PROTECTED);
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);
RNA_def_property_boolean_sdna(prop, NULL, "flag", AGRP_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);
RNA_def_property_int_sdna(prop, NULL, "customCol");
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);
}
/* fcurve.keyframe_points */
@@ -512,7 +512,7 @@ static void rna_def_action_groups(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_ui_description(func, "Remove action group");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
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);
}
static void rna_def_action_fcurves(BlenderRNA *brna, PropertyRNA *cprop)
@@ -543,7 +543,7 @@ static void rna_def_action_fcurves(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_ui_description(func, "Remove action group");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
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);
}
static void rna_def_action_pose_markers(BlenderRNA *brna, PropertyRNA *cprop)
@@ -571,7 +571,7 @@ static void rna_def_action_pose_markers(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_ui_description(func, "Remove a timeline marker");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
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);
RNA_def_property_struct_type(prop, "TimelineMarker");

View File

@@ -59,15 +59,16 @@ EnumPropertyItem actuator_type_items[] = {
{ACT_STATE, "STATE", 0, "State", ""},
{ACT_VISIBILITY, "VISIBILITY", 0, "Visibility", ""},
{ACT_STEERING, "STEERING", 0, "Steering", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
#ifdef RNA_RUNTIME
#include "BKE_sca.h"
static StructRNA* rna_Actuator_refine(struct PointerRNA *ptr)
static StructRNA *rna_Actuator_refine(struct PointerRNA *ptr)
{
bActuator *actuator = (bActuator*)ptr->data;
bActuator *actuator = (bActuator *)ptr->data;
switch (actuator->type) {
case ACT_ACTION:
@@ -139,185 +140,185 @@ static void rna_ConstraintActuator_type_set(struct PointerRNA *ptr, int value)
if (value != ca->type) {
ca->type = value;
switch (ca->type) {
case ACT_CONST_TYPE_ORI:
/* negative axis not supported in the orientation mode */
if (ELEM3(ca->mode, ACT_CONST_DIRNX, ACT_CONST_DIRNY, ACT_CONST_DIRNZ))
ca->mode = ACT_CONST_NONE;
break;
case ACT_CONST_TYPE_ORI:
/* negative axis not supported in the orientation mode */
if (ELEM3(ca->mode, ACT_CONST_DIRNX, ACT_CONST_DIRNY, ACT_CONST_DIRNZ))
ca->mode = ACT_CONST_NONE;
break;
case ACT_CONST_TYPE_LOC:
case ACT_CONST_TYPE_DIST:
case ACT_CONST_TYPE_FH:
default:
break;
case ACT_CONST_TYPE_LOC:
case ACT_CONST_TYPE_DIST:
case ACT_CONST_TYPE_FH:
default:
break;
}
}
}
static float rna_ConstraintActuator_limitmin_get(struct PointerRNA *ptr)
{
bActuator *act = (bActuator*)ptr->data;
bActuator *act = (bActuator *)ptr->data;
bConstraintActuator *ca = act->data;
float *fp;
if (ca->flag & ACT_CONST_LOCX) fp = ca->minloc;
else if (ca->flag & ACT_CONST_LOCY) fp = ca->minloc+1;
else if (ca->flag & ACT_CONST_LOCZ) fp = ca->minloc+2;
else if (ca->flag & ACT_CONST_LOCY) fp = ca->minloc + 1;
else if (ca->flag & ACT_CONST_LOCZ) fp = ca->minloc + 2;
else if (ca->flag & ACT_CONST_ROTX) fp = ca->minrot;
else if (ca->flag & ACT_CONST_ROTY) fp = ca->minrot+1;
else fp = ca->minrot+2;
else if (ca->flag & ACT_CONST_ROTY) fp = ca->minrot + 1;
else fp = ca->minrot + 2;
return *fp;
}
static void rna_ConstraintActuator_limitmin_set(struct PointerRNA *ptr, float value)
{
bActuator *act = (bActuator*)ptr->data;
bActuator *act = (bActuator *)ptr->data;
bConstraintActuator *ca = act->data;
float *fp;
if (ca->flag & ACT_CONST_LOCX) fp = ca->minloc;
else if (ca->flag & ACT_CONST_LOCY) fp = ca->minloc+1;
else if (ca->flag & ACT_CONST_LOCZ) fp = ca->minloc+2;
else if (ca->flag & ACT_CONST_LOCY) fp = ca->minloc + 1;
else if (ca->flag & ACT_CONST_LOCZ) fp = ca->minloc + 2;
else if (ca->flag & ACT_CONST_ROTX) fp = ca->minrot;
else if (ca->flag & ACT_CONST_ROTY) fp = ca->minrot+1;
else fp = ca->minrot+2;
else if (ca->flag & ACT_CONST_ROTY) fp = ca->minrot + 1;
else fp = ca->minrot + 2;
*fp = value;
}
static float rna_ConstraintActuator_limitmax_get(struct PointerRNA *ptr)
{
bActuator *act = (bActuator*)ptr->data;
bActuator *act = (bActuator *)ptr->data;
bConstraintActuator *ca = act->data;
float *fp;
if (ca->flag & ACT_CONST_LOCX) fp = ca->maxloc;
else if (ca->flag & ACT_CONST_LOCY) fp = ca->maxloc+1;
else if (ca->flag & ACT_CONST_LOCZ) fp = ca->maxloc+2;
else if (ca->flag & ACT_CONST_LOCY) fp = ca->maxloc + 1;
else if (ca->flag & ACT_CONST_LOCZ) fp = ca->maxloc + 2;
else if (ca->flag & ACT_CONST_ROTX) fp = ca->maxrot;
else if (ca->flag & ACT_CONST_ROTY) fp = ca->maxrot+1;
else fp = ca->maxrot+2;
else if (ca->flag & ACT_CONST_ROTY) fp = ca->maxrot + 1;
else fp = ca->maxrot + 2;
return *fp;
}
static void rna_ConstraintActuator_limitmax_set(struct PointerRNA *ptr, float value)
{
bActuator *act = (bActuator*)ptr->data;
bActuator *act = (bActuator *)ptr->data;
bConstraintActuator *ca = act->data;
float *fp;
if (ca->flag & ACT_CONST_LOCX) fp = ca->maxloc;
else if (ca->flag & ACT_CONST_LOCY) fp = ca->maxloc+1;
else if (ca->flag & ACT_CONST_LOCZ) fp = ca->maxloc+2;
else if (ca->flag & ACT_CONST_LOCY) fp = ca->maxloc + 1;
else if (ca->flag & ACT_CONST_LOCZ) fp = ca->maxloc + 2;
else if (ca->flag & ACT_CONST_ROTX) fp = ca->maxrot;
else if (ca->flag & ACT_CONST_ROTY) fp = ca->maxrot+1;
else fp = ca->maxrot+2;
else if (ca->flag & ACT_CONST_ROTY) fp = ca->maxrot + 1;
else fp = ca->maxrot + 2;
*fp = value;
}
static float rna_ConstraintActuator_distance_get(struct PointerRNA *ptr)
{
bActuator *act = (bActuator*)ptr->data;
bActuator *act = (bActuator *)ptr->data;
bConstraintActuator *ca = act->data;
float *fp;
if (ca->mode & (ACT_CONST_DIRPX|ACT_CONST_DIRNX)) fp = ca->minloc;
else if (ca->mode & (ACT_CONST_DIRPY|ACT_CONST_DIRNY)) fp = ca->minloc+1;
else fp = ca->minloc+2;
if (ca->mode & (ACT_CONST_DIRPX | ACT_CONST_DIRNX)) fp = ca->minloc;
else if (ca->mode & (ACT_CONST_DIRPY | ACT_CONST_DIRNY)) fp = ca->minloc + 1;
else fp = ca->minloc + 2;
return *fp;
}
static void rna_ConstraintActuator_distance_set(struct PointerRNA *ptr, float value)
{
bActuator *act = (bActuator*)ptr->data;
bActuator *act = (bActuator *)ptr->data;
bConstraintActuator *ca = act->data;
float *fp;
if (ca->mode & (ACT_CONST_DIRPX|ACT_CONST_DIRNX)) fp = ca->minloc;
else if (ca->mode & (ACT_CONST_DIRPY|ACT_CONST_DIRNY)) fp = ca->minloc+1;
else fp = ca->minloc+2;
if (ca->mode & (ACT_CONST_DIRPX | ACT_CONST_DIRNX)) fp = ca->minloc;
else if (ca->mode & (ACT_CONST_DIRPY | ACT_CONST_DIRNY)) fp = ca->minloc + 1;
else fp = ca->minloc + 2;
*fp = value;
}
static float rna_ConstraintActuator_range_get(struct PointerRNA *ptr)
{
bActuator *act = (bActuator*)ptr->data;
bActuator *act = (bActuator *)ptr->data;
bConstraintActuator *ca = act->data;
float *fp;
if (ca->mode & (ACT_CONST_DIRPX|ACT_CONST_DIRNX)) fp = ca->maxloc;
else if (ca->mode & (ACT_CONST_DIRPY|ACT_CONST_DIRNY)) fp = ca->maxloc+1;
else fp = ca->maxloc+2;
if (ca->mode & (ACT_CONST_DIRPX | ACT_CONST_DIRNX)) fp = ca->maxloc;
else if (ca->mode & (ACT_CONST_DIRPY | ACT_CONST_DIRNY)) fp = ca->maxloc + 1;
else fp = ca->maxloc + 2;
return *fp;
}
static void rna_ConstraintActuator_range_set(struct PointerRNA *ptr, float value)
{
bActuator *act = (bActuator*)ptr->data;
bActuator *act = (bActuator *)ptr->data;
bConstraintActuator *ca = act->data;
float *fp;
if (ca->mode & (ACT_CONST_DIRPX|ACT_CONST_DIRNX)) fp = ca->maxloc;
else if (ca->mode & (ACT_CONST_DIRPY|ACT_CONST_DIRNY)) fp = ca->maxloc+1;
else fp = ca->maxloc+2;
if (ca->mode & (ACT_CONST_DIRPX | ACT_CONST_DIRNX)) fp = ca->maxloc;
else if (ca->mode & (ACT_CONST_DIRPY | ACT_CONST_DIRNY)) fp = ca->maxloc + 1;
else fp = ca->maxloc + 2;
*fp = value;
}
static float rna_ConstraintActuator_fhheight_get(struct PointerRNA *ptr)
{
bActuator *act = (bActuator*)ptr->data;
bActuator *act = (bActuator *)ptr->data;
bConstraintActuator *ca = act->data;
float *fp;
if (ca->mode & (ACT_CONST_DIRPX|ACT_CONST_DIRNX)) fp = ca->minloc;
else if (ca->mode & (ACT_CONST_DIRPY|ACT_CONST_DIRNY)) fp = ca->minloc+1;
else fp = ca->minloc+2;
if (ca->mode & (ACT_CONST_DIRPX | ACT_CONST_DIRNX)) fp = ca->minloc;
else if (ca->mode & (ACT_CONST_DIRPY | ACT_CONST_DIRNY)) fp = ca->minloc + 1;
else fp = ca->minloc + 2;
return *fp;
}
static void rna_ConstraintActuator_fhheight_set(struct PointerRNA *ptr, float value)
{
bActuator *act = (bActuator*)ptr->data;
bActuator *act = (bActuator *)ptr->data;
bConstraintActuator *ca = act->data;
float *fp;
if (ca->mode & (ACT_CONST_DIRPX|ACT_CONST_DIRNX)) fp = ca->minloc;
else if (ca->mode & (ACT_CONST_DIRPY|ACT_CONST_DIRNY)) fp = ca->minloc+1;
else fp = ca->minloc+2;
if (ca->mode & (ACT_CONST_DIRPX | ACT_CONST_DIRNX)) fp = ca->minloc;
else if (ca->mode & (ACT_CONST_DIRPY | ACT_CONST_DIRNY)) fp = ca->minloc + 1;
else fp = ca->minloc + 2;
*fp = value;
}
static float rna_ConstraintActuator_spring_get(struct PointerRNA *ptr)
{
bActuator *act = (bActuator*)ptr->data;
bActuator *act = (bActuator *)ptr->data;
bConstraintActuator *ca = act->data;
float *fp;
if (ca->mode & (ACT_CONST_DIRPX|ACT_CONST_DIRNX)) fp = ca->maxloc;
else if (ca->mode & (ACT_CONST_DIRPY|ACT_CONST_DIRNY)) fp = ca->maxloc+1;
else fp = ca->maxloc+2;
if (ca->mode & (ACT_CONST_DIRPX | ACT_CONST_DIRNX)) fp = ca->maxloc;
else if (ca->mode & (ACT_CONST_DIRPY | ACT_CONST_DIRNY)) fp = ca->maxloc + 1;
else fp = ca->maxloc + 2;
return *fp;
}
static void rna_ConstraintActuator_spring_set(struct PointerRNA *ptr, float value)
{
bActuator *act = (bActuator*)ptr->data;
bActuator *act = (bActuator *)ptr->data;
bConstraintActuator *ca = act->data;
float *fp;
if (ca->mode & (ACT_CONST_DIRPX|ACT_CONST_DIRNX)) fp = ca->maxloc;
else if (ca->mode & (ACT_CONST_DIRPY|ACT_CONST_DIRNY)) fp = ca->maxloc+1;
else fp = ca->maxloc+2;
if (ca->mode & (ACT_CONST_DIRPX | ACT_CONST_DIRNX)) fp = ca->maxloc;
else if (ca->mode & (ACT_CONST_DIRPY | ACT_CONST_DIRNY)) fp = ca->maxloc + 1;
else fp = ca->maxloc + 2;
*fp = value;
}
@@ -325,10 +326,10 @@ static void rna_ConstraintActuator_spring_set(struct PointerRNA *ptr, float valu
* Therefore we need to clear the property when "use_material_detect" mode changes */
static void rna_Actuator_constraint_detect_material_set(struct PointerRNA *ptr, int value)
{
bActuator *act = (bActuator*)ptr->data;
bActuator *act = (bActuator *)ptr->data;
bConstraintActuator *ca = act->data;
short old_value = (ca->flag & ACT_CONST_MATERIAL? 1:0);
short old_value = (ca->flag & ACT_CONST_MATERIAL ? 1 : 0);
if (old_value != value) {
ca->flag ^= ACT_CONST_MATERIAL;
@@ -371,51 +372,51 @@ static void rna_ObjectActuator_type_set(struct PointerRNA *ptr, int value)
if (value != oa->type) {
oa->type = value;
switch (oa->type) {
case ACT_OBJECT_NORMAL:
memset(oa, 0, sizeof(bObjectActuator));
oa->flag = ACT_FORCE_LOCAL|ACT_TORQUE_LOCAL|ACT_DLOC_LOCAL|ACT_DROT_LOCAL;
oa->type = ACT_OBJECT_NORMAL;
break;
case ACT_OBJECT_NORMAL:
memset(oa, 0, sizeof(bObjectActuator));
oa->flag = ACT_FORCE_LOCAL | ACT_TORQUE_LOCAL | ACT_DLOC_LOCAL | ACT_DROT_LOCAL;
oa->type = ACT_OBJECT_NORMAL;
break;
case ACT_OBJECT_SERVO:
memset(oa, 0, sizeof(bObjectActuator));
oa->flag = ACT_LIN_VEL_LOCAL;
oa->type = ACT_OBJECT_SERVO;
oa->forcerot[0] = 30.0f;
oa->forcerot[1] = 0.5f;
oa->forcerot[2] = 0.0f;
break;
case ACT_OBJECT_SERVO:
memset(oa, 0, sizeof(bObjectActuator));
oa->flag = ACT_LIN_VEL_LOCAL;
oa->type = ACT_OBJECT_SERVO;
oa->forcerot[0] = 30.0f;
oa->forcerot[1] = 0.5f;
oa->forcerot[2] = 0.0f;
break;
}
}
}
static void rna_ObjectActuator_integralcoefficient_set(struct PointerRNA *ptr, float value)
{
bActuator *act = (bActuator*)ptr->data;
bActuator *act = (bActuator *)ptr->data;
bObjectActuator *oa = act->data;
oa->forcerot[1] = value;
oa->forcerot[0] = 60.0f*oa->forcerot[1];
oa->forcerot[0] = 60.0f * oa->forcerot[1];
}
static void rna_StateActuator_state_set(PointerRNA *ptr, const int *values)
{
bActuator *act = (bActuator*)ptr->data;
bActuator *act = (bActuator *)ptr->data;
bStateActuator *sa = act->data;
int i, tot = 0;
/* 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])
tot++;
if (tot == 0)
return;
for (i = 0; i<OB_MAX_STATES; i++) {
if (values[i]) sa->mask |= (1<<i);
else sa->mask &= ~(1<<i);
for (i = 0; i < OB_MAX_STATES; i++) {
if (values[i]) sa->mask |= (1 << i);
else sa->mask &= ~(1 << i);
}
}
@@ -500,10 +501,10 @@ static void rna_Actuator_Armature_update(Main *UNUSED(bmain), Scene *UNUSED(scen
static void rna_SteeringActuator_navmesh_set(PointerRNA *ptr, PointerRNA value)
{
bActuator *act = (bActuator*)ptr->data;
bSteeringActuator *sa = (bSteeringActuator*) act->data;
bActuator *act = (bActuator *)ptr->data;
bSteeringActuator *sa = (bSteeringActuator *) act->data;
Object* obj = value.data;
Object *obj = value.data;
if (obj && obj->body_type == OB_BODY_TYPE_NAVMESH)
sa->navmesh = obj;
else
@@ -579,7 +580,8 @@ static void rna_def_action_actuator(BlenderRNA *brna)
#ifdef __NLA_ACTION_BY_MOTION_ACTUATOR
{ACT_ACTION_MOTION, "MOTION", 0, "Displacement", ""},
#endif
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
srna = RNA_def_struct(brna, "ActionActuator", "Actuator");
RNA_def_struct_ui_text(srna, "Action Actuator", "Actuator to control the object movement");
@@ -691,12 +693,13 @@ static void rna_def_action_actuator(BlenderRNA *brna)
static void rna_def_object_actuator(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA* prop;
PropertyRNA *prop;
static EnumPropertyItem prop_type_items[] = {
{ACT_OBJECT_NORMAL, "OBJECT_NORMAL", 0, "Simple Motion", ""},
{ACT_OBJECT_SERVO, "OBJECT_SERVO", 0, "Servo Control", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
srna = RNA_def_struct(brna, "ObjectActuator", "Actuator");
RNA_def_struct_ui_text(srna, "Motion Actuator", "Actuator to control the object movement");
@@ -887,7 +890,8 @@ static void rna_def_camera_actuator(BlenderRNA *brna)
{OB_POSY, "POS_Y", 0, "+Y", "Camera tries to get behind the Y axis"},
{OB_NEGX, "NEG_X", 0, "-X", "Camera tries to get behind the -X axis"},
{OB_NEGY, "NEG_Y", 0, "-Y", "Camera tries to get behind the -Y axis"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
srna = RNA_def_struct(brna, "CameraActuator", "Actuator");
RNA_def_struct_ui_text(srna, "Camera Actuator", "");
@@ -1310,15 +1314,17 @@ static void rna_def_edit_object_actuator(BlenderRNA *brna)
{ACT_EDOB_ENABLE_RB, "ENABLERIGIDBODY", 0, "Enable Rigid Body", ""},
{ACT_EDOB_DISABLE_RB, "DISABLERIGIDBODY", 0, "Disable Rigid Body", ""},
{ACT_EDOB_SET_MASS, "SETMASS", 0, "Set Mass", ""},
{0, NULL, 0, NULL, NULL} };
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem prop_type_items[] = {
{ACT_EDOB_ADD_OBJECT, "ADDOBJECT", 0, "Add Object", ""},
{ACT_EDOB_END_OBJECT, "ENDOBJECT", 0, "End Object", ""},
{ACT_EDOB_REPLACE_MESH, "REPLACEMESH", 0, "Replace Mesh", ""},
{ACT_EDOB_TRACK_TO, "TRACKTO", 0, "Track to", ""},
{ACT_EDOB_DYNAMICS, "DYNAMICS", 0, "Dynamics", ""},
{0, NULL, 0, NULL, NULL} };
{ACT_EDOB_ADD_OBJECT, "ADDOBJECT", 0, "Add Object", ""},
{ACT_EDOB_END_OBJECT, "ENDOBJECT", 0, "End Object", ""},
{ACT_EDOB_REPLACE_MESH, "REPLACEMESH", 0, "Replace Mesh", ""},
{ACT_EDOB_TRACK_TO, "TRACKTO", 0, "Track to", ""},
{ACT_EDOB_DYNAMICS, "DYNAMICS", 0, "Dynamics", ""},
{0, NULL, 0, NULL, NULL}
};
srna = RNA_def_struct(brna, "EditObjectActuator", "Actuator");
RNA_def_struct_ui_text(srna, "Edit Object Actuator", "Actuator used to edit objects");
@@ -1427,7 +1433,8 @@ static void rna_def_scene_actuator(BlenderRNA *brna)
{ACT_SCENE_REMOVE, "REMOVE", 0, "Remove Scene", ""},
{ACT_SCENE_SUSPEND, "SUSPEND", 0, "Suspend Scene", ""},
{ACT_SCENE_RESUME, "RESUME", 0, "Resume Scene", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
srna = RNA_def_struct(brna, "SceneActuator", "Actuator");
RNA_def_struct_ui_text(srna, "Scene Actuator", "");
@@ -1469,7 +1476,8 @@ static void rna_def_random_actuator(BlenderRNA *brna)
{ACT_RANDOM_FLOAT_UNIFORM, "FLOAT_UNIFORM", 0, "Float Uniform", ""},
{ACT_RANDOM_FLOAT_NORMAL, "FLOAT_NORMAL", 0, "Float Normal", ""},
{ACT_RANDOM_FLOAT_NEGATIVE_EXPONENTIAL, "FLOAT_NEGATIVE_EXPONENTIAL", 0, "Float Neg. Exp.", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
srna = RNA_def_struct(brna, "RandomActuator", "Actuator");
RNA_def_struct_ui_text(srna, "Random Actuator", "");
@@ -1588,7 +1596,8 @@ static void rna_def_message_actuator(BlenderRNA *brna)
static EnumPropertyItem prop_body_type_items[] = {
{ACT_MESG_MESG, "TEXT", 0, "Text", ""},
{ACT_MESG_PROP, "PROPERTY", 0, "Property", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
srna = RNA_def_struct(brna, "MessageActuator", "Actuator");
RNA_def_struct_ui_text(srna, "Message Actuator", "");
@@ -1638,7 +1647,8 @@ static void rna_def_game_actuator(BlenderRNA *brna)
{ACT_GAME_QUIT, "QUIT", 0, "Quit Game", ""},
{ACT_GAME_SAVECFG, "SAVECFG", 0, "Save bge.logic.globalDict", ""},
{ACT_GAME_LOADCFG, "LOADCFG", 0, "Load bge.logic.globalDict", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
srna = RNA_def_struct(brna, "GameActuator", "Actuator");
RNA_def_struct_ui_text(srna, "Game Actuator", "");
@@ -1711,7 +1721,8 @@ static void rna_def_twodfilter_actuator(BlenderRNA *brna)
{ACT_2DFILTER_INVERT, "INVERT", 0, "Invert", ""},
{ACT_2DFILTER_CUSTOMFILTER, "CUSTOMFILTER", 0, "Custom Filter", ""},
/* {ACT_2DFILTER_NUMBER_OF_FILTERS, "", 0, "Do not use it. Sentinel", ""}, */
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
srna = RNA_def_struct(brna, "Filter2DActuator", "Actuator");
RNA_def_struct_ui_text(srna, "Filter 2D Actuator", "Actuator to apply screen graphic effects");
@@ -1757,7 +1768,8 @@ static void rna_def_parent_actuator(BlenderRNA *brna)
static EnumPropertyItem prop_type_items[] = {
{ACT_PARENT_SET, "SETPARENT", 0, "Set Parent", ""},
{ACT_PARENT_REMOVE, "REMOVEPARENT", 0, "Remove Parent", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
srna = RNA_def_struct(brna, "ParentActuator", "Actuator");
RNA_def_struct_ui_text(srna, "Parent Actuator", "");
@@ -1805,7 +1817,8 @@ static void rna_def_shape_action_actuator(BlenderRNA *brna)
#ifdef __NLA_ACTION_BY_MOTION_ACTUATOR
{ACT_ACTION_MOTION, "MOTION", 0, "Displacement", ""},
#endif
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
srna = RNA_def_struct(brna, "ShapeActionActuator", "Actuator");
RNA_def_struct_ui_text(srna, "Shape Action Actuator", "Actuator to control shape key animations");
@@ -1886,7 +1899,8 @@ static void rna_def_state_actuator(BlenderRNA *brna)
{ACT_STATE_ADD, "ADD", 0, "Add State", ""},
{ACT_STATE_REMOVE, "REMOVE", 0, "Remove State", ""},
{ACT_STATE_CHANGE, "CHANGE", 0, "Change State", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
srna = RNA_def_struct(brna, "StateActuator", "Actuator");
RNA_def_struct_ui_text(srna, "State Actuator", "Actuator to handle states");
@@ -1908,7 +1922,7 @@ static void rna_def_state_actuator(BlenderRNA *brna)
static void rna_def_armature_actuator(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA* prop;
PropertyRNA *prop;
static EnumPropertyItem prop_type_items[] = {
{ACT_ARM_RUN, "RUN", 0, "Run Armature", ""},
@@ -1917,7 +1931,8 @@ static void rna_def_armature_actuator(BlenderRNA *brna)
{ACT_ARM_SETTARGET, "SETTARGET", 0, "Set Target", ""},
{ACT_ARM_SETWEIGHT, "SETWEIGHT", 0, "Set Weight", ""},
{ACT_ARM_SETINFLUENCE, "SETINFLUENCE", 0, "Set Influence", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
srna = RNA_def_struct(brna, "ArmatureActuator", "Actuator");
RNA_def_struct_ui_text(srna, "Armature Actuator", "");
@@ -1976,7 +1991,8 @@ static void rna_def_steering_actuator(BlenderRNA *brna)
{ACT_STEERING_SEEK, "SEEK", 0, "Seek", ""},
{ACT_STEERING_FLEE, "FLEE", 0, "Flee", ""},
{ACT_STEERING_PATHFOLLOWING, "PATHFOLLOWING", 0, "Path following", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem facingaxis_items[] = {
{1, "X", 0, "X", ""},
@@ -1985,7 +2001,8 @@ static void rna_def_steering_actuator(BlenderRNA *brna)
{4, "NEG_X", 0, "-X", ""},
{5, "NEG_Y", 0, "-Y", ""},
{6, "NEG_Z", 0, "-Z", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
srna = RNA_def_struct(brna, "SteeringActuator", "Actuator");
RNA_def_struct_ui_text(srna, "Steering Actuator", "");

View File

@@ -48,7 +48,8 @@ EnumPropertyItem keyingset_path_grouping_items[] = {
{KSP_GROUP_NAMED, "NAMED", 0, "Named Group", ""},
{KSP_GROUP_NONE, "NONE", 0, "None", ""},
{KSP_GROUP_KSNAME, "KEYINGSET", 0, "Keying Set Name", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
#ifdef RNA_RUNTIME
@@ -92,6 +93,7 @@ static int RKS_POLL_rna_internal(KeyingSetInfo *ksi, bContext *C)
func = &rna_KeyingSetInfo_poll_func; /* RNA_struct_find_function(&ptr, "poll"); */
RNA_parameter_list_create(&list, &ptr, func);
{
/* hook up arguments */
RNA_parameter_set_lookup(&list, "ksi", &ksi);
RNA_parameter_set_lookup(&list, "context", &C);
@@ -101,7 +103,8 @@ static int RKS_POLL_rna_internal(KeyingSetInfo *ksi, bContext *C)
/* read the result */
RNA_parameter_get_lookup(&list, "ok", &ret);
ok = *(int*)ret;
ok = *(int *)ret;
}
RNA_parameter_list_free(&list);
return ok;
@@ -120,6 +123,7 @@ static void RKS_ITER_rna_internal(KeyingSetInfo *ksi, bContext *C, KeyingSet *ks
func = &rna_KeyingSetInfo_iterator_func; /* RNA_struct_find_function(&ptr, "poll"); */
RNA_parameter_list_create(&list, &ptr, func);
{
/* hook up arguments */
RNA_parameter_set_lookup(&list, "ksi", &ksi);
RNA_parameter_set_lookup(&list, "context", &C);
@@ -127,6 +131,7 @@ static void RKS_ITER_rna_internal(KeyingSetInfo *ksi, bContext *C, KeyingSet *ks
/* execute the function */
ksi->ext.call(C, &ptr, func, &list);
}
RNA_parameter_list_free(&list);
}
@@ -143,6 +148,7 @@ static void RKS_GEN_rna_internal(KeyingSetInfo *ksi, bContext *C, KeyingSet *ks,
func = &rna_KeyingSetInfo_generate_func; /* RNA_struct_find_generate(&ptr, "poll"); */
RNA_parameter_list_create(&list, &ptr, func);
{
/* hook up arguments */
RNA_parameter_set_lookup(&list, "ksi", &ksi);
RNA_parameter_set_lookup(&list, "context", &C);
@@ -151,6 +157,7 @@ static void RKS_GEN_rna_internal(KeyingSetInfo *ksi, bContext *C, KeyingSet *ks,
/* execute the function */
ksi->ext.call(C, &ptr, func, &list);
}
RNA_parameter_list_free(&list);
}
@@ -160,7 +167,7 @@ static void RKS_GEN_rna_internal(KeyingSetInfo *ksi, bContext *C, KeyingSet *ks,
static StructRNA *rna_KeyingSetInfo_refine(PointerRNA *ptr)
{
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)
@@ -218,9 +225,9 @@ static StructRNA *rna_KeyingSetInfo_register(Main *bmain, ReportList *reports, v
/* set callbacks */
/* NOTE: we really should have all of these... */
ksi->poll = (have_function[0])? RKS_POLL_rna_internal: NULL;
ksi->iter = (have_function[1])? RKS_ITER_rna_internal: NULL;
ksi->generate = (have_function[2])? RKS_GEN_rna_internal: NULL;
ksi->poll = (have_function[0]) ? RKS_POLL_rna_internal : NULL;
ksi->iter = (have_function[1]) ? RKS_ITER_rna_internal : NULL;
ksi->generate = (have_function[2]) ? RKS_GEN_rna_internal : NULL;
/* add and register with other info as needed */
ANIM_keyingset_info_register(ksi);
@@ -233,19 +240,19 @@ static StructRNA *rna_KeyingSetInfo_register(Main *bmain, ReportList *reports, v
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);
}
static int rna_ksPath_id_editable(PointerRNA *ptr)
{
KS_Path *ksp = (KS_Path*)ptr->data;
return (ksp->idtype)? PROP_EDITABLE : 0;
KS_Path *ksp = (KS_Path *)ptr->data;
return (ksp->idtype) ? PROP_EDITABLE : 0;
}
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 */
data->idtype = value;
@@ -299,26 +306,26 @@ static int rna_KeyingSet_active_ksPath_editable(PointerRNA *ptr)
static PointerRNA rna_KeyingSet_active_ksPath_get(PointerRNA *ptr)
{
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)
{
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;
}
static int rna_KeyingSet_active_ksPath_index_get(PointerRNA *ptr)
{
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)
{
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, int *softmin, int *softmax)
@@ -326,7 +333,7 @@ static void rna_KeyingSet_active_ksPath_index_range(PointerRNA *ptr, int *min, i
KeyingSet *ks = (KeyingSet *)ptr->data;
*min = 0;
*max = BLI_countlist(&ks->paths)-1;
*max = BLI_countlist(&ks->paths) - 1;
*max = MAX2(0, *max);
}
@@ -344,7 +351,7 @@ static PointerRNA rna_KeyingSet_typeinfo_get(PointerRNA *ptr)
static KS_Path *rna_KeyingSet_paths_add(KeyingSet *keyingset, ReportList *reports,
ID *id, const char rna_path[], int index, int group_method, const char group_name[])
ID *id, const char rna_path[], int index, int group_method, const char group_name[])
{
KS_Path *ksp = NULL;
short flag = 0;
@@ -409,7 +416,7 @@ static NlaTrack *rna_NlaTrack_new(AnimData *adt, bContext *C, NlaTrack *track)
{
NlaTrack *new_track = add_nlatrack(adt, track);
WM_event_add_notifier(C, NC_ANIMATION|ND_NLA|NA_ADDED, NULL);
WM_event_add_notifier(C, NC_ANIMATION | ND_NLA | NA_ADDED, NULL);
return new_track;
}
@@ -418,20 +425,20 @@ static void rna_NlaTrack_remove(AnimData *adt, bContext *C, NlaTrack *track)
{
free_nlatrack(&adt->nla_tracks, track);
WM_event_add_notifier(C, NC_ANIMATION|ND_NLA|NA_REMOVED, NULL);
WM_event_add_notifier(C, NC_ANIMATION | ND_NLA | NA_REMOVED, NULL);
}
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);
return rna_pointer_inherit_refine(ptr, &RNA_NlaTrack, track);
}
static void rna_NlaTrack_active_set(PointerRNA *ptr, PointerRNA value)
{
AnimData *adt = (AnimData*)ptr->data;
NlaTrack *track = (NlaTrack*)value.data;
AnimData *adt = (AnimData *)ptr->data;
NlaTrack *track = (NlaTrack *)value.data;
BKE_nlatrack_set_active(&adt->nla_tracks, track);
}
@@ -461,29 +468,31 @@ static void rna_def_common_keying_flags(StructRNA *srna, short reg)
PropertyRNA *prop;
static EnumPropertyItem keying_flag_items[] = {
{INSERTKEY_NEEDED, "INSERTKEY_NEEDED", 0, "Insert Keyframes - Only Needed",
"Only insert keyframes where they're needed in the relevant F-Curves"},
{INSERTKEY_MATRIX, "INSERTKEY_VISUAL", 0, "Insert Keyframes - Visual",
"Insert keyframes based on 'visual transforms'"},
{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}};
{INSERTKEY_NEEDED, "INSERTKEY_NEEDED", 0, "Insert Keyframes - Only Needed",
"Only insert keyframes where they're needed in the relevant F-Curves"},
{INSERTKEY_MATRIX, "INSERTKEY_VISUAL", 0, "Insert Keyframes - Visual",
"Insert keyframes based on 'visual transforms'"},
{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}
};
prop = RNA_def_property(srna, "bl_options", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "keyingflag");
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);
RNA_def_property_ui_text(prop, "Options", "Keying set options");
}
/* --- */
/* To avoid repeating it twice! */
#define KEYINGSET_IDNAME_DOC "If this is set, the Keying Set gets a custom ID, otherwise it takes " \
"the name of the class used to define the Keying Set (for example, " \
"if the class name is \"BUILTIN_KSI_location\", and bl_idname is not " \
"set by the script, then bl_idname = \"BUILTIN_KSI_location\")"
#define KEYINGSET_IDNAME_DOC \
"If this is set, the Keying Set gets a custom ID, otherwise it takes " \
"the name of the class used to define the Keying Set (for example, " \
"if the class name is \"BUILTIN_KSI_location\", and bl_idname is not " \
"set by the script, then bl_idname = \"BUILTIN_KSI_location\")"
static void rna_def_keyingset_info(BlenderRNA *brna)
@@ -505,7 +514,7 @@ static void rna_def_keyingset_info(BlenderRNA *brna)
prop = RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE);
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);
RNA_def_property_ui_text(prop, "ID Name", KEYINGSET_IDNAME_DOC);
prop = RNA_def_property(srna, "bl_label", PROP_STRING, PROP_NONE);
@@ -525,7 +534,7 @@ static void rna_def_keyingset_info(BlenderRNA *brna)
RNA_define_verify_sdna(1);
/* Function Callbacks ------------- */
/* poll */
/* poll */
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_flag(func, FUNC_REGISTER);
@@ -533,7 +542,7 @@ static void rna_def_keyingset_info(BlenderRNA *brna)
parm = RNA_def_pointer(func, "context", "Context", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* iterator */
/* iterator */
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_flag(func, FUNC_REGISTER);
@@ -542,7 +551,7 @@ static void rna_def_keyingset_info(BlenderRNA *brna)
parm = RNA_def_pointer(func, "ks", "KeyingSet", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* generate */
/* generate */
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_flag(func, FUNC_REGISTER);
@@ -551,7 +560,7 @@ static void rna_def_keyingset_info(BlenderRNA *brna)
parm = RNA_def_pointer(func, "ks", "KeyingSet", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
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);
}
static void rna_def_keyingset_path(BlenderRNA *brna)
@@ -572,7 +581,7 @@ static void rna_def_keyingset_path(BlenderRNA *brna)
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);
RNA_def_property_enum_sdna(prop, NULL, "idtype");
@@ -580,19 +589,19 @@ static void rna_def_keyingset_path(BlenderRNA *brna)
RNA_def_property_enum_default(prop, ID_OB);
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_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 */
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_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 */
prop = RNA_def_property(srna, "group_method", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "groupmode");
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_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 */
prop = RNA_def_property(srna, "data_path", PROP_STRING, PROP_NONE);
@@ -600,12 +609,12 @@ static void rna_def_keyingset_path(BlenderRNA *brna)
"rna_ksPath_RnaPath_set");
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_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 */
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_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 */
prop = RNA_def_property(srna, "use_entire_array", PROP_BOOLEAN, PROP_NONE);
@@ -613,7 +622,7 @@ static void rna_def_keyingset_path(BlenderRNA *brna)
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 */
rna_def_common_keying_flags(srna, 0);
@@ -640,21 +649,21 @@ static void rna_def_keyingset_paths(BlenderRNA *brna, PropertyRNA *cprop)
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_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");
RNA_def_function_return(func, parm);
/* ID-block for target */
RNA_def_function_return(func, parm);
/* ID-block for target */
parm = RNA_def_pointer(func, "target_id", "ID", "Target ID", "ID-Datablock for the destination");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* rna-path */
/* XXX hopefully this is long enough */
RNA_def_property_flag(parm, PROP_REQUIRED);
/* rna-path */
/* XXX hopefully this is long enough */
parm = RNA_def_string(func, "data_path", "", 256, "Data-Path", "RNA-Path to destination property");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* index (defaults to -1 for entire array) */
RNA_def_property_flag(parm, PROP_REQUIRED);
/* index (defaults to -1 for entire array) */
RNA_def_int(func, "index", -1, -1, INT_MAX, "Index",
"The index of the destination property (i.e. axis of Location/Rotation/etc.), "
"or -1 for the entire array", 0, INT_MAX);
/* grouping */
/* grouping */
RNA_def_enum(func, "group_method", keyingset_path_grouping_items, KSP_GROUP_KSNAME,
"Grouping Method", "Method used to define which Group-name to use");
RNA_def_string(func, "group_name", "", 64, "Group Name",
@@ -665,9 +674,9 @@ static void rna_def_keyingset_paths(BlenderRNA *brna, PropertyRNA *cprop)
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_flag(func, FUNC_USE_REPORTS);
/* path to remove */
/* path to remove */
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 */
@@ -701,9 +710,9 @@ static void rna_def_keyingset(BlenderRNA *brna)
/* Id/Label. */
prop = RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE);
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);
RNA_def_property_ui_text(prop, "ID Name", KEYINGSET_IDNAME_DOC);
RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET|NA_RENAME, NULL);
RNA_def_property_update(prop, NC_SCENE | ND_KEYINGSET | NA_RENAME, NULL);
prop = RNA_def_property(srna, "bl_label", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "name");
@@ -775,7 +784,7 @@ static void rna_api_animdata_nla_tracks(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
RNA_def_function_ui_description(func, "Remove a NLA Track");
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);
RNA_def_property_struct_type(prop, "NlaTrack");
@@ -783,7 +792,7 @@ static void rna_api_animdata_nla_tracks(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Active Constraint", "Active Object constraint");
/* XXX: should (but doesn't) update the active track in the NLA window */
RNA_def_property_update(prop, NC_ANIMATION|ND_NLA|NA_SELECTED, NULL);
RNA_def_property_update(prop, NC_ANIMATION | ND_NLA | NA_SELECTED, NULL);
}
static void rna_api_animdata_drivers(BlenderRNA *brna, PropertyRNA *cprop)
@@ -836,8 +845,8 @@ void rna_def_animdata(BlenderRNA *brna)
/* Active Action */
prop = RNA_def_property(srna, "action", PROP_POINTER, PROP_NONE);
/* this flag as well as the dynamic test must be defined for this to be editable... */
RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_REFCOUNT);
/* this flag as well as the dynamic test must be defined for this to be editable... */
RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_REFCOUNT);
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_ui_text(prop, "Action", "Active Action for this datablock");
@@ -849,14 +858,14 @@ void rna_def_animdata(BlenderRNA *brna)
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_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);
RNA_def_property_enum_sdna(prop, NULL, "act_blendmode");
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_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);
RNA_def_property_float_sdna(prop, NULL, "act_influence");
@@ -864,7 +873,7 @@ void rna_def_animdata(BlenderRNA *brna)
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Action Influence",
"Amount the Active Action contributes to the result of the 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? */
/* Drivers */
prop = RNA_def_property(srna, "drivers", PROP_COLLECTION, PROP_NONE);
@@ -878,7 +887,7 @@ void rna_def_animdata(BlenderRNA *brna)
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_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

@@ -77,7 +77,7 @@ void RNA_api_keyingset(StructRNA *srna)
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);
}
#endif

View File

@@ -45,7 +45,8 @@ EnumPropertyItem motionpath_bake_location_items[] = {
{MOTIONPATH_BAKE_HEADS, "HEADS", 0, "Heads", "Calculate bone paths from heads"},
{0, "TAILS", 0, "Tails", "Calculate bone paths from tails"},
//{MOTIONPATH_BAKE_CENTERS, "CENTROID", 0, "Centers", "Calculate bone paths from center of mass"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
#ifdef RNA_RUNTIME
@@ -61,7 +62,7 @@ static PointerRNA rna_AnimViz_motion_paths_get(PointerRNA *ptr)
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);
data->ghost_sf = value;
@@ -69,26 +70,26 @@ static void rna_AnimViz_ghost_start_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;
}
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;
}
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... */
CLAMP(value, data->path_sf+1, (int)(MAXFRAMEF/2));
CLAMP(value, data->path_sf + 1, (int)(MAXFRAMEF / 2));
data->path_ef = value;
}
@@ -175,7 +176,8 @@ static void rna_def_animviz_ghosts(BlenderRNA *brna)
{GHOST_TYPE_ACFRA, "CURRENT_FRAME", 0, "Around Current Frame", "Show ghosts from around the current frame"},
{GHOST_TYPE_RANGE, "RANGE", 0, "In Range", "Show ghosts for the specified frame range"},
{GHOST_TYPE_KEYS, "KEYS", 0, "On Keyframes", "Show ghosts on keyframes"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
srna = RNA_def_struct(brna, "AnimVizOnionSkinning", NULL);
@@ -188,21 +190,21 @@ static void rna_def_animviz_ghosts(BlenderRNA *brna)
RNA_def_property_enum_sdna(prop, NULL, "ghost_type");
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_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 */
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_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);
RNA_def_property_int_sdna(prop, NULL, "ghost_step");
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_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 */
prop = RNA_def_property(srna, "frame_start", PROP_INT, PROP_TIME);
@@ -211,7 +213,7 @@ static void rna_def_animviz_ghosts(BlenderRNA *brna)
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);
RNA_def_property_int_sdna(prop, NULL, "ghost_ef");
@@ -219,7 +221,7 @@ static void rna_def_animviz_ghosts(BlenderRNA *brna)
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 */
prop = RNA_def_property(srna, "frame_before", PROP_INT, PROP_TIME);
@@ -228,7 +230,7 @@ static void rna_def_animviz_ghosts(BlenderRNA *brna)
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);
RNA_def_property_int_sdna(prop, NULL, "ghost_ac");
@@ -236,7 +238,7 @@ static void rna_def_animviz_ghosts(BlenderRNA *brna)
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_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 */
}
static void rna_def_animviz_paths(BlenderRNA *brna)
@@ -246,9 +248,10 @@ static void rna_def_animviz_paths(BlenderRNA *brna)
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"},
"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"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
srna = RNA_def_struct(brna, "AnimVizMotionPaths", NULL);
RNA_def_struct_sdna(srna, "bAnimVizSettings");
@@ -260,43 +263,43 @@ static void rna_def_animviz_paths(BlenderRNA *brna)
RNA_def_property_enum_sdna(prop, NULL, "path_type");
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_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);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "path_bakeflag");
RNA_def_property_enum_items(prop, motionpath_bake_location_items);
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 */
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_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);
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_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);
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_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);
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_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);
RNA_def_property_int_sdna(prop, NULL, "path_step");
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_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 */
@@ -306,7 +309,7 @@ static void rna_def_animviz_paths(BlenderRNA *brna)
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);
RNA_def_property_int_sdna(prop, NULL, "path_ef");
@@ -314,24 +317,24 @@ static void rna_def_animviz_paths(BlenderRNA *brna)
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 */
prop = RNA_def_property(srna, "frame_before", PROP_INT, PROP_TIME);
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_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);
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_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 */
}
/* --- */
@@ -375,8 +378,8 @@ static void rna_def_animviz(BlenderRNA *brna)
void RNA_def_animviz(BlenderRNA *brna)
{
rna_def_animviz(brna);
rna_def_animviz_ghosts(brna);
rna_def_animviz_paths(brna);
rna_def_animviz_ghosts(brna);
rna_def_animviz_paths(brna);
rna_def_animviz_motion_path(brna);
rna_def_animviz_motionpath_vert(brna);

View File

@@ -55,14 +55,14 @@ static void rna_Armature_update_data(Main *UNUSED(bmain), Scene *UNUSED(scene),
ID *id = ptr->id.data;
DAG_id_tag_update(id, 0);
WM_main_add_notifier(NC_GEOM|ND_DATA, id);
WM_main_add_notifier(NC_GEOM | ND_DATA, id);
/*WM_main_add_notifier(NC_OBJECT|ND_POSE, NULL); */
}
static void rna_Armature_act_bone_set(PointerRNA *ptr, PointerRNA value)
{
bArmature *arm = (bArmature*)ptr->data;
bArmature *arm = (bArmature *)ptr->data;
if (value.id.data == NULL && value.data == NULL) {
arm->act_bone = NULL;
@@ -84,7 +84,7 @@ static void rna_Armature_act_bone_set(PointerRNA *ptr, PointerRNA value)
static void rna_Armature_act_edit_bone_set(PointerRNA *ptr, PointerRNA value)
{
bArmature *arm = (bArmature*)ptr->data;
bArmature *arm = (bArmature *)ptr->data;
if (value.id.data == NULL && value.data == NULL) {
arm->act_edbone = NULL;
@@ -103,7 +103,7 @@ static void rna_Armature_act_edit_bone_set(PointerRNA *ptr, PointerRNA value)
EditBone *rna_Armature_edit_bone_new(bArmature *arm, ReportList *reports, const char *name)
{
if (arm->edbo == NULL) {
BKE_reportf(reports, RPT_ERROR, "Armature '%s' not in editmode, cant add an editbone", arm->id.name+2);
BKE_reportf(reports, RPT_ERROR, "Armature '%s' not in editmode, cant add an editbone", arm->id.name + 2);
return NULL;
}
return ED_armature_edit_bone_add(arm, name);
@@ -112,12 +112,12 @@ EditBone *rna_Armature_edit_bone_new(bArmature *arm, ReportList *reports, const
void rna_Armature_edit_bone_remove(bArmature *arm, ReportList *reports, EditBone *ebone)
{
if (arm->edbo == NULL) {
BKE_reportf(reports, RPT_ERROR, "Armature '%s' not in editmode, cant remove an editbone", arm->id.name+2);
BKE_reportf(reports, RPT_ERROR, "Armature '%s' not in editmode, cant remove an editbone", arm->id.name + 2);
return;
}
if (BLI_findindex(arm->edbo, ebone) == -1) {
BKE_reportf(reports, RPT_ERROR, "Armature '%s' doesn't contain bone '%s'", arm->id.name+2, ebone->name);
BKE_reportf(reports, RPT_ERROR, "Armature '%s' doesn't contain bone '%s'", arm->id.name + 2, ebone->name);
return;
}
@@ -135,19 +135,19 @@ static void rna_Armature_update_layers(Main *bmain, Scene *UNUSED(scene), Pointe
if (ob->data == arm && ob->pose)
ob->pose->proxy_layer = arm->layer;
WM_main_add_notifier(NC_GEOM|ND_DATA, arm);
WM_main_add_notifier(NC_GEOM | ND_DATA, arm);
}
static void rna_Armature_redraw_data(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
ID *id = ptr->id.data;
WM_main_add_notifier(NC_GEOM|ND_DATA, id);
WM_main_add_notifier(NC_GEOM | ND_DATA, id);
}
static char *rna_Bone_path(PointerRNA *ptr)
{
Bone *bone = (Bone*)ptr->data;
Bone *bone = (Bone *)ptr->data;
/* special exception for trying to get the path where ID-block is Object
* - this will be assumed to be from a Pose Bone...
@@ -192,60 +192,60 @@ static void rna_bone_layer_set(int *layer, const int *values)
int i, tot = 0;
/* ensure we always have some layer selected */
for (i = 0; i<32; i++)
for (i = 0; i < 32; i++)
if (values[i])
tot++;
if (tot == 0)
return;
for (i = 0; i<32; i++) {
if (values[i]) *layer |= (1<<i);
else *layer &= ~(1<<i);
for (i = 0; i < 32; i++) {
if (values[i]) *layer |= (1 << i);
else *layer &= ~(1 << i);
}
}
static void rna_Bone_layer_set(PointerRNA *ptr, const int *values)
{
Bone *bone = (Bone*)ptr->data;
Bone *bone = (Bone *)ptr->data;
rna_bone_layer_set(&bone->layer, values);
}
static void rna_Armature_layer_set(PointerRNA *ptr, const int *values)
{
bArmature *arm = (bArmature*)ptr->data;
bArmature *arm = (bArmature *)ptr->data;
int i, tot = 0;
/* ensure we always have some layer selected */
for (i = 0; i<32; i++)
for (i = 0; i < 32; i++)
if (values[i])
tot++;
if (tot == 0)
return;
for (i = 0; i<32; i++) {
if (values[i]) arm->layer |= (1<<i);
else arm->layer &= ~(1<<i);
for (i = 0; i < 32; i++) {
if (values[i]) arm->layer |= (1 << i);
else arm->layer &= ~(1 << i);
}
}
/* XXX depreceated.... old armature only animviz */
static void rna_Armature_ghost_start_frame_set(PointerRNA *ptr, int value)
{
bArmature *data = (bArmature*)ptr->data;
CLAMP(value, 1, (int)(MAXFRAMEF/2));
bArmature *data = (bArmature *)ptr->data;
CLAMP(value, 1, (int)(MAXFRAMEF / 2));
data->ghostsf = value;
if (data->ghostsf >= data->ghostef) {
data->ghostef = MIN2(data->ghostsf, (int)(MAXFRAMEF/2));
data->ghostef = MIN2(data->ghostsf, (int)(MAXFRAMEF / 2));
}
}
static void rna_Armature_ghost_end_frame_set(PointerRNA *ptr, int value)
{
bArmature *data = (bArmature*)ptr->data;
CLAMP(value, 1, (int)(MAXFRAMEF/2));
bArmature *data = (bArmature *)ptr->data;
CLAMP(value, 1, (int)(MAXFRAMEF / 2));
data->ghostef = value;
if (data->ghostsf >= data->ghostef) {
@@ -256,8 +256,8 @@ static void rna_Armature_ghost_end_frame_set(PointerRNA *ptr, int value)
static void rna_EditBone_name_set(PointerRNA *ptr, const char *value)
{
bArmature *arm = (bArmature*)ptr->id.data;
EditBone *ebone = (EditBone*)ptr->data;
bArmature *arm = (bArmature *)ptr->id.data;
EditBone *ebone = (EditBone *)ptr->data;
char oldname[sizeof(ebone->name)], newname[sizeof(ebone->name)];
/* need to be on the stack */
@@ -269,8 +269,8 @@ static void rna_EditBone_name_set(PointerRNA *ptr, const char *value)
static void rna_Bone_name_set(PointerRNA *ptr, const char *value)
{
bArmature *arm = (bArmature*)ptr->id.data;
Bone *bone = (Bone*)ptr->data;
bArmature *arm = (bArmature *)ptr->id.data;
Bone *bone = (Bone *)ptr->data;
char oldname[sizeof(bone->name)], newname[sizeof(bone->name)];
/* need to be on the stack */
@@ -282,7 +282,7 @@ static void rna_Bone_name_set(PointerRNA *ptr, const char *value)
static void rna_EditBone_layer_set(PointerRNA *ptr, const int values[])
{
EditBone *data = (EditBone*)(ptr->data);
EditBone *data = (EditBone *)(ptr->data);
rna_bone_layer_set(&data->layer, values);
}
@@ -304,7 +304,7 @@ static void rna_EditBone_connected_check(EditBone *ebone)
static void rna_EditBone_connected_set(PointerRNA *ptr, int value)
{
EditBone *ebone = (EditBone*)(ptr->data);
EditBone *ebone = (EditBone *)(ptr->data);
if (value) ebone->flag |= BONE_CONNECTED;
else ebone->flag &= ~BONE_CONNECTED;
@@ -314,14 +314,14 @@ static void rna_EditBone_connected_set(PointerRNA *ptr, int value)
static PointerRNA rna_EditBone_parent_get(PointerRNA *ptr)
{
EditBone *data = (EditBone*)(ptr->data);
EditBone *data = (EditBone *)(ptr->data);
return rna_pointer_inherit_refine(ptr, &RNA_EditBone, data->parent);
}
static void rna_EditBone_parent_set(PointerRNA *ptr, PointerRNA value)
{
EditBone *ebone = (EditBone*)(ptr->data);
EditBone *pbone, *parbone = (EditBone*)value.data;
EditBone *ebone = (EditBone *)(ptr->data);
EditBone *pbone, *parbone = (EditBone *)value.data;
if (parbone == NULL) {
if (ebone->parent && !(ebone->parent->flag & BONE_ROOTSEL))
@@ -350,9 +350,9 @@ static void rna_EditBone_parent_set(PointerRNA *ptr, PointerRNA value)
static void rna_EditBone_matrix_get(PointerRNA *ptr, float *values)
{
EditBone *ebone = (EditBone*)(ptr->data);
EditBone *ebone = (EditBone *)(ptr->data);
float delta[3], tmat[3][3], mat[4][4];
float delta[3], tmat[3][3], mat[4][4];
/* Find the current bone matrix */
sub_v3_v3v3(delta, ebone->tail, ebone->head);
@@ -365,8 +365,8 @@ static void rna_EditBone_matrix_get(PointerRNA *ptr, float *values)
static void rna_Armature_editbone_transform_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
bArmature *arm = (bArmature*)ptr->id.data;
EditBone *ebone = (EditBone*)ptr->data;
bArmature *arm = (bArmature *)ptr->id.data;
EditBone *ebone = (EditBone *)ptr->data;
EditBone *child, *eboflip;
/* update our parent */
@@ -394,7 +394,7 @@ static void rna_Armature_editbone_transform_update(Main *bmain, Scene *scene, Po
/* update our children if necessary */
for (child = arm->edbo->first; child; child = child->next)
if (child->parent == eboflip && (child->flag & BONE_CONNECTED))
copy_v3_v3 (child->head, eboflip->tail);
copy_v3_v3(child->head, eboflip->tail);
}
}
@@ -404,19 +404,19 @@ static void rna_Armature_editbone_transform_update(Main *bmain, Scene *scene, Po
static void rna_Armature_bones_next(CollectionPropertyIterator *iter)
{
ListBaseIterator *internal = iter->internal;
Bone *bone = (Bone*)internal->link;
Bone *bone = (Bone *)internal->link;
if (bone->childbase.first)
internal->link = (Link*)bone->childbase.first;
internal->link = (Link *)bone->childbase.first;
else if (bone->next)
internal->link = (Link*)bone->next;
internal->link = (Link *)bone->next;
else {
internal->link = NULL;
do {
bone = bone->parent;
if (bone && bone->next) {
internal->link = (Link*)bone->next;
internal->link = (Link *)bone->next;
break;
}
} while (bone);
@@ -504,7 +504,7 @@ static void rna_def_bone_common(StructRNA *srna, int editbone)
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
/* Number values */
/* envelope deform settings */
/* envelope deform settings */
prop = RNA_def_property(srna, "envelope_distance", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "dist");
RNA_def_property_range(prop, 0.0f, 1000.0f);
@@ -521,7 +521,7 @@ static void rna_def_bone_common(StructRNA *srna, int editbone)
if (editbone) RNA_def_property_update(prop, 0, "rna_Armature_editbone_transform_update");
else RNA_def_property_update(prop, 0, "rna_Armature_update_data");
RNA_def_property_float_sdna(prop, NULL, "rad_head");
/* XXX range is 0 to lim, where lim= 10000.0f*MAX2(1.0, view3d->grid); */
/* XXX range is 0 to lim, where lim= 10000.0f*MAX2(1.0, view3d->grid); */
/*RNA_def_property_range(prop, 0, 1000); */
RNA_def_property_ui_range(prop, 0.01, 100, 0.1, 3);
RNA_def_property_ui_text(prop, "Envelope Head Radius", "Radius of head of bone (for Envelope deform only)");
@@ -530,12 +530,12 @@ static void rna_def_bone_common(StructRNA *srna, int editbone)
if (editbone) RNA_def_property_update(prop, 0, "rna_Armature_editbone_transform_update");
else RNA_def_property_update(prop, 0, "rna_Armature_update_data");
RNA_def_property_float_sdna(prop, NULL, "rad_tail");
/* XXX range is 0 to lim, where lim= 10000.0f*MAX2(1.0, view3d->grid); */
/* XXX range is 0 to lim, where lim= 10000.0f*MAX2(1.0, view3d->grid); */
/*RNA_def_property_range(prop, 0, 1000); */
RNA_def_property_ui_range(prop, 0.01, 100, 0.1, 3);
RNA_def_property_ui_text(prop, "Envelope Tail Radius", "Radius of tail of bone (for Envelope deform only)");
/* b-bones deform settings */
/* b-bones deform settings */
prop = RNA_def_property(srna, "bbone_segments", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "segments");
RNA_def_property_range(prop, 1, 32);
@@ -580,14 +580,14 @@ static void rna_def_bone(BlenderRNA *brna)
RNA_def_struct_idprops_func(srna, "rna_Bone_idprops");
/* pointers/collections */
/* parent (pointer) */
/* parent (pointer) */
prop = RNA_def_property(srna, "parent", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Bone");
RNA_def_property_pointer_sdna(prop, NULL, "parent");
RNA_def_property_ui_text(prop, "Parent", "Parent bone (in same Armature)");
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
/* children (collection) */
/* children (collection) */
prop = RNA_def_property(srna, "children", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "childbase", NULL);
RNA_def_property_struct_type(prop, "Bone");
@@ -595,8 +595,8 @@ static void rna_def_bone(BlenderRNA *brna)
rna_def_bone_common(srna, 0);
/* XXX should we define this in PoseChannel wrapping code instead?
* But PoseChannels directly get some of their flags from here... */
/* XXX should we define this in PoseChannel wrapping code instead?
* But PoseChannels directly get some of their flags from here... */
prop = RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_HIDDEN_P);
RNA_def_property_ui_text(prop, "Hide",
@@ -745,7 +745,7 @@ static void rna_def_edit_bone(BlenderRNA *brna)
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_flag(prop, PROP_THICK_WRAP); /* no reference to original data */
RNA_def_property_ui_text(prop, "Editbone Matrix", "Read-only matrix calculated from the roll (armature space)");
/* TODO - this could be made writable also */
/* TODO - this could be made writable also */
RNA_def_property_float_funcs(prop, "rna_EditBone_matrix_get", NULL, NULL);
RNA_api_armature_edit_bone(srna);
@@ -822,7 +822,7 @@ static void rna_def_armature_edit_bones(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_ui_description(func, "Remove an existing bone from the armature");
/* target to remove*/
parm = RNA_def_pointer(func, "bone", "EditBone", "", "EditBone to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL);
}
static void rna_def_armature(BlenderRNA *brna)
@@ -837,21 +837,25 @@ static void rna_def_armature(BlenderRNA *brna)
{ARM_ENVELOPE, "ENVELOPE", 0, "Envelope",
"Display bones as extruded spheres, showing deformation influence volume"},
{ARM_WIRE, "WIRE", 0, "Wire", "Display bones as thin wires, showing subdivision and B-Splines"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem prop_vdeformer[] = {
{ARM_VDEF_BLENDER, "BLENDER", 0, "Blender", "Use Blender's armature vertex deformation"},
{ARM_VDEF_BGE_CPU, "BGE_CPU", 0, "BGE", "Use vertex deformation code optimized for the BGE"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem prop_ghost_type_items[] = {
{ARM_GHOST_CUR, "CURRENT_FRAME", 0, "Around Frame",
"Display Ghosts of poses within a fixed number of frames around the current frame"},
{ARM_GHOST_RANGE, "RANGE", 0, "In Range", "Display Ghosts of poses within specified range"},
{ARM_GHOST_KEYS, "KEYS", 0, "On Keyframes", "Display Ghosts of poses on Keyframes"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static const EnumPropertyItem prop_pose_position_items[] = {
{0, "POSE", 0, "Pose Position", "Show armature in posed state"},
{ARM_RESTPOS, "REST", 0, "Rest Position", "Show Armature in binding pose state (no posing possible)"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
srna = RNA_def_struct(brna, "Armature", "ID");
RNA_def_struct_ui_text(srna, "Armature",
@@ -908,16 +912,16 @@ static void rna_def_armature(BlenderRNA *brna)
/* XXX depreceated ....... old animviz for armatures only */
/* Boolean values */
/* layer */
/* layer */
prop = RNA_def_property(srna, "layers", PROP_BOOLEAN, PROP_LAYER_MEMBER);
RNA_def_property_boolean_sdna(prop, NULL, "layer", 1);
RNA_def_property_array(prop, 32);
RNA_def_property_ui_text(prop, "Visible Layers", "Armature layer visibility");
RNA_def_property_boolean_funcs(prop, NULL, "rna_Armature_layer_set");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Armature_update_layers");
RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Armature_update_layers");
RNA_def_property_flag(prop, PROP_LIB_EXCEPTION);
/* layer protection */
/* layer protection */
prop = RNA_def_property(srna, "layers_protected", PROP_BOOLEAN, PROP_LAYER);
RNA_def_property_boolean_sdna(prop, NULL, "layer_protected", 1);
RNA_def_property_array(prop, 32);
@@ -926,7 +930,7 @@ static void rna_def_armature(BlenderRNA *brna)
"on file reload and undo");
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
/* flag */
/* flag */
prop = RNA_def_property(srna, "show_axes", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ARM_DRAWAXES);
RNA_def_property_ui_text(prop, "Draw Axes", "Draw bone axes");
@@ -976,7 +980,7 @@ static void rna_def_armature(BlenderRNA *brna)
/* Number fields */
/* XXX depreceated ....... old animviz for armatures only */
/* ghost/onionskining settings */
/* ghost/onionskining settings */
prop = RNA_def_property(srna, "ghost_step", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "ghostep");
RNA_def_property_range(prop, 0, 30);

View File

@@ -76,7 +76,7 @@ void RNA_api_bone(StructRNA *srna)
func = RNA_def_function(srna, "evaluate_envelope", "rna_Bone_do_envelope");
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",
"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);
/* return value */
parm = RNA_def_float(func, "factor", 0, -FLT_MAX, FLT_MAX, "Factor", "Envelope factor", -FLT_MAX, FLT_MAX);

View File

@@ -65,7 +65,8 @@ EnumPropertyItem boidrule_type_items[] = {
{eBoidRuleType_FollowWall, "FOLLOW_WALL", 0, "Follow Wall",
"Move next to a deflector object's in direction of it's tangent"},
#endif
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
EnumPropertyItem boidruleset_type_items[] = {
{eBoidRulesetType_Fuzzy, "FUZZY", 0, "Fuzzy",
@@ -73,7 +74,8 @@ EnumPropertyItem boidruleset_type_items[] = {
"fuzziness threshold is evaluated)"},
{eBoidRulesetType_Random, "RANDOM", 0, "Random", "A random rule is selected for each boid"},
{eBoidRulesetType_Average, "AVERAGE", 0, "Average", "All rules are averaged"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
#ifdef RNA_RUNTIME
@@ -85,37 +87,37 @@ EnumPropertyItem boidruleset_type_items[] = {
static void rna_Boids_reset(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
if (ptr->type == &RNA_ParticleSystem) {
ParticleSystem *psys = (ParticleSystem*)ptr->data;
ParticleSystem *psys = (ParticleSystem *)ptr->data;
psys->recalc = PSYS_RECALC_RESET;
DAG_id_tag_update(ptr->id.data, OB_RECALC_DATA);
}
else
DAG_id_tag_update(ptr->id.data, OB_RECALC_DATA|PSYS_RECALC_RESET);
DAG_id_tag_update(ptr->id.data, OB_RECALC_DATA | PSYS_RECALC_RESET);
WM_main_add_notifier(NC_OBJECT|ND_PARTICLE|NA_EDITED, NULL);
WM_main_add_notifier(NC_OBJECT | ND_PARTICLE | NA_EDITED, NULL);
}
static void rna_Boids_reset_deps(Main *bmain, Scene *scene, PointerRNA *ptr)
{
if (ptr->type == &RNA_ParticleSystem) {
ParticleSystem *psys = (ParticleSystem*)ptr->data;
ParticleSystem *psys = (ParticleSystem *)ptr->data;
psys->recalc = PSYS_RECALC_RESET;
DAG_id_tag_update(ptr->id.data, OB_RECALC_DATA);
}
else
DAG_id_tag_update(ptr->id.data, OB_RECALC_DATA|PSYS_RECALC_RESET);
DAG_id_tag_update(ptr->id.data, OB_RECALC_DATA | PSYS_RECALC_RESET);
DAG_scene_sort(bmain, scene);
WM_main_add_notifier(NC_OBJECT|ND_PARTICLE|NA_EDITED, NULL);
WM_main_add_notifier(NC_OBJECT | ND_PARTICLE | NA_EDITED, NULL);
}
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) {
case eBoidRuleType_Goal:
@@ -137,13 +139,13 @@ static StructRNA* rna_BoidRule_refine(struct 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)
{
BoidState *state = (BoidState*)ptr->data;
BoidRule *rule = (BoidRule*)state->rules.first;
BoidState *state = (BoidState *)ptr->data;
BoidRule *rule = (BoidRule *)state->rules.first;
for (; rule; rule = rule->next) {
if (rule->flag & BOIDRULE_CURRENT)
@@ -153,16 +155,16 @@ static PointerRNA rna_BoidState_active_boid_rule_get(PointerRNA *ptr)
}
static void rna_BoidState_active_boid_rule_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax)
{
BoidState *state = (BoidState*)ptr->data;
BoidState *state = (BoidState *)ptr->data;
*min = 0;
*max = BLI_countlist(&state->rules)-1;
*max = BLI_countlist(&state->rules) - 1;
*max = MAX2(0, *max);
}
static int rna_BoidState_active_boid_rule_index_get(PointerRNA *ptr)
{
BoidState *state = (BoidState*)ptr->data;
BoidRule *rule = (BoidRule*)state->rules.first;
BoidState *state = (BoidState *)ptr->data;
BoidRule *rule = (BoidRule *)state->rules.first;
int i = 0;
for (; rule; rule = rule->next, i++) {
@@ -174,8 +176,8 @@ 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)
{
BoidState *state = (BoidState*)ptr->data;
BoidRule *rule = (BoidRule*)state->rules.first;
BoidState *state = (BoidState *)ptr->data;
BoidRule *rule = (BoidRule *)state->rules.first;
int i = 0;
for (; rule; rule = rule->next, i++) {
@@ -198,7 +200,7 @@ static char *rna_BoidSettings_path(PointerRNA *ptr)
BoidSettings *boids = (BoidSettings *)ptr->data;
if (particle_id_check(ptr)) {
ParticleSettings *part = (ParticleSettings*)ptr->id.data;
ParticleSettings *part = (ParticleSettings *)ptr->id.data;
if (part->boids == boids)
return BLI_sprintfN("boids");
@@ -208,8 +210,8 @@ static char *rna_BoidSettings_path(PointerRNA *ptr)
static PointerRNA rna_BoidSettings_active_boid_state_get(PointerRNA *ptr)
{
BoidSettings *boids = (BoidSettings*)ptr->data;
BoidState *state = (BoidState*)boids->states.first;
BoidSettings *boids = (BoidSettings *)ptr->data;
BoidState *state = (BoidState *)boids->states.first;
for (; state; state = state->next) {
if (state->flag & BOIDSTATE_CURRENT)
@@ -220,16 +222,16 @@ static PointerRNA rna_BoidSettings_active_boid_state_get(PointerRNA *ptr)
static void rna_BoidSettings_active_boid_state_index_range(PointerRNA *ptr, int *min, int *max,
int *softmin, int *softmax)
{
BoidSettings *boids = (BoidSettings*)ptr->data;
BoidSettings *boids = (BoidSettings *)ptr->data;
*min = 0;
*max = BLI_countlist(&boids->states)-1;
*max = BLI_countlist(&boids->states) - 1;
*max = MAX2(0, *max);
}
static int rna_BoidSettings_active_boid_state_index_get(PointerRNA *ptr)
{
BoidSettings *boids = (BoidSettings*)ptr->data;
BoidState *state = (BoidState*)boids->states.first;
BoidSettings *boids = (BoidSettings *)ptr->data;
BoidState *state = (BoidState *)boids->states.first;
int i = 0;
for (; state; state = state->next, i++) {
@@ -241,8 +243,8 @@ 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)
{
BoidSettings *boids = (BoidSettings*)ptr->data;
BoidState *state = (BoidState*)boids->states.first;
BoidSettings *boids = (BoidSettings *)ptr->data;
BoidState *state = (BoidState *)boids->states.first;
int i = 0;
for (; state; state = state->next, i++) {

View File

@@ -83,7 +83,7 @@ static void rna_Camera_angle_y_set(PointerRNA *ptr, float value)
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);
}
@@ -98,7 +98,8 @@ void RNA_def_camera(BlenderRNA *brna)
{CAM_PERSP, "PERSP", 0, "Perspective", ""},
{CAM_ORTHO, "ORTHO", 0, "Orthographic", ""},
{CAM_PANO, "PANO", 0, "Panoramic", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem prop_draw_type_extra_items[] = {
{CAM_DTX_CENTER, "CENTER", 0, "Center", ""},
{CAM_DTX_CENTER_DIAG, "CENTER_DIAGONAL", 0, "Center Diagonal", ""},
@@ -108,16 +109,19 @@ void RNA_def_camera(BlenderRNA *brna)
{CAM_DTX_GOLDEN_TRI_B, "GOLDEN_TRIANGLE_B", 0, "Golden Triangle B", ""},
{CAM_DTX_HARMONY_TRI_A, "HARMONY_TRIANGLE_A", 0, "Harmonious Triangle A", ""},
{CAM_DTX_HARMONY_TRI_B, "HARMONY_TRIANGLE_B", 0, "Harmonious Triangle B", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem prop_lens_unit_items[] = {
{0, "MILLIMETERS", 0, "Millimeters", ""},
{CAM_ANGLETOGGLE, "DEGREES", 0, "Degrees", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem sensor_fit_items[] = {
{CAMERA_SENSOR_FIT_AUTO, "AUTO", 0, "Auto", "Fit to the sensor width or height depending on image resolution"},
{CAMERA_SENSOR_FIT_HOR, "HORIZONTAL", 0, "Horizontal", "Fit to the sensor width"},
{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");
RNA_def_struct_ui_text(srna, "Camera", "Camera datablock for storing camera settings");
@@ -127,145 +131,145 @@ void RNA_def_camera(BlenderRNA *brna)
prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, prop_type_items);
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);
RNA_def_property_enum_sdna(prop, NULL, "dtx");
RNA_def_property_enum_items(prop, prop_draw_type_extra_items);
RNA_def_property_flag(prop, PROP_ENUM_FLAG);
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);
RNA_def_property_enum_sdna(prop, NULL, "sensor_fit");
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_update(prop, NC_OBJECT|ND_DRAW, "rna_Camera_update");
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Camera_update");
/* Number values */
prop = RNA_def_property(srna, "passepartout_alpha", PROP_FLOAT, PROP_FACTOR);
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_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);
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_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_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);
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_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_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);
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_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_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);
RNA_def_property_float_sdna(prop, NULL, "clipsta");
RNA_def_property_range(prop, 0.001f, FLT_MAX);
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);
RNA_def_property_float_sdna(prop, NULL, "clipend");
RNA_def_property_range(prop, 1.0f, FLT_MAX);
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);
RNA_def_property_float_sdna(prop, NULL, "lens");
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_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);
RNA_def_property_float_sdna(prop, NULL, "sensor_x");
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_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);
RNA_def_property_float_sdna(prop, NULL, "sensor_y");
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_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);
RNA_def_property_float_sdna(prop, NULL, "ortho_scale");
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_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);
RNA_def_property_float_sdna(prop, NULL, "drawsize");
RNA_def_property_range(prop, 0.01f, 1000.0f);
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_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);
RNA_def_property_float_sdna(prop, NULL, "shiftx");
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_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);
RNA_def_property_float_sdna(prop, NULL, "shifty");
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_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);
RNA_def_property_float_sdna(prop, NULL, "YF_dofdist");
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_update(prop, NC_OBJECT|ND_DRAW, NULL);
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL);
/* flag */
prop = RNA_def_property(srna, "show_limits", PROP_BOOLEAN, PROP_NONE);
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_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);
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_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);
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_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);
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_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);
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_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);
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_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);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
@@ -280,7 +284,7 @@ void RNA_def_camera(BlenderRNA *brna)
RNA_def_property_pointer_sdna(prop, NULL, "dof_ob");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "DOF Object", "Use this object to define the depth of field focal point");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL);
/* Camera API */
RNA_api_camera(srna);

View File

@@ -49,39 +49,39 @@
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);
WM_main_add_notifier(NC_OBJECT|ND_MODIFIER, ob);
WM_main_add_notifier(NC_OBJECT | ND_MODIFIER, ob);
}
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; */
ClothModifierData *clmd = (ClothModifierData*)modifiers_findByType(ob, eModifierType_Cloth);
ClothModifierData *clmd = (ClothModifierData *)modifiers_findByType(ob, eModifierType_Cloth);
cloth_free_modifier(clmd);
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);
}
static void rna_cloth_reset(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
Object *ob = (Object*)ptr->id.data;
ClothSimSettings *settings = (ClothSimSettings*)ptr->data;
Object *ob = (Object *)ptr->id.data;
ClothSimSettings *settings = (ClothSimSettings *)ptr->data;
settings->reset = 1;
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);
}
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 */
if (value < settings->bending)
@@ -92,7 +92,7 @@ static void rna_ClothSettings_max_bend_set(struct PointerRNA *ptr, float value)
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 */
if (value < settings->structural)
@@ -103,77 +103,77 @@ static void rna_ClothSettings_max_struct_set(struct PointerRNA *ptr, float 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);
}
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);
}
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);
}
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);
}
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);
}
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);
}
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);
}
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);
}
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);
}
static PointerRNA rna_ClothSettings_rest_shape_key_get(PointerRNA *ptr)
{
Object *ob = (Object*)ptr->id.data;
ClothSimSettings *sim = (ClothSimSettings*)ptr->data;
Object *ob = (Object *)ptr->id.data;
ClothSimSettings *sim = (ClothSimSettings *)ptr->data;
return rna_object_shapekey_index_get(ob->data, sim->shapekey_rest);
}
static void rna_ClothSettings_rest_shape_key_set(PointerRNA *ptr, PointerRNA value)
{
Object *ob = (Object*)ptr->id.data;
ClothSimSettings *sim = (ClothSimSettings*)ptr->data;
Object *ob = (Object *)ptr->id.data;
ClothSimSettings *sim = (ClothSimSettings *)ptr->data;
sim->shapekey_rest = rna_object_shapekey_index_set(ob->data, value, sim->shapekey_rest);
}
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[1] = sim->gravity[1];
@@ -182,7 +182,7 @@ static void rna_ClothSettings_gravity_get(PointerRNA *ptr, 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[1] = values[1];
@@ -191,7 +191,7 @@ static void rna_ClothSettings_gravity_set(PointerRNA *ptr, const float *values)
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);
return md ? BLI_sprintfN("modifiers[\"%s\"].settings", md->name) : NULL;
@@ -199,7 +199,7 @@ static char *rna_ClothSettings_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);
return md ? BLI_sprintfN("modifiers[\"%s\"].collision_settings", md->name) : NULL;
@@ -398,40 +398,47 @@ static void rna_def_cloth_sim_settings(BlenderRNA *brna)
/* unused */
/* unused still
/* unused still */
#if 0
prop= RNA_def_property(srna, "shear_stiffness", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "shear");
RNA_def_property_range(prop, 0.0f, 1000.0f);
RNA_def_property_ui_text(prop, "Shear Stiffness", "Shear spring stiffness"); */
/* unused still
RNA_def_property_ui_text(prop, "Shear Stiffness", "Shear spring stiffness");
#endif
/* unused still */
#if 0
prop= RNA_def_property(srna, "shear_stiffness_max", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "max_shear");
RNA_def_property_range(prop, 0.0f, upperLimitf);
RNA_def_property_ui_text(prop, "Shear Stiffness Maximum", "Maximum shear scaling value"); */
/* unused still
RNA_def_property_ui_text(prop, "Shear Stiffness Maximum", "Maximum shear scaling value");
#endif
/* unused still */
#if 0
prop= RNA_def_property(srna, "effector_force_scale", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "eff_force_scale");
RNA_def_property_range(prop, 0.0f, 100.0f);
RNA_def_property_ui_text(prop, "Effector Force Scale", ""); */
/* unused still
RNA_def_property_ui_text(prop, "Effector Force Scale", "");
#endif
/* unused still */
#if 0
prop= RNA_def_property(srna, "effector_wind_scale", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "eff_wind_scale");
RNA_def_property_range(prop, 0.0f, 100.0f);
RNA_def_property_ui_text(prop, "Effector Wind Scale", ""); */
/* unused still
RNA_def_property_ui_text(prop, "Effector Wind Scale", "");
#endif
/* unused still */
#if 0
prop= RNA_def_property(srna, "tearing", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", CLOTH_SIMSETTINGS_FLAG_TEARING);
RNA_def_property_ui_text(prop, "Tearing", "");*/
/* unused still
RNA_def_property_ui_text(prop, "Tearing", "");
#endif
/* unused still */
#if 0
prop= RNA_def_property(srna, "max_spring_extensions", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "maxspringlen");
RNA_def_property_range(prop, 1.0, 1000.0);
RNA_def_property_ui_text(prop, "Maximum Spring Extension", "Maximum extension before spring gets cut"); */
RNA_def_property_ui_text(prop, "Maximum Spring Extension", "Maximum extension before spring gets cut");
#endif
}
static void rna_def_cloth_collision_settings(BlenderRNA *brna)

View File

@@ -55,10 +55,10 @@
static int rna_CurveMapping_curves_length(PointerRNA *ptr)
{
CurveMapping *cumap = (CurveMapping*)ptr->data;
CurveMapping *cumap = (CurveMapping *)ptr->data;
int len;
for (len = 0; len<CM_TOT; len++)
for (len = 0; len < CM_TOT; len++)
if (!cumap->cm[len].curve)
break;
@@ -67,14 +67,14 @@ static int rna_CurveMapping_curves_length(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);
}
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;
else cumap->flag &= ~CUMA_DO_CLIP;
@@ -84,7 +84,7 @@ static void rna_CurveMapping_clip_set(PointerRNA *ptr, int value)
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[1] = values[1];
cumap->black[2] = values[2];
@@ -93,7 +93,7 @@ static void rna_CurveMapping_black_level_set(PointerRNA *ptr, const float *value
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[1] = values[1];
cumap->white[2] = values[2];
@@ -102,7 +102,7 @@ static void rna_CurveMapping_white_level_set(PointerRNA *ptr, const float *value
static void rna_CurveMapping_clipminx_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax)
{
CurveMapping *cumap = (CurveMapping*)ptr->data;
CurveMapping *cumap = (CurveMapping *)ptr->data;
*min = -100.0f;
*max = cumap->clipr.xmax;
@@ -110,7 +110,7 @@ static void rna_CurveMapping_clipminx_range(PointerRNA *ptr, float *min, float *
static void rna_CurveMapping_clipminy_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax)
{
CurveMapping *cumap = (CurveMapping*)ptr->data;
CurveMapping *cumap = (CurveMapping *)ptr->data;
*min = -100.0f;
*max = cumap->clipr.ymax;
@@ -118,7 +118,7 @@ static void rna_CurveMapping_clipminy_range(PointerRNA *ptr, float *min, float *
static void rna_CurveMapping_clipmaxx_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax)
{
CurveMapping *cumap = (CurveMapping*)ptr->data;
CurveMapping *cumap = (CurveMapping *)ptr->data;
*min = cumap->clipr.xmin;
*max = 100.0f;
@@ -126,7 +126,7 @@ static void rna_CurveMapping_clipmaxx_range(PointerRNA *ptr, float *min, float *
static void rna_CurveMapping_clipmaxy_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax)
{
CurveMapping *cumap = (CurveMapping*)ptr->data;
CurveMapping *cumap = (CurveMapping *)ptr->data;
*min = cumap->clipr.ymin;
*max = 100.0f;
@@ -140,16 +140,16 @@ static char *rna_ColorRamp_path(PointerRNA *ptr)
ID *id = ptr->id.data;
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)
return BLI_strdup("diffuse_ramp");
else if (ptr->data == ma->ramp_spec)
return BLI_strdup("specular_ramp");
}
break;
break;
}
}
@@ -202,9 +202,9 @@ static char *rna_ColorRampElement_path(PointerRNA *ptr)
COLRAMP_GETPATH;
}
}
break;
break;
/* TODO: node trees need special attention */
/* TODO: node trees need special attention */
case ID_NT:
{
bNodeTree *ntree = (bNodeTree *)id;
@@ -217,7 +217,7 @@ static char *rna_ColorRampElement_path(PointerRNA *ptr)
}
}
}
break;
break;
default: /* everything else should have a "color_ramp" property */
{
@@ -247,9 +247,9 @@ static void rna_ColorRamp_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *
Material *ma = ptr->id.data;
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);
}
break;
break;
case ID_NT:
{
bNodeTree *ntree = (bNodeTree *)id;
@@ -261,7 +261,7 @@ static void rna_ColorRamp_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *
}
}
}
break;
break;
case ID_TE:
{
Tex *tex = ptr->id.data;
@@ -269,7 +269,7 @@ static void rna_ColorRamp_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *
DAG_id_tag_update(&tex->id, 0);
WM_main_add_notifier(NC_TEXTURE, tex);
}
break;
break;
default:
break;
}
@@ -301,7 +301,7 @@ static void rna_ColorRampElement_remove(struct ColorBand *coba, ReportList *repo
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;
}
@@ -474,7 +474,7 @@ static void rna_def_color_ramp_element_api(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_ui_description(func, "Delete element from ColorRamp");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
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);
}
static void rna_def_color_ramp(BlenderRNA *brna)
@@ -489,7 +489,8 @@ static void rna_def_color_ramp(BlenderRNA *brna)
{0, "LINEAR", 0, "Linear", ""},
{2, "B_SPLINE", 0, "B-Spline", ""},
{4, "CONSTANT", 0, "Constant", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
srna = RNA_def_struct(brna, "ColorRamp", NULL);
RNA_def_struct_sdna(srna, "ColorBand");
@@ -541,7 +542,8 @@ static void rna_def_histogram(BlenderRNA *brna)
{HISTO_MODE_R, "R", ICON_COLOR, "Red", ""},
{HISTO_MODE_G, "G", ICON_COLOR, "Green", ""},
{HISTO_MODE_B, "B", ICON_COLOR, "Blue", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, 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");
@@ -564,7 +566,8 @@ static void rna_def_scopes(BlenderRNA *brna)
{SCOPES_WAVEFRM_YCC_601, "YCBCR601", ICON_COLOR, "YCbCr (ITU 601)", ""},
{SCOPES_WAVEFRM_YCC_709, "YCBCR709", ICON_COLOR, "YCbCr (ITU 709)", ""},
{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);
RNA_def_struct_ui_text(srna, "Scopes", "Scopes for statistical view of an image");

File diff suppressed because it is too large Load Diff

View File

@@ -41,54 +41,54 @@
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));
}
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));
}
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));
}
static PointerRNA rna_Context_area_get(PointerRNA *ptr)
{
bContext *C = (bContext*)ptr->data;
bContext *C = (bContext *)ptr->data;
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;
}
static PointerRNA rna_Context_space_data_get(PointerRNA *ptr)
{
bContext *C = (bContext*)ptr->data;
bContext *C = (bContext *)ptr->data;
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;
}
static PointerRNA rna_Context_region_get(PointerRNA *ptr)
{
bContext *C = (bContext*)ptr->data;
bContext *C = (bContext *)ptr->data;
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;
}
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 */
if (CTX_wm_view3d(C)) {
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;
}
@@ -97,19 +97,19 @@ static PointerRNA rna_Context_region_data_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));
}
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));
}
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);
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)
{
bContext *C = (bContext*)ptr->data;
bContext *C = (bContext *)ptr->data;
return CTX_data_mode_enum(C);
}
@@ -149,7 +149,8 @@ void RNA_def_context(BlenderRNA *brna)
{CTX_MODE_PAINT_TEXTURE, "PAINT_TEXTURE", 0, "Texture Paint", ""},
{CTX_MODE_PARTICLE, "PARTICLE", 0, "Particle", ""},
{CTX_MODE_OBJECT, "OBJECT", 0, "Object", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
srna = RNA_def_struct(brna, "Context", NULL);
RNA_def_struct_ui_text(srna, "Context", "Current windowmanager and data context");

View File

@@ -43,36 +43,36 @@ EnumPropertyItem controller_type_items[] = {
{CONT_LOGIC_XNOR, "LOGIC_XNOR", 0, "Xnor", "Logic Xnor"},
{CONT_EXPRESSION, "EXPRESSION", 0, "Expression", ""},
{CONT_PYTHON, "PYTHON", 0, "Python", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
#ifdef RNA_RUNTIME
#include "BKE_sca.h"
#include "DNA_actuator_types.h"
static struct StructRNA* rna_Controller_refine(struct PointerRNA *ptr)
{
bController *controller = (bController*)ptr->data;
static struct StructRNA *rna_Controller_refine(struct PointerRNA *ptr){
bController *controller = (bController *)ptr->data;
switch (controller->type) {
case CONT_LOGIC_AND:
return &RNA_AndController;
case CONT_LOGIC_OR:
return &RNA_OrController;
case CONT_LOGIC_NAND:
return &RNA_NandController;
case CONT_LOGIC_NOR:
return &RNA_NorController;
case CONT_LOGIC_XOR:
return &RNA_XorController;
case CONT_LOGIC_XNOR:
return &RNA_XnorController;
case CONT_EXPRESSION:
return &RNA_ExpressionController;
case CONT_PYTHON:
return &RNA_PythonController;
default:
return &RNA_Controller;
case CONT_LOGIC_AND:
return &RNA_AndController;
case CONT_LOGIC_OR:
return &RNA_OrController;
case CONT_LOGIC_NAND:
return &RNA_NandController;
case CONT_LOGIC_NOR:
return &RNA_NorController;
case CONT_LOGIC_XOR:
return &RNA_XorController;
case CONT_LOGIC_XNOR:
return &RNA_XnorController;
case CONT_EXPRESSION:
return &RNA_ExpressionController;
case CONT_PYTHON:
return &RNA_PythonController;
default:
return &RNA_Controller;
}
}
@@ -116,9 +116,9 @@ static int rna_Controller_state_number_get(struct PointerRNA *ptr)
bController *cont = (bController *)ptr->data;
int bit;
for (bit = 0; bit<32; bit++) {
if (cont->state_mask & (1<<bit))
return bit+1;
for (bit = 0; bit < 32; bit++) {
if (cont->state_mask & (1 << bit))
return bit + 1;
}
return 0;
}
@@ -150,9 +150,9 @@ static void rna_Controller_state_get(PointerRNA *ptr, int *values)
bController *cont = (bController *)ptr->data;
int i;
memset(values, 0, sizeof(int)*OB_MAX_STATES);
for (i = 0; i<OB_MAX_STATES; i++)
values[i] = (cont->state_mask & (1<<i));
memset(values, 0, sizeof(int) * OB_MAX_STATES);
for (i = 0; i < OB_MAX_STATES; i++)
values[i] = (cont->state_mask & (1 << i));
}
static void rna_Controller_state_set(PointerRNA *ptr, const int *values)
@@ -161,7 +161,7 @@ static void rna_Controller_state_set(PointerRNA *ptr, const int *values)
int i, tot = 0;
/* 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])
tot++;
@@ -169,12 +169,12 @@ static void rna_Controller_state_set(PointerRNA *ptr, const int *values)
return;
/* only works for one state at once */
if (tot>1)
if (tot > 1)
return;
for (i = 0; i<OB_MAX_STATES; i++) {
if (values[i]) cont->state_mask |= (1<<i);
else cont->state_mask &= ~(1<<i);
for (i = 0; i < OB_MAX_STATES; i++) {
if (values[i]) cont->state_mask |= (1 << i);
else cont->state_mask &= ~(1 << i);
}
}
#endif
@@ -189,7 +189,8 @@ void RNA_def_controller(BlenderRNA *brna)
static EnumPropertyItem python_controller_modes[] = {
{CONT_PY_SCRIPT, "SCRIPT", 0, "Script", ""},
{CONT_PY_MODULE, "MODULE", 0, "Module", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
/* Controller */
srna = RNA_def_struct(brna, "Controller", NULL);
@@ -265,7 +266,7 @@ void RNA_def_controller(BlenderRNA *brna)
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* 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_ui_text(srna, "Python Controller", "Controller executing a python script");

View File

@@ -44,25 +44,28 @@
#include "ED_curve.h"
EnumPropertyItem beztriple_handle_type_items[] = {
{HD_FREE, "FREE", 0, "Free", ""},
{HD_VECT, "VECTOR", 0, "Vector", ""},
{HD_ALIGN, "ALIGNED", 0, "Aligned", ""},
{HD_AUTO, "AUTO", 0, "Auto", ""},
{0, NULL, 0, NULL, NULL}};
{HD_FREE, "FREE", 0, "Free", ""},
{HD_VECT, "VECTOR", 0, "Vector", ""},
{HD_ALIGN, "ALIGNED", 0, "Aligned", ""},
{HD_AUTO, "AUTO", 0, "Auto", ""},
{0, NULL, 0, NULL, NULL}
};
EnumPropertyItem keyframe_handle_type_items[] = {
{HD_FREE, "FREE", 0, "Free", ""},
{HD_VECT, "VECTOR", 0, "Vector", ""},
{HD_ALIGN, "ALIGNED", 0, "Aligned", ""},
{HD_AUTO, "AUTO", 0, "Automatic", ""},
{HD_AUTO_ANIM, "AUTO_CLAMPED", 0, "Auto Clamped", "Auto handles clamped to not overshoot"},
{0, NULL, 0, NULL, NULL}};
{HD_FREE, "FREE", 0, "Free", ""},
{HD_VECT, "VECTOR", 0, "Vector", ""},
{HD_ALIGN, "ALIGNED", 0, "Aligned", ""},
{HD_AUTO, "AUTO", 0, "Automatic", ""},
{HD_AUTO_ANIM, "AUTO_CLAMPED", 0, "Auto Clamped", "Auto handles clamped to not overshoot"},
{0, NULL, 0, NULL, NULL}
};
EnumPropertyItem beztriple_interpolation_mode_items[] = {
{BEZT_IPO_CONST, "CONSTANT", 0, "Constant", ""},
{BEZT_IPO_LIN, "LINEAR", 0, "Linear", ""},
{BEZT_IPO_BEZ, "BEZIER", 0, "Bezier", ""},
{0, NULL, 0, NULL, NULL}};
{BEZT_IPO_CONST, "CONSTANT", 0, "Constant", ""},
{BEZT_IPO_LIN, "LINEAR", 0, "Linear", ""},
{BEZT_IPO_BEZ, "BEZIER", 0, "Bezier", ""},
{0, NULL, 0, NULL, NULL}
};
EnumPropertyItem curve_type_items[] = {
{CU_POLY, "POLY", 0, "Poly", ""},
@@ -70,21 +73,24 @@ EnumPropertyItem curve_type_items[] = {
{CU_BSPLINE, "BSPLINE", 0, "BSpline", ""},
{CU_CARDINAL, "CARDINAL", 0, "Cardinal", ""},
{CU_NURBS, "NURBS", 0, "Ease", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static const EnumPropertyItem curve3d_fill_mode_items[] = {
{0, "FULL", 0, "Full", ""},
{CU_BACK, "BACK", 0, "Back", ""},
{CU_FRONT, "FRONT", 0, "Front", ""},
{CU_FRONT|CU_BACK, "HALF", 0, "Half", ""},
{0, NULL, 0, NULL, NULL}};
{CU_FRONT | CU_BACK, "HALF", 0, "Half", ""},
{0, NULL, 0, NULL, NULL}
};
static const EnumPropertyItem curve2d_fill_mode_items[] = {
{0, "NONE", 0, "None", ""},
{CU_BACK, "BACK", 0, "Back", ""},
{CU_FRONT, "FRONT", 0, "Front", ""},
{CU_FRONT|CU_BACK, "BOTH", 0, "Both", ""},
{0, NULL, 0, NULL, NULL}};
{CU_FRONT | CU_BACK, "BOTH", 0, "Both", ""},
{0, NULL, 0, NULL, NULL}
};
#ifdef RNA_RUNTIME
@@ -128,8 +134,8 @@ static Nurb *curve_nurb_from_point(Curve *cu, const void *point, int *nu_index,
}
if (pt_index) {
if (nu->type == CU_BEZIER) *pt_index = (int)((BezTriple *)point - nu->bezt);
else *pt_index = (int)((BPoint *)point - nu->bp);
if (nu->type == CU_BEZIER) *pt_index = (int)((BezTriple *)point - nu->bezt);
else *pt_index = (int)((BPoint *)point - nu->bp);
}
}
@@ -138,7 +144,7 @@ static Nurb *curve_nurb_from_point(Curve *cu, const void *point, int *nu_index,
static StructRNA *rna_Curve_refine(PointerRNA *ptr)
{
Curve *cu = (Curve*)ptr->data;
Curve *cu = (Curve *)ptr->data;
short obtype = BKE_curve_type_get(cu);
if (obtype == OB_FONT) return &RNA_TextCurve;
@@ -148,7 +154,7 @@ static StructRNA *rna_Curve_refine(PointerRNA *ptr)
static void rna_BezTriple_handle1_get(PointerRNA *ptr, float *values)
{
BezTriple *bt = (BezTriple*)ptr->data;
BezTriple *bt = (BezTriple *)ptr->data;
values[0] = bt->vec[0][0];
values[1] = bt->vec[0][1];
@@ -157,7 +163,7 @@ static void rna_BezTriple_handle1_get(PointerRNA *ptr, float *values)
static void rna_BezTriple_handle1_set(PointerRNA *ptr, const float *values)
{
BezTriple *bt = (BezTriple*)ptr->data;
BezTriple *bt = (BezTriple *)ptr->data;
bt->vec[0][0] = values[0];
bt->vec[0][1] = values[1];
@@ -166,7 +172,7 @@ static void rna_BezTriple_handle1_set(PointerRNA *ptr, const float *values)
static void rna_BezTriple_handle2_get(PointerRNA *ptr, float *values)
{
BezTriple *bt = (BezTriple*)ptr->data;
BezTriple *bt = (BezTriple *)ptr->data;
values[0] = bt->vec[2][0];
values[1] = bt->vec[2][1];
@@ -175,7 +181,7 @@ static void rna_BezTriple_handle2_get(PointerRNA *ptr, float *values)
static void rna_BezTriple_handle2_set(PointerRNA *ptr, const float *values)
{
BezTriple *bt = (BezTriple*)ptr->data;
BezTriple *bt = (BezTriple *)ptr->data;
bt->vec[2][0] = values[0];
bt->vec[2][1] = values[1];
@@ -184,7 +190,7 @@ static void rna_BezTriple_handle2_set(PointerRNA *ptr, const float *values)
static void rna_BezTriple_ctrlpoint_get(PointerRNA *ptr, float *values)
{
BezTriple *bt = (BezTriple*)ptr->data;
BezTriple *bt = (BezTriple *)ptr->data;
values[0] = bt->vec[1][0];
values[1] = bt->vec[1][1];
@@ -193,7 +199,7 @@ static void rna_BezTriple_ctrlpoint_get(PointerRNA *ptr, float *values)
static void rna_BezTriple_ctrlpoint_set(PointerRNA *ptr, const float *values)
{
BezTriple *bt = (BezTriple*)ptr->data;
BezTriple *bt = (BezTriple *)ptr->data;
bt->vec[1][0] = values[0];
bt->vec[1][1] = values[1];
@@ -202,7 +208,7 @@ static void rna_BezTriple_ctrlpoint_set(PointerRNA *ptr, const float *values)
static void rna_Curve_texspace_set(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
Curve *cu = (Curve*)ptr->data;
Curve *cu = (Curve *)ptr->data;
if (cu->texflag & CU_AUTOSPACE)
BKE_curve_texspace_calc(cu);
@@ -210,8 +216,8 @@ static void rna_Curve_texspace_set(Main *UNUSED(bmain), Scene *UNUSED(scene), Po
static int rna_Curve_texspace_editable(PointerRNA *ptr)
{
Curve *cu = (Curve*)ptr->data;
return (cu->texflag & CU_AUTOSPACE)? 0: PROP_EDITABLE;
Curve *cu = (Curve *)ptr->data;
return (cu->texflag & CU_AUTOSPACE) ? 0 : PROP_EDITABLE;
}
static void rna_Curve_texspace_loc_get(PointerRNA *ptr, float *values)
@@ -250,24 +256,24 @@ static void rna_Curve_texspace_size_set(PointerRNA *ptr, const float *values)
static void rna_Curve_material_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax)
{
Curve *cu = (Curve*)ptr->id.data;
Curve *cu = (Curve *)ptr->id.data;
*min = 0;
*max = cu->totcol-1;
*max = cu->totcol - 1;
*max = MAX2(0, *max);
}
static void rna_Curve_active_textbox_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax)
{
Curve *cu = (Curve*)ptr->id.data;
Curve *cu = (Curve *)ptr->id.data;
*min = 0;
*max = cu->totbox-1;
*max = cu->totbox - 1;
*max = MAX2(0, *max);
}
static void rna_Curve_dimension_set(PointerRNA *ptr, int value)
{
Curve *cu = (Curve*)ptr->id.data;
Curve *cu = (Curve *)ptr->id.data;
if (value == CU_3D) cu->flag |= CU_3D;
else cu->flag &= ~CU_3D;
@@ -277,7 +283,7 @@ static void rna_Curve_dimension_set(PointerRNA *ptr, int value)
static EnumPropertyItem *rna_Curve_fill_mode_itemf(bContext *UNUSED(C), PointerRNA *ptr,
PropertyRNA *UNUSED(prop), int *UNUSED(free))
{
Curve *cu = (Curve*)ptr->id.data;
Curve *cu = (Curve *)ptr->id.data;
/* cast to quiet warning it IS a const still */
return (EnumPropertyItem *)((cu->flag & CU_3D) ? curve3d_fill_mode_items : curve2d_fill_mode_items);
@@ -285,28 +291,28 @@ static EnumPropertyItem *rna_Curve_fill_mode_itemf(bContext *UNUSED(C), PointerR
static int rna_Nurb_length(PointerRNA *ptr)
{
Nurb *nu = (Nurb*)ptr->data;
Nurb *nu = (Nurb *)ptr->data;
if (nu->type == CU_BEZIER) return 0;
return nu->pntsv>0 ? nu->pntsu*nu->pntsv : nu->pntsu;
return nu->pntsv > 0 ? nu->pntsu * nu->pntsv : nu->pntsu;
}
static void rna_Nurb_type_set(PointerRNA *ptr, int value)
{
Nurb *nu = (Nurb*)ptr->data;
Nurb *nu = (Nurb *)ptr->data;
ED_nurb_set_spline_type(nu, value);
}
static void rna_BPoint_array_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
Nurb *nu = (Nurb*)ptr->data;
rna_iterator_array_begin(iter, (void*)nu->bp, sizeof(BPoint),
nu->pntsv > 0 ? nu->pntsu*nu->pntsv : nu->pntsu, 0, NULL);
Nurb *nu = (Nurb *)ptr->data;
rna_iterator_array_begin(iter, (void *)nu->bp, sizeof(BPoint),
nu->pntsv > 0 ? nu->pntsu * nu->pntsv : nu->pntsu, 0, NULL);
}
static void rna_Curve_update_data_id(Main *UNUSED(bmain), Scene *UNUSED(scene), ID *id)
{
DAG_id_tag_update(id, 0);
WM_main_add_notifier(NC_GEOM|ND_DATA, id);
WM_main_add_notifier(NC_GEOM | ND_DATA, id);
}
static void rna_Curve_update_data(Main *bmain, Scene *scene, PointerRNA *ptr)
@@ -322,7 +328,7 @@ static void rna_Curve_update_deps(Main *bmain, Scene *scene, PointerRNA *ptr)
static void rna_Curve_update_points(Main *bmain, Scene *scene, PointerRNA *ptr)
{
Curve *cu = (Curve*)ptr->id.data;
Curve *cu = (Curve *)ptr->id.data;
Nurb *nu = curve_nurb_from_point(cu, ptr->data, NULL, NULL);
if (nu)
@@ -333,7 +339,7 @@ static void rna_Curve_update_points(Main *bmain, Scene *scene, PointerRNA *ptr)
static PointerRNA rna_Curve_bevelObject_get(PointerRNA *ptr)
{
Curve *cu = (Curve*)ptr->id.data;
Curve *cu = (Curve *)ptr->id.data;
Object *ob = cu->bevobj;
if (ob)
@@ -344,8 +350,8 @@ static PointerRNA rna_Curve_bevelObject_get(PointerRNA *ptr)
static void rna_Curve_bevelObject_set(PointerRNA *ptr, PointerRNA value)
{
Curve *cu = (Curve*)ptr->id.data;
Object *ob = (Object*)value.data;
Curve *cu = (Curve *)ptr->id.data;
Object *ob = (Object *)value.data;
if (ob) {
/* if bevel object has got the save curve, as object, for which it's */
@@ -361,8 +367,8 @@ static void rna_Curve_bevelObject_set(PointerRNA *ptr, PointerRNA value)
static int rna_Curve_otherObject_poll(PointerRNA *ptr, PointerRNA value)
{
Curve *cu = (Curve*)ptr->id.data;
Object *ob = (Object*)value.data;
Curve *cu = (Curve *)ptr->id.data;
Object *ob = (Object *)value.data;
if (ob) {
if (ob->type == OB_CURVE && ob->data != cu) {
@@ -375,7 +381,7 @@ static int rna_Curve_otherObject_poll(PointerRNA *ptr, PointerRNA value)
static PointerRNA rna_Curve_taperObject_get(PointerRNA *ptr)
{
Curve *cu = (Curve*)ptr->id.data;
Curve *cu = (Curve *)ptr->id.data;
Object *ob = cu->taperobj;
if (ob)
@@ -386,8 +392,8 @@ static PointerRNA rna_Curve_taperObject_get(PointerRNA *ptr)
static void rna_Curve_taperObject_set(PointerRNA *ptr, PointerRNA value)
{
Curve *cu = (Curve*)ptr->id.data;
Object *ob = (Object*)value.data;
Curve *cu = (Curve *)ptr->id.data;
Object *ob = (Object *)value.data;
if (ob) {
/* if taper object has got the save curve, as object, for which it's */
@@ -403,7 +409,7 @@ static void rna_Curve_taperObject_set(PointerRNA *ptr, PointerRNA value)
static void rna_Curve_resolution_u_update_data(Main *bmain, Scene *scene, PointerRNA *ptr)
{
Curve *cu = (Curve*)ptr->id.data;
Curve *cu = (Curve *)ptr->id.data;
ListBase *nurbs = BKE_curve_nurbs_get(cu);
Nurb *nu = nurbs->first;
@@ -417,7 +423,7 @@ static void rna_Curve_resolution_u_update_data(Main *bmain, Scene *scene, Pointe
static void rna_Curve_resolution_v_update_data(Main *bmain, Scene *scene, PointerRNA *ptr)
{
Curve *cu = (Curve*)ptr->id.data;
Curve *cu = (Curve *)ptr->id.data;
ListBase *nurbs = BKE_curve_nurbs_get(cu);
Nurb *nu = nurbs->first;
@@ -432,26 +438,26 @@ static void rna_Curve_resolution_v_update_data(Main *bmain, Scene *scene, Pointe
static float rna_Curve_offset_get(PointerRNA *ptr)
{
Curve *cu = (Curve*)ptr->id.data;
Curve *cu = (Curve *)ptr->id.data;
return cu->width - 1.0f;
}
static void rna_Curve_offset_set(PointerRNA *ptr, float value)
{
Curve *cu = (Curve*)ptr->id.data;
Curve *cu = (Curve *)ptr->id.data;
cu->width = 1.0f + value;
}
/* name functions that ignore the first two ID characters */
void rna_Curve_body_get(PointerRNA *ptr, char *value)
{
Curve *cu = (Curve*)ptr->id.data;
BLI_strncpy(value, cu->str, cu->len+1);
Curve *cu = (Curve *)ptr->id.data;
BLI_strncpy(value, cu->str, cu->len + 1);
}
int rna_Curve_body_length(PointerRNA *ptr)
{
Curve *cu = (Curve*)ptr->id.data;
Curve *cu = (Curve *)ptr->id.data;
return cu->len;
}
@@ -459,7 +465,7 @@ int rna_Curve_body_length(PointerRNA *ptr)
void rna_Curve_body_set(PointerRNA *ptr, const char *value)
{
int len = strlen(value);
Curve *cu = (Curve*)ptr->id.data;
Curve *cu = (Curve *)ptr->id.data;
cu->len = cu->pos = len;
@@ -470,15 +476,15 @@ void rna_Curve_body_set(PointerRNA *ptr, const char *value)
cu->str = MEM_callocN(len + sizeof(wchar_t), "str");
/* don't know why this is +4, just duplicating load_editText() */
cu->strinfo = MEM_callocN((len+4) *sizeof(CharInfo), "strinfo");
cu->strinfo = MEM_callocN((len + 4) * sizeof(CharInfo), "strinfo");
/*BLI_strncpy_wchar_as_utf8(cu->str, value, len+1); *//* value is not wchar_t */
BLI_strncpy(cu->str, value, len+1);
BLI_strncpy(cu->str, value, len + 1);
}
static void rna_Nurb_update_cyclic_u(Main *bmain, Scene *scene, PointerRNA *ptr)
{
Nurb *nu = (Nurb*)ptr->data;
Nurb *nu = (Nurb *)ptr->data;
if (nu->type == CU_BEZIER) {
BKE_nurb_handles_calc(nu);
@@ -492,7 +498,7 @@ static void rna_Nurb_update_cyclic_u(Main *bmain, Scene *scene, PointerRNA *ptr)
static void rna_Nurb_update_cyclic_v(Main *bmain, Scene *scene, PointerRNA *ptr)
{
Nurb *nu = (Nurb*)ptr->data;
Nurb *nu = (Nurb *)ptr->data;
BKE_nurb_knot_calc_v(nu);
@@ -501,7 +507,7 @@ static void rna_Nurb_update_cyclic_v(Main *bmain, Scene *scene, PointerRNA *ptr)
static void rna_Nurb_update_knot_u(Main *bmain, Scene *scene, PointerRNA *ptr)
{
Nurb *nu = (Nurb*)ptr->data;
Nurb *nu = (Nurb *)ptr->data;
BKE_nurb_order_clamp_u(nu);
BKE_nurb_knot_calc_u(nu);
@@ -511,7 +517,7 @@ static void rna_Nurb_update_knot_u(Main *bmain, Scene *scene, PointerRNA *ptr)
static void rna_Nurb_update_knot_v(Main *bmain, Scene *scene, PointerRNA *ptr)
{
Nurb *nu = (Nurb*)ptr->data;
Nurb *nu = (Nurb *)ptr->data;
BKE_nurb_order_clamp_v(nu);
BKE_nurb_knot_calc_v(nu);
@@ -558,7 +564,7 @@ static void rna_Curve_spline_bezpoints_add(ID *id, Nurb *nu, ReportList *reports
static Nurb *rna_Curve_spline_new(Curve *cu, int type)
{
Nurb *nu = (Nurb *) MEM_callocN(sizeof( Nurb ), "spline.new" );
Nurb *nu = (Nurb *) MEM_callocN(sizeof(Nurb), "spline.new");
if (type == CU_BEZIER) {
BezTriple *bezt = (BezTriple *)MEM_callocN(sizeof(BezTriple), "spline.new.bezt");
@@ -592,7 +598,7 @@ static void rna_Curve_spline_remove(Curve *cu, ReportList *reports, Nurb *nu)
found = BLI_remlink_safe(nurbs, nu);
if (!found) {
BKE_reportf(reports, RPT_ERROR, "Curve \"%s\" does not contain spline given", cu->id.name+2);
BKE_reportf(reports, RPT_ERROR, "Curve \"%s\" does not contain spline given", cu->id.name + 2);
return;
}
@@ -600,7 +606,7 @@ static void rna_Curve_spline_remove(Curve *cu, ReportList *reports, Nurb *nu)
/* invalidate pointer!, no can do */
DAG_id_tag_update(&cu->id, OB_RECALC_DATA);
WM_main_add_notifier(NC_GEOM|ND_DATA, NULL);
WM_main_add_notifier(NC_GEOM | ND_DATA, NULL);
}
static void rna_Curve_spline_clear(Curve *cu)
@@ -610,12 +616,12 @@ static void rna_Curve_spline_clear(Curve *cu)
BKE_nurbList_free(nurbs);
DAG_id_tag_update(&cu->id, OB_RECALC_DATA);
WM_main_add_notifier(NC_GEOM|ND_DATA, NULL);
WM_main_add_notifier(NC_GEOM | ND_DATA, NULL);
}
static PointerRNA rna_Curve_active_spline_get(PointerRNA *ptr)
{
Curve *cu = (Curve*)ptr->data;
Curve *cu = (Curve *)ptr->data;
Nurb *nu;
ListBase *nurbs = BKE_curve_nurbs_get(cu);
@@ -630,7 +636,7 @@ static PointerRNA rna_Curve_active_spline_get(PointerRNA *ptr)
static void rna_Curve_active_spline_set(PointerRNA *ptr, PointerRNA value)
{
Curve *cu = (Curve*)ptr->data;
Curve *cu = (Curve *)ptr->data;
Nurb *nu = value.data;
ListBase *nubase = BKE_curve_nurbs_get(cu);
@@ -643,7 +649,7 @@ static void rna_Curve_active_spline_set(PointerRNA *ptr, PointerRNA value)
static char *rna_Curve_spline_path(PointerRNA *ptr)
{
Curve *cu = (Curve*)ptr->id.data;
Curve *cu = (Curve *)ptr->id.data;
ListBase *nubase = BKE_curve_nurbs_get(cu);
Nurb *nu = ptr->data;
int index = BLI_findindex(nubase, nu);
@@ -657,7 +663,7 @@ static char *rna_Curve_spline_path(PointerRNA *ptr)
/* use for both bezier and nurbs */
static char *rna_Curve_spline_point_path(PointerRNA *ptr)
{
Curve *cu = (Curve*)ptr->id.data;
Curve *cu = (Curve *)ptr->id.data;
Nurb *nu;
void *point = ptr->data;
int nu_index, pt_index;
@@ -680,7 +686,7 @@ static char *rna_Curve_spline_point_path(PointerRNA *ptr)
static char *rna_TextBox_path(PointerRNA *ptr)
{
Curve *cu = (Curve*)ptr->id.data;
Curve *cu = (Curve *)ptr->id.data;
TextBox *tb = ptr->data;
int index = (int)(tb - cu->tb);
@@ -692,7 +698,7 @@ static char *rna_TextBox_path(PointerRNA *ptr)
static void rna_Curve_splines_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
Curve *cu = (Curve*)ptr->id.data;
Curve *cu = (Curve *)ptr->id.data;
rna_iterator_listbase_begin(iter, BKE_curve_nurbs_get(cu), NULL);
}
@@ -909,7 +915,8 @@ static void rna_def_font(BlenderRNA *brna, StructRNA *srna)
{CU_RIGHT, "RIGHT", 0, "Right", "Align text to the right"},
{CU_JUSTIFY, "JUSTIFY", 0, "Justify", "Align to the left and the right"},
{CU_FLUSH, "FLUSH", 0, "Flush", "Align to the left and the right, with equal character spacing"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
/* Enums */
prop = RNA_def_property(srna, "align", PROP_ENUM, PROP_NONE);
@@ -992,7 +999,7 @@ static void rna_def_font(BlenderRNA *brna, StructRNA *srna)
/* strings */
prop = RNA_def_property(srna, "family", PROP_STRING, PROP_NONE);
RNA_def_property_string_maxlength(prop, MAX_ID_NAME-2);
RNA_def_property_string_maxlength(prop, MAX_ID_NAME - 2);
RNA_def_property_ui_text(prop, "Object Font",
"Use Blender Objects as font characters (give font objects a common name "
"followed by the character they represent, eg. familya, familyb, etc, "
@@ -1117,10 +1124,12 @@ static void rna_def_charinfo(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
/* probably there is no reason to expose this */
/* prop= RNA_def_property(srna, "wrap", PROP_BOOLEAN, PROP_NONE);
#if 0
prop= RNA_def_property(srna, "wrap", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_CHINFO_WRAP);
RNA_def_property_ui_text(prop, "Wrap", "");
RNA_def_property_update(prop, 0, "rna_Curve_update_data"); */
#endif
prop = RNA_def_property(srna, "use_small_caps", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_CHINFO_SMALLCAPS);
@@ -1170,16 +1179,16 @@ static void rna_def_curve_spline_points(BlenderRNA *brna, PropertyRNA *cprop)
func = RNA_def_function(srna, "add", "rna_Curve_spline_points_add");
RNA_def_function_ui_description(func, "Add a number of points to this spline");
RNA_def_function_flag(func, FUNC_USE_SELF_ID|FUNC_USE_REPORTS);
RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_USE_REPORTS);
RNA_def_int(func, "count", 1, 1, INT_MAX, "Number", "Number of points to add to the spline", 1, INT_MAX);
/*
#if 0
func= RNA_def_function(srna, "remove", "rna_Curve_spline_remove");
RNA_def_function_ui_description(func, "Remove a spline from a curve");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
parm= RNA_def_pointer(func, "spline", "Spline", "", "The spline to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
*/
#endif
}
static void rna_def_curve_spline_bezpoints(BlenderRNA *brna, PropertyRNA *cprop)
@@ -1197,15 +1206,15 @@ static void rna_def_curve_spline_bezpoints(BlenderRNA *brna, PropertyRNA *cprop)
func = RNA_def_function(srna, "add", "rna_Curve_spline_bezpoints_add");
RNA_def_function_ui_description(func, "Add a number of points to this spline");
RNA_def_function_flag(func, FUNC_USE_SELF_ID|FUNC_USE_REPORTS);
RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_USE_REPORTS);
RNA_def_int(func, "count", 1, INT_MIN, INT_MAX, "Number", "Number of points to add to the spline", 0, INT_MAX);
#if 0
func= RNA_def_function(srna, "remove", "rna_Curve_spline_remove");
func = RNA_def_function(srna, "remove", "rna_Curve_spline_remove");
RNA_def_function_ui_description(func, "Remove a spline from a curve");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
parm= RNA_def_pointer(func, "spline", "Spline", "", "The spline to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
parm = RNA_def_pointer(func, "spline", "Spline", "", "The spline to remove");
RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL);
#endif
}
@@ -1234,7 +1243,7 @@ static void rna_def_curve_splines(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_ui_description(func, "Remove a spline from a curve");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
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);
func = RNA_def_function(srna, "clear", "rna_Curve_spline_clear");
RNA_def_function_ui_description(func, "Remove all spline from a curve");
@@ -1246,7 +1255,7 @@ static void rna_def_curve_splines(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_property_ui_text(prop, "Active Spline", "Active curve spline");
/* Could call: ED_base_object_activate(C, scene->basact);
* but would be a bad level call and it seems the notifier is enough */
RNA_def_property_update(prop, NC_SCENE|ND_OB_ACTIVE, NULL);
RNA_def_property_update(prop, NC_SCENE | ND_OB_ACTIVE, NULL);
}
@@ -1256,16 +1265,18 @@ static void rna_def_curve(BlenderRNA *brna)
PropertyRNA *prop;
static EnumPropertyItem curve_twist_mode_items[] = {
{CU_TWIST_Z_UP, "Z_UP", 0, "Z-Up", "Use Z-Up axis to calculate the curve twist at each point"},
{CU_TWIST_MINIMUM, "MINIMUM", 0, "Minimum", "Use the least twist over the entire curve"},
{CU_TWIST_TANGENT, "TANGENT", 0, "Tangent", "Use the tangent to calculate twist"},
{0, NULL, 0, NULL, NULL}};
{CU_TWIST_Z_UP, "Z_UP", 0, "Z-Up", "Use Z-Up axis to calculate the curve twist at each point"},
{CU_TWIST_MINIMUM, "MINIMUM", 0, "Minimum", "Use the least twist over the entire curve"},
{CU_TWIST_TANGENT, "TANGENT", 0, "Tangent", "Use the tangent to calculate twist"},
{0, NULL, 0, NULL, NULL}
};
static const EnumPropertyItem curve_axis_items[] = {
{0, "2D", 0, "2D", "Clamp the Z axis of the curve"},
{CU_3D, "3D", 0, "3D",
"Allow editing on the Z axis of this curve, also allows tilt and curve radius to be used"},
{0, NULL, 0, NULL, NULL}};
"Allow editing on the Z axis of this curve, also allows tilt and curve radius to be used"},
{0, NULL, 0, NULL, NULL}
};
srna = RNA_def_struct(brna, "Curve", "ID");
RNA_def_struct_ui_text(srna, "Curve", "Curve datablock storing curves, splines and NURBS");
@@ -1295,12 +1306,12 @@ static void rna_def_curve(BlenderRNA *brna)
prop = RNA_def_property(srna, "show_handles", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "drawflag", CU_HIDE_HANDLES);
RNA_def_property_ui_text(prop, "Draw Handles", "Display Bezier handles in editmode");
RNA_def_property_update(prop, NC_GEOM|ND_DATA, NULL);
RNA_def_property_update(prop, NC_GEOM | ND_DATA, NULL);
prop = RNA_def_property(srna, "show_normal_face", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "drawflag", CU_HIDE_NORMALS);
RNA_def_property_ui_text(prop, "Draw Normals", "Display 3D curve normals in editmode");
RNA_def_property_update(prop, NC_GEOM|ND_DATA, NULL);
RNA_def_property_update(prop, NC_GEOM | ND_DATA, NULL);
rna_def_path(brna, srna);
@@ -1313,21 +1324,21 @@ static void rna_def_curve(BlenderRNA *brna)
"Bevel resolution when depth is non-zero and no specific bevel object has been defined");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
prop = RNA_def_property(srna, "offset", PROP_FLOAT, PROP_NONE|PROP_UNIT_LENGTH);
prop = RNA_def_property(srna, "offset", PROP_FLOAT, PROP_NONE | PROP_UNIT_LENGTH);
RNA_def_property_float_sdna(prop, NULL, "width");
RNA_def_property_ui_range(prop, -1.0, 1.0, 0.1, 3);
RNA_def_property_float_funcs(prop, "rna_Curve_offset_get", "rna_Curve_offset_set", NULL);
RNA_def_property_ui_text(prop, "Offset", "Offset the curve to adjust the width of a text");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
prop = RNA_def_property(srna, "extrude", PROP_FLOAT, PROP_NONE|PROP_UNIT_LENGTH);
prop = RNA_def_property(srna, "extrude", PROP_FLOAT, PROP_NONE | PROP_UNIT_LENGTH);
RNA_def_property_float_sdna(prop, NULL, "ext1");
RNA_def_property_ui_range(prop, 0, 100.0, 0.1, 3);
RNA_def_property_range(prop, 0.0, FLT_MAX);
RNA_def_property_ui_text(prop, "Extrude", "Amount of curve extrusion when not using a bevel object");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
prop = RNA_def_property(srna, "bevel_depth", PROP_FLOAT, PROP_NONE|PROP_UNIT_LENGTH);
prop = RNA_def_property(srna, "bevel_depth", PROP_FLOAT, PROP_NONE | PROP_UNIT_LENGTH);
RNA_def_property_float_sdna(prop, NULL, "ext2");
RNA_def_property_ui_range(prop, 0, 100.0, 0.1, 3);
RNA_def_property_ui_text(prop, "Bevel Depth", "Bevel depth when not using a bevel object");
@@ -1432,7 +1443,7 @@ static void rna_def_curve(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "texflag", CU_AUTOSPACE);
RNA_def_property_ui_text(prop, "Auto Texture Space",
"Adjust active object's texture space automatically when transforming object");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Curve_texspace_set");
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Curve_texspace_set");
prop = RNA_def_property(srna, "texspace_location", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_array(prop, 3);
@@ -1451,7 +1462,7 @@ static void rna_def_curve(BlenderRNA *brna)
/* not supported yet */
#if 0
prop= RNA_def_property(srna, "texspace_rot", PROP_FLOAT, PROP_EULER);
prop = RNA_def_property(srna, "texspace_rot", PROP_FLOAT, PROP_EULER);
RNA_def_property_float(prop, NULL, "rot");
RNA_def_property_ui_text(prop, "Texture Space Rotation", "Texture space rotation");
RNA_def_property_editable_func(prop, texspace_editable);
@@ -1491,7 +1502,8 @@ static void rna_def_curve_nurb(BlenderRNA *brna)
{KEY_CARDINAL, "CARDINAL", 0, "Cardinal", ""},
{KEY_BSPLINE, "BSPLINE", 0, "BSpline", ""},
{KEY_CU_EASE, "EASE", 0, "Ease", ""}, /* todo, define somewhere, not one of BEZT_IPO_* */
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
StructRNA *srna;
PropertyRNA *prop;

View File

@@ -51,8 +51,8 @@ BlenderDefRNA DefRNA = {NULL, {NULL, NULL}, {NULL, NULL}, NULL, 0, 0, 0, 1};
/* Duplicated code since we can't link in blenkernel or blenlib */
#ifndef MIN2
#define MIN2(x,y) ((x)<(y)? (x): (y))
#define MAX2(x,y) ((x)>(y)? (x): (y))
#define MIN2(x, y) ((x) < (y) ? (x) : (y))
#define MAX2(x, y) ((x) > (y) ? (x) : (y))
#endif
/* pedantic check for '.', do this since its a hassle for translators */
@@ -268,11 +268,11 @@ static ContainerDefRNA *rna_find_container_def(ContainerRNA *cont)
return NULL;
}
ds = rna_find_struct_def((StructRNA*)cont);
ds = rna_find_struct_def((StructRNA *)cont);
if (ds)
return &ds->cont;
dfunc = rna_find_function_def((FunctionRNA*)cont);
dfunc = rna_find_function_def((FunctionRNA *)cont);
if (dfunc)
return &dfunc->cont;
@@ -293,20 +293,20 @@ static int rna_member_cmp(const char *name, const char *oname)
int a = 0;
/* compare without pointer or array part */
while (name[0] =='*')
while (name[0] == '*')
name++;
while (oname[0] =='*')
while (oname[0] == '*')
oname++;
while (1) {
if (name[a] =='[' && oname[a] == 0) return 1;
if (name[a] =='[' && oname[a] =='[') return 1;
if (name[a] == '[' && oname[a] == 0) return 1;
if (name[a] == '[' && oname[a] == '[') return 1;
if (name[a] == 0) break;
if (name[a] != oname[a]) return 0;
a++;
}
if (name[a] == 0 && oname[a] == '.') return 2;
if (name[a] == 0 && oname[a] == '-' && oname[a+1] == '>') return 3;
if (name[a] == 0 && oname[a] == '-' && oname[a + 1] == '>') return 3;
return (name[a] == oname[a]);
}
@@ -325,7 +325,7 @@ static int rna_find_sdna_member(SDNA *sdna, const char *structname, const char *
totmember = sp[1];
sp += 2;
for (a = 0; a<totmember; a++, sp += 2) {
for (a = 0; a < totmember; a++, sp += 2) {
dnaname = sdna->names[sp[1]];
cmp = rna_member_cmp(dnaname, membername);
@@ -400,11 +400,11 @@ static int rna_validate_identifier(const char *identifier, char *error, int prop
}
}
if (identifier[a] =='_') {
if (identifier[a] == '_') {
continue;
}
if (identifier[a] ==' ') {
if (identifier[a] == ' ') {
strcpy(error, "spaces are not okay in identifier names");
return 0;
}
@@ -492,9 +492,9 @@ void RNA_define_verify_sdna(int verify)
void RNA_struct_free_extension(StructRNA *srna, ExtensionRNA *ext)
{
#ifdef RNA_RUNTIME
ext->free(ext->data); /* decref's the PyObject that the srna owns */
RNA_struct_blender_type_set(srna, NULL); /* this gets accessed again - XXX fixme */
RNA_struct_py_type_set(srna, NULL); /* NULL the srna's value so RNA_struct_free wont complain of a leak */
ext->free(ext->data); /* decref's the PyObject that the srna owns */
RNA_struct_blender_type_set(srna, NULL); /* this gets accessed again - XXX fixme */
RNA_struct_py_type_set(srna, NULL); /* NULL the srna's value so RNA_struct_free wont complain of a leak */
#endif
}
@@ -505,12 +505,13 @@ void RNA_struct_free(BlenderRNA *brna, StructRNA *srna)
PropertyRNA *prop, *nextprop;
PropertyRNA *parm, *nextparm;
/*
#if 0
if (srna->flag & STRUCT_RUNTIME) {
if (RNA_struct_py_type_get(srna)) {
fprintf(stderr, "%s '%s' freed while holding a python reference\n", __func__, srna->identifier);
}
} */
}
#endif
for (prop = srna->cont.properties.first; prop; prop = nextprop) {
nextprop = prop->next;
@@ -691,7 +692,7 @@ StructRNA *RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *
}
else {
#ifdef RNA_RUNTIME
CollectionPropertyRNA *cprop = (CollectionPropertyRNA*)prop;
CollectionPropertyRNA *cprop = (CollectionPropertyRNA *)prop;
cprop->begin = rna_builtin_properties_begin;
cprop->next = rna_builtin_properties_next;
cprop->get = rna_builtin_properties_get;
@@ -709,7 +710,7 @@ StructRNA *RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *
}
else {
#ifdef RNA_RUNTIME
PointerPropertyRNA *pprop = (PointerPropertyRNA*)prop;
PointerPropertyRNA *pprop = (PointerPropertyRNA *)prop;
pprop->get = rna_builtin_type_get;
pprop->type = &RNA_Struct;
#endif
@@ -920,20 +921,20 @@ PropertyRNA *RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier
}
break;
case PROP_INT: {
IntPropertyRNA *iprop = (IntPropertyRNA*)prop;
IntPropertyRNA *iprop = (IntPropertyRNA *)prop;
iprop->hardmin = (subtype == PROP_UNSIGNED)? 0: INT_MIN;
iprop->hardmin = (subtype == PROP_UNSIGNED) ? 0 : INT_MIN;
iprop->hardmax = INT_MAX;
iprop->softmin = (subtype == PROP_UNSIGNED)? 0: -10000; /* rather arbitrary .. */
iprop->softmin = (subtype == PROP_UNSIGNED) ? 0 : -10000; /* rather arbitrary .. */
iprop->softmax = 10000;
iprop->step = 1;
break;
}
case PROP_FLOAT: {
FloatPropertyRNA *fprop = (FloatPropertyRNA*)prop;
FloatPropertyRNA *fprop = (FloatPropertyRNA *)prop;
fprop->hardmin = (subtype == PROP_UNSIGNED)? 0.0f: -FLT_MAX;
fprop->hardmin = (subtype == PROP_UNSIGNED) ? 0.0f : -FLT_MAX;
fprop->hardmax = FLT_MAX;
if (ELEM(subtype, PROP_COLOR, PROP_COLOR_GAMMA)) {
@@ -945,7 +946,7 @@ PropertyRNA *RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier
fprop->softmax = fprop->hardmax = 1.0f;
}
else {
fprop->softmin = (subtype == PROP_UNSIGNED)? 0.0f: -10000.0f; /* rather arbitrary .. */
fprop->softmin = (subtype == PROP_UNSIGNED) ? 0.0f : -10000.0f; /* rather arbitrary .. */
fprop->softmax = 10000.0f;
}
fprop->step = 10;
@@ -953,7 +954,7 @@ PropertyRNA *RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier
break;
}
case PROP_STRING: {
StringPropertyRNA *sprop = (StringPropertyRNA*)prop;
StringPropertyRNA *sprop = (StringPropertyRNA *)prop;
sprop->defaultvalue = "";
break;
@@ -1038,10 +1039,10 @@ PropertyRNA *RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier
}
}
else {
prop->flag |= PROP_IDPROPERTY|PROP_RUNTIME;
prop->flag |= PROP_IDPROPERTY | PROP_RUNTIME;
#ifdef RNA_RUNTIME
if (cont->prophash)
BLI_ghash_insert(cont->prophash, (void*)prop->identifier, prop);
BLI_ghash_insert(cont->prophash, (void *)prop->identifier, prop);
#endif
}
@@ -1069,14 +1070,14 @@ void RNA_def_property_array(PropertyRNA *prop, int length)
{
StructRNA *srna = DefRNA.laststruct;
if (length<0) {
if (length < 0) {
fprintf(stderr, "%s: \"%s.%s\", array length must be zero of greater.\n", __func__,
srna->identifier, prop->identifier);
DefRNA.error = 1;
return;
}
if (length>RNA_MAX_ARRAY_LENGTH) {
if (length > RNA_MAX_ARRAY_LENGTH) {
fprintf(stderr, "%s: \"%s.%s\", array length must be smaller than %d.\n", __func__,
srna->identifier, prop->identifier, RNA_MAX_ARRAY_LENGTH);
DefRNA.error = 1;
@@ -1134,10 +1135,10 @@ void RNA_def_property_multi_array(PropertyRNA *prop, int dimension, const int le
prop->totarraylength = 0;
if (length) {
memcpy(prop->arraylength, length, sizeof(int)*dimension);
memcpy(prop->arraylength, length, sizeof(int) * dimension);
prop->totarraylength = length[0];
for (i = 1; i<dimension; i++)
for (i = 1; i < dimension; i++)
prop->totarraylength *= length[i];
}
else
@@ -1167,14 +1168,14 @@ void RNA_def_property_ui_range(PropertyRNA *prop, double min, double max, double
switch (prop->type) {
case PROP_INT: {
IntPropertyRNA *iprop = (IntPropertyRNA*)prop;
IntPropertyRNA *iprop = (IntPropertyRNA *)prop;
iprop->softmin = (int)min;
iprop->softmax = (int)max;
iprop->step = (int)step;
break;
}
case PROP_FLOAT: {
FloatPropertyRNA *fprop = (FloatPropertyRNA*)prop;
FloatPropertyRNA *fprop = (FloatPropertyRNA *)prop;
fprop->softmin = (float)min;
fprop->softmax = (float)max;
fprop->step = (float)step;
@@ -1195,7 +1196,7 @@ void RNA_def_property_range(PropertyRNA *prop, double min, double max)
switch (prop->type) {
case PROP_INT: {
IntPropertyRNA *iprop = (IntPropertyRNA*)prop;
IntPropertyRNA *iprop = (IntPropertyRNA *)prop;
iprop->hardmin = (int)min;
iprop->hardmax = (int)max;
iprop->softmin = MAX2((int)min, iprop->hardmin);
@@ -1203,7 +1204,7 @@ void RNA_def_property_range(PropertyRNA *prop, double min, double max)
break;
}
case PROP_FLOAT: {
FloatPropertyRNA *fprop = (FloatPropertyRNA*)prop;
FloatPropertyRNA *fprop = (FloatPropertyRNA *)prop;
fprop->hardmin = (float)min;
fprop->hardmax = (float)max;
fprop->softmin = MAX2((float)min, fprop->hardmin);
@@ -1228,13 +1229,13 @@ void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
switch (prop->type) {
case PROP_POINTER: {
PointerPropertyRNA *pprop = (PointerPropertyRNA*)prop;
pprop->type = (StructRNA*)type;
PointerPropertyRNA *pprop = (PointerPropertyRNA *)prop;
pprop->type = (StructRNA *)type;
break;
}
case PROP_COLLECTION: {
CollectionPropertyRNA *cprop = (CollectionPropertyRNA*)prop;
cprop->item_type = (StructRNA*)type;
CollectionPropertyRNA *cprop = (CollectionPropertyRNA *)prop;
cprop->item_type = (StructRNA *)type;
break;
}
default:
@@ -1256,7 +1257,7 @@ void RNA_def_property_struct_runtime(PropertyRNA *prop, StructRNA *type)
switch (prop->type) {
case PROP_POINTER: {
PointerPropertyRNA *pprop = (PointerPropertyRNA*)prop;
PointerPropertyRNA *pprop = (PointerPropertyRNA *)prop;
pprop->type = type;
if (type && (type->flag & STRUCT_ID_REFCOUNT))
@@ -1265,7 +1266,7 @@ void RNA_def_property_struct_runtime(PropertyRNA *prop, StructRNA *type)
break;
}
case PROP_COLLECTION: {
CollectionPropertyRNA *cprop = (CollectionPropertyRNA*)prop;
CollectionPropertyRNA *cprop = (CollectionPropertyRNA *)prop;
cprop->item_type = type;
break;
}
@@ -1284,8 +1285,8 @@ void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item
switch (prop->type) {
case PROP_ENUM: {
EnumPropertyRNA *eprop = (EnumPropertyRNA*)prop;
eprop->item = (EnumPropertyItem*)item;
EnumPropertyRNA *eprop = (EnumPropertyRNA *)prop;
eprop->item = (EnumPropertyItem *)item;
eprop->totitem = 0;
for (i = 0; item[i].identifier; i++) {
eprop->totitem++;
@@ -1319,7 +1320,7 @@ void RNA_def_property_string_maxlength(PropertyRNA *prop, int maxlength)
switch (prop->type) {
case PROP_STRING: {
StringPropertyRNA *sprop = (StringPropertyRNA*)prop;
StringPropertyRNA *sprop = (StringPropertyRNA *)prop;
sprop->maxlength = maxlength;
break;
}
@@ -1336,7 +1337,7 @@ void RNA_def_property_boolean_default(PropertyRNA *prop, int value)
switch (prop->type) {
case PROP_BOOLEAN: {
BoolPropertyRNA *bprop = (BoolPropertyRNA*)prop;
BoolPropertyRNA *bprop = (BoolPropertyRNA *)prop;
bprop->defaultvalue = value;
break;
}
@@ -1353,7 +1354,7 @@ void RNA_def_property_boolean_array_default(PropertyRNA *prop, const int *array)
switch (prop->type) {
case PROP_BOOLEAN: {
BoolPropertyRNA *bprop = (BoolPropertyRNA*)prop;
BoolPropertyRNA *bprop = (BoolPropertyRNA *)prop;
bprop->defaultarray = array;
break;
}
@@ -1370,7 +1371,7 @@ void RNA_def_property_int_default(PropertyRNA *prop, int value)
switch (prop->type) {
case PROP_INT: {
IntPropertyRNA *iprop = (IntPropertyRNA*)prop;
IntPropertyRNA *iprop = (IntPropertyRNA *)prop;
iprop->defaultvalue = value;
break;
}
@@ -1387,7 +1388,7 @@ void RNA_def_property_int_array_default(PropertyRNA *prop, const int *array)
switch (prop->type) {
case PROP_INT: {
IntPropertyRNA *iprop = (IntPropertyRNA*)prop;
IntPropertyRNA *iprop = (IntPropertyRNA *)prop;
iprop->defaultarray = array;
break;
}
@@ -1404,7 +1405,7 @@ void RNA_def_property_float_default(PropertyRNA *prop, float value)
switch (prop->type) {
case PROP_FLOAT: {
FloatPropertyRNA *fprop = (FloatPropertyRNA*)prop;
FloatPropertyRNA *fprop = (FloatPropertyRNA *)prop;
fprop->defaultvalue = value;
break;
}
@@ -1421,7 +1422,7 @@ void RNA_def_property_float_array_default(PropertyRNA *prop, const float *array)
switch (prop->type) {
case PROP_FLOAT: {
FloatPropertyRNA *fprop = (FloatPropertyRNA*)prop;
FloatPropertyRNA *fprop = (FloatPropertyRNA *)prop;
fprop->defaultarray = array; /* WARNING, this array must not come from the stack and lost */
break;
}
@@ -1438,7 +1439,7 @@ void RNA_def_property_string_default(PropertyRNA *prop, const char *value)
switch (prop->type) {
case PROP_STRING: {
StringPropertyRNA *sprop = (StringPropertyRNA*)prop;
StringPropertyRNA *sprop = (StringPropertyRNA *)prop;
sprop->defaultvalue = value;
break;
}
@@ -1456,13 +1457,13 @@ void RNA_def_property_enum_default(PropertyRNA *prop, int value)
switch (prop->type) {
case PROP_ENUM: {
EnumPropertyRNA *eprop = (EnumPropertyRNA*)prop;
EnumPropertyRNA *eprop = (EnumPropertyRNA *)prop;
eprop->defaultvalue = value;
if (prop->flag & PROP_ENUM_FLAG) {
/* check all bits are accounted for */
int totflag = 0;
for (i = 0; i<eprop->totitem; i++) {
for (i = 0; i < eprop->totitem; i++) {
if (eprop->item[i].identifier[0]) {
totflag |= eprop->item[i].value;
}
@@ -1475,7 +1476,7 @@ void RNA_def_property_enum_default(PropertyRNA *prop, int value)
}
}
else {
for (i = 0; i<eprop->totitem; i++) {
for (i = 0; i < eprop->totitem; i++) {
if (eprop->item[i].identifier[0] && eprop->item[i].value == eprop->defaultvalue)
defaultfound = 1;
}
@@ -1512,7 +1513,7 @@ static PropertyDefRNA *rna_def_property_sdna(PropertyRNA *prop, const char *stru
dp = rna_find_struct_property_def(DefRNA.laststruct, prop);
if (dp == NULL) return NULL;
ds = rna_find_struct_def((StructRNA*)dp->cont);
ds = rna_find_struct_def((StructRNA *)dp->cont);
if (!structname)
structname = ds->dnaname;
@@ -1610,7 +1611,7 @@ void RNA_def_property_boolean_negative_sdna(PropertyRNA *prop, const char *struc
void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const char *propname)
{
PropertyDefRNA *dp;
IntPropertyRNA *iprop = (IntPropertyRNA*)prop;
IntPropertyRNA *iprop = (IntPropertyRNA *)prop;
StructRNA *srna = DefRNA.laststruct;
if (!DefRNA.preprocess) {
@@ -1661,7 +1662,7 @@ void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const
void RNA_def_property_float_sdna(PropertyRNA *prop, const char *structname, const char *propname)
{
PropertyDefRNA *dp;
FloatPropertyRNA *fprop = (FloatPropertyRNA*)prop;
FloatPropertyRNA *fprop = (FloatPropertyRNA *)prop;
StructRNA *srna = DefRNA.laststruct;
if (!DefRNA.preprocess) {
@@ -1714,7 +1715,7 @@ void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const
return;
}
if (( /* dp= */ rna_def_property_sdna(prop, structname, propname))) {
if ((/* dp= */ rna_def_property_sdna(prop, structname, propname))) {
if (prop->arraydimension) {
prop->arraydimension = 0;
prop->totarraylength = 0;
@@ -1743,7 +1744,7 @@ void RNA_def_property_enum_bitflag_sdna(PropertyRNA *prop, const char *structnam
void RNA_def_property_string_sdna(PropertyRNA *prop, const char *structname, const char *propname)
{
/* PropertyDefRNA *dp; */
StringPropertyRNA *sprop = (StringPropertyRNA*)prop;
StringPropertyRNA *sprop = (StringPropertyRNA *)prop;
StructRNA *srna = DefRNA.laststruct;
if (!DefRNA.preprocess) {
@@ -1800,7 +1801,7 @@ void RNA_def_property_collection_sdna(PropertyRNA *prop, const char *structname,
const char *lengthpropname)
{
PropertyDefRNA *dp;
CollectionPropertyRNA *cprop = (CollectionPropertyRNA*)prop;
CollectionPropertyRNA *cprop = (CollectionPropertyRNA *)prop;
StructRNA *srna = DefRNA.laststruct;
if (!DefRNA.preprocess) {
@@ -1835,7 +1836,7 @@ void RNA_def_property_collection_sdna(PropertyRNA *prop, const char *structname,
if (dp && lengthpropname) {
DNAStructMember smember;
StructDefRNA *ds = rna_find_struct_def((StructRNA*)dp->cont);
StructDefRNA *ds = rna_find_struct_def((StructRNA *)dp->cont);
if (!structname)
structname = ds->dnaname;
@@ -1939,7 +1940,7 @@ void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const ch
switch (prop->type) {
case PROP_BOOLEAN: {
BoolPropertyRNA *bprop = (BoolPropertyRNA*)prop;
BoolPropertyRNA *bprop = (BoolPropertyRNA *)prop;
if (prop->arraydimension) {
if (get) bprop->getarray = (PropBooleanArrayGetFunc)get;
@@ -1969,7 +1970,7 @@ void RNA_def_property_int_funcs(PropertyRNA *prop, const char *get, const char *
switch (prop->type) {
case PROP_INT: {
IntPropertyRNA *iprop = (IntPropertyRNA*)prop;
IntPropertyRNA *iprop = (IntPropertyRNA *)prop;
if (prop->arraydimension) {
if (get) iprop->getarray = (PropIntArrayGetFunc)get;
@@ -2000,7 +2001,7 @@ void RNA_def_property_float_funcs(PropertyRNA *prop, const char *get, const char
switch (prop->type) {
case PROP_FLOAT: {
FloatPropertyRNA *fprop = (FloatPropertyRNA*)prop;
FloatPropertyRNA *fprop = (FloatPropertyRNA *)prop;
if (prop->arraydimension) {
if (get) fprop->getarray = (PropFloatArrayGetFunc)get;
@@ -2031,7 +2032,7 @@ void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char
switch (prop->type) {
case PROP_ENUM: {
EnumPropertyRNA *eprop = (EnumPropertyRNA*)prop;
EnumPropertyRNA *eprop = (EnumPropertyRNA *)prop;
if (get) eprop->get = (PropEnumGetFunc)get;
if (set) eprop->set = (PropEnumSetFunc)set;
@@ -2056,7 +2057,7 @@ void RNA_def_property_string_funcs(PropertyRNA *prop, const char *get, const cha
switch (prop->type) {
case PROP_STRING: {
StringPropertyRNA *sprop = (StringPropertyRNA*)prop;
StringPropertyRNA *sprop = (StringPropertyRNA *)prop;
if (get) sprop->get = (PropStringGetFunc)get;
if (length) sprop->length = (PropStringLengthFunc)length;
@@ -2082,7 +2083,7 @@ void RNA_def_property_pointer_funcs(PropertyRNA *prop, const char *get, const ch
switch (prop->type) {
case PROP_POINTER: {
PointerPropertyRNA *pprop = (PointerPropertyRNA*)prop;
PointerPropertyRNA *pprop = (PointerPropertyRNA *)prop;
if (get) pprop->get = (PropPointerGetFunc)get;
if (set) pprop->set = (PropPointerSetFunc)set;
@@ -2110,7 +2111,7 @@ void RNA_def_property_collection_funcs(PropertyRNA *prop, const char *begin, con
switch (prop->type) {
case PROP_COLLECTION: {
CollectionPropertyRNA *cprop = (CollectionPropertyRNA*)prop;
CollectionPropertyRNA *cprop = (CollectionPropertyRNA *)prop;
if (begin) cprop->begin = (PropCollectionBeginFunc)begin;
if (next) cprop->next = (PropCollectionNextFunc)next;
@@ -2131,7 +2132,7 @@ void RNA_def_property_collection_funcs(PropertyRNA *prop, const char *begin, con
void RNA_def_property_srna(PropertyRNA *prop, const char *type)
{
prop->srna = (StructRNA*)type;
prop->srna = (StructRNA *)type;
}
void RNA_def_py_data(PropertyRNA *prop, void *py_data)
@@ -2371,13 +2372,13 @@ PropertyRNA *RNA_def_enum_flag(StructOrFunctionRNA *cont_, const char *identifie
void RNA_def_enum_funcs(PropertyRNA *prop, EnumPropertyItemFunc itemfunc)
{
EnumPropertyRNA *eprop = (EnumPropertyRNA*)prop;
EnumPropertyRNA *eprop = (EnumPropertyRNA *)prop;
eprop->itemf = itemfunc;
}
void RNA_def_enum_py_data(PropertyRNA *prop, void *py_data)
{
EnumPropertyRNA *eprop = (EnumPropertyRNA*)prop;
EnumPropertyRNA *eprop = (EnumPropertyRNA *)prop;
eprop->py_data = py_data;
}
@@ -2707,9 +2708,9 @@ int rna_parameter_size(PropertyRNA *parm)
switch (ptype) {
case PROP_BOOLEAN:
case PROP_INT:
return sizeof(int)*len;
return sizeof(int) * len;
case PROP_FLOAT:
return sizeof(float)*len;
return sizeof(float) * len;
default:
break;
}
@@ -2725,7 +2726,7 @@ int rna_parameter_size(PropertyRNA *parm)
case PROP_STRING:
/* return values don't store a pointer to the original */
if (parm->flag & PROP_THICK_WRAP) {
StringPropertyRNA *sparm = (StringPropertyRNA*)parm;
StringPropertyRNA *sparm = (StringPropertyRNA *)parm;
return sizeof(char) * sparm->maxlength;
}
else
@@ -2771,18 +2772,18 @@ void RNA_enum_item_add(EnumPropertyItem **items, int *totitem, const EnumPropert
int tot = *totitem;
if (tot == 0) {
*items = MEM_callocN(sizeof(EnumPropertyItem)*8, "RNA_enum_items_add");
*items = MEM_callocN(sizeof(EnumPropertyItem) * 8, "RNA_enum_items_add");
}
else if (tot >= 8 && (tot&(tot-1)) == 0) {
else if (tot >= 8 && (tot & (tot - 1)) == 0) {
/* power of two > 8 */
newitems = MEM_callocN(sizeof(EnumPropertyItem)*tot*2, "RNA_enum_items_add");
memcpy(newitems, *items, sizeof(EnumPropertyItem)*tot);
newitems = MEM_callocN(sizeof(EnumPropertyItem) * tot * 2, "RNA_enum_items_add");
memcpy(newitems, *items, sizeof(EnumPropertyItem) * tot);
MEM_freeN(*items);
*items = newitems;
}
(*items)[tot] = *item;
*totitem = tot+1;
*totitem = tot + 1;
}
void RNA_enum_item_add_separator(EnumPropertyItem **items, int *totitem)
@@ -2830,9 +2831,9 @@ void RNA_def_struct_duplicate_pointers(StructRNA *srna)
void RNA_def_struct_free_pointers(StructRNA *srna)
{
if (srna->flag & STRUCT_FREE_POINTERS) {
if (srna->identifier) MEM_freeN((void*)srna->identifier);
if (srna->name) MEM_freeN((void*)srna->name);
if (srna->description) MEM_freeN((void*)srna->description);
if (srna->identifier) MEM_freeN((void *)srna->identifier);
if (srna->name) MEM_freeN((void *)srna->name);
if (srna->description) MEM_freeN((void *)srna->description);
}
}
@@ -2847,8 +2848,8 @@ void RNA_def_func_duplicate_pointers(FunctionRNA *func)
void RNA_def_func_free_pointers(FunctionRNA *func)
{
if (func->flag & FUNC_FREE_POINTERS) {
if (func->identifier) MEM_freeN((void*)func->identifier);
if (func->description) MEM_freeN((void*)func->description);
if (func->identifier) MEM_freeN((void *)func->identifier);
if (func->description) MEM_freeN((void *)func->description);
}
}
@@ -2864,9 +2865,9 @@ void RNA_def_property_duplicate_pointers(StructOrFunctionRNA *cont_, PropertyRNA
* in the first place */
if (prop->identifier) {
if (cont->prophash) {
BLI_ghash_remove(cont->prophash, (void*)prop->identifier, NULL, NULL);
BLI_ghash_remove(cont->prophash, (void *)prop->identifier, NULL, NULL);
prop->identifier = BLI_strdup(prop->identifier);
BLI_ghash_insert(cont->prophash, (void*)prop->identifier, prop);
BLI_ghash_insert(cont->prophash, (void *)prop->identifier, prop);
}
else {
prop->identifier = BLI_strdup(prop->identifier);
@@ -2878,34 +2879,34 @@ void RNA_def_property_duplicate_pointers(StructOrFunctionRNA *cont_, PropertyRNA
switch (prop->type) {
case PROP_BOOLEAN: {
BoolPropertyRNA *bprop = (BoolPropertyRNA*)prop;
BoolPropertyRNA *bprop = (BoolPropertyRNA *)prop;
if (bprop->defaultarray) {
iarray = MEM_callocN(sizeof(int)*prop->totarraylength, "RNA_def_property_store");
memcpy(iarray, bprop->defaultarray, sizeof(int)*prop->totarraylength);
iarray = MEM_callocN(sizeof(int) * prop->totarraylength, "RNA_def_property_store");
memcpy(iarray, bprop->defaultarray, sizeof(int) * prop->totarraylength);
bprop->defaultarray = iarray;
}
break;
}
case PROP_INT: {
IntPropertyRNA *iprop = (IntPropertyRNA*)prop;
IntPropertyRNA *iprop = (IntPropertyRNA *)prop;
if (iprop->defaultarray) {
iarray = MEM_callocN(sizeof(int)*prop->totarraylength, "RNA_def_property_store");
memcpy(iarray, iprop->defaultarray, sizeof(int)*prop->totarraylength);
iarray = MEM_callocN(sizeof(int) * prop->totarraylength, "RNA_def_property_store");
memcpy(iarray, iprop->defaultarray, sizeof(int) * prop->totarraylength);
iprop->defaultarray = iarray;
}
break;
}
case PROP_ENUM: {
EnumPropertyRNA *eprop = (EnumPropertyRNA*)prop;
EnumPropertyRNA *eprop = (EnumPropertyRNA *)prop;
if (eprop->item) {
earray = MEM_callocN(sizeof(EnumPropertyItem)*(eprop->totitem+1), "RNA_def_property_store"),
memcpy(earray, eprop->item, sizeof(EnumPropertyItem)*(eprop->totitem+1));
earray = MEM_callocN(sizeof(EnumPropertyItem) * (eprop->totitem + 1), "RNA_def_property_store"),
memcpy(earray, eprop->item, sizeof(EnumPropertyItem) * (eprop->totitem + 1));
eprop->item = earray;
for (a = 0; a<eprop->totitem; a++) {
for (a = 0; a < eprop->totitem; a++) {
if (eprop->item[a].identifier)
eprop->item[a].identifier = BLI_strdup(eprop->item[a].identifier);
if (eprop->item[a].name)
@@ -2917,17 +2918,17 @@ void RNA_def_property_duplicate_pointers(StructOrFunctionRNA *cont_, PropertyRNA
break;
}
case PROP_FLOAT: {
FloatPropertyRNA *fprop = (FloatPropertyRNA*)prop;
FloatPropertyRNA *fprop = (FloatPropertyRNA *)prop;
if (fprop->defaultarray) {
farray = MEM_callocN(sizeof(float)*prop->totarraylength, "RNA_def_property_store");
memcpy(farray, fprop->defaultarray, sizeof(float)*prop->totarraylength);
farray = MEM_callocN(sizeof(float) * prop->totarraylength, "RNA_def_property_store");
memcpy(farray, fprop->defaultarray, sizeof(float) * prop->totarraylength);
fprop->defaultarray = farray;
}
break;
}
case PROP_STRING: {
StringPropertyRNA *sprop = (StringPropertyRNA*)prop;
StringPropertyRNA *sprop = (StringPropertyRNA *)prop;
if (sprop->defaultvalue)
sprop->defaultvalue = BLI_strdup(sprop->defaultvalue);
break;
@@ -2945,52 +2946,52 @@ void RNA_def_property_free_pointers(PropertyRNA *prop)
int a;
if (prop->identifier)
MEM_freeN((void*)prop->identifier);
MEM_freeN((void *)prop->identifier);
if (prop->name)
MEM_freeN((void*)prop->name);
MEM_freeN((void *)prop->name);
if (prop->description)
MEM_freeN((void*)prop->description);
MEM_freeN((void *)prop->description);
if (prop->py_data)
MEM_freeN(prop->py_data);
switch (prop->type) {
case PROP_BOOLEAN: {
BoolPropertyRNA *bprop = (BoolPropertyRNA*)prop;
BoolPropertyRNA *bprop = (BoolPropertyRNA *)prop;
if (bprop->defaultarray)
MEM_freeN((void*)bprop->defaultarray);
MEM_freeN((void *)bprop->defaultarray);
break;
}
case PROP_INT: {
IntPropertyRNA *iprop = (IntPropertyRNA*)prop;
IntPropertyRNA *iprop = (IntPropertyRNA *)prop;
if (iprop->defaultarray)
MEM_freeN((void*)iprop->defaultarray);
MEM_freeN((void *)iprop->defaultarray);
break;
}
case PROP_FLOAT: {
FloatPropertyRNA *fprop = (FloatPropertyRNA*)prop;
FloatPropertyRNA *fprop = (FloatPropertyRNA *)prop;
if (fprop->defaultarray)
MEM_freeN((void*)fprop->defaultarray);
MEM_freeN((void *)fprop->defaultarray);
break;
}
case PROP_ENUM: {
EnumPropertyRNA *eprop = (EnumPropertyRNA*)prop;
EnumPropertyRNA *eprop = (EnumPropertyRNA *)prop;
for (a = 0; a<eprop->totitem; a++) {
for (a = 0; a < eprop->totitem; a++) {
if (eprop->item[a].identifier)
MEM_freeN((void*)eprop->item[a].identifier);
MEM_freeN((void *)eprop->item[a].identifier);
if (eprop->item[a].name)
MEM_freeN((void*)eprop->item[a].name);
MEM_freeN((void *)eprop->item[a].name);
if (eprop->item[a].description)
MEM_freeN((void*)eprop->item[a].description);
MEM_freeN((void *)eprop->item[a].description);
}
if (eprop->item) MEM_freeN((void*)eprop->item);
if (eprop->item) MEM_freeN((void *)eprop->item);
break;
}
case PROP_STRING: {
StringPropertyRNA *sprop = (StringPropertyRNA*)prop;
StringPropertyRNA *sprop = (StringPropertyRNA *)prop;
if (sprop->defaultvalue)
MEM_freeN((void*)sprop->defaultvalue);
MEM_freeN((void *)sprop->defaultvalue);
break;
}
default:
@@ -3005,7 +3006,7 @@ static void rna_def_property_free(StructOrFunctionRNA *cont_, PropertyRNA *prop)
if (prop->flag & PROP_RUNTIME) {
if (cont->prophash)
BLI_ghash_remove(cont->prophash, (void*)prop->identifier, NULL, NULL);
BLI_ghash_remove(cont->prophash, (void *)prop->identifier, NULL, NULL);
RNA_def_property_free_pointers(prop);
rna_freelinkN(&cont->properties, prop);

View File

@@ -44,9 +44,10 @@
#include "WM_types.h"
EnumPropertyItem prop_dynamicpaint_type_items[] = {
{MOD_DYNAMICPAINT_TYPE_CANVAS, "CANVAS", 0, "Canvas", ""},
{MOD_DYNAMICPAINT_TYPE_BRUSH, "BRUSH", 0, "Brush", ""},
{0, NULL, 0, NULL, NULL}};
{MOD_DYNAMICPAINT_TYPE_CANVAS, "CANVAS", 0, "Canvas", ""},
{MOD_DYNAMICPAINT_TYPE_BRUSH, "BRUSH", 0, "Brush", ""},
{0, NULL, 0, NULL, NULL}
};
#ifdef RNA_RUNTIME
@@ -58,7 +59,7 @@ EnumPropertyItem prop_dynamicpaint_type_items[] = {
static char *rna_DynamicPaintCanvasSettings_path(PointerRNA *ptr)
{
DynamicPaintCanvasSettings *settings = (DynamicPaintCanvasSettings*)ptr->data;
DynamicPaintCanvasSettings *settings = (DynamicPaintCanvasSettings *)ptr->data;
ModifierData *md = (ModifierData *)settings->pmd;
return BLI_sprintfN("modifiers[\"%s\"].canvas_settings", md->name);
@@ -66,7 +67,7 @@ static char *rna_DynamicPaintCanvasSettings_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;
return BLI_sprintfN("modifiers[\"%s\"].brush_settings", md->name);
@@ -74,7 +75,7 @@ static char *rna_DynamicPaintBrushSettings_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;
return BLI_sprintfN("modifiers[\"%s\"].canvas_settings.canvas_surfaces[\"%s\"]", md->name, surface->name);
@@ -92,18 +93,18 @@ static void rna_DynamicPaint_redoModifier(Main *bmain, Scene *scene, PointerRNA
static void rna_DynamicPaintSurfaces_updateFrames(Main *bmain, Scene *scene, PointerRNA *ptr)
{
dynamicPaint_cacheUpdateFrames((DynamicPaintSurface*)ptr->data);
dynamicPaint_cacheUpdateFrames((DynamicPaintSurface *)ptr->data);
}
static void rna_DynamicPaintSurface_reset(Main *bmain, Scene *scene, PointerRNA *ptr)
{
dynamicPaint_resetSurface((DynamicPaintSurface*)ptr->data);
dynamicPaint_resetSurface((DynamicPaintSurface *)ptr->data);
rna_DynamicPaint_redoModifier(bmain, scene, ptr);
}
static void rna_DynamicPaintSurface_initialcolortype(Main *bmain, Scene *scene, PointerRNA *ptr)
{
DynamicPaintSurface *surface = (DynamicPaintSurface*)ptr->data;
DynamicPaintSurface *surface = (DynamicPaintSurface *)ptr->data;
surface->init_layername[0] = '\0';
dynamicPaint_clearSurface(surface);
@@ -112,7 +113,7 @@ static void rna_DynamicPaintSurface_initialcolortype(Main *bmain, Scene *scene,
static void rna_DynamicPaintSurface_changePreview(Main *bmain, Scene *scene, PointerRNA *ptr)
{
DynamicPaintSurface *act_surface = (DynamicPaintSurface*)ptr->data;
DynamicPaintSurface *act_surface = (DynamicPaintSurface *)ptr->data;
DynamicPaintSurface *surface = act_surface->canvas->surfaces.first;
/* since only one color surface can show preview at time
@@ -126,23 +127,23 @@ static void rna_DynamicPaintSurface_changePreview(Main *bmain, Scene *scene, Poi
static void rna_DynamicPaintSurface_uniqueName(Main *bmain, Scene *scene, PointerRNA *ptr)
{
dynamicPaintSurface_setUniqueName((DynamicPaintSurface*)ptr->data, ((DynamicPaintSurface*)ptr->data)->name);
dynamicPaintSurface_setUniqueName((DynamicPaintSurface *)ptr->data, ((DynamicPaintSurface *)ptr->data)->name);
}
static void rna_DynamicPaintSurface_changeType(Main *bmain, Scene *scene, PointerRNA *ptr)
{
dynamicPaintSurface_updateType((DynamicPaintSurface*)ptr->data);
dynamicPaint_resetSurface((DynamicPaintSurface*)ptr->data);
dynamicPaintSurface_updateType((DynamicPaintSurface *)ptr->data);
dynamicPaint_resetSurface((DynamicPaintSurface *)ptr->data);
rna_DynamicPaintSurface_reset(bmain, scene, ptr);
}
static void rna_DynamicPaintSurfaces_changeFormat(Main *bmain, Scene *scene, PointerRNA *ptr)
{
DynamicPaintSurface *surface = (DynamicPaintSurface*)ptr->data;
DynamicPaintSurface *surface = (DynamicPaintSurface *)ptr->data;
surface->type = MOD_DPAINT_SURFACE_T_PAINT;
dynamicPaintSurface_updateType((DynamicPaintSurface*)ptr->data);
dynamicPaintSurface_updateType((DynamicPaintSurface *)ptr->data);
rna_DynamicPaintSurface_reset(bmain, scene, ptr);
}
@@ -154,7 +155,7 @@ static void rna_DynamicPaint_resetDependancy(Main *bmain, Scene *scene, PointerR
static PointerRNA rna_PaintSurface_active_get(PointerRNA *ptr)
{
DynamicPaintCanvasSettings *canvas = (DynamicPaintCanvasSettings*)ptr->data;
DynamicPaintCanvasSettings *canvas = (DynamicPaintCanvasSettings *)ptr->data;
DynamicPaintSurface *surface = canvas->surfaces.first;
int id = 0;
@@ -168,36 +169,36 @@ static PointerRNA rna_PaintSurface_active_get(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_listbase_begin(iter, &canvas->surfaces, NULL);
}
static int rna_Surface_active_point_index_get(PointerRNA *ptr)
{
DynamicPaintCanvasSettings *canvas = (DynamicPaintCanvasSettings*)ptr->data;
DynamicPaintCanvasSettings *canvas = (DynamicPaintCanvasSettings *)ptr->data;
return canvas->active_sur;
}
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;
return;
}
static void rna_Surface_active_point_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax)
{
DynamicPaintCanvasSettings *canvas = (DynamicPaintCanvasSettings*)ptr->data;
DynamicPaintCanvasSettings *canvas = (DynamicPaintCanvasSettings *)ptr->data;
*min = 0;
*max = BLI_countlist(&canvas->surfaces)-1;
*max = BLI_countlist(&canvas->surfaces) - 1;
}
/* uvlayer */
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;
int id = 0;
@@ -213,7 +214,7 @@ static void rna_DynamicPaint_uvlayer_set(PointerRNA *ptr, const char *value)
/* is point cache used */
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;
}
@@ -228,7 +229,7 @@ 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)
{
DynamicPaintSurface *surface = (DynamicPaintSurface*)ptr->data;
DynamicPaintSurface *surface = (DynamicPaintSurface *)ptr->data;
EnumPropertyItem *item = NULL;
EnumPropertyItem tmp = {0, "", 0, "", ""};
@@ -242,7 +243,7 @@ static EnumPropertyItem *rna_DynamicPaint_surface_type_itemf(bContext *C, Pointe
/* Displace */
if (surface->format == MOD_DPAINT_SURFACE_F_VERTEX ||
surface->format == MOD_DPAINT_SURFACE_F_IMAGESEQ) {
surface->format == MOD_DPAINT_SURFACE_F_IMAGESEQ) {
tmp.value = MOD_DPAINT_SURFACE_T_DISPLACE;
tmp.identifier = "DISPLACE";
tmp.name = "Displace";
@@ -294,7 +295,7 @@ static void rna_def_canvas_surfaces(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_property_struct_type(prop, "DynamicPaintSurface");
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_update(prop, NC_OBJECT|ND_DRAW, NULL);
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL);
}
@@ -307,51 +308,58 @@ static void rna_def_canvas_surface(BlenderRNA *brna)
/* Surface format */
static EnumPropertyItem prop_dynamicpaint_surface_format[] = {
/*{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_IMAGESEQ, "IMAGE", ICON_FILE_IMAGE, "Image Sequence", ""},
{0, NULL, 0, NULL, NULL}};
/*{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_IMAGESEQ, "IMAGE", ICON_FILE_IMAGE, "Image Sequence", ""},
{0, NULL, 0, NULL, NULL}
};
/* Surface type - generated dynamically based on surface format */
static EnumPropertyItem prop_dynamicpaint_surface_type[] = {
{MOD_DPAINT_SURFACE_T_PAINT, "PAINT", 0, "Paint", ""},
{0, NULL, 0, NULL, NULL}};
{MOD_DPAINT_SURFACE_T_PAINT, "PAINT", 0, "Paint", ""},
{0, NULL, 0, NULL, NULL}
};
/* Surface output preview. currently only paint has multiple outputs */
static EnumPropertyItem prop_dynamicpaint_surface_preview[] = {
{MOD_DPAINT_SURFACE_PREV_PAINT, "PAINT", 0, "Paint", ""},
{MOD_DPAINT_SURFACE_PREV_WETMAP, "WETMAP", 0, "Wetmap", ""},
{0, NULL, 0, NULL, NULL}};
{MOD_DPAINT_SURFACE_PREV_PAINT, "PAINT", 0, "Paint", ""},
{MOD_DPAINT_SURFACE_PREV_WETMAP, "WETMAP", 0, "Wetmap", ""},
{0, NULL, 0, NULL, NULL}
};
/* Initial color setting */
static EnumPropertyItem prop_dynamicpaint_init_color_type[] = {
{MOD_DPAINT_INITIAL_NONE, "NONE", 0, "None", ""},
{MOD_DPAINT_INITIAL_COLOR, "COLOR", ICON_COLOR, "Color", ""},
{MOD_DPAINT_INITIAL_TEXTURE, "TEXTURE", ICON_TEXTURE, "UV Texture", ""},
{MOD_DPAINT_INITIAL_VERTEXCOLOR, "VERTEX_COLOR", ICON_GROUP_VCOL, "Vertex Color", ""},
{0, NULL, 0, NULL, NULL}};
{MOD_DPAINT_INITIAL_NONE, "NONE", 0, "None", ""},
{MOD_DPAINT_INITIAL_COLOR, "COLOR", ICON_COLOR, "Color", ""},
{MOD_DPAINT_INITIAL_TEXTURE, "TEXTURE", ICON_TEXTURE, "UV Texture", ""},
{MOD_DPAINT_INITIAL_VERTEXCOLOR, "VERTEX_COLOR", ICON_GROUP_VCOL, "Vertex Color", ""},
{0, NULL, 0, NULL, NULL}
};
/* Effect type
* Only used by ui to view per effect settings */
static EnumPropertyItem prop_dynamicpaint_effecttype[] = {
{1, "SPREAD", 0, "Spread", ""},
{2, "DRIP", 0, "Drip", ""},
{3, "SHRINK", 0, "Shrink", ""},
{0, NULL, 0, NULL, NULL}};
{1, "SPREAD", 0, "Spread", ""},
{2, "DRIP", 0, "Drip", ""},
{3, "SHRINK", 0, "Shrink", ""},
{0, NULL, 0, NULL, NULL}
};
/* Displacemap file format */
static EnumPropertyItem prop_dynamicpaint_image_fileformat[] = {
{MOD_DPAINT_IMGFORMAT_PNG, "PNG", 0, "PNG", ""},
{MOD_DPAINT_IMGFORMAT_PNG, "PNG", 0, "PNG", ""},
#ifdef WITH_OPENEXR
{MOD_DPAINT_IMGFORMAT_OPENEXR, "OPENEXR", 0, "OpenEXR", ""},
{MOD_DPAINT_IMGFORMAT_OPENEXR, "OPENEXR", 0, "OpenEXR", ""},
#endif
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
/* Displacemap type */
static EnumPropertyItem prop_dynamicpaint_displace_type[] = {
{MOD_DPAINT_DISP_DISPLACE, "DISPLACE", 0, "Displacement", ""},
{MOD_DPAINT_DISP_DEPTH, "DEPTH", 0, "Depth", ""},
{0, NULL, 0, NULL, NULL}};
{MOD_DPAINT_DISP_DISPLACE, "DISPLACE", 0, "Displacement", ""},
{MOD_DPAINT_DISP_DEPTH, "DEPTH", 0, "Depth", ""},
{0, NULL, 0, NULL, NULL}
};
@@ -366,7 +374,7 @@ static void rna_def_canvas_surface(BlenderRNA *brna)
RNA_def_property_enum_sdna(prop, NULL, "format");
RNA_def_property_enum_items(prop, prop_dynamicpaint_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);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
@@ -374,17 +382,17 @@ static void rna_def_canvas_surface(BlenderRNA *brna)
RNA_def_property_enum_items(prop, prop_dynamicpaint_surface_type);
RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_DynamicPaint_surface_type_itemf");
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);
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_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);
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_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);
RNA_def_property_ui_text(prop, "Name", "Surface name");
@@ -395,7 +403,7 @@ static void rna_def_canvas_surface(BlenderRNA *brna)
RNA_def_property_struct_type(prop, "Group");
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_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_resetDependancy");
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_resetDependancy");
/*
@@ -441,7 +449,7 @@ static void rna_def_canvas_surface(BlenderRNA *brna)
RNA_def_property_range(prop, 1.0, 9999.0);
RNA_def_property_ui_range(prop, 1.0, 9999, 1, 0);
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);
RNA_def_property_int_sdna(prop, NULL, "end_frame");
@@ -449,7 +457,7 @@ static void rna_def_canvas_surface(BlenderRNA *brna)
RNA_def_property_range(prop, 1.0, 9999.0);
RNA_def_property_ui_range(prop, 1.0, 9999.0, 1, 0);
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);
RNA_def_property_int_sdna(prop, NULL, "substeps");
@@ -461,21 +469,21 @@ static void rna_def_canvas_surface(BlenderRNA *brna)
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
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_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);
RNA_def_property_float_sdna(prop, NULL, "influence_scale");
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_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);
RNA_def_property_float_sdna(prop, NULL, "radius_scale");
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_text(prop, "Radius Scale", "Adjust radius of proximity brushes or particles for 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");
/*
* Initial Color
@@ -485,22 +493,22 @@ static void rna_def_canvas_surface(BlenderRNA *brna)
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_enum_items(prop, prop_dynamicpaint_init_color_type);
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);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_array(prop, 4);
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);
RNA_def_property_flag(prop, PROP_EDITABLE);
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);
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
@@ -523,7 +531,7 @@ static void rna_def_canvas_surface(BlenderRNA *brna)
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
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_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);
RNA_def_property_float_sdna(prop, NULL, "spread_speed");
@@ -547,13 +555,13 @@ static void rna_def_canvas_surface(BlenderRNA *brna)
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
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_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);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
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_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);
RNA_def_property_float_sdna(prop, NULL, "shrink_speed");
@@ -613,13 +621,13 @@ static void rna_def_canvas_surface(BlenderRNA *brna)
RNA_def_property_enum_sdna(prop, NULL, "preview_id");
RNA_def_property_enum_items(prop, prop_dynamicpaint_surface_preview);
RNA_def_property_ui_text(prop, "Preview", "");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
/* to check if output name 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");
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);
RNA_def_property_flag(parm, PROP_REQUIRED);
/* return type */
@@ -632,7 +640,7 @@ static void rna_def_canvas_surface(BlenderRNA *brna)
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_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);
RNA_def_property_float_sdna(prop, NULL, "disp_factor");
@@ -640,7 +648,7 @@ static void rna_def_canvas_surface(BlenderRNA *brna)
RNA_def_property_range(prop, -50.0, 50.0);
RNA_def_property_ui_range(prop, -5.0, 5.0, 1, 2);
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);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
@@ -657,7 +665,7 @@ static void rna_def_canvas_surface(BlenderRNA *brna)
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
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_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaintSurface_reset");
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaintSurface_reset");
/* wave simulator settings */
prop = RNA_def_property(srna, "wave_damping", PROP_FLOAT, PROP_NONE);
@@ -695,7 +703,7 @@ static void rna_def_canvas_surface(BlenderRNA *brna)
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_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);
}
static void rna_def_dynamic_paint_canvas_settings(BlenderRNA *brna)
@@ -727,31 +735,35 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna)
/* paint collision type */
static EnumPropertyItem prop_dynamicpaint_collisiontype[] = {
{MOD_DPAINT_COL_PSYS, "PARTICLE_SYSTEM", ICON_PARTICLES, "Particle System", ""},
{MOD_DPAINT_COL_POINT, "POINT", ICON_META_EMPTY, "Object Center", ""},
{MOD_DPAINT_COL_DIST, "DISTANCE", ICON_META_EMPTY, "Proximity", ""},
{MOD_DPAINT_COL_VOLDIST, "VOLUME_DISTANCE", ICON_META_CUBE, "Mesh Volume + Proximity", ""},
{MOD_DPAINT_COL_VOLUME, "VOLUME", ICON_MESH_CUBE, "Mesh Volume", ""},
{0, NULL, 0, NULL, NULL}};
{MOD_DPAINT_COL_PSYS, "PARTICLE_SYSTEM", ICON_PARTICLES, "Particle System", ""},
{MOD_DPAINT_COL_POINT, "POINT", ICON_META_EMPTY, "Object Center", ""},
{MOD_DPAINT_COL_DIST, "DISTANCE", ICON_META_EMPTY, "Proximity", ""},
{MOD_DPAINT_COL_VOLDIST, "VOLUME_DISTANCE", ICON_META_CUBE, "Mesh Volume + Proximity", ""},
{MOD_DPAINT_COL_VOLUME, "VOLUME", ICON_MESH_CUBE, "Mesh Volume", ""},
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem prop_dynamicpaint_prox_falloff[] = {
{MOD_DPAINT_PRFALL_SMOOTH, "SMOOTH", ICON_SPHERECURVE, "Smooth", ""},
{MOD_DPAINT_PRFALL_CONSTANT, "CONSTANT", ICON_NOCURVE, "Constant", ""},
{MOD_DPAINT_PRFALL_RAMP, "RAMP", ICON_COLOR, "Color Ramp", ""},
{0, NULL, 0, NULL, NULL}};
{MOD_DPAINT_PRFALL_SMOOTH, "SMOOTH", ICON_SPHERECURVE, "Smooth", ""},
{MOD_DPAINT_PRFALL_CONSTANT, "CONSTANT", ICON_NOCURVE, "Constant", ""},
{MOD_DPAINT_PRFALL_RAMP, "RAMP", ICON_COLOR, "Color Ramp", ""},
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem prop_dynamicpaint_brush_wave_type[] = {
{MOD_DPAINT_WAVEB_CHANGE, "CHANGE", 0, "Depth Change", ""},
{MOD_DPAINT_WAVEB_DEPTH, "DEPTH", 0, "Obstacle", ""},
{MOD_DPAINT_WAVEB_FORCE, "FORCE", 0, "Force", ""},
{MOD_DPAINT_WAVEB_REFLECT, "REFLECT", 0, "Reflect Only", ""},
{0, NULL, 0, NULL, NULL}};
{MOD_DPAINT_WAVEB_CHANGE, "CHANGE", 0, "Depth Change", ""},
{MOD_DPAINT_WAVEB_DEPTH, "DEPTH", 0, "Obstacle", ""},
{MOD_DPAINT_WAVEB_FORCE, "FORCE", 0, "Force", ""},
{MOD_DPAINT_WAVEB_REFLECT, "REFLECT", 0, "Reflect Only", ""},
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem prop_dynamicpaint_brush_ray_dir[] = {
{MOD_DPAINT_RAY_CANVAS, "CANVAS", 0, "Canvas Normal", ""},
{MOD_DPAINT_RAY_BRUSH_AVG, "BRUSH", 0, "Brush Normal", ""},
{MOD_DPAINT_RAY_ZPLUS, "Z_AXIS", 0, "Z-Axis", ""},
{0, NULL, 0, NULL, NULL}};
{MOD_DPAINT_RAY_CANVAS, "CANVAS", 0, "Canvas Normal", ""},
{MOD_DPAINT_RAY_BRUSH_AVG, "BRUSH", 0, "Brush Normal", ""},
{MOD_DPAINT_RAY_ZPLUS, "Z_AXIS", 0, "Z-Axis", ""},
{0, NULL, 0, NULL, NULL}
};
srna = RNA_def_struct(brna, "DynamicPaintBrushSettings", NULL);
RNA_def_struct_ui_text(srna, "Brush Settings", "Brush settings");
@@ -765,26 +777,26 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna)
RNA_def_property_float_sdna(prop, NULL, "r");
RNA_def_property_array(prop, 3);
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);
RNA_def_property_float_sdna(prop, NULL, "alpha");
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_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);
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_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);
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_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);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_ABS_ALPHA);
@@ -797,12 +809,12 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna)
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_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);
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_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);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
@@ -839,28 +851,28 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna)
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_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);
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_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);
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_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
/*
* Paint Area / Collision
*/
* Paint Area / Collision
*/
prop = RNA_def_property(srna, "paint_source", PROP_ENUM, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_enum_sdna(prop, NULL, "collision");
RNA_def_property_enum_items(prop, prop_dynamicpaint_collisiontype);
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);
RNA_def_property_float_sdna(prop, NULL, "paint_distance");
@@ -868,25 +880,25 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna)
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_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);
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_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);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_enum_sdna(prop, NULL, "proximity_falloff");
RNA_def_property_enum_items(prop, prop_dynamicpaint_prox_falloff);
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);
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_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);
RNA_def_property_enum_sdna(prop, NULL, "ray_dir");
@@ -894,17 +906,17 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna)
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);
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_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);
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_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
/*
@@ -915,27 +927,27 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna)
RNA_def_property_struct_type(prop, "ParticleSystem");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Particle Systems", "The particle system to paint with");
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);
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_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);
RNA_def_property_float_sdna(prop, NULL, "particle_radius");
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_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);
RNA_def_property_float_sdna(prop, NULL, "particle_smooth");
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_text(prop, "Smooth Radius", "Smooth falloff added after solid radius");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
/*
@@ -945,13 +957,13 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna)
RNA_def_property_pointer_sdna(prop, NULL, "paint_ramp");
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_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);
RNA_def_property_pointer_sdna(prop, NULL, "vel_ramp");
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_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier");
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier");
}
void RNA_def_dynamic_paint(BlenderRNA *brna)

View File

@@ -59,14 +59,16 @@ EnumPropertyItem fmodifier_type_items[] = {
/*{FMODIFIER_TYPE_PYTHON, "PYTHON", 0, "Python", ""}, *//* FIXME: not implemented yet! */
{FMODIFIER_TYPE_LIMITS, "LIMITS", 0, "Limits", ""},
{FMODIFIER_TYPE_STEPPED, "STEPPED", 0, "Stepped Interpolation", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
EnumPropertyItem beztriple_keyframe_type_items[] = {
{BEZT_KEYTYPE_KEYFRAME, "KEYFRAME", 0, "Keyframe", ""},
{BEZT_KEYTYPE_BREAKDOWN, "BREAKDOWN", 0, "Breakdown", ""},
{BEZT_KEYTYPE_EXTREME, "EXTREME", 0, "Extreme", ""},
{BEZT_KEYTYPE_JITTER, "JITTER", 0, "Jitter", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
#ifdef RNA_RUNTIME
@@ -115,9 +117,9 @@ static void rna_ChannelDriver_update_data(Main *bmain, Scene *scene, PointerRNA
/* TODO: this really needs an update guard... */
DAG_scene_sort(bmain, scene);
DAG_id_tag_update(id, OB_RECALC_OB|OB_RECALC_DATA);
DAG_id_tag_update(id, OB_RECALC_OB | OB_RECALC_DATA);
WM_main_add_notifier(NC_SCENE|ND_FRAME, scene);
WM_main_add_notifier(NC_SCENE | ND_FRAME, scene);
}
static void rna_ChannelDriver_update_expr(Main *bmain, Scene *scene, PointerRNA *ptr)
@@ -163,25 +165,25 @@ static void rna_DriverTarget_update_name(Main *bmain, Scene *scene, PointerRNA *
/* note: this function exists only to avoid id refcounting */
static void rna_DriverTarget_id_set(PointerRNA *ptr, PointerRNA value)
{
DriverTarget *dtar = (DriverTarget*)ptr->data;
DriverTarget *dtar = (DriverTarget *)ptr->data;
dtar->id = value.data;
}
static StructRNA *rna_DriverTarget_id_typef(PointerRNA *ptr)
{
DriverTarget *dtar = (DriverTarget*)ptr->data;
DriverTarget *dtar = (DriverTarget *)ptr->data;
return ID_code_to_RNA_type(dtar->idtype);
}
static int rna_DriverTarget_id_editable(PointerRNA *ptr)
{
DriverTarget *dtar = (DriverTarget*)ptr->data;
return (dtar->idtype)? PROP_EDITABLE : 0;
DriverTarget *dtar = (DriverTarget *)ptr->data;
return (dtar->idtype) ? PROP_EDITABLE : 0;
}
static int rna_DriverTarget_id_type_editable(PointerRNA *ptr)
{
DriverTarget *dtar = (DriverTarget*)ptr->data;
DriverTarget *dtar = (DriverTarget *)ptr->data;
/* when the id-type can only be object, don't allow editing
* otherwise, there may be strange crashes
@@ -191,7 +193,7 @@ static int rna_DriverTarget_id_type_editable(PointerRNA *ptr)
static void rna_DriverTarget_id_type_set(PointerRNA *ptr, int value)
{
DriverTarget *data = (DriverTarget*)(ptr->data);
DriverTarget *data = (DriverTarget *)(ptr->data);
/* check if ID-type is settable */
if ((data->flag & DTAR_FLAG_ID_OB_ONLY) == 0) {
@@ -254,7 +256,7 @@ static void rna_DriverVariable_type_set(PointerRNA *ptr, int value)
static void rna_FKeyframe_handle1_get(PointerRNA *ptr, float *values)
{
BezTriple *bezt = (BezTriple*)ptr->data;
BezTriple *bezt = (BezTriple *)ptr->data;
values[0] = bezt->vec[0][0];
values[1] = bezt->vec[0][1];
@@ -262,7 +264,7 @@ static void rna_FKeyframe_handle1_get(PointerRNA *ptr, float *values)
static void rna_FKeyframe_handle1_set(PointerRNA *ptr, const float *values)
{
BezTriple *bezt = (BezTriple*)ptr->data;
BezTriple *bezt = (BezTriple *)ptr->data;
bezt->vec[0][0] = values[0];
bezt->vec[0][1] = values[1];
@@ -270,7 +272,7 @@ static void rna_FKeyframe_handle1_set(PointerRNA *ptr, const float *values)
static void rna_FKeyframe_handle2_get(PointerRNA *ptr, float *values)
{
BezTriple *bezt = (BezTriple*)ptr->data;
BezTriple *bezt = (BezTriple *)ptr->data;
values[0] = bezt->vec[2][0];
values[1] = bezt->vec[2][1];
@@ -278,7 +280,7 @@ static void rna_FKeyframe_handle2_get(PointerRNA *ptr, float *values)
static void rna_FKeyframe_handle2_set(PointerRNA *ptr, const float *values)
{
BezTriple *bezt = (BezTriple*)ptr->data;
BezTriple *bezt = (BezTriple *)ptr->data;
bezt->vec[2][0] = values[0];
bezt->vec[2][1] = values[1];
@@ -286,7 +288,7 @@ static void rna_FKeyframe_handle2_set(PointerRNA *ptr, const float *values)
static void rna_FKeyframe_ctrlpoint_get(PointerRNA *ptr, float *values)
{
BezTriple *bezt = (BezTriple*)ptr->data;
BezTriple *bezt = (BezTriple *)ptr->data;
values[0] = bezt->vec[1][0];
values[1] = bezt->vec[1][1];
@@ -294,7 +296,7 @@ static void rna_FKeyframe_ctrlpoint_get(PointerRNA *ptr, float *values)
static void rna_FKeyframe_ctrlpoint_set(PointerRNA *ptr, const float *values)
{
BezTriple *bezt = (BezTriple*)ptr->data;
BezTriple *bezt = (BezTriple *)ptr->data;
bezt->vec[1][0] = values[0];
bezt->vec[1][1] = values[1];
@@ -362,7 +364,7 @@ static void rna_FCurve_group_set(PointerRNA *ptr, PointerRNA value)
else {
/* the ID given is the owner of the F-Curve (for drivers) */
AnimData *adt = BKE_animdata_from_id(ptr->id.data);
act = (adt)? adt->action : NULL;
act = (adt) ? adt->action : NULL;
}
/* already belongs to group? */
@@ -420,14 +422,14 @@ void rna_Driver_remove_variable(ChannelDriver *driver, ReportList *reports, Driv
static PointerRNA rna_FCurve_active_modifier_get(PointerRNA *ptr)
{
FCurve *fcu = (FCurve*)ptr->data;
FCurve *fcu = (FCurve *)ptr->data;
FModifier *fcm = find_active_fmodifier(&fcu->modifiers);
return rna_pointer_inherit_refine(ptr, &RNA_FModifier, fcm);
}
static void rna_FCurve_active_modifier_set(PointerRNA *ptr, PointerRNA value)
{
FCurve *fcu = (FCurve*)ptr->data;
FCurve *fcu = (FCurve *)ptr->data;
set_active_fmodifier(&fcu->modifiers, (FModifier *)value.data);
}
@@ -447,7 +449,7 @@ static void rna_FCurve_modifiers_remove(FCurve *fcu, ReportList *reports, FModif
static void rna_FModifier_active_set(PointerRNA *ptr, int UNUSED(value))
{
FModifier *fm = (FModifier*)ptr->data;
FModifier *fm = (FModifier *)ptr->data;
/* don't toggle, always switch on */
fm->flag |= FMODIFIER_FLAG_ACTIVE;
@@ -455,23 +457,23 @@ static void rna_FModifier_active_set(PointerRNA *ptr, int UNUSED(value))
static void rna_FModifier_start_frame_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax)
{
FModifier *fcm = (FModifier*)ptr->data;
FModifier *fcm = (FModifier *)ptr->data;
*min = MINAFRAMEF;
*max = (fcm->flag & FMODIFIER_FLAG_RANGERESTRICT)? fcm->efra : MAXFRAMEF;
*max = (fcm->flag & FMODIFIER_FLAG_RANGERESTRICT) ? fcm->efra : MAXFRAMEF;
}
static void rna_FModifier_end_frame_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax)
{
FModifier *fcm = (FModifier*)ptr->data;
FModifier *fcm = (FModifier *)ptr->data;
*min = (fcm->flag & FMODIFIER_FLAG_RANGERESTRICT)? fcm->sfra : MINAFRAMEF;
*min = (fcm->flag & FMODIFIER_FLAG_RANGERESTRICT) ? fcm->sfra : MINAFRAMEF;
*max = MAXFRAMEF;
}
static void rna_FModifier_blending_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax)
{
FModifier *fcm = (FModifier*)ptr->data;
FModifier *fcm = (FModifier *)ptr->data;
*min = 0.0f;
*max = fcm->efra - fcm->sfra;
@@ -479,7 +481,7 @@ static void rna_FModifier_blending_range(PointerRNA *ptr, float *min, float *max
static void rna_FModifier_active_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
FModifier *fm, *fmo = (FModifier*)ptr->data;
FModifier *fm, *fmo = (FModifier *)ptr->data;
/* clear active state of other FModifiers in this list */
for (fm = fmo->prev; fm; fm = fm->prev) {
@@ -493,64 +495,64 @@ static void rna_FModifier_active_update(Main *UNUSED(bmain), Scene *UNUSED(scene
static int rna_FModifierGenerator_coefficients_get_length(PointerRNA *ptr, int length[RNA_MAX_ARRAY_DIMENSION])
{
FModifier *fcm = (FModifier*)ptr->data;
FModifier *fcm = (FModifier *)ptr->data;
FMod_Generator *gen = fcm->data;
if (gen)
length[0] = gen->arraysize;
else
length[0] = 100; /* for raw_access, untested */
length[0] = 100; /* for raw_access, untested */
return length[0];
}
static void rna_FModifierGenerator_coefficients_get(PointerRNA *ptr, float *values)
{
FModifier *fcm = (FModifier*)ptr->data;
FModifier *fcm = (FModifier *)ptr->data;
FMod_Generator *gen = fcm->data;
memcpy(values, gen->coefficients, gen->arraysize * sizeof(float));
}
static void rna_FModifierGenerator_coefficients_set(PointerRNA *ptr, const float *values)
{
FModifier *fcm = (FModifier*)ptr->data;
FModifier *fcm = (FModifier *)ptr->data;
FMod_Generator *gen = fcm->data;
memcpy(gen->coefficients, values, gen->arraysize * sizeof(float));
}
static void rna_FModifierLimits_minx_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax)
{
FModifier *fcm = (FModifier*)ptr->data;
FModifier *fcm = (FModifier *)ptr->data;
FMod_Limits *data = fcm->data;
*min = MINAFRAMEF;
*max = (data->flag & FCM_LIMIT_XMAX)? data->rect.xmax : MAXFRAMEF;
*max = (data->flag & FCM_LIMIT_XMAX) ? data->rect.xmax : MAXFRAMEF;
}
static void rna_FModifierLimits_maxx_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax)
{
FModifier *fcm = (FModifier*)ptr->data;
FModifier *fcm = (FModifier *)ptr->data;
FMod_Limits *data = fcm->data;
*min = (data->flag & FCM_LIMIT_XMIN)? data->rect.xmin : MINAFRAMEF;
*min = (data->flag & FCM_LIMIT_XMIN) ? data->rect.xmin : MINAFRAMEF;
*max = MAXFRAMEF;
}
static void rna_FModifierLimits_miny_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax)
{
FModifier *fcm = (FModifier*)ptr->data;
FModifier *fcm = (FModifier *)ptr->data;
FMod_Limits *data = fcm->data;
*min = -FLT_MAX;
*max = (data->flag & FCM_LIMIT_YMAX)? data->rect.ymax : FLT_MAX;
*max = (data->flag & FCM_LIMIT_YMAX) ? data->rect.ymax : FLT_MAX;
}
static void rna_FModifierLimits_maxy_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax)
{
FModifier *fcm = (FModifier*)ptr->data;
FModifier *fcm = (FModifier *)ptr->data;
FMod_Limits *data = fcm->data;
*min = (data->flag & FCM_LIMIT_YMIN)? data->rect.ymin : -FLT_MAX;
*min = (data->flag & FCM_LIMIT_YMIN) ? data->rect.ymin : -FLT_MAX;
*max = FLT_MAX;
}
@@ -558,27 +560,27 @@ static void rna_FModifierLimits_maxy_range(PointerRNA *ptr, float *min, float *m
static void rna_FModifierStepped_start_frame_range(PointerRNA *ptr, float *min, float *max,
float *softmin, float *softmax)
{
FModifier *fcm = (FModifier*)ptr->data;
FModifier *fcm = (FModifier *)ptr->data;
FMod_Stepped *data = fcm->data;
*min = MINAFRAMEF;
*max = (data->flag & FCM_STEPPED_NO_AFTER)? data->end_frame : MAXFRAMEF;
*max = (data->flag & FCM_STEPPED_NO_AFTER) ? data->end_frame : MAXFRAMEF;
}
static void rna_FModifierStepped_end_frame_range(PointerRNA *ptr, float *min, float *max,
float *softmin, float *softmax)
{
FModifier *fcm = (FModifier*)ptr->data;
FModifier *fcm = (FModifier *)ptr->data;
FMod_Stepped *data = fcm->data;
*min = (data->flag & FCM_STEPPED_NO_BEFORE)? data->start_frame : MINAFRAMEF;
*min = (data->flag & FCM_STEPPED_NO_BEFORE) ? data->start_frame : MINAFRAMEF;
*max = MAXFRAMEF;
}
static BezTriple *rna_FKeyframe_points_insert(FCurve *fcu, float frame, float value, int flag)
{
int index = insert_vert_fcurve(fcu, frame, value, flag);
return ((fcu->bezt) && (index >= 0))? (fcu->bezt + index) : NULL;
return ((fcu->bezt) && (index >= 0)) ? (fcu->bezt + index) : NULL;
}
static void rna_FKeyframe_points_add(FCurve *fcu, int tot)
@@ -621,7 +623,7 @@ static void rna_FKeyframe_points_remove(FCurve *fcu, ReportList *reports, BezTri
static void rna_fcurve_range(FCurve *fcu, float range[2])
{
calc_fcurve_range(fcu, range, range+1, FALSE, FALSE);
calc_fcurve_range(fcu, range, range + 1, FALSE, FALSE);
}
#else
@@ -634,7 +636,8 @@ static void rna_def_fmodifier_generator(BlenderRNA *brna)
static EnumPropertyItem generator_mode_items[] = {
{FCM_GENERATOR_POLYNOMIAL, "POLYNOMIAL", 0, "Expanded Polynomial", ""},
{FCM_GENERATOR_POLYNOMIAL_FACTORISED, "POLYNOMIAL_FACTORISED", 0, "Factorized Polynomial", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
srna = RNA_def_struct(brna, "FModifierGenerator", "FModifier");
RNA_def_struct_ui_text(srna, "Generator F-Modifier", "Deterministically generate values for the modified F-Curve");
@@ -646,21 +649,21 @@ static void rna_def_fmodifier_generator(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Additive",
"Values generated by this modifier are applied on top of "
"the existing values instead of overwriting them");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);
/* XXX this has a special validation func */
/* XXX this has a special validation func */
prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, generator_mode_items);
RNA_def_property_ui_text(prop, "Mode", "Type of generator to use");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);
/* order of the polynomial */
/* XXX this has a special validation func */
/* XXX this has a special validation func */
prop = RNA_def_property(srna, "poly_order", PROP_INT, PROP_NONE);
RNA_def_property_ui_text(prop, "Polynomial Order",
"The highest power of 'x' for this polynomial (number of coefficients - 1)");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);
/* coefficients array */
prop = RNA_def_property(srna, "coefficients", PROP_FLOAT, PROP_NONE);
@@ -686,7 +689,8 @@ static void rna_def_fmodifier_function_generator(BlenderRNA *brna)
{3, "SQRT", 0, "Square Root", ""},
{4, "LN", 0, "Natural Logarithm", ""},
{5, "SINC", 0, "Normalised Sine", "sin(x) / x"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
srna = RNA_def_struct(brna, "FModifierFunctionGenerator", "FModifier");
RNA_def_struct_ui_text(srna, "Built-In Function F-Modifier", "Generate values using a Built-In Function");
@@ -695,19 +699,19 @@ static void rna_def_fmodifier_function_generator(BlenderRNA *brna)
/* coefficients */
prop = RNA_def_property(srna, "amplitude", PROP_FLOAT, PROP_NONE);
RNA_def_property_ui_text(prop, "Amplitude", "Scale factor determining the maximum/minimum values");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);
prop = RNA_def_property(srna, "phase_multiplier", PROP_FLOAT, PROP_NONE);
RNA_def_property_ui_text(prop, "Phase Multiplier", "Scale factor determining the 'speed' of the function");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);
prop = RNA_def_property(srna, "phase_offset", PROP_FLOAT, PROP_NONE);
RNA_def_property_ui_text(prop, "Phase Offset", "Constant factor to offset time by for function");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);
prop = RNA_def_property(srna, "value_offset", PROP_FLOAT, PROP_NONE);
RNA_def_property_ui_text(prop, "Value Offset", "Constant factor to offset values by");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);
/* flags */
prop = RNA_def_property(srna, "use_additive", PROP_BOOLEAN, PROP_NONE);
@@ -715,13 +719,13 @@ static void rna_def_fmodifier_function_generator(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Additive",
"Values generated by this modifier are applied on top of "
"the existing values instead of overwriting them");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);
prop = RNA_def_property(srna, "function_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "type");
RNA_def_property_enum_items(prop, prop_type_items);
RNA_def_property_ui_text(prop, "Type", "Type of built-in function to use");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);
}
/* --------- */
@@ -742,18 +746,18 @@ static void rna_def_fmodifier_envelope_ctrl(BlenderRNA *brna)
prop = RNA_def_property(srna, "min", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "min");
RNA_def_property_ui_text(prop, "Minimum Value", "Lower bound of envelope at this control-point");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);
prop = RNA_def_property(srna, "max", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "max");
RNA_def_property_ui_text(prop, "Maximum Value", "Upper bound of envelope at this control-point");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);
/* Frame */
prop = RNA_def_property(srna, "frame", PROP_FLOAT, PROP_TIME);
RNA_def_property_float_sdna(prop, NULL, "time");
RNA_def_property_ui_text(prop, "Frame", "Frame this control-point occurs on");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);
/* TODO: */
/* - selection flags (not implemented in UI yet though) */
@@ -778,17 +782,17 @@ static void rna_def_fmodifier_envelope(BlenderRNA *brna)
prop = RNA_def_property(srna, "reference_value", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "midval");
RNA_def_property_ui_text(prop, "Reference Value", "Value that envelope's influence is centered around / based on");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);
prop = RNA_def_property(srna, "default_min", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "min");
RNA_def_property_ui_text(prop, "Default Minimum", "Lower distance from Reference Value for 1:1 default influence");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);
prop = RNA_def_property(srna, "default_max", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "max");
RNA_def_property_ui_text(prop, "Default Maximum", "Upper distance from Reference Value for 1:1 default influence");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);
}
/* --------- */
@@ -806,7 +810,8 @@ static void rna_def_fmodifier_cycles(BlenderRNA *brna)
"start and end values"},
{FCM_EXTRAPOLATE_MIRROR, "MIRROR", 0, "Repeat Mirrored",
"Alternate between forward and reverse playback of keyframe range"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
srna = RNA_def_struct(brna, "FModifierCycles", "FModifier");
RNA_def_struct_ui_text(srna, "Cycles F-Modifier", "Repeat the values of the modified F-Curve");
@@ -817,26 +822,26 @@ static void rna_def_fmodifier_cycles(BlenderRNA *brna)
RNA_def_property_enum_sdna(prop, NULL, "before_mode");
RNA_def_property_enum_items(prop, prop_type_items);
RNA_def_property_ui_text(prop, "Before Mode", "Cycling mode to use before first keyframe");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);
prop = RNA_def_property(srna, "cycles_before", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "before_cycles");
RNA_def_property_ui_text(prop, "Before Cycles",
"Maximum number of cycles to allow before first keyframe (0 = infinite)");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);
/* after */
prop = RNA_def_property(srna, "mode_after", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "after_mode");
RNA_def_property_enum_items(prop, prop_type_items);
RNA_def_property_ui_text(prop, "After Mode", "Cycling mode to use after last keyframe");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);
prop = RNA_def_property(srna, "cycles_after", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "after_cycles");
RNA_def_property_ui_text(prop, "After Cycles",
"Maximum number of cycles to allow after last keyframe (0 = infinite)");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);
}
/* --------- */
@@ -865,46 +870,46 @@ static void rna_def_fmodifier_limits(BlenderRNA *brna)
prop = RNA_def_property(srna, "use_min_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", FCM_LIMIT_XMIN);
RNA_def_property_ui_text(prop, "Minimum X", "Use the minimum X value");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);
prop = RNA_def_property(srna, "use_min_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", FCM_LIMIT_YMIN);
RNA_def_property_ui_text(prop, "Minimum Y", "Use the minimum Y value");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);
prop = RNA_def_property(srna, "use_max_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", FCM_LIMIT_XMAX);
RNA_def_property_ui_text(prop, "Maximum X", "Use the maximum X value");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);
prop = RNA_def_property(srna, "use_max_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", FCM_LIMIT_YMAX);
RNA_def_property_ui_text(prop, "Maximum Y", "Use the maximum Y value");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);
prop = RNA_def_property(srna, "min_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "rect.xmin");
RNA_def_property_float_funcs(prop, NULL, NULL, "rna_FModifierLimits_minx_range");
RNA_def_property_ui_text(prop, "Minimum X", "Lowest X value to allow");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);
prop = RNA_def_property(srna, "min_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "rect.ymin");
RNA_def_property_float_funcs(prop, NULL, NULL, "rna_FModifierLimits_miny_range");
RNA_def_property_ui_text(prop, "Minimum Y", "Lowest Y value to allow");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);
prop = RNA_def_property(srna, "max_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "rect.xmax");
RNA_def_property_float_funcs(prop, NULL, NULL, "rna_FModifierLimits_maxx_range");
RNA_def_property_ui_text(prop, "Maximum X", "Highest X value to allow");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);
prop = RNA_def_property(srna, "max_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "rect.ymax");
RNA_def_property_float_funcs(prop, NULL, NULL, "rna_FModifierLimits_maxy_range");
RNA_def_property_ui_text(prop, "Maximum Y", "Highest Y value to allow");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);
}
/* --------- */
@@ -919,7 +924,8 @@ static void rna_def_fmodifier_noise(BlenderRNA *brna)
{FCM_NOISE_MODIF_ADD, "ADD", 0, "Add", ""},
{FCM_NOISE_MODIF_SUBTRACT, "SUBTRACT", 0, "Subtract", ""},
{FCM_NOISE_MODIF_MULTIPLY, "MULTIPLY", 0, "Multiply", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
srna = RNA_def_struct(brna, "FModifierNoise", "FModifier");
RNA_def_struct_ui_text(srna, "Noise F-Modifier", "Give randomness to the modified F-Curve");
@@ -929,28 +935,28 @@ static void rna_def_fmodifier_noise(BlenderRNA *brna)
RNA_def_property_enum_sdna(prop, NULL, "modification");
RNA_def_property_enum_items(prop, prop_modification_items);
RNA_def_property_ui_text(prop, "Blend Type", "Method of modifying the existing F-Curve");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);
prop = RNA_def_property(srna, "scale", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "size");
RNA_def_property_ui_text(prop, "Scale", "Scaling (in time) of the noise");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);
prop = RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "strength");
RNA_def_property_ui_text(prop, "Strength",
"Amplitude of the noise - the amount that it modifies the underlying curve");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);
prop = RNA_def_property(srna, "phase", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "phase");
RNA_def_property_ui_text(prop, "Phase", "A random seed for the noise effect");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);
prop = RNA_def_property(srna, "depth", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "depth");
RNA_def_property_ui_text(prop, "Depth", "Amount of fine level detail present in the noise");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);
}
@@ -971,36 +977,36 @@ static void rna_def_fmodifier_stepped(BlenderRNA *brna)
prop = RNA_def_property(srna, "frame_step", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "step_size");
RNA_def_property_ui_text(prop, "Step Size", "Number of frames to hold each value");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);
prop = RNA_def_property(srna, "frame_offset", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "offset");
RNA_def_property_ui_text(prop, "Offset",
"Reference number of frames before frames get held "
"(use to get hold for '1-3' vs '5-7' holding patterns)");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);
prop = RNA_def_property(srna, "use_frame_start", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", FCM_STEPPED_NO_BEFORE);
RNA_def_property_ui_text(prop, "Use Start Frame", "Restrict modifier to only act after its 'start' frame");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);
prop = RNA_def_property(srna, "use_frame_end", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", FCM_STEPPED_NO_AFTER);
RNA_def_property_ui_text(prop, "Use End Frame", "Restrict modifier to only act before its 'end' frame");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);
prop = RNA_def_property(srna, "frame_start", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "start_frame");
RNA_def_property_float_funcs(prop, NULL, NULL, "rna_FModifierStepped_start_frame_range");
RNA_def_property_ui_text(prop, "Start Frame", "Frame that modifier's influence starts (if applicable)");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);
prop = RNA_def_property(srna, "frame_end", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "end_frame");
RNA_def_property_float_funcs(prop, NULL, NULL, "rna_FModifierStepped_end_frame_range");
RNA_def_property_ui_text(prop, "End Frame", "Frame that modifier's influence ends (if applicable)");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);
}
/* --------- */
@@ -1017,7 +1023,7 @@ static void rna_def_fmodifier(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "F-Modifier", "Modifier for values of F-Curve");
#if 0 /* XXX not used yet */
/* name */
/* name */
prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_struct_name_property(srna, prop);
RNA_def_property_ui_text(prop, "Name", "Short description of F-Curve Modifier");
@@ -1038,21 +1044,21 @@ static void rna_def_fmodifier(BlenderRNA *brna)
prop = RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", FMODIFIER_FLAG_MUTED);
RNA_def_property_ui_text(prop, "Muted", "F-Curve Modifier will not be evaluated");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL);
RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME_PROP, NULL);
RNA_def_property_ui_icon(prop, ICON_MUTE_IPO_OFF, 1);
prop = RNA_def_property(srna, "is_valid", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", FMODIFIER_FLAG_DISABLED);
RNA_def_property_ui_text(prop, "Disabled", "F-Curve Modifier has invalid settings and will not be evaluated");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL);
RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME_PROP, NULL);
/* TODO: setting this to true must ensure that all others in stack are turned off too... */
/* TODO: setting this to true must ensure that all others in stack are turned off too... */
prop = RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", FMODIFIER_FLAG_ACTIVE);
RNA_def_property_ui_text(prop, "Active", "F-Curve Modifier is the one being edited ");
RNA_def_property_boolean_funcs(prop, NULL, "rna_FModifier_active_set");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, "rna_FModifier_active_update");
RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME_PROP, "rna_FModifier_active_update");
RNA_def_property_ui_icon(prop, ICON_RADIOBUT_OFF, 1);
/* restricted range */
@@ -1061,7 +1067,7 @@ static void rna_def_fmodifier(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Restrict Frame Range",
"F-Curve Modifier is only applied for the specified frame range to help "
"mask off effects in order to chain them");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL);
RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME_PROP, NULL);
RNA_def_property_ui_icon(prop, ICON_TRIA_RIGHT, 1); /* XXX: depends on UI implementation */
prop = RNA_def_property(srna, "frame_start", PROP_FLOAT, PROP_NONE);
@@ -1069,32 +1075,32 @@ static void rna_def_fmodifier(BlenderRNA *brna)
RNA_def_property_float_funcs(prop, NULL, NULL, "rna_FModifier_start_frame_range");
RNA_def_property_ui_text(prop, "Start Frame",
"Frame that modifier's influence starts (if Restrict Frame Range is in use)");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL);
RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME_PROP, NULL);
prop = RNA_def_property(srna, "frame_end", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "efra");
RNA_def_property_float_funcs(prop, NULL, NULL, "rna_FModifier_end_frame_range");
RNA_def_property_ui_text(prop, "End Frame",
"Frame that modifier's influence ends (if Restrict Frame Range is in use)");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL);
RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME_PROP, NULL);
prop = RNA_def_property(srna, "blend_in", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "blendin");
RNA_def_property_float_funcs(prop, NULL, NULL, "rna_FModifier_blending_range");
RNA_def_property_ui_text(prop, "Blend In", "Number of frames from start frame for influence to take effect");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL);
RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME_PROP, NULL);
prop = RNA_def_property(srna, "blend_out", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "blendout");
RNA_def_property_float_funcs(prop, NULL, NULL, "rna_FModifier_blending_range");
RNA_def_property_ui_text(prop, "Blend Out", "Number of frames from end frame for influence to fade out");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL);
RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME_PROP, NULL);
/* influence */
prop = RNA_def_property(srna, "use_influence", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", FMODIFIER_FLAG_USEINFLUENCE);
RNA_def_property_ui_text(prop, "Use Influence", "F-Curve Modifier's effects will be tempered by a default factor");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL);
RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME_PROP, NULL);
RNA_def_property_ui_icon(prop, ICON_TRIA_RIGHT, 1); /* XXX: depends on UI implementation */
prop = RNA_def_property(srna, "influence", PROP_FLOAT, PROP_FACTOR);
@@ -1103,7 +1109,7 @@ static void rna_def_fmodifier(BlenderRNA *brna)
RNA_def_property_float_default(prop, 1.0f);
RNA_def_property_ui_text(prop, "Influence",
"Amount of influence F-Curve Modifier will have when not fading in/out");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL);
RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME_PROP, NULL);
}
/* *********************** */
@@ -1123,7 +1129,8 @@ static void rna_def_drivertarget(BlenderRNA *brna)
{DTAR_TRANSCHAN_SCALEX, "SCALE_X", 0, "X Scale", ""},
{DTAR_TRANSCHAN_SCALEY, "SCALE_Y", 0, "Y Scale", ""},
{DTAR_TRANSCHAN_SCALEZ, "SCALE_Z", 0, "Z Scale", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem prop_local_space_items[] = {
{0, "WORLD_SPACE", 0, "World Space", "Transforms include effects of parenting/restpose and constraints"},
@@ -1132,7 +1139,8 @@ static void rna_def_drivertarget(BlenderRNA *brna)
{DTAR_FLAG_LOCALSPACE|DTAR_FLAG_LOCAL_CONSTS, "LOCAL_SPACE", 0, "Local Space",
"Transforms include effects of constraints but not "
"parenting/restpose"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
srna = RNA_def_struct(brna, "DriverTarget", NULL);
RNA_def_struct_ui_text(srna, "Driver Target", "Source of input values for driver variables");
@@ -1194,7 +1202,8 @@ static void rna_def_drivervar(BlenderRNA *brna)
"Final transformation value of object or bone"},
{DVAR_TYPE_ROT_DIFF, "ROTATION_DIFF", 0, "Rotational Difference", "Use the angle between two bones"},
{DVAR_TYPE_LOC_DIFF, "LOC_DIFF", 0, "Distance", "Distance between two bones or objects"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
srna = RNA_def_struct(brna, "DriverVariable", NULL);
@@ -1244,9 +1253,9 @@ static void rna_def_channeldriver_variables(BlenderRNA *brna, PropertyRNA *cprop
/* add variable */
func = RNA_def_function(srna, "new", "rna_Driver_new_variable");
RNA_def_function_ui_description(func, "Add a new variable for the driver");
/* return type */
/* return type */
parm = RNA_def_pointer(func, "var", "DriverVariable", "", "Newly created Driver Variable");
RNA_def_function_return(func, parm);
RNA_def_function_return(func, parm);
/* remove variable */
func = RNA_def_function(srna, "remove", "rna_Driver_remove_variable");
@@ -1254,7 +1263,7 @@ static void rna_def_channeldriver_variables(BlenderRNA *brna, PropertyRNA *cprop
RNA_def_function_flag(func, FUNC_USE_REPORTS);
/* target to remove */
parm = RNA_def_pointer(func, "variable", "DriverVariable", "", "Variable to remove from the driver");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL);
}
static void rna_def_channeldriver(BlenderRNA *brna)
@@ -1268,7 +1277,8 @@ static void rna_def_channeldriver(BlenderRNA *brna)
{DRIVER_TYPE_PYTHON, "SCRIPTED", 0, "Scripted Expression", ""},
{DRIVER_TYPE_MIN, "MIN", 0, "Minimum Value", ""},
{DRIVER_TYPE_MAX, "MAX", 0, "Maximum Value", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
srna = RNA_def_struct(brna, "Driver", NULL);
RNA_def_struct_sdna(srna, "ChannelDriver");
@@ -1324,14 +1334,14 @@ static void rna_def_fpoint(BlenderRNA *brna)
prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", 1);
RNA_def_property_ui_text(prop, "Select", "Selection status");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_SELECTED, NULL);
RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_SELECTED, NULL);
/* Vector value */
prop = RNA_def_property(srna, "co", PROP_FLOAT, PROP_COORDS); /* keyframes are dimensionless */
RNA_def_property_float_sdna(prop, NULL, "vec");
RNA_def_property_array(prop, 2);
RNA_def_property_ui_text(prop, "Point", "Point coordinates");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);
}
@@ -1351,30 +1361,30 @@ static void rna_def_fkeyframe(BlenderRNA *brna)
prop = RNA_def_property(srna, "select_left_handle", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "f1", 0);
RNA_def_property_ui_text(prop, "Handle 1 selected", "Left handle selection status");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_SELECTED, NULL);
RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_SELECTED, NULL);
prop = RNA_def_property(srna, "select_right_handle", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "f3", 0);
RNA_def_property_ui_text(prop, "Handle 2 selected", "Right handle selection status");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_SELECTED, NULL);
RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_SELECTED, NULL);
prop = RNA_def_property(srna, "select_control_point", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "f2", 0);
RNA_def_property_ui_text(prop, "Select", "Control point selection status");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_SELECTED, NULL);
RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_SELECTED, NULL);
/* Enums */
prop = RNA_def_property(srna, "handle_left_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "h1");
RNA_def_property_enum_items(prop, keyframe_handle_type_items);
RNA_def_property_ui_text(prop, "Left Handle Type", "Handle types");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL);
RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME_PROP, NULL);
prop = RNA_def_property(srna, "handle_right_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "h2");
RNA_def_property_enum_items(prop, keyframe_handle_type_items);
RNA_def_property_ui_text(prop, "Right Handle Type", "Handle types");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL);
RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME_PROP, NULL);
prop = RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "ipo");
@@ -1382,32 +1392,32 @@ static void rna_def_fkeyframe(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Interpolation",
"Interpolation method to use for segment of the F-Curve from "
"this Keyframe until the next Keyframe");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL);
RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME_PROP, NULL);
prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "hide");
RNA_def_property_enum_items(prop, beztriple_keyframe_type_items);
RNA_def_property_ui_text(prop, "Type", "Type of keyframe (for visual purposes only)");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL);
RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME_PROP, NULL);
/* Vector values */
prop = RNA_def_property(srna, "handle_left", PROP_FLOAT, PROP_COORDS); /* keyframes are dimensionless */
RNA_def_property_array(prop, 2);
RNA_def_property_float_funcs(prop, "rna_FKeyframe_handle1_get", "rna_FKeyframe_handle1_set", NULL);
RNA_def_property_ui_text(prop, "Left Handle", "Coordinates of the left handle (before the control point)");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);
prop = RNA_def_property(srna, "co", PROP_FLOAT, PROP_COORDS); /* keyframes are dimensionless */
RNA_def_property_array(prop, 2);
RNA_def_property_float_funcs(prop, "rna_FKeyframe_ctrlpoint_get", "rna_FKeyframe_ctrlpoint_set", NULL);
RNA_def_property_ui_text(prop, "Control Point", "Coordinates of the control point");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);
prop = RNA_def_property(srna, "handle_right", PROP_FLOAT, PROP_COORDS); /* keyframes are dimensionless */
RNA_def_property_array(prop, 2);
RNA_def_property_float_funcs(prop, "rna_FKeyframe_handle2_get", "rna_FKeyframe_handle2_set", NULL);
RNA_def_property_ui_text(prop, "Right Handle", "Coordinates of the right handle (after the control point)");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);
}
static void rna_def_fcurve_modifiers(BlenderRNA *brna, PropertyRNA *cprop)
@@ -1448,7 +1458,7 @@ static void rna_def_fcurve_modifiers(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_ui_description(func, "Remove a modifier from this F-Curve");
/* modifier to remove */
parm = RNA_def_pointer(func, "modifier", "FModifier", "", "Removed modifier");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL);
}
/* fcurve.keyframe_points */
@@ -1463,7 +1473,8 @@ static void rna_def_fcurve_keyframe_points(BlenderRNA *brna, PropertyRNA *cprop)
{INSERTKEY_REPLACE, "REPLACE", 0, "Replace", "Don't add any new keyframes, but just replace existing ones"},
{INSERTKEY_NEEDED, "NEEDED", 0, "Needed", "Only adds keyframes that are needed"},
{INSERTKEY_FAST, "FAST", 0, "Fast", "Fast keyframe insertion to avoid recalculating the curve each time"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
RNA_def_property_srna(cprop, "FCurveKeyframePoints");
srna = RNA_def_struct(brna, "FCurveKeyframePoints", NULL);
@@ -1492,7 +1503,7 @@ static void rna_def_fcurve_keyframe_points(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_ui_description(func, "Remove keyframe from an F-Curve");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
parm = RNA_def_pointer(func, "keyframe", "Keyframe", "", "Keyframe to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL);
/* optional */
RNA_def_boolean(func, "fast", 0, "Fast", "Fast keyframe removal to avoid recalculating the curve each time");
}
@@ -1507,12 +1518,14 @@ static void rna_def_fcurve(BlenderRNA *brna)
static EnumPropertyItem prop_mode_extend_items[] = {
{FCURVE_EXTRAPOLATE_CONSTANT, "CONSTANT", 0, "Constant", ""},
{FCURVE_EXTRAPOLATE_LINEAR, "LINEAR", 0, "Linear", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem prop_mode_color_items[] = {
{FCURVE_COLOR_AUTO_RAINBOW, "AUTO_RAINBOW", 0, "Auto Rainbow", ""},
{FCURVE_COLOR_AUTO_RGB, "AUTO_RGB", 0, "Auto XYZ to RGB", ""},
{FCURVE_COLOR_CUSTOM, "CUSTOM", 0, "User Defined", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
srna = RNA_def_struct(brna, "FCurve", NULL);
RNA_def_struct_ui_text(srna, "F-Curve", "F-Curve defining values of a period of time");
@@ -1523,7 +1536,7 @@ static void rna_def_fcurve(BlenderRNA *brna)
RNA_def_property_enum_sdna(prop, NULL, "extend");
RNA_def_property_enum_items(prop, prop_mode_extend_items);
RNA_def_property_ui_text(prop, "Extrapolation", "");
/* XXX need an update callback for this so that animation gets evaluated */
/* XXX need an update callback for this so that animation gets evaluated */
RNA_def_property_update(prop, NC_ANIMATION, NULL);
/* Pointers */
@@ -1543,14 +1556,14 @@ static void rna_def_fcurve(BlenderRNA *brna)
RNA_def_property_string_funcs(prop, "rna_FCurve_RnaPath_get", "rna_FCurve_RnaPath_length",
"rna_FCurve_RnaPath_set");
RNA_def_property_ui_text(prop, "Data Path", "RNA Path to property affected by F-Curve");
/* XXX need an update callback for this to that animation gets evaluated */
/* XXX need an update callback for this to that animation gets evaluated */
RNA_def_property_update(prop, NC_ANIMATION, NULL);
/* called 'index' when given as function arg */
prop = RNA_def_property(srna, "array_index", PROP_INT, PROP_NONE);
RNA_def_property_ui_text(prop, "RNA Array Index",
"Index to the specific property affected by F-Curve if applicable");
/* XXX need an update callback for this so that animation gets evaluated */
/* XXX need an update callback for this so that animation gets evaluated */
RNA_def_property_update(prop, NC_ANIMATION, NULL);
/* Color */
@@ -1569,22 +1582,22 @@ static void rna_def_fcurve(BlenderRNA *brna)
prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", FCURVE_SELECTED);
RNA_def_property_ui_text(prop, "Select", "F-Curve is selected for editing");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_SELECTED, NULL);
RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_SELECTED, NULL);
prop = RNA_def_property(srna, "lock", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", FCURVE_PROTECTED);
RNA_def_property_ui_text(prop, "Lock", "F-Curve's settings cannot be edited");
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, "mute", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", FCURVE_MUTED);
RNA_def_property_ui_text(prop, "Muted", "F-Curve is not evaluated");
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, "hide", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", FCURVE_VISIBLE);
RNA_def_property_ui_text(prop, "Hide", "F-Curve and its keyframes are hidden in the Graph Editor graphs");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_GRAPH, NULL);
/* State Info (for Debugging) */
prop = RNA_def_property(srna, "is_valid", PROP_BOOLEAN, PROP_NONE);
@@ -1592,7 +1605,7 @@ static void rna_def_fcurve(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Valid",
"False when F-Curve could not be evaluated in past, so should be skipped "
"when evaluating");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL);
RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME_PROP, NULL);
/* Collections */
prop = RNA_def_property(srna, "sampled_points", PROP_COLLECTION, PROP_NONE);
@@ -1635,8 +1648,8 @@ static void rna_def_fcurve(BlenderRNA *brna)
void RNA_def_fcurve(BlenderRNA *brna)
{
rna_def_fcurve(brna);
rna_def_fkeyframe(brna);
rna_def_fpoint(brna);
rna_def_fkeyframe(brna);
rna_def_fpoint(brna);
rna_def_drivertarget(brna);
rna_def_drivervar(brna);
@@ -1646,8 +1659,10 @@ void RNA_def_fcurve(BlenderRNA *brna)
rna_def_fmodifier_generator(brna);
rna_def_fmodifier_function_generator(brna);
rna_def_fmodifier_envelope(brna);
rna_def_fmodifier_envelope_ctrl(brna);
rna_def_fmodifier_envelope_ctrl(brna);
rna_def_fmodifier_cycles(brna);
rna_def_fmodifier_python(brna);
rna_def_fmodifier_limits(brna);

View File

@@ -51,9 +51,9 @@
#include "BKE_particle.h"
#include "BKE_pointcache.h"
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) {
case OB_FLUIDSIM_DOMAIN:
@@ -80,7 +80,7 @@ static void rna_fluid_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerR
Object *ob = ptr->id.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);
}
static int fluidsim_find_lastframe(Object *ob, FluidsimSettings *fss)
@@ -103,7 +103,7 @@ static int fluidsim_find_lastframe(Object *ob, FluidsimSettings *fss)
static void rna_fluid_find_enframe(Main *bmain, Scene *scene, PointerRNA *ptr)
{
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) {
fluidmd->fss->lastgoodframe = fluidsim_find_lastframe(ob, fluidmd->fss);
@@ -116,13 +116,13 @@ static void rna_fluid_find_enframe(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;
ParticleSystemModifierData *psmd;
ParticleSystem *psys;
ParticleSettings *part;
fluidmd = (FluidsimModifierData*)modifiers_findByType(ob, eModifierType_Fluidsim);
fluidmd = (FluidsimModifierData *)modifiers_findByType(ob, eModifierType_Fluidsim);
fluidmd->fss->flag &= ~OB_FLUIDSIM_REVERSE; /* clear flag */
/* remove fluidsim particle system */
@@ -144,7 +144,7 @@ static void rna_FluidSettings_update_type(Main *bmain, Scene *scene, PointerRNA
BLI_addtail(&ob->particlesystem, psys);
/* add modifier */
psmd = (ParticleSystemModifierData*)modifier_new(eModifierType_ParticleSystem);
psmd = (ParticleSystemModifierData *)modifier_new(eModifierType_ParticleSystem);
BLI_strncpy(psmd->modifier.name, "FluidParticleSystem", sizeof(psmd->modifier.name));
psmd->psys = psys;
BLI_addtail(&ob->modifiers, psmd);
@@ -175,8 +175,8 @@ static void rna_DomainFluidSettings_memory_estimate_get(PointerRNA *ptr, char *v
(void)ptr;
value[0] = '\0';
#else
Object *ob = (Object*)ptr->id.data;
FluidsimSettings *fss = (FluidsimSettings*)ptr->data;
Object *ob = (Object *)ptr->id.data;
FluidsimSettings *fss = (FluidsimSettings *)ptr->data;
fluid_estimate_memory(ob, fss, value);
#endif
@@ -193,7 +193,7 @@ static int rna_DomainFluidSettings_memory_estimate_length(PointerRNA *UNUSED(ptr
static char *rna_FluidSettings_path(PointerRNA *ptr)
{
FluidsimSettings *fss = (FluidsimSettings*)ptr->data;
FluidsimSettings *fss = (FluidsimSettings *)ptr->data;
ModifierData *md = (ModifierData *)fss->fmd;
return BLI_sprintfN("modifiers[\"%s\"].settings", md->name);
@@ -201,13 +201,13 @@ static char *rna_FluidSettings_path(PointerRNA *ptr)
static void rna_FluidMeshVertex_data_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
FluidsimSettings *fss = (FluidsimSettings*)ptr->data;
rna_iterator_array_begin(iter, fss->meshVelocities, sizeof(float)*3, fss->totvert, 0, NULL);
FluidsimSettings *fss = (FluidsimSettings *)ptr->data;
rna_iterator_array_begin(iter, fss->meshVelocities, sizeof(float) * 3, fss->totvert, 0, NULL);
}
static int rna_FluidMeshVertex_data_length(PointerRNA *ptr)
{
FluidsimSettings *fss = (FluidsimSettings*)ptr->data;
FluidsimSettings *fss = (FluidsimSettings *)ptr->data;
return fss->totvert;
}
@@ -225,7 +225,8 @@ static void rna_def_fluidsim_slip(StructRNA *srna)
"Mix between no-slip and free-slip (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);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "typeFlags");
@@ -267,7 +268,8 @@ static void rna_def_fluidsim_domain(BlenderRNA *brna)
{OB_FSDOM_GEOM, "GEOMETRY", 0, "Geometry", "Display geometry"},
{OB_FSDOM_PREVIEW, "PREVIEW", 0, "Preview", "Display preview quality results"},
{OB_FSDOM_FINAL, "FINAL", 0, "Final", "Display final quality results"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
srna = RNA_def_struct(brna, "DomainFluidSettings", "FluidSettings");
RNA_def_struct_sdna(srna, "FluidsimSettings");
@@ -446,7 +448,8 @@ static void rna_def_fluidsim_volume(StructRNA *srna)
{1, "VOLUME", 0, "Volume", "Use only the inner volume of the mesh"},
{2, "SHELL", 0, "Shell", "Use only 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);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "volumeInitType");
@@ -675,8 +678,9 @@ void RNA_def_fluidsim(BlenderRNA *brna)
"Object is made a particle system to display particles generated by a "
"fluidsim domain object"},
{OB_FLUIDSIM_CONTROL, "CONTROL", 0, "Control",
"Object is made a fluid control mesh, which influences the fluid"},
{0, NULL, 0, NULL, NULL}};
"Object is made a fluid control mesh, which influences the fluid"},
{0, NULL, 0, NULL, NULL}
};
srna = RNA_def_struct(brna, "FluidSettings", NULL);

View File

@@ -116,13 +116,13 @@ static void rna_def_gpencil_stroke_point(BlenderRNA *brna)
RNA_def_property_float_sdna(prop, NULL, "x");
RNA_def_property_array(prop, 3);
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);
RNA_def_property_float_sdna(prop, NULL, "pressure");
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_update(prop, NC_SCREEN|ND_GPENCIL, NULL);
RNA_def_property_update(prop, NC_SCREEN | ND_GPENCIL, NULL);
}
static void rna_def_gpencil_stroke(BlenderRNA *brna)
@@ -207,26 +207,26 @@ static void rna_def_gpencil_layer(BlenderRNA *brna)
RNA_def_property_array(prop, 3);
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_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);
RNA_def_property_float_sdna(prop, NULL, "color[3]");
RNA_def_property_range(prop, 0.3, 1.0f);
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 */
prop = RNA_def_property(srna, "line_width", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "thickness");
RNA_def_property_range(prop, 1, 10);
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 */
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_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);
RNA_def_property_int_sdna(prop, NULL, "gstep");
@@ -234,23 +234,23 @@ static void rna_def_gpencil_layer(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Max Ghost Range",
"Maximum number of frames on either side of the active frame to show "
"(0 = show the 'first' available sketch on either side)");
RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL);
RNA_def_property_update(prop, NC_SCREEN | ND_GPENCIL, NULL);
/* Flags */
prop = RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_HIDE);
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);
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_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);
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_update(prop, NC_SCREEN|ND_GPENCIL, NULL);
RNA_def_property_update(prop, NC_SCREEN | ND_GPENCIL, NULL);
/* expose as layers.active */
#if 0
@@ -258,25 +258,25 @@ static void rna_def_gpencil_layer(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_ACTIVE);
RNA_def_property_boolean_funcs(prop, NULL, "rna_GPencilLayer_active_set");
RNA_def_property_ui_text(prop, "Active", "Set active layer for editing");
RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL);
RNA_def_property_update(prop, NC_SCREEN | ND_GPENCIL, NULL);
#endif
prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
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_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);
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_update(prop, NC_SCREEN|ND_GPENCIL, NULL);
RNA_def_property_update(prop, NC_SCREEN | ND_GPENCIL, NULL);
/* X-Ray */
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_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);
}
static void rna_def_gpencil_layers(BlenderRNA *brna, PropertyRNA *cprop)
@@ -304,7 +304,7 @@ static void rna_def_gpencil_layers(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_ui_description(func, "Remove a spline from a curve");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
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
prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
@@ -322,9 +322,10 @@ static void rna_def_gpencil_data(BlenderRNA *brna)
static EnumPropertyItem draw_mode_items[] = {
{GP_DATA_VIEWALIGN, "CURSOR", 0, "Cursor", "Draw stroke at the 3D cursor"},
{0, "VIEW", 0, "View", "Stick stroke to the view "}, /* weird, GP_DATA_VIEWALIGN is inverted */
{GP_DATA_VIEWALIGN|GP_DATA_DEPTH_VIEW, "SURFACE", 0, "Surface", "Stick stroke to surfaces"},
{GP_DATA_VIEWALIGN|GP_DATA_DEPTH_STROKE, "STROKE", 0, "Stroke", "Stick stroke to other strokes"},
{0, NULL, 0, NULL, NULL}};
{GP_DATA_VIEWALIGN | GP_DATA_DEPTH_VIEW, "SURFACE", 0, "Surface", "Stick stroke to surfaces"},
{GP_DATA_VIEWALIGN | GP_DATA_DEPTH_STROKE, "STROKE", 0, "Stroke", "Stick stroke to other strokes"},
{0, NULL, 0, NULL, NULL}
};
srna = RNA_def_struct(brna, "GreasePencil", "ID");
RNA_def_struct_sdna(srna, "bGPdata");

View File

@@ -48,27 +48,27 @@ static PointerRNA rna_Group_objects_get(CollectionPropertyIterator *iter)
ListBaseIterator *internal = iter->internal;
/* 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);
}
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)) {
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;
}
WM_main_add_notifier(NC_OBJECT|ND_DRAW, &object->id);
WM_main_add_notifier(NC_OBJECT | ND_DRAW, &object->id);
}
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)) {
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;
}
WM_main_add_notifier(NC_OBJECT|ND_DRAW, &object->id);
WM_main_add_notifier(NC_OBJECT | ND_DRAW, &object->id);
}
#else
@@ -89,16 +89,16 @@ static void rna_def_group_objects(BlenderRNA *brna, PropertyRNA *cprop)
/* add object */
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");
/* 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 */
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_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
RNA_def_function_flag(func, FUNC_USE_CONTEXT | FUNC_USE_REPORTS);
/* object to remove */
parm = RNA_def_pointer(func, "object", "Object", "", "Object to remove");
RNA_def_property_flag(parm, PROP_REQUIRED);
@@ -113,7 +113,7 @@ void RNA_def_group(BlenderRNA *brna)
srna = RNA_def_struct(brna, "Group", "ID");
RNA_def_struct_ui_text(srna, "Group", "Group of Object datablocks");
RNA_def_struct_ui_icon(srna, ICON_GROUP);
/* this is done on save/load in readfile.c, removed if no objects are in the group */
/* 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);
prop = RNA_def_property(srna, "dupli_offset", PROP_FLOAT, PROP_TRANSLATION);

View File

@@ -48,7 +48,8 @@ static EnumPropertyItem image_source_items[] = {
{IMA_SRC_MOVIE, "MOVIE", 0, "Movie", "Movie file"},
{IMA_SRC_GENERATED, "GENERATED", 0, "Generated", "Generated image"},
{IMA_SRC_VIEWER, "VIEWER", 0, "Viewer", "Compositing node viewer"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
#ifdef RNA_RUNTIME
@@ -56,20 +57,20 @@ static EnumPropertyItem image_source_items[] = {
static void rna_Image_animated_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
Image *ima = (Image*)ptr->data;
int nr;
Image *ima = (Image *)ptr->data;
int nr;
if (ima->flag & IMA_TWINANIM) {
nr = ima->xrep*ima->yrep;
nr = ima->xrep * ima->yrep;
if (ima->twsta >= nr) ima->twsta = 1;
if (ima->twend >= nr) ima->twend = nr-1;
if (ima->twsta>ima->twend) ima->twsta = 1;
if (ima->twend >= nr) ima->twend = nr - 1;
if (ima->twsta > ima->twend) ima->twsta = 1;
}
}
static int rna_Image_dirty_get(PointerRNA *ptr)
{
Image *ima = (Image*)ptr->data;
Image *ima = (Image *)ptr->data;
ImBuf *ibuf;
for (ibuf = ima->ibufs.first; ibuf; ibuf = ibuf->next)
@@ -111,7 +112,7 @@ static void rna_Image_free_update(Main *UNUSED(bmain), Scene *UNUSED(scene), Poi
{
Image *ima = ptr->id.data;
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);
}
@@ -120,7 +121,7 @@ static void rna_Image_reload_update(Main *UNUSED(bmain), Scene *UNUSED(scene), P
{
Image *ima = ptr->id.data;
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);
}
@@ -144,8 +145,8 @@ char *rna_ImageUser_path(PointerRNA *ptr)
/* ImageUser *iuser= ptr->data; */
switch (GS(((ID *)ptr->id.data)->name)) {
case ID_TE:
return BLI_strdup("image_user");
case ID_TE:
return BLI_strdup("image_user");
}
}
@@ -155,7 +156,7 @@ char *rna_ImageUser_path(PointerRNA *ptr)
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;
int totitem = 0;
@@ -177,22 +178,22 @@ static EnumPropertyItem *rna_Image_source_itemf(bContext *UNUSED(C), PointerRNA
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);
return BKE_ftype_to_imtype(ibuf ? ibuf->ftype : 0);
}
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 */
ImBuf *ibuf;
int ftype = BKE_imtype_to_ftype(value);
#if 0
ibuf= BKE_image_get_ibuf(image, NULL);
ibuf = BKE_image_get_ibuf(image, NULL);
if (ibuf)
ibuf->ftype= ftype;
ibuf->ftype = ftype;
#endif
/* to be safe change all buffer file types */
@@ -204,7 +205,7 @@ static void rna_Image_file_format_set(PointerRNA *ptr, int value)
static int rna_Image_has_data_get(PointerRNA *ptr)
{
Image *im = (Image*)ptr->data;
Image *im = (Image *)ptr->data;
if (im->ibufs.first)
return 1;
@@ -214,7 +215,7 @@ static int rna_Image_has_data_get(PointerRNA *ptr)
static void rna_Image_size_get(PointerRNA *ptr, int *values)
{
Image *im = (Image*)ptr->data;
Image *im = (Image *)ptr->data;
ImBuf *ibuf;
void *lock;
@@ -233,7 +234,7 @@ static void rna_Image_size_get(PointerRNA *ptr, int *values)
static void rna_Image_resolution_get(PointerRNA *ptr, float *values)
{
Image *im = (Image*)ptr->data;
Image *im = (Image *)ptr->data;
ImBuf *ibuf;
void *lock;
@@ -252,7 +253,7 @@ static void rna_Image_resolution_get(PointerRNA *ptr, 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;
void *lock;
@@ -267,7 +268,7 @@ static void rna_Image_resolution_set(PointerRNA *ptr, const float *values)
static int rna_Image_depth_get(PointerRNA *ptr)
{
Image *im = (Image*)ptr->data;
Image *im = (Image *)ptr->data;
ImBuf *ibuf;
void *lock;
int planes;
@@ -295,7 +296,7 @@ static int rna_Image_pixels_get_length(PointerRNA *ptr, int length[RNA_MAX_ARRAY
ibuf = BKE_image_acquire_ibuf(ima, NULL, &lock);
if (ibuf)
length[0] = ibuf->x*ibuf->y*ibuf->channels;
length[0] = ibuf->x * ibuf->y * ibuf->channels;
else
length[0] = 0;
@@ -314,14 +315,14 @@ static void rna_Image_pixels_get(PointerRNA *ptr, float *values)
ibuf = BKE_image_acquire_ibuf(ima, NULL, &lock);
if (ibuf) {
size = ibuf->x*ibuf->y*ibuf->channels;
size = ibuf->x * ibuf->y * ibuf->channels;
if (ibuf->rect_float) {
memcpy(values, ibuf->rect_float, sizeof(float)*size);
memcpy(values, ibuf->rect_float, sizeof(float) * size);
}
else {
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);
}
}
@@ -338,14 +339,14 @@ static void rna_Image_pixels_set(PointerRNA *ptr, const float *values)
ibuf = BKE_image_acquire_ibuf(ima, NULL, &lock);
if (ibuf) {
size = ibuf->x*ibuf->y*ibuf->channels;
size = ibuf->x * ibuf->y * ibuf->channels;
if (ibuf->rect_float) {
memcpy(ibuf->rect_float, values, sizeof(float)*size);
memcpy(ibuf->rect_float, values, sizeof(float) * size);
}
else {
for (i = 0; i < size; i++)
((unsigned char*)ibuf->rect)[i] = FTOCHAR(values[i]);
((unsigned char *)ibuf->rect)[i] = FTOCHAR(values[i]);
}
ibuf->userflags |= IB_BITMAPDIRTY;
@@ -423,20 +424,24 @@ static void rna_def_image(BlenderRNA *brna)
{IMA_TYPE_UV_TEST, "UV_TEST", 0, "UV Test", ""},
{IMA_TYPE_R_RESULT, "RENDER_RESULT", 0, "Render Result", ""},
{IMA_TYPE_COMPOSITE, "COMPOSITING", 0, "Compositing", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static const EnumPropertyItem prop_generated_type_items[] = {
{0, "BLANK", 0, "Blank", "Generate a blank image"},
{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"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static const EnumPropertyItem prop_mapping_items[] = {
{0, "UV", 0, "UV Coordinates", "Use UV coordinates 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[] = {
{0, "EVEN", 0, "Upper First", "Upper 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");
RNA_def_struct_ui_text(srna, "Image", "Image datablock referencing an external or packed image");
@@ -445,7 +450,7 @@ static void rna_def_image(BlenderRNA *brna)
prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
RNA_def_property_string_sdna(prop, NULL, "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 :( */
prop = RNA_def_property(srna, "filepath_raw", PROP_STRING, PROP_FILEPATH);
@@ -461,13 +466,13 @@ static void rna_def_image(BlenderRNA *brna)
RNA_def_property_enum_items(prop, image_source_items);
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_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);
RNA_def_property_enum_items(prop, prop_type_items);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
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);
RNA_def_property_pointer_sdna(prop, NULL, "packedfile");
@@ -477,25 +482,25 @@ static void rna_def_image(BlenderRNA *brna)
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
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_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, NULL);
/* booleans */
prop = RNA_def_property(srna, "use_fields", PROP_BOOLEAN, PROP_NONE);
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_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);
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_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);
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_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);
RNA_def_property_boolean_funcs(prop, "rna_Image_dirty_get", NULL);
@@ -507,100 +512,100 @@ static void rna_def_image(BlenderRNA *brna)
RNA_def_property_enum_sdna(prop, NULL, "gen_type");
RNA_def_property_enum_items(prop, prop_generated_type_items);
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);
RNA_def_property_int_sdna(prop, NULL, "gen_x");
RNA_def_property_range(prop, 1, 16384);
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);
RNA_def_property_int_sdna(prop, NULL, "gen_y");
RNA_def_property_range(prop, 1, 16384);
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);
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_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 */
prop = RNA_def_property(srna, "mapping", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
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_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);
RNA_def_property_float_sdna(prop, NULL, "aspx");
RNA_def_property_array(prop, 2);
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_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);
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_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);
RNA_def_property_int_sdna(prop, NULL, "twsta");
RNA_def_property_range(prop, 0, 128);
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);
RNA_def_property_int_sdna(prop, NULL, "twend");
RNA_def_property_range(prop, 0, 128);
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);
RNA_def_property_int_sdna(prop, NULL, "animspeed");
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_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);
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_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);
RNA_def_property_int_sdna(prop, NULL, "xrep");
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_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);
RNA_def_property_int_sdna(prop, NULL, "yrep");
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_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);
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_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);
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_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);
RNA_def_property_int_sdna(prop, NULL, "bindcode");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Bindcode", "OpenGL bindcode");
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, "render_slot", PROP_INT, PROP_UNSIGNED);
RNA_def_property_range(prop, 0, IMA_MAX_RENDER_SLOT - 1);
RNA_def_property_ui_text(prop, "Render Slot", "The current render slot displayed, only for viewer type images");
RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, NULL);
/*
* Image.has_data and Image.depth are temporary,

View File

@@ -109,7 +109,7 @@ static void rna_Image_save(Image *image, ReportList *reports)
if (image->packedfile) {
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)) {
@@ -121,11 +121,11 @@ static void rna_Image_save(Image *image, ReportList *reports)
ibuf->userflags &= ~IB_BITMAPDIRTY;
}
else {
BKE_reportf(reports, RPT_ERROR, "Image \"%s\" could not be saved to \"%s\"", image->id.name+2, image->name);
BKE_reportf(reports, RPT_ERROR, "Image \"%s\" could not be saved to \"%s\"", image->id.name + 2, image->name);
}
}
else {
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);
}
}
@@ -157,7 +157,7 @@ static void rna_Image_unpack(Image *image, ReportList *reports, int method)
}
else {
/* reports its own error on failure */
unpackImage (reports, image, method);
unpackImage(reports, image, method);
}
}
@@ -171,7 +171,7 @@ static void rna_Image_update(Image *image, ReportList *reports)
ImBuf *ibuf = BKE_image_get_ibuf(image, 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;
}
@@ -189,13 +189,13 @@ static int rna_Image_gl_load(Image *image, ReportList *reports, int filter, int
ibuf = BKE_image_get_ibuf(image, NULL);
if (ibuf == NULL || ibuf->rect == NULL ) {
BKE_reportf(reports, RPT_ERROR, "Image \"%s\" does not have any image data", image->id.name+2);
if (ibuf == NULL || ibuf->rect == NULL) {
BKE_reportf(reports, RPT_ERROR, "Image \"%s\" does not have any image data", image->id.name + 2);
return (int)GL_INVALID_OPERATION;
}
/* could be made into a function? */
glGenTextures(1, (GLuint*)bind);
glGenTextures(1, (GLuint *)bind);
glBindTexture(GL_TEXTURE_2D, *bind);
if (filter != GL_NEAREST && filter != GL_LINEAR)
@@ -212,7 +212,7 @@ static int rna_Image_gl_load(Image *image, ReportList *reports, int filter, int
}
if (error) {
glDeleteTextures(1, (GLuint*)bind);
glDeleteTextures(1, (GLuint *)bind);
image->bindcode = 0;
}
@@ -236,7 +236,7 @@ void RNA_api_image(StructRNA *srna)
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_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");
RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_pointer(func, "scene", "Scene", "", "Scene to take image parameters from");

View File

@@ -57,11 +57,11 @@
static Key *rna_ShapeKey_find_key(ID *id)
{
switch (GS(id->name)) {
case ID_CU: return ((Curve*)id)->key;
case ID_KE: return (Key*)id;
case ID_LT: return ((Lattice*)id)->key;
case ID_ME: return ((Mesh*)id)->key;
case ID_OB: return ob_get_key((Object*)id);
case ID_CU: return ((Curve *)id)->key;
case ID_KE: return (Key *)id;
case ID_LT: return ((Lattice *)id)->key;
case ID_ME: return ((Mesh *)id)->key;
case ID_OB: return ob_get_key((Object *)id);
default: return NULL;
}
}
@@ -89,14 +89,14 @@ void rna_ShapeKey_name_set(PointerRNA *ptr, const char *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);
data->curval = value;
}
static void rna_ShapeKey_value_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax)
{
KeyBlock *data = (KeyBlock*)ptr->data;
KeyBlock *data = (KeyBlock *)ptr->data;
*min = data->slidermin;
*max = data->slidermax;
@@ -107,7 +107,7 @@ static void rna_ShapeKey_value_range(PointerRNA *ptr, float *min, float *max, fl
static void rna_ShapeKey_slider_min_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax)
{
KeyBlock *data = (KeyBlock*)ptr->data;
KeyBlock *data = (KeyBlock *)ptr->data;
*min = -10.0f;
*max = data->slidermax - SHAPEKEY_SLIDER_TOL;
@@ -115,7 +115,7 @@ static void rna_ShapeKey_slider_min_range(PointerRNA *ptr, float *min, float *ma
static void rna_ShapeKey_slider_min_set(PointerRNA *ptr, float value)
{
KeyBlock *data = (KeyBlock*)ptr->data;
KeyBlock *data = (KeyBlock *)ptr->data;
float min, max, softmin, softmax;
rna_ShapeKey_slider_min_range(ptr, &min, &max, &softmin, &softmax);
@@ -125,7 +125,7 @@ static void rna_ShapeKey_slider_min_set(PointerRNA *ptr, float value)
static void rna_ShapeKey_slider_max_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax)
{
KeyBlock *data = (KeyBlock*)ptr->data;
KeyBlock *data = (KeyBlock *)ptr->data;
*min = data->slidermin + SHAPEKEY_SLIDER_TOL;
*max = 10.0f;
@@ -133,7 +133,7 @@ static void rna_ShapeKey_slider_max_range(PointerRNA *ptr, float *min, float *ma
static void rna_ShapeKey_slider_max_set(PointerRNA *ptr, float value)
{
KeyBlock *data = (KeyBlock*)ptr->data;
KeyBlock *data = (KeyBlock *)ptr->data;
float min, max, softmin, softmax;
rna_ShapeKey_slider_max_range(ptr, &min, &max, &softmin, &softmax);
@@ -171,21 +171,21 @@ int rna_object_shapekey_index_set(ID *id, PointerRNA value, int current)
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);
}
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);
}
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[1] = vec[1];
@@ -194,7 +194,7 @@ static void rna_ShapeKeyPoint_co_get(PointerRNA *ptr, 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[1] = values[1];
@@ -203,37 +203,37 @@ static void rna_ShapeKeyPoint_co_set(PointerRNA *ptr, const float *values)
static float rna_ShapeKeyCurvePoint_tilt_get(PointerRNA *ptr)
{
float *vec = (float*)ptr->data;
float *vec = (float *)ptr->data;
return vec[3];
}
static void rna_ShapeKeyCurvePoint_tilt_set(PointerRNA *ptr, float value)
{
float *vec = (float*)ptr->data;
float *vec = (float *)ptr->data;
vec[3] = value;
}
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[1] = vec[1+3];
values[2] = vec[2+3];
values[0] = vec[0 + 3];
values[1] = vec[1 + 3];
values[2] = vec[2 + 3];
}
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[1+3] = values[1];
vec[2+3] = values[2];
vec[0 + 3] = values[0];
vec[1 + 3] = values[1];
vec[2 + 3] = values[2];
}
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[1] = vec[1];
@@ -242,7 +242,7 @@ static void rna_ShapeKeyBezierPoint_handle_1_co_get(PointerRNA *ptr, float *valu
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[1] = values[1];
@@ -251,46 +251,46 @@ static void rna_ShapeKeyBezierPoint_handle_1_co_set(PointerRNA *ptr, const float
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[1] = vec[6+1];
values[2] = vec[6+2];
values[0] = vec[6 + 0];
values[1] = vec[6 + 1];
values[2] = vec[6 + 2];
}
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+1] = values[1];
vec[6+2] = values[2];
vec[6 + 0] = values[0];
vec[6 + 1] = values[1];
vec[6 + 2] = values[2];
}
#if 0
static float rna_ShapeKeyBezierPoint_tilt_get(PointerRNA *ptr)
{
float *vec= (float*)ptr->data;
float *vec = (float *)ptr->data;
return vec[10];
}
static void rna_ShapeKeyBezierPoint_tilt_set(PointerRNA *ptr, float value)
{
float *vec= (float*)ptr->data;
vec[10]= value;
float *vec = (float *)ptr->data;
vec[10] = value;
}
#endif
static void rna_ShapeKey_data_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
Key *key = rna_ShapeKey_find_key(ptr->id.data);
KeyBlock *kb = (KeyBlock*)ptr->data;
KeyBlock *kb = (KeyBlock *)ptr->data;
Curve *cu;
Nurb *nu;
int tot = kb->totelem, size = key->elemsize;
if (GS(key->from->name) == ID_CU) {
cu = (Curve*)key->from;
cu = (Curve *)key->from;
nu = cu->nurb.first;
if (nu->bezt) {
@@ -299,19 +299,19 @@ static void rna_ShapeKey_data_begin(CollectionPropertyIterator *iter, PointerRNA
}
}
rna_iterator_array_begin(iter, (void*)kb->data, size, tot, 0, NULL);
rna_iterator_array_begin(iter, (void *)kb->data, size, tot, 0, NULL);
}
static int rna_ShapeKey_data_length(PointerRNA *ptr)
{
Key *key = rna_ShapeKey_find_key(ptr->id.data);
KeyBlock *kb = (KeyBlock*)ptr->data;
KeyBlock *kb = (KeyBlock *)ptr->data;
Curve *cu;
Nurb *nu;
int tot = kb->totelem;
if (GS(key->from->name) == ID_CU) {
cu = (Curve*)key->from;
cu = (Curve *)key->from;
nu = cu->nurb.first;
if (nu->bezt)
@@ -329,7 +329,7 @@ static PointerRNA rna_ShapeKey_data_get(CollectionPropertyIterator *iter)
Nurb *nu;
if (GS(key->from->name) == ID_CU) {
cu = (Curve*)key->from;
cu = (Curve *)key->from;
nu = cu->nurb.first;
if (nu->bezt)
@@ -362,7 +362,7 @@ static void rna_Key_update_data(Main *bmain, Scene *UNUSED(scene), PointerRNA *p
for (ob = bmain->object.first; ob; ob = ob->id.next) {
if (ob_get_key(ob) == key) {
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);
}
}
}
@@ -440,7 +440,7 @@ static char *rna_ShapeKeyPoint_path(PointerRNA *ptr)
return BLI_sprintfN("shape_keys.key_blocks[\"%s\"].data[%d]", kb->name, index);
}
else
return NULL; /* XXX: there's really no way to resolve this... */
return NULL; /* XXX: there's really no way to resolve this... */
}
#else
@@ -462,7 +462,7 @@ static void rna_def_keydata(BlenderRNA *brna)
srna = RNA_def_struct(brna, "ShapeKeyCurvePoint", NULL);
RNA_def_struct_ui_text(srna, "Shape Key Curve Point", "Point in a shape key for curves");
/* there's nothing type specific here, so this is fine for now */
/* there's nothing type specific here, so this is fine for now */
RNA_def_struct_path_func(srna, "rna_ShapeKeyPoint_path");
prop = RNA_def_property(srna, "co", PROP_FLOAT, PROP_TRANSLATION);
@@ -478,7 +478,7 @@ static void rna_def_keydata(BlenderRNA *brna)
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");
/* there's nothing type specific here, so this is fine for now */
/* there's nothing type specific here, so this is fine for now */
RNA_def_struct_path_func(srna, "rna_ShapeKeyPoint_path");
prop = RNA_def_property(srna, "co", PROP_FLOAT, PROP_TRANSLATION);
@@ -519,7 +519,8 @@ static void rna_def_keyblock(BlenderRNA *brna)
{KEY_LINEAR, "KEY_LINEAR", 0, "Linear", ""},
{KEY_CARDINAL, "KEY_CARDINAL", 0, "Cardinal", ""},
{KEY_BSPLINE, "KEY_BSPLINE", 0, "BSpline", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
srna = RNA_def_struct(brna, "ShapeKey", NULL);
RNA_def_struct_ui_text(srna, "Shape Key", "Shape key in a shape keys datablock");

View File

@@ -52,7 +52,7 @@
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);
la->bufsize = value;
@@ -66,13 +66,13 @@ static PointerRNA rna_Lamp_sky_settings_get(PointerRNA *ptr)
static void rna_Lamp_mtex_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
Lamp *la = (Lamp*)ptr->data;
rna_iterator_array_begin(iter, (void*)la->mtex, sizeof(MTex*), MAX_MTEX, 0, NULL);
Lamp *la = (Lamp *)ptr->data;
rna_iterator_array_begin(iter, (void *)la->mtex, sizeof(MTex *), MAX_MTEX, 0, NULL);
}
static PointerRNA rna_Lamp_active_texture_get(PointerRNA *ptr)
{
Lamp *la = (Lamp*)ptr->data;
Lamp *la = (Lamp *)ptr->data;
Tex *tex;
tex = give_current_lamp_texture(la);
@@ -81,16 +81,16 @@ static PointerRNA rna_Lamp_active_texture_get(PointerRNA *ptr)
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);
}
static int rna_use_shadow_get(PointerRNA *ptr)
{
Lamp *la = (Lamp*)ptr->data;
Lamp *la = (Lamp *)ptr->data;
if(la->type == LA_SPOT)
if (la->type == LA_SPOT)
return la->mode & LA_SHAD_BUF;
else
return la->mode & LA_SHAD_RAY;
@@ -98,20 +98,20 @@ static int rna_use_shadow_get(PointerRNA *ptr)
static void rna_use_shadow_set(PointerRNA *ptr, int value)
{
Lamp *la = (Lamp*)ptr->data;
Lamp *la = (Lamp *)ptr->data;
if (value) {
if(la->type == LA_SPOT)
if (la->type == LA_SPOT)
la->mode |= LA_SHAD_BUF;
else
la->mode |= LA_SHAD_RAY;
}
else
la->mode &= ~(LA_SHAD_BUF|LA_SHAD_RAY);
la->mode &= ~(LA_SHAD_BUF | LA_SHAD_RAY);
}
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) {
case LA_LOCAL:
@@ -135,9 +135,9 @@ static void rna_Lamp_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr)
DAG_id_tag_update(&la->id, 0);
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
WM_main_add_notifier(NC_LAMP|ND_LIGHTING, la);
WM_main_add_notifier(NC_LAMP | ND_LIGHTING, la);
}
static void rna_Lamp_draw_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
@@ -145,7 +145,7 @@ static void rna_Lamp_draw_update(Main *UNUSED(bmain), Scene *UNUSED(scene), Poin
Lamp *la = ptr->id.data;
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);
}
static void rna_Lamp_sky_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
@@ -153,7 +153,7 @@ static void rna_Lamp_sky_update(Main *UNUSED(bmain), Scene *UNUSED(scene), Point
Lamp *la = ptr->id.data;
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);
}
/* only for rad/deg conversion! can remove later */
@@ -171,7 +171,7 @@ static void rna_Lamp_spot_size_set(PointerRNA *ptr, float value)
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)
ED_node_shader_default(scene, &la->id);
@@ -187,7 +187,8 @@ EnumPropertyItem lamp_type_items[] = {
{LA_SPOT, "SPOT", 0, "Spot", "Directional cone light source"},
{LA_HEMI, "HEMI", 0, "Hemi", "180 degree constant light source"},
{LA_AREA, "AREA", 0, "Area", "Directional area light source"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static void rna_def_lamp_mtex(BlenderRNA *brna)
{
@@ -198,7 +199,8 @@ static void rna_def_lamp_mtex(BlenderRNA *brna)
{TEXCO_GLOB, "GLOBAL", 0, "Global", "Use global coordinates for the texture coordinates"},
{TEXCO_VIEW, "VIEW", 0, "View", "Use view coordinates for the 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");
RNA_def_struct_sdna(srna, "MTex");
@@ -247,7 +249,8 @@ static void rna_def_lamp_sky_settings(BlenderRNA *brna)
{0, "SMPTE", 0, "SMPTE", ""},
{1, "REC709", 0, "REC709", ""},
{2, "CIE", 0, "CIE", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
srna = RNA_def_struct(brna, "LampSkySettings", NULL);
RNA_def_struct_sdna(srna, "Lamp");
@@ -418,7 +421,7 @@ static void rna_def_lamp(BlenderRNA *brna)
/* textures */
rna_def_mtex_common(brna, srna, "rna_Lamp_mtex_begin", "rna_Lamp_active_texture_get",
"rna_Lamp_active_texture_set", NULL, "LampTextureSlot", "LampTextureSlots", "rna_Lamp_update");
"rna_Lamp_active_texture_set", NULL, "LampTextureSlot", "LampTextureSlots", "rna_Lamp_update");
}
static void rna_def_lamp_falloff(StructRNA *srna)
@@ -431,7 +434,8 @@ static void rna_def_lamp_falloff(StructRNA *srna)
{LA_FALLOFF_INVSQUARE, "INVERSE_SQUARE", 0, "Inverse Square", ""},
{LA_FALLOFF_CURVE, "CUSTOM_CURVE", 0, "Custom Curve", ""},
{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);
RNA_def_property_enum_items(prop, prop_fallofftype_items);
@@ -468,24 +472,28 @@ static void rna_def_lamp_shadow(StructRNA *srna, int spot, int area)
static EnumPropertyItem prop_shadow_items[] = {
{0, "NOSHADOW", 0, "No Shadow", ""},
{LA_SHAD_RAY, "RAY_SHADOW", 0, "Ray Shadow", "Use ray tracing for shadow"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem prop_spot_shadow_items[] = {
{0, "NOSHADOW", 0, "No Shadow", ""},
{LA_SHAD_BUF, "BUFFER_SHADOW", 0, "Buffer Shadow", "Let spotlight produce shadows using shadow buffer"},
{LA_SHAD_RAY, "RAY_SHADOW", 0, "Ray Shadow", "Use ray tracing for shadow"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem prop_ray_sampling_method_items[] = {
{LA_SAMP_HALTON, "ADAPTIVE_QMC", 0, "Adaptive QMC", ""},
{LA_SAMP_HAMMERSLEY, "CONSTANT_QMC", 0, "Constant QMC", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem prop_spot_ray_sampling_method_items[] = {
{LA_SAMP_HALTON, "ADAPTIVE_QMC", 0, "Adaptive QMC", ""},
{LA_SAMP_HAMMERSLEY, "CONSTANT_QMC", 0, "Constant QMC", ""},
{LA_SAMP_CONSTANT, "CONSTANT_JITTERED", 0, "Constant Jittered", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem prop_shadbuftype_items[] = {
{LA_SHADBUF_REGULAR, "REGULAR", 0, "Classical", "Classic shadow buffer"},
@@ -497,33 +505,37 @@ static void rna_def_lamp_shadow(StructRNA *srna, int spot, int area)
{LA_SHADBUF_DEEP, "DEEP", 0, "Deep",
"Deep shadow buffer supports transparency and better filtering, at the cost of "
"more memory usage and processing time"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem prop_shadbuffiltertype_items[] = {
{LA_SHADBUF_BOX, "BOX", 0, "Box", "Apply the Box filter to shadow buffer samples"},
{LA_SHADBUF_TENT, "TENT", 0, "Tent", "Apply the Tent Filter to shadow buffer samples"},
{LA_SHADBUF_GAUSS, "GAUSS", 0, "Gauss", "Apply the Gauss filter to shadow buffer samples"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem prop_numbuffer_items[] = {
{1, "BUFFERS_1", 0, "1", "Only one buffer rendered"},
{4, "BUFFERS_4", 0, "4", "Render 4 buffers for better AA, this quadruples memory usage"},
{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}
};
/* GE only */
static EnumPropertyItem prop_ge_shadowbuffer_type_items[] = {
{LA_SHADMAP_SIMPLE, "SIMPLE", 0, "Simple", "Simple shadow maps"},
{LA_SHADMAP_VARIANCE, "VARIANCE", 0, "Variance", "Variance shadow maps"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
prop= RNA_def_property(srna, "use_shadow", PROP_BOOLEAN, PROP_NONE);
prop = RNA_def_property(srna, "use_shadow", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_use_shadow_get", "rna_use_shadow_set");
RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
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_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_update(prop, 0, "rna_Lamp_update");
prop = RNA_def_property(srna, "shadow_buffer_size", PROP_INT, PROP_NONE);
@@ -555,7 +567,7 @@ static void rna_def_lamp_shadow(StructRNA *srna, int spot, int area)
"Shadow map clip start, below which objects will not generate shadows");
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_range(prop, 0.0f, 9999.0f);
RNA_def_property_ui_text(prop, "Shadow Buffer Clip End",
@@ -629,16 +641,16 @@ static void rna_def_lamp_shadow(StructRNA *srna, int spot, int area)
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_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_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_range(prop, 1, 64);
RNA_def_property_ui_text(prop, (area)? "Shadow Ray Samples": "Shadow Ray Samples X",
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");
@@ -690,7 +702,8 @@ static void rna_def_area_lamp(BlenderRNA *brna)
static EnumPropertyItem prop_areashape_items[] = {
{LA_AREA_SQUARE, "SQUARE", 0, "Square", ""},
{LA_AREA_RECT, "RECTANGLE", 0, "Rectangle", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
srna = RNA_def_struct(brna, "AreaLamp", "Lamp");
RNA_def_struct_sdna(srna, "Lamp");
@@ -749,13 +762,15 @@ static void rna_def_spot_lamp(BlenderRNA *brna)
{LA_SHADBUF_BOX, "BOX", 0, "Box", "Apply the Box filter to shadow buffer samples"},
{LA_SHADBUF_TENT, "TENT", 0, "Tent", "Apply the Tent Filter to shadow buffer samples"},
{LA_SHADBUF_GAUSS, "GAUSS", 0, "Gauss", "Apply the Gauss filter to shadow buffer samples"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem prop_numbuffer_items[] = {
{1, "BUFFERS_1", 0, "1", "Only one buffer rendered"},
{4, "BUFFERS_4", 0, "4", "Render 4 buffers for better AA, this quadruples memory usage"},
{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");
RNA_def_struct_sdna(srna, "Lamp");
@@ -795,9 +810,9 @@ static void rna_def_spot_lamp(BlenderRNA *brna)
prop = RNA_def_property(srna, "spot_size", PROP_FLOAT, PROP_ANGLE);
/* 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");
/* only for deg/rad conversion */
/* only for deg/rad conversion */
RNA_def_property_float_funcs(prop, "rna_Lamp_spot_size_get", "rna_Lamp_spot_size_set", NULL);
RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
@@ -830,7 +845,7 @@ static void rna_def_sun_lamp(BlenderRNA *brna)
rna_def_lamp_sky_settings(brna);
/* BGE Only */
prop= RNA_def_property(srna, "shadow_frustum_size", PROP_FLOAT, PROP_NONE);
prop = RNA_def_property(srna, "shadow_frustum_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "shadow_frustum_size");
RNA_def_property_ui_range(prop, 0.001, 100.0, 2, 1);
RNA_def_property_ui_text(prop, "Frustum Size", "Size of the frustum used for creating the shadow map");

View File

@@ -51,27 +51,27 @@
static void rna_LatticePoint_co_get(PointerRNA *ptr, float *values)
{
Lattice *lt = (Lattice*)ptr->id.data;
BPoint *bp = (BPoint*)ptr->data;
Lattice *lt = (Lattice *)ptr->id.data;
BPoint *bp = (BPoint *)ptr->data;
int a = bp - lt->def;
int x = a % lt->pntsu;
int y = (a/lt->pntsu) % lt->pntsv;
int z = (a/(lt->pntsu*lt->pntsv));
int y = (a / lt->pntsu) % lt->pntsv;
int z = (a / (lt->pntsu * lt->pntsv));
values[0] = lt->fu + x*lt->du;
values[1] = lt->fv + y*lt->dv;
values[2] = lt->fw + z*lt->dw;
values[0] = lt->fu + x * lt->du;
values[1] = lt->fv + y * lt->dv;
values[2] = lt->fw + z * lt->dw;
}
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) {
BPoint *bp = (BPoint*)ptr->data;
MDeformVert *dvert = lt->dvert + (bp-lt->def);
BPoint *bp = (BPoint *)ptr->data;
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);
}
else
rna_iterator_array_begin(iter, NULL, 0, 0, 0, NULL);
@@ -79,13 +79,13 @@ static void rna_LatticePoint_groups_begin(CollectionPropertyIterator *iter, Poin
static void rna_Lattice_points_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
Lattice *lt = (Lattice*)ptr->data;
int tot = lt->pntsu*lt->pntsv*lt->pntsw;
Lattice *lt = (Lattice *)ptr->data;
int tot = lt->pntsu * lt->pntsv * lt->pntsw;
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)
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
rna_iterator_array_begin(iter, NULL, 0, 0, 0, NULL);
}
@@ -95,7 +95,7 @@ static void rna_Lattice_update_data(Main *UNUSED(bmain), Scene *UNUSED(scene), P
ID *id = ptr->id.data;
DAG_id_tag_update(id, 0);
WM_main_add_notifier(NC_GEOM|ND_DATA, id);
WM_main_add_notifier(NC_GEOM | ND_DATA, id);
}
static void rna_Lattice_update_size(Main *bmain, Scene *scene, PointerRNA *ptr)
@@ -105,9 +105,9 @@ static void rna_Lattice_update_size(Main *bmain, Scene *scene, PointerRNA *ptr)
int newu, newv, neww;
/* we don't modify the actual pnts, but go through opnts instead */
newu = (lt->opntsu > 0)? lt->opntsu: lt->pntsu;
newv = (lt->opntsv > 0)? lt->opntsv: lt->pntsv;
neww = (lt->opntsw > 0)? lt->opntsw: lt->pntsw;
newu = (lt->opntsu > 0) ? lt->opntsu : lt->pntsu;
newv = (lt->opntsv > 0) ? lt->opntsv : lt->pntsv;
neww = (lt->opntsw > 0) ? lt->opntsw : lt->pntsw;
/* BKE_lattice_resize needs an object, any object will have the same result */
for (ob = bmain->object.first; ob; ob = ob->id.next) {
@@ -148,28 +148,28 @@ static void rna_Lattice_use_outside_set(PointerRNA *ptr, int value)
static int rna_Lattice_size_editable(PointerRNA *ptr)
{
Lattice *lt = (Lattice*)ptr->data;
Lattice *lt = (Lattice *)ptr->data;
return lt->key == NULL;
}
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);
}
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);
}
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);
}
@@ -187,7 +187,7 @@ static void rna_Lattice_vg_name_set(PointerRNA *ptr, const char *value)
/* annoying, but is a consequence of RNA structures... */
static char *rna_LatticePoint_path(PointerRNA *ptr)
{
Lattice *lt = (Lattice*)ptr->id.data;
Lattice *lt = (Lattice *)ptr->id.data;
void *point = ptr->data;
BPoint *points = NULL;
@@ -197,7 +197,7 @@ static char *rna_LatticePoint_path(PointerRNA *ptr)
points = lt->def;
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 */
if ((point >= (void *)points) && (point < (void *)(points + tot))) {
@@ -252,7 +252,8 @@ static void rna_def_lattice(BlenderRNA *brna)
{KEY_LINEAR, "KEY_LINEAR", 0, "Linear", ""},
{KEY_CARDINAL, "KEY_CARDINAL", 0, "Cardinal", ""},
{KEY_BSPLINE, "KEY_BSPLINE", 0, "BSpline", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
srna = RNA_def_struct(brna, "Lattice", "ID");
RNA_def_struct_ui_text(srna, "Lattice", "Lattice datablock defining a grid for deforming other objects");

View File

@@ -50,7 +50,7 @@ static int rna_Main_is_saved_get(PointerRNA *UNUSED(ptr))
static int rna_Main_is_dirty_get(PointerRNA *ptr)
{
/* 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;
for (wm = bmain->wm.first; wm; wm = wm->id.next) {
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)
{
Main *bmain = (Main*)ptr->data;
Main *bmain = (Main *)ptr->data;
BLI_strncpy(value, bmain->name, sizeof(bmain->name));
}
static int rna_Main_filepath_length(PointerRNA *ptr)
{
Main *bmain = (Main*)ptr->data;
Main *bmain = (Main *)ptr->data;
return strlen(bmain->name);
}
#if 0
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));
}
#endif
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);
}
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);
}
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);
}
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);
}
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);
}
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);
}
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);
}
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);
}
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);
}
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);
}
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);
}
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);
}
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);
}
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);
}
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);
}
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);
}
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);
}
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);
}
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);
}
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);
}
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);
}
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);
}
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);
}
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);
}
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);
}
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);
}
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);
}
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);
}
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);
}
@@ -271,11 +271,11 @@ static PointerRNA rna_Test_test_get(PointerRNA *ptr)
typedef void (CollectionDefFunc)(struct BlenderRNA *brna, struct PropertyRNA *cprop);
typedef struct MainCollectionDef {
const char *identifier;
const char *type;
const char *iter_begin;
const char *name;
const char *description;
const char *identifier;
const char *type;
const char *iter_begin;
const char *name;
const char *description;
CollectionDefFunc *func;
} MainCollectionDef;
@@ -291,14 +291,12 @@ void RNA_def_main(BlenderRNA *brna)
{"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},
{"materials", "Material", "rna_Main_mat_begin", "Materials", "Material datablocks", RNA_def_main_materials},
{"node_groups", "NodeTree", "rna_Main_nodetree_begin", "Node Groups", "Node group datablocks",
RNA_def_main_node_groups},
{"node_groups", "NodeTree", "rna_Main_nodetree_begin", "Node Groups", "Node group datablocks", RNA_def_main_node_groups},
{"meshes", "Mesh", "rna_Main_mesh_begin", "Meshes", "Mesh datablocks", RNA_def_main_meshes},
{"lamps", "Lamp", "rna_Main_lamp_begin", "Lamps", "Lamp datablocks", RNA_def_main_lamps},
{"libraries", "Library", "rna_Main_library_begin", "Libraries", "Library datablocks", RNA_def_main_libraries},
{"screens", "Screen", "rna_Main_screen_begin", "Screens", "Screen datablocks", RNA_def_main_screens},
{"window_managers", "WindowManager", "rna_Main_wm_begin", "Window Managers", "Window manager datablocks",
RNA_def_main_window_managers},
{"window_managers", "WindowManager", "rna_Main_wm_begin", "Window Managers", "Window manager datablocks", RNA_def_main_window_managers},
{"images", "Image", "rna_Main_image_begin", "Images", "Image datablocks", RNA_def_main_images},
{"lattices", "Lattice", "rna_Main_latt_begin", "Lattices", "Lattice datablocks", RNA_def_main_lattices},
{"curves", "Curve", "rna_Main_curve_begin", "Curves", "Curve datablocks", RNA_def_main_curves},
@@ -313,16 +311,13 @@ void RNA_def_main(BlenderRNA *brna)
{"texts", "Text", "rna_Main_text_begin", "Texts", "Text datablocks", RNA_def_main_texts},
{"speakers", "Speaker", "rna_Main_speaker_begin", "Speakers", "Speaker datablocks", RNA_def_main_speakers},
{"sounds", "Sound", "rna_Main_sound_begin", "Sounds", "Sound datablocks", RNA_def_main_sounds},
{"armatures", "Armature", "rna_Main_armature_begin", "Armatures", "Armature datablocks",
RNA_def_main_armatures},
{"armatures", "Armature", "rna_Main_armature_begin", "Armatures", "Armature datablocks", RNA_def_main_armatures},
{"actions", "Action", "rna_Main_action_begin", "Actions", "Action datablocks", RNA_def_main_actions},
{"particles", "ParticleSettings", "rna_Main_particle_begin", "Particles", "Particle datablocks",
RNA_def_main_particles},
{"grease_pencil", "GreasePencil", "rna_Main_gpencil_begin", "Grease Pencil", "Grease Pencil datablocks",
RNA_def_main_gpencil},
{"movieclips", "MovieClip", "rna_Main_movieclips_begin", "Movie Clips", "Movie Clip datablocks",
RNA_def_main_movieclips},
{NULL, NULL, NULL, NULL, NULL, NULL}};
{"particles", "ParticleSettings", "rna_Main_particle_begin", "Particles", "Particle datablocks", RNA_def_main_particles},
{"grease_pencil", "GreasePencil", "rna_Main_gpencil_begin", "Grease Pencil", "Grease Pencil datablocks", RNA_def_main_gpencil},
{"movieclips", "MovieClip", "rna_Main_movieclips_begin", "Movie Clips", "Movie Clip datablocks", RNA_def_main_movieclips},
{NULL, NULL, NULL, NULL, NULL, NULL}
};
int i;

View File

@@ -102,7 +102,7 @@ void rna_Main_cameras_remove(Main *bmain, ReportList *reports, struct Camera *ca
BKE_libblock_free(&bmain->camera, camera);
else
BKE_reportf(reports, RPT_ERROR, "Camera \"%s\" must have zero users to be removed, found %d",
camera->id.name+2, ID_REAL_USERS(camera));
camera->id.name + 2, ID_REAL_USERS(camera));
/* XXX python now has invalid pointer? */
}
@@ -121,7 +121,7 @@ void rna_Main_scenes_remove(Main *bmain, bContext *C, ReportList *reports, struc
else if (scene->id.next)
newscene = scene->id.next;
else {
BKE_reportf(reports, RPT_ERROR, "Scene \"%s\" is the last, cant ve removed", scene->id.name+2);
BKE_reportf(reports, RPT_ERROR, "Scene \"%s\" is the last, cant ve removed", scene->id.name + 2);
return;
}
@@ -192,12 +192,11 @@ void rna_Main_objects_remove(Main *bmain, ReportList *reports, struct Object *ob
}
else {
BKE_reportf(reports, RPT_ERROR, "Object \"%s\" must have zero users to be removed, found %d",
object->id.name+2, ID_REAL_USERS(object));
object->id.name + 2, ID_REAL_USERS(object));
}
}
struct Material *rna_Main_materials_new(Main *UNUSED(bmain), const char *name)
{
struct Material *rna_Main_materials_new(Main *UNUSED(bmain), const char *name){
ID *id = (ID *)BKE_material_add(name);
id_us_min(id);
return (Material *)id;
@@ -208,13 +207,12 @@ void rna_Main_materials_remove(Main *bmain, ReportList *reports, struct Material
BKE_libblock_free(&bmain->mat, material);
else
BKE_reportf(reports, RPT_ERROR, "Material \"%s\" must have zero users to be removed, found %d",
material->id.name+2, ID_REAL_USERS(material));
material->id.name + 2, ID_REAL_USERS(material));
/* XXX python now has invalid pointer? */
}
struct bNodeTree *rna_Main_nodetree_new(Main *UNUSED(bmain), const char *name, int type)
{
struct bNodeTree *rna_Main_nodetree_new(Main *UNUSED(bmain), const char *name, int type){
bNodeTree *tree = ntreeAddTree(name, type, NODE_GROUP);
id_us_min(&tree->id);
@@ -226,7 +224,7 @@ void rna_Main_nodetree_remove(Main *bmain, ReportList *reports, struct bNodeTree
BKE_libblock_free(&bmain->nodetree, tree);
else
BKE_reportf(reports, RPT_ERROR, "Node Tree \"%s\" must have zero users to be removed, found %d",
tree->id.name+2, ID_REAL_USERS(tree));
tree->id.name + 2, ID_REAL_USERS(tree));
/* XXX python now has invalid pointer? */
}
@@ -243,7 +241,7 @@ void rna_Main_meshes_remove(Main *bmain, ReportList *reports, Mesh *mesh)
BKE_libblock_free(&bmain->mesh, mesh);
else
BKE_reportf(reports, RPT_ERROR, "Mesh \"%s\" must have zero users to be removed, found %d",
mesh->id.name+2, ID_REAL_USERS(mesh));
mesh->id.name + 2, ID_REAL_USERS(mesh));
/* XXX python now has invalid pointer? */
}
@@ -261,7 +259,7 @@ void rna_Main_lamps_remove(Main *bmain, ReportList *reports, Lamp *lamp)
BKE_libblock_free(&bmain->lamp, lamp);
else
BKE_reportf(reports, RPT_ERROR, "Lamp \"%s\" must have zero users to be removed, found %d",
lamp->id.name+2, ID_REAL_USERS(lamp));
lamp->id.name + 2, ID_REAL_USERS(lamp));
/* XXX python now has invalid pointer? */
}
@@ -269,7 +267,7 @@ void rna_Main_lamps_remove(Main *bmain, ReportList *reports, Lamp *lamp)
Image *rna_Main_images_new(Main *UNUSED(bmain), const char *name, int width, int height, int alpha, int float_buffer)
{
float color[4] = {0.0, 0.0, 0.0, 1.0};
Image *image = BKE_image_add_generated(width, height, name, alpha ? 32:24, float_buffer, 0, color);
Image *image = BKE_image_add_generated(width, height, name, alpha ? 32 : 24, float_buffer, 0, color);
id_us_min(&image->id);
return image;
}
@@ -292,7 +290,7 @@ void rna_Main_images_remove(Main *bmain, ReportList *reports, Image *image)
BKE_libblock_free(&bmain->image, image);
else
BKE_reportf(reports, RPT_ERROR, "Image \"%s\" must have zero users to be removed, found %d",
image->id.name+2, ID_REAL_USERS(image));
image->id.name + 2, ID_REAL_USERS(image));
/* XXX python now has invalid pointer? */
}
@@ -309,7 +307,7 @@ void rna_Main_lattices_remove(Main *bmain, ReportList *reports, struct Lattice *
BKE_libblock_free(&bmain->latt, lt);
else
BKE_reportf(reports, RPT_ERROR, "Lattice \"%s\" must have zero users to be removed, found %d",
lt->id.name+2, ID_REAL_USERS(lt));
lt->id.name + 2, ID_REAL_USERS(lt));
}
Curve *rna_Main_curves_new(Main *UNUSED(bmain), const char *name, int type)
@@ -324,7 +322,7 @@ void rna_Main_curves_remove(Main *bmain, ReportList *reports, struct Curve *cu)
BKE_libblock_free(&bmain->curve, cu);
else
BKE_reportf(reports, RPT_ERROR, "Curve \"%s\" must have zero users to be removed, found %d",
cu->id.name+2, ID_REAL_USERS(cu));
cu->id.name + 2, ID_REAL_USERS(cu));
}
MetaBall *rna_Main_metaballs_new(Main *UNUSED(bmain), const char *name)
@@ -339,7 +337,7 @@ void rna_Main_metaballs_remove(Main *bmain, ReportList *reports, struct MetaBall
BKE_libblock_free(&bmain->mball, mb);
else
BKE_reportf(reports, RPT_ERROR, "Metaball \"%s\" must have zero users to be removed, found %d",
mb->id.name+2, ID_REAL_USERS(mb));
mb->id.name + 2, ID_REAL_USERS(mb));
}
VFont *rna_Main_fonts_load(Main *bmain, ReportList *reports, const char *filepath)
@@ -362,7 +360,7 @@ void rna_Main_fonts_remove(Main *bmain, ReportList *reports, VFont *vfont)
BKE_libblock_free(&bmain->vfont, vfont);
else
BKE_reportf(reports, RPT_ERROR, "Font \"%s\" must have zero users to be removed, found %d",
vfont->id.name+2, ID_REAL_USERS(vfont));
vfont->id.name + 2, ID_REAL_USERS(vfont));
/* XXX python now has invalid pointer? */
}
@@ -380,7 +378,7 @@ void rna_Main_textures_remove(Main *bmain, ReportList *reports, struct Tex *tex)
BKE_libblock_free(&bmain->tex, tex);
else
BKE_reportf(reports, RPT_ERROR, "Texture \"%s\" must have zero users to be removed, found %d",
tex->id.name+2, ID_REAL_USERS(tex));
tex->id.name + 2, ID_REAL_USERS(tex));
}
Brush *rna_Main_brushes_new(Main *UNUSED(bmain), const char *name)
@@ -395,7 +393,7 @@ void rna_Main_brushes_remove(Main *bmain, ReportList *reports, struct Brush *bru
BKE_libblock_free(&bmain->brush, brush);
else
BKE_reportf(reports, RPT_ERROR, "Brush \"%s\" must have zero users to be removed, found %d",
brush->id.name+2, ID_REAL_USERS(brush));
brush->id.name + 2, ID_REAL_USERS(brush));
}
World *rna_Main_worlds_new(Main *UNUSED(bmain), const char *name)
@@ -410,7 +408,7 @@ void rna_Main_worlds_remove(Main *bmain, ReportList *reports, struct World *worl
BKE_libblock_free(&bmain->world, world);
else
BKE_reportf(reports, RPT_ERROR, "World \"%s\" must have zero users to be removed, found %d",
world->id.name+2, ID_REAL_USERS(world));
world->id.name + 2, ID_REAL_USERS(world));
}
Group *rna_Main_groups_new(Main *UNUSED(bmain), const char *name)
@@ -436,7 +434,7 @@ void rna_Main_speakers_remove(Main *bmain, ReportList *reports, Speaker *speaker
BKE_libblock_free(&bmain->speaker, speaker);
else
BKE_reportf(reports, RPT_ERROR, "Speaker \"%s\" must have zero users to be removed, found %d",
speaker->id.name+2, ID_REAL_USERS(speaker));
speaker->id.name + 2, ID_REAL_USERS(speaker));
/* XXX python now has invalid pointer? */
}
@@ -478,7 +476,7 @@ void rna_Main_armatures_remove(Main *bmain, ReportList *reports, bArmature *arm)
BKE_libblock_free(&bmain->armature, arm);
else
BKE_reportf(reports, RPT_ERROR, "Armature \"%s\" must have zero users to be removed, found %d",
arm->id.name+2, ID_REAL_USERS(arm));
arm->id.name + 2, ID_REAL_USERS(arm));
/* XXX python now has invalid pointer? */
}
@@ -496,7 +494,7 @@ void rna_Main_actions_remove(Main *bmain, ReportList *reports, bAction *act)
BKE_libblock_free(&bmain->action, act);
else
BKE_reportf(reports, RPT_ERROR, "Action \"%s\" must have zero users to be removed, found %d",
act->id.name+2, ID_REAL_USERS(act));
act->id.name + 2, ID_REAL_USERS(act));
/* XXX python now has invalid pointer? */
}
@@ -513,7 +511,7 @@ void rna_Main_particles_remove(Main *bmain, ReportList *reports, ParticleSetting
BKE_libblock_free(&bmain->particle, part);
else
BKE_reportf(reports, RPT_ERROR, "Particle Settings \"%s\" must have zero users to be removed, found %d",
part->id.name+2, ID_REAL_USERS(part));
part->id.name + 2, ID_REAL_USERS(part));
/* XXX python now has invalid pointer? */
}
@@ -606,11 +604,11 @@ void RNA_api_main(StructRNA *srna)
PropertyRNA *parm;
/* maybe we want to add functions in 'bpy.data' still?
* for now they are all in collections bpy.data.images.new(...) */
func= RNA_def_function(srna, "add_image", "rna_Main_add_image");
func = RNA_def_function(srna, "add_image", "rna_Main_add_image");
RNA_def_function_ui_description(func, "Add a new image");
parm= RNA_def_string_file_path(func, "filepath", "", 0, "", "File path to load image from");
parm = RNA_def_string_file_path(func, "filepath", "", 0, "", "File path to load image from");
RNA_def_property_flag(parm, PROP_REQUIRED);
parm= RNA_def_pointer(func, "image", "Image", "", "New image");
parm = RNA_def_pointer(func, "image", "Image", "", "New image");
RNA_def_function_return(func, parm);
#endif
}
@@ -639,7 +637,7 @@ void RNA_def_main_cameras(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Remove a camera from the current blendfile");
parm = RNA_def_pointer(func, "camera", "Camera", "", "Camera 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, "tag", "rna_Main_cameras_tag");
parm = RNA_def_boolean(func, "value", 0, "Value", "");
@@ -671,10 +669,10 @@ void RNA_def_main_scenes(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_return(func, parm);
func = RNA_def_function(srna, "remove", "rna_Main_scenes_remove");
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, "Remove a scene from the current blendfile");
parm = RNA_def_pointer(func, "scene", "Scene", "", "Scene 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, "tag", "rna_Main_scenes_tag");
parm = RNA_def_boolean(func, "value", 0, "Value", "");
@@ -713,7 +711,7 @@ void RNA_def_main_objects(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_ui_description(func, "Remove a object from the current blendfile");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
parm = RNA_def_pointer(func, "object", "Object", "", "Object 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, "tag", "rna_Main_objects_tag");
parm = RNA_def_boolean(func, "value", 0, "Value", "");
@@ -748,7 +746,7 @@ void RNA_def_main_materials(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Remove a material from the current blendfile");
parm = RNA_def_pointer(func, "material", "Material", "", "Material 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, "tag", "rna_Main_materials_tag");
parm = RNA_def_boolean(func, "value", 0, "Value", "");
@@ -766,10 +764,11 @@ void RNA_def_main_node_groups(BlenderRNA *brna, PropertyRNA *cprop)
PropertyRNA *prop;
static EnumPropertyItem node_nodetree_items[] = {
{0, "SHADER", 0, "Shader", ""},
{1, "COMPOSITE", 0, "Composite", ""},
{2, "TEXTURE", 0, "Texture", ""},
{0, NULL, 0, NULL, NULL}};
{0, "SHADER", 0, "Shader", ""},
{1, "COMPOSITE", 0, "Composite", ""},
{2, "TEXTURE", 0, "Texture", ""},
{0, NULL, 0, NULL, NULL}
};
RNA_def_property_srna(cprop, "BlendDataNodeTrees");
srna = RNA_def_struct(brna, "BlendDataNodeTrees", NULL);
@@ -790,7 +789,7 @@ void RNA_def_main_node_groups(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Remove a node tree from the current blendfile");
parm = RNA_def_pointer(func, "tree", "NodeTree", "", "Node tree 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, "tag", "rna_Main_node_groups_tag");
parm = RNA_def_boolean(func, "value", 0, "Value", "");
@@ -824,7 +823,7 @@ void RNA_def_main_meshes(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Remove a mesh from the current blendfile");
parm = RNA_def_pointer(func, "mesh", "Mesh", "", "Mesh 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, "tag", "rna_Main_meshes_tag");
parm = RNA_def_boolean(func, "value", 0, "Value", "");
@@ -860,7 +859,7 @@ void RNA_def_main_lamps(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Remove a lamp from the current blendfile");
parm = RNA_def_pointer(func, "lamp", "Lamp", "", "Lamp 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, "tag", "rna_Main_lamps_tag");
parm = RNA_def_boolean(func, "value", 0, "Value", "");
@@ -972,7 +971,7 @@ void RNA_def_main_images(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Remove an image from the current blendfile");
parm = RNA_def_pointer(func, "image", "Image", "", "Image 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, "tag", "rna_Main_images_tag");
parm = RNA_def_boolean(func, "value", 0, "Value", "");
@@ -1007,7 +1006,7 @@ void RNA_def_main_lattices(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Remove a lattice from the current blendfile");
parm = RNA_def_pointer(func, "lattice", "Lattice", "", "Lattice 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, "tag", "rna_Main_lattices_tag");
parm = RNA_def_boolean(func, "value", 0, "Value", "");
@@ -1043,7 +1042,7 @@ void RNA_def_main_curves(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Remove a curve from the current blendfile");
parm = RNA_def_pointer(func, "curve", "Curve", "", "Curve 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, "tag", "rna_Main_curves_tag");
parm = RNA_def_boolean(func, "value", 0, "Value", "");
@@ -1077,7 +1076,7 @@ void RNA_def_main_metaballs(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Remove a metaball from the current blendfile");
parm = RNA_def_pointer(func, "metaball", "MetaBall", "", "Metaball 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, "tag", "rna_Main_metaballs_tag");
parm = RNA_def_boolean(func, "value", 0, "Value", "");
@@ -1112,7 +1111,7 @@ void RNA_def_main_fonts(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Remove a font from the current blendfile");
parm = RNA_def_pointer(func, "vfont", "VectorFont", "", "Font 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, "tag", "rna_Main_fonts_tag");
parm = RNA_def_boolean(func, "value", 0, "Value", "");
@@ -1148,7 +1147,7 @@ void RNA_def_main_textures(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Remove a texture from the current blendfile");
parm = RNA_def_pointer(func, "texture", "Texture", "", "Texture 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, "tag", "rna_Main_textures_tag");
parm = RNA_def_boolean(func, "value", 0, "Value", "");
@@ -1182,7 +1181,7 @@ void RNA_def_main_brushes(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Remove a brush from the current blendfile");
parm = RNA_def_pointer(func, "brush", "Brush", "", "Brush 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, "tag", "rna_Main_brushes_tag");
parm = RNA_def_boolean(func, "value", 0, "Value", "");
@@ -1217,7 +1216,7 @@ void RNA_def_main_worlds(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Remove a world from the current blendfile");
parm = RNA_def_pointer(func, "world", "World", "", "World 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, "tag", "rna_Main_worlds_tag");
parm = RNA_def_boolean(func, "value", 0, "Value", "");
@@ -1251,7 +1250,7 @@ void RNA_def_main_groups(BlenderRNA *brna, PropertyRNA *cprop)
func = RNA_def_function(srna, "remove", "rna_Main_groups_remove");
RNA_def_function_ui_description(func, "Remove a group from the current blendfile");
parm = RNA_def_pointer(func, "group", "Group", "", "Group 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, "tag", "rna_Main_groups_tag");
parm = RNA_def_boolean(func, "value", 0, "Value", "");
@@ -1286,7 +1285,7 @@ void RNA_def_main_speakers(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Remove a speaker from the current blendfile");
parm = RNA_def_pointer(func, "speaker", "Speaker", "", "Speaker 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, "tag", "rna_Main_speakers_tag");
parm = RNA_def_boolean(func, "value", 0, "Value", "");
@@ -1320,7 +1319,7 @@ void RNA_def_main_texts(BlenderRNA *brna, PropertyRNA *cprop)
func = RNA_def_function(srna, "remove", "rna_Main_texts_remove");
RNA_def_function_ui_description(func, "Remove a text from the current blendfile");
parm = RNA_def_pointer(func, "text", "Text", "", "Text to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL);
/* load func */
func = RNA_def_function(srna, "load", "rna_Main_texts_load");
@@ -1388,7 +1387,7 @@ void RNA_def_main_armatures(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Remove a armature from the current blendfile");
parm = RNA_def_pointer(func, "armature", "Armature", "", "Armature 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, "tag", "rna_Main_armatures_tag");
parm = RNA_def_boolean(func, "value", 0, "Value", "");
@@ -1422,7 +1421,7 @@ void RNA_def_main_actions(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Remove a action from the current blendfile");
parm = RNA_def_pointer(func, "action", "Action", "", "Action 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, "tag", "rna_Main_actions_tag");
parm = RNA_def_boolean(func, "value", 0, "Value", "");
@@ -1456,7 +1455,7 @@ void RNA_def_main_particles(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Remove a particle settings instance from the current blendfile");
parm = RNA_def_pointer(func, "particle", "ParticleSettings", "", "Particle Settings 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, "tag", "rna_Main_particles_tag");
parm = RNA_def_boolean(func, "value", 0, "Value", "");
@@ -1506,7 +1505,7 @@ void RNA_def_main_movieclips(BlenderRNA *brna, PropertyRNA *cprop)
func = RNA_def_function(srna, "remove", "rna_Main_movieclips_remove");
RNA_def_function_ui_description(func, "Remove a movie clip from the current blendfile.");
parm = RNA_def_pointer(func, "clip", "MovieClip", "", "Movie clip to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL);
/* load func */
func = RNA_def_function(srna, "load", "rna_Main_movieclip_load");

View File

@@ -39,41 +39,43 @@
#include "WM_types.h"
static EnumPropertyItem prop_texture_coordinates_items[] = {
{TEXCO_GLOB, "GLOBAL", 0, "Global", "Use global coordinates for the texture coordinates"},
{TEXCO_OBJECT, "OBJECT", 0, "Object", "Use linked object's coordinates for texture coordinates"},
{TEXCO_UV, "UV", 0, "UV", "Use UV coordinates for texture coordinates"},
{TEXCO_ORCO, "ORCO", 0, "Generated", "Use the original undeformed coordinates of the object"},
{TEXCO_STRAND, "STRAND", 0, "Strand / Particle",
"Use normalized strand texture coordinate (1D) or particle age (X) and trail position (Y)"},
{TEXCO_STICKY, "STICKY", 0, "Sticky", "Use mesh's sticky coordinates for the texture coordinates"},
{TEXCO_WINDOW, "WINDOW", 0, "Window", "Use screen coordinates as texture coordinates"},
{TEXCO_NORM, "NORMAL", 0, "Normal", "Use normal vector as texture coordinates"},
{TEXCO_REFL, "REFLECTION", 0, "Reflection", "Use reflection vector as texture coordinates"},
{TEXCO_STRESS, "STRESS", 0, "Stress",
"Use the difference of edge lengths compared to original coordinates of the mesh"},
{TEXCO_TANGENT, "TANGENT", 0, "Tangent", "Use the optional tangent vector as texture coordinates"},
{0, NULL, 0, NULL, NULL}};
{TEXCO_GLOB, "GLOBAL", 0, "Global", "Use global coordinates for the texture coordinates"},
{TEXCO_OBJECT, "OBJECT", 0, "Object", "Use linked object's coordinates for texture coordinates"},
{TEXCO_UV, "UV", 0, "UV", "Use UV coordinates for texture coordinates"},
{TEXCO_ORCO, "ORCO", 0, "Generated", "Use the original undeformed coordinates of the object"},
{TEXCO_STRAND, "STRAND", 0, "Strand / Particle",
"Use normalized strand texture coordinate (1D) or particle age (X) and trail position (Y)"},
{TEXCO_STICKY, "STICKY", 0, "Sticky", "Use mesh's sticky coordinates for the texture coordinates"},
{TEXCO_WINDOW, "WINDOW", 0, "Window", "Use screen coordinates as texture coordinates"},
{TEXCO_NORM, "NORMAL", 0, "Normal", "Use normal vector as texture coordinates"},
{TEXCO_REFL, "REFLECTION", 0, "Reflection", "Use reflection vector as texture coordinates"},
{TEXCO_STRESS, "STRESS", 0, "Stress",
"Use the difference of edge lengths compared to original coordinates of the mesh"},
{TEXCO_TANGENT, "TANGENT", 0, "Tangent", "Use the optional tangent vector as texture coordinates"},
{0, NULL, 0, NULL, NULL}
};
EnumPropertyItem ramp_blend_items[] = {
{MA_RAMP_BLEND, "MIX", 0, "Mix", ""},
{MA_RAMP_ADD, "ADD", 0, "Add", ""},
{MA_RAMP_MULT, "MULTIPLY", 0, "Multiply", ""},
{MA_RAMP_SUB, "SUBTRACT", 0, "Subtract", ""},
{MA_RAMP_SCREEN, "SCREEN", 0, "Screen", ""},
{MA_RAMP_DIV, "DIVIDE", 0, "Divide", ""},
{MA_RAMP_DIFF, "DIFFERENCE", 0, "Difference", ""},
{MA_RAMP_DARK, "DARKEN", 0, "Darken", ""},
{MA_RAMP_LIGHT, "LIGHTEN", 0, "Lighten", ""},
{MA_RAMP_OVERLAY, "OVERLAY", 0, "Overlay", ""},
{MA_RAMP_DODGE, "DODGE", 0, "Dodge", ""},
{MA_RAMP_BURN, "BURN", 0, "Burn", ""},
{MA_RAMP_HUE, "HUE", 0, "Hue", ""},
{MA_RAMP_SAT, "SATURATION", 0, "Saturation", ""},
{MA_RAMP_VAL, "VALUE", 0, "Value", ""},
{MA_RAMP_COLOR, "COLOR", 0, "Color", ""},
{MA_RAMP_SOFT, "SOFT_LIGHT", 0, "Soft Light", ""},
{MA_RAMP_LINEAR, "LINEAR_LIGHT", 0, "Linear Light", ""},
{0, NULL, 0, NULL, NULL}};
{MA_RAMP_BLEND, "MIX", 0, "Mix", ""},
{MA_RAMP_ADD, "ADD", 0, "Add", ""},
{MA_RAMP_MULT, "MULTIPLY", 0, "Multiply", ""},
{MA_RAMP_SUB, "SUBTRACT", 0, "Subtract", ""},
{MA_RAMP_SCREEN, "SCREEN", 0, "Screen", ""},
{MA_RAMP_DIV, "DIVIDE", 0, "Divide", ""},
{MA_RAMP_DIFF, "DIFFERENCE", 0, "Difference", ""},
{MA_RAMP_DARK, "DARKEN", 0, "Darken", ""},
{MA_RAMP_LIGHT, "LIGHTEN", 0, "Lighten", ""},
{MA_RAMP_OVERLAY, "OVERLAY", 0, "Overlay", ""},
{MA_RAMP_DODGE, "DODGE", 0, "Dodge", ""},
{MA_RAMP_BURN, "BURN", 0, "Burn", ""},
{MA_RAMP_HUE, "HUE", 0, "Hue", ""},
{MA_RAMP_SAT, "SATURATION", 0, "Saturation", ""},
{MA_RAMP_VAL, "VALUE", 0, "Value", ""},
{MA_RAMP_COLOR, "COLOR", 0, "Color", ""},
{MA_RAMP_SOFT, "SOFT_LIGHT", 0, "Soft Light", ""},
{MA_RAMP_LINEAR, "LINEAR_LIGHT", 0, "Linear Light", ""},
{0, NULL, 0, NULL, NULL}
};
#ifdef RNA_RUNTIME
@@ -96,10 +98,10 @@ static void rna_Material_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *p
DAG_id_tag_update(&ma->id, 0);
if (scene) { /* can be NULL, see [#30025] */
if (scene->gm.matmode == GAME_MAT_GLSL) {
WM_main_add_notifier(NC_MATERIAL|ND_SHADING_DRAW, ma);
WM_main_add_notifier(NC_MATERIAL | ND_SHADING_DRAW, ma);
}
else {
WM_main_add_notifier(NC_MATERIAL|ND_SHADING, ma);
WM_main_add_notifier(NC_MATERIAL | ND_SHADING, ma);
}
}
}
@@ -109,7 +111,7 @@ static void rna_Material_draw_update(Main *UNUSED(bmain), Scene *UNUSED(scene),
Material *ma = ptr->id.data;
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);
}
static PointerRNA rna_Material_mirror_get(PointerRNA *ptr)
@@ -144,23 +146,23 @@ static PointerRNA rna_Material_physics_get(PointerRNA *ptr)
static void rna_Material_type_set(PointerRNA *ptr, int value)
{
Material *ma = (Material*)ptr->data;
Material *ma = (Material *)ptr->data;
if (ma->material_type == MA_TYPE_HALO && value != MA_TYPE_HALO)
ma->mode &= ~(MA_STAR|MA_HALO_XALPHA|MA_ZINV|MA_ENV);
ma->mode &= ~(MA_STAR | MA_HALO_XALPHA | MA_ZINV | MA_ENV);
ma->material_type = value;
}
static void rna_Material_mtex_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
Material *ma = (Material*)ptr->data;
rna_iterator_array_begin(iter, (void*)ma->mtex, sizeof(MTex*), MAX_MTEX, 0, NULL);
Material *ma = (Material *)ptr->data;
rna_iterator_array_begin(iter, (void *)ma->mtex, sizeof(MTex *), MAX_MTEX, 0, NULL);
}
static PointerRNA rna_Material_active_texture_get(PointerRNA *ptr)
{
Material *ma = (Material*)ptr->data;
Material *ma = (Material *)ptr->data;
Tex *tex;
tex = give_current_material_texture(ma);
@@ -169,27 +171,27 @@ static PointerRNA rna_Material_active_texture_get(PointerRNA *ptr)
static void rna_Material_active_texture_set(PointerRNA *ptr, PointerRNA value)
{
Material *ma = (Material*)ptr->data;
Material *ma = (Material *)ptr->data;
set_current_material_texture(ma, value.data);
}
static int rna_Material_active_texture_editable(PointerRNA *ptr)
{
Material *ma = (Material*)ptr->id.data;
Material *ma = (Material *)ptr->id.data;
return has_current_material_texture(ma);
}
static PointerRNA rna_Material_active_node_material_get(PointerRNA *ptr)
{
Material *ma = give_node_material((Material*)ptr->data);
Material *ma = give_node_material((Material *)ptr->data);
return rna_pointer_inherit_refine(ptr, &RNA_Material, ma);
}
static void rna_Material_active_node_material_set(PointerRNA *ptr, PointerRNA value)
{
Material *ma = (Material*)ptr->data;
Material *ma = (Material *)ptr->data;
Material *ma_act = value.data;
nodeSetActiveID(ma->nodetree, ID_MA, &ma_act->id);
@@ -197,7 +199,7 @@ static void rna_Material_active_node_material_set(PointerRNA *ptr, PointerRNA va
static void rna_MaterialStrand_start_size_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax)
{
Material *ma = (Material*)ptr->id.data;
Material *ma = (Material *)ptr->id.data;
if (ma->mode & MA_STR_B_UNITS) {
*min = 0.0001f;
@@ -211,7 +213,7 @@ static void rna_MaterialStrand_start_size_range(PointerRNA *ptr, float *min, flo
static void rna_MaterialStrand_end_size_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax)
{
Material *ma = (Material*)ptr->id.data;
Material *ma = (Material *)ptr->id.data;
if (ma->mode & MA_STR_B_UNITS) {
*min = 0.0001f;
@@ -225,36 +227,36 @@ static void rna_MaterialStrand_end_size_range(PointerRNA *ptr, float *min, float
static int rna_MaterialTextureSlot_use_get(PointerRNA *ptr)
{
Material *ma = (Material*)ptr->id.data;
MTex *mtex = (MTex*)ptr->data;
Material *ma = (Material *)ptr->id.data;
MTex *mtex = (MTex *)ptr->data;
int a;
for (a = 0; a<MAX_MTEX; a++)
for (a = 0; a < MAX_MTEX; a++)
if (ma->mtex[a] == mtex)
return (ma->septex & (1<<a)) == 0;
return (ma->septex & (1 << a)) == 0;
return 0;
}
static void rna_MaterialTextureSlot_use_set(PointerRNA *ptr, int value)
{
Material *ma = (Material*)ptr->id.data;
MTex *mtex = (MTex*)ptr->data;
Material *ma = (Material *)ptr->id.data;
MTex *mtex = (MTex *)ptr->data;
int a;
for (a = 0; a<MAX_MTEX; a++) {
for (a = 0; a < MAX_MTEX; a++) {
if (ma->mtex[a] == mtex) {
if (value)
ma->septex &= ~(1<<a);
ma->septex &= ~(1 << a);
else
ma->septex |= (1<<a);
ma->septex |= (1 << a);
}
}
}
static void rna_Material_use_diffuse_ramp_set(PointerRNA *ptr, int value)
{
Material *ma = (Material*)ptr->data;
Material *ma = (Material *)ptr->data;
if (value) ma->mode |= MA_RAMP_COL;
else ma->mode &= ~MA_RAMP_COL;
@@ -265,7 +267,7 @@ static void rna_Material_use_diffuse_ramp_set(PointerRNA *ptr, int value)
static void rna_Material_use_specular_ramp_set(PointerRNA *ptr, int value)
{
Material *ma = (Material*)ptr->data;
Material *ma = (Material *)ptr->data;
if (value) ma->mode |= MA_RAMP_SPEC;
else ma->mode &= ~MA_RAMP_SPEC;
@@ -276,7 +278,7 @@ static void rna_Material_use_specular_ramp_set(PointerRNA *ptr, int value)
static void rna_Material_use_nodes_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
Material *ma = (Material*)ptr->data;
Material *ma = (Material *)ptr->data;
if (ma->use_nodes && ma->nodetree == NULL)
ED_node_shader_default(scene, &ma->id);
@@ -287,7 +289,7 @@ static void rna_Material_use_nodes_update(Main *bmain, Scene *scene, PointerRNA
static EnumPropertyItem *rna_Material_texture_coordinates_itemf(bContext *UNUSED(C), PointerRNA *ptr,
PropertyRNA *UNUSED(prop), int *free)
{
Material *ma = (Material*)ptr->id.data;
Material *ma = (Material *)ptr->id.data;
EnumPropertyItem *item = NULL;
int totitem = 0;
@@ -385,35 +387,40 @@ static void rna_def_material_mtex(BlenderRNA *brna)
{MTEX_CUBE, "CUBE", 0, "Cube", "Map using the normal vector"},
{MTEX_TUBE, "TUBE", 0, "Tube", "Map with Z as central axis"},
{MTEX_SPHERE, "SPHERE", 0, "Sphere", "Map with Z as central axis"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem prop_x_mapping_items[] = {
{0, "NONE", 0, "None", ""},
{1, "X", 0, "X", ""},
{2, "Y", 0, "Y", ""},
{3, "Z", 0, "Z", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem prop_y_mapping_items[] = {
{0, "NONE", 0, "None", ""},
{1, "X", 0, "X", ""},
{2, "Y", 0, "Y", ""},
{3, "Z", 0, "Z", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem prop_z_mapping_items[] = {
{0, "NONE", 0, "None", ""},
{1, "X", 0, "X", ""},
{2, "Y", 0, "Y", ""},
{3, "Z", 0, "Z", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem prop_normal_map_space_items[] = {
{MTEX_NSPACE_CAMERA, "CAMERA", 0, "Camera", ""},
{MTEX_NSPACE_WORLD, "WORLD", 0, "World", ""},
{MTEX_NSPACE_OBJECT, "OBJECT", 0, "Object", ""},
{MTEX_NSPACE_TANGENT, "TANGENT", 0, "Tangent", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem prop_bump_method_items[] = {
{0, "BUMP_ORIGINAL", 0, "Original", ""},
@@ -421,15 +428,17 @@ static void rna_def_material_mtex(BlenderRNA *brna)
{MTEX_3TAP_BUMP, "BUMP_LOW_QUALITY", 0, "Low Quality", "Use 3 tap filtering"},
{MTEX_5TAP_BUMP, "BUMP_MEDIUM_QUALITY", 0, "Medium Quality", "Use 5 tap filtering"},
{MTEX_BICUBIC_BUMP, "BUMP_BEST_QUALITY", 0,
"Best Quality", "Use bicubic filtering (requires OpenGL 3.0+, it will fall back on "
"medium setting for other systems)"},
{0, NULL, 0, NULL, NULL}};
"Best Quality", "Use bicubic filtering (requires OpenGL 3.0+, it will fall back on "
"medium setting for other systems)"},
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem prop_bump_space_items[] = {
{0, "BUMP_VIEWSPACE", 0, "ViewSpace", ""},
{MTEX_BUMP_OBJECTSPACE, "BUMP_OBJECTSPACE", 0, "ObjectSpace", ""},
{MTEX_BUMP_TEXTURESPACE, "BUMP_TEXTURESPACE", 0, "TextureSpace", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
srna = RNA_def_struct(brna, "MaterialTextureSlot", "TextureSlot");
RNA_def_struct_sdna(srna, "MTex");
@@ -763,14 +772,16 @@ static void rna_def_material_gamesettings(BlenderRNA *brna)
"Render polygon transparent, depending on alpha channel of the texture"},
{GEMAT_ALPHA_SORT, "ALPHA_SORT", 0, "Alpha Sort",
"Sort faces for correct alpha drawing (slow, use Alpha Clip instead when possible)"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem prop_face_orientation_items[] = {
{GEMAT_NORMAL, "NORMAL", 0, "Normal", "No tranformation"},
{GEMAT_HALO, "HALO", 0, "Halo", "Screen aligned billboard"},
{GEMAT_BILLBOARD, "BILLBOARD", 0, "Billboard", "Billboard with Z-axis constraint"},
{GEMAT_SHADOW, "SHADOW", 0, "Shadow", "Faces are used for shadow"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
srna = RNA_def_struct(brna, "MaterialGameSettings", NULL);
RNA_def_struct_sdna(srna, "GameSettings");
@@ -816,7 +827,8 @@ static void rna_def_material_colors(StructRNA *srna)
{MA_RAMP_IN_ENERGY, "ENERGY", 0, "Energy", ""},
{MA_RAMP_IN_NOR, "NORMAL", 0, "Normal", ""},
{MA_RAMP_IN_RESULT, "RESULT", 0, "Result", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
prop = RNA_def_property(srna, "diffuse_color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "r");
@@ -919,7 +931,8 @@ static void rna_def_material_diffuse(StructRNA *srna)
{MA_DIFF_TOON, "TOON", 0, "Toon", "Use a toon shader"},
{MA_DIFF_MINNAERT, "MINNAERT", 0, "Minnaert", "Use a Minnaert shader"},
{MA_DIFF_FRESNEL, "FRESNEL", 0, "Fresnel", "Use a Fresnel shader"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
prop = RNA_def_property(srna, "diffuse_shader", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "diff_shader");
@@ -976,7 +989,8 @@ static void rna_def_material_raymirror(BlenderRNA *brna)
static EnumPropertyItem prop_fadeto_mir_items[] = {
{MA_RAYMIR_FADETOSKY, "FADE_TO_SKY", 0, "Sky", ""},
{MA_RAYMIR_FADETOMAT, "FADE_TO_MATERIAL", 0, "Material", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
srna = RNA_def_struct(brna, "MaterialRaytraceMirror", NULL);
RNA_def_struct_sdna(srna, "Material");
@@ -1148,13 +1162,15 @@ static void rna_def_material_volume(BlenderRNA *brna)
{MA_VOL_SHADE_SHADED, "SHADED", 0, "Shaded", ""},
{MA_VOL_SHADE_MULTIPLE, "MULTIPLE_SCATTERING", 0, "Multiple Scattering", ""},
{MA_VOL_SHADE_SHADEDPLUSMULTIPLE, "SHADED_PLUS_MULTIPLE_SCATTERING", 0, "Shaded + Multiple Scattering", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem prop_stepsize_items[] = {
{MA_VOL_STEP_RANDOMIZED, "RANDOMIZED", 0, "Randomized", ""},
{MA_VOL_STEP_CONSTANT, "CONSTANT", 0, "Constant", ""},
/*{MA_VOL_STEP_ADAPTIVE, "ADAPTIVE", 0, "Adaptive", ""}, */
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
srna = RNA_def_struct(brna, "MaterialVolume", NULL);
RNA_def_struct_sdna(srna, "VolumeSettings");
@@ -1433,7 +1449,7 @@ static void rna_def_material_sss(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Material Subsurface Scattering",
"Diffuse subsurface scattering settings for a Material datablock");
prop = RNA_def_property(srna, "radius", PROP_FLOAT, PROP_COLOR|PROP_UNIT_LENGTH);
prop = RNA_def_property(srna, "radius", PROP_FLOAT, PROP_COLOR | PROP_UNIT_LENGTH);
RNA_def_property_float_sdna(prop, NULL, "sss_radius");
RNA_def_property_range(prop, 0.001, FLT_MAX);
RNA_def_property_ui_range(prop, 0.001, 10000, 1, 3);
@@ -1503,7 +1519,8 @@ static void rna_def_material_specularity(StructRNA *srna)
{MA_SPEC_BLINN, "BLINN", 0, "Blinn", "Use a Blinn shader"},
{MA_SPEC_TOON, "TOON", 0, "Toon", "Use a toon shader"},
{MA_SPEC_WARDISO, "WARDISO", 0, "WardIso", "Use a Ward anisotropic shader"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
prop = RNA_def_property(srna, "specular_shader", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "spec_shader");
@@ -1678,12 +1695,14 @@ void RNA_def_material(BlenderRNA *brna)
{MA_TYPE_WIRE, "WIRE", 0, "Wire", "Render the edges of faces as wires (not supported in raytracing)"},
{MA_TYPE_VOLUME, "VOLUME", 0, "Volume", "Render object as a volume"},
{MA_TYPE_HALO, "HALO", 0, "Halo", "Render object as halo particles"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem transparency_items[] = {
{0, "MASK", 0, "Mask", "Mask the background"},
{MA_ZTRANSP, "Z_TRANSPARENCY", 0, "Z Transparency", "Use alpha buffer for transparent faces"},
{MA_RAYTRANSP, "RAYTRACE", 0, "Raytrace", "Use raytracing for transparent refraction rendering"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
/* Render Preview Types */
static EnumPropertyItem preview_type_items[] = {
@@ -1693,14 +1712,16 @@ void RNA_def_material(BlenderRNA *brna)
{MA_MONKEY, "MONKEY", ICON_MONKEY, "Monkey", "Monkey"},
{MA_HAIR, "HAIR", ICON_HAIR, "Hair", "Hair strands"},
{MA_SPHERE_A, "SPHERE_A", ICON_MAT_SPHERE_SKY, "World Sphere", "Large sphere with sky"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem prop_shadows_only_items[] = {
{MA_SO_OLD, "SHADOW_ONLY_OLD", 0, "Shadow and Distance", "Old shadow only method"},
{MA_SO_SHADOW, "SHADOW_ONLY", 0, "Shadow Only", "Improved shadow only method"},
{MA_SO_SHADED, "SHADOW_ONLY_SHADED", 0, "Shadow and Shading",
"Improved shadow only method which also renders lightless areas as shadows"},
{0, NULL, 0, NULL, NULL}};
"Improved shadow only method which also renders lightless areas as shadows"},
{0, NULL, 0, NULL, NULL}
};
srna = RNA_def_struct(brna, "Material", "ID");
RNA_def_struct_ui_text(srna, "Material",
@@ -1990,8 +2011,8 @@ void RNA_def_material(BlenderRNA *brna)
/* common */
rna_def_animdata_common(srna);
rna_def_mtex_common(brna, srna, "rna_Material_mtex_begin", "rna_Material_active_texture_get",
"rna_Material_active_texture_set", "rna_Material_active_texture_editable",
"MaterialTextureSlot", "MaterialTextureSlots", "rna_Material_update");
"rna_Material_active_texture_set", "rna_Material_active_texture_editable",
"MaterialTextureSlot", "MaterialTextureSlots", "rna_Material_update");
/* only material has this one */
prop = RNA_def_property(srna, "use_textures", PROP_BOOLEAN, PROP_NONE);
@@ -2034,26 +2055,26 @@ static void rna_def_texture_slots(BlenderRNA *brna, PropertyRNA *cprop, const ch
/* functions */
func = RNA_def_function(srna, "add", "rna_mtex_texture_slots_add");
RNA_def_function_flag(func, FUNC_USE_SELF_ID|FUNC_NO_SELF|FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_NO_SELF | FUNC_USE_CONTEXT | FUNC_USE_REPORTS);
parm = RNA_def_pointer(func, "mtex", structname, "", "The newly initialized mtex");
RNA_def_function_return(func, parm);
func = RNA_def_function(srna, "create", "rna_mtex_texture_slots_create");
RNA_def_function_flag(func, FUNC_USE_SELF_ID|FUNC_NO_SELF|FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_NO_SELF | FUNC_USE_CONTEXT | FUNC_USE_REPORTS);
parm = RNA_def_int(func, "index", 0, 0, INT_MAX, "Index", "Slot index to initialize", 0, INT_MAX);
RNA_def_property_flag(parm, PROP_REQUIRED);
parm = RNA_def_pointer(func, "mtex", structname, "", "The newly initialized mtex");
RNA_def_function_return(func, parm);
func = RNA_def_function(srna, "clear", "rna_mtex_texture_slots_clear");
RNA_def_function_flag(func, FUNC_USE_SELF_ID|FUNC_NO_SELF|FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_NO_SELF | FUNC_USE_CONTEXT | FUNC_USE_REPORTS);
parm = RNA_def_int(func, "index", 0, 0, INT_MAX, "Index", "Slot index to clear", 0, INT_MAX);
RNA_def_property_flag(parm, PROP_REQUIRED);
}
void rna_def_mtex_common(BlenderRNA *brna, StructRNA *srna, const char *begin,
const char *activeget, const char *activeset, const char *activeeditable,
const char *structname, const char *structname_slots, const char *update)
const char *activeget, const char *activeset, const char *activeeditable,
const char *structname, const char *structname_slots, const char *update)
{
PropertyRNA *prop;
@@ -2076,7 +2097,7 @@ void rna_def_mtex_common(BlenderRNA *brna, StructRNA *srna, const char *begin,
prop = RNA_def_property(srna, "active_texture_index", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "texact");
RNA_def_property_range(prop, 0, MAX_MTEX-1);
RNA_def_property_range(prop, 0, MAX_MTEX - 1);
RNA_def_property_ui_text(prop, "Active Texture Index", "Index of active texture slot");
RNA_def_property_update(prop, 0, update);
}

View File

@@ -116,7 +116,7 @@ static void rna_Mesh_update_data(Main *bmain, Scene *scene, PointerRNA *ptr)
/* cheating way for importers to avoid slow updates */
if (id->us > 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);
}
}
@@ -125,7 +125,7 @@ static void rna_Mesh_update_select(Main *bmain, Scene *scene, PointerRNA *ptr)
ID *id = ptr->id.data;
/* cheating way for importers to avoid slow updates */
if (id->us > 0) {
WM_main_add_notifier(NC_GEOM|ND_SELECT, id);
WM_main_add_notifier(NC_GEOM | ND_SELECT, id);
}
}
@@ -134,14 +134,14 @@ void rna_Mesh_update_draw(Main *bmain, Scene *scene, PointerRNA *ptr)
ID *id = ptr->id.data;
/* cheating way for importers to avoid slow updates */
if (id->us > 0) {
WM_main_add_notifier(NC_GEOM|ND_DATA, id);
WM_main_add_notifier(NC_GEOM | ND_DATA, id);
}
}
void rna_Mesh_update_vertmask(Main *bmain, Scene *scene, PointerRNA *ptr)
{
Mesh* me = ptr->data;
Mesh *me = ptr->data;
if ((me->editflag & ME_EDIT_VERT_SEL) && (me->editflag & ME_EDIT_PAINT_MASK)) {
me->editflag ^= ME_EDIT_PAINT_MASK;
}
@@ -150,7 +150,7 @@ void rna_Mesh_update_vertmask(Main *bmain, Scene *scene, PointerRNA *ptr)
void rna_Mesh_update_facemask(Main *bmain, Scene *scene, PointerRNA *ptr)
{
Mesh* me = ptr->data;
Mesh *me = ptr->data;
if ((me->editflag & ME_EDIT_VERT_SEL) && (me->editflag & ME_EDIT_PAINT_MASK)) {
me->editflag ^= ME_EDIT_VERT_SEL;
}
@@ -158,13 +158,13 @@ void rna_Mesh_update_facemask(Main *bmain, Scene *scene, PointerRNA *ptr)
}
static void rna_MeshVertex_normal_get(PointerRNA *ptr, float *value)
{
MVert *mvert = (MVert*)ptr->data;
MVert *mvert = (MVert *)ptr->data;
normal_short_to_float_v3(value, mvert->no);
}
static void rna_MeshVertex_normal_set(PointerRNA *ptr, const float *value)
{
MVert *mvert = (MVert*)ptr->data;
MVert *mvert = (MVert *)ptr->data;
float no[3];
copy_v3_v3(no, value);
@@ -174,61 +174,61 @@ static void rna_MeshVertex_normal_set(PointerRNA *ptr, const float *value)
static float rna_MeshVertex_bevel_weight_get(PointerRNA *ptr)
{
MVert *mvert = (MVert*)ptr->data;
return mvert->bweight/255.0f;
MVert *mvert = (MVert *)ptr->data;
return mvert->bweight / 255.0f;
}
static void rna_MeshVertex_bevel_weight_set(PointerRNA *ptr, float value)
{
MVert *mvert = (MVert*)ptr->data;
mvert->bweight = (char)(CLAMPIS(value*255.0f, 0, 255));
MVert *mvert = (MVert *)ptr->data;
mvert->bweight = (char)(CLAMPIS(value * 255.0f, 0, 255));
}
static float rna_MEdge_bevel_weight_get(PointerRNA *ptr)
{
MEdge *medge = (MEdge*)ptr->data;
return medge->bweight/255.0f;
MEdge *medge = (MEdge *)ptr->data;
return medge->bweight / 255.0f;
}
static void rna_MEdge_bevel_weight_set(PointerRNA *ptr, float value)
{
MEdge *medge = (MEdge*)ptr->data;
medge->bweight = (char)(CLAMPIS(value*255.0f, 0, 255));
MEdge *medge = (MEdge *)ptr->data;
medge->bweight = (char)(CLAMPIS(value * 255.0f, 0, 255));
}
static float rna_MEdge_crease_get(PointerRNA *ptr)
{
MEdge *medge = (MEdge*)ptr->data;
return medge->crease/255.0f;
MEdge *medge = (MEdge *)ptr->data;
return medge->crease / 255.0f;
}
static void rna_MEdge_crease_set(PointerRNA *ptr, float value)
{
MEdge *medge = (MEdge*)ptr->data;
medge->crease = (char)(CLAMPIS(value*255.0f, 0, 255));
MEdge *medge = (MEdge *)ptr->data;
medge->crease = (char)(CLAMPIS(value * 255.0f, 0, 255));
}
static void rna_MeshPolygon_normal_get(PointerRNA *ptr, float *values)
{
Mesh *me = rna_mesh(ptr);
MPoly *mp = (MPoly*)ptr->data;
MPoly *mp = (MPoly *)ptr->data;
/* BMESH_TODO: might be faster to look for a CD_NORMALS layer and use that */
mesh_calc_poly_normal(mp, me->mloop+mp->loopstart, me->mvert, values);
mesh_calc_poly_normal(mp, me->mloop + mp->loopstart, me->mvert, values);
}
static float rna_MeshPolygon_area_get(PointerRNA *ptr)
{
Mesh *me = (Mesh*)ptr->id.data;
MPoly *mp = (MPoly*)ptr->data;
Mesh *me = (Mesh *)ptr->id.data;
MPoly *mp = (MPoly *)ptr->data;
return BKE_mesh_calc_poly_area(mp, me->mloop+mp->loopstart, me->mvert, NULL);
return BKE_mesh_calc_poly_area(mp, me->mloop + mp->loopstart, me->mvert, NULL);
}
static void rna_MeshTessFace_normal_get(PointerRNA *ptr, float *values)
{
Mesh *me = rna_mesh(ptr);
MFace *mface = (MFace*)ptr->data;
MFace *mface = (MFace *)ptr->data;
if (mface->v4)
normal_quad_v3(values, me->mvert[mface->v1].co, me->mvert[mface->v2].co,
@@ -240,7 +240,7 @@ static void rna_MeshTessFace_normal_get(PointerRNA *ptr, float *values)
static float rna_MeshTessFace_area_get(PointerRNA *ptr)
{
Mesh *me = rna_mesh(ptr);
MFace *mface = (MFace*)ptr->data;
MFace *mface = (MFace *)ptr->data;
if (mface->v4)
return area_quad_v3(me->mvert[mface->v1].co, me->mvert[mface->v2].co, me->mvert[mface->v3].co,
@@ -251,7 +251,7 @@ static float rna_MeshTessFace_area_get(PointerRNA *ptr)
static void rna_MeshTextureFace_uv1_get(PointerRNA *ptr, float *values)
{
MTFace *mtface = (MTFace*)ptr->data;
MTFace *mtface = (MTFace *)ptr->data;
values[0] = mtface->uv[0][0];
values[1] = mtface->uv[0][1];
@@ -259,7 +259,7 @@ static void rna_MeshTextureFace_uv1_get(PointerRNA *ptr, float *values)
static void rna_MeshTextureFace_uv1_set(PointerRNA *ptr, const float *values)
{
MTFace *mtface = (MTFace*)ptr->data;
MTFace *mtface = (MTFace *)ptr->data;
mtface->uv[0][0] = values[0];
mtface->uv[0][1] = values[1];
@@ -267,7 +267,7 @@ static void rna_MeshTextureFace_uv1_set(PointerRNA *ptr, const float *values)
static void rna_MeshTextureFace_uv2_get(PointerRNA *ptr, float *values)
{
MTFace *mtface = (MTFace*)ptr->data;
MTFace *mtface = (MTFace *)ptr->data;
values[0] = mtface->uv[1][0];
values[1] = mtface->uv[1][1];
@@ -275,7 +275,7 @@ static void rna_MeshTextureFace_uv2_get(PointerRNA *ptr, float *values)
static void rna_MeshTextureFace_uv2_set(PointerRNA *ptr, const float *values)
{
MTFace *mtface = (MTFace*)ptr->data;
MTFace *mtface = (MTFace *)ptr->data;
mtface->uv[1][0] = values[0];
mtface->uv[1][1] = values[1];
@@ -283,7 +283,7 @@ static void rna_MeshTextureFace_uv2_set(PointerRNA *ptr, const float *values)
static void rna_MeshTextureFace_uv3_get(PointerRNA *ptr, float *values)
{
MTFace *mtface = (MTFace*)ptr->data;
MTFace *mtface = (MTFace *)ptr->data;
values[0] = mtface->uv[2][0];
values[1] = mtface->uv[2][1];
@@ -291,7 +291,7 @@ static void rna_MeshTextureFace_uv3_get(PointerRNA *ptr, float *values)
static void rna_MeshTextureFace_uv3_set(PointerRNA *ptr, const float *values)
{
MTFace *mtface = (MTFace*)ptr->data;
MTFace *mtface = (MTFace *)ptr->data;
mtface->uv[2][0] = values[0];
mtface->uv[2][1] = values[1];
@@ -299,7 +299,7 @@ static void rna_MeshTextureFace_uv3_set(PointerRNA *ptr, const float *values)
static void rna_MeshTextureFace_uv4_get(PointerRNA *ptr, float *values)
{
MTFace *mtface = (MTFace*)ptr->data;
MTFace *mtface = (MTFace *)ptr->data;
values[0] = mtface->uv[3][0];
values[1] = mtface->uv[3][1];
@@ -307,7 +307,7 @@ static void rna_MeshTextureFace_uv4_get(PointerRNA *ptr, float *values)
static void rna_MeshTextureFace_uv4_set(PointerRNA *ptr, const float *values)
{
MTFace *mtface = (MTFace*)ptr->data;
MTFace *mtface = (MTFace *)ptr->data;
mtface->uv[3][0] = values[0];
mtface->uv[3][1] = values[1];
@@ -322,7 +322,7 @@ static int rna_CustomDataData_numverts(PointerRNA *ptr, int type)
for (cdl = fdata->layers, a = 0; a < fdata->totlayer; cdl++, a++) {
if (cdl->type == type) {
b = ((char *)ptr->data - ((char*)cdl->data)) / CustomData_sizeof(type);
b = ((char *)ptr->data - ((char *)cdl->data)) / CustomData_sizeof(type);
if (b >= 0 && b < me->totface) {
return (me->mface[b].v4 ? 4 : 3);
}
@@ -336,12 +336,12 @@ static int rna_MeshTextureFace_uv_get_length(PointerRNA *ptr, int length[RNA_MAX
{
length[0] = rna_CustomDataData_numverts(ptr, CD_MTFACE);
length[1] = 2;
return length[0]*length[1];
return length[0] * length[1];
}
static void rna_MeshTextureFace_uv_get(PointerRNA *ptr, float *values)
{
MTFace *mtface = (MTFace*)ptr->data;
MTFace *mtface = (MTFace *)ptr->data;
int totvert = rna_CustomDataData_numverts(ptr, CD_MTFACE);
memcpy(values, mtface->uv, totvert * 2 * sizeof(float));
@@ -349,7 +349,7 @@ static void rna_MeshTextureFace_uv_get(PointerRNA *ptr, float *values)
static void rna_MeshTextureFace_uv_set(PointerRNA *ptr, const float *values)
{
MTFace *mtface = (MTFace*)ptr->data;
MTFace *mtface = (MTFace *)ptr->data;
int totvert = rna_CustomDataData_numverts(ptr, CD_MTFACE);
memcpy(mtface->uv, values, totvert * 2 * sizeof(float));
@@ -358,74 +358,74 @@ static void rna_MeshTextureFace_uv_set(PointerRNA *ptr, const float *values)
/* notice red and blue are swapped */
static void rna_MeshColor_color1_get(PointerRNA *ptr, float *values)
{
MCol *mcol = (MCol*)ptr->data;
MCol *mcol = (MCol *)ptr->data;
values[2] = (&mcol[0].r)[0]/255.0f;
values[1] = (&mcol[0].r)[1]/255.0f;
values[0] = (&mcol[0].r)[2]/255.0f;
values[2] = (&mcol[0].r)[0] / 255.0f;
values[1] = (&mcol[0].r)[1] / 255.0f;
values[0] = (&mcol[0].r)[2] / 255.0f;
}
static void rna_MeshColor_color1_set(PointerRNA *ptr, const float *values)
{
MCol *mcol = (MCol*)ptr->data;
MCol *mcol = (MCol *)ptr->data;
(&mcol[0].r)[2] = (char)(CLAMPIS(values[0]*255.0f, 0, 255));
(&mcol[0].r)[1] = (char)(CLAMPIS(values[1]*255.0f, 0, 255));
(&mcol[0].r)[0] = (char)(CLAMPIS(values[2]*255.0f, 0, 255));
(&mcol[0].r)[2] = (char)(CLAMPIS(values[0] * 255.0f, 0, 255));
(&mcol[0].r)[1] = (char)(CLAMPIS(values[1] * 255.0f, 0, 255));
(&mcol[0].r)[0] = (char)(CLAMPIS(values[2] * 255.0f, 0, 255));
}
static void rna_MeshColor_color2_get(PointerRNA *ptr, float *values)
{
MCol *mcol = (MCol*)ptr->data;
MCol *mcol = (MCol *)ptr->data;
values[2] = (&mcol[1].r)[0]/255.0f;
values[1] = (&mcol[1].r)[1]/255.0f;
values[0] = (&mcol[1].r)[2]/255.0f;
values[2] = (&mcol[1].r)[0] / 255.0f;
values[1] = (&mcol[1].r)[1] / 255.0f;
values[0] = (&mcol[1].r)[2] / 255.0f;
}
static void rna_MeshColor_color2_set(PointerRNA *ptr, const float *values)
{
MCol *mcol = (MCol*)ptr->data;
MCol *mcol = (MCol *)ptr->data;
(&mcol[1].r)[2] = (char)(CLAMPIS(values[0]*255.0f, 0, 255));
(&mcol[1].r)[1] = (char)(CLAMPIS(values[1]*255.0f, 0, 255));
(&mcol[1].r)[0] = (char)(CLAMPIS(values[2]*255.0f, 0, 255));
(&mcol[1].r)[2] = (char)(CLAMPIS(values[0] * 255.0f, 0, 255));
(&mcol[1].r)[1] = (char)(CLAMPIS(values[1] * 255.0f, 0, 255));
(&mcol[1].r)[0] = (char)(CLAMPIS(values[2] * 255.0f, 0, 255));
}
static void rna_MeshColor_color3_get(PointerRNA *ptr, float *values)
{
MCol *mcol = (MCol*)ptr->data;
MCol *mcol = (MCol *)ptr->data;
values[2] = (&mcol[2].r)[0]/255.0f;
values[1] = (&mcol[2].r)[1]/255.0f;
values[0] = (&mcol[2].r)[2]/255.0f;
values[2] = (&mcol[2].r)[0] / 255.0f;
values[1] = (&mcol[2].r)[1] / 255.0f;
values[0] = (&mcol[2].r)[2] / 255.0f;
}
static void rna_MeshColor_color3_set(PointerRNA *ptr, const float *values)
{
MCol *mcol = (MCol*)ptr->data;
MCol *mcol = (MCol *)ptr->data;
(&mcol[2].r)[2] = (char)(CLAMPIS(values[0]*255.0f, 0, 255));
(&mcol[2].r)[1] = (char)(CLAMPIS(values[1]*255.0f, 0, 255));
(&mcol[2].r)[0] = (char)(CLAMPIS(values[2]*255.0f, 0, 255));
(&mcol[2].r)[2] = (char)(CLAMPIS(values[0] * 255.0f, 0, 255));
(&mcol[2].r)[1] = (char)(CLAMPIS(values[1] * 255.0f, 0, 255));
(&mcol[2].r)[0] = (char)(CLAMPIS(values[2] * 255.0f, 0, 255));
}
static void rna_MeshColor_color4_get(PointerRNA *ptr, float *values)
{
MCol *mcol = (MCol*)ptr->data;
MCol *mcol = (MCol *)ptr->data;
values[2] = (&mcol[3].r)[0]/255.0f;
values[1] = (&mcol[3].r)[1]/255.0f;
values[0] = (&mcol[3].r)[2]/255.0f;
values[2] = (&mcol[3].r)[0] / 255.0f;
values[1] = (&mcol[3].r)[1] / 255.0f;
values[0] = (&mcol[3].r)[2] / 255.0f;
}
static void rna_MeshColor_color4_set(PointerRNA *ptr, const float *values)
{
MCol *mcol = (MCol*)ptr->data;
MCol *mcol = (MCol *)ptr->data;
(&mcol[3].r)[2] = (char)(CLAMPIS(values[0]*255.0f, 0, 255));
(&mcol[3].r)[1] = (char)(CLAMPIS(values[1]*255.0f, 0, 255));
(&mcol[3].r)[0] = (char)(CLAMPIS(values[2]*255.0f, 0, 255));
(&mcol[3].r)[2] = (char)(CLAMPIS(values[0] * 255.0f, 0, 255));
(&mcol[3].r)[1] = (char)(CLAMPIS(values[1] * 255.0f, 0, 255));
(&mcol[3].r)[0] = (char)(CLAMPIS(values[2] * 255.0f, 0, 255));
}
static void rna_MeshLoopColor_color_get(PointerRNA *ptr, float *values)
@@ -448,15 +448,15 @@ static void rna_MeshLoopColor_color_set(PointerRNA *ptr, const float *values)
static int rna_Mesh_texspace_editable(PointerRNA *ptr)
{
Mesh *me = (Mesh*)ptr->data;
return (me->texflag & ME_AUTOSPACE)? 0: PROP_EDITABLE;
Mesh *me = (Mesh *)ptr->data;
return (me->texflag & ME_AUTOSPACE) ? 0 : PROP_EDITABLE;
}
static void rna_Mesh_texspace_size_get(PointerRNA *ptr, float values[3])
{
Mesh *me= (Mesh*)ptr->data;
Mesh *me = (Mesh *)ptr->data;
if(!me->bb)
if (!me->bb)
BKE_mesh_texspace_calc(me);
copy_v3_v3(values, me->size);
@@ -464,9 +464,9 @@ static void rna_Mesh_texspace_size_get(PointerRNA *ptr, float values[3])
static void rna_Mesh_texspace_loc_get(PointerRNA *ptr, float values[3])
{
Mesh *me= (Mesh*)ptr->data;
Mesh *me = (Mesh *)ptr->data;
if(!me->bb)
if (!me->bb)
BKE_mesh_texspace_calc(me);
copy_v3_v3(values, me->loc);
@@ -477,10 +477,10 @@ static void rna_MeshVertex_groups_begin(CollectionPropertyIterator *iter, Pointe
Mesh *me = rna_mesh(ptr);
if (me->dvert) {
MVert *mvert = (MVert*)ptr->data;
MDeformVert *dvert = me->dvert + (mvert-me->mvert);
MVert *mvert = (MVert *)ptr->data;
MDeformVert *dvert = me->dvert + (mvert - me->mvert);
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);
}
else
rna_iterator_array_begin(iter, NULL, 0, 0, 0, NULL);
@@ -488,7 +488,7 @@ static void rna_MeshVertex_groups_begin(CollectionPropertyIterator *iter, Pointe
static int rna_CustomDataLayer_active_get(PointerRNA *ptr, CustomData *data, int type, int render)
{
int n = ((CustomDataLayer*)ptr->data) - data->layers;
int n = ((CustomDataLayer *)ptr->data) - data->layers;
if (render) return (n == CustomData_get_render_layer_index(data, type));
else return (n == CustomData_get_active_layer_index(data, type));
@@ -496,32 +496,32 @@ static int rna_CustomDataLayer_active_get(PointerRNA *ptr, CustomData *data, int
static int rna_CustomDataLayer_clone_get(PointerRNA *ptr, CustomData *data, int type, int render)
{
int n = ((CustomDataLayer*)ptr->data) - data->layers;
int n = ((CustomDataLayer *)ptr->data) - data->layers;
return (n == CustomData_get_clone_layer_index(data, type));
}
static void rna_CustomDataLayer_active_set(PointerRNA *ptr, CustomData *data, int value, int type, int render)
{
int n = (((CustomDataLayer*)ptr->data) - data->layers) - CustomData_get_layer_index(data, type);
int n = (((CustomDataLayer *)ptr->data) - data->layers) - CustomData_get_layer_index(data, type);
if (value == 0)
return;
if (render) CustomData_set_layer_render(data, type, n);
else CustomData_set_layer_active(data, type, n);
else CustomData_set_layer_active(data, type, n);
/* sync loop layer */
if (type == CD_MTEXPOLY) {
CustomData *ldata = rna_mesh_ldata(ptr);
if (render) CustomData_set_layer_render(ldata, CD_MLOOPUV, n);
else CustomData_set_layer_active(ldata, CD_MLOOPUV, n);
else CustomData_set_layer_active(ldata, CD_MLOOPUV, n);
}
}
static void rna_CustomDataLayer_clone_set(PointerRNA *ptr, CustomData *data, int value, int type, int render)
{
int n = ((CustomDataLayer*)ptr->data) - data->layers;
int n = ((CustomDataLayer *)ptr->data) - data->layers;
if (value == 0)
return;
@@ -539,9 +539,9 @@ DEFINE_CUSTOMDATA_LAYER_COLLECTION_ACTIVEITEM(uv_layer, ldata, CD_MLOOPUV, rende
/* MeshUVLoopLayer */
static char *rna_MeshUVLoopLayer_path(PointerRNA *ptr)
static char *rna_MeshUVLoopLayer_path(PointerRNA * ptr)
{
return BLI_sprintfN("uv_layers[\"%s\"]", ((CustomDataLayer*)ptr->data)->name);
return BLI_sprintfN("uv_layers[\"%s\"]", ((CustomDataLayer *)ptr->data)->name);
}
static void rna_MeshUVLoopLayer_data_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
@@ -568,14 +568,14 @@ DEFINE_CUSTOMDATA_LAYER_COLLECTION_ACTIVEITEM(tessface_uv_texture, fdata, CD_MTF
static void rna_MeshTextureFaceLayer_data_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
Mesh *me = rna_mesh(ptr);
CustomDataLayer *layer = (CustomDataLayer*)ptr->data;
rna_iterator_array_begin(iter, layer->data, sizeof(MTFace), (me->edit_btmesh)? 0: me->totface, 0, NULL);
CustomDataLayer *layer = (CustomDataLayer *)ptr->data;
rna_iterator_array_begin(iter, layer->data, sizeof(MTFace), (me->edit_btmesh) ? 0 : me->totface, 0, NULL);
}
static int rna_MeshTextureFaceLayer_data_length(PointerRNA *ptr)
{
Mesh *me = rna_mesh(ptr);
return (me->edit_btmesh)? 0: me->totface;
return (me->edit_btmesh) ? 0 : me->totface;
}
static int rna_MeshTextureFaceLayer_active_render_get(PointerRNA *ptr)
@@ -611,7 +611,7 @@ static void rna_MeshTextureFaceLayer_clone_set(PointerRNA *ptr, int value)
static void rna_MeshTextureFaceLayer_name_set(PointerRNA *ptr, const char *value)
{
CustomData *fdata = rna_mesh_fdata(ptr);
CustomDataLayer *cdl = (CustomDataLayer*)ptr->data;
CustomDataLayer *cdl = (CustomDataLayer *)ptr->data;
BLI_strncpy_utf8(cdl->name, value, sizeof(cdl->name));
CustomData_set_layer_unique_name(fdata, cdl - fdata->layers);
}
@@ -627,7 +627,7 @@ DEFINE_CUSTOMDATA_LAYER_COLLECTION_ACTIVEITEM(uv_texture, pdata, CD_MTEXPOLY, re
static void rna_MeshTexturePolyLayer_data_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
Mesh *me = rna_mesh(ptr);
CustomDataLayer *layer = (CustomDataLayer*)ptr->data;
CustomDataLayer *layer = (CustomDataLayer *)ptr->data;
rna_iterator_array_begin(iter, layer->data, sizeof(MTexPoly), (me->edit_btmesh) ? 0 : me->totpoly, 0, NULL);
}
@@ -670,7 +670,7 @@ static void rna_MeshTexturePolyLayer_clone_set(PointerRNA *ptr, int value)
static void rna_MeshTexturePolyLayer_name_set(PointerRNA *ptr, const char *value)
{
CustomData *pdata = rna_mesh_pdata(ptr);
CustomDataLayer *cdl = (CustomDataLayer*)ptr->data;
CustomDataLayer *cdl = (CustomDataLayer *)ptr->data;
BLI_strncpy_utf8(cdl->name, value, sizeof(cdl->name));
CustomData_set_layer_unique_name(pdata, cdl - pdata->layers);
}
@@ -721,7 +721,7 @@ DEFINE_CUSTOMDATA_LAYER_COLLECTION_ACTIVEITEM(vertex_color, ldata, CD_MLOOPCOL,
static void rna_MeshLoopColorLayer_data_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
Mesh *me = rna_mesh(ptr);
CustomDataLayer *layer = (CustomDataLayer*)ptr->data;
CustomDataLayer *layer = (CustomDataLayer *)ptr->data;
rna_iterator_array_begin(iter, layer->data, sizeof(MLoopCol), me->totloop, 0, NULL);
}
@@ -755,7 +755,7 @@ static void rna_MeshLoopColorLayer_name_set(PointerRNA *ptr, const char *value)
{
/* Mesh *me = rna_mesh(ptr); */ /* UNUSED */
/* CustomData *pdata = rna_mesh_pdata(ptr); */ /* UNUSED */
CustomDataLayer *cdl = (CustomDataLayer*)ptr->data;
CustomDataLayer *cdl = (CustomDataLayer *)ptr->data;
BLI_strncpy_utf8(cdl->name, value, sizeof(cdl->name));
CustomData_set_layer_unique_name(rna_mesh_ldata(ptr), cdl - rna_mesh_ldata(ptr)->layers);
}
@@ -763,7 +763,7 @@ static void rna_MeshLoopColorLayer_name_set(PointerRNA *ptr, const char *value)
static void rna_MeshFloatPropertyLayer_data_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
Mesh *me = rna_mesh(ptr);
CustomDataLayer *layer = (CustomDataLayer*)ptr->data;
CustomDataLayer *layer = (CustomDataLayer *)ptr->data;
rna_iterator_array_begin(iter, layer->data, sizeof(MFloatProperty), me->totpoly, 0, NULL);
}
@@ -775,14 +775,14 @@ static int rna_MeshFloatPropertyLayer_data_length(PointerRNA *ptr)
static int rna_float_layer_check(CollectionPropertyIterator *iter, void *data)
{
CustomDataLayer *layer = (CustomDataLayer*)data;
CustomDataLayer *layer = (CustomDataLayer *)data;
return (layer->type != CD_PROP_FLT);
}
static void rna_Mesh_polygon_float_layers_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
CustomData *pdata = rna_mesh_pdata(ptr);
rna_iterator_array_begin(iter, (void*)pdata->layers, sizeof(CustomDataLayer), pdata->totlayer, 0,
rna_iterator_array_begin(iter, (void *)pdata->layers, sizeof(CustomDataLayer), pdata->totlayer, 0,
rna_float_layer_check);
}
@@ -793,14 +793,14 @@ static int rna_Mesh_polygon_float_layers_length(PointerRNA *ptr)
static int rna_int_layer_check(CollectionPropertyIterator *iter, void *data)
{
CustomDataLayer *layer = (CustomDataLayer*)data;
CustomDataLayer *layer = (CustomDataLayer *)data;
return (layer->type != CD_PROP_INT);
}
static void rna_MeshIntPropertyLayer_data_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
Mesh *me = rna_mesh(ptr);
CustomDataLayer *layer = (CustomDataLayer*)ptr->data;
CustomDataLayer *layer = (CustomDataLayer *)ptr->data;
rna_iterator_array_begin(iter, layer->data, sizeof(MIntProperty), me->totpoly, 0, NULL);
}
@@ -813,7 +813,7 @@ static int rna_MeshIntPropertyLayer_data_length(PointerRNA *ptr)
static void rna_Mesh_polygon_int_layers_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
CustomData *pdata = rna_mesh_pdata(ptr);
rna_iterator_array_begin(iter, (void*)pdata->layers, sizeof(CustomDataLayer), pdata->totlayer, 0,
rna_iterator_array_begin(iter, (void *)pdata->layers, sizeof(CustomDataLayer), pdata->totlayer, 0,
rna_int_layer_check);
}
@@ -824,14 +824,14 @@ static int rna_Mesh_polygon_int_layers_length(PointerRNA *ptr)
static int rna_string_layer_check(CollectionPropertyIterator *iter, void *data)
{
CustomDataLayer *layer = (CustomDataLayer*)data;
CustomDataLayer *layer = (CustomDataLayer *)data;
return (layer->type != CD_PROP_STR);
}
static void rna_MeshStringPropertyLayer_data_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
Mesh *me = rna_mesh(ptr);
CustomDataLayer *layer = (CustomDataLayer*)ptr->data;
CustomDataLayer *layer = (CustomDataLayer *)ptr->data;
rna_iterator_array_begin(iter, layer->data, sizeof(MStringProperty), me->totpoly, 0, NULL);
}
@@ -844,7 +844,7 @@ static int rna_MeshStringPropertyLayer_data_length(PointerRNA *ptr)
static void rna_Mesh_polygon_string_layers_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
CustomData *pdata = rna_mesh_pdata(ptr);
rna_iterator_array_begin(iter, (void*)pdata->layers, sizeof(CustomDataLayer), pdata->totlayer, 0,
rna_iterator_array_begin(iter, (void *)pdata->layers, sizeof(CustomDataLayer), pdata->totlayer, 0,
rna_string_layer_check);
}
@@ -855,7 +855,7 @@ static int rna_Mesh_polygon_string_layers_length(PointerRNA *ptr)
static void rna_TexturePoly_image_set(PointerRNA *ptr, PointerRNA value)
{
MTexPoly *tf = (MTexPoly*)ptr->data;
MTexPoly *tf = (MTexPoly *)ptr->data;
ID *id = value.data;
if (id) {
@@ -874,7 +874,7 @@ static void rna_TexturePoly_image_set(PointerRNA *ptr, PointerRNA value)
* keep it to support importers that only make tessfaces */
static void rna_TextureFace_image_set(PointerRNA *ptr, PointerRNA value)
{
MTFace *tf = (MTFace*)ptr->data;
MTFace *tf = (MTFace *)ptr->data;
ID *id = value.data;
if (id) {
@@ -905,32 +905,32 @@ static float rna_Mesh_auto_smooth_angle_get(PointerRNA *ptr)
static int rna_MeshTessFace_verts_get_length(PointerRNA *ptr, int length[RNA_MAX_ARRAY_DIMENSION])
{
MFace *face = (MFace*)ptr->data;
MFace *face = (MFace *)ptr->data;
if (face)
length[0] = (face->v4)? 4: 3;
length[0] = (face->v4) ? 4 : 3;
else
length[0] = 4; /* XXX rna_raw_access wants the length of a dummy face. this needs fixing. - Campbell */
length[0] = 4; /* XXX rna_raw_access wants the length of a dummy face. this needs fixing. - Campbell */
return length[0];
}
static void rna_MeshTessFace_verts_get(PointerRNA *ptr, int *values)
{
MFace *face = (MFace*)ptr->data;
MFace *face = (MFace *)ptr->data;
memcpy(values, &face->v1, (face->v4 ? 4 : 3) * sizeof(int));
}
static void rna_MeshTessFace_verts_set(PointerRNA *ptr, const int *values)
{
MFace *face = (MFace*)ptr->data;
MFace *face = (MFace *)ptr->data;
memcpy(&face->v1, values, (face->v4 ? 4 : 3) * sizeof(int));
}
/* poly.vertices - this is faked loop access for convenience */
static int rna_MeshPoly_vertices_get_length(PointerRNA *ptr, int length[RNA_MAX_ARRAY_DIMENSION])
{
MPoly *mp = (MPoly*)ptr->data;
MPoly *mp = (MPoly *)ptr->data;
/* note, raw access uses dummy item, this _could_ crash, watch out for this, mface uses it but it cant work here */
return (length[0] = mp->totloop);
}
@@ -938,7 +938,7 @@ static int rna_MeshPoly_vertices_get_length(PointerRNA *ptr, int length[RNA_MAX_
static void rna_MeshPoly_vertices_get(PointerRNA *ptr, int *values)
{
Mesh *me = rna_mesh(ptr);
MPoly *mp = (MPoly*)ptr->data;
MPoly *mp = (MPoly *)ptr->data;
MLoop *ml = &me->mloop[mp->loopstart];
unsigned int i;
for (i = mp->totloop; i > 0; i--, values++, ml++) {
@@ -949,7 +949,7 @@ static void rna_MeshPoly_vertices_get(PointerRNA *ptr, int *values)
static void rna_MeshPoly_vertices_set(PointerRNA *ptr, const int *values)
{
Mesh *me = rna_mesh(ptr);
MPoly *mp = (MPoly*)ptr->data;
MPoly *mp = (MPoly *)ptr->data;
MLoop *ml = &me->mloop[mp->loopstart];
unsigned int i;
for (i = mp->totloop; i > 0; i--, values++, ml++) {
@@ -961,42 +961,42 @@ static void rna_MeshPoly_material_index_range(PointerRNA *ptr, int *min, int *ma
{
Mesh *me = rna_mesh(ptr);
*min = 0;
*max = me->totcol-1;
*max = me->totcol - 1;
*max = MAX2(0, *max);
}
static int rna_MeshVertex_index_get(PointerRNA *ptr)
{
Mesh *me = rna_mesh(ptr);
MVert *vert = (MVert*)ptr->data;
MVert *vert = (MVert *)ptr->data;
return (int)(vert - me->mvert);
}
static int rna_MeshEdge_index_get(PointerRNA *ptr)
{
Mesh *me = rna_mesh(ptr);
MEdge *edge = (MEdge*)ptr->data;
MEdge *edge = (MEdge *)ptr->data;
return (int)(edge - me->medge);
}
static int rna_MeshTessFace_index_get(PointerRNA *ptr)
{
Mesh *me = rna_mesh(ptr);
MFace *face = (MFace*)ptr->data;
MFace *face = (MFace *)ptr->data;
return (int)(face - me->mface);
}
static int rna_MeshPolygon_index_get(PointerRNA *ptr)
{
Mesh *me = rna_mesh(ptr);
MPoly *mpoly = (MPoly*)ptr->data;
MPoly *mpoly = (MPoly *)ptr->data;
return (int)(mpoly - me->mpoly);
}
static int rna_MeshLoop_index_get(PointerRNA *ptr)
{
Mesh *me = rna_mesh(ptr);
MLoop *mloop = (MLoop*)ptr->data;
MLoop *mloop = (MLoop *)ptr->data;
return (int)(mloop - me->mloop);
}
@@ -1005,7 +1005,7 @@ static int rna_MeshLoop_index_get(PointerRNA *ptr)
static char *rna_VertexGroupElement_path(PointerRNA *ptr)
{
Mesh *me = rna_mesh(ptr); /* XXX not always! */
MDeformWeight *dw = (MDeformWeight*)ptr->data;
MDeformWeight *dw = (MDeformWeight *)ptr->data;
MDeformVert *dvert;
int a, b;
@@ -1019,7 +1019,7 @@ static char *rna_VertexGroupElement_path(PointerRNA *ptr)
static char *rna_MeshPolygon_path(PointerRNA *ptr)
{
return BLI_sprintfN("polygons[%d]", (int)((MPoly*)ptr->data - rna_mesh(ptr)->mpoly));
return BLI_sprintfN("polygons[%d]", (int)((MPoly *)ptr->data - rna_mesh(ptr)->mpoly));
}
static char *rna_MeshTessFace_path(PointerRNA *ptr)
@@ -1029,28 +1029,28 @@ static char *rna_MeshTessFace_path(PointerRNA *ptr)
static char *rna_MeshEdge_path(PointerRNA *ptr)
{
return BLI_sprintfN("edges[%d]", (int)((MEdge*)ptr->data - rna_mesh(ptr)->medge));
return BLI_sprintfN("edges[%d]", (int)((MEdge *)ptr->data - rna_mesh(ptr)->medge));
}
static char *rna_MeshLoop_path(PointerRNA *ptr)
{
return BLI_sprintfN("loops[%d]", (int)((MLoop*)ptr->data - rna_mesh(ptr)->mloop));
return BLI_sprintfN("loops[%d]", (int)((MLoop *)ptr->data - rna_mesh(ptr)->mloop));
}
static char *rna_MeshVertex_path(PointerRNA *ptr)
{
return BLI_sprintfN("vertices[%d]", (int)((MVert*)ptr->data - rna_mesh(ptr)->mvert));
return BLI_sprintfN("vertices[%d]", (int)((MVert *)ptr->data - rna_mesh(ptr)->mvert));
}
static char *rna_MeshTextureFaceLayer_path(PointerRNA *ptr)
{
return BLI_sprintfN("tessface_uv_textures[\"%s\"]", ((CustomDataLayer*)ptr->data)->name);
return BLI_sprintfN("tessface_uv_textures[\"%s\"]", ((CustomDataLayer *)ptr->data)->name);
}
static char *rna_MeshTexturePolyLayer_path(PointerRNA *ptr)
{
return BLI_sprintfN("uv_textures[\"%s\"]", ((CustomDataLayer*)ptr->data)->name);
return BLI_sprintfN("uv_textures[\"%s\"]", ((CustomDataLayer *)ptr->data)->name);
}
static char *rna_PolyCustomData_data_path(PointerRNA *ptr, char *collection, int type)
@@ -1062,7 +1062,7 @@ static char *rna_PolyCustomData_data_path(PointerRNA *ptr, char *collection, int
for (cdl = pdata->layers, a = 0; a < pdata->totlayer; cdl++, a++) {
if (cdl->type == type) {
b = ((char*)ptr->data - ((char*)cdl->data))/CustomData_sizeof(type);
b = ((char *)ptr->data - ((char *)cdl->data)) / CustomData_sizeof(type);
if (b >= 0 && b < totpoly)
return BLI_sprintfN("%s[\"%s\"].data[%d]", collection, cdl->name, b);
}
@@ -1080,7 +1080,7 @@ static char *rna_LoopCustomData_data_path(PointerRNA *ptr, char *collection, int
for (cdl = ldata->layers, a = 0; a < ldata->totlayer; cdl++, a++) {
if (cdl->type == type) {
b = ((char*)ptr->data - ((char*)cdl->data))/CustomData_sizeof(type);
b = ((char *)ptr->data - ((char *)cdl->data)) / CustomData_sizeof(type);
if (b >= 0 && b < totloop)
return BLI_sprintfN("%s[\"%s\"].data[%d]", collection, cdl->name, b);
}
@@ -1098,7 +1098,7 @@ static char *rna_FaceCustomData_data_path(PointerRNA *ptr, char *collection, int
for (cdl = fdata->layers, a = 0; a < fdata->totlayer; cdl++, a++) {
if (cdl->type == type) {
b = ((char*)ptr->data - ((char*)cdl->data))/CustomData_sizeof(type);
b = ((char *)ptr->data - ((char *)cdl->data)) / CustomData_sizeof(type);
if (b >= 0 && b < totloop)
return BLI_sprintfN("%s[\"%s\"].data[%d]", collection, cdl->name, b);
}
@@ -1124,12 +1124,12 @@ static char *rna_MeshTexturePoly_path(PointerRNA *ptr)
static char *rna_MeshColorLayer_path(PointerRNA *ptr)
{
return BLI_sprintfN("tessface_vertex_colors[\"%s\"]", ((CustomDataLayer*)ptr->data)->name);
return BLI_sprintfN("tessface_vertex_colors[\"%s\"]", ((CustomDataLayer *)ptr->data)->name);
}
static char *rna_MeshLoopColorLayer_path(PointerRNA *ptr)
{
return BLI_sprintfN("vertex_colors[\"%s\"]", ((CustomDataLayer*)ptr->data)->name);
return BLI_sprintfN("vertex_colors[\"%s\"]", ((CustomDataLayer *)ptr->data)->name);
}
static char *rna_MeshColor_path(PointerRNA *ptr)
@@ -1139,12 +1139,12 @@ static char *rna_MeshColor_path(PointerRNA *ptr)
static char *rna_MeshSticky_path(PointerRNA *ptr)
{
return BLI_sprintfN("sticky[%d]", (int)((MSticky*)ptr->data - rna_mesh(ptr)->msticky));
return BLI_sprintfN("sticky[%d]", (int)((MSticky *)ptr->data - rna_mesh(ptr)->msticky));
}
static char *rna_MeshIntPropertyLayer_path(PointerRNA *ptr)
{
return BLI_sprintfN("int_layers[\"%s\"]", ((CustomDataLayer*)ptr->data)->name);
return BLI_sprintfN("int_layers[\"%s\"]", ((CustomDataLayer *)ptr->data)->name);
}
static char *rna_MeshIntProperty_path(PointerRNA *ptr)
@@ -1154,7 +1154,7 @@ static char *rna_MeshIntProperty_path(PointerRNA *ptr)
static char *rna_MeshFloatPropertyLayer_path(PointerRNA *ptr)
{
return BLI_sprintfN("float_layers[\"%s\"]", ((CustomDataLayer*)ptr->data)->name);
return BLI_sprintfN("float_layers[\"%s\"]", ((CustomDataLayer *)ptr->data)->name);
}
static char *rna_MeshFloatProperty_path(PointerRNA *ptr)
@@ -1164,7 +1164,7 @@ static char *rna_MeshFloatProperty_path(PointerRNA *ptr)
static char *rna_MeshStringPropertyLayer_path(PointerRNA *ptr)
{
return BLI_sprintfN("string_layers[\"%s\"]", ((CustomDataLayer*)ptr->data)->name);
return BLI_sprintfN("string_layers[\"%s\"]", ((CustomDataLayer *)ptr->data)->name);
}
static char *rna_MeshStringProperty_path(PointerRNA *ptr)
@@ -1180,7 +1180,7 @@ static int rna_Mesh_tot_vert_get(PointerRNA *ptr)
static int rna_Mesh_tot_edge_get(PointerRNA *ptr)
{
Mesh *me = rna_mesh(ptr);
return me->edit_btmesh ? me->edit_btmesh->bm->totedgesel: 0;
return me->edit_btmesh ? me->edit_btmesh->bm->totedgesel : 0;
}
static int rna_Mesh_tot_face_get(PointerRNA *ptr)
{
@@ -1696,8 +1696,8 @@ static void rna_def_mtface(BlenderRNA *brna)
RNA_def_property_struct_type(prop, "MeshTextureFace");
RNA_def_property_ui_text(prop, "Data", "");
RNA_def_property_collection_funcs(prop, "rna_MeshTextureFaceLayer_data_begin", "rna_iterator_array_next",
"rna_iterator_array_end", "rna_iterator_array_get",
"rna_MeshTextureFaceLayer_data_length", NULL, NULL, NULL);
"rna_iterator_array_end", "rna_iterator_array_get",
"rna_MeshTextureFaceLayer_data_length", NULL, NULL, NULL);
srna = RNA_def_struct(brna, "MeshTextureFace", NULL);
RNA_def_struct_sdna(srna, "MTFace");
@@ -2097,12 +2097,14 @@ void rna_def_texmat_common(StructRNA *srna, const char *texspace_editable)
RNA_def_property_editable_func(prop, texspace_editable);
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
/* not supported yet
/* not supported yet */
#if 0
prop = RNA_def_property(srna, "texspace_rot", PROP_FLOAT, PROP_EULER);
RNA_def_property_float(prop, NULL, "rot");
RNA_def_property_ui_text(prop, "Texture Space Rotation", "Texture space rotation");
RNA_def_property_editable_func(prop, texspace_editable);
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");*/
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
#endif
/* materials */
prop = RNA_def_property(srna, "materials", PROP_COLLECTION, PROP_NONE);
@@ -2294,13 +2296,14 @@ static void rna_def_loop_colors(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_property_flag(parm, PROP_RNAPTR);
RNA_def_function_return(func, parm);
/*
#if 0
func = RNA_def_function(srna, "remove", "rna_Mesh_vertex_color_remove");
RNA_def_function_ui_description(func, "Remove a vertex color layer");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
parm = RNA_def_pointer(func, "layer", "Layer", "", "The layer to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
*/
#endif
prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_UNSIGNED);
RNA_def_property_struct_type(prop, "MeshLoopColorLayer");
RNA_def_property_pointer_funcs(prop, "rna_Mesh_vertex_color_active_get",
@@ -2470,13 +2473,14 @@ static void rna_def_uv_textures(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_property_flag(parm, PROP_RNAPTR);
RNA_def_function_return(func, parm);
/*
#if 0
func = RNA_def_function(srna, "remove", "rna_Mesh_uv_texture_layers_remove");
RNA_def_function_ui_description(func, "Remove a vertex color layer");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
parm = RNA_def_pointer(func, "layer", "Layer", "", "The layer to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
*/
#endif
prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_UNSIGNED);
RNA_def_property_struct_type(prop, "MeshTexturePolyLayer");
RNA_def_property_pointer_funcs(prop, "rna_Mesh_uv_texture_active_get",
@@ -2539,7 +2543,7 @@ static void rna_def_mesh(BlenderRNA *brna)
/* TODO, should this be allowed to be its self? */
prop = RNA_def_property(srna, "texture_mesh", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "texcomesh");
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, "Texture Mesh",
"Use another mesh for texture indices (vertex indices must be aligned)");
@@ -2702,21 +2706,23 @@ static void rna_def_mesh(BlenderRNA *brna)
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);
#if 0
prop = RNA_def_property(srna, "texspace_location", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Texture Space Location", "Texture space location");
RNA_def_property_editable_func(prop, "rna_Mesh_texspace_editable");
RNA_def_property_float_funcs(prop, "rna_Mesh_texspace_loc_get", "rna_Mesh_texspace_loc_set", NULL);
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
*/
#endif
/* not supported yet
/* not supported yet */
#if 0
prop = RNA_def_property(srna, "texspace_rot", PROP_FLOAT, PROP_EULER);
RNA_def_property_float(prop, NULL, "rot");
RNA_def_property_ui_text(prop, "Texture Space Rotation", "Texture space rotation");
RNA_def_property_editable_func(prop, texspace_editable);
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
*/
#endif
/* Mesh Draw Options for Edit Mode*/
@@ -2728,7 +2734,7 @@ static void rna_def_mesh(BlenderRNA *brna)
prop = RNA_def_property(srna, "show_all_edges", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_ALLEDGES);
RNA_def_property_ui_text(prop, "All Edges", "Display all edges for wireframe in all view modes 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, "show_faces", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWFACES);
@@ -2795,15 +2801,15 @@ static void rna_def_mesh(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "editflag", ME_EDIT_MIRROR_X);
RNA_def_property_ui_text(prop, "X Mirror", "X Axis mirror editing");
/*
#if 0
prop = RNA_def_property(srna, "use_mirror_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "editflag", ME_EDIT_MIRROR_Y);
RNA_def_property_ui_text(prop, "Y Mirror", "Y Axis mirror editing");
prop = RNA_def_property(srna, "use_mirror_x", PROP_BOOLEAN, PROP_NONE);
prop = RNA_def_property(srna, "use_mirror_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "editflag", ME_EDIT_MIRROR_Z);
RNA_def_property_ui_text(prop, "Z Mirror", "Z Axis mirror editing");
*/
#endif
prop = RNA_def_property(srna, "use_mirror_topology", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "editflag", ME_EDIT_MIRROR_TOPO);
@@ -2815,13 +2821,13 @@ static void rna_def_mesh(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "editflag", ME_EDIT_PAINT_MASK);
RNA_def_property_ui_text(prop, "Paint Mask", "Face selection masking for painting");
RNA_def_property_ui_icon(prop, ICON_FACESEL_HLT, 0);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, "rna_Mesh_update_facemask");
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_Mesh_update_facemask");
prop = RNA_def_property(srna, "use_paint_mask_vertex", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "editflag", ME_EDIT_VERT_SEL);
RNA_def_property_ui_text(prop, "Vertex Selection", "Vertex selection masking for painting (weight paint only)");
RNA_def_property_ui_icon(prop, ICON_VERTEXSEL, 0);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, "rna_Mesh_update_vertmask");
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_Mesh_update_vertmask");
/* readonly editmesh info - use for extrude menu */
prop = RNA_def_property(srna, "total_vert_sel", PROP_INT, PROP_UNSIGNED);

View File

@@ -42,7 +42,7 @@
#ifdef RNA_RUNTIME
const char *rna_Mesh_unit_test_compare(struct Mesh *mesh, bContext *C, struct Mesh *mesh2)
{
const char *ret = BKE_mesh_cmp(mesh, mesh2, FLT_EPSILON*60);
const char *ret = BKE_mesh_cmp(mesh, mesh2, FLT_EPSILON * 60);
if (!ret)
ret = "Same";
@@ -82,7 +82,7 @@ void RNA_api_mesh(StructRNA *srna)
func = RNA_def_function(srna, "validate", "BKE_mesh_validate");
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");
parm = RNA_def_boolean(func, "result", 0, "Result", "");
RNA_def_function_return(func, parm);

View File

@@ -53,13 +53,13 @@
static int rna_Meta_texspace_editable(PointerRNA *ptr)
{
MetaBall *mb = (MetaBall*)ptr->data;
return (mb->texflag & MB_AUTOSPACE)? 0: PROP_EDITABLE;
MetaBall *mb = (MetaBall *)ptr->data;
return (mb->texflag & MB_AUTOSPACE) ? 0 : PROP_EDITABLE;
}
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 */
@@ -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)
{
MetaBall *mb = (MetaBall*)ptr->data;
MetaBall *mb = (MetaBall *)ptr->data;
copy_v3_v3(mb->loc, 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 */
@@ -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)
{
MetaBall *mb = (MetaBall*)ptr->data;
MetaBall *mb = (MetaBall *)ptr->data;
copy_v3_v3(mb->size, values);
}
@@ -102,7 +102,7 @@ static void rna_MetaBall_update_data(Main *bmain, Scene *scene, PointerRNA *ptr)
BKE_mball_properties_copy(scene, ob);
DAG_id_tag_update(&mb->id, 0);
WM_main_add_notifier(NC_GEOM|ND_DATA, mb);
WM_main_add_notifier(NC_GEOM | ND_DATA, mb);
}
}
@@ -120,7 +120,7 @@ static MetaElem *rna_MetaBall_elements_new(MetaBall *mb, int type)
/* cheating way for importers to avoid slow updates */
if (mb->id.us > 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);
}
return ml;
@@ -133,7 +133,7 @@ static void rna_MetaBall_elements_remove(MetaBall *mb, ReportList *reports, Meta
found = BLI_remlink_safe(&mb->elems, ml);
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;
}
@@ -143,7 +143,7 @@ static void rna_MetaBall_elements_remove(MetaBall *mb, ReportList *reports, Meta
/* cheating way for importers to avoid slow updates */
if (mb->id.us > 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);
}
}
@@ -154,7 +154,7 @@ static void rna_MetaBall_elements_clear(MetaBall *mb)
/* cheating way for importers to avoid slow updates */
if (mb->id.us > 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);
}
}
@@ -188,7 +188,7 @@ static void rna_def_metaelement(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Rotation", "Normalized quaternion 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_ui_text(prop, "Radius", "");
RNA_def_property_range(prop, 0.0f, FLT_MAX);
@@ -254,7 +254,7 @@ static void rna_def_metaball_elements(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_ui_description(func, "Remove an element from the metaball");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
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");
RNA_def_function_ui_description(func, "Remove all elements from the metaball");
@@ -273,7 +273,8 @@ static void rna_def_metaball(BlenderRNA *brna)
{MB_UPDATE_HALFRES, "HALFRES", 0, "Half", "While editing, update metaball in half resolution"},
{MB_UPDATE_FAST, "FAST", 0, "Fast", "While editing, update metaball without polygonization"},
{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");
RNA_def_struct_ui_text(srna, "MetaBall", "Metaball datablock to defined blobby surfaces");
@@ -333,7 +334,7 @@ static void rna_def_metaball(BlenderRNA *brna)
/* not supported yet */
#if 0
prop= RNA_def_property(srna, "texspace_rot", PROP_FLOAT, PROP_EULER);
prop = RNA_def_property(srna, "texspace_rot", PROP_FLOAT, PROP_EULER);
RNA_def_property_float(prop, NULL, "rot");
RNA_def_property_ui_text(prop, "Texture Space Rotation", "Texture space rotation");
RNA_def_property_editable_func(prop, "rna_Meta_texspace_editable");

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)
{
MovieClip *clip = (MovieClip*)ptr->id.data;
MovieClip *clip = (MovieClip *)ptr->id.data;
BKE_movieclip_reload(clip);
DAG_id_tag_update(&clip->id, 0);
@@ -60,7 +60,7 @@ static void rna_MovieClip_reload_update(Main *UNUSED(bmain), Scene *UNUSED(scene
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[1] = clip->lastsize[1];
@@ -82,7 +82,8 @@ static void rna_def_movieclip_proxy(BlenderRNA *brna)
"written by recording device"},
{IMB_TC_RECORD_RUN_NO_GAPS, "FREE_RUN_NO_GAPS", 0, "Free Run No Gaps",
"Record run, but ignore timecode, changes in framerate or dropouts"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
srna = RNA_def_struct(brna, "MovieClipProxy", NULL);
RNA_def_struct_ui_text(srna, "Movie Clip Proxy", "Proxy parameters for a movie clip");
@@ -158,14 +159,14 @@ static void rna_def_movieclip_proxy(BlenderRNA *brna)
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_enum_items(prop, clip_tc_items);
RNA_def_property_ui_text(prop, "Timecode", "");
RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL);
RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, NULL);
/* directory */
prop = RNA_def_property(srna, "directory", PROP_STRING, PROP_DIRPATH);
RNA_def_property_string_sdna(prop, NULL, "dir");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Directory", "Location to store the proxy files");
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");
}
static void rna_def_moviecliUser(BlenderRNA *brna)
@@ -179,7 +180,8 @@ static void rna_def_moviecliUser(BlenderRNA *brna)
{MCLIP_PROXY_RENDER_SIZE_75, "PROXY_75", 0, "Proxy size 75%", ""},
{MCLIP_PROXY_RENDER_SIZE_100, "PROXY_100", 0, "Proxy size 100%", ""},
{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);
RNA_def_struct_ui_text(srna, "Movie Clip User",
@@ -197,13 +199,13 @@ static void rna_def_moviecliUser(BlenderRNA *brna)
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_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL);
RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, NULL);
/* render undistorted */
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_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);
}
static void rna_def_movieClipScopes(BlenderRNA *brna)
@@ -223,7 +225,8 @@ static void rna_def_movieclip(BlenderRNA *brna)
static EnumPropertyItem clip_source_items[] = {
{MCLIP_SRC_SEQUENCE, "SEQUENCE", 0, "Image Sequence", "Multiple image files, as a sequence"},
{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");
RNA_def_struct_ui_text(srna, "MovieClip", "MovieClip datablock referencing an external movie file");
@@ -232,7 +235,7 @@ static void rna_def_movieclip(BlenderRNA *brna)
prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
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_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);
RNA_def_property_struct_type(prop, "MovieTracking");
@@ -246,7 +249,7 @@ static void rna_def_movieclip(BlenderRNA *brna)
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_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);
@@ -259,7 +262,7 @@ static void rna_def_movieclip(BlenderRNA *brna)
RNA_def_property_range(prop, 0.1f, 5000.0f);
RNA_def_property_ui_range(prop, 0.1f, 5000.0f, 1, 2);
RNA_def_property_ui_text(prop, "Display Aspect", "Display Aspect for this clip, does not affect rendering");
RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL);
RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, NULL);
/* source */
prop = RNA_def_property(srna, "source", PROP_ENUM, PROP_NONE);
@@ -273,7 +276,7 @@ static void rna_def_movieclip(BlenderRNA *brna)
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_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 */
prop = RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE);

View File

@@ -52,7 +52,7 @@
#include "ED_anim_api.h"
/* temp constant defined for these funcs only... */
#define NLASTRIP_MIN_LEN_THRESH 0.1f
#define NLASTRIP_MIN_LEN_THRESH 0.1f
static void rna_NlaStrip_name_set(PointerRNA *ptr, const char *value)
{
@@ -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)
{
NlaStrip *strip = (NlaStrip*)ptr->data;
NlaStrip *strip = (NlaStrip *)ptr->data;
BKE_nlameta_flush_transforms(strip);
}
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
* - cannot start past the end of the strip + some flexibility threshold
@@ -112,13 +112,13 @@ static void rna_NlaStrip_start_frame_set(PointerRNA *ptr, float value)
*/
if (data->prev) {
if (data->prev->type == NLASTRIP_TYPE_TRANSITION) {
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 */
data->prev->end = value;
}
else {
CLAMP(value, data->prev->end, data->end-NLASTRIP_MIN_LEN_THRESH);
CLAMP(value, data->prev->end, data->end - NLASTRIP_MIN_LEN_THRESH);
}
}
else {
@@ -129,7 +129,7 @@ static void rna_NlaStrip_start_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
* - must not have zero or negative length strip, so cannot start before the first frame
@@ -140,17 +140,17 @@ static void rna_NlaStrip_end_frame_set(PointerRNA *ptr, float value)
*/
if (data->next) {
if (data->next->type == NLASTRIP_TYPE_TRANSITION) {
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 */
data->next->start = value;
}
else {
CLAMP(value, data->start+NLASTRIP_MIN_LEN_THRESH, data->next->start);
CLAMP(value, data->start + NLASTRIP_MIN_LEN_THRESH, data->next->start);
}
}
else {
CLAMP(value, data->start+NLASTRIP_MIN_LEN_THRESH, MAXFRAME);
CLAMP(value, data->start + NLASTRIP_MIN_LEN_THRESH, MAXFRAME);
}
data->end = value;
@@ -170,10 +170,10 @@ static void rna_NlaStrip_end_frame_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 */
/* NOTE: these need to be synced with the values in the property definition in rna_def_nlastrip() */
/* NOTE: these need to be synced with the values in the property definition in rna_def_nlastrip() */
CLAMP(value, 0.0001f, 1000.0f);
data->scale = value;
@@ -183,10 +183,10 @@ static void rna_NlaStrip_scale_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 */
/* NOTE: these need to be synced with the values in the property definition in rna_def_nlastrip() */
/* NOTE: these need to be synced with the values in the property definition in rna_def_nlastrip() */
CLAMP(value, 0.01f, 1000.0f);
data->repeat = value;
@@ -196,7 +196,7 @@ static void rna_NlaStrip_repeat_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;
/* blend-in is limited to the length of the strip, and also cannot overlap with blendout */
@@ -208,7 +208,7 @@ static void rna_NlaStrip_blend_in_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;
/* blend-out is limited to the length of the strip */
@@ -247,7 +247,7 @@ static int rna_NlaStrip_action_editable(PointerRNA *ptr)
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 */
CLAMP(value, MINAFRAME, data->actend);
@@ -260,7 +260,7 @@ static void rna_NlaStrip_action_start_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 */
CLAMP(value, data->actstart, MAXFRAME);
@@ -272,7 +272,7 @@ static void rna_NlaStrip_action_end_frame_set(PointerRNA *ptr, float value)
static void rna_NlaStrip_animated_influence_set(PointerRNA *ptr, int value)
{
NlaStrip *data = (NlaStrip*)ptr->data;
NlaStrip *data = (NlaStrip *)ptr->data;
if (value) {
/* set the flag, then make sure a curve for this exists */
@@ -285,7 +285,7 @@ static void rna_NlaStrip_animated_influence_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) {
/* set the flag, then make sure a curve for this exists */
@@ -318,7 +318,7 @@ static NlaStrip *rna_NlaStrip_new(NlaTrack *track, bContext *C, ReportList *repo
/* create dummy AnimData block so that BKE_nlastrip_validate_name()
* can be used to ensure a valid name, as we don't have one here...
* - only the nla_tracks list is needed there, which we aim to reverse engineer here...
* - only the nla_tracks list is needed there, which we aim to reverse engineer here...
*/
{
AnimData adt = {NULL};
@@ -340,7 +340,7 @@ static NlaStrip *rna_NlaStrip_new(NlaTrack *track, bContext *C, ReportList *repo
BKE_nlastrip_validate_name(&adt, strip);
}
WM_event_add_notifier(C, NC_ANIMATION|ND_NLA|NA_ADDED, NULL);
WM_event_add_notifier(C, NC_ANIMATION | ND_NLA | NA_ADDED, NULL);
return strip;
}
@@ -353,7 +353,7 @@ static void rna_NlaStrip_remove(NlaTrack *track, bContext *C, ReportList *report
}
else {
free_nlastrip(&track->strips, strip);
WM_event_add_notifier(C, NC_ANIMATION|ND_NLA|NA_REMOVED, NULL);
WM_event_add_notifier(C, NC_ANIMATION | ND_NLA | NA_REMOVED, NULL);
}
}
@@ -374,20 +374,22 @@ EnumPropertyItem nla_mode_extend_items[] = {
{NLASTRIP_EXTEND_HOLD, "HOLD", 0, "Hold",
"Hold the first frame if no previous strips in track, and always hold last frame"},
{NLASTRIP_EXTEND_HOLD_FORWARD, "HOLD_FORWARD", 0, "Hold Forward", "Only hold last frame"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static void rna_def_nlastrip(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
/* enum defs */
/* enum defs */
static EnumPropertyItem prop_type_items[] = {
{NLASTRIP_TYPE_CLIP, "CLIP", 0, "Action Clip", "NLA Strip references some Action"},
{NLASTRIP_TYPE_TRANSITION, "TRANSITION", 0, "Transition", "NLA Strip 'transitions' between adjacent strips"},
{NLASTRIP_TYPE_META, "META", 0, "Meta", "NLA Strip acts as a container for adjacent strips"},
{NLASTRIP_TYPE_SOUND, "SOUND", 0, "Sound Clip", "NLA Strip representing a sound event for speakers"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
/* struct definition */
srna = RNA_def_struct(brna, "NlaStrip", NULL);
@@ -400,7 +402,7 @@ static void rna_def_nlastrip(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Name", "");
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_NlaStrip_name_set");
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 */
prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
@@ -408,19 +410,19 @@ static void rna_def_nlastrip(BlenderRNA *brna)
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_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);
RNA_def_property_enum_sdna(prop, NULL, "extendmode");
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_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);
RNA_def_property_enum_sdna(prop, NULL, "blendmode");
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_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 */
prop = RNA_def_property(srna, "frame_start", PROP_FLOAT, PROP_TIME);
@@ -440,61 +442,61 @@ static void rna_def_nlastrip(BlenderRNA *brna)
RNA_def_property_float_sdna(prop, NULL, "blendin");
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_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);
RNA_def_property_float_sdna(prop, NULL, "blendout");
RNA_def_property_float_funcs(prop, NULL, "rna_NlaStrip_blend_out_set", NULL);
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);
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_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
RNA_def_property_update(prop, NC_ANIMATION | ND_NLA, NULL); /* this will do? */
/* Action */
prop = RNA_def_property(srna, "action", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "act");
RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Action_id_poll");
RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_REFCOUNT);
RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_REFCOUNT);
RNA_def_property_editable_func(prop, "rna_NlaStrip_action_editable");
RNA_def_property_ui_text(prop, "Action", "Action referenced by this 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? */
/* Action extents */
prop = RNA_def_property(srna, "action_frame_start", PROP_FLOAT, PROP_TIME);
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_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);
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_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 */
prop = RNA_def_property(srna, "repeat", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "repeat");
RNA_def_property_float_funcs(prop, NULL, "rna_NlaStrip_repeat_set", NULL);
/* these limits have currently be chosen arbitarily, but could be extended
* (minimum should still be > 0 though) if needed... */
/* 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);
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);
RNA_def_property_float_sdna(prop, NULL, "scale");
RNA_def_property_float_funcs(prop, NULL, "rna_NlaStrip_scale_set", NULL);
/* these limits can be extended, but beyond this, we can get some crazy+annoying bugs
* due to numeric errors */
/* 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);
RNA_def_property_ui_text(prop, "Scale", "Scaling factor for action");
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 */
prop = RNA_def_property(srna, "fcurves", PROP_COLLECTION, PROP_NONE);
@@ -516,26 +518,26 @@ static void rna_def_nlastrip(BlenderRNA *brna)
prop = RNA_def_property(srna, "influence", PROP_FLOAT, PROP_NONE);
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_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);
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);
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_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);
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_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);
RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_USR_TIME_CYCLIC);
@@ -544,28 +546,28 @@ static void rna_def_nlastrip(BlenderRNA *brna)
/* settings */
prop = RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE);
/* can be made editable by hooking it up to the necessary NLA API methods */
/* can be made editable by hooking it up to the necessary NLA API methods */
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
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_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);
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_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);
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_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);
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_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */
RNA_def_property_update(prop, NC_ANIMATION | ND_NLA, NULL); /* this will do? */
/* TODO: */
/* - sync length */
@@ -583,7 +585,7 @@ static void rna_api_nlatrack_strips(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_struct_ui_text(srna, "Nla Strips", "Collection of Nla Strips");
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");
parm = RNA_def_string(func, "name", "NlaStrip", 0, "", "Name for the NLA Strips");
RNA_def_property_flag(parm, PROP_REQUIRED);
@@ -591,16 +593,16 @@ static void rna_api_nlatrack_strips(BlenderRNA *brna, PropertyRNA *cprop)
"Start frame for this strip", INT_MIN, INT_MAX);
RNA_def_property_flag(parm, PROP_REQUIRED);
parm = RNA_def_pointer(func, "action", "Action", "", "Action to assign to this strip");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL);
/* return type */
parm = RNA_def_pointer(func, "strip", "NlaStrip", "", "New NLA Strip");
RNA_def_function_return(func, parm);
func = RNA_def_function(srna, "remove", "rna_NlaStrip_remove");
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, "Remove a NLA Strip");
parm = RNA_def_pointer(func, "strip", "NlaStrip", "", "NLA Strip to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL);
}
static void rna_def_nlatrack(BlenderRNA *brna)
@@ -623,39 +625,39 @@ static void rna_def_nlatrack(BlenderRNA *brna)
prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Name", "");
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 */
prop = RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE);
/* can be made editable by hooking it up to the necessary NLA API methods */
/* can be made editable by hooking it up to the necessary NLA API methods */
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", NLATRACK_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);
/* can be made editable by hooking it up to the necessary NLA API methods */
/* can be made editable by hooking it up to the necessary NLA API methods */
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
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_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);
RNA_def_property_boolean_sdna(prop, NULL, "flag", NLATRACK_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);
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_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);
RNA_def_property_boolean_sdna(prop, NULL, "flag", NLATRACK_PROTECTED);
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? */
}
/* --------- */

File diff suppressed because it is too large Load Diff

View File

@@ -82,157 +82,157 @@ Mesh *rna_Object_to_mesh(Object *ob, ReportList *reports, Scene *sce, int apply_
/* perform the mesh extraction based on type */
switch (ob->type) {
case OB_FONT:
case OB_CURVE:
case OB_SURF:
case OB_FONT:
case OB_CURVE:
case OB_SURF:
/* copies object and modifiers (but not the data) */
tmpobj = BKE_object_copy(ob);
tmpcu = (Curve *)tmpobj->data;
tmpcu->id.us--;
/* copies object and modifiers (but not the data) */
tmpobj = BKE_object_copy(ob);
tmpcu = (Curve *)tmpobj->data;
tmpcu->id.us--;
/* if getting the original caged mesh, delete object modifiers */
if ( cage )
BKE_object_free_modifiers(tmpobj);
/* if getting the original caged mesh, delete object modifiers */
if (cage)
BKE_object_free_modifiers(tmpobj);
/* copies the data */
copycu = tmpobj->data = BKE_curve_copy((Curve *) ob->data );
/* temporarily set edit so we get updates from edit mode, but
* also because for text datablocks copying it while in edit
* mode gives invalid data structures */
copycu->editfont = tmpcu->editfont;
copycu->editnurb = tmpcu->editnurb;
/* get updated display list, and convert to a mesh */
BKE_displist_make_curveTypes(sce, tmpobj, 0);
copycu->editfont = NULL;
copycu->editnurb = NULL;
BKE_mesh_from_nurbs(tmpobj);
/* BKE_mesh_from_nurbs changes the type to a mesh, check it worked */
if (tmpobj->type != OB_MESH) {
BKE_libblock_free_us(&(G.main->object), tmpobj);
BKE_report(reports, RPT_ERROR, "cant convert curve to mesh. Does the curve have any segments?");
return NULL;
}
tmpmesh = tmpobj->data;
BKE_libblock_free_us(&G.main->object, tmpobj);
break;
case OB_MBALL: {
/* metaballs don't have modifiers, so just convert to mesh */
Object *basis_ob = BKE_mball_basis_find(sce, ob);
/* todo, re-generatre for render-res */
/* metaball_polygonize(scene, ob) */
if (ob != basis_ob)
return NULL; /* only do basis metaball */
tmpmesh = BKE_mesh_add("Mesh");
if (render) {
ListBase disp = {NULL, NULL};
BKE_displist_make_mball_forRender(sce, ob, &disp);
BKE_mesh_from_metaball(&disp, tmpmesh);
BKE_displist_free(&disp);
}
else
BKE_mesh_from_metaball(&ob->disp, tmpmesh);
break;
}
case OB_MESH:
/* copies object and modifiers (but not the data) */
if (cage) {
/* copies the data */
tmpmesh = BKE_mesh_copy( ob->data );
/* if not getting the original caged mesh, get final derived mesh */
}
else {
/* Make a dummy mesh, saves copying */
DerivedMesh *dm;
/* CustomDataMask mask = CD_MASK_BAREMESH|CD_MASK_MTFACE|CD_MASK_MCOL; */
CustomDataMask mask = CD_MASK_MESH; /* this seems more suitable, exporter,
* for example, needs CD_MASK_MDEFORMVERT */
/* Write the display mesh into the dummy mesh */
if (render)
dm = mesh_create_derived_render(sce, ob, mask);
else
dm = mesh_create_derived_view(sce, ob, mask);
copycu = tmpobj->data = BKE_curve_copy((Curve *) ob->data);
/* temporarily set edit so we get updates from edit mode, but
* also because for text datablocks copying it while in edit
* mode gives invalid data structures */
copycu->editfont = tmpcu->editfont;
copycu->editnurb = tmpcu->editnurb;
/* get updated display list, and convert to a mesh */
BKE_displist_make_curveTypes(sce, tmpobj, 0);
copycu->editfont = NULL;
copycu->editnurb = NULL;
BKE_mesh_from_nurbs(tmpobj);
/* BKE_mesh_from_nurbs changes the type to a mesh, check it worked */
if (tmpobj->type != OB_MESH) {
BKE_libblock_free_us(&(G.main->object), tmpobj);
BKE_report(reports, RPT_ERROR, "cant convert curve to mesh. Does the curve have any segments?");
return NULL;
}
tmpmesh = tmpobj->data;
BKE_libblock_free_us(&G.main->object, tmpobj);
break;
case OB_MBALL: {
/* metaballs don't have modifiers, so just convert to mesh */
Object *basis_ob = BKE_mball_basis_find(sce, ob);
/* todo, re-generatre for render-res */
/* metaball_polygonize(scene, ob) */
if (ob != basis_ob)
return NULL; /* only do basis metaball */
tmpmesh = BKE_mesh_add("Mesh");
DM_to_mesh(dm, tmpmesh, ob);
dm->release(dm);
if (render) {
ListBase disp = {NULL, NULL};
BKE_displist_make_mball_forRender(sce, ob, &disp);
BKE_mesh_from_metaball(&disp, tmpmesh);
BKE_displist_free(&disp);
}
else
BKE_mesh_from_metaball(&ob->disp, tmpmesh);
break;
}
case OB_MESH:
/* copies object and modifiers (but not the data) */
if (cage) {
/* copies the data */
tmpmesh = BKE_mesh_copy(ob->data);
/* if not getting the original caged mesh, get final derived mesh */
}
else {
/* Make a dummy mesh, saves copying */
DerivedMesh *dm;
/* CustomDataMask mask = CD_MASK_BAREMESH|CD_MASK_MTFACE|CD_MASK_MCOL; */
CustomDataMask mask = CD_MASK_MESH; /* this seems more suitable, exporter,
* for example, needs CD_MASK_MDEFORMVERT */
/* Write the display mesh into the dummy mesh */
if (render)
dm = mesh_create_derived_render(sce, ob, mask);
else
dm = mesh_create_derived_view(sce, ob, mask);
break;
default:
BKE_report(reports, RPT_ERROR, "Object does not have geometry data");
return NULL;
tmpmesh = BKE_mesh_add("Mesh");
DM_to_mesh(dm, tmpmesh, ob);
dm->release(dm);
}
break;
default:
BKE_report(reports, RPT_ERROR, "Object does not have geometry data");
return NULL;
}
/* Copy materials to new mesh */
switch (ob->type) {
case OB_SURF:
case OB_FONT:
case OB_CURVE:
tmpmesh->totcol = tmpcu->totcol;
/* free old material list (if it exists) and adjust user counts */
if ( tmpcu->mat ) {
for ( i = tmpcu->totcol; i-- > 0; ) {
/* are we an object material or data based? */
case OB_SURF:
case OB_FONT:
case OB_CURVE:
tmpmesh->totcol = tmpcu->totcol;
tmpmesh->mat[i] = ob->matbits[i] ? ob->mat[i] : tmpcu->mat[i];
if (tmpmesh->mat[i]) {
tmpmesh->mat[i]->id.us++;
}
}
}
break;
#if 0
/* Crashes when assigning the new material, not sure why */
case OB_MBALL:
tmpmb = (MetaBall *)ob->data;
tmpmesh->totcol = tmpmb->totcol;
/* free old material list (if it exists) and adjust user counts */
if ( tmpmb->mat ) {
for ( i = tmpmb->totcol; i-- > 0; ) {
tmpmesh->mat[i] = tmpmb->mat[i]; /* CRASH HERE ??? */
if (tmpmesh->mat[i]) {
tmpmb->mat[i]->id.us++;
}
}
}
break;
#endif
case OB_MESH:
if (!cage) {
Mesh *origmesh = ob->data;
tmpmesh->flag = origmesh->flag;
tmpmesh->mat = MEM_dupallocN(origmesh->mat);
tmpmesh->totcol = origmesh->totcol;
tmpmesh->smoothresh = origmesh->smoothresh;
if ( origmesh->mat ) {
for ( i = origmesh->totcol; i-- > 0; ) {
/* free old material list (if it exists) and adjust user counts */
if (tmpcu->mat) {
for (i = tmpcu->totcol; i-- > 0; ) {
/* 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] : tmpcu->mat[i];
if (tmpmesh->mat[i]) {
tmpmesh->mat[i]->id.us++;
}
}
}
}
break;
break;
#if 0
/* Crashes when assigning the new material, not sure why */
case OB_MBALL:
tmpmb = (MetaBall *)ob->data;
tmpmesh->totcol = tmpmb->totcol;
/* free old material list (if it exists) and adjust user counts */
if (tmpmb->mat) {
for (i = tmpmb->totcol; i-- > 0; ) {
tmpmesh->mat[i] = tmpmb->mat[i]; /* CRASH HERE ??? */
if (tmpmesh->mat[i]) {
tmpmb->mat[i]->id.us++;
}
}
}
break;
#endif
case OB_MESH:
if (!cage) {
Mesh *origmesh = ob->data;
tmpmesh->flag = origmesh->flag;
tmpmesh->mat = MEM_dupallocN(origmesh->mat);
tmpmesh->totcol = origmesh->totcol;
tmpmesh->smoothresh = origmesh->smoothresh;
if (origmesh->mat) {
for (i = origmesh->totcol; i-- > 0; ) {
/* are we an object material or data based? */
tmpmesh->mat[i] = ob->matbits[i] ? ob->mat[i] : origmesh->mat[i];
if (tmpmesh->mat[i]) {
tmpmesh->mat[i]->id.us++;
}
}
}
}
break;
} /* end copy materials */
/* cycles and exporters rely on this still */
@@ -277,7 +277,7 @@ static void dupli_render_particle_set(Scene *scene, Object *ob, int level, int e
/* this is to make sure we get render level duplis in groups:
* the derivedmesh must be created before init_render_mesh,
* 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);
for (psys = ob->particlesystem.first; psys; psys = psys->next)
@@ -289,7 +289,7 @@ static void dupli_render_particle_set(Scene *scene, Object *ob, int level, int e
group = ob->dup_group;
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 */
void rna_Object_create_duplilist(Object *ob, ReportList *reports, Scene *sce)
@@ -332,12 +332,12 @@ static PointerRNA rna_Object_shape_key_add(Object *ob, bContext *C, ReportList *
PointerRNA keyptr;
RNA_pointer_create((ID *)ob->data, &RNA_ShapeKey, kb, &keyptr);
WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob);
WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob);
return keyptr;
}
else {
BKE_reportf(reports, RPT_ERROR, "Object \"%s\"does not support shapes", ob->id.name+2);
BKE_reportf(reports, RPT_ERROR, "Object \"%s\"does not support shapes", ob->id.name + 2);
return PointerRNA_NULL;
}
}
@@ -356,7 +356,7 @@ static void rna_Mesh_assign_verts_to_group(Object *ob, bDeformGroup *group, int
return;
}
Mesh *me = (Mesh*)ob->data;
Mesh *me = (Mesh *)ob->data;
int group_index = BLI_findlink(&ob->defbase, group);
if (group_index == -1) {
BKE_report(reports, RPT_ERROR, "No deform groups assigned to mesh");
@@ -391,7 +391,7 @@ void rna_Object_ray_cast(Object *ob, ReportList *reports, float ray_start[3], fl
BVHTreeFromMesh treeData = {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;
}
@@ -399,7 +399,7 @@ void rna_Object_ray_cast(Object *ob, ReportList *reports, float ray_start[3], fl
bvhtree_from_mesh_faces(&treeData, ob->derivedFinal, 0.0f, 4, 6);
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;
}
else {
@@ -433,7 +433,7 @@ void rna_Object_closest_point_on_mesh(Object *ob, ReportList *reports, float poi
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);
ob->id.name + 2);
return;
}
@@ -442,7 +442,7 @@ void rna_Object_closest_point_on_mesh(Object *ob, ReportList *reports, float poi
if (treeData.tree == NULL) {
BKE_reportf(reports, RPT_ERROR, "object \"%s\" could not create internal data for finding nearest point",
ob->id.name+2);
ob->id.name + 2);
return;
}
else {
@@ -546,7 +546,7 @@ void RNA_api_object(StructRNA *srna)
RNA_def_function_ui_description(func, "Create a Mesh datablock with modifiers applied");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
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");
RNA_def_property_flag(parm, PROP_REQUIRED);
parm = RNA_def_enum(func, "settings", mesh_type_items, 0, "", "Modifier settings to apply");
@@ -558,10 +558,10 @@ void RNA_api_object(StructRNA *srna)
/* duplis */
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 "
"be freed manually with free_dupli_list to restore the "
"objects real matrix and layers");
"be freed manually with free_dupli_list to restore the "
"objects real matrix and layers");
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);
func = RNA_def_function(srna, "dupli_list_clear", "rna_Object_free_duplilist");
@@ -576,7 +576,7 @@ void RNA_api_object(StructRNA *srna)
/* Shape key */
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_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_boolean(func, "from_mix", 1, "", "Create new shape from existing mix of shapes");
parm = RNA_def_pointer(func, "key", "ShapeKey", "", "New shape keyblock");
@@ -635,7 +635,7 @@ void RNA_api_object(StructRNA *srna)
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");
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");
RNA_def_function_return(func, parm);
@@ -643,7 +643,7 @@ void RNA_api_object(StructRNA *srna)
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");
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");
RNA_def_property_flag(parm, PROP_REQUIRED);
parm = RNA_def_boolean(func, "result", 0, "", "Object visibility");
@@ -652,7 +652,7 @@ void RNA_api_object(StructRNA *srna)
func = RNA_def_function(srna, "is_deform_modified", "rna_Object_is_deform_modified");
RNA_def_function_ui_description(func, "Determine if this object is modified by a deformation from the base mesh data");
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");
RNA_def_property_flag(parm, PROP_REQUIRED);
parm = RNA_def_boolean(func, "result", 0, "", "Object visibility");
@@ -682,7 +682,7 @@ void RNA_api_object_base(StructRNA *srna)
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", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL);
}
#endif

View File

@@ -100,8 +100,8 @@ static EnumPropertyItem empty_vortex_shape_items[] = {
static void rna_Cache_change(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
Object *ob = (Object*)ptr->id.data;
PointCache *cache = (PointCache*)ptr->data;
Object *ob = (Object *)ptr->id.data;
PointCache *cache = (PointCache *)ptr->data;
PTCacheID *pid = NULL;
ListBase pidlist;
@@ -131,8 +131,8 @@ static void rna_Cache_change(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerR
static void rna_Cache_toggle_disk_cache(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
Object *ob = (Object*)ptr->id.data;
PointCache *cache = (PointCache*)ptr->data;
Object *ob = (Object *)ptr->id.data;
PointCache *cache = (PointCache *)ptr->data;
PTCacheID *pid = NULL;
ListBase pidlist;
@@ -157,8 +157,8 @@ static void rna_Cache_toggle_disk_cache(Main *UNUSED(bmain), Scene *UNUSED(scene
static void rna_Cache_idname_change(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
Object *ob = (Object*)ptr->id.data;
PointCache *cache = (PointCache*)ptr->data;
Object *ob = (Object *)ptr->id.data;
PointCache *cache = (PointCache *)ptr->data;
PTCacheID *pid = NULL, *pid2 = NULL;
ListBase pidlist;
int new_name = 1;
@@ -239,7 +239,7 @@ static void rna_Cache_active_point_cache_index_range(PointerRNA *ptr, int *min,
for (pid = pidlist.first; pid; pid = pid->next) {
if (pid->cache == cache) {
*max = BLI_countlist(pid->ptcaches)-1;
*max = BLI_countlist(pid->ptcaches) - 1;
*max = MAX2(0, *max);
break;
}
@@ -315,7 +315,7 @@ static char *rna_CollisionSettings_path(PointerRNA *UNUSED(ptr))
{
/* both methods work ok, but return the shorter path */
#if 0
Object *ob = (Object*)ptr->id.data;
Object *ob = (Object *)ptr->id.data;
ModifierData *md = (ModifierData *)modifiers_findByType(ob, eModifierType_Collision);
if (md) {
@@ -332,59 +332,59 @@ static char *rna_CollisionSettings_path(PointerRNA *UNUSED(ptr))
static int rna_SoftBodySettings_use_edges_get(PointerRNA *ptr)
{
Object *data = (Object*)(ptr->id.data);
Object *data = (Object *)(ptr->id.data);
return (((data->softflag) & OB_SB_EDGES) != 0);
}
static void rna_SoftBodySettings_use_edges_set(PointerRNA *ptr, int value)
{
Object *data = (Object*)(ptr->id.data);
Object *data = (Object *)(ptr->id.data);
if (value) data->softflag |= OB_SB_EDGES;
else data->softflag &= ~OB_SB_EDGES;
}
static int rna_SoftBodySettings_use_goal_get(PointerRNA *ptr)
{
Object *data = (Object*)(ptr->id.data);
Object *data = (Object *)(ptr->id.data);
return (((data->softflag) & OB_SB_GOAL) != 0);
}
static void rna_SoftBodySettings_use_goal_set(PointerRNA *ptr, int value)
{
Object *data = (Object*)(ptr->id.data);
Object *data = (Object *)(ptr->id.data);
if (value) data->softflag |= OB_SB_GOAL;
else data->softflag &= ~OB_SB_GOAL;
}
static int rna_SoftBodySettings_stiff_quads_get(PointerRNA *ptr)
{
Object *data = (Object*)(ptr->id.data);
Object *data = (Object *)(ptr->id.data);
return (((data->softflag) & OB_SB_QUADS) != 0);
}
static void rna_SoftBodySettings_stiff_quads_set(PointerRNA *ptr, int value)
{
Object *data = (Object*)(ptr->id.data);
Object *data = (Object *)(ptr->id.data);
if (value) data->softflag |= OB_SB_QUADS;
else data->softflag &= ~OB_SB_QUADS;
}
static int rna_SoftBodySettings_self_collision_get(PointerRNA *ptr)
{
Object *data = (Object*)(ptr->id.data);
Object *data = (Object *)(ptr->id.data);
return (((data->softflag) & OB_SB_SELF) != 0);
}
static void rna_SoftBodySettings_self_collision_set(PointerRNA *ptr, int value)
{
Object *data = (Object*)(ptr->id.data);
Object *data = (Object *)(ptr->id.data);
if (value) data->softflag |= OB_SB_SELF;
else data->softflag &= ~OB_SB_SELF;
}
static int rna_SoftBodySettings_new_aero_get(PointerRNA *ptr)
{
Object *data = (Object*)(ptr->id.data);
Object *data = (Object *)(ptr->id.data);
if (data->softflag & OB_SB_AERO_ANGLE)
return 1;
else
@@ -393,73 +393,73 @@ static int rna_SoftBodySettings_new_aero_get(PointerRNA *ptr)
static void rna_SoftBodySettings_new_aero_set(PointerRNA *ptr, int value)
{
Object *data = (Object*)(ptr->id.data);
Object *data = (Object *)(ptr->id.data);
if (value == 1)
data->softflag |= OB_SB_AERO_ANGLE;
else /* value == 0 */
else /* value == 0 */
data->softflag &= ~OB_SB_AERO_ANGLE;
}
static int rna_SoftBodySettings_face_collision_get(PointerRNA *ptr)
{
Object *data = (Object*)(ptr->id.data);
Object *data = (Object *)(ptr->id.data);
return (((data->softflag) & OB_SB_FACECOLL) != 0);
}
static void rna_SoftBodySettings_face_collision_set(PointerRNA *ptr, int value)
{
Object *data = (Object*)(ptr->id.data);
Object *data = (Object *)(ptr->id.data);
if (value) data->softflag |= OB_SB_FACECOLL;
else data->softflag &= ~OB_SB_FACECOLL;
}
static int rna_SoftBodySettings_edge_collision_get(PointerRNA *ptr)
{
Object *data = (Object*)(ptr->id.data);
Object *data = (Object *)(ptr->id.data);
return (((data->softflag) & OB_SB_EDGECOLL) != 0);
}
static void rna_SoftBodySettings_edge_collision_set(PointerRNA *ptr, int value)
{
Object *data = (Object*)(ptr->id.data);
Object *data = (Object *)(ptr->id.data);
if (value) data->softflag |= OB_SB_EDGECOLL;
else data->softflag &= ~OB_SB_EDGECOLL;
}
static void rna_SoftBodySettings_goal_vgroup_get(PointerRNA *ptr, char *value)
{
SoftBody *sb = (SoftBody*)ptr->data;
SoftBody *sb = (SoftBody *)ptr->data;
rna_object_vgroup_name_index_get(ptr, value, sb->vertgroup);
}
static int rna_SoftBodySettings_goal_vgroup_length(PointerRNA *ptr)
{
SoftBody *sb = (SoftBody*)ptr->data;
SoftBody *sb = (SoftBody *)ptr->data;
return rna_object_vgroup_name_index_length(ptr, sb->vertgroup);
}
static void rna_SoftBodySettings_goal_vgroup_set(PointerRNA *ptr, const char *value)
{
SoftBody *sb = (SoftBody*)ptr->data;
SoftBody *sb = (SoftBody *)ptr->data;
rna_object_vgroup_name_index_set(ptr, value, &sb->vertgroup);
}
static void rna_SoftBodySettings_mass_vgroup_set(PointerRNA *ptr, const char *value)
{
SoftBody *sb = (SoftBody*)ptr->data;
SoftBody *sb = (SoftBody *)ptr->data;
rna_object_vgroup_name_set(ptr, value, sb->namedVG_Mass, sizeof(sb->namedVG_Mass));
}
static void rna_SoftBodySettings_spring_vgroup_set(PointerRNA *ptr, const char *value)
{
SoftBody *sb = (SoftBody*)ptr->data;
SoftBody *sb = (SoftBody *)ptr->data;
rna_object_vgroup_name_set(ptr, value, sb->namedVG_Spring_K, sizeof(sb->namedVG_Spring_K));
}
static char *rna_SoftBodySettings_path(PointerRNA *ptr)
{
Object *ob = (Object*)ptr->id.data;
Object *ob = (Object *)ptr->id.data;
ModifierData *md = (ModifierData *)modifiers_findByType(ob, eModifierType_Softbody);
return BLI_sprintfN("modifiers[\"%s\"].settings", md->name);
@@ -475,7 +475,7 @@ static int particle_id_check(PointerRNA *ptr)
static void rna_FieldSettings_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
if (particle_id_check(ptr)) {
ParticleSettings *part = (ParticleSettings*)ptr->id.data;
ParticleSettings *part = (ParticleSettings *)ptr->id.data;
if (part->pd->forcefield != PFIELD_TEXTURE && part->pd->tex) {
part->pd->tex->id.us--;
@@ -487,12 +487,12 @@ static void rna_FieldSettings_update(Main *UNUSED(bmain), Scene *UNUSED(scene),
part->pd2->tex = NULL;
}
DAG_id_tag_update(&part->id, OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME|PSYS_RECALC_RESET);
WM_main_add_notifier(NC_OBJECT|ND_DRAW, NULL);
DAG_id_tag_update(&part->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME | PSYS_RECALC_RESET);
WM_main_add_notifier(NC_OBJECT | ND_DRAW, NULL);
}
else {
Object *ob = (Object*)ptr->id.data;
Object *ob = (Object *)ptr->id.data;
if (ob->pd->forcefield != PFIELD_TEXTURE && ob->pd->tex) {
ob->pd->tex->id.us--;
@@ -500,14 +500,14 @@ static void rna_FieldSettings_update(Main *UNUSED(bmain), Scene *UNUSED(scene),
}
DAG_id_tag_update(&ob->id, OB_RECALC_OB);
WM_main_add_notifier(NC_OBJECT|ND_DRAW, ob);
WM_main_add_notifier(NC_OBJECT | ND_DRAW, ob);
}
}
static void rna_FieldSettings_shape_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
if (!particle_id_check(ptr)) {
Object *ob = (Object*)ptr->id.data;
Object *ob = (Object *)ptr->id.data;
PartDeflect *pd = ob->pd;
ModifierData *md = modifiers_findByType(ob, eModifierType_Surface);
@@ -522,23 +522,23 @@ static void rna_FieldSettings_shape_update(Main *bmain, Scene *scene, PointerRNA
ED_object_modifier_remove(NULL, bmain, scene, ob, md);
}
WM_main_add_notifier(NC_OBJECT|ND_DRAW, ob);
WM_main_add_notifier(NC_OBJECT | ND_DRAW, ob);
}
}
static void rna_FieldSettings_dependency_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
if (particle_id_check(ptr)) {
DAG_id_tag_update((ID*)ptr->id.data, OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME|PSYS_RECALC_RESET);
DAG_id_tag_update((ID *)ptr->id.data, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME | PSYS_RECALC_RESET);
}
else {
Object *ob = (Object*)ptr->id.data;
Object *ob = (Object *)ptr->id.data;
/* do this before scene sort, that one checks for CU_PATH */
#if 0 /* XXX */
if (ob->type == OB_CURVE && ob->pd->forcefield == PFIELD_GUIDE) {
Curve *cu = ob->data;
cu->flag |= (CU_PATH|CU_3D);
cu->flag |= (CU_PATH | CU_3D);
do_curvebuts(B_CU3D); /* all curves too */
}
#endif
@@ -548,11 +548,11 @@ static void rna_FieldSettings_dependency_update(Main *bmain, Scene *scene, Point
DAG_scene_sort(bmain, scene);
if (ob->type == OB_CURVE && ob->pd->forcefield == PFIELD_GUIDE)
DAG_id_tag_update(&ob->id, OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME);
DAG_id_tag_update(&ob->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME);
else
DAG_id_tag_update(&ob->id, OB_RECALC_OB);
WM_main_add_notifier(NC_OBJECT|ND_DRAW, ob);
WM_main_add_notifier(NC_OBJECT | ND_DRAW, ob);
}
}
@@ -564,7 +564,7 @@ static char *rna_FieldSettings_path(PointerRNA *ptr)
if (particle_id_check(ptr)) {
/* particle system force field */
ParticleSettings *part = (ParticleSettings*)ptr->id.data;
ParticleSettings *part = (ParticleSettings *)ptr->id.data;
if (part->pd == pd)
return BLI_sprintfN("force_field_1");
@@ -573,7 +573,7 @@ static char *rna_FieldSettings_path(PointerRNA *ptr)
}
else {
/* object force field */
Object *ob = (Object*)ptr->id.data;
Object *ob = (Object *)ptr->id.data;
if (ob->pd == pd)
return BLI_sprintfN("field");
@@ -583,18 +583,18 @@ static char *rna_FieldSettings_path(PointerRNA *ptr)
static void rna_EffectorWeight_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
DAG_id_tag_update((ID*)ptr->id.data, OB_RECALC_DATA|PSYS_RECALC_RESET);
DAG_id_tag_update((ID *)ptr->id.data, OB_RECALC_DATA | PSYS_RECALC_RESET);
WM_main_add_notifier(NC_OBJECT|ND_DRAW, NULL);
WM_main_add_notifier(NC_OBJECT | ND_DRAW, NULL);
}
static void rna_EffectorWeight_dependency_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
DAG_scene_sort(bmain, scene);
DAG_id_tag_update((ID*)ptr->id.data, OB_RECALC_DATA|PSYS_RECALC_RESET);
DAG_id_tag_update((ID *)ptr->id.data, OB_RECALC_DATA | PSYS_RECALC_RESET);
WM_main_add_notifier(NC_OBJECT|ND_DRAW, NULL);
WM_main_add_notifier(NC_OBJECT | ND_DRAW, NULL);
}
static char *rna_EffectorWeight_path(PointerRNA *ptr)
@@ -604,13 +604,13 @@ static char *rna_EffectorWeight_path(PointerRNA *ptr)
if (particle_id_check(ptr)) {
/* particle effector weights */
ParticleSettings *part = (ParticleSettings*)ptr->id.data;
ParticleSettings *part = (ParticleSettings *)ptr->id.data;
if (part->effector_weights == ew)
return BLI_sprintfN("effector_weights");
}
else {
Object *ob = (Object*)ptr->id.data;
Object *ob = (Object *)ptr->id.data;
ModifierData *md;
/* check softbody modifier */
@@ -660,7 +660,7 @@ static char *rna_EffectorWeight_path(PointerRNA *ptr)
static void rna_CollisionSettings_dependency_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
Object *ob = (Object*)ptr->id.data;
Object *ob = (Object *)ptr->id.data;
ModifierData *md = modifiers_findByType(ob, eModifierType_Collision);
/* add/remove modifier as needed */
@@ -669,23 +669,23 @@ static void rna_CollisionSettings_dependency_update(Main *bmain, Scene *scene, P
else if (!ob->pd->deflect && md)
ED_object_modifier_remove(NULL, bmain, scene, ob, md);
WM_main_add_notifier(NC_OBJECT|ND_DRAW, ob);
WM_main_add_notifier(NC_OBJECT | ND_DRAW, ob);
}
static void rna_CollisionSettings_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_OB|OB_RECALC_DATA|OB_RECALC_TIME);
WM_main_add_notifier(NC_OBJECT|ND_DRAW, ob);
DAG_id_tag_update(&ob->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME);
WM_main_add_notifier(NC_OBJECT | ND_DRAW, ob);
}
static void rna_softbody_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);
WM_main_add_notifier(NC_OBJECT|ND_MODIFIER, ob);
WM_main_add_notifier(NC_OBJECT | ND_MODIFIER, ob);
}
@@ -697,7 +697,7 @@ static EnumPropertyItem *rna_Effector_shape_itemf(bContext *UNUSED(C), PointerRN
if (particle_id_check(ptr))
return empty_shape_items;
ob = (Object*)ptr->id.data;
ob = (Object *)ptr->id.data;
if (ob->type == OB_CURVE) {
if (ob->pd->forcefield == PFIELD_VORTEX)
@@ -752,7 +752,8 @@ static void rna_def_pointcache(BlenderRNA *brna)
{PTCACHE_COMPRESS_NO, "NO", 0, "No", "No compression"},
{PTCACHE_COMPRESS_LZO, "LIGHT", 0, "Light", "Fast but not so effective compression"},
{PTCACHE_COMPRESS_LZMA, "HEAVY", 0, "Heavy", "Effective but slow compression"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
srna = RNA_def_struct(brna, "PointCache", NULL);
RNA_def_struct_ui_text(srna, "Point Cache", "Point cache for physics simulations");
@@ -1081,25 +1082,29 @@ static void rna_def_field(BlenderRNA *brna)
{PFIELD_BOID, "BOID", ICON_FORCE_BOID, "Boid", ""},
{PFIELD_TURBULENCE, "TURBULENCE", ICON_FORCE_TURBULENCE, "Turbulence", "Create turbulence with a noise field"},
{PFIELD_DRAG, "DRAG", ICON_FORCE_DRAG, "Drag", "Create a force that dampens motion"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem falloff_items[] = {
{PFIELD_FALL_SPHERE, "SPHERE", 0, "Sphere", ""},
{PFIELD_FALL_TUBE, "TUBE", 0, "Tube", ""},
{PFIELD_FALL_CONE, "CONE", 0, "Cone", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem texture_items[] = {
{PFIELD_TEX_RGB, "RGB", 0, "RGB", ""},
{PFIELD_TEX_GRAD, "GRADIENT", 0, "Gradient", ""},
{PFIELD_TEX_CURL, "CURL", 0, "Curl", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem zdirection_items[] = {
{PFIELD_Z_BOTH, "BOTH", 0, "Both Z", ""},
{PFIELD_Z_POS, "POSITIVE", 0, "+Z", ""},
{PFIELD_Z_NEG, "NEGATIVE", 0, "-Z", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem guide_kink_items[] = {
{0, "NONE", 0, "Nothing", ""},
@@ -1109,13 +1114,15 @@ static void rna_def_field(BlenderRNA *brna)
{4, "BRAID", 0, "Braid", ""},
{5, "ROTATION", 0, "Rotation", ""},
{6, "ROLL", 0, "Roll", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem guide_kink_axis_items[] = {
{0, "X", 0, "X", ""},
{1, "Y", 0, "Y", ""},
{2, "Z", 0, "Z", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
srna = RNA_def_struct(brna, "FieldSettings", NULL);
RNA_def_struct_sdna(srna, "PartDeflect");
@@ -1495,12 +1502,14 @@ static void rna_def_softbody(BlenderRNA *brna)
{SBC_MODE_MIN, "MINIMAL", 0, "Minimal", "Minimal Spring length * Ball Size"},
{SBC_MODE_MAX, "MAXIMAL", 0, "Maximal", "Maximal Spring length * Ball Size"},
{SBC_MODE_AVGMINMAX, "MINMAX", 0, "AvMinMax", "(Min+Max)/2 * Ball Size"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem aerodynamics_type[] = {
{0, "SIMPLE", 0, "Simple", "Edges receive a drag force from surrounding media"},
{1, "LIFT_FORCE", 0, "Lift Force", "Edges receive a lift force when passing through surrounding media"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
srna = RNA_def_struct(brna, "SoftBodySettings", NULL);
RNA_def_struct_sdna(srna, "SoftBody");

View File

@@ -38,7 +38,8 @@ EnumPropertyItem unpack_method_items[] = {
{PF_WRITE_LOCAL, "WRITE_LOCAL", 0, "Write Local File (overwrite existing)", ""},
{PF_USE_ORIGINAL, "USE_ORIGINAL", 0, "Use Original File", ""},
{PF_WRITE_ORIGINAL, "WRITE_ORIGINAL", 0, "Write Original File (overwrite existing)", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
#ifdef RNA_RUNTIME
#else

View File

@@ -147,9 +147,9 @@ static void rna_ParticleHairKey_location_object_info(PointerRNA *ptr, ParticleSy
/* given the pointer HairKey *hkey, we iterate over all particles in all
* particle systems in the object "ob" in order to find
*- the ParticleSystemData to which the HairKey (and hence the particle)
* belongs (will be stored in psmd_pt)
*- the ParticleData to which the HairKey belongs (will be stored in pa_pt)
* - the ParticleSystemData to which the HairKey (and hence the particle)
* belongs (will be stored in psmd_pt)
* - the ParticleData to which the HairKey belongs (will be stored in pa_pt)
*
* not a very efficient way of getting hair key location data,
* but it's the best we've got at the present
@@ -242,16 +242,16 @@ static void rna_ParticleHairKey_location_object_set(PointerRNA *ptr, const float
static void particle_recalc(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr, short flag)
{
if (ptr->type == &RNA_ParticleSystem) {
ParticleSystem *psys = (ParticleSystem*)ptr->data;
ParticleSystem *psys = (ParticleSystem *)ptr->data;
psys->recalc = flag;
DAG_id_tag_update(ptr->id.data, OB_RECALC_DATA);
}
else
DAG_id_tag_update(ptr->id.data, OB_RECALC_DATA|flag);
DAG_id_tag_update(ptr->id.data, OB_RECALC_DATA | flag);
WM_main_add_notifier(NC_OBJECT|ND_PARTICLE|NA_EDITED, NULL);
WM_main_add_notifier(NC_OBJECT | ND_PARTICLE | NA_EDITED, NULL);
}
static void rna_Particle_redo(Main *bmain, Scene *scene, PointerRNA *ptr)
{
@@ -271,12 +271,12 @@ static void rna_Particle_reset(Main *bmain, Scene *scene, PointerRNA *ptr)
static void rna_Particle_change_type(Main *bmain, Scene *scene, PointerRNA *ptr)
{
particle_recalc(bmain, scene, ptr, PSYS_RECALC_RESET|PSYS_RECALC_TYPE);
particle_recalc(bmain, scene, ptr, PSYS_RECALC_RESET | PSYS_RECALC_TYPE);
}
static void rna_Particle_change_physics(Main *bmain, Scene *scene, PointerRNA *ptr)
{
particle_recalc(bmain, scene, ptr, PSYS_RECALC_RESET|PSYS_RECALC_PHYS);
particle_recalc(bmain, scene, ptr, PSYS_RECALC_RESET | PSYS_RECALC_PHYS);
}
static void rna_Particle_redo_child(Main *bmain, Scene *scene, PointerRNA *ptr)
@@ -300,12 +300,12 @@ static ParticleSystem *rna_particle_system_for_target(Object *ob, ParticleTarget
static void rna_Particle_target_reset(Main *bmain, Scene *scene, PointerRNA *ptr)
{
if (ptr->type == &RNA_ParticleTarget) {
Object *ob = (Object*)ptr->id.data;
ParticleTarget *pt = (ParticleTarget*)ptr->data;
Object *ob = (Object *)ptr->id.data;
ParticleTarget *pt = (ParticleTarget *)ptr->data;
ParticleSystem *kpsys = NULL, *psys = rna_particle_system_for_target(ob, pt);
if (pt->ob == ob || pt->ob == NULL) {
kpsys = BLI_findlink(&ob->particlesystem, pt->psys-1);
kpsys = BLI_findlink(&ob->particlesystem, pt->psys - 1);
if (kpsys)
pt->flag |= PTARGET_VALID;
@@ -314,7 +314,7 @@ static void rna_Particle_target_reset(Main *bmain, Scene *scene, PointerRNA *ptr
}
else {
if (pt->ob)
kpsys = BLI_findlink(&pt->ob->particlesystem, pt->psys-1);
kpsys = BLI_findlink(&pt->ob->particlesystem, pt->psys - 1);
if (kpsys)
pt->flag |= PTARGET_VALID;
@@ -328,43 +328,43 @@ static void rna_Particle_target_reset(Main *bmain, Scene *scene, PointerRNA *ptr
DAG_scene_sort(bmain, scene);
}
WM_main_add_notifier(NC_OBJECT|ND_PARTICLE|NA_EDITED, NULL);
WM_main_add_notifier(NC_OBJECT | ND_PARTICLE | NA_EDITED, NULL);
}
static void rna_Particle_target_redo(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
if (ptr->type == &RNA_ParticleTarget) {
Object *ob = (Object*)ptr->id.data;
ParticleTarget *pt = (ParticleTarget*)ptr->data;
Object *ob = (Object *)ptr->id.data;
ParticleTarget *pt = (ParticleTarget *)ptr->data;
ParticleSystem *psys = rna_particle_system_for_target(ob, pt);
psys->recalc = PSYS_RECALC_REDO;
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);
}
}
static void rna_Particle_hair_dynamics(Main *bmain, Scene *scene, PointerRNA *ptr)
{
Object *ob = (Object*)ptr->id.data;
ParticleSystem *psys = (ParticleSystem*)ptr->data;
Object *ob = (Object *)ptr->id.data;
ParticleSystem *psys = (ParticleSystem *)ptr->data;
if (psys && !psys->clmd) {
psys->clmd = (ClothModifierData*)modifier_new(eModifierType_Cloth);
psys->clmd = (ClothModifierData *)modifier_new(eModifierType_Cloth);
psys->clmd->sim_parms->goalspring = 0.0f;
psys->clmd->sim_parms->flags |= CLOTH_SIMSETTINGS_FLAG_GOAL|CLOTH_SIMSETTINGS_FLAG_NO_SPRING_COMPRESS;
psys->clmd->sim_parms->flags |= CLOTH_SIMSETTINGS_FLAG_GOAL | CLOTH_SIMSETTINGS_FLAG_NO_SPRING_COMPRESS;
psys->clmd->coll_parms->flags &= ~CLOTH_COLLSETTINGS_FLAG_SELF;
rna_Particle_redo(bmain, scene, ptr);
}
else
WM_main_add_notifier(NC_OBJECT|ND_PARTICLE|NA_EDITED, NULL);
WM_main_add_notifier(NC_OBJECT | ND_PARTICLE | NA_EDITED, NULL);
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
}
static PointerRNA rna_particle_settings_get(PointerRNA *ptr)
{
ParticleSystem *psys = (ParticleSystem*)ptr->data;
ParticleSystem *psys = (ParticleSystem *)ptr->data;
ParticleSettings *part = psys->part;
return rna_pointer_inherit_refine(ptr, &RNA_ParticleSettings, part);
@@ -372,7 +372,7 @@ static PointerRNA rna_particle_settings_get(PointerRNA *ptr)
static void rna_particle_settings_set(PointerRNA *ptr, PointerRNA value)
{
ParticleSystem *psys = (ParticleSystem*)ptr->data;
ParticleSystem *psys = (ParticleSystem *)ptr->data;
int old_type = 0;
@@ -392,21 +392,21 @@ static void rna_particle_settings_set(PointerRNA *ptr, PointerRNA value)
}
static void rna_Particle_abspathtime_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
ParticleSettings *settings = (ParticleSettings*)ptr->data;
ParticleSettings *settings = (ParticleSettings *)ptr->data;
float delta = settings->end + settings->lifetime - settings->sta;
if (settings->draw & PART_ABS_PATH_TIME) {
settings->path_start = settings->sta + settings->path_start * delta;
settings->path_end = settings->sta + settings->path_end * delta;
}
else {
settings->path_start = (settings->path_start - settings->sta)/delta;
settings->path_end = (settings->path_end - settings->sta)/delta;
settings->path_start = (settings->path_start - settings->sta) / delta;
settings->path_end = (settings->path_end - settings->sta) / delta;
}
rna_Particle_redo(bmain, scene, ptr);
}
static void rna_PartSettings_start_set(struct PointerRNA *ptr, float value)
{
ParticleSettings *settings = (ParticleSettings*)ptr->data;
ParticleSettings *settings = (ParticleSettings *)ptr->data;
/* check for clipping */
if (value > settings->end)
@@ -423,7 +423,7 @@ static void rna_PartSettings_start_set(struct PointerRNA *ptr, float value)
static void rna_PartSettings_end_set(struct PointerRNA *ptr, float value)
{
ParticleSettings *settings = (ParticleSettings*)ptr->data;
ParticleSettings *settings = (ParticleSettings *)ptr->data;
/* check for clipping */
if (value < settings->sta)
@@ -434,44 +434,44 @@ static void rna_PartSettings_end_set(struct PointerRNA *ptr, float value)
static void rna_PartSetings_timestep_set(struct PointerRNA *ptr, float value)
{
ParticleSettings *settings = (ParticleSettings*)ptr->data;
ParticleSettings *settings = (ParticleSettings *)ptr->data;
settings->timetweak = value/0.04f;
settings->timetweak = value / 0.04f;
}
static float rna_PartSettings_timestep_get(struct PointerRNA *ptr)
{
ParticleSettings *settings = (ParticleSettings*)ptr->data;
ParticleSettings *settings = (ParticleSettings *)ptr->data;
return settings->timetweak * 0.04f;
}
static void rna_PartSetting_hairlength_set(struct PointerRNA *ptr, float value)
{
ParticleSettings *settings = (ParticleSettings*)ptr->data;
ParticleSettings *settings = (ParticleSettings *)ptr->data;
settings->normfac = value / 4.f;
}
static float rna_PartSetting_hairlength_get(struct PointerRNA *ptr)
{
ParticleSettings *settings = (ParticleSettings*)ptr->data;
ParticleSettings *settings = (ParticleSettings *)ptr->data;
return settings->normfac * 4.f;
}
static void rna_PartSetting_linelentail_set(struct PointerRNA *ptr, float value)
{
ParticleSettings *settings = (ParticleSettings*)ptr->data;
ParticleSettings *settings = (ParticleSettings *)ptr->data;
settings->draw_line[0] = value;
}
static float rna_PartSetting_linelentail_get(struct PointerRNA *ptr)
{
ParticleSettings *settings = (ParticleSettings*)ptr->data;
ParticleSettings *settings = (ParticleSettings *)ptr->data;
return settings->draw_line[0];
}
static void rna_PartSetting_pathstartend_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax)
{
ParticleSettings *settings = (ParticleSettings*)ptr->data;
ParticleSettings *settings = (ParticleSettings *)ptr->data;
if (settings->type == PART_HAIR) {
*min = 0.0f;
@@ -484,20 +484,20 @@ static void rna_PartSetting_pathstartend_range(PointerRNA *ptr, float *min, floa
}
static void rna_PartSetting_linelenhead_set(struct PointerRNA *ptr, float value)
{
ParticleSettings *settings = (ParticleSettings*)ptr->data;
ParticleSettings *settings = (ParticleSettings *)ptr->data;
settings->draw_line[1] = value;
}
static float rna_PartSetting_linelenhead_get(struct PointerRNA *ptr)
{
ParticleSettings *settings = (ParticleSettings*)ptr->data;
ParticleSettings *settings = (ParticleSettings *)ptr->data;
return settings->draw_line[1];
}
static int rna_PartSettings_is_fluid_get(PointerRNA *ptr)
{
ParticleSettings *part = (ParticleSettings*)ptr->data;
ParticleSettings *part = (ParticleSettings *)ptr->data;
return part->type == PART_FLUID;
}
@@ -505,7 +505,7 @@ static int rna_PartSettings_is_fluid_get(PointerRNA *ptr)
void rna_ParticleSystem_name_set(PointerRNA *ptr, const char *value)
{
Object *ob = ptr->id.data;
ParticleSystem *part = (ParticleSystem*)ptr->data;
ParticleSystem *part = (ParticleSystem *)ptr->data;
/* copy the new name into the name slot */
BLI_strncpy_utf8(part->name, value, sizeof(part->name));
@@ -516,7 +516,7 @@ void rna_ParticleSystem_name_set(PointerRNA *ptr, const char *value)
static PointerRNA rna_ParticleSystem_active_particle_target_get(PointerRNA *ptr)
{
ParticleSystem *psys = (ParticleSystem*)ptr->data;
ParticleSystem *psys = (ParticleSystem *)ptr->data;
ParticleTarget *pt = psys->targets.first;
for (; pt; pt = pt->next) {
@@ -528,15 +528,15 @@ static PointerRNA rna_ParticleSystem_active_particle_target_get(PointerRNA *ptr)
static void rna_ParticleSystem_active_particle_target_index_range(PointerRNA *ptr, int *min, int *max,
int *softmin, int *softmax)
{
ParticleSystem *psys = (ParticleSystem*)ptr->data;
ParticleSystem *psys = (ParticleSystem *)ptr->data;
*min = 0;
*max = BLI_countlist(&psys->targets)-1;
*max = BLI_countlist(&psys->targets) - 1;
*max = MAX2(0, *max);
}
static int rna_ParticleSystem_active_particle_target_index_get(PointerRNA *ptr)
{
ParticleSystem *psys = (ParticleSystem*)ptr->data;
ParticleSystem *psys = (ParticleSystem *)ptr->data;
ParticleTarget *pt = psys->targets.first;
int i = 0;
@@ -549,7 +549,7 @@ static int rna_ParticleSystem_active_particle_target_index_get(PointerRNA *ptr)
static void rna_ParticleSystem_active_particle_target_index_set(struct PointerRNA *ptr, int value)
{
ParticleSystem *psys = (ParticleSystem*)ptr->data;
ParticleSystem *psys = (ParticleSystem *)ptr->data;
ParticleTarget *pt = psys->targets.first;
int i = 0;
@@ -568,15 +568,15 @@ static int rna_ParticleTarget_name_length(PointerRNA *ptr)
ParticleSystem *psys = NULL;
if (pt->ob)
psys = BLI_findlink(&pt->ob->particlesystem, pt->psys-1);
psys = BLI_findlink(&pt->ob->particlesystem, pt->psys - 1);
else {
Object *ob = (Object*) ptr->id.data;
psys = BLI_findlink(&ob->particlesystem, pt->psys-1);
Object *ob = (Object *) ptr->id.data;
psys = BLI_findlink(&ob->particlesystem, pt->psys - 1);
}
if (psys) {
if (pt->ob)
return strlen(pt->ob->id.name+2) + 2 + strlen(psys->name);
return strlen(pt->ob->id.name + 2) + 2 + strlen(psys->name);
else
return strlen(psys->name);
}
@@ -595,15 +595,15 @@ static void rna_ParticleTarget_name_get(PointerRNA *ptr, char *str)
ParticleSystem *psys = NULL;
if (pt->ob)
psys = BLI_findlink(&pt->ob->particlesystem, pt->psys-1);
psys = BLI_findlink(&pt->ob->particlesystem, pt->psys - 1);
else {
Object *ob = (Object*) ptr->id.data;
psys = BLI_findlink(&ob->particlesystem, pt->psys-1);
Object *ob = (Object *) ptr->id.data;
psys = BLI_findlink(&ob->particlesystem, pt->psys - 1);
}
if (psys) {
if (pt->ob)
sprintf(str, "%s: %s", pt->ob->id.name+2, psys->name);
sprintf(str, "%s: %s", pt->ob->id.name + 2, psys->name);
else
strcpy(str, psys->name);
}
@@ -626,7 +626,7 @@ static char *rna_SPHFluidSettings_path(PointerRNA *ptr)
SPHFluidSettings *fluid = (SPHFluidSettings *)ptr->data;
if (particle_id_check(ptr)) {
ParticleSettings *part = (ParticleSettings*)ptr->id.data;
ParticleSettings *part = (ParticleSettings *)ptr->id.data;
if (part->fluid == fluid)
return BLI_sprintfN("fluid");
@@ -636,19 +636,19 @@ static char *rna_SPHFluidSettings_path(PointerRNA *ptr)
static int rna_ParticleSystem_multiple_caches_get(PointerRNA *ptr)
{
ParticleSystem *psys = (ParticleSystem*)ptr->data;
ParticleSystem *psys = (ParticleSystem *)ptr->data;
return (psys->ptcaches.first != psys->ptcaches.last);
}
static int rna_ParticleSystem_editable_get(PointerRNA *ptr)
{
ParticleSystem *psys = (ParticleSystem*)ptr->data;
ParticleSystem *psys = (ParticleSystem *)ptr->data;
return psys_check_edited(psys);
}
static int rna_ParticleSystem_edited_get(PointerRNA *ptr)
{
ParticleSystem *psys = (ParticleSystem*)ptr->data;
ParticleSystem *psys = (ParticleSystem *)ptr->data;
if (psys->part && psys->part->type == PART_HAIR)
return (psys->flag & PSYS_EDITED || (psys->edit && psys->edit->edited));
@@ -657,7 +657,7 @@ static int rna_ParticleSystem_edited_get(PointerRNA *ptr)
}
static PointerRNA rna_ParticleDupliWeight_active_get(PointerRNA *ptr)
{
ParticleSettings *part = (ParticleSettings*)ptr->id.data;
ParticleSettings *part = (ParticleSettings *)ptr->id.data;
ParticleDupliWeight *dw = part->dupliweights.first;
for (; dw; dw = dw->next) {
@@ -668,15 +668,15 @@ static PointerRNA rna_ParticleDupliWeight_active_get(PointerRNA *ptr)
}
static void rna_ParticleDupliWeight_active_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax)
{
ParticleSettings *part = (ParticleSettings*)ptr->id.data;
ParticleSettings *part = (ParticleSettings *)ptr->id.data;
*min = 0;
*max = BLI_countlist(&part->dupliweights)-1;
*max = BLI_countlist(&part->dupliweights) - 1;
*max = MAX2(0, *max);
}
static int rna_ParticleDupliWeight_active_index_get(PointerRNA *ptr)
{
ParticleSettings *part = (ParticleSettings*)ptr->id.data;
ParticleSettings *part = (ParticleSettings *)ptr->id.data;
ParticleDupliWeight *dw = part->dupliweights.first;
int i = 0;
@@ -689,7 +689,7 @@ static int rna_ParticleDupliWeight_active_index_get(PointerRNA *ptr)
static void rna_ParticleDupliWeight_active_index_set(struct PointerRNA *ptr, int value)
{
ParticleSettings *part = (ParticleSettings*)ptr->id.data;
ParticleSettings *part = (ParticleSettings *)ptr->id.data;
ParticleDupliWeight *dw = part->dupliweights.first;
int i = 0;
@@ -715,7 +715,7 @@ static void rna_ParticleDupliWeight_name_get(PointerRNA *ptr, char *str)
ParticleDupliWeight *dw = ptr->data;
if (dw->ob)
sprintf(str, "%s: %i", dw->ob->id.name+2, dw->count);
sprintf(str, "%s: %i", dw->ob->id.name + 2, dw->count);
else
strcpy(str, "No object");
}
@@ -726,7 +726,7 @@ static EnumPropertyItem *rna_Particle_from_itemf(bContext *UNUSED(C), PointerRNA
/*if (part->type==PART_REACTOR) */
/* return part_reactor_from_items; */
/*else */
return part_from_items;
return part_from_items;
}
static EnumPropertyItem *rna_Particle_dist_itemf(bContext *UNUSED(C), PointerRNA *ptr,
@@ -764,7 +764,7 @@ static EnumPropertyItem *rna_Particle_ren_as_itemf(bContext *UNUSED(C), PointerR
static PointerRNA rna_Particle_field1_get(PointerRNA *ptr)
{
ParticleSettings *part = (ParticleSettings*)ptr->id.data;
ParticleSettings *part = (ParticleSettings *)ptr->id.data;
/* weak */
if (!part->pd)
@@ -775,7 +775,7 @@ static PointerRNA rna_Particle_field1_get(PointerRNA *ptr)
static PointerRNA rna_Particle_field2_get(PointerRNA *ptr)
{
ParticleSettings *part = (ParticleSettings*)ptr->id.data;
ParticleSettings *part = (ParticleSettings *)ptr->id.data;
/* weak */
if (!part->pd2)
@@ -787,10 +787,10 @@ static PointerRNA rna_Particle_field2_get(PointerRNA *ptr)
static void psys_vg_name_get__internal(PointerRNA *ptr, char *value, int index)
{
Object *ob = ptr->id.data;
ParticleSystem *psys = (ParticleSystem*)ptr->data;
ParticleSystem *psys = (ParticleSystem *)ptr->data;
if (psys->vgroup[index] > 0) {
bDeformGroup *defGroup = BLI_findlink(&ob->defbase, psys->vgroup[index]-1);
bDeformGroup *defGroup = BLI_findlink(&ob->defbase, psys->vgroup[index] - 1);
if (defGroup) {
strcpy(value, defGroup->name);
@@ -803,10 +803,10 @@ static void psys_vg_name_get__internal(PointerRNA *ptr, char *value, int index)
static int psys_vg_name_len__internal(PointerRNA *ptr, int index)
{
Object *ob = ptr->id.data;
ParticleSystem *psys = (ParticleSystem*)ptr->data;
ParticleSystem *psys = (ParticleSystem *)ptr->data;
if (psys->vgroup[index] > 0) {
bDeformGroup *defGroup = BLI_findlink(&ob->defbase, psys->vgroup[index]-1);
bDeformGroup *defGroup = BLI_findlink(&ob->defbase, psys->vgroup[index] - 1);
if (defGroup) {
return strlen(defGroup->name);
@@ -817,9 +817,9 @@ static int psys_vg_name_len__internal(PointerRNA *ptr, int index)
static void psys_vg_name_set__internal(PointerRNA *ptr, const char *value, int index)
{
Object *ob = ptr->id.data;
ParticleSystem *psys = (ParticleSystem*)ptr->data;
ParticleSystem *psys = (ParticleSystem *)ptr->data;
if (value[0] =='\0') {
if (value[0] == '\0') {
psys->vgroup[index] = 0;
}
else {
@@ -834,19 +834,19 @@ static void psys_vg_name_set__internal(PointerRNA *ptr, const char *value, int i
static char *rna_ParticleSystem_path(PointerRNA *ptr)
{
ParticleSystem *psys = (ParticleSystem*)ptr->data;
ParticleSystem *psys = (ParticleSystem *)ptr->data;
return BLI_sprintfN("particle_systems[\"%s\"]", psys->name);
}
static void rna_ParticleSettings_mtex_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
ParticleSettings *part = (ParticleSettings*)ptr->data;
rna_iterator_array_begin(iter, (void*)part->mtex, sizeof(MTex*), MAX_MTEX, 0, NULL);
ParticleSettings *part = (ParticleSettings *)ptr->data;
rna_iterator_array_begin(iter, (void *)part->mtex, sizeof(MTex *), MAX_MTEX, 0, NULL);
}
static PointerRNA rna_ParticleSettings_active_texture_get(PointerRNA *ptr)
{
ParticleSettings *part = (ParticleSettings*)ptr->data;
ParticleSettings *part = (ParticleSettings *)ptr->data;
Tex *tex;
tex = give_current_particle_texture(part);
@@ -855,7 +855,7 @@ static PointerRNA rna_ParticleSettings_active_texture_get(PointerRNA *ptr)
static void rna_ParticleSettings_active_texture_set(PointerRNA *ptr, PointerRNA value)
{
ParticleSettings *part = (ParticleSettings*)ptr->data;
ParticleSettings *part = (ParticleSettings *)ptr->data;
set_current_particle_texture(part, value.data);
}
@@ -1259,35 +1259,40 @@ static void rna_def_particle_settings_mtex(BlenderRNA *brna)
{TEXCO_ORCO, "ORCO", 0, "Generated", "Use the original undeformed coordinates of the object"},
{TEXCO_STRAND, "STRAND", 0, "Strand / Particle",
"Use normalized strand texture coordinate (1D) or particle age (X) and trail position (Y)"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem prop_mapping_items[] = {
{MTEX_FLAT, "FLAT", 0, "Flat", "Map X and Y coordinates directly"},
{MTEX_CUBE, "CUBE", 0, "Cube", "Map using the normal vector"},
{MTEX_TUBE, "TUBE", 0, "Tube", "Map with Z as central axis"},
{MTEX_SPHERE, "SPHERE", 0, "Sphere", "Map with Z as central axis"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem prop_x_mapping_items[] = {
{0, "NONE", 0, "None", ""},
{1, "X", 0, "X", ""},
{2, "Y", 0, "Y", ""},
{3, "Z", 0, "Z", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem prop_y_mapping_items[] = {
{0, "NONE", 0, "None", ""},
{1, "X", 0, "X", ""},
{2, "Y", 0, "Y", ""},
{3, "Z", 0, "Z", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem prop_z_mapping_items[] = {
{0, "NONE", 0, "None", ""},
{1, "X", 0, "X", ""},
{2, "Y", 0, "Y", ""},
{3, "Z", 0, "Z", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
srna = RNA_def_struct(brna, "ParticleSettingsTextureSlot", "TextureSlot");
RNA_def_struct_sdna(srna, "MTex");
@@ -1914,7 +1919,7 @@ static void rna_def_particle_settings(BlenderRNA *brna)
/*TODO: not found in UI, readonly? */
prop = RNA_def_property(srna, "keys_step", PROP_INT, PROP_NONE);
RNA_def_property_range(prop, 0, SHRT_MAX);/*TODO:min,max */
RNA_def_property_range(prop, 0, SHRT_MAX); /*TODO:min,max */
RNA_def_property_ui_text(prop, "Keys Step", "");
/* adaptive path rendering */
@@ -2068,7 +2073,7 @@ static void rna_def_particle_settings(BlenderRNA *brna)
/* general values */
prop = RNA_def_property(srna, "frame_start", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "sta");/*optional if prop names are the same */
RNA_def_property_float_sdna(prop, NULL, "sta"); /*optional if prop names are the same */
RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_float_funcs(prop, NULL, "rna_PartSettings_start_set", NULL);
@@ -2153,7 +2158,7 @@ static void rna_def_particle_settings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Number", "Total number of particles");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
prop = RNA_def_property(srna, "userjit", PROP_INT, PROP_UNSIGNED);/*TODO: can we get a better name for userjit? */
prop = RNA_def_property(srna, "userjit", PROP_INT, PROP_UNSIGNED); /*TODO: can we get a better name for userjit? */
RNA_def_property_int_sdna(prop, NULL, "userjit");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 0, 1000);
@@ -2183,7 +2188,7 @@ static void rna_def_particle_settings(BlenderRNA *brna)
/* initial velocity factors */
prop = RNA_def_property(srna, "normal_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "normfac");/*optional if prop names are the same */
RNA_def_property_float_sdna(prop, NULL, "normfac"); /*optional if prop names are the same */
RNA_def_property_range(prop, -1000.0f, 1000.0f);
RNA_def_property_ui_range(prop, 0, 100, 1, 3);
RNA_def_property_ui_text(prop, "Normal", "Let the surface normal give the particle a starting speed");
@@ -2197,7 +2202,7 @@ static void rna_def_particle_settings(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_Particle_reset");
prop = RNA_def_property(srna, "factor_random", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "randfac");/*optional if prop names are the same */
RNA_def_property_float_sdna(prop, NULL, "randfac"); /*optional if prop names are the same */
RNA_def_property_range(prop, 0.0f, 200.0f);
RNA_def_property_ui_range(prop, 0, 100, 1, 3);
RNA_def_property_ui_text(prop, "Random", "Give the starting speed a random variation");
@@ -2322,7 +2327,7 @@ static void rna_def_particle_settings(BlenderRNA *brna)
/* children */
prop = RNA_def_property(srna, "child_nbr", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "child_nbr");/*optional if prop names are the same */
RNA_def_property_int_sdna(prop, NULL, "child_nbr"); /*optional if prop names are the same */
RNA_def_property_range(prop, 0, 100000);
RNA_def_property_ui_range(prop, 0, 1000, 1, 0);
RNA_def_property_ui_text(prop, "Children Per Parent", "Number of children/parent");
@@ -2683,7 +2688,7 @@ static void rna_def_particle_system(BlenderRNA *brna)
prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Name", "Particle system name");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER|NA_RENAME, NULL);
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER | NA_RENAME, NULL);
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_ParticleSystem_name_set");
RNA_def_struct_name_property(srna, prop);
@@ -2692,7 +2697,7 @@ static void rna_def_particle_system(BlenderRNA *brna)
prop = RNA_def_property(srna, "settings", PROP_POINTER, PROP_NONE);
/*RNA_def_property_pointer_sdna(prop, NULL, "part"); */
RNA_def_property_struct_type(prop, "ParticleSettings");
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, "rna_particle_settings_get", "rna_particle_settings_set", NULL, NULL);
RNA_def_property_ui_text(prop, "Settings", "Particle system settings");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
@@ -2970,7 +2975,7 @@ static void rna_def_particle_system(BlenderRNA *brna)
* the next time-step. The user should change ParticlSettings.subframes or
* ParticleSettings.courant_target instead. */
prop = RNA_def_property(srna, "dt_frac", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 1.0f/101.0f, 1.0f);
RNA_def_property_range(prop, 1.0f / 101.0f, 1.0f);
RNA_def_property_ui_text(prop, "Timestep", "The current simulation time step size, as a fraction of a frame");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);

View File

@@ -57,7 +57,8 @@ EnumPropertyItem posebone_rotmode_items[] = {
{ROT_MODE_ZYX, "ZYX", 0, "ZYX Euler", "ZYX Rotation Order (prone to Gimbal Lock)"},
{ROT_MODE_AXISANGLE, "AXIS_ANGLE", 0, "Axis Angle",
"Axis Angle (W+XYZ), defines a rotation around some axis defined by 3D-Vector"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
#ifdef RNA_RUNTIME
@@ -103,7 +104,7 @@ static void rna_Pose_IK_update(Main *UNUSED(bmain), Scene *UNUSED(scene), Pointe
static char *rna_PoseBone_path(PointerRNA *ptr)
{
return BLI_sprintfN("pose.bones[\"%s\"]", ((bPoseChannel*)ptr->data)->name);
return BLI_sprintfN("pose.bones[\"%s\"]", ((bPoseChannel *)ptr->data)->name);
}
static void rna_BoneGroup_color_set_set(PointerRNA *ptr, int value)
@@ -163,7 +164,7 @@ static IDProperty *rna_PoseBone_idprops(PointerRNA *ptr, int create)
static void rna_Pose_ik_solver_set(struct PointerRNA *ptr, int value)
{
bPose *pose = (bPose*)ptr->data;
bPose *pose = (bPose *)ptr->data;
if (pose->iksolver != value) {
/* the solver has changed, must clean any temporary structures */
@@ -182,14 +183,14 @@ static void rna_Pose_ik_solver_update(Main *bmain, Scene *scene, PointerRNA *ptr
Object *ob = ptr->id.data;
bPose *pose = ptr->data;
pose->flag |= POSE_RECALC; /* checks & sorts pose channels */
pose->flag |= POSE_RECALC; /* checks & sorts pose channels */
DAG_scene_sort(bmain, scene);
BKE_pose_update_constraint_flags(pose);
object_test_constraints(ob);
DAG_id_tag_update(&ob->id, OB_RECALC_DATA|OB_RECALC_OB);
DAG_id_tag_update(&ob->id, OB_RECALC_DATA | OB_RECALC_OB);
}
/* rotation - axis-angle */
@@ -228,8 +229,8 @@ static void rna_PoseChannel_rotation_mode_set(PointerRNA *ptr, int value)
static void rna_PoseChannel_name_set(PointerRNA *ptr, const char *value)
{
Object *ob = (Object*)ptr->id.data;
bPoseChannel *pchan = (bPoseChannel*)ptr->data;
Object *ob = (Object *)ptr->id.data;
bPoseChannel *pchan = (bPoseChannel *)ptr->data;
char oldname[sizeof(pchan->name)], newname[sizeof(pchan->name)];
/* need to be on the stack */
@@ -241,8 +242,8 @@ static void rna_PoseChannel_name_set(PointerRNA *ptr, const char *value)
static int rna_PoseChannel_has_ik_get(PointerRNA *ptr)
{
Object *ob = (Object*)ptr->id.data;
bPoseChannel *pchan = (bPoseChannel*)ptr->data;
Object *ob = (Object *)ptr->id.data;
bPoseChannel *pchan = (bPoseChannel *)ptr->data;
return ED_pose_channel_in_IK_chain(ob, pchan);
}
@@ -252,28 +253,28 @@ StructRNA *rna_IKParam_refine(PointerRNA *ptr)
bIKParam *param = (bIKParam *)ptr->data;
switch (param->iksolver) {
case IKSOLVER_ITASC:
return &RNA_Itasc;
default:
return &RNA_IKParam;
case IKSOLVER_ITASC:
return &RNA_Itasc;
default:
return &RNA_IKParam;
}
}
PointerRNA rna_Pose_ikparam_get(struct PointerRNA *ptr)
{
bPose *pose = (bPose*)ptr->data;
bPose *pose = (bPose *)ptr->data;
return rna_pointer_inherit_refine(ptr, &RNA_IKParam, pose->ikparam);
}
static StructRNA *rna_Pose_ikparam_typef(PointerRNA *ptr)
{
bPose *pose = (bPose*)ptr->data;
bPose *pose = (bPose *)ptr->data;
switch (pose->iksolver) {
case IKSOLVER_ITASC:
return &RNA_Itasc;
default:
return &RNA_IKParam;
case IKSOLVER_ITASC:
return &RNA_Itasc;
default:
return &RNA_IKParam;
}
}
@@ -307,13 +308,13 @@ static void rna_Itasc_update_rebuild(Main *bmain, Scene *scene, PointerRNA *ptr)
Object *ob = ptr->id.data;
bPose *pose = ob->pose;
pose->flag |= POSE_RECALC; /* checks & sorts pose channels */
pose->flag |= POSE_RECALC; /* checks & sorts pose channels */
rna_Itasc_update(bmain, scene, ptr);
}
static void rna_PoseChannel_bone_custom_set(PointerRNA *ptr, PointerRNA value)
{
bPoseChannel *pchan = (bPoseChannel*)ptr->data;
bPoseChannel *pchan = (bPoseChannel *)ptr->data;
if (pchan->custom) {
@@ -328,13 +329,13 @@ static void rna_PoseChannel_bone_custom_set(PointerRNA *ptr, PointerRNA value)
static PointerRNA rna_PoseChannel_bone_group_get(PointerRNA *ptr)
{
Object *ob = (Object*)ptr->id.data;
Object *ob = (Object *)ptr->id.data;
bPose *pose = (ob) ? ob->pose : NULL;
bPoseChannel *pchan = (bPoseChannel*)ptr->data;
bPoseChannel *pchan = (bPoseChannel *)ptr->data;
bActionGroup *grp;
if (pose)
grp = BLI_findlink(&pose->agroups, pchan->agrp_index-1);
grp = BLI_findlink(&pose->agroups, pchan->agrp_index - 1);
else
grp = NULL;
@@ -343,9 +344,9 @@ static PointerRNA rna_PoseChannel_bone_group_get(PointerRNA *ptr)
static void rna_PoseChannel_bone_group_set(PointerRNA *ptr, PointerRNA value)
{
Object *ob = (Object*)ptr->id.data;
Object *ob = (Object *)ptr->id.data;
bPose *pose = (ob) ? ob->pose : NULL;
bPoseChannel *pchan = (bPoseChannel*)ptr->data;
bPoseChannel *pchan = (bPoseChannel *)ptr->data;
if (pose)
pchan->agrp_index = BLI_findindex(&pose->agroups, value.data) + 1;
@@ -355,25 +356,25 @@ static void rna_PoseChannel_bone_group_set(PointerRNA *ptr, PointerRNA value)
static int rna_PoseChannel_bone_group_index_get(PointerRNA *ptr)
{
bPoseChannel *pchan = (bPoseChannel*)ptr->data;
return MAX2(pchan->agrp_index-1, 0);
bPoseChannel *pchan = (bPoseChannel *)ptr->data;
return MAX2(pchan->agrp_index - 1, 0);
}
static void rna_PoseChannel_bone_group_index_set(PointerRNA *ptr, int value)
{
bPoseChannel *pchan = (bPoseChannel*)ptr->data;
pchan->agrp_index = value+1;
bPoseChannel *pchan = (bPoseChannel *)ptr->data;
pchan->agrp_index = value + 1;
}
static void rna_PoseChannel_bone_group_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax)
{
Object *ob = (Object*)ptr->id.data;
Object *ob = (Object *)ptr->id.data;
bPose *pose = (ob) ? ob->pose : NULL;
*min = 0;
if (pose) {
*max = BLI_countlist(&pose->agroups)-1;
*max = BLI_countlist(&pose->agroups) - 1;
*max = MAX2(0, *max);
}
else
@@ -382,44 +383,44 @@ static void rna_PoseChannel_bone_group_index_range(PointerRNA *ptr, int *min, in
static PointerRNA rna_Pose_active_bone_group_get(PointerRNA *ptr)
{
bPose *pose = (bPose*)ptr->data;
return rna_pointer_inherit_refine(ptr, &RNA_BoneGroup, BLI_findlink(&pose->agroups, pose->active_group-1));
bPose *pose = (bPose *)ptr->data;
return rna_pointer_inherit_refine(ptr, &RNA_BoneGroup, BLI_findlink(&pose->agroups, pose->active_group - 1));
}
static void rna_Pose_active_bone_group_set(PointerRNA *ptr, PointerRNA value)
{
bPose *pose = (bPose*)ptr->data;
bPose *pose = (bPose *)ptr->data;
pose->active_group = BLI_findindex(&pose->agroups, value.data) + 1;
}
static int rna_Pose_active_bone_group_index_get(PointerRNA *ptr)
{
bPose *pose = (bPose*)ptr->data;
return MAX2(pose->active_group-1, 0);
bPose *pose = (bPose *)ptr->data;
return MAX2(pose->active_group - 1, 0);
}
static void rna_Pose_active_bone_group_index_set(PointerRNA *ptr, int value)
{
bPose *pose = (bPose*)ptr->data;
pose->active_group = value+1;
bPose *pose = (bPose *)ptr->data;
pose->active_group = value + 1;
}
static void rna_Pose_active_bone_group_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax)
{
bPose *pose = (bPose*)ptr->data;
bPose *pose = (bPose *)ptr->data;
*min = 0;
*max = BLI_countlist(&pose->agroups)-1;
*max = BLI_countlist(&pose->agroups) - 1;
*max = MAX2(0, *max);
}
#if 0
static void rna_pose_bgroup_name_index_get(PointerRNA *ptr, char *value, int index)
{
bPose *pose = (bPose*)ptr->data;
bPose *pose = (bPose *)ptr->data;
bActionGroup *grp;
grp = BLI_findlink(&pose->agroups, index-1);
grp = BLI_findlink(&pose->agroups, index - 1);
if (grp) BLI_strncpy(value, grp->name, sizeof(grp->name));
else value[0] = '\0';
@@ -427,16 +428,16 @@ static void rna_pose_bgroup_name_index_get(PointerRNA *ptr, char *value, int ind
static int rna_pose_bgroup_name_index_length(PointerRNA *ptr, int index)
{
bPose *pose = (bPose*)ptr->data;
bPose *pose = (bPose *)ptr->data;
bActionGroup *grp;
grp = BLI_findlink(&pose->agroups, index-1);
return (grp)? strlen(grp->name): 0;
grp = BLI_findlink(&pose->agroups, index - 1);
return (grp) ? strlen(grp->name) : 0;
}
static void rna_pose_bgroup_name_index_set(PointerRNA *ptr, const char *value, short *index)
{
bPose *pose = (bPose*)ptr->data;
bPose *pose = (bPose *)ptr->data;
bActionGroup *grp;
int a;
@@ -452,7 +453,7 @@ static void rna_pose_bgroup_name_index_set(PointerRNA *ptr, const char *value, s
static void rna_pose_pgroup_name_set(PointerRNA *ptr, const char *value, char *result, int maxlen)
{
bPose *pose = (bPose*)ptr->data;
bPose *pose = (bPose *)ptr->data;
bActionGroup *grp;
for (grp = pose->agroups.first; grp; grp = grp->next) {
@@ -468,14 +469,14 @@ static void rna_pose_pgroup_name_set(PointerRNA *ptr, const char *value, char *r
static PointerRNA rna_PoseChannel_active_constraint_get(PointerRNA *ptr)
{
bPoseChannel *pchan = (bPoseChannel*)ptr->data;
bPoseChannel *pchan = (bPoseChannel *)ptr->data;
bConstraint *con = constraints_get_active(&pchan->constraints);
return rna_pointer_inherit_refine(ptr, &RNA_Constraint, con);
}
static void rna_PoseChannel_active_constraint_set(PointerRNA *ptr, PointerRNA value)
{
bPoseChannel *pchan = (bPoseChannel*)ptr->data;
bPoseChannel *pchan = (bPoseChannel *)ptr->data;
constraints_set_active(&pchan->constraints, (bConstraint *)value.data);
}
@@ -500,7 +501,7 @@ static void rna_PoseChannel_constraints_remove(ID *id, bPoseChannel *pchan, Repo
remove_constraint(&pchan->constraints, con);
ED_object_constraint_update(ob);
constraints_set_active(&pchan->constraints, NULL);
WM_main_add_notifier(NC_OBJECT|ND_CONSTRAINT|NA_REMOVED, id);
WM_main_add_notifier(NC_OBJECT | ND_CONSTRAINT | NA_REMOVED, id);
if (is_ik) {
BIK_clear_data(ob->pose);
@@ -510,16 +511,16 @@ static void rna_PoseChannel_constraints_remove(ID *id, bPoseChannel *pchan, Repo
static int rna_PoseChannel_proxy_editable(PointerRNA *ptr)
{
Object *ob = (Object*)ptr->id.data;
Object *ob = (Object *)ptr->id.data;
bArmature *arm = ob->data;
bPoseChannel *pchan = (bPoseChannel*)ptr->data;
bPoseChannel *pchan = (bPoseChannel *)ptr->data;
return (ob->proxy && pchan->bone && (pchan->bone->layer & arm->layer_protected))? 0: PROP_EDITABLE;
return (ob->proxy && pchan->bone && (pchan->bone->layer & arm->layer_protected)) ? 0 : PROP_EDITABLE;
}
static int rna_PoseChannel_location_editable(PointerRNA *ptr, int index)
{
bPoseChannel *pchan = (bPoseChannel*)ptr->data;
bPoseChannel *pchan = (bPoseChannel *)ptr->data;
/* only if the axis in question is locked, not editable... */
if ((index == 0) && (pchan->protectflag & OB_LOCK_LOCX))
@@ -534,7 +535,7 @@ static int rna_PoseChannel_location_editable(PointerRNA *ptr, int index)
static int rna_PoseChannel_scale_editable(PointerRNA *ptr, int index)
{
bPoseChannel *pchan = (bPoseChannel*)ptr->data;
bPoseChannel *pchan = (bPoseChannel *)ptr->data;
/* only if the axis in question is locked, not editable... */
if ((index == 0) && (pchan->protectflag & OB_LOCK_SCALEX))
@@ -549,7 +550,7 @@ static int rna_PoseChannel_scale_editable(PointerRNA *ptr, int index)
static int rna_PoseChannel_rotation_euler_editable(PointerRNA *ptr, int index)
{
bPoseChannel *pchan = (bPoseChannel*)ptr->data;
bPoseChannel *pchan = (bPoseChannel *)ptr->data;
/* only if the axis in question is locked, not editable... */
if ((index == 0) && (pchan->protectflag & OB_LOCK_ROTX))
@@ -564,7 +565,7 @@ static int rna_PoseChannel_rotation_euler_editable(PointerRNA *ptr, int index)
static int rna_PoseChannel_rotation_4d_editable(PointerRNA *ptr, int index)
{
bPoseChannel *pchan = (bPoseChannel*)ptr->data;
bPoseChannel *pchan = (bPoseChannel *)ptr->data;
/* only consider locks if locking components individually... */
if (pchan->protectflag & OB_LOCK_ROT4D) {
@@ -585,7 +586,7 @@ static int rna_PoseChannel_rotation_4d_editable(PointerRNA *ptr, int index)
/* not essential, but much faster then the default lookup function */
int rna_PoseBones_lookup_string(PointerRNA *ptr, const char *key, PointerRNA *r_ptr)
{
bPose *pose = (bPose*)ptr->data;
bPose *pose = (bPose *)ptr->data;
bPoseChannel *pchan = BKE_pose_channel_find_name(pose, key);
if (pchan) {
RNA_pointer_create(ptr->id.data, &RNA_PoseBone, pchan, r_ptr);
@@ -598,20 +599,20 @@ int rna_PoseBones_lookup_string(PointerRNA *ptr, const char *key, PointerRNA *r_
static void rna_PoseChannel_matrix_basis_get(PointerRNA *ptr, float *values)
{
bPoseChannel *pchan = (bPoseChannel*)ptr->data;
bPoseChannel *pchan = (bPoseChannel *)ptr->data;
BKE_pchan_to_mat4(pchan, (float (*)[4])values);
}
static void rna_PoseChannel_matrix_basis_set(PointerRNA *ptr, const float *values)
{
bPoseChannel *pchan = (bPoseChannel*)ptr->data;
bPoseChannel *pchan = (bPoseChannel *)ptr->data;
BKE_pchan_apply_mat4(pchan, (float (*)[4])values, FALSE); /* no compat for predictable result */
}
static void rna_PoseChannel_matrix_set(PointerRNA *ptr, const float *values)
{
bPoseChannel *pchan = (bPoseChannel*)ptr->data;
Object *ob = (Object*)ptr->id.data;
bPoseChannel *pchan = (bPoseChannel *)ptr->data;
Object *ob = (Object *)ptr->id.data;
float tmat[4][4];
BKE_armature_mat_pose_to_bone_ex(ob, pchan, (float (*)[4])values, tmat);
@@ -646,7 +647,8 @@ static void rna_def_bone_group(BlenderRNA *brna)
{19, "THEME19", 0, "19 - Theme Color Set", ""},
{20, "THEME20", 0, "20 - Theme Color Set", ""},
{-1, "CUSTOM", 0, "Custom Color Set", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
StructRNA *srna;
PropertyRNA *prop;
@@ -671,27 +673,29 @@ static void rna_def_bone_group(BlenderRNA *brna)
RNA_def_property_enum_items(prop, prop_colorSets_items);
RNA_def_property_enum_funcs(prop, NULL, "rna_BoneGroup_color_set_set", NULL);
RNA_def_property_ui_text(prop, "Color Set", "Custom color set to use");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update");
/* TODO: editing the colors for this should result in changes to the color type... */
/* TODO: editing the colors for this should result in changes to the color type... */
prop = RNA_def_property(srna, "colors", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "ThemeBoneColorSet");
/* NOTE: the DNA data is not really a pointer, but this code works :) */
/* NOTE: the DNA data is not really a pointer, but this code works :) */
RNA_def_property_pointer_sdna(prop, NULL, "cs");
RNA_def_property_ui_text(prop, "Colors", "Copy of the colors associated with the group's color set");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update");
}
static EnumPropertyItem prop_iksolver_items[] = {
{IKSOLVER_LEGACY, "LEGACY", 0, "Legacy", "Original IK solver"},
{IKSOLVER_ITASC, "ITASC", 0, "iTaSC", "Multi constraint, stateful IK solver"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem prop_solver_items[] = {
{ITASC_SOLVER_SDLS, "SDLS", 0, "SDLS", "Selective Damped Least Square"},
{ITASC_SOLVER_DLS, "DLS", 0, "DLS", "Damped Least Square with Numerical Filtering"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static void rna_def_pose_channel_constraints(BlenderRNA *brna, PropertyRNA *cprop)
@@ -728,16 +732,16 @@ static void rna_def_pose_channel_constraints(BlenderRNA *brna, PropertyRNA *cpro
func = RNA_def_function(srna, "remove", "rna_PoseChannel_constraints_remove");
RNA_def_function_ui_description(func, "Remove a constraint from this object");
RNA_def_function_flag(func, FUNC_USE_REPORTS|FUNC_USE_SELF_ID); /* ID needed for refresh */
RNA_def_function_flag(func, FUNC_USE_REPORTS | FUNC_USE_SELF_ID); /* ID needed for refresh */
/* constraint to remove */
parm = RNA_def_pointer(func, "constraint", "Constraint", "", "Removed constraint");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL);
}
static void rna_def_pose_channel(BlenderRNA *brna)
{
static float default_quat[4] = {1, 0, 0, 0}; /* default quaternion values */
static float default_axisAngle[4] = {0, 0, 1, 0}; /* default axis-angle rotation values */
static float default_quat[4] = {1, 0, 0, 0}; /* default quaternion values */
static float default_axisAngle[4] = {0, 0, 1, 0}; /* default axis-angle rotation values */
static float default_scale[3] = {1, 1, 1}; /* default scale values */
const int matrix_dimsize[] = {4, 4};
@@ -791,31 +795,31 @@ static void rna_def_pose_channel(BlenderRNA *brna)
RNA_def_property_editable_array_func(prop, "rna_PoseChannel_location_editable");
RNA_def_property_ui_text(prop, "Location", "");
RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, RNA_TRANSLATION_PREC_DEFAULT);
/* XXX... disabled, since proxy-locked layers are currently used for ensuring proxy-syncing too */
/* XXX... disabled, since proxy-locked layers are currently used for ensuring proxy-syncing too */
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update");
prop = RNA_def_property(srna, "scale", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "size");
RNA_def_property_editable_array_func(prop, "rna_PoseChannel_scale_editable");
RNA_def_property_float_array_default(prop, default_scale);
RNA_def_property_ui_text(prop, "Scale", "");
/* XXX... disabled, since proxy-locked layers are currently used for ensuring proxy-syncing too */
/* XXX... disabled, since proxy-locked layers are currently used for ensuring proxy-syncing too */
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update");
prop = RNA_def_property(srna, "rotation_quaternion", PROP_FLOAT, PROP_QUATERNION);
RNA_def_property_float_sdna(prop, NULL, "quat");
RNA_def_property_editable_array_func(prop, "rna_PoseChannel_rotation_4d_editable");
RNA_def_property_float_array_default(prop, default_quat);
RNA_def_property_ui_text(prop, "Quaternion Rotation", "Rotation in Quaternions");
/* XXX... disabled, since proxy-locked layers are currently used for ensuring proxy-syncing too */
/* XXX... disabled, since proxy-locked layers are currently used for ensuring proxy-syncing too */
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update");
/* XXX: for axis-angle, it would have been nice to have 2 separate fields for UI purposes, but
* having a single one is better for Keyframing and other property-management situations...
*/
/* XXX: for axis-angle, it would have been nice to have 2 separate fields for UI purposes, but
* having a single one is better for Keyframing and other property-management situations...
*/
prop = RNA_def_property(srna, "rotation_axis_angle", PROP_FLOAT, PROP_AXISANGLE);
RNA_def_property_array(prop, 4);
RNA_def_property_float_funcs(prop, "rna_PoseChannel_rotation_axis_angle_get",
@@ -823,26 +827,26 @@ static void rna_def_pose_channel(BlenderRNA *brna)
RNA_def_property_editable_array_func(prop, "rna_PoseChannel_rotation_4d_editable");
RNA_def_property_float_array_default(prop, default_axisAngle);
RNA_def_property_ui_text(prop, "Axis-Angle Rotation", "Angle of Rotation for Axis-Angle rotation representation");
/* XXX... disabled, since proxy-locked layers are currently used for ensuring proxy-syncing too */
/* XXX... disabled, since proxy-locked layers are currently used for ensuring proxy-syncing too */
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update");
prop = RNA_def_property(srna, "rotation_euler", PROP_FLOAT, PROP_EULER);
RNA_def_property_float_sdna(prop, NULL, "eul");
RNA_def_property_editable_array_func(prop, "rna_PoseChannel_rotation_euler_editable");
/* XXX... disabled, since proxy-locked layers are currently used for ensuring proxy-syncing too */
/* XXX... disabled, since proxy-locked layers are currently used for ensuring proxy-syncing too */
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_property_ui_text(prop, "Euler Rotation", "Rotation in Eulers");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update");
prop = RNA_def_property(srna, "rotation_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "rotmode");
RNA_def_property_enum_items(prop, posebone_rotmode_items); /* XXX move to using a single define of this someday */
RNA_def_property_enum_funcs(prop, NULL, "rna_PoseChannel_rotation_mode_set", NULL);
/* XXX... disabled, since proxy-locked layers are currently used for ensuring proxy-syncing too */
/* XXX... disabled, since proxy-locked layers are currently used for ensuring proxy-syncing too */
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_property_ui_text(prop, "Rotation Mode", "");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update");
/* transform matrices - should be read-only since these are set directly by AnimSys evaluation */
prop = RNA_def_property(srna, "matrix_channel", PROP_FLOAT, PROP_MATRIX);
@@ -858,7 +862,7 @@ static void rna_def_pose_channel(BlenderRNA *brna)
"Alternative access to location/scale/rotation relative to the parent and own rest bone");
RNA_def_property_float_funcs(prop, "rna_PoseChannel_matrix_basis_get", "rna_PoseChannel_matrix_basis_set", NULL);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update");
/* final matrix */
prop = RNA_def_property(srna, "matrix", PROP_FLOAT, PROP_MATRIX);
@@ -867,7 +871,7 @@ static void rna_def_pose_channel(BlenderRNA *brna)
RNA_def_property_float_funcs(prop, NULL, "rna_PoseChannel_matrix_set", NULL);
RNA_def_property_ui_text(prop, "Pose Matrix",
"Final 4x4 matrix after constraints and drivers are applied (object space)");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update");
/* Head/Tail Coordinates (in Pose Space) - Automatically calculated... */
prop = RNA_def_property(srna, "head", PROP_FLOAT, PROP_TRANSLATION);
@@ -887,139 +891,139 @@ static void rna_def_pose_channel(BlenderRNA *brna)
RNA_def_property_boolean_funcs(prop, "rna_PoseChannel_has_ik_get", NULL);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Has IK", "Is part of an IK chain");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update");
RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_IK_update");
prop = RNA_def_property(srna, "lock_ik_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ikflag", BONE_IK_NO_XDOF);
RNA_def_property_ui_text(prop, "IK X Lock", "Disallow movement around the X axis");
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update");
RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_IK_update");
prop = RNA_def_property(srna, "lock_ik_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ikflag", BONE_IK_NO_YDOF);
RNA_def_property_ui_text(prop, "IK Y Lock", "Disallow movement around the Y axis");
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update");
RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_IK_update");
prop = RNA_def_property(srna, "lock_ik_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ikflag", BONE_IK_NO_ZDOF);
RNA_def_property_ui_text(prop, "IK Z Lock", "Disallow movement around the Z axis");
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update");
RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_IK_update");
prop = RNA_def_property(srna, "use_ik_limit_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ikflag", BONE_IK_XLIMIT);
RNA_def_property_ui_text(prop, "IK X Limit", "Limit movement around the X axis");
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update");
RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_IK_update");
prop = RNA_def_property(srna, "use_ik_limit_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ikflag", BONE_IK_YLIMIT);
RNA_def_property_ui_text(prop, "IK Y Limit", "Limit movement around the Y axis");
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update");
RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_IK_update");
prop = RNA_def_property(srna, "use_ik_limit_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ikflag", BONE_IK_ZLIMIT);
RNA_def_property_ui_text(prop, "IK Z Limit", "Limit movement around the Z axis");
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update");
RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_IK_update");
prop = RNA_def_property(srna, "use_ik_rotation_control", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ikflag", BONE_IK_ROTCTL);
RNA_def_property_ui_text(prop, "IK rot control", "Apply channel rotation as IK constraint");
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update");
RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_IK_update");
prop = RNA_def_property(srna, "use_ik_linear_control", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ikflag", BONE_IK_LINCTL);
RNA_def_property_ui_text(prop, "IK rot control", "Apply channel size as IK constraint if stretching is enabled");
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update");
RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_IK_update");
prop = RNA_def_property(srna, "ik_min_x", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "limitmin[0]");
RNA_def_property_range(prop, -M_PI, 0.0f);
RNA_def_property_ui_text(prop, "IK X Minimum", "Minimum angles for IK Limit");
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update");
RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_IK_update");
prop = RNA_def_property(srna, "ik_max_x", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "limitmax[0]");
RNA_def_property_range(prop, 0.0f, M_PI);
RNA_def_property_ui_text(prop, "IK X Maximum", "Maximum angles for IK Limit");
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update");
RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_IK_update");
prop = RNA_def_property(srna, "ik_min_y", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "limitmin[1]");
RNA_def_property_range(prop, -M_PI, 0.0f);
RNA_def_property_ui_text(prop, "IK Y Minimum", "Minimum angles for IK Limit");
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update");
RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_IK_update");
prop = RNA_def_property(srna, "ik_max_y", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "limitmax[1]");
RNA_def_property_range(prop, 0.0f, M_PI);
RNA_def_property_ui_text(prop, "IK Y Maximum", "Maximum angles for IK Limit");
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update");
RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_IK_update");
prop = RNA_def_property(srna, "ik_min_z", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "limitmin[2]");
RNA_def_property_range(prop, -M_PI, 0.0f);
RNA_def_property_ui_text(prop, "IK Z Minimum", "Minimum angles for IK Limit");
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update");
RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_IK_update");
prop = RNA_def_property(srna, "ik_max_z", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "limitmax[2]");
RNA_def_property_range(prop, 0.0f, M_PI);
RNA_def_property_ui_text(prop, "IK Z Maximum", "Maximum angles for IK Limit");
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update");
RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_IK_update");
prop = RNA_def_property(srna, "ik_stiffness_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "stiffness[0]");
RNA_def_property_range(prop, 0.0f, 0.99f);
RNA_def_property_ui_text(prop, "IK X Stiffness", "IK stiffness around the X axis");
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update");
RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_IK_update");
prop = RNA_def_property(srna, "ik_stiffness_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "stiffness[1]");
RNA_def_property_range(prop, 0.0f, 0.99f);
RNA_def_property_ui_text(prop, "IK Y Stiffness", "IK stiffness around the Y axis");
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update");
RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_IK_update");
prop = RNA_def_property(srna, "ik_stiffness_z", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "stiffness[2]");
RNA_def_property_range(prop, 0.0f, 0.99f);
RNA_def_property_ui_text(prop, "IK Z Stiffness", "IK stiffness around the Z axis");
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update");
RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_IK_update");
prop = RNA_def_property(srna, "ik_stretch", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ikstretch");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "IK Stretch", "Allow scaling of the bone for IK");
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update");
RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_IK_update");
prop = RNA_def_property(srna, "ik_rotation_weight", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ikrotweight");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "IK Rot Weight", "Weight of rotation constraint for IK");
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update");
prop = RNA_def_property(srna, "ik_linear_weight", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "iklinweight");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "IK Lin Weight", "Weight of scale constraint for IK");
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update");
/* custom bone shapes */
prop = RNA_def_property(srna, "custom_shape", PROP_POINTER, PROP_NONE);
@@ -1029,7 +1033,7 @@ static void rna_def_pose_channel(BlenderRNA *brna)
RNA_def_property_pointer_funcs(prop, NULL, "rna_PoseChannel_bone_custom_set", NULL, NULL);
RNA_def_property_ui_text(prop, "Custom Object", "Object that defines custom draw type for this bone");
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update");
prop = RNA_def_property(srna, "custom_shape_transform", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "custom_tx");
@@ -1038,7 +1042,7 @@ static void rna_def_pose_channel(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Custom Shape Transform",
"Bone that defines the display transform of this custom shape");
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update");
/* bone groups */
prop = RNA_def_property(srna, "bone_group_index", PROP_INT, PROP_NONE);
@@ -1049,7 +1053,7 @@ static void rna_def_pose_channel(BlenderRNA *brna)
"rna_PoseChannel_bone_group_index_range");
RNA_def_property_ui_text(prop, "Bone Group Index", "Bone Group this pose channel belongs to (0=no group)");
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update");
prop = RNA_def_property(srna, "bone_group", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "BoneGroup");
@@ -1058,7 +1062,7 @@ static void rna_def_pose_channel(BlenderRNA *brna)
"rna_PoseChannel_bone_group_set", NULL, NULL);
RNA_def_property_ui_text(prop, "Bone Group", "Bone Group this pose channel belongs to");
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update");
/* transform locks */
prop = RNA_def_property(srna, "lock_location", PROP_BOOLEAN, PROP_NONE);
@@ -1067,7 +1071,7 @@ static void rna_def_pose_channel(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Lock Location", "Lock editing of location in the interface");
RNA_def_property_ui_icon(prop, ICON_UNLOCKED, 1);
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update");
prop = RNA_def_property(srna, "lock_rotation", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "protectflag", OB_LOCK_ROTX);
@@ -1075,25 +1079,25 @@ static void rna_def_pose_channel(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Lock Rotation", "Lock editing of rotation in the interface");
RNA_def_property_ui_icon(prop, ICON_UNLOCKED, 1);
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update");
/* XXX this is sub-optimal - it really should be included above, but due to technical reasons
* we can't do this! */
/* XXX this is sub-optimal - it really should be included above, but due to technical reasons
* we can't do this! */
prop = RNA_def_property(srna, "lock_rotation_w", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "protectflag", OB_LOCK_ROTW);
RNA_def_property_ui_text(prop, "Lock Rotation (4D Angle)",
"Lock editing of 'angle' component of four-component rotations in the interface");
RNA_def_property_ui_icon(prop, ICON_UNLOCKED, 1);
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update");
/* XXX this needs a better name */
/* XXX this needs a better name */
prop = RNA_def_property(srna, "lock_rotations_4d", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "protectflag", OB_LOCK_ROT4D);
RNA_def_property_ui_text(prop, "Lock Rotations (4D)",
"Lock editing of four component rotations by components (instead of as Eulers)");
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update");
prop = RNA_def_property(srna, "lock_scale", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "protectflag", OB_LOCK_SCALEX);
@@ -1101,7 +1105,7 @@ static void rna_def_pose_channel(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Lock Scale", "Lock editing of scale in the interface");
RNA_def_property_ui_icon(prop, ICON_UNLOCKED, 1);
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update");
RNA_api_pose_channel(srna);
}
@@ -1114,7 +1118,8 @@ static void rna_def_pose_itasc(BlenderRNA *brna)
{ITASC_SIMULATION, "SIMULATION", 0, "Simulation",
"Statefull solver running in real-time context and ignoring actions "
"and non-IK constraints"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static const EnumPropertyItem prop_itasc_reiteration_items[] = {
{0, "NEVER", 0, "Never", "The solver does not reiterate, not even on first frame (starts from rest pose)"},
{ITASC_INITIAL_REITERATION, "INITIAL", 0, "Initial",
@@ -1122,7 +1127,8 @@ static void rna_def_pose_itasc(BlenderRNA *brna)
"subsequent frame"},
{ITASC_INITIAL_REITERATION|ITASC_REITERATION, "ALWAYS", 0, "Always",
"The solver reiterates (converges) on all frames"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
StructRNA *srna;
PropertyRNA *prop;
@@ -1135,26 +1141,26 @@ static void rna_def_pose_itasc(BlenderRNA *brna)
RNA_def_property_float_sdna(prop, NULL, "precision");
RNA_def_property_range(prop, 0.0f, 0.1f);
RNA_def_property_ui_text(prop, "Precision", "Precision of convergence in case of reiteration");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update");
RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Itasc_update");
prop = RNA_def_property(srna, "iterations", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "numiter");
RNA_def_property_range(prop, 1.f, 1000.f);
RNA_def_property_ui_text(prop, "Iterations",
"Maximum number of iterations for convergence in case of reiteration");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update");
RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Itasc_update");
prop = RNA_def_property(srna, "step_count", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "numstep");
RNA_def_property_range(prop, 1.f, 50.f);
RNA_def_property_ui_text(prop, "Num steps", "Divide the frame interval into this many steps");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update");
RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Itasc_update");
prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
RNA_def_property_enum_items(prop, prop_itasc_mode_items);
RNA_def_property_ui_text(prop, "Mode", NULL);
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update_rebuild");
RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Itasc_update_rebuild");
prop = RNA_def_property(srna, "reiteration_method", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
@@ -1162,26 +1168,26 @@ static void rna_def_pose_itasc(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Reiteration",
"Defines if the solver is allowed to reiterate (converge until "
"precision is met) on none, first or all frames");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update");
RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Itasc_update");
prop = RNA_def_property(srna, "use_auto_step", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ITASC_AUTO_STEP);
RNA_def_property_ui_text(prop, "Auto step",
"Automatically determine the optimal number of steps for best "
"performance/accuracy trade off");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update");
RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Itasc_update");
prop = RNA_def_property(srna, "step_min", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "minstep");
RNA_def_property_range(prop, 0.0f, 0.1f);
RNA_def_property_ui_text(prop, "Min step", "Lower bound for timestep in second in case of automatic substeps");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update");
RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Itasc_update");
prop = RNA_def_property(srna, "step_max", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "maxstep");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Max step", "Higher bound for timestep in second in case of automatic substeps");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update");
RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Itasc_update");
prop = RNA_def_property(srna, "feedback", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "feedback");
@@ -1189,19 +1195,19 @@ static void rna_def_pose_itasc(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Feedback",
"Feedback coefficient for error correction, average response time is 1/feedback "
"(default=20)");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update");
RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Itasc_update");
prop = RNA_def_property(srna, "velocity_max", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "maxvel");
RNA_def_property_range(prop, 0.0f, 100.0f);
RNA_def_property_ui_text(prop, "Max Velocity", "Maximum joint velocity in rad/s (default=50)");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update");
RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Itasc_update");
prop = RNA_def_property(srna, "solver", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "solver");
RNA_def_property_enum_items(prop, prop_solver_items);
RNA_def_property_ui_text(prop, "Solver", "Solving method selection: automatic damping or manual damping");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update_rebuild");
RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Itasc_update_rebuild");
prop = RNA_def_property(srna, "damping_max", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "dampmax");
@@ -1209,7 +1215,7 @@ static void rna_def_pose_itasc(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Damp",
"Maximum damping coefficient when singular value is nearly 0 "
"(higher values=more stability, less reactivity - default=0.5)");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update");
RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Itasc_update");
prop = RNA_def_property(srna, "damping_epsilon", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "dampeps");
@@ -1217,7 +1223,7 @@ static void rna_def_pose_itasc(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Epsilon",
"Singular value under which damping is progressively applied "
"(higher values=more stability, less reactivity - default=0.1)");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update");
RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Itasc_update");
}
static void rna_def_pose_ikparam(BlenderRNA *brna)
@@ -1258,14 +1264,14 @@ static void rna_def_bone_groups(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_property_pointer_funcs(prop, "rna_Pose_active_bone_group_get",
"rna_Pose_active_bone_group_set", NULL, NULL);
RNA_def_property_ui_text(prop, "Active Bone Group", "Active bone group for this pose");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update");
prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "active_group");
RNA_def_property_int_funcs(prop, "rna_Pose_active_bone_group_index_get", "rna_Pose_active_bone_group_index_set",
"rna_Pose_active_bone_group_index_range");
RNA_def_property_ui_text(prop, "Active Bone Group Index", "Active index in bone groups array");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update");
}
static void rna_def_pose(BlenderRNA *brna)
@@ -1283,7 +1289,7 @@ static void rna_def_pose(BlenderRNA *brna)
RNA_def_property_collection_sdna(prop, NULL, "chanbase", NULL);
RNA_def_property_struct_type(prop, "PoseBone");
RNA_def_property_ui_text(prop, "Pose Bones", "Individual pose bones for the armature");
/* can be removed, only for fast lookup */
/* can be removed, only for fast lookup */
RNA_def_property_collection_funcs(prop, NULL, NULL, NULL, NULL, NULL, NULL, "rna_PoseBones_lookup_string", NULL);
/* bone groups */
@@ -1300,7 +1306,7 @@ static void rna_def_pose(BlenderRNA *brna)
RNA_def_property_enum_items(prop, prop_iksolver_items);
RNA_def_property_ui_text(prop, "IK Solver",
"Selection of IK solver for IK chain, current choice is 0 for Legacy, 1 for iTaSC");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_ik_solver_update");
RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_ik_solver_update");
prop = RNA_def_property(srna, "ik_param", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "IKParam");

View File

@@ -71,7 +71,7 @@ void RNA_api_pose_channel(StructRNA *srna)
func = RNA_def_function(srna, "evaluate_envelope", "rna_PoseBone_do_envelope");
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",
"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);
/* return value */
parm = RNA_def_float(func, "factor", 0, -FLT_MAX, FLT_MAX, "Factor", "Envelope factor", -FLT_MAX, FLT_MAX);

View File

@@ -41,16 +41,17 @@ EnumPropertyItem gameproperty_type_items[] = {
{GPROP_FLOAT, "FLOAT", 0, "Float", "Floating-Point Property"},
{GPROP_STRING, "STRING", 0, "String", "String Property"},
{GPROP_TIME, "TIMER", 0, "Timer", "Timer Property"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
#ifdef RNA_RUNTIME
#include "BKE_property.h"
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) {
case GPROP_BOOL:
@@ -71,20 +72,20 @@ static StructRNA* rna_GameProperty_refine(struct PointerRNA *ptr)
/* for both float and timer */
static float rna_GameFloatProperty_value_get(PointerRNA *ptr)
{
bProperty *prop = (bProperty*)(ptr->data);
return *(float*)(&prop->data);
bProperty *prop = (bProperty *)(ptr->data);
return *(float *)(&prop->data);
}
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);
*(float*)(&prop->data) = value;
*(float *)(&prop->data) = 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) {
prop->type = value;
@@ -94,7 +95,7 @@ static void rna_GameProperty_type_set(PointerRNA *ptr, int 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));
unique_property(NULL, prop, 1);
}

View File

@@ -184,10 +184,10 @@ static StructRNA *rna_RenderEngine_register(Main *bmain, ReportList *reports, vo
et->ext.free = free;
RNA_struct_blender_type_set(et->ext.srna, et);
et->update = (have_function[0])? engine_update: NULL;
et->render = (have_function[1])? engine_render: NULL;
et->view_update = (have_function[2])? engine_view_update: NULL;
et->view_draw = (have_function[3])? engine_view_draw: NULL;
et->update = (have_function[0]) ? engine_update : NULL;
et->render = (have_function[1]) ? engine_render : NULL;
et->view_update = (have_function[2]) ? engine_view_update : NULL;
et->view_draw = (have_function[3]) ? engine_view_draw : NULL;
BLI_addtail(&R_engines, et);
@@ -200,66 +200,66 @@ static void **rna_RenderEngine_instance(PointerRNA *ptr)
return &engine->py_instance;
}
static StructRNA* rna_RenderEngine_refine(PointerRNA *ptr)
static StructRNA *rna_RenderEngine_refine(PointerRNA *ptr)
{
RenderEngine *engine = (RenderEngine*)ptr->data;
return (engine->type && engine->type->ext.srna)? engine->type->ext.srna: &RNA_RenderEngine;
RenderEngine *engine = (RenderEngine *)ptr->data;
return (engine->type && engine->type->ext.srna) ? engine->type->ext.srna : &RNA_RenderEngine;
}
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);
}
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);
}
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;
return length[0]*length[1];
return length[0] * length[1];
}
static void rna_RenderLayer_rect_get(PointerRNA *ptr, float *values)
{
RenderLayer *rl = (RenderLayer*)ptr->data;
memcpy(values, rl->rectf, sizeof(float)*rl->rectx*rl->recty*4);
RenderLayer *rl = (RenderLayer *)ptr->data;
memcpy(values, rl->rectf, sizeof(float) * rl->rectx * rl->recty * 4);
}
void rna_RenderLayer_rect_set(PointerRNA *ptr, const float *values)
{
RenderLayer *rl = (RenderLayer*)ptr->data;
memcpy(rl->rectf, values, sizeof(float)*rl->rectx*rl->recty*4);
RenderLayer *rl = (RenderLayer *)ptr->data;
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])
{
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;
return length[0]*length[1];
return length[0] * length[1];
}
static void rna_RenderPass_rect_get(PointerRNA *ptr, float *values)
{
RenderPass *rpass = (RenderPass*)ptr->data;
memcpy(values, rpass->rect, sizeof(float)*rpass->rectx*rpass->recty*rpass->channels);
RenderPass *rpass = (RenderPass *)ptr->data;
memcpy(values, rpass->rect, sizeof(float) * rpass->rectx * rpass->recty * rpass->channels);
}
void rna_RenderPass_rect_set(PointerRNA *ptr, const float *values)
{
RenderPass *rpass = (RenderPass*)ptr->data;
memcpy(rpass->rect, values, sizeof(float)*rpass->rectx*rpass->recty*rpass->channels);
RenderPass *rpass = (RenderPass *)ptr->data;
memcpy(rpass->rect, values, sizeof(float) * rpass->rectx * rpass->recty * rpass->channels);
}
#else /* RNA_RUNTIME */
@@ -364,7 +364,7 @@ static void rna_def_render_engine(BlenderRNA *brna)
prop = RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE);
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);
RNA_def_property_string_sdna(prop, NULL, "type->name");
@@ -398,8 +398,8 @@ static void rna_def_render_result(BlenderRNA *brna)
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);
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_define_verify_sdna(0);
@@ -434,7 +434,7 @@ static void rna_def_render_layer(BlenderRNA *brna)
RNA_def_function_ui_description(func, "Copies the pixels of this renderlayer from an image file");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
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_int(func, "x", 0, 0, INT_MAX, "Offset X",
"Offset the position to copy from if the image is larger than the render layer", 0, INT_MAX);
@@ -492,7 +492,8 @@ static void rna_def_render_pass(BlenderRNA *brna)
{SCE_PASS_TRANSM_DIRECT, "TRANSMISSION_DIRECT", 0, "Transmission Direct", ""},
{SCE_PASS_TRANSM_INDIRECT, "TRANSMISSION_INDIRECT", 0, "Transmission Indirect", ""},
{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);
RNA_def_struct_ui_text(srna, "Render Pass", "");

View File

@@ -42,7 +42,8 @@ EnumPropertyItem property_type_items[] = {
{PROP_ENUM, "ENUM", 0, "Enumeration", ""},
{PROP_POINTER, "POINTER", 0, "Pointer", ""},
{PROP_COLLECTION, "COLLECTION", 0, "Collection", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
EnumPropertyItem property_subtype_items[] = {
{PROP_NONE, "NONE", 0, "None", ""},
@@ -79,7 +80,8 @@ EnumPropertyItem property_subtype_items[] = {
/* booleans */
{PROP_LAYER, "LAYER", 0, "Layer", ""},
{PROP_LAYER_MEMBER, "LAYER_MEMBER", 0, "Layer Member", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
EnumPropertyItem property_unit_items[] = {
{PROP_UNIT_NONE, "NONE", 0, "None", ""},
@@ -90,7 +92,8 @@ EnumPropertyItem property_unit_items[] = {
{PROP_UNIT_TIME, "TIME", 0, "Time", ""},
{PROP_UNIT_VELOCITY, "VELOCITY", 0, "Velocity", ""},
{PROP_UNIT_ACCELERATION, "ACCELERATION", 0, "Acceleration", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
#ifdef RNA_RUNTIME
#include "MEM_guardedalloc.h"
@@ -101,57 +104,57 @@ EnumPropertyItem property_unit_items[] = {
static void rna_Struct_identifier_get(PointerRNA *ptr, char *value)
{
strcpy(value, ((StructRNA*)ptr->data)->identifier);
strcpy(value, ((StructRNA *)ptr->data)->identifier);
}
static int rna_Struct_identifier_length(PointerRNA *ptr)
{
return strlen(((StructRNA*)ptr->data)->identifier);
return strlen(((StructRNA *)ptr->data)->identifier);
}
static void rna_Struct_description_get(PointerRNA *ptr, char *value)
{
strcpy(value, ((StructRNA*)ptr->data)->description);
strcpy(value, ((StructRNA *)ptr->data)->description);
}
static int rna_Struct_description_length(PointerRNA *ptr)
{
return strlen(((StructRNA*)ptr->data)->description);
return strlen(((StructRNA *)ptr->data)->description);
}
static void rna_Struct_name_get(PointerRNA *ptr, char *value)
{
strcpy(value, ((StructRNA*)ptr->data)->name);
strcpy(value, ((StructRNA *)ptr->data)->name);
}
static int rna_Struct_name_length(PointerRNA *ptr)
{
return strlen(((StructRNA*)ptr->data)->name);
return strlen(((StructRNA *)ptr->data)->name);
}
static void rna_Struct_translation_context_get(PointerRNA *ptr, char *value)
{
strcpy(value, ((StructRNA*)ptr->data)->translation_context ? ((StructRNA*)ptr->data)->translation_context : "");
strcpy(value, ((StructRNA *)ptr->data)->translation_context ? ((StructRNA *)ptr->data)->translation_context : "");
}
static int rna_Struct_translation_context_length(PointerRNA *ptr)
{
return ((StructRNA*)ptr->data)->translation_context ? strlen(((StructRNA*)ptr->data)->translation_context) : 0;
return ((StructRNA *)ptr->data)->translation_context ? strlen(((StructRNA *)ptr->data)->translation_context) : 0;
}
static PointerRNA rna_Struct_base_get(PointerRNA *ptr)
{
return rna_pointer_inherit_refine(ptr, &RNA_Struct, ((StructRNA*)ptr->data)->base);
return rna_pointer_inherit_refine(ptr, &RNA_Struct, ((StructRNA *)ptr->data)->base);
}
static PointerRNA rna_Struct_nested_get(PointerRNA *ptr)
{
return rna_pointer_inherit_refine(ptr, &RNA_Struct, ((StructRNA*)ptr->data)->nested);
return rna_pointer_inherit_refine(ptr, &RNA_Struct, ((StructRNA *)ptr->data)->nested);
}
static PointerRNA rna_Struct_name_property_get(PointerRNA *ptr)
{
return rna_pointer_inherit_refine(ptr, &RNA_Property, ((StructRNA*)ptr->data)->nameproperty);
return rna_pointer_inherit_refine(ptr, &RNA_Property, ((StructRNA *)ptr->data)->nameproperty);
}
/* Struct property iteration. This is quite complicated, the purpose is to
@@ -160,7 +163,7 @@ static PointerRNA rna_Struct_name_property_get(PointerRNA *ptr)
static int rna_idproperty_known(CollectionPropertyIterator *iter, void *data)
{
IDProperty *idprop = (IDProperty*)data;
IDProperty *idprop = (IDProperty *)data;
PropertyRNA *prop;
StructRNA *ptype = iter->builtin_parent.type;
@@ -177,7 +180,7 @@ static int rna_idproperty_known(CollectionPropertyIterator *iter, void *data)
static int rna_property_builtin(CollectionPropertyIterator *UNUSED(iter), void *data)
{
PropertyRNA *prop = (PropertyRNA*)data;
PropertyRNA *prop = (PropertyRNA *)data;
/* function to skip builtin rna properties */
@@ -186,7 +189,7 @@ static int rna_property_builtin(CollectionPropertyIterator *UNUSED(iter), void *
static int rna_function_builtin(CollectionPropertyIterator *UNUSED(iter), void *data)
{
FunctionRNA *func = (FunctionRNA*)data;
FunctionRNA *func = (FunctionRNA *)data;
/* function to skip builtin rna functions */
@@ -200,9 +203,9 @@ static void rna_inheritance_next_level_restart(CollectionPropertyIterator *iter,
StructRNA *srna;
int i;
srna = (StructRNA*)iter->parent.data;
srna = (StructRNA *)iter->parent.data;
iter->level--;
for (i = iter->level; i>0; i--)
for (i = iter->level; i > 0; i--)
srna = srna->base;
rna_iterator_listbase_end(iter);
@@ -363,7 +366,7 @@ int rna_builtin_properties_lookup_string(PointerRNA *ptr, const char *key, Point
do {
if (srna->cont.prophash) {
prop = BLI_ghash_lookup(srna->cont.prophash, (void*)key);
prop = BLI_ghash_lookup(srna->cont.prophash, (void *)key);
if (prop) {
propptr.type = &RNA_Property;
@@ -420,7 +423,7 @@ PointerRNA rna_builtin_type_get(PointerRNA *ptr)
static StructRNA *rna_Property_refine(PointerRNA *ptr)
{
PropertyRNA *prop = (PropertyRNA*)ptr->data;
PropertyRNA *prop = (PropertyRNA *)ptr->data;
rna_idproperty_check(&prop, ptr); /* XXX ptr? */
@@ -438,185 +441,185 @@ static StructRNA *rna_Property_refine(PointerRNA *ptr)
static void rna_Property_identifier_get(PointerRNA *ptr, char *value)
{
PropertyRNA *prop = (PropertyRNA*)ptr->data;
PropertyRNA *prop = (PropertyRNA *)ptr->data;
rna_idproperty_check(&prop, ptr);
strcpy(value, ((PropertyRNA*)prop)->identifier);
strcpy(value, ((PropertyRNA *)prop)->identifier);
}
static int rna_Property_identifier_length(PointerRNA *ptr)
{
PropertyRNA *prop = (PropertyRNA*)ptr->data;
PropertyRNA *prop = (PropertyRNA *)ptr->data;
rna_idproperty_check(&prop, ptr);
return strlen(prop->identifier);
}
static void rna_Property_name_get(PointerRNA *ptr, char *value)
{
PropertyRNA *prop = (PropertyRNA*)ptr->data;
PropertyRNA *prop = (PropertyRNA *)ptr->data;
rna_idproperty_check(&prop, ptr);
strcpy(value, prop->name);
}
static int rna_Property_name_length(PointerRNA *ptr)
{
PropertyRNA *prop = (PropertyRNA*)ptr->data;
PropertyRNA *prop = (PropertyRNA *)ptr->data;
rna_idproperty_check(&prop, ptr);
return strlen(prop->name);
}
static void rna_Property_description_get(PointerRNA *ptr, char *value)
{
PropertyRNA *prop = (PropertyRNA*)ptr->data;
PropertyRNA *prop = (PropertyRNA *)ptr->data;
rna_idproperty_check(&prop, ptr);
strcpy(value, prop->description ? prop->description:"");
strcpy(value, prop->description ? prop->description : "");
}
static int rna_Property_description_length(PointerRNA *ptr)
{
PropertyRNA *prop = (PropertyRNA*)ptr->data;
PropertyRNA *prop = (PropertyRNA *)ptr->data;
rna_idproperty_check(&prop, ptr);
return prop->description ? strlen(prop->description) : 0;
}
static void rna_Property_translation_context_get(PointerRNA *ptr, char *value)
{
PropertyRNA *prop = (PropertyRNA*)ptr->data;
PropertyRNA *prop = (PropertyRNA *)ptr->data;
rna_idproperty_check(&prop, ptr);
strcpy(value, prop->translation_context ? prop->translation_context:"");
strcpy(value, prop->translation_context ? prop->translation_context : "");
}
static int rna_Property_translation_context_length(PointerRNA *ptr)
{
PropertyRNA *prop = (PropertyRNA*)ptr->data;
PropertyRNA *prop = (PropertyRNA *)ptr->data;
rna_idproperty_check(&prop, ptr);
return prop->translation_context ? strlen(prop->translation_context) : 0;
}
static int rna_Property_type_get(PointerRNA *ptr)
{
PropertyRNA *prop = (PropertyRNA*)ptr->data;
PropertyRNA *prop = (PropertyRNA *)ptr->data;
rna_idproperty_check(&prop, ptr);
return prop->type;
}
static int rna_Property_subtype_get(PointerRNA *ptr)
{
PropertyRNA *prop = (PropertyRNA*)ptr->data;
PropertyRNA *prop = (PropertyRNA *)ptr->data;
rna_idproperty_check(&prop, ptr);
return prop->subtype;
}
static PointerRNA rna_Property_srna_get(PointerRNA *ptr)
{
PropertyRNA *prop = (PropertyRNA*)ptr->data;
PropertyRNA *prop = (PropertyRNA *)ptr->data;
rna_idproperty_check(&prop, ptr);
return rna_pointer_inherit_refine(ptr, &RNA_Struct, prop->srna);
}
static int rna_Property_unit_get(PointerRNA *ptr)
{
PropertyRNA *prop = (PropertyRNA*)ptr->data;
PropertyRNA *prop = (PropertyRNA *)ptr->data;
rna_idproperty_check(&prop, ptr);
return RNA_SUBTYPE_UNIT(prop->subtype);
}
static int rna_Property_readonly_get(PointerRNA *ptr)
{
PropertyRNA *prop = (PropertyRNA*)ptr->data;
PropertyRNA *prop = (PropertyRNA *)ptr->data;
/* don't use this becaure it will call functions that check the internal
* data for introspection we only need to know if it can be edited so the
* flag is better for this */
/* return RNA_property_editable(ptr, prop); */
return prop->flag & PROP_EDITABLE ? 0:1;
return prop->flag & PROP_EDITABLE ? 0 : 1;
}
static int rna_Property_animatable_get(PointerRNA *ptr)
{
PropertyRNA *prop = (PropertyRNA*)ptr->data;
PropertyRNA *prop = (PropertyRNA *)ptr->data;
return (prop->flag & PROP_ANIMATABLE) != 0;
}
static int rna_Property_use_output_get(PointerRNA *ptr)
{
PropertyRNA *prop = (PropertyRNA*)ptr->data;
return prop->flag & PROP_OUTPUT ? 1:0;
PropertyRNA *prop = (PropertyRNA *)ptr->data;
return prop->flag & PROP_OUTPUT ? 1 : 0;
}
static int rna_Property_is_required_get(PointerRNA *ptr)
{
PropertyRNA *prop = (PropertyRNA*)ptr->data;
return prop->flag & PROP_REQUIRED ? 1:0;
PropertyRNA *prop = (PropertyRNA *)ptr->data;
return prop->flag & PROP_REQUIRED ? 1 : 0;
}
static int rna_Property_is_never_none_get(PointerRNA *ptr)
{
PropertyRNA *prop = (PropertyRNA*)ptr->data;
return prop->flag & PROP_NEVER_NULL ? 1:0;
PropertyRNA *prop = (PropertyRNA *)ptr->data;
return prop->flag & PROP_NEVER_NULL ? 1 : 0;
}
static int rna_Property_is_hidden_get(PointerRNA *ptr)
{
PropertyRNA *prop = (PropertyRNA*)ptr->data;
return prop->flag & PROP_HIDDEN ? 1:0;
PropertyRNA *prop = (PropertyRNA *)ptr->data;
return prop->flag & PROP_HIDDEN ? 1 : 0;
}
static int rna_Property_is_skip_save_get(PointerRNA *ptr)
{
PropertyRNA *prop = (PropertyRNA*)ptr->data;
return prop->flag & PROP_SKIP_SAVE ? 1:0;
PropertyRNA *prop = (PropertyRNA *)ptr->data;
return prop->flag & PROP_SKIP_SAVE ? 1 : 0;
}
static int rna_Property_is_enum_flag_get(PointerRNA *ptr)
{
PropertyRNA *prop = (PropertyRNA*)ptr->data;
return prop->flag & PROP_ENUM_FLAG ? 1:0;
PropertyRNA *prop = (PropertyRNA *)ptr->data;
return prop->flag & PROP_ENUM_FLAG ? 1 : 0;
}
static int rna_Property_array_length_get(PointerRNA *ptr)
{
PropertyRNA *prop = (PropertyRNA*)ptr->data;
PropertyRNA *prop = (PropertyRNA *)ptr->data;
rna_idproperty_check(&prop, ptr);
return prop->totarraylength;
}
static int rna_Property_registered_get(PointerRNA *ptr)
{
PropertyRNA *prop = (PropertyRNA*)ptr->data;
PropertyRNA *prop = (PropertyRNA *)ptr->data;
return prop->flag & PROP_REGISTER;
}
static int rna_Property_registered_optional_get(PointerRNA *ptr)
{
PropertyRNA *prop = (PropertyRNA*)ptr->data;
PropertyRNA *prop = (PropertyRNA *)ptr->data;
return prop->flag & PROP_REGISTER_OPTIONAL;
}
static int rna_Property_runtime_get(PointerRNA *ptr)
{
PropertyRNA *prop = (PropertyRNA*)ptr->data;
PropertyRNA *prop = (PropertyRNA *)ptr->data;
return prop->flag & PROP_RUNTIME;
}
static int rna_BoolProperty_default_get(PointerRNA *ptr)
{
PropertyRNA *prop = (PropertyRNA*)ptr->data;
PropertyRNA *prop = (PropertyRNA *)ptr->data;
rna_idproperty_check(&prop, ptr);
return ((BoolPropertyRNA*)prop)->defaultvalue;
return ((BoolPropertyRNA *)prop)->defaultvalue;
}
static int rna_IntProperty_default_get(PointerRNA *ptr)
{
PropertyRNA *prop = (PropertyRNA*)ptr->data;
PropertyRNA *prop = (PropertyRNA *)ptr->data;
rna_idproperty_check(&prop, ptr);
return ((IntPropertyRNA*)prop)->defaultvalue;
return ((IntPropertyRNA *)prop)->defaultvalue;
}
/* int/float/bool */
static int rna_NumberProperty_default_array_get_length(PointerRNA *ptr, int length[RNA_MAX_ARRAY_DIMENSION])
{
PropertyRNA *prop = (PropertyRNA*)ptr->data;
PropertyRNA *prop = (PropertyRNA *)ptr->data;
rna_idproperty_check(&prop, ptr);
length[0] = prop->totarraylength;
@@ -625,8 +628,8 @@ static int rna_NumberProperty_default_array_get_length(PointerRNA *ptr, int leng
}
static void rna_IntProperty_default_array_get(PointerRNA *ptr, int *values)
{
PropertyRNA *prop = (PropertyRNA*)ptr->data;
IntPropertyRNA *nprop = (IntPropertyRNA*)prop;
PropertyRNA *prop = (PropertyRNA *)ptr->data;
IntPropertyRNA *nprop = (IntPropertyRNA *)prop;
rna_idproperty_check(&prop, ptr);
if (nprop->defaultarray) {
@@ -640,8 +643,8 @@ static void rna_IntProperty_default_array_get(PointerRNA *ptr, int *values)
}
static void rna_BoolProperty_default_array_get(PointerRNA *ptr, int *values)
{
PropertyRNA *prop = (PropertyRNA*)ptr->data;
BoolPropertyRNA *nprop = (BoolPropertyRNA*)prop;
PropertyRNA *prop = (PropertyRNA *)ptr->data;
BoolPropertyRNA *nprop = (BoolPropertyRNA *)prop;
rna_idproperty_check(&prop, ptr);
if (nprop->defaultarray) {
@@ -655,8 +658,8 @@ static void rna_BoolProperty_default_array_get(PointerRNA *ptr, int *values)
}
static void rna_FloatProperty_default_array_get(PointerRNA *ptr, float *values)
{
PropertyRNA *prop = (PropertyRNA*)ptr->data;
FloatPropertyRNA *nprop = (FloatPropertyRNA*)prop;
PropertyRNA *prop = (PropertyRNA *)ptr->data;
FloatPropertyRNA *nprop = (FloatPropertyRNA *)prop;
rna_idproperty_check(&prop, ptr);
if (nprop->defaultarray) {
@@ -671,125 +674,125 @@ static void rna_FloatProperty_default_array_get(PointerRNA *ptr, float *values)
static int rna_IntProperty_hard_min_get(PointerRNA *ptr)
{
PropertyRNA *prop = (PropertyRNA*)ptr->data;
PropertyRNA *prop = (PropertyRNA *)ptr->data;
rna_idproperty_check(&prop, ptr);
return ((IntPropertyRNA*)prop)->hardmin;
return ((IntPropertyRNA *)prop)->hardmin;
}
static int rna_IntProperty_hard_max_get(PointerRNA *ptr)
{
PropertyRNA *prop = (PropertyRNA*)ptr->data;
PropertyRNA *prop = (PropertyRNA *)ptr->data;
rna_idproperty_check(&prop, ptr);
return ((IntPropertyRNA*)prop)->hardmax;
return ((IntPropertyRNA *)prop)->hardmax;
}
static int rna_IntProperty_soft_min_get(PointerRNA *ptr)
{
PropertyRNA *prop = (PropertyRNA*)ptr->data;
PropertyRNA *prop = (PropertyRNA *)ptr->data;
rna_idproperty_check(&prop, ptr);
return ((IntPropertyRNA*)prop)->softmin;
return ((IntPropertyRNA *)prop)->softmin;
}
static int rna_IntProperty_soft_max_get(PointerRNA *ptr)
{
PropertyRNA *prop = (PropertyRNA*)ptr->data;
PropertyRNA *prop = (PropertyRNA *)ptr->data;
rna_idproperty_check(&prop, ptr);
return ((IntPropertyRNA*)prop)->softmax;
return ((IntPropertyRNA *)prop)->softmax;
}
static int rna_IntProperty_step_get(PointerRNA *ptr)
{
PropertyRNA *prop = (PropertyRNA*)ptr->data;
PropertyRNA *prop = (PropertyRNA *)ptr->data;
rna_idproperty_check(&prop, ptr);
return ((IntPropertyRNA*)prop)->step;
return ((IntPropertyRNA *)prop)->step;
}
static float rna_FloatProperty_default_get(PointerRNA *ptr)
{
PropertyRNA *prop = (PropertyRNA*)ptr->data;
PropertyRNA *prop = (PropertyRNA *)ptr->data;
rna_idproperty_check(&prop, ptr);
return ((FloatPropertyRNA*)prop)->defaultvalue;
return ((FloatPropertyRNA *)prop)->defaultvalue;
}
static float rna_FloatProperty_hard_min_get(PointerRNA *ptr)
{
PropertyRNA *prop = (PropertyRNA*)ptr->data;
PropertyRNA *prop = (PropertyRNA *)ptr->data;
rna_idproperty_check(&prop, ptr);
return ((FloatPropertyRNA*)prop)->hardmin;
return ((FloatPropertyRNA *)prop)->hardmin;
}
static float rna_FloatProperty_hard_max_get(PointerRNA *ptr)
{
PropertyRNA *prop = (PropertyRNA*)ptr->data;
PropertyRNA *prop = (PropertyRNA *)ptr->data;
rna_idproperty_check(&prop, ptr);
return ((FloatPropertyRNA*)prop)->hardmax;
return ((FloatPropertyRNA *)prop)->hardmax;
}
static float rna_FloatProperty_soft_min_get(PointerRNA *ptr)
{
PropertyRNA *prop = (PropertyRNA*)ptr->data;
PropertyRNA *prop = (PropertyRNA *)ptr->data;
rna_idproperty_check(&prop, ptr);
return ((FloatPropertyRNA*)prop)->softmin;
return ((FloatPropertyRNA *)prop)->softmin;
}
static float rna_FloatProperty_soft_max_get(PointerRNA *ptr)
{
PropertyRNA *prop = (PropertyRNA*)ptr->data;
PropertyRNA *prop = (PropertyRNA *)ptr->data;
rna_idproperty_check(&prop, ptr);
return ((FloatPropertyRNA*)prop)->softmax;
return ((FloatPropertyRNA *)prop)->softmax;
}
static float rna_FloatProperty_step_get(PointerRNA *ptr)
{
PropertyRNA *prop = (PropertyRNA*)ptr->data;
PropertyRNA *prop = (PropertyRNA *)ptr->data;
rna_idproperty_check(&prop, ptr);
return ((FloatPropertyRNA*)prop)->step;
return ((FloatPropertyRNA *)prop)->step;
}
static int rna_FloatProperty_precision_get(PointerRNA *ptr)
{
PropertyRNA *prop = (PropertyRNA*)ptr->data;
PropertyRNA *prop = (PropertyRNA *)ptr->data;
rna_idproperty_check(&prop, ptr);
return ((FloatPropertyRNA*)prop)->precision;
return ((FloatPropertyRNA *)prop)->precision;
}
static void rna_StringProperty_default_get(PointerRNA *ptr, char *value)
{
PropertyRNA *prop = (PropertyRNA*)ptr->data;
PropertyRNA *prop = (PropertyRNA *)ptr->data;
rna_idproperty_check(&prop, ptr);
strcpy(value, ((StringPropertyRNA*)prop)->defaultvalue);
strcpy(value, ((StringPropertyRNA *)prop)->defaultvalue);
}
static int rna_StringProperty_default_length(PointerRNA *ptr)
{
PropertyRNA *prop = (PropertyRNA*)ptr->data;
PropertyRNA *prop = (PropertyRNA *)ptr->data;
rna_idproperty_check(&prop, ptr);
return strlen(((StringPropertyRNA*)prop)->defaultvalue);
return strlen(((StringPropertyRNA *)prop)->defaultvalue);
}
static int rna_StringProperty_max_length_get(PointerRNA *ptr)
{
PropertyRNA *prop = (PropertyRNA*)ptr->data;
PropertyRNA *prop = (PropertyRNA *)ptr->data;
rna_idproperty_check(&prop, ptr);
return ((StringPropertyRNA*)prop)->maxlength;
return ((StringPropertyRNA *)prop)->maxlength;
}
static EnumPropertyItem *rna_EnumProperty_default_itemf(bContext *C, PointerRNA *ptr,
PropertyRNA *prop_parent, int *free)
{
PropertyRNA *prop = (PropertyRNA*)ptr->data;
PropertyRNA *prop = (PropertyRNA *)ptr->data;
EnumPropertyRNA *eprop;
rna_idproperty_check(&prop, ptr);
eprop = (EnumPropertyRNA*)prop;
eprop = (EnumPropertyRNA *)prop;
/* incompatible default attributes */
if ((prop_parent->flag & PROP_ENUM_FLAG) != (prop->flag & PROP_ENUM_FLAG)) {
return NULL;
}
if ( (eprop->itemf == NULL) ||
(eprop->itemf == rna_EnumProperty_default_itemf) ||
(ptr->type == &RNA_EnumProperty) ||
(C == NULL))
if ((eprop->itemf == NULL) ||
(eprop->itemf == rna_EnumProperty_default_itemf) ||
(ptr->type == &RNA_EnumProperty) ||
(C == NULL))
{
return eprop->item;
}
@@ -800,21 +803,21 @@ static EnumPropertyItem *rna_EnumProperty_default_itemf(bContext *C, PointerRNA
/* XXX - not sure this is needed? */
static int rna_EnumProperty_default_get(PointerRNA *ptr)
{
PropertyRNA *prop = (PropertyRNA*)ptr->data;
PropertyRNA *prop = (PropertyRNA *)ptr->data;
rna_idproperty_check(&prop, ptr);
return ((EnumPropertyRNA*)prop)->defaultvalue;
return ((EnumPropertyRNA *)prop)->defaultvalue;
}
static int rna_enum_check_separator(CollectionPropertyIterator *UNUSED(iter), void *data)
{
EnumPropertyItem *item = (EnumPropertyItem*)data;
EnumPropertyItem *item = (EnumPropertyItem *)data;
return (item->identifier[0] == 0);
}
static void rna_EnumProperty_items_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
PropertyRNA *prop = (PropertyRNA*)ptr->data;
PropertyRNA *prop = (PropertyRNA *)ptr->data;
/* EnumPropertyRNA *eprop; *//* UNUSED */
EnumPropertyItem *item = NULL;
int totitem, free = 0;
@@ -823,32 +826,32 @@ static void rna_EnumProperty_items_begin(CollectionPropertyIterator *iter, Point
/* eprop= (EnumPropertyRNA*)prop; */
RNA_property_enum_items(NULL, ptr, prop, &item, &totitem, &free);
rna_iterator_array_begin(iter, (void*)item, sizeof(EnumPropertyItem), totitem, free, rna_enum_check_separator);
rna_iterator_array_begin(iter, (void *)item, sizeof(EnumPropertyItem), totitem, free, rna_enum_check_separator);
}
static void rna_EnumPropertyItem_identifier_get(PointerRNA *ptr, char *value)
{
strcpy(value, ((EnumPropertyItem*)ptr->data)->identifier);
strcpy(value, ((EnumPropertyItem *)ptr->data)->identifier);
}
static int rna_EnumPropertyItem_identifier_length(PointerRNA *ptr)
{
return strlen(((EnumPropertyItem*)ptr->data)->identifier);
return strlen(((EnumPropertyItem *)ptr->data)->identifier);
}
static void rna_EnumPropertyItem_name_get(PointerRNA *ptr, char *value)
{
strcpy(value, ((EnumPropertyItem*)ptr->data)->name);
strcpy(value, ((EnumPropertyItem *)ptr->data)->name);
}
static int rna_EnumPropertyItem_name_length(PointerRNA *ptr)
{
return strlen(((EnumPropertyItem*)ptr->data)->name);
return strlen(((EnumPropertyItem *)ptr->data)->name);
}
static void rna_EnumPropertyItem_description_get(PointerRNA *ptr, char *value)
{
EnumPropertyItem *eprop = (EnumPropertyItem*)ptr->data;
EnumPropertyItem *eprop = (EnumPropertyItem *)ptr->data;
if (eprop->description)
strcpy(value, eprop->description);
@@ -858,7 +861,7 @@ static void rna_EnumPropertyItem_description_get(PointerRNA *ptr, char *value)
static int rna_EnumPropertyItem_description_length(PointerRNA *ptr)
{
EnumPropertyItem *eprop = (EnumPropertyItem*)ptr->data;
EnumPropertyItem *eprop = (EnumPropertyItem *)ptr->data;
if (eprop->description)
return strlen(eprop->description);
@@ -868,65 +871,65 @@ static int rna_EnumPropertyItem_description_length(PointerRNA *ptr)
static int rna_EnumPropertyItem_value_get(PointerRNA *ptr)
{
return ((EnumPropertyItem*)ptr->data)->value;
return ((EnumPropertyItem *)ptr->data)->value;
}
static PointerRNA rna_PointerProperty_fixed_type_get(PointerRNA *ptr)
{
PropertyRNA *prop = (PropertyRNA*)ptr->data;
PropertyRNA *prop = (PropertyRNA *)ptr->data;
rna_idproperty_check(&prop, ptr);
return rna_pointer_inherit_refine(ptr, &RNA_Struct, ((PointerPropertyRNA*)prop)->type);
return rna_pointer_inherit_refine(ptr, &RNA_Struct, ((PointerPropertyRNA *)prop)->type);
}
static PointerRNA rna_CollectionProperty_fixed_type_get(PointerRNA *ptr)
{
PropertyRNA *prop = (PropertyRNA*)ptr->data;
PropertyRNA *prop = (PropertyRNA *)ptr->data;
rna_idproperty_check(&prop, ptr);
return rna_pointer_inherit_refine(ptr, &RNA_Struct, ((CollectionPropertyRNA*)prop)->item_type);
return rna_pointer_inherit_refine(ptr, &RNA_Struct, ((CollectionPropertyRNA *)prop)->item_type);
}
/* Function */
static void rna_Function_identifier_get(PointerRNA *ptr, char *value)
{
strcpy(value, ((FunctionRNA*)ptr->data)->identifier);
strcpy(value, ((FunctionRNA *)ptr->data)->identifier);
}
static int rna_Function_identifier_length(PointerRNA *ptr)
{
return strlen(((FunctionRNA*)ptr->data)->identifier);
return strlen(((FunctionRNA *)ptr->data)->identifier);
}
static void rna_Function_description_get(PointerRNA *ptr, char *value)
{
strcpy(value, ((FunctionRNA*)ptr->data)->description);
strcpy(value, ((FunctionRNA *)ptr->data)->description);
}
static int rna_Function_description_length(PointerRNA *ptr)
{
return strlen(((FunctionRNA*)ptr->data)->description);
return strlen(((FunctionRNA *)ptr->data)->description);
}
static void rna_Function_parameters_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
rna_iterator_listbase_begin(iter, &((FunctionRNA*)ptr->data)->cont.properties, rna_property_builtin);
rna_iterator_listbase_begin(iter, &((FunctionRNA *)ptr->data)->cont.properties, rna_property_builtin);
}
static int rna_Function_registered_get(PointerRNA *ptr)
{
FunctionRNA *func = (FunctionRNA*)ptr->data;
FunctionRNA *func = (FunctionRNA *)ptr->data;
return func->flag & FUNC_REGISTER;
}
static int rna_Function_registered_optional_get(PointerRNA *ptr)
{
FunctionRNA *func = (FunctionRNA*)ptr->data;
FunctionRNA *func = (FunctionRNA *)ptr->data;
return func->flag & FUNC_REGISTER_OPTIONAL;
}
static int rna_Function_no_self_get(PointerRNA *ptr)
{
FunctionRNA *func = (FunctionRNA*)ptr->data;
FunctionRNA *func = (FunctionRNA *)ptr->data;
return !(func->flag & FUNC_NO_SELF);
}
@@ -934,17 +937,17 @@ static int rna_Function_no_self_get(PointerRNA *ptr)
static void rna_BlenderRNA_structs_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
rna_iterator_listbase_begin(iter, &((BlenderRNA*)ptr->data)->structs, NULL);
rna_iterator_listbase_begin(iter, &((BlenderRNA *)ptr->data)->structs, NULL);
}
/* optional, for faster lookups */
static int rna_BlenderRNA_structs_length(PointerRNA *ptr)
{
return BLI_countlist(&((BlenderRNA*)ptr->data)->structs);
return BLI_countlist(&((BlenderRNA *)ptr->data)->structs);
}
static int rna_BlenderRNA_structs_lookup_int(PointerRNA *ptr, int index, PointerRNA *r_ptr)
{
StructRNA *srna = BLI_findlink(&((BlenderRNA*)ptr->data)->structs, index);
StructRNA *srna = BLI_findlink(&((BlenderRNA *)ptr->data)->structs, index);
if (srna) {
RNA_pointer_create(NULL, &RNA_Struct, srna, r_ptr);
@@ -956,7 +959,7 @@ static int rna_BlenderRNA_structs_lookup_int(PointerRNA *ptr, int index, Pointer
}
static int rna_BlenderRNA_structs_lookup_string(PointerRNA *ptr, const char *key, PointerRNA *r_ptr)
{
StructRNA *srna = ((BlenderRNA*)ptr->data)->structs.first;
StructRNA *srna = ((BlenderRNA *)ptr->data)->structs.first;
for (; srna; srna = srna->cont.next) {
if (key[0] == srna->identifier[0] && strcmp(key, srna->identifier) == 0) {
RNA_pointer_create(NULL, &RNA_Struct, srna, r_ptr);
@@ -1062,7 +1065,8 @@ static void rna_def_property(BlenderRNA *brna)
{PROP_COORDS, "COORDINATES", 0, "Vector Coordinates", ""},
{PROP_LAYER, "LAYER", 0, "Layer", ""},
{PROP_LAYER_MEMBER, "LAYER_MEMBERSHIP", 0, "Layer Membership", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
srna = RNA_def_struct(brna, "Property", NULL);
RNA_def_struct_ui_text(srna, "Property Definition", "RNA property definition");
@@ -1331,7 +1335,8 @@ static void rna_def_enum_property(BlenderRNA *brna, StructRNA *srna)
/* the itemf func is used instead, keep blender happy */
static EnumPropertyItem default_dummy_items[] = {
{PROP_NONE, "DUMMY", 0, "Dummy", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
prop = RNA_def_property(srna, "default", PROP_ENUM, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
@@ -1457,7 +1462,7 @@ void RNA_def_rna(BlenderRNA *brna)
RNA_def_property_struct_type(prop, "Struct");
RNA_def_property_collection_funcs(prop, "rna_BlenderRNA_structs_begin", "rna_iterator_listbase_next",
"rna_iterator_listbase_end", "rna_iterator_listbase_get",
/* included for speed, can be removed */
/* included for speed, can be removed */
#if 0
NULL, NULL, NULL, NULL);
#else

View File

@@ -56,7 +56,7 @@ void rna_Scene_frame_set(Scene *scene, int frame, float subframe)
scene->r.subframe = subframe;
CLAMP(scene->r.cfra, MINAFRAME, MAXFRAME);
BKE_scene_update_for_newframe(G.main, scene, (1<<20) - 1);
BKE_scene_update_for_newframe(G.main, scene, (1 << 20) - 1);
BKE_scene_camera_switch_update(scene);
/* cant use NC_SCENE|ND_FRAME because this casues wm_event_do_notifiers to call
@@ -133,7 +133,7 @@ void RNA_api_scene_render(StructRNA *srna)
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);
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_function_output(func, parm);
}

View File

@@ -45,7 +45,8 @@ EnumPropertyItem region_type_items[] = {
{RGN_TYPE_TOOLS, "TOOLS", 0, "Tools", ""},
{RGN_TYPE_TOOL_PROPS, "TOOL_PROPS", 0, "Tool Properties", ""},
{RGN_TYPE_PREVIEW, "PREVIEW", 0, "Preview", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
#include "ED_screen.h"
@@ -58,7 +59,7 @@ EnumPropertyItem region_type_items[] = {
static void rna_Screen_scene_set(PointerRNA *ptr, PointerRNA value)
{
bScreen *sc = (bScreen*)ptr->data;
bScreen *sc = (bScreen *)ptr->data;
if (value.data == NULL)
return;
@@ -68,12 +69,12 @@ static void rna_Screen_scene_set(PointerRNA *ptr, PointerRNA value)
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 */
if (sc->newscene) {
ED_screen_set_scene(C, sc, 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.debug & G_DEBUG)
printf("scene set %p\n", sc->newscene);
@@ -93,19 +94,19 @@ static void rna_Screen_redraw_update(Main *UNUSED(bmain), Scene *UNUSED(scene),
static int rna_Screen_is_animation_playing_get(PointerRNA *ptr)
{
bScreen *sc = (bScreen*)ptr->data;
bScreen *sc = (bScreen *)ptr->data;
return (sc->animtimer != NULL);
}
static int rna_Screen_fullscreen_get(PointerRNA *ptr)
{
bScreen *sc = (bScreen*)ptr->data;
bScreen *sc = (bScreen *)ptr->data;
return (sc->full != 0);
}
static void rna_Area_type_set(PointerRNA *ptr, int value)
{
ScrArea *sa = (ScrArea*)ptr->data;
ScrArea *sa = (ScrArea *)ptr->data;
sa->butspacetype = value;
}
@@ -113,12 +114,12 @@ static void rna_Area_type_update(bContext *C, PointerRNA *ptr)
{
wmWindowManager *wm = CTX_wm_manager(C);
wmWindow *win;
bScreen *sc = (bScreen*)ptr->id.data;
ScrArea *sa = (ScrArea*)ptr->data;
bScreen *sc = (bScreen *)ptr->id.data;
ScrArea *sa = (ScrArea *)ptr->data;
/* XXX this call still use context, so we trick it to work in the right context */
for(win=wm->windows.first; win; win=win->next) {
if(sc == win->screen) {
for (win = wm->windows.first; win; win = win->next) {
if (sc == win->screen) {
wmWindow *prevwin = CTX_wm_window(C);
ScrArea *prevsa = CTX_wm_area(C);
ARegion *prevar = CTX_wm_region(C);
@@ -255,7 +256,7 @@ static void rna_def_screen(BlenderRNA *brna)
/* pointers */
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_ui_text(prop, "Scene", "Active scene to be edited in the screen");
RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
@@ -282,42 +283,42 @@ static void rna_def_screen(BlenderRNA *brna)
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_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);
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_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);
RNA_def_property_boolean_sdna(prop, NULL, "redraws_flag", TIME_ALL_ANIM_WIN);
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);
RNA_def_property_boolean_sdna(prop, NULL, "redraws_flag", TIME_ALL_BUTS_WIN);
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);
RNA_def_property_boolean_sdna(prop, NULL, "redraws_flag", TIME_ALL_IMAGE_WIN);
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);
RNA_def_property_boolean_sdna(prop, NULL, "redraws_flag", TIME_SEQ);
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);
RNA_def_property_boolean_sdna(prop, NULL, "redraws_flag", TIME_NODES);
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);
RNA_def_property_boolean_sdna(prop, NULL, "redraws_flag", TIME_CLIPS);
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");
}
void RNA_def_screen(BlenderRNA *brna)

View File

@@ -49,7 +49,8 @@ static EnumPropertyItem particle_edit_hair_brush_items[] = {
{PE_BRUSH_PUFF, "PUFF", 0, "Puff", "Make hairs stand up"},
{PE_BRUSH_CUT, "CUT", 0, "Cut", "Cut hairs"},
{PE_BRUSH_WEIGHT, "WEIGHT", 0, "Weight", "Weight hair particles"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
#ifdef RNA_RUNTIME
#include "MEM_guardedalloc.h"
@@ -68,18 +69,20 @@ static EnumPropertyItem particle_edit_disconnected_hair_brush_items[] = {
{PE_BRUSH_LENGTH, "LENGTH", 0, "Length", "Make hairs longer or shorter"},
{PE_BRUSH_CUT, "CUT", 0, "Cut", "Cut hairs"},
{PE_BRUSH_WEIGHT, "WEIGHT", 0, "Weight", "Weight hair particles"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem particle_edit_cache_brush_items[] = {
{PE_BRUSH_NONE, "NONE", 0, "None", "Don't use any brush"},
{PE_BRUSH_COMB, "COMB", 0, "Comb", "Comb paths"},
{PE_BRUSH_SMOOTH, "SMOOTH", 0, "Smooth", "Smooth paths"},
{PE_BRUSH_LENGTH, "LENGTH", 0, "Length", "Make paths longer or shorter"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static PointerRNA rna_ParticleEdit_brush_get(PointerRNA *ptr)
{
ParticleEditSettings *pset = (ParticleEditSettings*)ptr->data;
ParticleEditSettings *pset = (ParticleEditSettings *)ptr->data;
ParticleBrushData *brush = NULL;
if (pset->brushtype != PE_BRUSH_NONE)
@@ -95,7 +98,7 @@ static PointerRNA rna_ParticleBrush_curve_get(PointerRNA *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);
if (!edit)
@@ -106,20 +109,20 @@ static void rna_ParticleEdit_redo(Main *UNUSED(bmain), Scene *scene, PointerRNA
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);
}
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 */
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) {
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);
}
}
@@ -129,7 +132,7 @@ static EnumPropertyItem *rna_ParticleEdit_tool_itemf(bContext *C, PointerRNA *UN
PropertyRNA *UNUSED(prop), int *UNUSED(free))
{
Scene *scene = CTX_data_scene(C);
Object *ob = (scene->basact)? scene->basact->object: NULL;
Object *ob = (scene->basact) ? scene->basact->object : NULL;
#if 0
PTCacheEdit *edit = PE_get_current(scene, ob);
ParticleSystem *psys = edit ? edit->psys : NULL;
@@ -154,13 +157,13 @@ static EnumPropertyItem *rna_ParticleEdit_tool_itemf(bContext *C, PointerRNA *UN
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));
}
static int rna_ParticleEdit_hair_get(PointerRNA *ptr)
{
ParticleEditSettings *pset = (ParticleEditSettings*)ptr->data;
ParticleEditSettings *pset = (ParticleEditSettings *)ptr->data;
if (pset->scene) {
PTCacheEdit *edit = PE_get_current(pset->scene, pset->object);
@@ -195,11 +198,11 @@ static int rna_Brush_mode_poll(PointerRNA *ptr, PointerRNA value)
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) {
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);
}
}
@@ -218,7 +221,7 @@ static void rna_def_paint(BlenderRNA *brna)
RNA_def_property_flag(prop, PROP_EDITABLE);
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_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);
RNA_def_property_boolean_sdna(prop, NULL, "flags", PAINT_SHOW_BRUSH);
@@ -288,7 +291,7 @@ static void rna_def_sculpt(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Use Deform Only",
"Use only deformation modifiers (temporary disable all "
"constructive modifiers except multi-resolution)");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Sculpt_update");
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Sculpt_update");
}
@@ -381,7 +384,7 @@ static void rna_def_image_paint(BlenderRNA *brna)
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",
"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);
}
@@ -394,17 +397,20 @@ static void rna_def_particle_edit(BlenderRNA *brna)
{SCE_SELECT_PATH, "PATH", ICON_PARTICLE_PATH, "Path", "Path edit mode"},
{SCE_SELECT_POINT, "POINT", ICON_PARTICLE_POINT, "Point", "Point select mode"},
{SCE_SELECT_END, "TIP", ICON_PARTICLE_TIP, "Tip", "Tip select mode"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem puff_mode[] = {
{0, "ADD", 0, "Add", "Make hairs more puffy"},
{1, "SUB", 0, "Sub", "Make hairs less puffy"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem length_mode[] = {
{0, "GROW", 0, "Grow", "Make hairs longer"},
{1, "SHRINK", 0, "Shrink", "Make hairs shorter"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem edit_type_items[] = {
{PE_TYPE_PARTICLES, "PARTICLES", 0, "Particles", ""},
@@ -430,7 +436,7 @@ static void rna_def_particle_edit(BlenderRNA *brna)
RNA_def_property_enum_bitflag_sdna(prop, NULL, "selectmode");
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_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);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_KEEP_LENGTHS);
@@ -452,7 +458,7 @@ static void rna_def_particle_edit(BlenderRNA *brna)
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_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);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_AUTO_VELOCITY);
@@ -461,7 +467,7 @@ static void rna_def_particle_edit(BlenderRNA *brna)
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_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);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_INTERPOLATE_ADDED);
@@ -481,18 +487,18 @@ static void rna_def_particle_edit(BlenderRNA *brna)
prop = RNA_def_property(srna, "draw_step", PROP_INT, PROP_NONE);
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_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);
RNA_def_property_range(prop, 1, 100);
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);
RNA_def_property_enum_sdna(prop, NULL, "edittype");
RNA_def_property_enum_items(prop, edit_type_items);
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);
RNA_def_property_boolean_funcs(prop, "rna_ParticleEdit_editable_get", NULL);

View File

@@ -56,16 +56,17 @@ EnumPropertyItem sensor_type_items[] = {
{SENS_RANDOM, "RANDOM", 0, "Random", ""},
{SENS_RAY, "RAY", 0, "Ray", ""},
{SENS_TOUCH, "TOUCH", 0, "Touch", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
#ifdef RNA_RUNTIME
#include "BKE_sca.h"
#include "DNA_controller_types.h"
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) {
case SENS_ALWAYS:
@@ -214,7 +215,7 @@ static void rna_Sensor_keyboard_modifier2_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;
if (sens->tap == 1)
@@ -223,7 +224,7 @@ static void rna_Sensor_tap_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;
if (sens->level == 1)
@@ -404,7 +405,8 @@ static void rna_def_mouse_sensor(BlenderRNA *brna)
{BL_SENS_MOUSE_MOVEMENT, "MOVEMENT", 0, "Movement", ""},
{BL_SENS_MOUSE_MOUSEOVER, "MOUSEOVER", 0, "Mouse Over", ""},
{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");
RNA_def_struct_ui_text(srna, "Mouse Sensor", "Sensor to detect mouse events");
@@ -492,7 +494,8 @@ static void rna_def_property_sensor(BlenderRNA *brna)
{SENS_PROP_INTERVAL, "PROPINTERVAL", 0, "Interval", ""},
{SENS_PROP_CHANGED, "PROPCHANGED", 0, "Changed", ""},
/* {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");
RNA_def_struct_ui_text(srna, "Property Sensor", "Sensor to detect values and changes in values of properties");
@@ -535,7 +538,8 @@ static void rna_def_armature_sensor(BlenderRNA *brna)
{SENS_ARM_LIN_ERROR_ABOVE, "LINERRORABOVE", 0, "Lin error above", ""},
{SENS_ARM_ROT_ERROR_BELOW, "ROTERRORBELOW", 0, "Rot error below", ""},
{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");
RNA_def_struct_ui_text(srna, "Armature Sensor", "Sensor to detect values and changes in values of IK solver");
@@ -663,7 +667,8 @@ static void rna_def_radar_sensor(BlenderRNA *brna)
{SENS_RADAR_NEG_X_AXIS, "NEGXAXIS", 0, "-X axis", ""},
{SENS_RADAR_NEG_Y_AXIS, "NEGYAXIS", 0, "-Y 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");
RNA_def_struct_ui_text(srna, "Radar Sensor",
@@ -719,12 +724,14 @@ static void rna_def_ray_sensor(BlenderRNA *brna)
{SENS_RAY_NEG_X_AXIS, "NEGXAXIS", 0, "-X axis", ""},
{SENS_RAY_NEG_Y_AXIS, "NEGYAXIS", 0, "-Y 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[] = {
{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"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
srna = RNA_def_struct(brna, "RaySensor", "Sensor");
RNA_def_struct_ui_text(srna, "Ray Sensor",
@@ -801,14 +808,16 @@ static void rna_def_joystick_sensor(BlenderRNA *brna)
{SENS_JOY_AXIS, "AXIS", 0, "Axis", ""},
{SENS_JOY_HAT, "HAT", 0, "Hat", ""},
{SENS_JOY_AXIS_SINGLE, "AXIS_SINGLE", 0, "Single Axis", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem axis_direction_items[] = {
{SENS_JOY_X_AXIS, "RIGHTAXIS", 0, "Right Axis", ""},
{SENS_JOY_Y_AXIS, "UPAXIS", 0, "Up Axis", ""},
{SENS_JOY_NEG_X_AXIS, "LEFTAXIS", 0, "Left 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[] = {
{SENS_JOY_HAT_UP, "UP", 0, "Up", ""},
@@ -820,7 +829,8 @@ static void rna_def_joystick_sensor(BlenderRNA *brna)
{SENS_JOY_HAT_DOWN_LEFT, "DOWNLEFT", 0, "Down/Left", ""},
{SENS_JOY_HAT_UP_LEFT, "UPLEFT", 0, "Up/Left", ""},
{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");
RNA_def_struct_ui_text(srna, "Joystick Sensor", "Sensor to detect joystick events");
@@ -829,7 +839,7 @@ static void rna_def_joystick_sensor(BlenderRNA *brna)
prop = RNA_def_property(srna, "joystick_index", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "joyindex");
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);
prop = RNA_def_property(srna, "event_type", PROP_ENUM, PROP_NONE);

View File

@@ -561,14 +561,14 @@ static int rna_Sequence_input_count_get(PointerRNA *ptr)
#if 0
static void rna_SoundSequence_filename_set(PointerRNA *ptr, const char *value)
{
Sequence *seq= (Sequence*)(ptr->data);
Sequence *seq = (Sequence *)(ptr->data);
BLI_split_dirfile(value, seq->strip->dir, seq->strip->stripdata->name, sizeof(seq->strip->dir),
sizeof(seq->strip->stripdata->name));
}
static void rna_SequenceElement_filename_set(PointerRNA *ptr, const char *value)
{
StripElem *elem= (StripElem*)(ptr->data);
StripElem *elem = (StripElem *)(ptr->data);
BLI_split_file_part(value, elem->name, sizeof(elem->name));
}
#endif
@@ -953,15 +953,15 @@ static void rna_def_strip_color_balance(BlenderRNA *brna)
/* not yet used */
#if 0
prop= RNA_def_property(srna, "exposure", PROP_FLOAT, PROP_NONE);
prop = RNA_def_property(srna, "exposure", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Exposure", "");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
prop= RNA_def_property(srna, "saturation", PROP_FLOAT, PROP_NONE);
prop = RNA_def_property(srna, "saturation", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Saturation", "");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
#endif
}

View File

@@ -65,7 +65,7 @@ static void rna_Smoke_dependency_update(Main *bmain, Scene *scene, PointerRNA *p
static void rna_Smoke_reset(Main *bmain, Scene *scene, PointerRNA *ptr)
{
SmokeDomainSettings *settings = (SmokeDomainSettings*)ptr->data;
SmokeDomainSettings *settings = (SmokeDomainSettings *)ptr->data;
smokeModifier_reset(settings->smd);
@@ -77,7 +77,7 @@ static void rna_Smoke_reset(Main *bmain, Scene *scene, PointerRNA *ptr)
static void rna_Smoke_reset_dependancy(Main *bmain, Scene *scene, PointerRNA *ptr)
{
SmokeDomainSettings *settings = (SmokeDomainSettings*)ptr->data;
SmokeDomainSettings *settings = (SmokeDomainSettings *)ptr->data;
smokeModifier_reset(settings->smd);
@@ -89,7 +89,7 @@ static void rna_Smoke_reset_dependancy(Main *bmain, Scene *scene, PointerRNA *pt
static char *rna_SmokeDomainSettings_path(PointerRNA *ptr)
{
SmokeDomainSettings *settings = (SmokeDomainSettings*)ptr->data;
SmokeDomainSettings *settings = (SmokeDomainSettings *)ptr->data;
ModifierData *md = (ModifierData *)settings->smd;
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)
{
SmokeFlowSettings *settings = (SmokeFlowSettings*)ptr->data;
SmokeFlowSettings *settings = (SmokeFlowSettings *)ptr->data;
ModifierData *md = (ModifierData *)settings->smd;
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)
{
SmokeCollSettings *settings = (SmokeCollSettings*)ptr->data;
SmokeCollSettings *settings = (SmokeCollSettings *)ptr->data;
ModifierData *md = (ModifierData *)settings->smd;
return BLI_sprintfN("modifiers[\"%s\"].coll_settings", md->name);
@@ -119,24 +119,27 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna)
PropertyRNA *prop;
static EnumPropertyItem prop_noise_type_items[] = {
{MOD_SMOKE_NOISEWAVE, "NOISEWAVE", 0, "Wavelet", ""},
{MOD_SMOKE_NOISEWAVE, "NOISEWAVE", 0, "Wavelet", ""},
#ifdef WITH_FFTW3
{MOD_SMOKE_NOISEFFT, "NOISEFFT", 0, "FFT", ""},
{MOD_SMOKE_NOISEFFT, "NOISEFFT", 0, "FFT", ""},
#endif
/* {MOD_SMOKE_NOISECURL, "NOISECURL", 0, "Curl", ""}, */
{0, NULL, 0, NULL, NULL}};
/* {MOD_SMOKE_NOISECURL, "NOISECURL", 0, "Curl", ""}, */
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem smoke_cache_comp_items[] = {
{SM_CACHE_LIGHT, "CACHELIGHT", 0, "Light", "Fast but not so effective compression"},
{SM_CACHE_HEAVY, "CACHEHEAVY", 0, "Heavy", "Effective but slow compression"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem smoke_domain_colli_items[] = {
{SM_BORDER_OPEN, "BORDEROPEN", 0, "Open", "Smoke doesn't collide with any border"},
{SM_BORDER_VERTICAL, "BORDERVERTICAL", 0, "Vertically Open",
"Smoke doesn't collide with top and bottom sides"},
"Smoke doesn't collide with top and bottom sides"},
{SM_BORDER_CLOSED, "BORDERCLOSED", 0, "Collide All", "Smoke collides with every side"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
srna = RNA_def_struct(brna, "SmokeDomainSettings", NULL);
RNA_def_struct_ui_text(srna, "Domain Settings", "Smoke domain settings");
@@ -149,7 +152,7 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna)
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_clear_flag(prop, PROP_ANIMATABLE);
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);
RNA_def_property_int_sdna(prop, NULL, "amplify");
@@ -157,25 +160,25 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna)
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_clear_flag(prop, PROP_ANIMATABLE);
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);
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_clear_flag(prop, PROP_ANIMATABLE);
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);
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_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);
RNA_def_property_enum_sdna(prop, NULL, "noise");
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_clear_flag(prop, PROP_ANIMATABLE);
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);
RNA_def_property_float_sdna(prop, NULL, "alpha");
@@ -183,7 +186,7 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna)
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_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);
RNA_def_property_float_sdna(prop, NULL, "beta");
@@ -191,52 +194,52 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna)
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_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);
RNA_def_property_pointer_sdna(prop, NULL, "coll_group");
RNA_def_property_struct_type(prop, "Group");
RNA_def_property_flag(prop, PROP_EDITABLE);
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);
RNA_def_property_pointer_sdna(prop, NULL, "fluid_group");
RNA_def_property_struct_type(prop, "Group");
RNA_def_property_flag(prop, PROP_EDITABLE);
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);
RNA_def_property_pointer_sdna(prop, NULL, "eff_group");
RNA_def_property_struct_type(prop, "Group");
RNA_def_property_flag(prop, PROP_EDITABLE);
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);
RNA_def_property_float_sdna(prop, NULL, "strength");
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_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);
RNA_def_property_int_sdna(prop, NULL, "diss_speed");
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_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);
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_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);
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_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);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
@@ -253,7 +256,7 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna)
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_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);
RNA_def_property_struct_type(prop, "EffectorWeights");
@@ -263,21 +266,21 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna)
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_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);
RNA_def_property_float_sdna(prop, NULL, "time_scale");
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_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);
RNA_def_property_float_sdna(prop, NULL, "vorticity");
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_text(prop, "Vorticity", "Amount of turbulence/rotation in fluid");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset");
}
@@ -296,14 +299,14 @@ static void rna_def_smoke_flow_settings(BlenderRNA *brna)
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_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);
RNA_def_property_float_sdna(prop, NULL, "temp");
RNA_def_property_range(prop, -10, 10);
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_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);
RNA_def_property_pointer_sdna(prop, NULL, "psys");
@@ -315,24 +318,24 @@ static void rna_def_smoke_flow_settings(BlenderRNA *brna)
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_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);
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_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);
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_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);
RNA_def_property_float_sdna(prop, NULL, "vel_multi");
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_text(prop, "Multiplier", "Multiplier to adjust velocity passed to 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");
}
static void rna_def_smoke_coll_settings(BlenderRNA *brna)
@@ -341,7 +344,8 @@ static void rna_def_smoke_coll_settings(BlenderRNA *brna)
{SM_COLL_STATIC, "COLLSTATIC", 0, "Static", "Non moving obstacle"},
{SM_COLL_RIGID, "COLLRIGID", 0, "Rigid", "Rigid obstacle"},
{SM_COLL_ANIMATED, "COLLANIMATED", 0, "Animated", "Animated obstacle"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
StructRNA *srna;
PropertyRNA *prop;
@@ -355,7 +359,7 @@ static void rna_def_smoke_coll_settings(BlenderRNA *brna)
RNA_def_property_enum_sdna(prop, NULL, "type");
RNA_def_property_enum_items(prop, smoke_coll_type_items);
RNA_def_property_ui_text(prop, "Collision type", "Collision type");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset");
}
void RNA_def_smoke(BlenderRNA *brna)

View File

@@ -41,18 +41,18 @@
static void rna_Sound_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
{
sound_load(bmain, (bSound*)ptr->data);
sound_load(bmain, (bSound *)ptr->data);
}
static int rna_Sound_caching_get(PointerRNA *ptr)
{
bSound *sound = (bSound*)(ptr->data);
bSound *sound = (bSound *)(ptr->data);
return (sound->flags & SOUND_FLAGS_CACHING) != 0;
}
static void rna_Sound_caching_set(PointerRNA *ptr, const int value)
{
bSound *sound = (bSound*)(ptr->data);
bSound *sound = (bSound *)(ptr->data);
if (value)
sound_cache(sound);
else
@@ -61,7 +61,7 @@ static void rna_Sound_caching_set(PointerRNA *ptr, const int value)
static void rna_Sound_caching_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
{
sound_update_sequencer(bmain, (bSound*)(ptr->data));
sound_update_sequencer(bmain, (bSound *)(ptr->data));
}
#else

File diff suppressed because it is too large Load Diff

View File

@@ -46,7 +46,7 @@ int text_file_modified(Text *text); /* XXX bad level call */
static void rna_Text_filename_get(PointerRNA *ptr, char *value)
{
Text *text = (Text*)ptr->data;
Text *text = (Text *)ptr->data;
if (text->name)
strcpy(value, text->name);
@@ -56,13 +56,13 @@ static void rna_Text_filename_get(PointerRNA *ptr, char *value)
static int rna_Text_filename_length(PointerRNA *ptr)
{
Text *text = (Text*)ptr->data;
return (text->name)? strlen(text->name): 0;
Text *text = (Text *)ptr->data;
return (text->name) ? strlen(text->name) : 0;
}
static void rna_Text_filename_set(PointerRNA *ptr, const char *value)
{
Text *text = (Text*)ptr->data;
Text *text = (Text *)ptr->data;
if (text->name)
MEM_freeN(text->name);
@@ -75,13 +75,13 @@ static void rna_Text_filename_set(PointerRNA *ptr, const char *value)
static int rna_Text_modified_get(PointerRNA *ptr)
{
Text *text = (Text*)ptr->data;
Text *text = (Text *)ptr->data;
return text_file_modified(text);
}
static void rna_TextLine_body_get(PointerRNA *ptr, char *value)
{
TextLine *line = (TextLine*)ptr->data;
TextLine *line = (TextLine *)ptr->data;
if (line->line)
strcpy(value, line->line);
@@ -91,13 +91,13 @@ static void rna_TextLine_body_get(PointerRNA *ptr, char *value)
static int rna_TextLine_body_length(PointerRNA *ptr)
{
TextLine *line = (TextLine*)ptr->data;
TextLine *line = (TextLine *)ptr->data;
return line->len;
}
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);
if (line->line)
@@ -126,7 +126,7 @@ static void rna_def_text_line(BlenderRNA *brna)
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_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);
}
static void rna_def_text_marker(BlenderRNA *brna)

View File

@@ -38,13 +38,13 @@
static void rna_Text_clear(Text *text)
{
BKE_text_clear(text);
WM_main_add_notifier(NC_TEXT|NA_EDITED, text);
WM_main_add_notifier(NC_TEXT | NA_EDITED, text);
}
static void rna_Text_write(Text *text, const char *str)
{
BKE_text_write(text, str);
WM_main_add_notifier(NC_TEXT|NA_EDITED, text);
WM_main_add_notifier(NC_TEXT | NA_EDITED, text);
}
#else

View File

@@ -51,7 +51,8 @@ EnumPropertyItem texture_filter_items[] = {
{TXF_EWA, "EWA", 0, "EWA", ""},
{TXF_FELINE, "FELINE", 0, "FELINE", ""},
{TXF_AREA, "AREA", 0, "Area", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
EnumPropertyItem texture_type_items[] = {
{0, "NONE", 0, "None", ""},
@@ -74,7 +75,8 @@ EnumPropertyItem texture_type_items[] = {
{TEX_VOXELDATA, "VOXEL_DATA", ICON_TEXTURE, "Voxel Data", "Create a 3d texture based on volumetric data"},
{TEX_WOOD, "WOOD", ICON_TEXTURE, "Wood", "Procedural - wave generated bands or rings, with optional noise"},
{TEX_OCEAN, "OCEAN", ICON_TEXTURE, "Ocean", "Use a texture generated by an Ocean modifier"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
EnumPropertyItem blend_type_items[] = {
{MTEX_BLEND, "MIX", 0, "Mix", ""},
@@ -93,7 +95,8 @@ EnumPropertyItem blend_type_items[] = {
{MTEX_BLEND_COLOR, "COLOR", 0, "Color", ""},
{MTEX_SOFT_LIGHT, "SOFT_LIGHT", 0, "Soft Light", ""},
{MTEX_LIN_LIGHT, "LINEAR_LIGHT", 0, "Linear Light", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
#ifdef RNA_RUNTIME
@@ -113,7 +116,7 @@ EnumPropertyItem blend_type_items[] = {
static StructRNA *rna_Texture_refine(struct PointerRNA *ptr)
{
Tex *tex = (Tex*)ptr->data;
Tex *tex = (Tex *)ptr->data;
switch (tex->type) {
case TEX_BLEND:
@@ -160,7 +163,7 @@ static void rna_Texture_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *pt
DAG_id_tag_update(&tex->id, 0);
WM_main_add_notifier(NC_TEXTURE, tex);
WM_main_add_notifier(NC_MATERIAL|ND_SHADING_DRAW, NULL);
WM_main_add_notifier(NC_MATERIAL | ND_SHADING_DRAW, NULL);
}
else if (GS(id->name) == ID_NT) {
bNodeTree *ntree = ptr->id.data;
@@ -205,12 +208,12 @@ static void rna_Texture_nodes_update(Main *UNUSED(bmain), Scene *UNUSED(scene),
Tex *tex = ptr->id.data;
DAG_id_tag_update(&tex->id, 0);
WM_main_add_notifier(NC_TEXTURE|ND_NODES, tex);
WM_main_add_notifier(NC_TEXTURE | ND_NODES, tex);
}
static void rna_Texture_type_set(PointerRNA *ptr, int value)
{
Tex *tex = (Tex*)ptr->data;
Tex *tex = (Tex *)ptr->data;
tex_set_type(tex, value);
}
@@ -223,14 +226,14 @@ void rna_TextureSlot_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRN
switch (GS(id->name)) {
case ID_MA:
WM_main_add_notifier(NC_MATERIAL|ND_SHADING, id);
WM_main_add_notifier(NC_MATERIAL|ND_SHADING_DRAW, id);
WM_main_add_notifier(NC_MATERIAL | ND_SHADING, id);
WM_main_add_notifier(NC_MATERIAL | ND_SHADING_DRAW, id);
break;
case ID_WO:
WM_main_add_notifier(NC_WORLD, id);
break;
case ID_LA:
WM_main_add_notifier(NC_LAMP|ND_LIGHTING, id);
WM_main_add_notifier(NC_LAMP | ND_LIGHTING, id);
break;
case ID_BR:
WM_main_add_notifier(NC_BRUSH, id);
@@ -246,7 +249,7 @@ void rna_TextureSlot_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRN
recalc |= PSYS_RECALC_CHILD;
DAG_id_tag_update(id, recalc);
WM_main_add_notifier(NC_OBJECT|ND_PARTICLE|NA_EDITED, NULL);
WM_main_add_notifier(NC_OBJECT | ND_PARTICLE | NA_EDITED, NULL);
break;
}
}
@@ -279,7 +282,7 @@ char *rna_TextureSlot_path(PointerRNA *ptr)
/* this is a compromise for the remaining cases... */
if (mtex->tex)
return BLI_sprintfN("texture_slots[\"%s\"]", mtex->tex->id.name+2);
return BLI_sprintfN("texture_slots[\"%s\"]", mtex->tex->id.name + 2);
else
return BLI_strdup("texture_slots[0]");
}
@@ -289,7 +292,7 @@ static int rna_TextureSlot_name_length(PointerRNA *ptr)
MTex *mtex = ptr->data;
if (mtex->tex)
return strlen(mtex->tex->id.name+2);
return strlen(mtex->tex->id.name + 2);
return 0;
}
@@ -299,7 +302,7 @@ static void rna_TextureSlot_name_get(PointerRNA *ptr, char *str)
MTex *mtex = ptr->data;
if (mtex->tex)
strcpy(str, mtex->tex->id.name+2);
strcpy(str, mtex->tex->id.name + 2);
else
str[0] = '\0';
}
@@ -350,7 +353,7 @@ static EnumPropertyItem *rna_TextureSlot_output_node_itemf(bContext *C, PointerR
for (node = ntree->nodes.first; node; node = node->next) {
if (node->type == TEX_NODE_OUTPUT) {
tmp.value = node->custom1;
tmp.name = ((TexNodeOutput*)node->storage)->name;
tmp.name = ((TexNodeOutput *)node->storage)->name;
tmp.identifier = tmp.name;
RNA_enum_item_add(&item, &totitem, &tmp);
}
@@ -366,7 +369,7 @@ static EnumPropertyItem *rna_TextureSlot_output_node_itemf(bContext *C, PointerR
static void rna_Texture_use_color_ramp_set(PointerRNA *ptr, int value)
{
Tex *tex = (Tex*)ptr->data;
Tex *tex = (Tex *)ptr->data;
if (value) tex->flag |= TEX_COLORBAND;
else tex->flag &= ~TEX_COLORBAND;
@@ -377,7 +380,7 @@ static void rna_Texture_use_color_ramp_set(PointerRNA *ptr, int value)
static void rna_Texture_use_nodes_set(PointerRNA *ptr, int v)
{
Tex *tex = (Tex*)ptr->data;
Tex *tex = (Tex *)ptr->data;
tex->use_nodes = v;
tex->type = 0;
@@ -388,7 +391,7 @@ static void rna_Texture_use_nodes_set(PointerRNA *ptr, int v)
static void rna_ImageTexture_mipmap_set(PointerRNA *ptr, int value)
{
Tex *tex = (Tex*)ptr->data;
Tex *tex = (Tex *)ptr->data;
if (value) tex->imaflag |= TEX_MIPMAP;
else tex->imaflag &= ~TEX_MIPMAP;
@@ -412,7 +415,7 @@ static PointerRNA rna_PointDensity_psys_get(PointerRNA *ptr)
PointerRNA value;
if (ob && pd->psys)
psys = BLI_findlink(&ob->particlesystem, pd->psys-1);
psys = BLI_findlink(&ob->particlesystem, pd->psys - 1);
RNA_pointer_create(&ob->id, &RNA_ParticleSystem, psys, &value);
return value;
@@ -451,14 +454,16 @@ static void rna_def_texmapping(BlenderRNA *brna)
{MTEX_CUBE, "CUBE", 0, "Cube", "Map using the normal vector"},
{MTEX_TUBE, "TUBE", 0, "Tube", "Map with Z as central axis"},
{MTEX_SPHERE, "SPHERE", 0, "Sphere", "Map with Z as central axis"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem prop_xyz_mapping_items[] = {
{0, "NONE", 0, "None", ""},
{1, "X", 0, "X", ""},
{2, "Y", 0, "Y", ""},
{3, "Z", 0, "Z", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
StructRNA *srna;
PropertyRNA *prop;
@@ -472,7 +477,7 @@ static void rna_def_texmapping(BlenderRNA *brna)
RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, RNA_TRANSLATION_PREC_DEFAULT);
RNA_def_property_update(prop, 0, "rna_Texture_mapping_update");
/* Not PROP_XYZ, this is now in radians, no more degrees */
/* Not PROP_XYZ, this is now in radians, no more degrees */
prop = RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_EULER);
RNA_def_property_float_sdna(prop, NULL, "rot");
RNA_def_property_ui_text(prop, "Rotation", "");
@@ -584,7 +589,8 @@ static void rna_def_mtex(BlenderRNA *brna)
static EnumPropertyItem output_node_items[] = {
{0, "DUMMY", 0, "Dummy", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
srna = RNA_def_struct(brna, "TextureSlot", NULL);
RNA_def_struct_sdna(srna, "MTex");
@@ -721,12 +727,14 @@ static void rna_def_environment_map(BlenderRNA *brna)
{ENV_STATIC, "STATIC", 0, "Static", "Calculate environment map only once"},
{ENV_ANIM, "ANIMATED", 0, "Animated", "Calculate environment map at each rendering"},
{ENV_LOAD, "IMAGE_FILE", 0, "Image File", "Load a saved environment map image from disk"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem prop_mapping_items[] = {
{ENV_CUBE, "CUBE", 0, "Cube", "Use environment map with six cube sides"},
{ENV_PLANE, "PLANE", 0, "Plane", "Only one side is rendered, with Z axis pointing in direction of image"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
srna = RNA_def_struct(brna, "EnvironmentMap", NULL);
RNA_def_struct_sdna(srna, "EnvMap");
@@ -818,12 +826,14 @@ static EnumPropertyItem prop_noise_basis_items[] = {
"Noise algorithm - Voronoi Crackle: Voronoi tessellation with sharp edges"},
{TEX_CELLNOISE, "CELL_NOISE", 0, "Cell Noise",
"Noise algorithm - Cell Noise: Square cell tessellation"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem prop_noise_type[] = {
{TEX_NOISESOFT, "SOFT_NOISE", 0, "Soft", "Generate soft noise (smooth transitions)"},
{TEX_NOISEPERL, "HARD_NOISE", 0, "Hard", "Generate hard noise (sharp transitions)"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static void rna_def_texture_clouds(BlenderRNA *brna)
@@ -832,9 +842,10 @@ static void rna_def_texture_clouds(BlenderRNA *brna)
PropertyRNA *prop;
static EnumPropertyItem prop_clouds_stype[] = {
{TEX_DEFAULT, "GREYSCALE", 0, "Greyscale", ""},
{TEX_COLOR, "COLOR", 0, "Color", ""},
{0, NULL, 0, NULL, NULL}};
{TEX_DEFAULT, "GREYSCALE", 0, "Greyscale", ""},
{TEX_COLOR, "COLOR", 0, "Color", ""},
{0, NULL, 0, NULL, NULL}
};
srna = RNA_def_struct(brna, "CloudsTexture", "Texture");
RNA_def_struct_ui_text(srna, "Clouds Texture", "Procedural noise texture");
@@ -885,17 +896,19 @@ static void rna_def_texture_wood(BlenderRNA *brna)
PropertyRNA *prop;
static EnumPropertyItem prop_wood_stype[] = {
{TEX_BAND, "BANDS", 0, "Bands", "Use standard wood texture in bands"},
{TEX_RING, "RINGS", 0, "Rings", "Use wood texture in rings"},
{TEX_BANDNOISE, "BANDNOISE", 0, "Band Noise", "Add noise to standard wood"},
{TEX_RINGNOISE, "RINGNOISE", 0, "Ring Noise", "Add noise to rings"},
{0, NULL, 0, NULL, NULL}};
{TEX_BAND, "BANDS", 0, "Bands", "Use standard wood texture in bands"},
{TEX_RING, "RINGS", 0, "Rings", "Use wood texture in rings"},
{TEX_BANDNOISE, "BANDNOISE", 0, "Band Noise", "Add noise to standard wood"},
{TEX_RINGNOISE, "RINGNOISE", 0, "Ring Noise", "Add noise to rings"},
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem prop_wood_noisebasis2[] = {
{TEX_SIN, "SIN", 0, "Sine", "Use a sine wave to produce bands"},
{TEX_SAW, "SAW", 0, "Saw", "Use a saw wave to produce bands"},
{TEX_TRI, "TRI", 0, "Tri", "Use a triangle wave to produce bands"},
{0, NULL, 0, NULL, NULL}};
{TEX_SIN, "SIN", 0, "Sine", "Use a sine wave to produce bands"},
{TEX_SAW, "SAW", 0, "Saw", "Use a saw wave to produce bands"},
{TEX_TRI, "TRI", 0, "Tri", "Use a triangle wave to produce bands"},
{0, NULL, 0, NULL, NULL}
};
srna = RNA_def_struct(brna, "WoodTexture", "Texture");
RNA_def_struct_ui_text(srna, "Wood Texture", "Procedural noise texture");
@@ -953,16 +966,18 @@ static void rna_def_texture_marble(BlenderRNA *brna)
PropertyRNA *prop;
static EnumPropertyItem prop_marble_stype[] = {
{TEX_SOFT, "SOFT", 0, "Soft", "Use soft marble"},
{TEX_SHARP, "SHARP", 0, "Sharp", "Use more clearly defined marble"},
{TEX_SHARPER, "SHARPER", 0, "Sharper", "Use very clearly defined marble"},
{0, NULL, 0, NULL, NULL}};
{TEX_SOFT, "SOFT", 0, "Soft", "Use soft marble"},
{TEX_SHARP, "SHARP", 0, "Sharp", "Use more clearly defined marble"},
{TEX_SHARPER, "SHARPER", 0, "Sharper", "Use very clearly defined marble"},
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem prop_marble_noisebasis2[] = {
{TEX_SIN, "SIN", 0, "Sin", "Use a sine wave to produce bands"},
{TEX_SAW, "SAW", 0, "Saw", "Use a saw wave to produce bands"},
{TEX_TRI, "TRI", 0, "Tri", "Use a triangle wave to produce bands"},
{0, NULL, 0, NULL, NULL}};
{TEX_SIN, "SIN", 0, "Sin", "Use a sine wave to produce bands"},
{TEX_SAW, "SAW", 0, "Saw", "Use a saw wave to produce bands"},
{TEX_TRI, "TRI", 0, "Tri", "Use a triangle wave to produce bands"},
{0, NULL, 0, NULL, NULL}
};
srna = RNA_def_struct(brna, "MarbleTexture", "Texture");
RNA_def_struct_ui_text(srna, "Marble Texture", "Procedural noise texture");
@@ -1059,12 +1074,14 @@ static void rna_def_texture_blend(BlenderRNA *brna)
{TEX_HALO, "QUADRATIC_SPHERE", 0, "Quadratic sphere",
"Create a quadratic progression in the shape of a sphere"},
{TEX_RAD, "RADIAL", 0, "Radial", "Create a radial progression"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static const EnumPropertyItem prop_flip_axis_items[] = {
{0, "HORIZONTAL", 0, "Horizontal", "No flipping"},
{TEX_FLIPBLEND, "VERTICAL", 0, "Vertical", "Flip the texture's X and Y axis"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
srna = RNA_def_struct(brna, "BlendTexture", "Texture");
RNA_def_struct_ui_text(srna, "Blend Texture", "Procedural color blending texture");
@@ -1090,10 +1107,11 @@ static void rna_def_texture_stucci(BlenderRNA *brna)
PropertyRNA *prop;
static EnumPropertyItem prop_stucci_stype[] = {
{TEX_PLASTIC, "PLASTIC", 0, "Plastic", "Use standard stucci"},
{TEX_WALLIN, "WALL_IN", 0, "Wall in", "Create Dimples"},
{TEX_WALLOUT, "WALL_OUT", 0, "Wall out", "Create Ridges"},
{0, NULL, 0, NULL, NULL}};
{TEX_PLASTIC, "PLASTIC", 0, "Plastic", "Use standard stucci"},
{TEX_WALLIN, "WALL_IN", 0, "Wall in", "Create Dimples"},
{TEX_WALLOUT, "WALL_OUT", 0, "Wall out", "Create Ridges"},
{0, NULL, 0, NULL, NULL}
};
srna = RNA_def_struct(brna, "StucciTexture", "Texture");
RNA_def_struct_ui_text(srna, "Stucci Texture", "Procedural noise texture");
@@ -1153,7 +1171,8 @@ static void rna_def_texture_image(BlenderRNA *brna)
"Clip to cubic-shaped area around the image and set exterior pixels as transparent"},
{TEX_REPEAT, "REPEAT", 0, "Repeat", "Cause the image to repeat horizontally and vertically"},
{TEX_CHECKER, "CHECKER", 0, "Checker", "Cause the image to repeat in checker board pattern"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
srna = RNA_def_struct(brna, "ImageTexture", "Texture");
RNA_def_struct_ui_text(srna, "Image Texture", "");
@@ -1344,7 +1363,8 @@ static void rna_def_texture_musgrave(BlenderRNA *brna)
"Use Perlin noise as a basis, with extended controls"},
{TEX_FBM, "FBM", 0, "fBM", "Fractal Brownian Motion, use Brownian noise as a basis"},
{TEX_HTERRAIN, "HETERO_TERRAIN", 0, "Hetero Terrain", "Similar to multifractal"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
srna = RNA_def_struct(brna, "MusgraveTexture", "Texture");
RNA_def_struct_ui_text(srna, "Musgrave", "Procedural musgrave texture");
@@ -1431,7 +1451,8 @@ static void rna_def_texture_voronoi(BlenderRNA *brna)
{TEX_MINKOVSKY, "MINKOVSKY", 0, "Minkovsky",
"Use the Minkowsky function to calculate distance "
"(exponent value determines the shape of the boundaries)"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem prop_coloring_items[] = {
/* XXX: OK names / descriptions? */
@@ -1440,7 +1461,8 @@ static void rna_def_texture_voronoi(BlenderRNA *brna)
{TEX_COL2, "POSITION_OUTLINE", 0, "Position and Outline", "Use position plus an outline based on F2-F1"},
{TEX_COL3, "POSITION_OUTLINE_INTENSITY", 0, "Position, Outline, and Intensity",
"Multiply position and outline by intensity"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
srna = RNA_def_struct(brna, "VoronoiTexture", "Texture");
RNA_def_struct_ui_text(srna, "Voronoi", "Procedural voronoi texture");
@@ -1559,19 +1581,22 @@ static void rna_def_texture_pointdensity(BlenderRNA *brna)
{TEX_PD_PSYS, "PARTICLE_SYSTEM", 0, "Particle System", "Generate point density from a particle system"},
{TEX_PD_OBJECT, "OBJECT", 0, "Object Vertices", "Generate point density from an object's vertices"},
/*{TEX_PD_FILE, "FILE", 0, "File", ""}, */
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem particle_cache_items[] = {
{TEX_PD_OBJECTLOC, "OBJECT_LOCATION", 0, "Emit Object Location", ""},
{TEX_PD_OBJECTSPACE, "OBJECT_SPACE", 0, "Emit Object Space", ""},
{TEX_PD_WORLDSPACE, "WORLD_SPACE", 0, "Global Space", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem vertice_cache_items[] = {
{TEX_PD_OBJECTLOC, "OBJECT_LOCATION", 0, "Object Location", ""},
{TEX_PD_OBJECTSPACE, "OBJECT_SPACE", 0, "Object Space", ""},
{TEX_PD_WORLDSPACE, "WORLD_SPACE", 0, "Global Space", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem falloff_items[] = {
{TEX_PD_FALLOFF_STD, "STANDARD", 0, "Standard", ""},
@@ -1581,7 +1606,8 @@ static void rna_def_texture_pointdensity(BlenderRNA *brna)
{TEX_PD_FALLOFF_ROOT, "ROOT", 0, "Root", ""},
{TEX_PD_FALLOFF_PARTICLE_AGE, "PARTICLE_AGE", 0, "Particle Age", ""},
{TEX_PD_FALLOFF_PARTICLE_VEL, "PARTICLE_VELOCITY", 0, "Particle Velocity", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem color_source_items[] = {
{TEX_PD_COLOR_CONSTANT, "CONSTANT", 0, "Constant", ""},
@@ -1589,7 +1615,8 @@ static void rna_def_texture_pointdensity(BlenderRNA *brna)
{TEX_PD_COLOR_PARTSPEED, "PARTICLE_SPEED", 0, "Particle Speed",
"Particle speed (absolute magnitude of velocity) mapped as 0.0-1.0 intensity"},
{TEX_PD_COLOR_PARTVEL, "PARTICLE_VELOCITY", 0, "Particle Velocity", "XYZ velocity mapped to RGB colors"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem turbulence_influence_items[] = {
{TEX_PD_NOISE_STATIC, "STATIC", 0, "Static",
@@ -1599,7 +1626,8 @@ static void rna_def_texture_pointdensity(BlenderRNA *brna)
{TEX_PD_NOISE_AGE, "PARTICLE_AGE", 0, "Particle Age",
"Turbulent noise driven by the particle's age between birth and death"},
{TEX_PD_NOISE_TIME, "GLOBAL_TIME", 0, "Global Time", "Turbulent noise driven by the global current frame"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
srna = RNA_def_struct(brna, "PointDensity", NULL);
RNA_def_struct_sdna(srna, "PointDensity");
@@ -1751,7 +1779,8 @@ static void rna_def_texture_voxeldata(BlenderRNA *brna)
{TEX_VD_TRICUBIC_CATROM, "TRICUBIC_CATROM", 0, "Cubic Catmull-Rom", "High quality interpolation, but slower"},
{TEX_VD_TRICUBIC_BSPLINE, "TRICUBIC_BSPLINE", 0, "Cubic B-Spline",
"Smoothed high quality interpolation, but slower"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem file_format_items[] = {
{TEX_VD_BLENDERVOXEL, "BLENDER_VOXEL", 0, "Blender Voxel", "Default binary voxel file format"},
@@ -1760,19 +1789,22 @@ static void rna_def_texture_voxeldata(BlenderRNA *brna)
{TEX_VD_IMAGE_SEQUENCE, "IMAGE_SEQUENCE", 0, "Image Sequence",
"Generate voxels from a sequence of image slices"},
{TEX_VD_SMOKE, "SMOKE", 0, "Smoke", "Render voxels from a Blender smoke simulation"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem voxeldata_extension[] = {
{TEX_EXTEND, "EXTEND", 0, "Extend", "Extend by repeating edge pixels of the image"},
{TEX_CLIP, "CLIP", 0, "Clip", "Clip to image size and set exterior pixels as transparent"},
{TEX_REPEAT, "REPEAT", 0, "Repeat", "Cause the image to repeat horizontally and vertically"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem smoked_type_items[] = {
{TEX_VD_SMOKEDENSITY, "SMOKEDENSITY", 0, "Density", "Use smoke density as texture data"},
{TEX_VD_SMOKEHEAT, "SMOKEHEAT", 0, "Heat", "Use smoke heat as texture data. Values from -2.0 to 2.0 are used"},
{TEX_VD_SMOKEVEL, "SMOKEVEL", 0, "Velocity", "Use smoke velocity as texture data"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
srna = RNA_def_struct(brna, "VoxelData", NULL);
RNA_def_struct_sdna(srna, "VoxelData");
@@ -1874,7 +1906,8 @@ static void rna_def_texture_ocean(BlenderRNA *brna)
{TEX_OCN_JPLUS, "JPLUS", 0, "Eigenvalues", "Positive Eigenvalues"},
{TEX_OCN_EMINUS, "EMINUS", 0, "Eigenvectors (-)", "Negative Eigenvectors"},
{TEX_OCN_EPLUS, "EPLUS", 0, "Eigenvectors (+)", "Positive Eigenvectors"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
srna = RNA_def_struct(brna, "OceanTexData", NULL);
RNA_def_struct_sdna(srna, "OceanTex");

View File

@@ -43,7 +43,7 @@
#include "RE_pipeline.h"
#include "RE_shader_ext.h"
void save_envmap(struct EnvMap *env, bContext *C, ReportList *reports, const char* filepath,
void save_envmap(struct EnvMap *env, bContext *C, ReportList *reports, const char *filepath,
struct Scene *scene, float layout[12])
{
if (scene == NULL) {
@@ -62,7 +62,7 @@ void clear_envmap(struct EnvMap *env, bContext *C)
for (tex = bmain->tex.first; tex; tex = tex->id.next)
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;
}
}
@@ -112,7 +112,7 @@ void RNA_api_environment_map(StructRNA *srna)
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_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");
RNA_def_property_flag(parm, PROP_REQUIRED);

View File

@@ -41,8 +41,8 @@
static void rna_TimelineMarker_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *UNUSED(ptr))
{
WM_main_add_notifier(NC_SCENE|ND_MARKERS, NULL);
WM_main_add_notifier(NC_ANIMATION|ND_MARKERS, NULL);
WM_main_add_notifier(NC_SCENE | ND_MARKERS, NULL);
WM_main_add_notifier(NC_ANIMATION | ND_MARKERS, NULL);
}
#else
@@ -74,7 +74,7 @@ static void rna_def_timeline_marker(BlenderRNA *brna)
#ifdef DURIAN_CAMERA_SWITCH
prop = RNA_def_property(srna, "camera", PROP_POINTER, PROP_NONE);
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");
#endif
}

View File

@@ -52,7 +52,8 @@ EnumPropertyItem operator_context_items[] = {
{WM_OP_EXEC_REGION_PREVIEW, "EXEC_REGION_PREVIEW", 0, "Exec Region Preview", ""},
{WM_OP_EXEC_AREA, "EXEC_AREA", 0, "Exec Area", ""},
{WM_OP_EXEC_SCREEN, "EXEC_SCREEN", 0, "Exec Screen", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
#ifdef RNA_RUNTIME
@@ -77,7 +78,7 @@ static ARegionType *region_type_find(ReportList *reports, int space_type, int re
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)
break;
}
@@ -111,7 +112,7 @@ static int panel_poll(const bContext *C, PanelType *pt)
pt->ext.call((bContext *)C, &ptr, func, &list);
RNA_parameter_get_lookup(&list, "visible", &ret);
visible = *(int*)ret;
visible = *(int *)ret;
RNA_parameter_list_free(&list);
@@ -127,7 +128,7 @@ static void panel_draw(const bContext *C, Panel *pnl)
FunctionRNA *func;
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_set_lookup(&list, "context", &C);
@@ -170,7 +171,7 @@ static void rna_Panel_unregister(Main *UNUSED(bmain), StructRNA *type)
RNA_struct_free(&BLENDER_RNA, type);
/* update while blender is running */
WM_main_add_notifier(NC_SCREEN|NA_EDITED, NULL);
WM_main_add_notifier(NC_SCREEN | NA_EDITED, NULL);
}
static StructRNA *rna_Panel_register(Main *bmain, ReportList *reports, void *data, const char *identifier,
@@ -221,9 +222,9 @@ static StructRNA *rna_Panel_register(Main *bmain, ReportList *reports, void *dat
RNA_struct_blender_type_set(pt->ext.srna, pt);
RNA_def_struct_flag(pt->ext.srna, STRUCT_NO_IDPROPERTIES);
pt->poll = (have_function[0])? panel_poll: NULL;
pt->draw = (have_function[1])? panel_draw: NULL;
pt->draw_header = (have_function[2])? panel_draw_header: NULL;
pt->poll = (have_function[0]) ? panel_poll : NULL;
pt->draw = (have_function[1]) ? panel_draw : 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 */
if (pt->flag & PNL_NO_HEADER) {
@@ -240,15 +241,15 @@ static StructRNA *rna_Panel_register(Main *bmain, ReportList *reports, void *dat
BLI_addtail(&art->paneltypes, pt);
/* update while blender is running */
WM_main_add_notifier(NC_SCREEN|NA_EDITED, NULL);
WM_main_add_notifier(NC_SCREEN | NA_EDITED, NULL);
return pt->ext.srna;
}
static StructRNA* rna_Panel_refine(PointerRNA *ptr)
static StructRNA *rna_Panel_refine(PointerRNA *ptr)
{
Panel *hdr = (Panel*)ptr->data;
return (hdr->type && hdr->type->ext.srna)? hdr->type->ext.srna: &RNA_Panel;
Panel *hdr = (Panel *)ptr->data;
return (hdr->type && hdr->type->ext.srna) ? hdr->type->ext.srna : &RNA_Panel;
}
/* Header */
@@ -287,7 +288,7 @@ static void rna_Header_unregister(Main *UNUSED(bmain), StructRNA *type)
RNA_struct_free(&BLENDER_RNA, type);
/* update while blender is running */
WM_main_add_notifier(NC_SCREEN|NA_EDITED, NULL);
WM_main_add_notifier(NC_SCREEN | NA_EDITED, NULL);
}
static StructRNA *rna_Header_register(Main *bmain, ReportList *reports, void *data, const char *identifier,
@@ -335,20 +336,20 @@ static StructRNA *rna_Header_register(Main *bmain, ReportList *reports, void *da
ht->ext.free = free;
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);
/* update while blender is running */
WM_main_add_notifier(NC_SCREEN|NA_EDITED, NULL);
WM_main_add_notifier(NC_SCREEN | NA_EDITED, NULL);
return ht->ext.srna;
}
static StructRNA* rna_Header_refine(PointerRNA *htr)
static StructRNA *rna_Header_refine(PointerRNA *htr)
{
Header *hdr = (Header*)htr->data;
return (hdr->type && hdr->type->ext.srna)? hdr->type->ext.srna: &RNA_Header;
Header *hdr = (Header *)htr->data;
return (hdr->type && hdr->type->ext.srna) ? hdr->type->ext.srna : &RNA_Header;
}
/* Menu */
@@ -371,7 +372,7 @@ static int menu_poll(const bContext *C, MenuType *pt)
pt->ext.call((bContext *)C, &ptr, func, &list);
RNA_parameter_get_lookup(&list, "visible", &ret);
visible = *(int*)ret;
visible = *(int *)ret;
RNA_parameter_list_free(&list);
@@ -410,7 +411,7 @@ static void rna_Menu_unregister(Main *UNUSED(bmain), StructRNA *type)
RNA_struct_free(&BLENDER_RNA, type);
/* update while blender is running */
WM_main_add_notifier(NC_SCREEN|NA_EDITED, NULL);
WM_main_add_notifier(NC_SCREEN | NA_EDITED, NULL);
}
static char _menu_descr[RNA_DYN_DESCR_MAX];
@@ -469,29 +470,29 @@ static StructRNA *rna_Menu_register(Main *bmain, ReportList *reports, void *data
RNA_struct_blender_type_set(mt->ext.srna, mt);
RNA_def_struct_flag(mt->ext.srna, STRUCT_NO_IDPROPERTIES);
mt->poll = (have_function[0])? menu_poll: NULL;
mt->draw = (have_function[1])? menu_draw: NULL;
mt->poll = (have_function[0]) ? menu_poll : NULL;
mt->draw = (have_function[1]) ? menu_draw : NULL;
WM_menutype_add(mt);
/* update while blender is running */
WM_main_add_notifier(NC_SCREEN|NA_EDITED, NULL);
WM_main_add_notifier(NC_SCREEN | NA_EDITED, NULL);
return mt->ext.srna;
}
static StructRNA* rna_Menu_refine(PointerRNA *mtr)
static StructRNA *rna_Menu_refine(PointerRNA *mtr)
{
Menu *hdr = (Menu*)mtr->data;
return (hdr->type && hdr->type->ext.srna)? hdr->type->ext.srna: &RNA_Menu;
Menu *hdr = (Menu *)mtr->data;
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)
{
Menu *data = (Menu*)(ptr->data);
Menu *data = (Menu *)(ptr->data);
char *str = (char *)data->type->description;
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");
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");
}
static int rna_UILayout_active_get(PointerRNA *ptr)
@@ -598,7 +599,8 @@ static void rna_def_ui_layout(BlenderRNA *brna)
{UI_LAYOUT_ALIGN_LEFT, "LEFT", 0, "Left", ""},
{UI_LAYOUT_ALIGN_CENTER, "CENTER", 0, "Center", ""},
{UI_LAYOUT_ALIGN_RIGHT, "RIGHT", 0, "Right", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
/* layout */
@@ -647,12 +649,13 @@ static void rna_def_panel(BlenderRNA *brna)
FunctionRNA *func;
static EnumPropertyItem panel_flag_items[] = {
{PNL_DEFAULT_CLOSED, "DEFAULT_CLOSED", 0, "Default Closed",
"Defines if the panel has to be open or collapsed at the time of its creation"},
{PNL_NO_HEADER, "HIDE_HEADER", 0, "Show Header",
"If set to True, the panel shows a header, which contains a clickable "
"arrow to collapse the panel and the label (see bl_label)"},
{0, NULL, 0, NULL, NULL}};
{PNL_DEFAULT_CLOSED, "DEFAULT_CLOSED", 0, "Default Closed",
"Defines if the panel has to be open or collapsed at the time of its creation"},
{PNL_NO_HEADER, "HIDE_HEADER", 0, "Show Header",
"If set to True, the panel shows a header, which contains a clickable "
"arrow to collapse the panel and the label (see bl_label)"},
{0, NULL, 0, NULL, NULL}
};
srna = RNA_def_struct(brna, "Panel", NULL);
RNA_def_struct_ui_text(srna, "Panel", "Panel containing UI elements");
@@ -663,23 +666,23 @@ static void rna_def_panel(BlenderRNA *brna)
/* poll */
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_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, "", ""));
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 */
func = RNA_def_function(srna, "draw", NULL);
RNA_def_function_ui_description(func, "Draw UI elements into the panel UI layout");
RNA_def_function_flag(func, FUNC_REGISTER);
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);
RNA_def_function_ui_description(func, "Draw UI elements into the panel's header UI layout");
RNA_def_function_flag(func, FUNC_REGISTER);
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);
RNA_def_property_struct_type(prop, "UILayout");
@@ -692,7 +695,7 @@ static void rna_def_panel(BlenderRNA *brna)
/* registration */
prop = RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE);
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",
"If this is set, the panel gets a custom ID, otherwise it takes the "
"name of the class used to define the panel. For example, if the "
@@ -731,7 +734,7 @@ static void rna_def_panel(BlenderRNA *brna)
prop = RNA_def_property(srna, "bl_options", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "type->flag");
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);
RNA_def_property_ui_text(prop, "Options", "Options for this panel type");
}
@@ -765,7 +768,7 @@ static void rna_def_header(BlenderRNA *brna)
/* registration */
prop = RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE);
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",
"If this is set, the header gets a custom ID, otherwise it takes the "
"name of the class used to define the panel; for example, if the "
@@ -797,7 +800,7 @@ static void rna_def_menu(BlenderRNA *brna)
/* poll */
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_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, "", ""));
parm = RNA_def_pointer(func, "context", "Context", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
@@ -819,7 +822,7 @@ static void rna_def_menu(BlenderRNA *brna)
/* registration */
prop = RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE);
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",
"If this is set, the menu gets a custom ID, otherwise it takes the "
"name of the class used to define the menu (for example, if the "

View File

@@ -50,13 +50,13 @@ static void rna_uiItemR(uiLayout *layout, PointerRNA *ptr, const char *propname,
return;
}
flag |= (slider)? UI_ITEM_R_SLIDER: 0;
flag |= (expand)? UI_ITEM_R_EXPAND: 0;
flag |= (toggle)? UI_ITEM_R_TOGGLE: 0;
flag |= (icon_only)? UI_ITEM_R_ICON_ONLY: 0;
flag |= (event)? UI_ITEM_R_EVENT: 0;
flag |= (full_event)? UI_ITEM_R_FULL_EVENT: 0;
flag |= (emboss)? 0: UI_ITEM_R_NO_BG;
flag |= (slider) ? UI_ITEM_R_SLIDER : 0;
flag |= (expand) ? UI_ITEM_R_EXPAND : 0;
flag |= (toggle) ? UI_ITEM_R_TOGGLE : 0;
flag |= (icon_only) ? UI_ITEM_R_ICON_ONLY : 0;
flag |= (event) ? UI_ITEM_R_EVENT : 0;
flag |= (full_event) ? UI_ITEM_R_FULL_EVENT : 0;
flag |= (emboss) ? 0 : UI_ITEM_R_NO_BG;
uiItemFullR(layout, ptr, prop, index, 0, flag, name, icon);
}
@@ -64,7 +64,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)
{
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);
}
@@ -75,7 +75,8 @@ static PointerRNA rna_uiItemO(uiLayout *layout, const char *opname, const char *
#define DEF_VICO(name) {VICO_##name, (#name), 0, (#name), ""},
static EnumPropertyItem icon_items[] = {
#include "UI_icons.h"
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
#undef DEF_ICON_BLANK_SKIP
#undef DEF_ICON
#undef DEF_VICO
@@ -110,7 +111,7 @@ static void api_ui_item_rna_common(FunctionRNA *func)
PropertyRNA *parm;
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");
RNA_def_property_flag(parm, PROP_REQUIRED);
}
@@ -124,13 +125,15 @@ void RNA_api_ui_layout(StructRNA *srna)
{0, "NONE", 0, "None", ""},
{'v', "VECTOR", 0, "Vector", ""},
{'c', "COLOR", 0, "Color", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem list_type_items[] = {
{0, "DEFAULT", 0, "None", ""},
{'c', "COMPACT", 0, "Compact", ""},
{'i', "ICONS", 0, "Icons", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
/* simple layout specifiers */
func = RNA_def_function(srna, "row", "uiLayoutRow");
@@ -160,7 +163,7 @@ void RNA_api_ui_layout(StructRNA *srna)
parm = RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in");
RNA_def_function_return(func, parm);
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 */
func = RNA_def_function(srna, "split", "uiLayoutSplit");
@@ -201,7 +204,7 @@ void RNA_api_ui_layout(StructRNA *srna)
func = RNA_def_function(srna, "prop_search", "uiItemPointerR");
api_ui_item_rna_common(func);
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");
RNA_def_property_flag(parm, PROP_REQUIRED);
api_ui_item_common(func);
@@ -210,18 +213,11 @@ void RNA_api_ui_layout(StructRNA *srna)
api_ui_item_op_common(func);
RNA_def_boolean(func, "emboss", 1, "", "Draw the button itself, just the icon/text");
parm = RNA_def_pointer(func, "properties", "OperatorProperties", "",
"Operator properties to fill in, return when 'properties' is set to true");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR);
"Operator properties to fill in, return when 'properties' is set to true");
RNA_def_property_flag(parm, PROP_REQUIRED | PROP_RNAPTR);
RNA_def_function_return(func, parm);
RNA_def_function_ui_description(func, "Item. Places a button into the layout to call an Operator");
/* func= RNA_def_function(srna, "operator_enum_single", "uiItemEnumO_string");
api_ui_item_op_common(func);
parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator");
RNA_def_property_flag(parm, PROP_REQUIRED);
parm= RNA_def_string(func, "value", "", 0, "", "Enum property value");
RNA_def_property_flag(parm, PROP_REQUIRED); */
func = RNA_def_function(srna, "operator_enum", "uiItemsEnumO");
parm = RNA_def_string(func, "operator", "", 0, "", "Identifier of the operator");
RNA_def_property_flag(parm, PROP_REQUIRED);
@@ -234,14 +230,24 @@ void RNA_api_ui_layout(StructRNA *srna)
RNA_def_property_flag(parm, PROP_REQUIRED);
api_ui_item_common(func);
/* func= RNA_def_function(srna, "operator_boolean", "uiItemBooleanO");
/* useful in C but not in python */
#if 0
func= RNA_def_function(srna, "operator_enum_single", "uiItemEnumO_string");
api_ui_item_op_common(func);
parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator");
RNA_def_property_flag(parm, PROP_REQUIRED);
parm= RNA_def_string(func, "value", "", 0, "", "Enum property value");
RNA_def_property_flag(parm, PROP_REQUIRED);
func= RNA_def_function(srna, "operator_boolean", "uiItemBooleanO");
api_ui_item_op_common(func);
parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator");
RNA_def_property_flag(parm, PROP_REQUIRED);
parm= RNA_def_boolean(func, "value", 0, "", "Value of the property to call the operator with");
RNA_def_property_flag(parm, PROP_REQUIRED); */
/* func= RNA_def_function(srna, "operator_int", "uiItemIntO");
func= RNA_def_function(srna, "operator_int", "uiItemIntO");
api_ui_item_op_common(func);
parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator");
RNA_def_property_flag(parm, PROP_REQUIRED);
@@ -249,7 +255,7 @@ void RNA_api_ui_layout(StructRNA *srna)
"Value of the property to call the operator with", INT_MIN, INT_MAX);
RNA_def_property_flag(parm, PROP_REQUIRED); */
/* func= RNA_def_function(srna, "operator_float", "uiItemFloatO");
func= RNA_def_function(srna, "operator_float", "uiItemFloatO");
api_ui_item_op_common(func);
parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator");
RNA_def_property_flag(parm, PROP_REQUIRED);
@@ -257,12 +263,13 @@ void RNA_api_ui_layout(StructRNA *srna)
"Value of the property to call the operator with", -FLT_MAX, FLT_MAX);
RNA_def_property_flag(parm, PROP_REQUIRED); */
/* func= RNA_def_function(srna, "operator_string", "uiItemStringO");
func= RNA_def_function(srna, "operator_string", "uiItemStringO");
api_ui_item_op_common(func);
parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator");
RNA_def_property_flag(parm, PROP_REQUIRED);
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);
#endif
func = RNA_def_function(srna, "label", "uiItemL");
RNA_def_function_ui_description(func, "Item. Display text in the layout");
@@ -282,7 +289,7 @@ void RNA_api_ui_layout(StructRNA *srna)
parm = RNA_def_string(func, "name", "", 0, "Name", "Name of entry in the context");
RNA_def_property_flag(parm, PROP_REQUIRED);
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 */
func = RNA_def_function(srna, "template_header", "uiTemplateHeader");
@@ -307,35 +314,35 @@ void RNA_api_ui_layout(StructRNA *srna)
func = RNA_def_function(srna, "template_any_ID", "uiTemplateAnyID");
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");
RNA_def_property_flag(parm, PROP_REQUIRED);
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_string_translate(func, "text", "", 0, "", "Custom label to display in UI");
func = RNA_def_function(srna, "template_path_builder", "uiTemplatePathBuilder");
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");
RNA_def_property_flag(parm, PROP_REQUIRED);
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");
func = RNA_def_function(srna, "template_modifier", "uiTemplateModifier");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
RNA_def_function_ui_description(func, "Layout . Generates the UI layout for modifiers");
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");
RNA_def_function_return(func, parm);
func = RNA_def_function(srna, "template_constraint", "uiTemplateConstraint");
RNA_def_function_ui_description(func, "Layout . Generates the UI layout for constraints");
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");
RNA_def_function_return(func, parm);
@@ -374,7 +381,7 @@ void RNA_api_ui_layout(StructRNA *srna)
func = RNA_def_function(srna, "template_layers", "uiTemplateLayers");
api_ui_item_rna_common(func);
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");
RNA_def_property_flag(parm, PROP_REQUIRED);
parm = RNA_def_int(func, "active_layer", 0, 0, INT_MAX, "Active Layer", "", 0, INT_MAX);
@@ -400,13 +407,13 @@ void RNA_api_ui_layout(StructRNA *srna)
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
api_ui_item_rna_common(func);
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");
func = RNA_def_function(srna, "template_image_settings", "uiTemplateImageSettings");
RNA_def_function_ui_description(func, "User interface for setting image format options");
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");
RNA_def_function_ui_description(func, "Item(s). User interface for selecting movie clips and their source paths");
@@ -422,21 +429,21 @@ void RNA_api_ui_layout(StructRNA *srna)
RNA_def_function_ui_description(func, "Item. A widget to control single marker settings.");
api_ui_item_rna_common(func);
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", "", "");
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");
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_flag(func, FUNC_USE_CONTEXT);
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");
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");
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");
RNA_def_property_flag(parm, PROP_REQUIRED);
@@ -484,10 +491,10 @@ void RNA_api_ui_layout(StructRNA *srna)
func = RNA_def_function(srna, "template_keymap_item_properties", "uiTemplateKeymapItemProperties");
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");
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);
}

View File

@@ -53,7 +53,8 @@ static EnumPropertyItem compute_device_type_items[] = {
{USER_COMPUTE_DEVICE_NONE, "NONE", 0, "None", "Don't use compute device"},
{USER_COMPUTE_DEVICE_CUDA, "CUDA", 0, "CUDA", "Use CUDA for GPU acceleration"},
{USER_COMPUTE_DEVICE_OPENCL, "OPENCL", 0, "OpenCL", "Use OpenCL for GPU acceleration"},
{ 0, NULL, 0, NULL, NULL}};
{ 0, NULL, 0, NULL, NULL}
};
#endif
#ifdef RNA_RUNTIME
@@ -84,9 +85,9 @@ static void rna_userdef_update(Main *UNUSED(bmain), Scene *UNUSED(scene), Pointe
static void rna_userdef_dpi_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *UNUSED(ptr))
{
U.widget_unit = (U.dpi * 20 + 36)/72;
WM_main_add_notifier(NC_WINDOW, NULL); /* full redraw */
WM_main_add_notifier(NC_SCREEN|NA_EDITED, NULL); /* refresh region sizes */
U.widget_unit = (U.dpi * 20 + 36) / 72;
WM_main_add_notifier(NC_WINDOW, NULL); /* full redraw */
WM_main_add_notifier(NC_SCREEN | NA_EDITED, NULL); /* refresh region sizes */
}
static void rna_userdef_language_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *UNUSED(ptr))
@@ -126,9 +127,9 @@ static void rna_userdef_show_manipulator_update(Main *bmain, Scene *scene, Point
static void rna_userdef_script_autoexec_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
UserDef *userdef = (UserDef*)ptr->data;
if (userdef->flag & USER_SCRIPT_AUTOEXEC_DISABLE) G.f &= ~G_SCRIPT_AUTOEXEC;
else G.f |= G_SCRIPT_AUTOEXEC;
UserDef *userdef = (UserDef *)ptr->data;
if (userdef->flag & USER_SCRIPT_AUTOEXEC_DISABLE) G.f &= ~G_SCRIPT_AUTOEXEC;
else G.f |= G_SCRIPT_AUTOEXEC;
}
static void rna_userdef_mipmap_update(Main *bmain, Scene *scene, PointerRNA *ptr)
@@ -157,7 +158,7 @@ static void rna_userdef_gl_use_16bit_textures(Main *bmain, Scene *scene, Pointer
static void rna_userdef_select_mouse_set(PointerRNA *ptr, int value)
{
UserDef *userdef = (UserDef*)ptr->data;
UserDef *userdef = (UserDef *)ptr->data;
if (value) {
userdef->flag |= USER_LMOUSESELECT;
@@ -169,7 +170,7 @@ static void rna_userdef_select_mouse_set(PointerRNA *ptr, int value)
static int rna_userdef_autokeymode_get(PointerRNA *ptr)
{
UserDef *userdef = (UserDef*)ptr->data;
UserDef *userdef = (UserDef *)ptr->data;
short retval = userdef->autokey_mode;
if (!(userdef->autokey_mode & AUTOKEY_ON))
@@ -180,7 +181,7 @@ static int rna_userdef_autokeymode_get(PointerRNA *ptr)
static void rna_userdef_autokeymode_set(PointerRNA *ptr, int value)
{
UserDef *userdef = (UserDef*)ptr->data;
UserDef *userdef = (UserDef *)ptr->data;
if (value == AUTOKEY_MODE_NORMAL) {
userdef->autokey_mode |= (AUTOKEY_MODE_NORMAL - AUTOKEY_ON);
@@ -194,7 +195,7 @@ static void rna_userdef_autokeymode_set(PointerRNA *ptr, int value)
static void rna_userdef_timecode_style_set(PointerRNA *ptr, int value)
{
UserDef *userdef = (UserDef*)ptr->data;
UserDef *userdef = (UserDef *)ptr->data;
int required_size = userdef->v2d_min_gridsize;
/* set the timecode style */
@@ -265,7 +266,7 @@ static void rna_UserDef_weight_color_update(Main *bmain, Scene *scene, PointerRN
{
Object *ob;
vDM_ColorBand_store((U.flag & USER_CUSTOM_RANGE) ? (&U.coba_weight):NULL);
vDM_ColorBand_store((U.flag & USER_CUSTOM_RANGE) ? (&U.coba_weight) : NULL);
for (ob = bmain->object.first; ob; ob = ob->id.next) {
if (ob->mode & OB_MODE_WEIGHT_PAINT)
@@ -284,7 +285,7 @@ static void rna_UserDef_viewport_lights_update(Main *bmain, Scene *scene, Pointe
light->flag |= 1;
}
WM_main_add_notifier(NC_SPACE|ND_SPACE_VIEW3D|NS_VIEW3D_GPU, NULL);
WM_main_add_notifier(NC_SPACE | ND_SPACE_VIEW3D | NS_VIEW3D_GPU, NULL);
rna_userdef_update(bmain, scene, ptr);
}
@@ -413,7 +414,8 @@ static void rna_def_userdef_theme_ui_font_style(BlenderRNA *brna)
static EnumPropertyItem font_kerning_style[] = {
{0, "UNFITTED", 0, "Unfitted", "Use scaled but un-grid-fitted kerning distances"},
{1, "DEFAULT", 0, "Default", "Use scaled and grid-fitted kerning distances"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
srna = RNA_def_struct(brna, "ThemeFontStyle", NULL);
RNA_def_struct_sdna(srna, "uiFontStyle");
@@ -471,20 +473,23 @@ static void rna_def_userdef_theme_ui_style(BlenderRNA *brna)
RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
RNA_def_struct_ui_text(srna, "Style", "Theme settings for style sets");
/* (not used yet)
/* (not used yet) */
#if 0
prop= RNA_def_property(srna, "panelzoom", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.5, 2.0);
RNA_def_property_ui_text(prop, "Panel Zoom", "Default zoom level for panel areas");
*/
#endif
prop = RNA_def_property(srna, "panel_title", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "paneltitle");
RNA_def_property_struct_type(prop, "ThemeFontStyle");
RNA_def_property_ui_text(prop, "Panel Style", "");
RNA_def_property_update(prop, 0, "rna_userdef_update");
/* (not used yet) */
#if 0
prop= RNA_def_property(srna, "group_label", PROP_POINTER, PROP_NONE);
prop = RNA_def_property(srna, "group_label", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "grouplabel");
RNA_def_property_struct_type(prop, "ThemeFontStyle");
@@ -2110,8 +2115,9 @@ static void rna_def_userdef_themes(BlenderRNA *brna)
{15, "INFO", ICON_INFO, "Info", ""},
{16, "FILE_BROWSER", ICON_FILESEL, "File Browser", ""},
{17, "CONSOLE", ICON_CONSOLE, "Python Console", ""},
{20, "CLIP_EDITOR", ICON_CLIP, "Movie Clip Editor", ""},
{0, NULL, 0, NULL, NULL}};
{20, "CLIP_EDITOR", ICON_CLIP, "Movie Clip Editor", ""},
{0, NULL, 0, NULL, NULL}
};
srna = RNA_def_struct(brna, "Theme", NULL);
RNA_def_struct_sdna(srna, "bTheme");
@@ -2121,7 +2127,7 @@ static void rna_def_userdef_themes(BlenderRNA *brna)
prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Name", "Name of the theme");
RNA_def_struct_name_property(srna, prop);
/* XXX: for now putting this in presets is silly - its just Default */
/* XXX: for now putting this in presets is silly - its just Default */
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
prop = RNA_def_property(srna, "theme_area", PROP_ENUM, PROP_NONE);
@@ -2342,7 +2348,8 @@ static void rna_def_userdef_view(BlenderRNA *brna)
"milliseconds are shown instead"},
{USER_TIMECODE_SECONDS_ONLY, "SECONDS_ONLY", 0, "Only Seconds",
"Direct conversion of frame numbers to seconds"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
PropertyRNA *prop;
StructRNA *srna;
@@ -2542,7 +2549,7 @@ static void rna_def_userdef_view(BlenderRNA *brna)
"Minimum number of pixels between each gridline in 2D Viewports");
RNA_def_property_update(prop, 0, "rna_userdef_update");
/* TODO: add a setter for this, so that we can bump up the minimum size as necessary... */
/* TODO: add a setter for this, so that we can bump up the minimum size as necessary... */
prop = RNA_def_property(srna, "timecode_style", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, timecode_styles);
RNA_def_property_enum_sdna(prop, NULL, "timecode_style");
@@ -2560,18 +2567,21 @@ static void rna_def_userdef_edit(BlenderRNA *brna)
static EnumPropertyItem auto_key_modes[] = {
{AUTOKEY_MODE_NORMAL, "ADD_REPLACE_KEYS", 0, "Add/Replace", ""},
{AUTOKEY_MODE_EDITKEYS, "REPLACE_KEYS", 0, "Replace", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static const EnumPropertyItem material_link_items[] = {
{0, "OBDATA", 0, "ObData", "Toggle whether the material is linked to object data or the object block"},
{USER_MAT_ON_OB, "OBJECT", 0, "Object",
"Toggle whether the material is linked to object data or the object block"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static const EnumPropertyItem object_align_items[] = {
{0, "WORLD", 0, "World", "Align newly added objects to the world coordinate system"},
{USER_ADD_VIEWALIGNED, "VIEW", 0, "View", "Align newly added objects facing the active 3D View direction"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
srna = RNA_def_struct(brna, "UserPreferencesEdit", NULL);
RNA_def_struct_sdna(srna, "UserDef");
@@ -2679,7 +2689,7 @@ static void rna_def_userdef_edit(BlenderRNA *brna)
RNA_def_property_range(prop, 0.001f, 1.0f);
RNA_def_property_ui_text(prop, "Unselected F-Curve Visibility",
"Amount that unselected F-Curves stand out from the background (Graph Editor)");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_GRAPH, NULL);
/* grease pencil */
prop = RNA_def_property(srna, "grease_pencil_manhattan_distance", PROP_INT, PROP_NONE);
@@ -2751,11 +2761,11 @@ static void rna_def_userdef_edit(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_TEX);
RNA_def_property_ui_text(prop, "Duplicate Texture", "Causes texture data to be duplicated with the object");
/* xxx */
/* xxx */
prop = RNA_def_property(srna, "use_duplicate_fcurve", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_IPO);
RNA_def_property_ui_text(prop, "Duplicate F-Curve", "Causes F-curve data to be duplicated with the object");
/* xxx */
/* xxx */
prop = RNA_def_property(srna, "use_duplicate_action", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_ACT);
RNA_def_property_ui_text(prop, "Duplicate Action", "Causes actions to be duplicated with the object");
@@ -2779,7 +2789,8 @@ static void rna_def_userdef_system(BlenderRNA *brna)
{512, "CLAMP_512", 0, "512", ""},
{256, "CLAMP_256", 0, "256", ""},
{128, "CLAMP_128", 0, "128", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem anisotropic_items[] = {
{1, "FILTER_0", 0, "Off", ""},
@@ -2787,7 +2798,8 @@ static void rna_def_userdef_system(BlenderRNA *brna)
{4, "FILTER_4", 0, "4x", ""},
{8, "FILTER_8", 0, "8x", ""},
{16, "FILTER_16", 0, "16x", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem audio_mixing_samples_items[] = {
{256, "SAMPLES_256", 0, "256", "Set audio mixing buffer size to 256 samples"},
@@ -2798,7 +2810,8 @@ static void rna_def_userdef_system(BlenderRNA *brna)
{8192, "SAMPLES_8192", 0, "8192", "Set audio mixing buffer size to 8192 samples"},
{16384, "SAMPLES_16384", 0, "16384", "Set audio mixing buffer size to 16384 samples"},
{32768, "SAMPLES_32768", 0, "32768", "Set audio mixing buffer size to 32768 samples"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem audio_device_items[] = {
{0, "NONE", 0, "None", "Null device - there will be no audio output"},
@@ -2811,7 +2824,8 @@ static void rna_def_userdef_system(BlenderRNA *brna)
#ifdef WITH_JACK
{3, "JACK", 0, "Jack", "JACK - Audio Connection Kit, recommended for pro audio users"},
#endif
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem audio_rate_items[] = {
/* {8000, "RATE_8000", 0, "8 kHz", "Set audio sampling rate to 8000 samples per second"}, */
@@ -2824,7 +2838,8 @@ static void rna_def_userdef_system(BlenderRNA *brna)
/* {88200, "RATE_88200", 0, "88.2 kHz", "Set audio sampling rate to 88200 samples per second"}, */
{96000, "RATE_96000", 0, "96 kHz", "Set audio sampling rate to 96000 samples per second"},
{192000, "RATE_192000", 0, "192 kHz", "Set audio sampling rate to 192000 samples per second"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem audio_format_items[] = {
{0x01, "U8", 0, "8-bit Unsigned", "Set audio sample format to 8 bit unsigned integer"},
@@ -2833,7 +2848,8 @@ static void rna_def_userdef_system(BlenderRNA *brna)
{0x14, "S32", 0, "32-bit Signed", "Set audio sample format to 32 bit signed integer"},
{0x24, "FLOAT", 0, "32-bit Float", "Set audio sample format to 32 bit float"},
{0x28, "DOUBLE", 0, "64-bit Float", "Set audio sample format to 64 bit float"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem audio_channel_items[] = {
{1, "MONO", 0, "Mono", "Set audio channels to mono"},
@@ -2841,7 +2857,8 @@ static void rna_def_userdef_system(BlenderRNA *brna)
{4, "SURROUND4", 0, "4 Channels", "Set audio channels to 4 channels"},
{6, "SURROUND51", 0, "5.1 Surround", "Set audio channels to 5.1 surround sound"},
{8, "SURROUND71", 0, "7.1 Surround", "Set audio channels to 7.1 surround sound"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem draw_method_items[] = {
{USER_DRAW_AUTOMATIC, "AUTOMATIC", 0, "Automatic", "Automatically set based on graphics card and driver"},
@@ -2854,16 +2871,18 @@ static void rna_def_userdef_system(BlenderRNA *brna)
"(for graphics drivers that do flipping)"},
{USER_DRAW_FULL, "FULL", 0, "Full",
"Do a full redraw each time, slow, only use for reference or when everything else fails"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem color_picker_types[] = {
{USER_CP_CIRCLE, "CIRCLE", 0, "Circle", "A circular Hue/Saturation color wheel, with Value slider"},
{USER_CP_SQUARE_SV, "SQUARE_SV", 0, "Square (SV + H)", "A square showing Saturation/Value, with Hue slider"},
{USER_CP_SQUARE_HS, "SQUARE_HS", 0, "Square (HS + V)", "A square showing Hue/Saturation, with Value slider"},
{USER_CP_SQUARE_HV, "SQUARE_HV", 0, "Square (HV + S)", "A square showing Hue/Value, with Saturation slider"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
/* hardcoded here, could become dynamic somehow */
/* hardcoded here, could become dynamic somehow */
/* locale according to http://www.roseindia.net/tutorials/I18N/locales-list.shtml */
/* if you edit here, please also edit the source/blender/blenfont/intern/blf_lang.c 's locales */
/* Note: As this list is in alphabetical order, and not defined order,
@@ -2905,12 +2924,14 @@ static void rna_def_userdef_system(BlenderRNA *brna)
{ 7, "SWEDISH", 0, "Swedish (Svenska)", "sv_SE"},
{30, "TURKISH", 0, "Turkish (Türkçe)", "tr_TR"},
{18, "UKRAINIAN", 0, "Ukrainian (Український)", "uk_UA"},
{ 0, NULL, 0, NULL, NULL}};
{ 0, NULL, 0, NULL, NULL}
};
#ifdef WITH_CYCLES
static EnumPropertyItem compute_device_items[] = {
{0, "CPU", 0, "CPU", ""},
{ 0, NULL, 0, NULL, NULL}};
{ 0, NULL, 0, NULL, NULL}
};
#endif
srna = RNA_def_struct(brna, "UserPreferencesSystem", NULL);
@@ -3015,7 +3036,7 @@ static void rna_def_userdef_system(BlenderRNA *brna)
prop = RNA_def_property(srna, "memory_cache_limit", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "memcachelimit");
RNA_def_property_range(prop, 0, (sizeof(void *) == 8)? 1024*16: 1024); /* 32 bit 2 GB, 64 bit 16 GB */
RNA_def_property_range(prop, 0, (sizeof(void *) == 8) ? 1024 * 16 : 1024); /* 32 bit 2 GB, 64 bit 16 GB */
RNA_def_property_ui_text(prop, "Memory Cache Limit", "Memory cache limit in sequencer (megabytes)");
RNA_def_property_update(prop, 0, "rna_Userdef_memcache_update");
@@ -3046,7 +3067,7 @@ static void rna_def_userdef_system(BlenderRNA *brna)
RNA_def_property_boolean_negative_sdna(prop, NULL, "gameflags", USER_DISABLE_VBO);
RNA_def_property_ui_text(prop, "VBOs",
"Use Vertex Buffer Objects (or Vertex Arrays, if unsupported) for viewport rendering");
/* this isn't essential but nice to check if VBO draws any differently */
/* this isn't essential but nice to check if VBO draws any differently */
RNA_def_property_update(prop, NC_WINDOW, NULL);
prop = RNA_def_property(srna, "use_antialiasing", PROP_BOOLEAN, PROP_NONE);
@@ -3159,24 +3180,28 @@ static void rna_def_userdef_input(BlenderRNA *brna)
static EnumPropertyItem select_mouse_items[] = {
{USER_LMOUSESELECT, "LEFT", 0, "Left", "Use left Mouse Button for selection"},
{0, "RIGHT", 0, "Right", "Use Right Mouse Button for selection"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem view_rotation_items[] = {
{0, "TURNTABLE", 0, "Turntable", "Use turntable style rotation in the viewport"},
{USER_TRACKBALL, "TRACKBALL", 0, "Trackball", "Use trackball style rotation in the viewport"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem view_zoom_styles[] = {
{USER_ZOOM_CONT, "CONTINUE", 0, "Continue", "Old style zoom, continues while moving mouse up or down"},
{USER_ZOOM_DOLLY, "DOLLY", 0, "Dolly", "Zoom in and out based on vertical mouse movement"},
{USER_ZOOM_SCALE, "SCALE", 0, "Scale",
"Zoom in and out like scaling the view, mouse movements relative to center"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem view_zoom_axes[] = {
{0, "VERTICAL", 0, "Vertical", "Zoom in and out based on vertical mouse movement"},
{USER_ZOOM_HORIZ, "HORIZONTAL", 0, "Horizontal", "Zoom in and out based on horizontal mouse movement"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
srna = RNA_def_struct(brna, "UserPreferencesInput", NULL);
RNA_def_struct_sdna(srna, "UserDef");
@@ -3336,7 +3361,8 @@ static void rna_def_userdef_filepaths(BlenderRNA *brna)
{4, "RV", 0, "rv", "Frame player from Tweak Software"},
{5, "MPLAYER", 0, "MPlayer", "Media player for video & png/jpeg/sgi image sequences"},
{50, "CUSTOM", 0, "Custom", "Custom animation player executable path"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
srna = RNA_def_struct(brna, "UserPreferencesFilePaths", NULL);
RNA_def_struct_sdna(srna, "UserDef");
@@ -3414,7 +3440,7 @@ static void rna_def_userdef_filepaths(BlenderRNA *brna)
RNA_def_property_enum_sdna(prop, NULL, "anim_player_preset");
RNA_def_property_enum_items(prop, anim_player_presets);
RNA_def_property_ui_text(prop, "Animation Player Preset", "Preset configs for external animation players");
RNA_def_property_enum_default(prop, 1); /* set default to blender 2.4 player until an internal one is back */
RNA_def_property_enum_default(prop, 1); /* set default to blender 2.4 player until an internal one is back */
/* Autosave */
@@ -3469,7 +3495,7 @@ void rna_def_userdef_addon_collection(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_flag(func, FUNC_NO_SELF);
RNA_def_function_ui_description(func, "Remove addon");
parm = RNA_def_pointer(func, "addon", "Addon", "", "Addon to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL);
}
void RNA_def_userdef(BlenderRNA *brna)
@@ -3485,7 +3511,8 @@ void RNA_def_userdef(BlenderRNA *brna)
{USER_SECTION_THEME, "THEMES", 0, "Themes", ""},
{USER_SECTION_FILE, "FILES", 0, "File", ""},
{USER_SECTION_SYSTEM, "SYSTEM", 0, "System", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
rna_def_userdef_dothemes(brna);
rna_def_userdef_solidlight(brna);

View File

@@ -46,7 +46,8 @@ EnumPropertyItem event_keymouse_value_items[] = {
{KM_RELEASE, "RELEASE", 0, "Release", ""},
{KM_CLICK, "CLICK", 0, "Click", ""},
{KM_DBL_CLICK, "DOUBLE_CLICK", 0, "Double Click", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
EnumPropertyItem event_tweak_value_items[] = {
{KM_ANY, "ANY", 0, "Any", ""},
@@ -58,7 +59,8 @@ EnumPropertyItem event_tweak_value_items[] = {
{EVT_GESTURE_SW, "SOUTH_WEST", 0, "South-West", ""},
{EVT_GESTURE_W, "WEST", 0, "West", ""},
{EVT_GESTURE_NW, "NORTH_WEST", 0, "North-West", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
EnumPropertyItem event_value_items[] = {
{KM_ANY, "ANY", 0, "Any", ""},
@@ -75,7 +77,8 @@ EnumPropertyItem event_value_items[] = {
{EVT_GESTURE_SW, "SOUTH_WEST", 0, "South-West", ""},
{EVT_GESTURE_W, "WEST", 0, "West", ""},
{EVT_GESTURE_NW, "NORTH_WEST", 0, "North-West", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
EnumPropertyItem event_tweak_type_items[] = {
{EVT_TWEAK_L, "EVT_TWEAK_L", 0, "Left", ""},
@@ -83,7 +86,8 @@ EnumPropertyItem event_tweak_type_items[] = {
{EVT_TWEAK_R, "EVT_TWEAK_R", 0, "Right", ""},
{EVT_TWEAK_A, "EVT_TWEAK_A", 0, "Action", ""},
{EVT_TWEAK_S, "EVT_TWEAK_S", 0, "Select", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
EnumPropertyItem event_mouse_type_items[] = {
{LEFTMOUSE, "LEFTMOUSE", 0, "Left", ""},
@@ -103,14 +107,16 @@ EnumPropertyItem event_mouse_type_items[] = {
{WHEELDOWNMOUSE, "WHEELDOWNMOUSE", 0, "Wheel Down", ""},
{WHEELINMOUSE, "WHEELINMOUSE", 0, "Wheel In", ""},
{WHEELOUTMOUSE, "WHEELOUTMOUSE", 0, "Wheel Out", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
EnumPropertyItem event_timer_type_items[] = {
{TIMER, "TIMER", 0, "Timer", ""},
{TIMER0, "TIMER0", 0, "Timer 0", ""},
{TIMER1, "TIMER1", 0, "Timer 1", ""},
{TIMER2, "TIMER2", 0, "Timer 2", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
EnumPropertyItem event_ndof_type_items[] = {
/* buttons on all 3dconnexion devices */
@@ -158,7 +164,8 @@ EnumPropertyItem event_ndof_type_items[] = {
{NDOF_BUTTON_A, "NDOF_BUTTON_A", 0, "Button A", ""},
{NDOF_BUTTON_B, "NDOF_BUTTON_B", 0, "Button B", ""},
{NDOF_BUTTON_C, "NDOF_BUTTON_C", 0, "Button C", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
/* not returned: CAPSLOCKKEY, UNKNOWNKEY */
EnumPropertyItem event_type_items[] = {
@@ -216,26 +223,26 @@ EnumPropertyItem event_type_items[] = {
{YKEY, "Y", 0, "Y", ""},
{ZKEY, "Z", 0, "Z", ""},
{0, "", 0, NULL, NULL},
{ZEROKEY, "ZERO", 0, "0", ""},
{ONEKEY, "ONE", 0, "1", ""},
{TWOKEY, "TWO", 0, "2", ""},
{THREEKEY, "THREE", 0, "3", ""},
{FOURKEY, "FOUR", 0, "4", ""},
{FIVEKEY, "FIVE", 0, "5", ""},
{SIXKEY, "SIX", 0, "6", ""},
{SEVENKEY, "SEVEN", 0, "7", ""},
{EIGHTKEY, "EIGHT", 0, "8", ""},
{NINEKEY, "NINE", 0, "9", ""},
{ZEROKEY, "ZERO", 0, "0", ""},
{ONEKEY, "ONE", 0, "1", ""},
{TWOKEY, "TWO", 0, "2", ""},
{THREEKEY, "THREE", 0, "3", ""},
{FOURKEY, "FOUR", 0, "4", ""},
{FIVEKEY, "FIVE", 0, "5", ""},
{SIXKEY, "SIX", 0, "6", ""},
{SEVENKEY, "SEVEN", 0, "7", ""},
{EIGHTKEY, "EIGHT", 0, "8", ""},
{NINEKEY, "NINE", 0, "9", ""},
{0, "", 0, NULL, NULL},
{LEFTCTRLKEY, "LEFT_CTRL", 0, "Left Ctrl", ""},
{LEFTALTKEY, "LEFT_ALT", 0, "Left Alt", ""},
{LEFTSHIFTKEY, "LEFT_SHIFT", 0, "Left Shift", ""},
{RIGHTALTKEY, "RIGHT_ALT", 0, "Right Alt", ""},
{RIGHTCTRLKEY, "RIGHT_CTRL", 0, "Right Ctrl", ""},
{RIGHTSHIFTKEY, "RIGHT_SHIFT", 0, "Right Shift", ""},
{LEFTCTRLKEY, "LEFT_CTRL", 0, "Left Ctrl", ""},
{LEFTALTKEY, "LEFT_ALT", 0, "Left Alt", ""},
{LEFTSHIFTKEY, "LEFT_SHIFT", 0, "Left Shift", ""},
{RIGHTALTKEY, "RIGHT_ALT", 0, "Right Alt", ""},
{RIGHTCTRLKEY, "RIGHT_CTRL", 0, "Right Ctrl", ""},
{RIGHTSHIFTKEY, "RIGHT_SHIFT", 0, "Right Shift", ""},
{0, "", 0, NULL, NULL},
{OSKEY, "OSKEY", 0, "OS Key", ""},
{GRLESSKEY, "GRLESS", 0, "Grless", ""},
{OSKEY, "OSKEY", 0, "OS Key", ""},
{GRLESSKEY, "GRLESS", 0, "Grless", ""},
{ESCKEY, "ESC", 0, "Esc", ""},
{TABKEY, "TAB", 0, "Tab", ""},
{RETKEY, "RET", 0, "Return", ""},
@@ -357,11 +364,13 @@ EnumPropertyItem event_type_items[] = {
{NDOF_BUTTON_A, "NDOF_BUTTON_A", 0, "NDOF Button A", ""},
{NDOF_BUTTON_B, "NDOF_BUTTON_B", 0, "NDOF Button B", ""},
{NDOF_BUTTON_C, "NDOF_BUTTON_C", 0, "NDOF Button C", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
EnumPropertyItem keymap_propvalue_items[] = {
{0, "NONE", 0, "", ""},
{0, NULL, 0, NULL, NULL}};
{0, "NONE", 0, "", ""},
{0, NULL, 0, NULL, NULL}
};
#if 0
static EnumPropertyItem keymap_modifiers_items[] = {
@@ -369,7 +378,8 @@ static EnumPropertyItem keymap_modifiers_items[] = {
{0, "NONE", 0, "None", ""},
{1, "FIRST", 0, "First", ""},
{2, "SECOND", 0, "Second", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
#endif
EnumPropertyItem operator_flag_items[] = {
@@ -382,15 +392,17 @@ EnumPropertyItem operator_flag_items[] = {
"is enabled"},
{OPTYPE_PRESET, "PRESET", 0, "Preset", "Display a preset button with the operators settings"},
{OPTYPE_INTERNAL, "INTERNAL", 0, "Internal", "Removes the operator from search results"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
EnumPropertyItem operator_return_items[] = {
{OPERATOR_RUNNING_MODAL, "RUNNING_MODAL", 0, "Running Modal", "Keep the operator running with blender"},
{OPERATOR_CANCELLED, "CANCELLED", 0, "Cancelled", "When no action has been taken, operator exits"},
{OPERATOR_FINISHED, "FINISHED", 0, "Finished", "When the operator is complete, operator exits"},
/* used as a flag */
/* used as a flag */
{OPERATOR_PASS_THROUGH, "PASS_THROUGH", 0, "Pass Through", "Do nothing and pass the event on"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
/* flag/enum */
EnumPropertyItem wm_report_items[] = {
@@ -402,14 +414,15 @@ EnumPropertyItem wm_report_items[] = {
{RPT_ERROR_INVALID_INPUT, "ERROR_INVALID_INPUT", 0, "Invalid Input", ""},
{RPT_ERROR_INVALID_CONTEXT, "ERROR_INVALID_CONTEXT", 0, "Invalid Context", ""},
{RPT_ERROR_OUT_OF_MEMORY, "ERROR_OUT_OF_MEMORY", 0, "Out of Memory", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
#define KMI_TYPE_KEYBOARD 0
#define KMI_TYPE_MOUSE 1
#define KMI_TYPE_TWEAK 2
#define KMI_TYPE_TEXTINPUT 3
#define KMI_TYPE_TIMER 4
#define KMI_TYPE_NDOF 5
#define KMI_TYPE_KEYBOARD 0
#define KMI_TYPE_MOUSE 1
#define KMI_TYPE_TWEAK 2
#define KMI_TYPE_TEXTINPUT 3
#define KMI_TYPE_TIMER 4
#define KMI_TYPE_NDOF 5
#ifdef RNA_RUNTIME
@@ -424,7 +437,7 @@ EnumPropertyItem wm_report_items[] = {
static wmOperator *rna_OperatorProperties_find_operator(PointerRNA *ptr)
{
wmWindowManager *wm = ptr->id.data;
IDProperty *properties = (IDProperty*)ptr->data;
IDProperty *properties = (IDProperty *)ptr->data;
wmOperator *op;
if (wm)
@@ -457,52 +470,52 @@ static IDProperty *rna_OperatorProperties_idprops(PointerRNA *ptr, int create)
static void rna_Operator_name_get(PointerRNA *ptr, char *value)
{
wmOperator *op = (wmOperator*)ptr->data;
wmOperator *op = (wmOperator *)ptr->data;
strcpy(value, op->type->name);
}
static int rna_Operator_name_length(PointerRNA *ptr)
{
wmOperator *op = (wmOperator*)ptr->data;
wmOperator *op = (wmOperator *)ptr->data;
return strlen(op->type->name);
}
static int rna_Operator_has_reports_get(PointerRNA *ptr)
{
wmOperator *op = (wmOperator*)ptr->data;
wmOperator *op = (wmOperator *)ptr->data;
return (op->reports && op->reports->list.first);
}
static PointerRNA rna_Operator_properties_get(PointerRNA *ptr)
{
wmOperator *op = (wmOperator*)ptr->data;
wmOperator *op = (wmOperator *)ptr->data;
return rna_pointer_inherit_refine(ptr, op->type->srna, op->properties);
}
static PointerRNA rna_OperatorMacro_properties_get(PointerRNA *ptr)
{
wmOperatorTypeMacro *otmacro = (wmOperatorTypeMacro*)ptr->data;
wmOperatorTypeMacro *otmacro = (wmOperatorTypeMacro *)ptr->data;
wmOperatorType *ot = WM_operatortype_find(otmacro->idname, TRUE);
return rna_pointer_inherit_refine(ptr, ot->srna, otmacro->properties);
}
static void rna_Event_ascii_get(PointerRNA *ptr, char *value)
{
wmEvent *event = (wmEvent*)ptr->data;
wmEvent *event = (wmEvent *)ptr->data;
value[0] = event->ascii;
value[1] = '\0';
}
static int rna_Event_ascii_length(PointerRNA *ptr)
{
wmEvent *event = (wmEvent*)ptr->data;
return (event->ascii)? 1 : 0;
wmEvent *event = (wmEvent *)ptr->data;
return (event->ascii) ? 1 : 0;
}
static void rna_Event_unicode_get(PointerRNA *ptr, char *value)
{
/* utf8 buf isn't \0 terminated */
wmEvent *event = (wmEvent*)ptr->data;
wmEvent *event = (wmEvent *)ptr->data;
size_t len = 0;
if (event->utf8_buf[0]) {
@@ -518,7 +531,7 @@ static void rna_Event_unicode_get(PointerRNA *ptr, char *value)
static int rna_Event_unicode_length(PointerRNA *ptr)
{
wmEvent *event = (wmEvent*)ptr->data;
wmEvent *event = (wmEvent *)ptr->data;
if (event->utf8_buf[0]) {
/* invalid value is checked on assignment so we don't need to account for this */
return BLI_str_utf8_size(event->utf8_buf);
@@ -530,7 +543,7 @@ static int rna_Event_unicode_length(PointerRNA *ptr)
static void rna_Window_screen_set(PointerRNA *ptr, PointerRNA value)
{
wmWindow *win = (wmWindow*)ptr->data;
wmWindow *win = (wmWindow *)ptr->data;
if (value.data == NULL)
return;
@@ -541,12 +554,12 @@ static void rna_Window_screen_set(PointerRNA *ptr, PointerRNA value)
static void rna_Window_screen_update(bContext *C, PointerRNA *ptr)
{
wmWindow *win = (wmWindow*)ptr->data;
wmWindow *win = (wmWindow *)ptr->data;
/* exception: can't set screens inside of area/region handers, and must
* use context so notifier gets to the right window */
if (win->newscreen) {
WM_event_add_notifier(C, NC_SCREEN|ND_SCREENBROWSE, win->newscreen);
WM_event_add_notifier(C, NC_SCREEN | ND_SCREENBROWSE, win->newscreen);
win->newscreen = NULL;
}
}
@@ -582,30 +595,30 @@ static void rna_wmKeyMapItem_map_type_set(PointerRNA *ptr, int value)
if (value != map_type) {
switch (value) {
case KMI_TYPE_KEYBOARD:
kmi->type = AKEY;
kmi->val = KM_PRESS;
break;
case KMI_TYPE_TWEAK:
kmi->type = EVT_TWEAK_L;
kmi->val = KM_ANY;
break;
case KMI_TYPE_MOUSE:
kmi->type = LEFTMOUSE;
kmi->val = KM_PRESS;
break;
case KMI_TYPE_TEXTINPUT:
kmi->type = KM_TEXTINPUT;
kmi->val = KM_NOTHING;
break;
case KMI_TYPE_TIMER:
kmi->type = TIMER;
kmi->val = KM_NOTHING;
break;
case KMI_TYPE_NDOF:
kmi->type = NDOF_BUTTON_MENU;
kmi->val = KM_PRESS;
break;
case KMI_TYPE_KEYBOARD:
kmi->type = AKEY;
kmi->val = KM_PRESS;
break;
case KMI_TYPE_TWEAK:
kmi->type = EVT_TWEAK_L;
kmi->val = KM_ANY;
break;
case KMI_TYPE_MOUSE:
kmi->type = LEFTMOUSE;
kmi->val = KM_PRESS;
break;
case KMI_TYPE_TEXTINPUT:
kmi->type = KM_TEXTINPUT;
kmi->val = KM_NOTHING;
break;
case KMI_TYPE_TIMER:
kmi->type = TIMER;
kmi->val = KM_NOTHING;
break;
case KMI_TYPE_NDOF:
kmi->type = NDOF_BUTTON_MENU;
kmi->val = KM_PRESS;
break;
}
}
}
@@ -662,7 +675,7 @@ static EnumPropertyItem *rna_KeyMapItem_propvalue_itemf(bContext *C, PointerRNA
static int rna_KeyMapItem_any_getf(PointerRNA *ptr)
{
wmKeyMapItem *kmi = (wmKeyMapItem*)ptr->data;
wmKeyMapItem *kmi = (wmKeyMapItem *)ptr->data;
if (kmi->shift == KM_ANY &&
kmi->ctrl == KM_ANY &&
@@ -678,7 +691,7 @@ static int rna_KeyMapItem_any_getf(PointerRNA *ptr)
static void rna_KeyMapItem_any_setf(PointerRNA *ptr, int value)
{
wmKeyMapItem *kmi = (wmKeyMapItem*)ptr->data;
wmKeyMapItem *kmi = (wmKeyMapItem *)ptr->data;
if (value) {
kmi->shift = kmi->ctrl = kmi->alt = kmi->oskey = KM_ANY;
@@ -813,7 +826,7 @@ static void rna_Operator_unregister(struct Main *bmain, StructRNA *type)
wm = bmain->wm.first;
if (wm)
WM_operator_stack_clear(wm);
WM_main_add_notifier(NC_SCREEN|NA_EDITED, NULL);
WM_main_add_notifier(NC_SCREEN | NA_EDITED, NULL);
RNA_struct_free_extension(type, &ot->ext);
@@ -843,7 +856,7 @@ static int operator_poll(bContext *C, wmOperatorType *ot)
ot->ext.call(C, &ptr, func, &list);
RNA_parameter_get_lookup(&list, "visible", &ret);
visible = *(int*)ret;
visible = *(int *)ret;
RNA_parameter_list_free(&list);
@@ -868,7 +881,7 @@ static int operator_execute(bContext *C, wmOperator *op)
op->type->ext.call(C, &opr, func, &list);
RNA_parameter_get_lookup(&list, "result", &ret);
result = *(int*)ret;
result = *(int *)ret;
RNA_parameter_list_free(&list);
@@ -894,7 +907,7 @@ static int operator_check(bContext *C, wmOperator *op)
op->type->ext.call(C, &opr, func, &list);
RNA_parameter_get_lookup(&list, "result", &ret);
result = *(int*)ret;
result = *(int *)ret;
RNA_parameter_list_free(&list);
@@ -920,7 +933,7 @@ static int operator_invoke(bContext *C, wmOperator *op, wmEvent *event)
op->type->ext.call(C, &opr, func, &list);
RNA_parameter_get_lookup(&list, "result", &ret);
result = *(int*)ret;
result = *(int *)ret;
RNA_parameter_list_free(&list);
@@ -947,7 +960,7 @@ static int operator_modal(bContext *C, wmOperator *op, wmEvent *event)
op->type->ext.call(C, &opr, func, &list);
RNA_parameter_get_lookup(&list, "result", &ret);
result = *(int*)ret;
result = *(int *)ret;
RNA_parameter_list_free(&list);
@@ -991,7 +1004,7 @@ static int operator_cancel(bContext *C, wmOperator *op)
op->type->ext.call(C, &opr, func, &list);
RNA_parameter_get_lookup(&list, "result", &ret);
result = *(int*)ret;
result = *(int *)ret;
RNA_parameter_list_free(&list);
@@ -1026,7 +1039,7 @@ static StructRNA *rna_Operator_register(Main *bmain, ReportList *reports, void *
if (validate(&dummyotr, data, have_function) != 0)
return NULL;
{ /* convert foo.bar to FOO_OT_bar
{ /* convert foo.bar to FOO_OT_bar
* allocate the description and the idname in 1 go */
/* inconveniently long name sanity check */
@@ -1102,17 +1115,17 @@ static StructRNA *rna_Operator_register(Main *bmain, ReportList *reports, void *
dummyot.ext.call = call;
dummyot.ext.free = free;
dummyot.pyop_poll = (have_function[0])? operator_poll: NULL;
dummyot.exec = (have_function[1])? operator_execute: NULL;
dummyot.check = (have_function[2])? operator_check: NULL;
dummyot.invoke = (have_function[3])? operator_invoke: NULL;
dummyot.modal = (have_function[4])? operator_modal: NULL;
dummyot.ui = (have_function[5])? operator_draw: NULL;
dummyot.cancel = (have_function[6])? operator_cancel: NULL;
dummyot.pyop_poll = (have_function[0]) ? operator_poll : NULL;
dummyot.exec = (have_function[1]) ? operator_execute : NULL;
dummyot.check = (have_function[2]) ? operator_check : NULL;
dummyot.invoke = (have_function[3]) ? operator_invoke : NULL;
dummyot.modal = (have_function[4]) ? operator_modal : NULL;
dummyot.ui = (have_function[5]) ? operator_draw : NULL;
dummyot.cancel = (have_function[6]) ? operator_cancel : NULL;
WM_operatortype_append_ptr(operator_wrapper, (void *)&dummyot);
/* update while blender is running */
WM_main_add_notifier(NC_SCREEN|NA_EDITED, NULL);
WM_main_add_notifier(NC_SCREEN | NA_EDITED, NULL);
return dummyot.ext.srna;
}
@@ -1142,7 +1155,7 @@ static StructRNA *rna_MacroOperator_register(Main *bmain, ReportList *reports, v
if (validate(&dummyotr, data, have_function) != 0)
return NULL;
{ /* convert foo.bar to FOO_OT_bar
{ /* convert foo.bar to FOO_OT_bar
* allocate the description and the idname in 1 go */
int idlen = strlen(_operator_idname) + 4;
int namelen = strlen(_operator_name) + 1;
@@ -1182,53 +1195,53 @@ static StructRNA *rna_MacroOperator_register(Main *bmain, ReportList *reports, v
dummyot.ext.call = call;
dummyot.ext.free = free;
dummyot.pyop_poll = (have_function[0])? operator_poll: NULL;
dummyot.ui = (have_function[3])? operator_draw: NULL;
dummyot.pyop_poll = (have_function[0]) ? operator_poll : NULL;
dummyot.ui = (have_function[3]) ? operator_draw : NULL;
WM_operatortype_append_macro_ptr(macro_wrapper, (void *)&dummyot);
/* update while blender is running */
WM_main_add_notifier(NC_SCREEN|NA_EDITED, NULL);
WM_main_add_notifier(NC_SCREEN | NA_EDITED, NULL);
return dummyot.ext.srna;
}
#endif /* WITH_PYTHON */
static StructRNA* rna_Operator_refine(PointerRNA *opr)
static StructRNA *rna_Operator_refine(PointerRNA *opr)
{
wmOperator *op = (wmOperator*)opr->data;
return (op->type && op->type->ext.srna)? op->type->ext.srna: &RNA_Operator;
wmOperator *op = (wmOperator *)opr->data;
return (op->type && op->type->ext.srna) ? op->type->ext.srna : &RNA_Operator;
}
static StructRNA* rna_MacroOperator_refine(PointerRNA *opr)
static StructRNA *rna_MacroOperator_refine(PointerRNA *opr)
{
wmOperator *op = (wmOperator*)opr->data;
return (op->type && op->type->ext.srna)? op->type->ext.srna: &RNA_Macro;
wmOperator *op = (wmOperator *)opr->data;
return (op->type && op->type->ext.srna) ? op->type->ext.srna : &RNA_Macro;
}
/* just to work around 'const char *' warning and to ensure this is a python op */
static void rna_Operator_bl_idname_set(PointerRNA *ptr, const char *value)
{
wmOperator *data = (wmOperator*)(ptr->data);
wmOperator *data = (wmOperator *)(ptr->data);
char *str = (char *)data->type->idname;
if (!str[0]) BLI_strncpy(str, value, RNA_DYN_DESCR_MAX); /* utf8 already ensured */
else assert(!"setting the bl_idname on a non-builtin operator");
if (!str[0]) BLI_strncpy(str, value, RNA_DYN_DESCR_MAX); /* utf8 already ensured */
else assert(!"setting the bl_idname on a non-builtin operator");
}
static void rna_Operator_bl_label_set(PointerRNA *ptr, const char *value)
{
wmOperator *data = (wmOperator*)(ptr->data);
wmOperator *data = (wmOperator *)(ptr->data);
char *str = (char *)data->type->name;
if (!str[0]) BLI_strncpy(str, value, RNA_DYN_DESCR_MAX); /* utf8 already ensured */
else assert(!"setting the bl_label on a non-builtin operator");
if (!str[0]) BLI_strncpy(str, value, RNA_DYN_DESCR_MAX); /* utf8 already ensured */
else assert(!"setting the bl_label on a non-builtin operator");
}
static void rna_Operator_bl_description_set(PointerRNA *ptr, const char *value)
{
wmOperator *data = (wmOperator*)(ptr->data);
wmOperator *data = (wmOperator *)(ptr->data);
char *str = (char *)data->type->description;
if (!str[0]) BLI_strncpy(str, value, RNA_DYN_DESCR_MAX); /* utf8 already ensured */
else assert(!"setting the bl_description on a non-builtin operator");
if (!str[0]) BLI_strncpy(str, value, RNA_DYN_DESCR_MAX); /* utf8 already ensured */
else assert(!"setting the bl_description on a non-builtin operator");
}
static void rna_KeyMapItem_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
@@ -1275,11 +1288,11 @@ static void rna_def_operator(BlenderRNA *brna)
/* Registration */
prop = RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "type->idname");
/* else it uses the pointer size!. -3 because '.' -> '_OT_' */
RNA_def_property_string_maxlength(prop, OP_MAX_TYPENAME-3);
/* else it uses the pointer size!. -3 because '.' -> '_OT_' */
RNA_def_property_string_maxlength(prop, OP_MAX_TYPENAME - 3);
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Operator_bl_idname_set");
/* RNA_def_property_clear_flag(prop, PROP_EDITABLE); */
RNA_def_property_flag(prop, PROP_REGISTER|PROP_NEVER_CLAMP);
RNA_def_property_flag(prop, PROP_REGISTER | PROP_NEVER_CLAMP);
RNA_def_struct_name_property(srna, prop);
/* operator's label indeed doesn't need PROP_TRANSLATE flag: translation of label happens in runtime
@@ -1303,7 +1316,7 @@ static void rna_def_operator(BlenderRNA *brna)
prop = RNA_def_property(srna, "bl_options", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "type->flag");
RNA_def_property_enum_items(prop, operator_flag_items);
RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL|PROP_ENUM_FLAG);
RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL | PROP_ENUM_FLAG);
RNA_def_property_ui_text(prop, "Options", "Options for this operator type");
RNA_api_operator(srna);
@@ -1346,7 +1359,7 @@ static void rna_def_macro_operator(BlenderRNA *brna)
RNA_def_property_string_maxlength(prop, OP_MAX_TYPENAME); /* else it uses the pointer size! */
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Operator_bl_idname_set");
/* RNA_def_property_clear_flag(prop, PROP_EDITABLE); */
RNA_def_property_flag(prop, PROP_REGISTER|PROP_NEVER_CLAMP);
RNA_def_property_flag(prop, PROP_REGISTER | PROP_NEVER_CLAMP);
RNA_def_struct_name_property(srna, prop);
/* menu's label indeed doesn't need PROP_TRANSLATE flag: translation of label happens in runtime
@@ -1370,7 +1383,7 @@ static void rna_def_macro_operator(BlenderRNA *brna)
prop = RNA_def_property(srna, "bl_options", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "type->flag");
RNA_def_property_enum_items(prop, operator_flag_items);
RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL|PROP_ENUM_FLAG);
RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL | PROP_ENUM_FLAG);
RNA_def_property_ui_text(prop, "Options", "Options for this operator type");
RNA_api_macro(srna);
@@ -1680,7 +1693,8 @@ static void rna_def_keyconfig(BlenderRNA *brna)
{KMI_TYPE_NDOF, "NDOF", 0, "NDOF", ""},
{KMI_TYPE_TEXTINPUT, "TEXTINPUT", 0, "Text Input", ""},
{KMI_TYPE_TIMER, "TIMER", 0, "Timer", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
/* KeyConfig */
srna = RNA_def_struct(brna, "KeyConfig", NULL);

View File

@@ -72,7 +72,7 @@ static int rna_event_modal_handler_add(struct bContext *C, struct wmOperator *op
}
/* XXX, need a way for python to know event types, 0x0110 is hard coded */
struct wmTimer *rna_event_timer_add(struct wmWindowManager *wm, float time_step, wmWindow *win)
wmTimer *rna_event_timer_add(struct wmWindowManager *wm, float time_step, wmWindow *win)
{
return WM_event_add_timer(wm, win, 0x0110, time_step);
}
@@ -164,15 +164,15 @@ static wmKeyMap *rna_keymap_find_modal(wmKeyConfig *UNUSED(keyconf), const char
#else
#define WM_GEN_INVOKE_EVENT (1<<0)
#define WM_GEN_INVOKE_SIZE (1<<1)
#define WM_GEN_INVOKE_RETURN (1<<2)
#define WM_GEN_INVOKE_EVENT (1 << 0)
#define WM_GEN_INVOKE_SIZE (1 << 1)
#define WM_GEN_INVOKE_RETURN (1 << 2)
static void rna_generic_op_invoke(FunctionRNA *func, int flag)
{
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");
RNA_def_property_flag(parm, PROP_REQUIRED);
@@ -204,7 +204,7 @@ void RNA_api_wm(StructRNA *srna)
rna_generic_op_invoke(func, 0);
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");
RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_function_return(func, RNA_def_boolean(func, "handle", 1, "", ""));
@@ -222,18 +222,18 @@ void RNA_api_wm(StructRNA *srna)
func = RNA_def_function(srna, "event_timer_remove", "rna_event_timer_remove");
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 */
func = RNA_def_function(srna, "invoke_props_popup", "WM_operator_props_popup");
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. */
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_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 */
func = RNA_def_function(srna, "invoke_search_popup", "rna_Operator_enum_search_invoke");
@@ -242,11 +242,11 @@ void RNA_api_wm(StructRNA *srna)
/* invoke functions, for use with python */
func = RNA_def_function(srna, "invoke_popup", "WM_operator_ui_popup");
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");
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);
}
@@ -268,19 +268,19 @@ void RNA_api_operator(StructRNA *srna)
/* poll */
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_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, "", ""));
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 */
func = RNA_def_function(srna, "execute", NULL);
RNA_def_function_ui_description(func, "Execute the operator");
RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL);
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);
/* better name? */
/* better name? */
parm = RNA_def_enum_flag(func, "result", operator_return_items, OPERATOR_CANCELLED, "result", "");
RNA_def_function_return(func, parm);
@@ -289,7 +289,7 @@ void RNA_api_operator(StructRNA *srna)
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);
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? */
RNA_def_function_return(func, parm);
@@ -299,11 +299,11 @@ void RNA_api_operator(StructRNA *srna)
RNA_def_function_ui_description(func, "Invoke the operator");
RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL);
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", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL);
/* better name? */
/* better name? */
parm = RNA_def_enum_flag(func, "result", operator_return_items, OPERATOR_CANCELLED, "result", "");
RNA_def_function_return(func, parm);
@@ -311,11 +311,11 @@ void RNA_api_operator(StructRNA *srna)
RNA_def_function_ui_description(func, "Modal operator function");
RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL);
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", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL);
/* better name? */
/* better name? */
parm = RNA_def_enum_flag(func, "result", operator_return_items, OPERATOR_CANCELLED, "result", "");
RNA_def_function_return(func, parm);
@@ -324,16 +324,16 @@ void RNA_api_operator(StructRNA *srna)
RNA_def_function_ui_description(func, "Draw function for the operator");
RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL);
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 */
func = RNA_def_function(srna, "cancel", NULL);
RNA_def_function_ui_description(func, "Called when the operator is canceled");
RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL);
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);
/* better name? */
/* better name? */
parm = RNA_def_enum_flag(func, "result", operator_return_items, OPERATOR_CANCELLED, "result", "");
RNA_def_function_return(func, parm);
}
@@ -356,17 +356,17 @@ void RNA_api_macro(StructRNA *srna)
/* poll */
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_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, "", ""));
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 */
func = RNA_def_function(srna, "draw", NULL);
RNA_def_function_ui_description(func, "Draw function for the operator");
RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL);
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)
@@ -391,7 +391,7 @@ void RNA_api_keymap(StructRNA *srna)
func = RNA_def_function(srna, "restore_item_to_default", "rna_keymap_restore_item_to_default");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
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);
}
void RNA_api_keymapitem(StructRNA *srna)

View File

@@ -67,13 +67,13 @@ static PointerRNA rna_World_mist_get(PointerRNA *ptr)
static void rna_World_mtex_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
World *wo = (World*)ptr->data;
rna_iterator_array_begin(iter, (void*)wo->mtex, sizeof(MTex*), MAX_MTEX, 0, NULL);
World *wo = (World *)ptr->data;
rna_iterator_array_begin(iter, (void *)wo->mtex, sizeof(MTex *), MAX_MTEX, 0, NULL);
}
static PointerRNA rna_World_active_texture_get(PointerRNA *ptr)
{
World *wo = (World*)ptr->data;
World *wo = (World *)ptr->data;
Tex *tex;
tex = give_current_world_texture(wo);
@@ -82,7 +82,7 @@ static PointerRNA rna_World_active_texture_get(PointerRNA *ptr)
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);
}
@@ -100,7 +100,7 @@ static void rna_World_draw_update(Main *UNUSED(bmain), Scene *UNUSED(scene), Poi
World *wo = ptr->id.data;
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);
}
/* so camera mist limits redraw */
@@ -109,8 +109,8 @@ static void rna_World_draw_mist_update(Main *UNUSED(bmain), Scene *UNUSED(scene)
World *wo = ptr->id.data;
DAG_id_tag_update(&wo->id, 0);
WM_main_add_notifier(NC_WORLD|ND_WORLD_DRAW, wo);
WM_main_add_notifier(NC_OBJECT|ND_DRAW, NULL);
WM_main_add_notifier(NC_WORLD | ND_WORLD_DRAW, wo);
WM_main_add_notifier(NC_OBJECT | ND_DRAW, NULL);
}
static void rna_World_stars_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
@@ -118,12 +118,12 @@ static void rna_World_stars_update(Main *UNUSED(bmain), Scene *UNUSED(scene), Po
World *wo = ptr->id.data;
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);
}
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)
ED_node_shader_default(scene, &wrld->id);
@@ -146,7 +146,8 @@ static void rna_def_world_mtex(BlenderRNA *brna)
{TEXCO_EQUIRECTMAP, "EQUIRECT", 0, "Equirectangular", "For 360 degree panorama sky, equirectangular mapping"},
{TEXCO_H_TUBEMAP, "TUBE", 0, "Tube", "For 360 degree panorama sky, cylindrical mapped, only top half"},
{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");
RNA_def_struct_sdna(srna, "MTex");
@@ -220,24 +221,28 @@ static void rna_def_lighting(BlenderRNA *brna)
static EnumPropertyItem blend_mode_items[] = {
{WO_AOMUL, "MULTIPLY", 0, "Multiply", "Multiply direct lighting with ambient occlusion, darkening the result"},
{WO_AOADD, "ADD", 0, "Add", "Add light and shadow"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem prop_color_items[] = {
{WO_AOPLAIN, "PLAIN", 0, "White", "Plain diffuse energy (white.)"},
{WO_AOSKYCOL, "SKY_COLOR", 0, "Sky Color", "Use horizon and zenith color for diffuse energy"},
{WO_AOSKYTEX, "SKY_TEXTURE", 0, "Sky Texture", "Does full Sky texture render for diffuse energy"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem prop_sample_method_items[] = {
{WO_AOSAMP_CONSTANT, "CONSTANT_JITTERED", 0, "Constant Jittered", "Fastest and gives the most noise"},
{WO_AOSAMP_HALTON, "ADAPTIVE_QMC", 0, "Adaptive QMC", "Fast in high-contrast areas"},
{WO_AOSAMP_HAMMERSLEY, "CONSTANT_QMC", 0, "Constant QMC", "Best quality"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem prop_gather_method_items[] = {
{WO_AOGATHER_RAYTRACE, "RAYTRACE", 0, "Raytrace", "Accurate, but slow when noise-free results are required"},
{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);
RNA_def_struct_sdna(srna, "World");
@@ -398,7 +403,8 @@ static void rna_def_world_mist(BlenderRNA *brna)
{0, "QUADRATIC", 0, "Quadratic", "Use quadratic progression"},
{1, "LINEAR", 0, "Linear", "Use linear 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);
RNA_def_struct_sdna(srna, "World");
@@ -496,7 +502,8 @@ void RNA_def_world(BlenderRNA *brna)
/*{WOPHY_DYNAMO, "DYNAMO", 0, "Dynamo", ""}, */
/*{WOPHY_ODE, "ODE", 0, "ODE", ""}, */
{WOPHY_BULLET, "BULLET", 0, "Bullet", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
#endif
srna = RNA_def_struct(brna, "World", "ID");
@@ -506,7 +513,7 @@ void RNA_def_world(BlenderRNA *brna)
rna_def_animdata_common(srna);
rna_def_mtex_common(brna, srna, "rna_World_mtex_begin", "rna_World_active_texture_get",
"rna_World_active_texture_set", NULL, "WorldTextureSlot", "WorldTextureSlots", "rna_World_update");
"rna_World_active_texture_set", NULL, "WorldTextureSlot", "WorldTextureSlots", "rna_World_update");
/* colors */
prop = RNA_def_property(srna, "horizon_color", PROP_FLOAT, PROP_COLOR);
@@ -515,7 +522,7 @@ void RNA_def_world(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Horizon Color", "Color at the horizon");
/* RNA_def_property_update(prop, 0, "rna_World_update"); */
/* render-only uses this */
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);

View File

@@ -81,7 +81,7 @@ void get_texture_value(Tex *texture, float *tex_co, TexResult *texres)
* if the texture didn't give an RGB value, copy the intensity across
*/
if (result_type & TEX_RGB) {
texres->tin= (1.0f / 3.0f) * (texres->tr + texres->tg + texres->tb);
texres->tin = (1.0f / 3.0f) * (texres->tr + texres->tg + texres->tb);
}
else {
copy_v3_fl(&texres->tr, texres->tin);

View File

@@ -41,7 +41,7 @@ void wm_init_cursor_data(void);
/* old cursors */
enum {
CURSOR_FACESEL=BC_GHOST_CURSORS,
CURSOR_FACESEL = BC_GHOST_CURSORS,
CURSOR_WAIT,
CURSOR_EDIT,
CURSOR_X_MOVE,
@@ -80,7 +80,7 @@ typedef struct BCursor {
#define SYSCURSOR 1
enum {
BC_NW_ARROWCURSOR=2,
BC_NW_ARROWCURSOR = 2,
BC_NS_ARROWCURSOR,
BC_EW_ARROWCURSOR,
BC_WAITCURSOR,
@@ -103,7 +103,7 @@ enum {
enum {
BC_BLACK=0,
BC_BLACK = 0,
BC_WHITE,
BC_RED,
BC_BLUE,
@@ -111,8 +111,8 @@ enum {
BC_YELLOW
};
#define SMALL_CURSOR 0
#define BIG_CURSOR 1
#define SMALL_CURSOR 0
#define BIG_CURSOR 1
struct wmWindow;
struct wmEvent;

View File

@@ -37,23 +37,23 @@
#ifdef BUILD_DATE
/* currently only these are defined in the header */
char build_date[]= BUILD_DATE;
char build_time[]= BUILD_TIME;
char build_rev[]= BUILD_REV;
char build_date[] = BUILD_DATE;
char build_time[] = BUILD_TIME;
char build_rev[] = BUILD_REV;
char build_platform[]= BUILD_PLATFORM;
char build_type[]= BUILD_TYPE;
char build_platform[] = BUILD_PLATFORM;
char build_type[] = BUILD_TYPE;
#ifdef BUILD_CFLAGS
char build_cflags[]= BUILD_CFLAGS;
char build_cxxflags[]= BUILD_CXXFLAGS;
char build_linkflags[]= BUILD_LINKFLAGS;
char build_system[]= BUILD_SYSTEM;
char build_cflags[] = BUILD_CFLAGS;
char build_cxxflags[] = BUILD_CXXFLAGS;
char build_linkflags[] = BUILD_LINKFLAGS;
char build_system[] = BUILD_SYSTEM;
#else
char build_cflags[]= "unmaintained buildsystem alert!";
char build_cxxflags[]= "unmaintained buildsystem alert!";
char build_linkflags[]= "unmaintained buildsystem alert!";
char build_system[]= "unmaintained buildsystem alert!";
char build_cflags[] = "unmaintained buildsystem alert!";
char build_cxxflags[] = "unmaintained buildsystem alert!";
char build_linkflags[] = "unmaintained buildsystem alert!";
char build_system[] = "unmaintained buildsystem alert!";
#endif
#endif // BUILD_DATE