Merging r41120 through from trunk r41139 into soc-2011-tomato

This commit is contained in:
Sergey Sharybin 2011-10-20 09:49:39 +00:00
commit 3dfd4808c3
135 changed files with 826 additions and 460 deletions

@ -216,6 +216,10 @@ mark_as_advanced(WITH_CXX_GUARDEDALLOC)
option(WITH_ASSERT_ABORT "Call abort() when raising an assertion through BLI_assert()" OFF)
mark_as_advanced(WITH_ASSERT_ABORT)
option(WITH_PYTHON_UI_INFO "Allow navigating to UI source from the context menu" OFF)
mark_as_advanced(WITH_PYTHON_UI_INFO)
if(APPLE)
if(NOT CMAKE_OSX_ARCHITECTURES)
set(CMAKE_OSX_ARCHITECTURES x86_64 CACHE STRING
@ -1329,6 +1333,10 @@ if(WITH_ASSERT_ABORT)
add_definitions(-DWITH_ASSERT_ABORT)
endif()
if(WITH_PYTHON_UI_INFO)
add_definitions(-DWITH_PYTHON_UI_INFO)
endif()
# message(STATUS "Using CFLAGS: ${CMAKE_C_FLAGS}")
# message(STATUS "Using CXXFLAGS: ${CMAKE_CXX_FLAGS}")

@ -174,7 +174,7 @@ package_archive:
# Other Targets
#
translations:
$(BUILD_DIR)/bin/blender --background --factory-startup --python po/update_msg.py
$(BUILD_DIR)/bin/blender --background -noaudio --factory-startup --python po/update_msg.py
python3 po/update_pot.py
python3 po/update_po.py
python3 po/update_mo.py
@ -238,12 +238,12 @@ check_sparse:
# Simple version of ./doc/python_api/sphinx_doc_gen.sh with no PDF generation.
doc_py:
$(BUILD_DIR)/bin/blender --background --factory-startup --python doc/python_api/sphinx_doc_gen.py
$(BUILD_DIR)/bin/blender --background -noaudio --factory-startup --python doc/python_api/sphinx_doc_gen.py
cd doc/python_api ; sphinx-build -n -b html sphinx-in sphinx-out
@echo "docs written into: '$(BLENDER_DIR)/doc/python_api/sphinx-out/contents.html'"
doc_dna:
$(BUILD_DIR)/bin/blender --background --factory-startup --python doc/blender_file_format/BlendFileDnaExporter_25.py
$(BUILD_DIR)/bin/blender --background -noaudio --factory-startup --python doc/blender_file_format/BlendFileDnaExporter_25.py
@echo "docs written into: '$(BLENDER_DIR)/doc/blender_file_format/dna.html'"
doc_man:

@ -316,8 +316,8 @@ def creator(env):
if env['WITH_BF_TIFF']:
defs.append('WITH_TIFF')
if not env['WITH_BF_SDL']:
defs.append('DISABLE_SDL')
if env['WITH_BF_SDL']:
defs.append('WITH_SDL')
if env['WITH_BF_LIBMV']:
incs.append('#/extern/libmv')

@ -379,15 +379,15 @@ class DNACatalogHTML:
def usage():
print("\nUsage: \n\tblender2.5 -b -P BlendFileDnaExporter_25.py [-- [options]]")
print("\nUsage: \n\tblender2.5 --background -noaudio --python BlendFileDnaExporter_25.py [-- [options]]")
print("Options:")
print("\t--dna-keep-blend: doesn't delete the produced blend file DNA export to html")
print("\t--dna-debug: sets the logging level to DEBUG (lots of additional info)")
print("\t--dna-versioned saves version informations in the html and blend filenames")
print("\t--dna-overwrite-css overwrite dna.css, useful when modifying css in the script")
print("Examples:")
print("\tdefault: % blender2.5 -b -P BlendFileDnaExporter_25.py")
print("\twith options: % blender2.5 -b -P BlendFileDnaExporter_25.py -- --dna-keep-blend --dna-debug\n")
print("\tdefault: % blender2.5 --background -noaudio --python BlendFileDnaExporter_25.py")
print("\twith options: % blender2.5 --background -noaudio --python BlendFileDnaExporter_25.py -- --dna-keep-blend --dna-debug\n")
######################################################

@ -16,14 +16,14 @@ Below you have the help message with a list of options you can use.
Usage:
blender2.5 -b -P BlendFileDnaExporter_25.py [-- [options]]
blender2.5 --background -noaudio --python BlendFileDnaExporter_25.py [-- [options]]
Options:
--dna-keep-blend: doesn't delete the produced blend file DNA export to html
--dna-debug: sets the logging level to DEBUG (lots of additional info)
--dna-versioned saves version informations in the html and blend filenames
--dna-overwrite-css overwrite dna.css, useful when modifying css in the script
Examples:
default: % blender2.5 -b -P BlendFileDnaExporter_25.py
with options: % blender2.5 -b -P BlendFileDnaExporter_25.py -- --dna-keep-blend --dna-debug
default: % blender2.5 --background -noaudio --python BlendFileDnaExporter_25.py
with options: % blender2.5 --background -noaudio --python BlendFileDnaExporter_25.py -- --dna-keep-blend --dna-debug

@ -27,7 +27,7 @@ For HTML generation
-------------------
- Run this script from blenders root path once you have compiled blender
./blender.bin --background --python doc/python_api/sphinx_doc_gen.py
./blender.bin --background -noaudio --python doc/python_api/sphinx_doc_gen.py
This will generate python files in doc/python_api/sphinx-in/
providing ./blender.bin is or links to the blender executable
@ -94,7 +94,7 @@ else:
# for quick rebuilds
"""
rm -rf /b/doc/python_api/sphinx-* && \
./blender.bin --background --factory-startup --python doc/python_api/sphinx_doc_gen.py && \
./blender.bin --background -noaudio --factory-startup --python doc/python_api/sphinx_doc_gen.py && \
sphinx-build doc/python_api/sphinx-in doc/python_api/sphinx-out
"""

@ -48,7 +48,7 @@ SPHINXBASE=doc/python_api
if $DO_EXE_BLENDER ; then
# dont delete existing docs, now partial updates are used for quick builds.
$BLENDER --background --factory-startup --python $SPHINXBASE/sphinx_doc_gen.py
$BLENDER --background -noaudio --factory-startup --python $SPHINXBASE/sphinx_doc_gen.py
fi

@ -352,7 +352,7 @@ const float AUD_ChannelMapperReader::SURROUND71_ANGLES[] =
0.0f * M_PI / 180.0f,
0.0f * M_PI / 180.0f,
-110.0f * M_PI / 180.0f,
110.0f * M_PI / 180.0f
110.0f * M_PI / 180.0f,
-150.0f * M_PI / 180.0f,
150.0f * M_PI / 180.0f
};

@ -468,6 +468,7 @@ typedef struct {
GHOST_TKey key;
/** The ascii code for the key event ('\0' if none). */
char ascii;
char utf8_buf[6];
} GHOST_TEventKeyData;
typedef struct {

@ -55,6 +55,7 @@ public:
{
m_keyEventData.key = key;
m_keyEventData.ascii = '\0';
m_keyEventData.utf8_buf[0]= '\0';
m_data = &m_keyEventData;
}
@ -65,11 +66,13 @@ public:
* @param key The key code of the key.
* @param ascii The ascii code for the key event.
*/
GHOST_EventKey(GHOST_TUns64 msec, GHOST_TEventType type, GHOST_IWindow* window, GHOST_TKey key, char ascii)
GHOST_EventKey(GHOST_TUns64 msec, GHOST_TEventType type, GHOST_IWindow* window, GHOST_TKey key, char ascii, const char utf8_buf[6])
: GHOST_Event(msec, type, window)
{
m_keyEventData.key = key;
m_keyEventData.ascii = ascii;
if (utf8_buf) memcpy(m_keyEventData.utf8_buf, utf8_buf, sizeof(m_keyEventData.utf8_buf));
else m_keyEventData.utf8_buf[0]= '\0';
m_data = &m_keyEventData;
}

@ -931,7 +931,7 @@ OSStatus GHOST_SystemCarbon::handleKeyEvent(EventRef event)
} else {
type = GHOST_kEventKeyUp;
}
pushEvent( new GHOST_EventKey( getMilliSeconds(), type, window, key, ascii) );
pushEvent( new GHOST_EventKey( getMilliSeconds(), type, window, key, ascii, NULL) );
// }
break;

@ -1655,7 +1655,9 @@ GHOST_TSuccess GHOST_SystemCocoa::handleKeyEvent(void *eventPtr)
return GHOST_kFailure;
}
char utf8_buf[6]= {'\0'}; /* TODO, unicode input */
switch ([event type]) {
case NSKeyDown:
case NSKeyUp:
charsIgnoringModifiers = [event charactersIgnoringModifiers];
@ -1684,10 +1686,10 @@ GHOST_TSuccess GHOST_SystemCocoa::handleKeyEvent(void *eventPtr)
break; //Cmd-Q is directly handled by Cocoa
if ([event type] == NSKeyDown) {
pushEvent( new GHOST_EventKey([event timestamp]*1000, GHOST_kEventKeyDown, window, keyCode, ascii) );
pushEvent( new GHOST_EventKey([event timestamp]*1000, GHOST_kEventKeyDown, window, keyCode, ascii, utf8_buf) );
//printf("\nKey down rawCode=0x%x charsIgnoringModifiers=%c keyCode=%u ascii=%i %c",[event keyCode],[charsIgnoringModifiers length]>0?[charsIgnoringModifiers characterAtIndex:0]:' ',keyCode,ascii,ascii);
} else {
pushEvent( new GHOST_EventKey([event timestamp]*1000, GHOST_kEventKeyUp, window, keyCode, ascii) );
pushEvent( new GHOST_EventKey([event timestamp]*1000, GHOST_kEventKeyUp, window, keyCode, ascii, utf8_buf) );
//printf("\nKey up rawCode=0x%x charsIgnoringModifiers=%c keyCode=%u ascii=%i %c",[event keyCode],[charsIgnoringModifiers length]>0?[charsIgnoringModifiers characterAtIndex:0]:' ',keyCode,ascii,ascii);
}
break;

@ -441,7 +441,7 @@ GHOST_SystemSDL::processEvent(SDL_Event *sdl_event)
}
}
g_event= new GHOST_EventKey(getMilliSeconds(), type, window, gkey, sym);
g_event= new GHOST_EventKey(getMilliSeconds(), type, window, gkey, sym, NULL);
}
break;
}

@ -725,7 +725,8 @@ GHOST_EventKey* GHOST_SystemWin32::processKeyEvent(GHOST_IWindow *window, RAWINP
(LPSTR) &ascii, 1,
NULL,NULL);
event = new GHOST_EventKey(system->getMilliSeconds(), keyDown ? GHOST_kEventKeyDown: GHOST_kEventKeyUp, window, key, ascii);
/* TODO, last arg is utf8, need to pass utf8 arg */
event = new GHOST_EventKey(system->getMilliSeconds(), keyDown ? GHOST_kEventKeyDown: GHOST_kEventKeyUp, window, key, ascii, NULL);
#ifdef GHOST_DEBUG
std::cout << ascii << std::endl;

@ -89,6 +89,11 @@ GHOST_SystemX11(
abort(); //was return before, but this would just mean it will crash later
}
/* Open a connection to the X input manager */
#if defined(WITH_X11_XINPUT) && defined(X_HAVE_UTF8_STRING)
m_xim = XOpenIM(m_display, NULL, (char *)GHOST_X11_RES_NAME, (char *)GHOST_X11_RES_CLASS);
#endif
m_delete_window_atom
= XInternAtom(m_display, "WM_DELETE_WINDOW", True);
@ -141,6 +146,10 @@ GHOST_SystemX11(
GHOST_SystemX11::
~GHOST_SystemX11()
{
#if defined(WITH_X11_XINPUT) && defined(X_HAVE_UTF8_STRING)
XCloseIM(m_xim);
#endif
XCloseDisplay(m_display);
}
@ -500,9 +509,9 @@ GHOST_SystemX11::processEvent(XEvent *xe)
case KeyRelease:
{
XKeyEvent *xke = &(xe->xkey);
KeySym key_sym = XLookupKeysym(xke,0);
char ascii;
char utf8_buf[6]; /* 6 is enough for a utf8 char */
GHOST_TKey gkey = convertXKey(key_sym);
GHOST_TEventType type = (xke->type == KeyPress) ?
@ -512,13 +521,55 @@ GHOST_SystemX11::processEvent(XEvent *xe)
ascii = '\0';
}
#if defined(WITH_X11_XINPUT) && defined(X_HAVE_UTF8_STRING)
/* getting unicode on key-up events gives XLookupNone status */
if (xke->type == KeyPress) {
Status status;
int len;
/* use utf8 because its not locale depentant, from xorg docs */
if (!(len= Xutf8LookupString(window->getX11_XIC(), xke, utf8_buf, sizeof(utf8_buf), &key_sym, &status))) {
utf8_buf[0]= '\0';
}
if ((status == XLookupChars || status == XLookupBoth)) {
if ((unsigned char)utf8_buf[0] >= 32) { /* not an ascii control character */
/* do nothing for now, this is valid utf8 */
}
else {
utf8_buf[0]= '\0';
}
}
else if (status == XLookupKeySym) {
/* this key doesn't have a text representation, it is a command
key of some sort */;
}
else {
printf("Bad keycode lookup. Keysym 0x%x Status: %s\n",
(unsigned int) key_sym,
(status == XBufferOverflow ? "BufferOverflow" :
status == XLookupNone ? "XLookupNone" :
status == XLookupKeySym ? "XLookupKeySym" :
"Unknown status"));
printf("'%.*s' %p %p\n", len, utf8_buf, window->getX11_XIC(), m_xim);
}
}
else {
utf8_buf[0]= '\0';
}
#else
utf8_buf[0]= '\0';
#endif
g_event = new
GHOST_EventKey(
getMilliSeconds(),
type,
window,
gkey,
ascii
ascii,
utf8_buf
);
break;

@ -40,6 +40,12 @@
#include "GHOST_System.h"
#include "../GHOST_Types.h"
#if defined(WITH_X11_XINPUT) && defined(X_HAVE_UTF8_STRING)
# define GHOST_X11_RES_NAME "Blender" /* res_name */
# define GHOST_X11_RES_CLASS "Blender" /* res_class */
#endif
class GHOST_WindowX11;
/**
@ -203,6 +209,14 @@ public:
return m_display;
}
#if defined(WITH_X11_XINPUT) && defined(X_HAVE_UTF8_STRING)
XIM
getX11_XIM(
) {
return m_xim;
}
#endif
/* Helped function for get data from the clipboard. */
void getClipboard_xcout(XEvent evt, Atom sel, Atom target,
unsigned char **txt, unsigned long *len,
@ -258,6 +272,9 @@ public:
private :
Display * m_display;
#if defined(WITH_X11_XINPUT) && defined(X_HAVE_UTF8_STRING)
XIM m_xim;
#endif
/// The vector of windows that need to be updated.
std::vector<GHOST_WindowX11 *> m_dirty_windows;

@ -392,6 +392,13 @@ GHOST_WindowX11(
}
}
#if defined(WITH_X11_XINPUT) && defined(X_HAVE_UTF8_STRING)
m_xic = XCreateIC(m_system->getX11_XIM(), XNClientWindow, m_window, XNFocusWindow, m_window,
XNInputStyle, XIMPreeditNothing | XIMStatusNothing,
XNResourceName, GHOST_X11_RES_NAME, XNResourceClass,
GHOST_X11_RES_CLASS, NULL);
#endif
// Set the window icon
XWMHints *xwmhints = XAllocWMHints();
XImage *x_image, *mask_image;
@ -1304,6 +1311,13 @@ GHOST_WindowX11::
XSetSelectionOwner(m_display, Clipboard_atom, None, CurrentTime);
}
#if defined(WITH_X11_XINPUT) && defined(X_HAVE_UTF8_STRING)
if (m_xic) {
XDestroyIC(m_xic);
}
#endif
XDestroyWindow(m_display, m_window);
XFree(m_visual);
}

@ -221,6 +221,10 @@ public:
{ return NULL; }
#endif // WITH_X11_XINPUT
#if defined(WITH_X11_XINPUT) && defined(X_HAVE_UTF8_STRING)
XIC getX11_XIC() { return m_xic; }
#endif
/*
* Need this in case that we want start the window
* in FullScree or Maximized state.
@ -363,6 +367,10 @@ private :
XTablet m_xtablet;
#endif
#if defined(WITH_X11_XINPUT) && defined(X_HAVE_UTF8_STRING)
XIC m_xic;
#endif
void icccmSetState(int state);
int icccmGetState() const;

@ -9,5 +9,5 @@ bpy.context.user_preferences.edit.use_insertkey_xyz_to_rgb = False
bpy.context.user_preferences.inputs.select_mouse = 'RIGHT'
bpy.context.user_preferences.inputs.view_zoom_method = 'DOLLY'
bpy.context.user_preferences.inputs.view_zoom_axis = 'VERTICAL'
bpy.context.user_preferences.inputs.view_rotate_method = 'TRACKBALL'
bpy.context.user_preferences.inputs.view_rotate_method = 'TURNTABLE'
bpy.context.user_preferences.inputs.invert_mouse_zoom = False

@ -228,7 +228,7 @@ class BakeAction(Operator):
class ClearUselessActions(Operator):
"""Mark actions with no F-Curves for deletion after save+reload of """ \
"""file preserving "action libraries"""
"""file preserving \"action libraries\""""
bl_idname = "anim.clear_useless_actions"
bl_label = "Clear Useless Actions"
bl_options = {'REGISTER', 'UNDO'}

@ -122,7 +122,7 @@ class SelectCamera(Operator):
class SelectHierarchy(Operator):
'''Select object relative to the active objects position''' \
'''Select object relative to the active object's position''' \
'''in the hierarchy'''
bl_idname = "object.select_hierarchy"
bl_label = "Select Hierarchy"

@ -142,7 +142,7 @@ class AddPresetBase():
class ExecutePreset(Operator):
''' Executes a preset '''
'''Execute a preset'''
bl_idname = "script.execute_preset"
bl_label = "Execute a Python Preset"

@ -66,7 +66,7 @@ def guess_player_path(preset):
class PlayRenderedAnim(Operator):
'''Plays back rendered frames/movies using an external player'''
'''Play back rendered frames/movies using an external player'''
bl_idname = "render.play_rendered_anim"
bl_label = "Play Rendered Animation"
bl_options = {'REGISTER'}

@ -159,7 +159,7 @@ class VertexPaintDirt(Operator):
)
blur_iterations = IntProperty(
name="Blur Iterations",
description="Number times to blur the colors. (higher blurs more)",
description="Number times to blur the colors (higher blurs more)",
min=0, max=40,
default=1,
)

@ -51,7 +51,7 @@ struct PackedFile *newPackedFileMemory(void *mem, int memlen);
void packAll(struct Main *bmain, struct ReportList *reports);
/* unpack */
char *unpackFile(struct ReportList *reports, char *abs_name, char *local_name, struct PackedFile *pf, int how);
char *unpackFile(struct ReportList *reports, const char *abs_name, const char *local_name, struct PackedFile *pf, int how);
int unpackVFont(struct ReportList *reports, struct VFont *vfont, int how);
int unpackSound(struct Main *bmain, struct ReportList *reports, struct bSound *sound, int how);
int unpackImage(struct ReportList *reports, struct Image *ima, int how);

@ -41,8 +41,7 @@ if env['WITH_BF_QUICKTIME']:
if env['WITH_BF_SDL']:
incs += ' ' + env['BF_SDL_INC']
else:
defs.append('DISABLE_SDL')
defs.append('WITH_SDL')
if env['WITH_BF_OPENEXR']:
defs.append('WITH_OPENEXR')

@ -906,8 +906,8 @@ static void stampdata(Scene *scene, Object *camera, StampData *stamp_data, int d
if (scene->r.stamp & R_STAMP_MARKER) {
char *name = scene_find_last_marker_name(scene, CFRA);
if (name) strcpy(text, name);
if (name) BLI_strncpy(text, name, sizeof(text));
else strcpy(text, "<none>");
BLI_snprintf(stamp_data->marker, sizeof(stamp_data->marker), do_prefix ? "Marker %s":"%s", text);
@ -980,7 +980,7 @@ static void stampdata(Scene *scene, Object *camera, StampData *stamp_data, int d
if (scene->r.stamp & R_STAMP_SEQSTRIP) {
Sequence *seq= seq_foreground_frame_get(scene, scene->r.cfra);
if (seq) strcpy(text, seq->name+2);
if (seq) BLI_strncpy(text, seq->name+2, sizeof(text));
else strcpy(text, "<none>");
BLI_snprintf(stamp_data->strip, sizeof(stamp_data->strip), do_prefix ? "Strip %s":"%s", text);

@ -86,8 +86,8 @@ ModifierData *modifier_new(int type)
ModifierTypeInfo *mti = modifierType_getInfo(type);
ModifierData *md = MEM_callocN(mti->structSize, mti->structName);
// FIXME: we need to make the name always be unique somehow...
strcpy(md->name, mti->name);
/* note, this name must be made unique later */
BLI_strncpy(md->name, mti->name, sizeof(md->name));
md->type = type;
md->mode = eModifierMode_Realtime

@ -374,7 +374,7 @@ void nodeMakeDynamicType(bNode *node)
/*node->typeinfo= MEM_dupallocN(ntype);*/
bNodeType *newtype= MEM_callocN(sizeof(bNodeType), "dynamic bNodeType");
*newtype= *ntype;
strcpy(newtype->name, ntype->name);
BLI_strncpy(newtype->name, ntype->name, sizeof(newtype->name));
node->typeinfo= newtype;
}
}

@ -182,7 +182,7 @@ PackedFile *newPackedFile(ReportList *reports, const char *filename, const char
// convert relative filenames to absolute filenames
strcpy(name, filename);
BLI_strncpy(name, filename, sizeof(name));
BLI_path_abs(name, basepath);
// open the file
@ -240,7 +240,7 @@ void packAll(Main *bmain, ReportList *reports)
}
/*
#if 0
// attempt to create a function that generates an unique filename
// this will work when all funtions in fileops.c understand relative filenames...
@ -249,6 +249,7 @@ static char *find_new_name(char *name)
{
char tempname[FILE_MAXDIR + FILE_MAXFILE];
char *newname;
size_t len;
if (fop_exists(name)) {
for (number = 1; number <= 999; number++) {
@ -258,14 +259,12 @@ static char *find_new_name(char *name)
}
}
}
newname = mallocN(strlen(tempname) + 1, "find_new_name");
strcpy(newname, tempname);
return(newname);
len= strlen(tempname) + 1;
newname = MEM_mallocN(len, "find_new_name");
memcpy(newname, tempname, len * sizeof(char));
return newname;
}
*/
#endif
int writePackedFile(ReportList *reports, const char *filename, PackedFile *pf, int guimode)
{
@ -277,12 +276,12 @@ int writePackedFile(ReportList *reports, const char *filename, PackedFile *pf, i
if (guimode) {} //XXX waitcursor(1);
strcpy(name, filename);
BLI_strncpy(name, filename, sizeof(name));
BLI_path_abs(name, G.main->name);
if (BLI_exists(name)) {
for (number = 1; number <= 999; number++) {
sprintf(tempname, "%s.%03d_", name, number);
BLI_snprintf(tempname, sizeof(tempname), "%s.%03d_", name, number);
if (! BLI_exists(tempname)) {
if (BLI_copy_fileops(name, tempname) == RET_OK) {
remove_tmp = TRUE;
@ -342,7 +341,7 @@ int checkPackedFile(const char *filename, PackedFile *pf)
char buf[4096];
char name[FILE_MAXDIR + FILE_MAXFILE];
strcpy(name, filename);
BLI_strncpy(name, filename, sizeof(name));
BLI_path_abs(name, G.main->name);
if (stat(name, &st)) {
@ -392,9 +391,10 @@ there was an error or when the user desides to cancel the operation.
*/
char *unpackFile(ReportList *reports, char *abs_name, char *local_name, PackedFile *pf, int how)
char *unpackFile(ReportList *reports, const char *abs_name, const char *local_name, PackedFile *pf, int how)
{
char *newname = NULL, *temp = NULL;
char *newname = NULL;
const char *temp = NULL;
// char newabs[FILE_MAXDIR + FILE_MAXFILE];
// char newlocal[FILE_MAXDIR + FILE_MAXFILE];
@ -437,12 +437,11 @@ char *unpackFile(ReportList *reports, char *abs_name, char *local_name, PackedFi
}
if (temp) {
newname = MEM_mallocN(strlen(temp) + 1, "unpack_file newname");
strcpy(newname, temp);
newname= BLI_strdup(temp);
}
}
return (newname);
return newname;
}
@ -453,17 +452,17 @@ int unpackVFont(ReportList *reports, VFont *vfont, int how)
int ret_value = RET_ERROR;
if (vfont != NULL) {
strcpy(localname, vfont->name);
BLI_strncpy(localname, vfont->name, sizeof(localname));
BLI_splitdirstring(localname, fi);
sprintf(localname, "//fonts/%s", fi);
BLI_snprintf(localname, sizeof(localname), "//fonts/%s", fi);
newname = unpackFile(reports, vfont->name, localname, vfont->packedfile, how);
if (newname != NULL) {
ret_value = RET_OK;
freePackedFile(vfont->packedfile);
vfont->packedfile = NULL;
strcpy(vfont->name, newname);
BLI_strncpy(vfont->name, newname, sizeof(vfont->name));
MEM_freeN(newname);
}
}
@ -478,13 +477,13 @@ int unpackSound(Main *bmain, ReportList *reports, bSound *sound, int how)
int ret_value = RET_ERROR;
if (sound != NULL) {
strcpy(localname, sound->name);
BLI_strncpy(localname, sound->name, sizeof(localname));
BLI_splitdirstring(localname, fi);
sprintf(localname, "//sounds/%s", fi);
BLI_snprintf(localname, sizeof(localname), "//sounds/%s", fi);
newname = unpackFile(reports, sound->name, localname, sound->packedfile, how);
if (newname != NULL) {
strcpy(sound->name, newname);
BLI_strncpy(sound->name, newname, sizeof(sound->name));
MEM_freeN(newname);
freePackedFile(sound->packedfile);
@ -506,16 +505,16 @@ int unpackImage(ReportList *reports, Image *ima, int how)
int ret_value = RET_ERROR;
if (ima != NULL) {
strcpy(localname, ima->name);
BLI_strncpy(localname, ima->name, sizeof(localname));
BLI_splitdirstring(localname, fi);
sprintf(localname, "//textures/%s", fi);
BLI_snprintf(localname, sizeof(localname), "//textures/%s", fi);
newname = unpackFile(reports, ima->name, localname, ima->packedfile, how);
if (newname != NULL) {
ret_value = RET_OK;
freePackedFile(ima->packedfile);
ima->packedfile = NULL;
strcpy(ima->name, newname);
BLI_strncpy(ima->name, newname, sizeof(ima->name));
MEM_freeN(newname);
BKE_image_signal(ima, NULL, IMA_SIGNAL_RELOAD);
}

@ -2891,24 +2891,24 @@ void BKE_ptcache_disk_cache_rename(PTCacheID *pid, char *from, char *to)
char ext[MAX_PTCACHE_PATH];
/* save old name */
strcpy(old_name, pid->cache->name);
BLI_strncpy(old_name, pid->cache->name, sizeof(old_name));
/* get "from" filename */
strcpy(pid->cache->name, from);
BLI_strncpy(pid->cache->name, from, sizeof(pid->cache->name));
len = ptcache_filename(pid, old_filename, 0, 0, 0); /* no path */
ptcache_path(pid, path);
dir = opendir(path);
if(dir==NULL) {
strcpy(pid->cache->name, old_name);
BLI_strncpy(pid->cache->name, old_name, sizeof(pid->cache->name));
return;
}
BLI_snprintf(ext, sizeof(ext), "_%02u"PTCACHE_EXT, pid->stack_index);
/* put new name into cache */
strcpy(pid->cache->name, to);
BLI_strncpy(pid->cache->name, to, sizeof(pid->cache->name));
while ((de = readdir(dir)) != NULL) {
if (strstr(de->d_name, ext)) { /* do we have the right extension?*/
@ -2963,7 +2963,7 @@ void BKE_ptcache_load_external(PTCacheID *pid)
if(cache->index >= 0)
BLI_snprintf(ext, sizeof(ext), "_%02d"PTCACHE_EXT, cache->index);
else
strcpy(ext, PTCACHE_EXT);
BLI_strncpy(ext, PTCACHE_EXT, sizeof(ext));
while ((de = readdir(dir)) != NULL) {
if (strstr(de->d_name, ext)) { /* do we have the right extension?*/

@ -166,7 +166,7 @@ void unique_property(bProperty *first, bProperty *prop, int force)
int i= 0;
/* strip numbers */
strcpy(base_name, prop->name);
BLI_strncpy(base_name, prop->name, sizeof(base_name));
for(i= strlen(base_name)-1; (i>=0 && isdigit(base_name[i])); i--) {
base_name[i]= '\0';
}
@ -178,7 +178,7 @@ void unique_property(bProperty *first, bProperty *prop, int force)
strcat(new_name, num);
} while(get_property__internal(first, prop, new_name));
strcpy(prop->name, new_name);
BLI_strncpy(prop->name, new_name, sizeof(prop->name));
}
}
}
@ -257,7 +257,7 @@ void set_property(bProperty *prop, char *str)
*((float *)&prop->data)= (float)atof(str);
break;
case GPROP_STRING:
strcpy(prop->poin, str);
strcpy(prop->poin, str); /* TODO - check size? */
break;
}

@ -866,8 +866,8 @@ void seqbase_unique_name_recursive(ListBase *seqbasep, struct Sequence *seq)
SeqUniqueInfo sui;
char *dot;
sui.seq= seq;
strcpy(sui.name_src, seq->name+2);
strcpy(sui.name_dest, seq->name+2);
BLI_strncpy(sui.name_src, seq->name+2, sizeof(sui.name_src));
BLI_strncpy(sui.name_dest, seq->name+2, sizeof(sui.name_dest));
sui.count= 1;
sui.match= 1; /* assume the worst to start the loop */
@ -887,7 +887,7 @@ void seqbase_unique_name_recursive(ListBase *seqbasep, struct Sequence *seq)
seqbase_recursive_apply(seqbasep, seqbase_unique_name_recursive_cb, &sui);
}
strcpy(seq->name+2, sui.name_dest);
BLI_strncpy(seq->name+2, sui.name_dest, sizeof(seq->name)-2);
}
static const char *give_seqname_by_type(int type)
@ -1204,7 +1204,7 @@ static int seq_proxy_get_fname(SeqRenderData context, Sequence * seq, int cfra,
sorry folks, please rebuild your proxies... */
if (seq->flag & (SEQ_USE_PROXY_CUSTOM_DIR|SEQ_USE_PROXY_CUSTOM_FILE)) {
strcpy(dir, seq->strip->proxy->dir);
BLI_strncpy(dir, seq->strip->proxy->dir, sizeof(dir));
} else if (seq->type == SEQ_IMAGE) {
BLI_snprintf(dir, PROXY_MAXFILE, "%s/BL_proxy", seq->strip->dir);
} else {
@ -3364,9 +3364,9 @@ int seq_swap(Sequence *seq_a, Sequence *seq_b, const char **error_str)
SWAP(Sequence, *seq_a, *seq_b);
/* swap back names so animation fcurves dont get swapped */
strcpy(name, seq_a->name+2);
strcpy(seq_a->name+2, seq_b->name+2);
strcpy(seq_b->name+2, name);
BLI_strncpy(name, seq_a->name+2, sizeof(name));
BLI_strncpy(seq_a->name+2, seq_b->name+2, sizeof(seq_b->name)-2);
BLI_strncpy(seq_b->name+2, name, sizeof(seq_b->name)-2);
/* swap back opacity, and overlay mode */
SWAP(int, seq_a->blend_mode, seq_b->blend_mode);

@ -79,9 +79,9 @@ struct bSound* sound_new_file(struct Main *bmain, const char *filename)
char str[FILE_MAX];
char *path;
int len;
size_t len;
strcpy(str, filename);
BLI_strncpy(str, filename, sizeof(str));
path = /*bmain ? bmain->name :*/ G.main->name;

@ -992,7 +992,7 @@ void autotexname(Tex *tex)
if(tex->type==TEX_IMAGE) {
ima= tex->ima;
if(ima) {
strcpy(di, ima->name);
BLI_strncpy(di, ima->name, sizeof(di));
BLI_splitdirstring(di, fi);
strcpy(di, "I.");
strcat(di, fi);

@ -221,7 +221,7 @@
# else
# define _dummy_abort() (void)0
# endif
# ifdef __GNUC__ /* just want to check if __func__ is available */
# if defined(__GNUC__) || defined(_MSC_VER) /* just want to check if __func__ is available */
# define BLI_assert(a) \
do { \
if (!(a)) { \

@ -227,7 +227,7 @@ int BLI_move(const char *file, const char *to) {
// it has to be 'mv filename filename' and not
// 'mv filename destdir'
strcpy(str, to);
BLI_strncpy(str, to, sizeof(str));
// points 'to' to a directory ?
if (BLI_last_slash(str) == (str + strlen(str) - 1)) {
if (BLI_last_slash(file) != NULL) {
@ -252,7 +252,7 @@ int BLI_copy_fileops(const char *file, const char *to) {
// it has to be 'cp filename filename' and not
// 'cp filename destdir'
strcpy(str, to);
BLI_strncpy(str, to, sizeof(str));
// points 'to' to a directory ?
if (BLI_last_slash(str) == (str + strlen(str) - 1)) {
if (BLI_last_slash(file) != NULL) {
@ -286,7 +286,7 @@ void BLI_recurdir_fileops(const char *dirname) {
// blah1/blah2/ (with slash) after creating
// blah1/blah2 (without slash)
strcpy(tmp, dirname);
BLI_strncpy(tmp, dirname, sizeof(tmp));
lslash= BLI_last_slash(tmp);
if (lslash == tmp + strlen(tmp) - 1) {
@ -371,7 +371,7 @@ void BLI_recurdir_fileops(const char *dirname) {
if (BLI_exists(dirname)) return;
strcpy(tmp, dirname);
BLI_strncpy(tmp, dirname, sizeof(tmp));
lslash= BLI_last_slash(tmp);
if (lslash) {

@ -364,7 +364,7 @@ static VFontData *objfnt_to_ftvfontdata(PackedFile * pf)
// get the name
fontname = FT_Get_Postscript_Name(face);
strcpy(vfd->name, (fontname == NULL) ? "" : fontname);
BLI_strncpy(vfd->name, (fontname == NULL) ? "" : fontname, sizeof(vfd->name));
// Extract the first 256 character from TTF
lcode= charcode= FT_Get_First_Char(face, &glyph_index);

@ -304,15 +304,15 @@ void BLI_adddirstrings(void)
for(num=0, file= files; num<actnum; num++, file++){
#ifdef WIN32
mode = 0;
strcpy(file->mode1, types[0]);
strcpy(file->mode2, types[0]);
strcpy(file->mode3, types[0]);
BLI_strncpy(file->mode1, types[0], sizeof(file->mode1));
BLI_strncpy(file->mode2, types[0], sizeof(file->mode2));
BLI_strncpy(file->mode3, types[0], sizeof(file->mode3));
#else
mode = file->s.st_mode;
strcpy(file->mode1, types[(mode & 0700) >> 6]);
strcpy(file->mode2, types[(mode & 0070) >> 3]);
strcpy(file->mode3, types[(mode & 0007)]);
BLI_strncpy(file->mode1, types[(mode & 0700) >> 6], sizeof(file->mode1));
BLI_strncpy(file->mode2, types[(mode & 0070) >> 3], sizeof(file->mode2));
BLI_strncpy(file->mode3, types[(mode & 0007)], sizeof(file->mode3));
if (((mode & S_ISGID) == S_ISGID) && (file->mode2[2]=='-'))file->mode2[2]='l';

@ -252,7 +252,7 @@ void BLO_library_append_end(const struct bContext *C, struct Main *mainl, BlendH
void *BLO_library_read_struct(struct FileData *fd, struct BHead *bh, const char *blockname);
BlendFileData* blo_read_blendafterruntime(int file, char *name, int actualsize, struct ReportList *reports);
BlendFileData* blo_read_blendafterruntime(int file, const char *name, int actualsize, struct ReportList *reports);
#ifdef __cplusplus
}

@ -42,8 +42,8 @@ extern "C" {
struct BlendFileData;
struct ReportList;
int BLO_is_a_runtime(char *file);
struct BlendFileData *BLO_read_runtime(char *file, struct ReportList *reports);
int BLO_is_a_runtime(const char *file);
struct BlendFileData *BLO_read_runtime(const char *file, struct ReportList *reports);
#ifdef __cplusplus
}

@ -288,7 +288,7 @@ BlendFileData *BLO_read_from_memfile(Main *oldmain, const char *filename, MemFil
fd = blo_openblendermemfile(memfile, reports);
if (fd) {
fd->reports= reports;
strcpy(fd->relabase, filename);
BLI_strncpy(fd->relabase, filename, sizeof(fd->relabase));
/* clear ob->proxy_from pointers in old main */
blo_clear_proxy_pointers_from_lib(oldmain);

@ -9416,7 +9416,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
simasel->prv_h = 96;
simasel->prv_w = 96;
simasel->flag = 7; /* ??? elubie */
strcpy (simasel->dir, U.textudir); /* TON */
BLI_strncpy (simasel->dir, U.textudir, sizeof(simasel->dir)); /* TON */
simasel->file[0]= '\0';
simasel->returnfunc = NULL;
@ -9639,7 +9639,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
ct= MEM_callocN(sizeof(bConstraintTarget), "PyConTarget");
ct->tar = data->tar;
strcpy(ct->subtarget, data->subtarget);
BLI_strncpy(ct->subtarget, data->subtarget, sizeof(ct->subtarget));
ct->space = con->tarspace;
BLI_addtail(&data->targets, ct);
@ -9669,7 +9669,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
ct= MEM_callocN(sizeof(bConstraintTarget), "PyConTarget");
ct->tar = data->tar;
strcpy(ct->subtarget, data->subtarget);
BLI_strncpy(ct->subtarget, data->subtarget, sizeof(ct->subtarget));
ct->space = con->tarspace;
BLI_addtail(&data->targets, ct);
@ -12149,8 +12149,8 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
aa->flag = ia->flag;
aa->sta = ia->sta;
aa->end = ia->end;
strcpy(aa->name, ia->name);
strcpy(aa->frameProp, ia->frameProp);
BLI_strncpy(aa->name, ia->name, sizeof(aa->name));
BLI_strncpy(aa->frameProp, ia->frameProp, sizeof(aa->frameProp));
if (ob->adt)
aa->act = ob->adt->action;
@ -13847,8 +13847,8 @@ static void read_libraries(FileData *basefd, ListBase *mainlist)
printf(" enter a new path:\n");
if(scanf("%s", newlib_path) > 0) {
strcpy(mainptr->curlib->name, newlib_path);
strcpy(mainptr->curlib->filepath, newlib_path);
BLI_strncpy(mainptr->curlib->name, newlib_path, sizeof(mainptr->curlib->name));
BLI_strncpy(mainptr->curlib->filepath, newlib_path, sizeof(mainptr->curlib->filepath));
cleanup_path(G.main->name, mainptr->curlib->filepath);
fd= blo_openblenderfile(mainptr->curlib->filepath, basefd->reports);
@ -13964,7 +13964,7 @@ static void read_libraries(FileData *basefd, ListBase *mainlist)
/* reading runtime */
BlendFileData *blo_read_blendafterruntime(int file, char *name, int actualsize, ReportList *reports)
BlendFileData *blo_read_blendafterruntime(int file, const char *name, int actualsize, ReportList *reports)
{
BlendFileData *bfd = NULL;
FileData *fd = filedata_new();

@ -68,7 +68,7 @@ static int handle_read_msb_int(int handle)
return (buf[0]<<24) + (buf[1]<<16) + (buf[2]<<8) + (buf[3]<<0);
}
int BLO_is_a_runtime(char *path)
int BLO_is_a_runtime(const char *path)
{
int res= 0, fd= open(path, O_BINARY|O_RDONLY, 0);
int datastart;
@ -97,7 +97,7 @@ cleanup:
return res;
}
BlendFileData *BLO_read_runtime(char *path, ReportList *reports)
BlendFileData *BLO_read_runtime(const char *path, ReportList *reports)
{
BlendFileData *bfd= NULL;
size_t actualsize;

@ -691,7 +691,7 @@ void AnimationImporter::apply_matrix_curves( Object * ob, std::vector<FCurve*>&
if (is_joint)
BLI_snprintf(rna_path, sizeof(rna_path), "%s.%s", joint_path, tm_str);
else
strcpy(rna_path, tm_str);
BLI_strncpy(rna_path, tm_str, sizeof(rna_path));
newcu[i] = create_fcurve(axis, rna_path);
newcu[i]->totvert = frames.size();
}
@ -1246,7 +1246,7 @@ Object *AnimationImporter::translate_animation_OLD(COLLADAFW::Node *node,
if (is_joint)
BLI_snprintf(rna_path, sizeof(rna_path), "%s.%s", joint_path, tm_str);
else
strcpy(rna_path, tm_str);
BLI_strncpy(rna_path, tm_str, sizeof(rna_path));
newcu[i] = create_fcurve(axis, rna_path);
#ifdef ARMATURE_TEST

@ -824,7 +824,7 @@ static void joined_armature_fix_links(Object *tarArm, Object *srcArm, bPoseChann
}
else if (strcmp(ct->subtarget, pchan->name)==0) {
ct->tar = tarArm;
strcpy(ct->subtarget, curbone->name);
BLI_strncpy(ct->subtarget, curbone->name, sizeof(ct->subtarget));
}
}
}
@ -871,7 +871,7 @@ static void joined_armature_fix_links(Object *tarArm, Object *srcArm, bPoseChann
}
else if (strcmp(ct->subtarget, pchan->name)==0) {
ct->tar = tarArm;
strcpy(ct->subtarget, curbone->name);
BLI_strncpy(ct->subtarget, curbone->name, sizeof(ct->subtarget));
}
}
}
@ -2503,7 +2503,7 @@ void updateDuplicateSubtargetObjects(EditBone *dupBone, ListBase *editbones, Obj
*/
if (oldtarget->temp) {
newtarget = (EditBone *) oldtarget->temp;
strcpy(ct->subtarget, newtarget->name);
BLI_strncpy(ct->subtarget, newtarget->name, sizeof(ct->subtarget));
}
}
}

@ -997,11 +997,8 @@ static void poselib_preview_apply (bContext *C, wmOperator *op)
}
/* get marker name */
if (pld->marker)
strcpy(markern, pld->marker->name);
else
strcpy(markern, "No Matches");
BLI_strncpy(markern, pld->marker ? pld->marker->name : "No Matches", sizeof(markern));
sprintf(pld->headerstr, "PoseLib Previewing Pose: Filter - [%s] | Current Pose - \"%s\" | Use ScrollWheel or PageUp/Down to change", tempstr, markern);
ED_area_headerprint(pld->sa, pld->headerstr);
}
@ -1186,7 +1183,7 @@ static int poselib_preview_handle_event (bContext *UNUSED(C), wmOperator *op, wm
/* backup stuff that needs to occur before every operation
* - make a copy of searchstr, so that we know if cache needs to be rebuilt
*/
strcpy(pld->searchold, pld->searchstr);
BLI_strncpy(pld->searchold, pld->searchstr, sizeof(pld->searchold));
/* if we're currently showing the original pose, only certain events are handled */
if (pld->flag & PL_PREVIEW_SHOWORIGINAL) {

@ -1197,7 +1197,7 @@ void POSE_OT_paste (wmOperatorType *ot)
/* identifiers */
ot->name= "Paste Pose";
ot->idname= "POSE_OT_paste";
ot->description= "Pastes the stored pose on to the current pose";
ot->description= "Paste the stored pose on to the current pose";
/* api callbacks */
ot->exec= pose_paste_exec;

@ -1046,7 +1046,7 @@ void FONT_OT_change_spacing(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
RNA_def_int(ot->srna, "delta", 1, -20, 20, "Delta", "Amount to decrease or increasing character spacing with", -20, 20);
RNA_def_int(ot->srna, "delta", 1, -20, 20, "Delta", "Amount to decrease or increase character spacing with", -20, 20);
}
/************************* change character **********************/

@ -311,7 +311,7 @@ void copy_gpdata ()
gpln= MEM_callocN(sizeof(bGPDlayer), "GPCopyPasteLayer");
gpln->frames.first= gpln->frames.last= NULL;
strcpy(gpln->info, gpls->info);
BLI_strncpy(gpln->info, gpls->info, sizeof(gpln->info));
BLI_addtail(&gpcopybuf, gpln);

@ -1747,7 +1747,9 @@ int ui_set_but_string(bContext *C, uiBut *but, const char *str)
}
else if(but->type == TEX) {
/* string */
BLI_strncpy(but->poin, str, but->hardmax);
if(ui_is_but_utf8(but)) BLI_strncpy_utf8(but->poin, str, but->hardmax);
else BLI_strncpy(but->poin, str, but->hardmax);
return 1;
}
else if(but->type == SEARCH_MENU) {
@ -2559,6 +2561,24 @@ static uiBut *ui_def_but(uiBlock *block, int type, int retval, const char *str,
if(block->curlayout)
ui_layout_add_but(block->curlayout, but);
#ifdef WITH_PYTHON_UI_INFO
{
extern void PyC_FileAndNum_Safe(const char **filename, int *lineno);
const char *fn;
int lineno= -1;
PyC_FileAndNum_Safe(&fn, &lineno);
if (lineno != -1) {
BLI_strncpy(but->py_dbg_fn, fn, sizeof(but->py_dbg_fn));
but->py_dbg_ln= lineno;
}
else {
but->py_dbg_fn[0]= '\0';
but->py_dbg_ln= -1;
}
}
#endif /* WITH_PYTHON_UI_INFO */
return but;
}

@ -115,7 +115,7 @@ int ui_but_anim_expression_set(uiBut *but, const char *str)
driver= fcu->driver;
if(driver && driver->type == DRIVER_TYPE_PYTHON) {
BLI_strncpy(driver->expression, str, sizeof(driver->expression));
BLI_strncpy_utf8(driver->expression, str, sizeof(driver->expression));
driver->flag |= DRIVER_FLAG_RECOMPILE;
WM_event_add_notifier(but->block->evil_C, NC_ANIMATION|ND_KEYFRAME, NULL);
return 1;
@ -164,7 +164,7 @@ int ui_but_anim_expression_create(uiBut *but, const char *str)
/* set the expression */
// TODO: need some way of identifying variables used
BLI_strncpy(driver->expression, str, sizeof(driver->expression));
BLI_strncpy_utf8(driver->expression, str, sizeof(driver->expression));
/* FIXME: for now, assume that
* - for expressions, users are likely to be using "frame" -> current frame" as a variable

@ -108,6 +108,12 @@ typedef enum uiHandleButtonState {
BUTTON_STATE_EXIT
} uiHandleButtonState;
typedef enum uiButtonJumpType {
BUTTON_EDIT_JUMP_NONE,
BUTTON_EDIT_JUMP_DELIM,
BUTTON_EDIT_JUMP_ALL
} uiButtonJumpType;
typedef struct uiHandleButtonData {
wmWindowManager *wm;
wmWindow *window;
@ -261,7 +267,7 @@ static int ui_is_a_warp_but(uiBut *but)
}
/* file selectors are exempt from utf-8 checks */
static int ui_is_utf8_but(uiBut *but)
int ui_is_but_utf8(uiBut *but)
{
if (but->rnaprop) {
const int subtype= RNA_property_subtype(but->rnaprop);
@ -1174,7 +1180,10 @@ static void ui_but_copy_paste(bContext *C, uiBut *but, uiHandleButtonData *data,
}
else {
button_activate_state(C, but, BUTTON_STATE_TEXT_EDITING);
BLI_strncpy(active_data->str, buf, active_data->maxlen);
if(ui_is_but_utf8(but)) BLI_strncpy_utf8(active_data->str, buf, active_data->maxlen);
else BLI_strncpy(active_data->str, buf, active_data->maxlen);
if(but->type == SEARCH_MENU) {
/* else uiSearchboxData.active member is not updated [#26856] */
ui_searchbox_update(C, data->searchbox, but, 1);
@ -1293,18 +1302,18 @@ static int ui_textedit_step_prev_utf8(const char *str, size_t UNUSED(maxlen), sh
static void ui_textedit_step_utf8(const char *str, size_t maxlen,
short *pos, const char direction,
const short do_jump, const short do_all)
uiButtonJumpType jump)
{
const short pos_prev= *pos;
if(direction) { /* right*/
if(do_jump) {
if(jump != BUTTON_EDIT_JUMP_NONE) {
/* jump between special characters (/,\,_,-, etc.),
* look at function test_special_char() for complete
* list of special character, ctr -> */
while((*pos) < maxlen) {
if (ui_textedit_step_next_utf8(str, maxlen, pos)) {
if(!do_all && test_special_char(str[(*pos)])) break;
if((jump != BUTTON_EDIT_JUMP_ALL) && test_special_char(str[(*pos)])) break;
}
else {
break; /* unlikely but just incase */
@ -1316,7 +1325,7 @@ static void ui_textedit_step_utf8(const char *str, size_t maxlen,
}
}
else { /* left */
if(do_jump) {
if(jump != BUTTON_EDIT_JUMP_NONE) {
/* left only: compensate for index/change in direction */
ui_textedit_step_prev_utf8(str, maxlen, pos);
@ -1325,7 +1334,7 @@ static void ui_textedit_step_utf8(const char *str, size_t maxlen,
* list of special character, ctr -> */
while ((*pos) > 0) {
if (ui_textedit_step_prev_utf8(str, maxlen, pos)) {
if(!do_all && test_special_char(str[(*pos)])) break;
if((jump != BUTTON_EDIT_JUMP_ALL) && test_special_char(str[(*pos)])) break;
}
else {
break;
@ -1439,27 +1448,28 @@ static void ui_textedit_set_cursor_select(uiBut *but, uiHandleButtonData *data,
ui_check_but(but);
}
static int ui_textedit_type_ascii(uiBut *but, uiHandleButtonData *data, char ascii)
/* note: utf8 & ascii funcs should be merged */
static int ui_textedit_type_utf8(uiBut *but, uiHandleButtonData *data, const char utf8_buf[6])
{
char *str;
int len, x, changed= 0;
int len, changed= 0;
str= data->str;
len= strlen(str);
if(len-(but->selend - but->selsta)+1 <= data->maxlen) {
int step= BLI_strnlen(utf8_buf, sizeof(utf8_buf));
/* type over the current selection */
if ((but->selend - but->selsta) > 0)
if ((but->selend - but->selsta) > 0) {
changed= ui_textedit_delete_selection(but, data);
len= strlen(str);
}
len= strlen(str);
if(len+1 < data->maxlen) {
for(x= data->maxlen; x>but->pos; x--)
str[x]= str[x-1];
str[but->pos]= ascii;
str[len+1]= '\0';
but->pos++;
if(len + step < data->maxlen) {
memmove(&str[but->pos + step], &str[but->pos], (len + 1) - but->pos);
memcpy(&str[but->pos], utf8_buf, step * sizeof(char));
but->pos += step;
changed= 1;
}
}
@ -1467,7 +1477,13 @@ static int ui_textedit_type_ascii(uiBut *but, uiHandleButtonData *data, char asc
return changed;
}
static void ui_textedit_move(uiBut *but, uiHandleButtonData *data, int direction, int select, int jump, int jump_all)
static int ui_textedit_type_ascii(uiBut *but, uiHandleButtonData *data, char ascii)
{
char utf8_buf[6]= {ascii, '\0'};
return ui_textedit_type_utf8(but, data, utf8_buf);
}
static void ui_textedit_move(uiBut *but, uiHandleButtonData *data, int direction, int select, uiButtonJumpType jump)
{
const char *str= data->str;
const int len= strlen(str);
@ -1476,7 +1492,7 @@ static void ui_textedit_move(uiBut *but, uiHandleButtonData *data, int direction
/* special case, quit selection and set cursor */
if (has_sel && !select) {
if (jump_all) {
if (jump == BUTTON_EDIT_JUMP_ALL) {
but->selsta = but->selend= but->pos = direction ? len : 0;
}
else {
@ -1490,7 +1506,7 @@ static void ui_textedit_move(uiBut *but, uiHandleButtonData *data, int direction
data->selextend = 0;
}
else {
ui_textedit_step_utf8(str, len, &but->pos, direction, jump, jump_all);
ui_textedit_step_utf8(str, len, &but->pos, direction, jump);
if(select) {
/* existing selection */
@ -1539,35 +1555,33 @@ static void ui_textedit_move(uiBut *but, uiHandleButtonData *data, int direction
}
}
static int ui_textedit_delete(uiBut *but, uiHandleButtonData *data, int direction, const int all, const int jump)
static int ui_textedit_delete(uiBut *but, uiHandleButtonData *data, int direction, uiButtonJumpType jump)
{
char *str= data->str;
const int len= strlen(str);
int x, changed= 0;
int changed= 0;
if(all) {
if(jump == BUTTON_EDIT_JUMP_ALL) {
if(len) changed=1;
str[0]= 0;
str[0]= '\0';
but->pos= 0;
}
else if(direction) { /* delete */
if ((but->selend - but->selsta) > 0) {
changed= ui_textedit_delete_selection(but, data);
}
else if(but->pos>=0 && but->pos<len) {
else if (but->pos>=0 && but->pos<len) {
short pos= but->pos;
int step;
ui_textedit_step_utf8(str, len, &pos, direction, jump, all);
ui_textedit_step_utf8(str, len, &pos, direction, jump);
step= pos - but->pos;
for(x=but->pos; x<len; x++)
str[x]= str[x+step];
str[len-step]='\0';
memmove(&str[but->pos], &str[but->pos + step], (len + 1) - but->pos);
changed= 1;
}
}
else { /* backspace */
if(len!=0) {
if (len != 0) {
if ((but->selend - but->selsta) > 0) {
changed= ui_textedit_delete_selection(but, data);
}
@ -1575,13 +1589,9 @@ static int ui_textedit_delete(uiBut *but, uiHandleButtonData *data, int directio
short pos= but->pos;
int step;
ui_textedit_step_utf8(str, len, &pos, direction, jump, all);
ui_textedit_step_utf8(str, len, &pos, direction, jump);
step= but->pos - pos;
for(x=but->pos; x<len; x++)
str[x-step]= str[x];
str[len-step]='\0';
memmove(&str[but->pos - step], &str[but->pos], (len + 1) - but->pos);
but->pos -= step;
changed= 1;
}
@ -1691,19 +1701,9 @@ static void ui_textedit_begin(bContext *C, uiBut *but, uiHandleButtonData *data)
ui_get_but_string(but, data->str, data->maxlen);
if(ELEM3(but->type, NUM, NUMABS, NUMSLI)) {
/* XXX: we dont have utf editing yet so for numbers its best to strip out utf chars
* this is so the deg' synbol isnt included in number editing fields: bug 22274 */
int i;
for(i=0; data->str[i]; i++) {
if(!isascii(data->str[i])) {
/* no stripping actually: just convert to alt name */
ui_convert_to_unit_alt_name(but, data->str, data->maxlen);
break;
}
}
ui_convert_to_unit_alt_name(but, data->str, data->maxlen);
}
data->origstr= BLI_strdup(data->str);
data->selextend= 0;
data->selstartx= 0;
@ -1728,7 +1728,7 @@ static void ui_textedit_begin(bContext *C, uiBut *but, uiHandleButtonData *data)
static void ui_textedit_end(bContext *C, uiBut *but, uiHandleButtonData *data)
{
if(but) {
if(ui_is_utf8_but(but)) {
if(ui_is_but_utf8(but)) {
int strip= BLI_utf8_invalid_strip(but->editstr, strlen(but->editstr));
/* not a file?, strip non utf-8 chars */
if(strip) {
@ -1880,11 +1880,11 @@ static void ui_do_but_textedit(bContext *C, uiBlock *block, uiBut *but, uiHandle
}
break;
case RIGHTARROWKEY:
ui_textedit_move(but, data, 1, event->shift, event->ctrl, FALSE);
ui_textedit_move(but, data, 1, event->shift, event->ctrl ? BUTTON_EDIT_JUMP_DELIM : BUTTON_EDIT_JUMP_NONE);
retval= WM_UI_HANDLER_BREAK;
break;
case LEFTARROWKEY:
ui_textedit_move(but, data, 0, event->shift, event->ctrl, FALSE);
ui_textedit_move(but, data, 0, event->shift, event->ctrl ? BUTTON_EDIT_JUMP_DELIM : BUTTON_EDIT_JUMP_NONE);
retval= WM_UI_HANDLER_BREAK;
break;
case DOWNARROWKEY:
@ -1894,7 +1894,7 @@ static void ui_do_but_textedit(bContext *C, uiBlock *block, uiBut *but, uiHandle
}
/* pass on purposedly */
case ENDKEY:
ui_textedit_move(but, data, 1, event->shift, TRUE, TRUE);
ui_textedit_move(but, data, 1, event->shift, BUTTON_EDIT_JUMP_ALL);
retval= WM_UI_HANDLER_BREAK;
break;
case UPARROWKEY:
@ -1904,7 +1904,7 @@ static void ui_do_but_textedit(bContext *C, uiBlock *block, uiBut *but, uiHandle
}
/* pass on purposedly */
case HOMEKEY:
ui_textedit_move(but, data, 0, event->shift, TRUE, TRUE);
ui_textedit_move(but, data, 0, event->shift, BUTTON_EDIT_JUMP_ALL);
retval= WM_UI_HANDLER_BREAK;
break;
case PADENTER:
@ -1913,12 +1913,12 @@ static void ui_do_but_textedit(bContext *C, uiBlock *block, uiBut *but, uiHandle
retval= WM_UI_HANDLER_BREAK;
break;
case DELKEY:
changed= ui_textedit_delete(but, data, 1, 0, event->ctrl);
changed= ui_textedit_delete(but, data, 1, event->ctrl ? BUTTON_EDIT_JUMP_DELIM : BUTTON_EDIT_JUMP_NONE);
retval= WM_UI_HANDLER_BREAK;
break;
case BACKSPACEKEY:
changed= ui_textedit_delete(but, data, 0, event->shift, event->ctrl);
changed= ui_textedit_delete(but, data, 0, event->shift ? BUTTON_EDIT_JUMP_ALL : (event->ctrl ? BUTTON_EDIT_JUMP_DELIM : BUTTON_EDIT_JUMP_NONE));
retval= WM_UI_HANDLER_BREAK;
break;
@ -1950,7 +1950,16 @@ static void ui_do_but_textedit(bContext *C, uiBlock *block, uiBut *but, uiHandle
if(event->type == PADPERIOD && ascii == ',')
ascii = '.';
changed= ui_textedit_type_ascii(but, data, ascii);
if(event->utf8_buf[0] || 1) {
/* keep this printf until utf8 is well tested */
printf("%s: utf8 char '%s'\n", __func__, event->utf8_buf);
// strcpy(event->utf8_buf, "12345");
changed= ui_textedit_type_utf8(but, data, event->utf8_buf);
}
else {
changed= ui_textedit_type_ascii(but, data, ascii);
}
retval= WM_UI_HANDLER_BREAK;
}
@ -4531,6 +4540,17 @@ static int ui_but_menu(bContext *C, uiBut *but)
}
}
#ifdef WITH_PYTHON_UI_INFO
if (but->py_dbg_ln != -1) {
PointerRNA ptr_props;
WM_operator_properties_create(&ptr_props, "WM_OT_text_edit");
RNA_string_set(&ptr_props, "filepath", but->py_dbg_fn);
RNA_int_set(&ptr_props, "line", but->py_dbg_ln);
uiItemFullO(layout, "WM_OT_text_edit", "Edit Source", ICON_NONE, ptr_props.data, WM_OP_EXEC_DEFAULT, 0);
}
#endif /* WITH_PYTHON_UI_INFO */
uiPupMenuEnd(C, pup);
return 1;

@ -252,6 +252,11 @@ struct uiBut {
/* pointer back */
uiBlock *block;
#ifdef WITH_PYTHON_UI_INFO
char py_dbg_fn[240];
int py_dbg_ln;
#endif
};
struct uiBlock {
@ -368,6 +373,7 @@ extern void ui_check_but(uiBut *but);
extern int ui_is_but_float(uiBut *but);
extern int ui_is_but_unit(uiBut *but);
extern int ui_is_but_rna_valid(uiBut *but);
extern int ui_is_but_utf8(uiBut *but);
extern void ui_bounds_block(uiBlock *block);
extern void ui_block_translate(uiBlock *block, int x, int y);

@ -759,18 +759,28 @@ static uiLayout *draw_modifier(uiLayout *layout, Scene *scene, Object *ob, Modif
if (mti->flags & eModifierTypeFlag_SupportsEditmode)
uiItemR(row, &ptr, "show_in_editmode", 0, "", ICON_NONE);
}
if ((ob->type==OB_MESH) && modifier_couldBeCage(scene, md) && (index <= lastCageIndex))
{
/* -- convert to rna ? */
but = uiDefIconButBitI(block, TOG, eModifierMode_OnCage, 0, ICON_MESH_DATA, 0, 0, UI_UNIT_X-2, UI_UNIT_Y, &md->mode, 0.0, 0.0, 0.0, 0.0,
UI_translate_do_tooltip(N_("Apply modifier to editing cage during Editmode")));
if (index < cageIndex)
uiButSetFlag(but, UI_BUT_DISABLED);
uiButSetFunc(but, modifiers_setOnCage, ob, md);
}
/* tesselation point for curve-typed objects */
if (ELEM3(ob->type, OB_CURVE, OB_SURF, OB_FONT)) {
if (ob->type==OB_MESH) {
if (modifier_couldBeCage(scene, md) && (index <= lastCageIndex))
{
/* -- convert to rna ? */
but = uiDefIconButBitI(block, TOG, eModifierMode_OnCage, 0, ICON_MESH_DATA, 0, 0, UI_UNIT_X-2, UI_UNIT_Y, &md->mode, 0.0, 0.0, 0.0, 0.0,
UI_translate_do_tooltip(N_("Apply modifier to editing cage during Editmode")));
if (index < cageIndex)
uiButSetFlag(but, UI_BUT_DISABLED);
uiButSetFunc(but, modifiers_setOnCage, ob, md);
}
else {
uiBlockEndAlign(block);
/* place holder button */
uiBlockSetEmboss(block, UI_EMBOSSN);
but= uiDefIconBut(block, BUT, 0, ICON_NONE, 0, 0, UI_UNIT_X-2, UI_UNIT_Y, NULL, 0.0, 0.0, 0.0, 0.0, NULL);
uiButSetFlag(but, UI_BUT_DISABLED);
uiBlockSetEmboss(block, UI_EMBOSS);
}
} /* tesselation point for curve-typed objects */
else if (ELEM3(ob->type, OB_CURVE, OB_SURF, OB_FONT)) {
/* some modifiers could work with pre-tesselated curves only */
if (ELEM3(md->type, eModifierType_Hook, eModifierType_Softbody, eModifierType_MeshDeform)) {
/* add disabled pre-tesselated button, so users could have

@ -1191,7 +1191,7 @@ void init_userdef_do_versions(void)
vDM_ColorBand_store((U.flag & USER_CUSTOM_RANGE) ? (&U.coba_weight):NULL);
if (bmain->versionfile <= 191) {
strcpy(U.plugtexdir, U.textudir);
BLI_strncpy(U.plugtexdir, U.textudir, sizeof(U.plugtexdir));
strcpy(U.sounddir, "/");
}

@ -246,7 +246,7 @@ static void set_constraint_nth_target (bConstraint *con, Object *target, const c
for (ct=targets.first, i=0; ct; ct= ct->next, i++) {
if (i == index) {
ct->tar= target;
strcpy(ct->subtarget, subtarget);
BLI_strncpy(ct->subtarget, subtarget, sizeof(ct->subtarget));
break;
}
}

@ -585,7 +585,7 @@ void OBJECT_OT_posemode_toggle(wmOperatorType *ot)
/* identifiers */
ot->name= "Toggle Pose Mode";
ot->idname= "OBJECT_OT_posemode_toggle";
ot->description= "Enables or disables posing/selecting bones";
ot->description= "Enable or disable posing/selecting bones";
/* api callbacks */
ot->exec= posemode_exec;

@ -837,7 +837,7 @@ void OBJECT_OT_hook_select(wmOperatorType *ot)
/* identifiers */
ot->name= "Select Hook";
ot->description= "Selects effected vertices on mesh";
ot->description= "Select affected vertices on mesh";
ot->idname= "OBJECT_OT_hook_select";
/* callbacks */

@ -334,11 +334,9 @@ static int make_proxy_exec (bContext *C, wmOperator *op)
/* Add new object for the proxy */
newob= add_object(scene, OB_EMPTY);
if (gob)
strcpy(name, gob->id.name+2);
else
strcpy(name, ob->id.name+2);
strcat(name, "_proxy");
BLI_snprintf(name, sizeof(name), "%s_proxy", ((ID *)(gob ? gob : ob))->name);
rename_id(&newob->id, name);
/* set layers OK */
@ -605,7 +603,7 @@ static int parent_set_exec(bContext *C, wmOperator *op)
/* handle types */
if (pchan)
strcpy(ob->parsubstr, pchan->name);
BLI_strncpy(ob->parsubstr, pchan->name, sizeof(ob->parsubstr));
else
ob->parsubstr[0]= 0;

@ -669,7 +669,7 @@ static void vgroup_duplicate(Object *ob)
}
cdg = defgroup_duplicate(dg);
strcpy(cdg->name, name);
BLI_strncpy(cdg->name, name, sizeof(cdg->name));
defgroup_unique_name(cdg, ob);
BLI_addtail(&ob->defbase, cdg);

@ -261,7 +261,7 @@ static Scene *preview_prepare_scene(Scene *scene, ID *id, int id_type, ShaderPre
sce->r.alphamode= R_ADDSKY;
sce->r.cfra= scene->r.cfra;
strcpy(sce->r.engine, scene->r.engine);
BLI_strncpy(sce->r.engine, scene->r.engine, sizeof(sce->r.engine));
if(id_type==ID_MA) {
Material *mat= NULL, *origmat= (Material *)id;

@ -649,7 +649,7 @@ static void SCREEN_OT_actionzone(wmOperatorType *ot)
ot->flag= OPTYPE_BLOCKING;
RNA_def_int(ot->srna, "modifier", 0, 0, 2, "modifier", "modifier state", 0, 2);
RNA_def_int(ot->srna, "modifier", 0, 0, 2, "Modifier", "Modifier state", 0, 2);
}
/* ************** swap area operator *********************************** */

@ -157,7 +157,7 @@ static int screenshot_exec(bContext *C, wmOperator *op)
RNA_string_get(op->ptr, "filepath", path);
strcpy(G.ima, path);
BLI_strncpy(G.ima, path, sizeof(G.ima));
BLI_path_abs(path, G.main->name);
/* BKE_add_image_extension() checks for if extension was already set */

@ -401,7 +401,7 @@ static void *image_undo_push_tile(Image *ima, ImBuf *ibuf, ImBuf **tmpibuf, int
*tmpibuf = IMB_allocImBuf(IMAPAINT_TILE_SIZE, IMAPAINT_TILE_SIZE, 32, IB_rectfloat|IB_rect);
tile= MEM_callocN(sizeof(UndoImageTile), "UndoImageTile");
strcpy(tile->idname, ima->id.name);
BLI_strncpy(tile->idname, ima->id.name, sizeof(tile->idname));
tile->x= x_tile;
tile->y= y_tile;
@ -409,7 +409,7 @@ static void *image_undo_push_tile(Image *ima, ImBuf *ibuf, ImBuf **tmpibuf, int
allocsize *= (ibuf->rect_float)? sizeof(float): sizeof(char);
tile->rect= MEM_mapallocN(allocsize, "UndeImageTile.rect");
strcpy(tile->ibufname, ibuf->name);
BLI_strncpy(tile->ibufname, ibuf->name, sizeof(tile->ibufname));
tile->gen_type= ima->gen_type;
tile->source= ima->source;

@ -262,7 +262,7 @@ SculptUndoNode *sculpt_undo_push_node(Object *ob, PBVHNode *node)
}
unode= MEM_callocN(sizeof(SculptUndoNode), "SculptUndoNode");
strcpy(unode->idname, ob->id.name);
BLI_strncpy(unode->idname, ob->id.name, sizeof(unode->idname));
unode->node= node;
BLI_pbvh_node_num_verts(ss->pbvh, node, &totvert, &allvert);

@ -704,8 +704,8 @@ void uiTemplateImage(uiLayout *layout, bContext *C, PointerRNA *ptr, const char
sprintf(str, "(%d) Frames:", iuser->framenr);
else strcpy(str, "Frames:");
uiBlockBeginAlign(block);
uiDefButI(block, NUM, imagechanged, str, 10, 90,150, 20, &iuser->frames, 0.0, MAXFRAMEF, 0, 0, "Sets the number of images of a movie to use");
uiDefButI(block, NUM, imagechanged, "StartFr:", 160,90,150,20, &iuser->sfra, 1.0, MAXFRAMEF, 0, 0, "Sets the global starting frame of the movie");
uiDefButI(block, NUM, imagechanged, str, 10, 90,150, 20, &iuser->frames, 0.0, MAXFRAMEF, 0, 0, "Number of images of a movie to use");
uiDefButI(block, NUM, imagechanged, "StartFr:", 160,90,150,20, &iuser->sfra, 1.0, MAXFRAMEF, 0, 0, "Global starting frame of the movie");
}
#endif
}

@ -160,7 +160,7 @@ void INFO_OT_select_pick(wmOperatorType *ot)
/* ot->flag= OPTYPE_REGISTER; */
/* properties */
RNA_def_int(ot->srna, "report_index", 0, 0, INT_MAX, "Report", "The index of the report", 0, INT_MAX);
RNA_def_int(ot->srna, "report_index", 0, 0, INT_MAX, "Report", "Index of the report", 0, INT_MAX);
}

@ -478,7 +478,7 @@ static int actuator_remove_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(e
static void LOGIC_OT_actuator_remove(wmOperatorType *ot)
{
ot->name= "Remove Actuator";
ot->description= "Remove a actuator from the active object";
ot->description= "Remove an actuator from the active object";
ot->idname= "LOGIC_OT_actuator_remove";
ot->invoke= actuator_remove_invoke;
@ -533,7 +533,7 @@ static void LOGIC_OT_actuator_add(wmOperatorType *ot)
/* identifiers */
ot->name= "Add Actuator";
ot->description = "Add a actuator to the active object";
ot->description = "Add an actuator to the active object";
ot->idname= "LOGIC_OT_actuator_add";
/* api callbacks */

@ -235,7 +235,7 @@ static int sequencer_add_scene_strip_exec(bContext *C, wmOperator *op)
strip->stripdata= MEM_callocN(seq->len*sizeof(StripElem), "stripelem");
strcpy(seq->name+2, sce_seq->id.name+2);
BLI_strncpy(seq->name+2, sce_seq->id.name+2, sizeof(seq->name)-2);
seqbase_unique_name_recursive(&ed->seqbase, seq);
seq->scene_sound = sound_scene_add_scene_sound(scene, seq, start_frame, start_frame + strip->len, 0);

@ -929,11 +929,11 @@ static void UNUSED_FUNCTION(seq_remap_paths)(Scene *scene)
if(last_seq==NULL)
return;
BLI_strncpy(from, last_seq->strip->dir, FILE_MAX);
BLI_strncpy(from, last_seq->strip->dir, sizeof(from));
// XXX if (0==sbutton(from, 0, sizeof(from)-1, "From: "))
// return;
strcpy(to, from);
BLI_strncpy(to, from, sizeof(to));
// XXX if (0==sbutton(to, 0, sizeof(to)-1, "To: "))
// return;

@ -136,7 +136,12 @@ static void text_listener(ScrArea *sa, wmNotifier *wmn)
switch(wmn->data) {
case ND_DISPLAY:
ED_area_tag_redraw(sa);
break;
case ND_CURSOR:
if(st->text && st->text == wmn->reference)
text_scroll_to_cursor(st, sa);
ED_area_tag_redraw(sa);
break;
}

@ -2583,6 +2583,9 @@ static int set_selection_invoke(bContext *C, wmOperator *op, wmEvent *event)
SpaceText *st= CTX_wm_space_text(C);
SetSelection *ssel;
if(event->mval[0]>=st->txtbar.xmin)
return OPERATOR_PASS_THROUGH;
op->customdata= MEM_callocN(sizeof(SetSelection), "SetCursor");
ssel= op->customdata;
ssel->selecting= RNA_boolean_get(op->ptr, "select");

@ -2955,7 +2955,7 @@ static TransData *ActionFCurveToTransData(TransData *td, TransData2D **td2dv, FC
TransData2D *td2d = *td2dv;
int i;
if (fcu == NULL)
if (ELEM(NULL, fcu, fcu->bezt))
return td;
for (i=0, bezt=fcu->bezt; i < fcu->totvert; i++, bezt++) {

@ -464,7 +464,7 @@ void UV_OT_minimize_stretch(wmOperatorType *ot)
/* identifiers */
ot->name= "Minimize Stretch";
ot->idname= "UV_OT_minimize_stretch";
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_GRAB_POINTER|OPTYPE_BLOCKING;
ot->description="Reduce UV stretching by relaxing angles";
/* api callbacks */

@ -1175,7 +1175,7 @@ static struct ImBuf * anim_getnew(struct anim * anim) {
case ANIM_SEQUENCE:
ibuf = IMB_loadiffname(anim->name, anim->ib_flags);
if (ibuf) {
strcpy(anim->first, anim->name);
BLI_strncpy(anim->first, anim->name, sizeof(anim->first));
anim->duration = 1;
}
break;

@ -342,27 +342,55 @@ static int imb_save_openexr_float(struct ImBuf *ibuf, const char *name, int flag
FrameBuffer frameBuffer;
OutputFile *file = new OutputFile(name, header);
int xstride = sizeof(float) * channels;
int ystride = - xstride*width;
float *rect[4] = {NULL, NULL, NULL, NULL};
int xstride = sizeof(float) * 4;
int ystride = xstride*width;
float *init_to = new float [4 * width*height * sizeof(float)];
float *from, *to = init_to;
/* last scanline, stride negative */
rect[0]= ibuf->rect_float + channels*(height-1)*width;
rect[1]= rect[0]+1;
rect[2]= rect[0]+2;
rect[3]= (channels >= 4)? rect[0]+3:rect[0]; /* red as alpha, is this needed since alpha isnt written? */
frameBuffer.insert ("R", Slice (FLOAT, (char *)rect[0], xstride, ystride));
frameBuffer.insert ("G", Slice (FLOAT, (char *)rect[1], xstride, ystride));
frameBuffer.insert ("B", Slice (FLOAT, (char *)rect[2], xstride, ystride));
frameBuffer.insert ("R", Slice (FLOAT, (char *)init_to, xstride, ystride));
frameBuffer.insert ("G", Slice (FLOAT, (char *)(init_to + 1), xstride, ystride));
frameBuffer.insert ("B", Slice (FLOAT, (char *)(init_to + 2), xstride, ystride));
if (ibuf->depth==32 && channels >= 4)
frameBuffer.insert ("A", Slice (FLOAT, (char *)rect[3], xstride, ystride));
frameBuffer.insert ("A", Slice (FLOAT, (char *)(init_to + 3), xstride, ystride));
if (write_zbuf)
frameBuffer.insert ("Z", Slice (FLOAT, (char *) (ibuf->zbuf_float + (height-1)*width),
sizeof(float), sizeof(float) * -width));
if(ibuf->profile == IB_PROFILE_LINEAR_RGB) {
for (int i = ibuf->y-1; i >= 0; i--)
{
from= ibuf->rect_float + channels*i*width;
for (int j = ibuf->x; j > 0; j--)
{
to[0] = from[0];
to[1] = from[1];
to[2] = from[2];
to[3] = (channels >= 4)? from[3]: 1.0f;
to+= 4; from += 4;
}
}
}
else {
for (int i = ibuf->y-1; i >= 0; i--)
{
from= ibuf->rect_float + channels*i*width;
for (int j = ibuf->x; j > 0; j--)
{
to[0] = srgb_to_linearrgb(from[0]);
to[1] = srgb_to_linearrgb(from[1]);
to[2] = srgb_to_linearrgb(from[2]);
to[3] = (channels >= 4)? from[3]: 1.0f;
to+= 4; from += 4;
}
}
}
file->setFrameBuffer (frameBuffer);
file->writePixels (height);
delete file;
delete [] init_to;
}
catch (const std::exception &exc)
{

@ -437,7 +437,8 @@ typedef struct SpaceLogic {
struct bGPdata *gpd; /* grease-pencil data */
} SpaceLogic;
/* note, this entire struct isnt used anymore!,
* may remove some day - campbell */
typedef struct SpaceImaSel {
SpaceLink *next, *prev;
ListBase regionbase; /* storage of regions for inactive spaces */

@ -132,7 +132,7 @@ static void rna_Action_fcurve_remove(bAction *act, ReportList *reports, FCurve *
}
}
static TimeMarker *rna_Action_pose_markers_new(bAction *act, ReportList *reports, const char name[])
static TimeMarker *rna_Action_pose_markers_new(bAction *act, const char name[])
{
TimeMarker *marker = MEM_callocN(sizeof(TimeMarker), "TimeMarker");
marker->flag= 1;
@ -550,7 +550,6 @@ static void rna_def_action_pose_markers(BlenderRNA *brna, PropertyRNA *cprop)
func= RNA_def_function(srna, "new", "rna_Action_pose_markers_new");
RNA_def_function_ui_description(func, "Add a pose marker to the action");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
parm= RNA_def_string(func, "name", "Marker", 0, "", "New name for the marker (not unique)");
RNA_def_property_flag(parm, PROP_REQUIRED);

@ -450,7 +450,7 @@ EnumPropertyItem *rna_Actuator_type_itemf(bContext *C, PointerRNA *ptr, Property
return item;
}
static void rna_Actuator_Armature_update(Main *bmain, Scene *scene, PointerRNA *ptr)
static void rna_Actuator_Armature_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
bActuator *act= (bActuator *)ptr->data;
bArmatureActuator *aa = act->data;

@ -80,6 +80,8 @@ static void rna_AnimData_action_set(PointerRNA *ptr, PointerRNA value)
/* wrapper for poll callback */
static int RKS_POLL_rna_internal(KeyingSetInfo *ksi, bContext *C)
{
extern FunctionRNA rna_KeyingSetInfo_poll_func;
PointerRNA ptr;
ParameterList list;
FunctionRNA *func;
@ -87,7 +89,7 @@ static int RKS_POLL_rna_internal(KeyingSetInfo *ksi, bContext *C)
int ok;
RNA_pointer_create(NULL, ksi->ext.srna, ksi, &ptr);
func= RNA_struct_find_function(&ptr, "poll");
func= &rna_KeyingSetInfo_poll_func; /* RNA_struct_find_function(&ptr, "poll"); */
RNA_parameter_list_create(&list, &ptr, func);
/* hook up arguments */
@ -108,12 +110,14 @@ static int RKS_POLL_rna_internal(KeyingSetInfo *ksi, bContext *C)
/* wrapper for iterator callback */
static void RKS_ITER_rna_internal(KeyingSetInfo *ksi, bContext *C, KeyingSet *ks)
{
extern FunctionRNA rna_KeyingSetInfo_iterator_func;
PointerRNA ptr;
ParameterList list;
FunctionRNA *func;
RNA_pointer_create(NULL, ksi->ext.srna, ksi, &ptr);
func= RNA_struct_find_function(&ptr, "iterator");
func= &rna_KeyingSetInfo_iterator_func; /* RNA_struct_find_function(&ptr, "poll"); */
RNA_parameter_list_create(&list, &ptr, func);
/* hook up arguments */
@ -129,12 +133,14 @@ static void RKS_ITER_rna_internal(KeyingSetInfo *ksi, bContext *C, KeyingSet *ks
/* wrapper for generator callback */
static void RKS_GEN_rna_internal(KeyingSetInfo *ksi, bContext *C, KeyingSet *ks, PointerRNA *data)
{
extern FunctionRNA rna_KeyingSetInfo_generate_func;
PointerRNA ptr;
ParameterList list;
FunctionRNA *func;
RNA_pointer_create(NULL, ksi->ext.srna, ksi, &ptr);
func= RNA_struct_find_function(&ptr, "generate");
func= &rna_KeyingSetInfo_generate_func; /* RNA_struct_find_generate(&ptr, "poll"); */
RNA_parameter_list_create(&list, &ptr, func);
/* hook up arguments */

@ -76,7 +76,7 @@ EnumPropertyItem boidruleset_type_items[] ={
#include "BKE_depsgraph.h"
#include "BKE_particle.h"
static void rna_Boids_reset(Main *bmain, Scene *scene, PointerRNA *ptr)
static void rna_Boids_reset(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
if(ptr->type==&RNA_ParticleSystem) {
ParticleSystem *psys = (ParticleSystem*)ptr->data;

@ -292,7 +292,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 *free)
static EnumPropertyItem *rna_Curve_fill_mode_itemf(bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *UNUSED(free))
{
Curve *cu= (Curve*)ptr->id.data;
@ -722,7 +722,7 @@ static void rna_def_bpoint(BlenderRNA *brna)
prop= RNA_def_property(srna, "weight", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "vec[3]");
RNA_def_property_ui_text(prop, "Weight", "Nurbs weight");
RNA_def_property_ui_text(prop, "Weight", "NURBS weight");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
/* Number values */
@ -1446,7 +1446,7 @@ static void rna_def_curve_nurb(BlenderRNA *brna)
srna= RNA_def_struct(brna, "Spline", NULL);
RNA_def_struct_sdna(srna, "Nurb");
RNA_def_struct_ui_text(srna, "Spline", "Element of a curve, either Nurbs, Bezier or Polyline or a character with text objects");
RNA_def_struct_ui_text(srna, "Spline", "Element of a curve, either NURBS, Bezier or Polyline or a character with text objects");
prop= RNA_def_property(srna, "points", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "bp", NULL);
@ -1496,13 +1496,13 @@ static void rna_def_curve_nurb(BlenderRNA *brna)
prop= RNA_def_property(srna, "order_u", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "orderu");
RNA_def_property_range(prop, 2, 6);
RNA_def_property_ui_text(prop, "Order U", "Nurbs order in the U direction (For splines and surfaces), Higher values let points influence a greater area");
RNA_def_property_ui_text(prop, "Order U", "NURBS order in the U direction (for splines and surfaces, higher values let points influence a greater area)");
RNA_def_property_update(prop, 0, "rna_Nurb_update_knot_u");
prop= RNA_def_property(srna, "order_v", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "orderv");
RNA_def_property_range(prop, 2, 6);
RNA_def_property_ui_text(prop, "Order V", "Nurbs order in the V direction (For surfaces only), Higher values let points influence a greater area");
RNA_def_property_ui_text(prop, "Order V", "NURBS order in the V direction (for surfaces only, higher values let points influence a greater area)");
RNA_def_property_update(prop, 0, "rna_Nurb_update_knot_v");

@ -1368,13 +1368,14 @@ static void rna_def_fkeyframe(BlenderRNA *brna)
RNA_def_property_enum_sdna(prop, NULL, "ipo");
RNA_def_property_enum_items(prop, beztriple_interpolation_mode_items);
RNA_def_property_ui_text(prop, "Interpolation",
"Interpolation method to use for segment of the curve from this Keyframe until the next Keyframe");
"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);
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", "The type of keyframe (for visual purposes only");
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);
/* Vector values */

@ -173,6 +173,7 @@ static void rna_FluidSettings_update_type(Main *bmain, Scene *scene, PointerRNA
static void rna_DomainFluidSettings_memory_estimate_get(PointerRNA *ptr, char *value)
{
#ifdef DISABLE_ELBEEM
(void)ptr;
value[0]= '\0';
#else
Object *ob= (Object*)ptr->id.data;
@ -182,7 +183,7 @@ static void rna_DomainFluidSettings_memory_estimate_get(PointerRNA *ptr, char *v
#endif
}
static int rna_DomainFluidSettings_memory_estimate_length(PointerRNA *ptr)
static int rna_DomainFluidSettings_memory_estimate_length(PointerRNA *UNUSED(ptr))
{
#ifdef DISABLE_ELBEEM
return 0;

@ -369,25 +369,25 @@ static void rna_def_imageuser(BlenderRNA *brna)
prop= RNA_def_property(srna, "frame_duration", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "frames");
RNA_def_property_range(prop, 0, MAXFRAMEF);
RNA_def_property_ui_text(prop, "Frames", "Sets the number of images of a movie to use");
RNA_def_property_ui_text(prop, "Frames", "Number of images of a movie to use");
RNA_def_property_update(prop, 0, "rna_ImageUser_update");
prop= RNA_def_property(srna, "frame_offset", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "offset");
RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF);
RNA_def_property_ui_text(prop, "Offset", "Offsets the number of the frame to use in the animation");
RNA_def_property_ui_text(prop, "Offset", "Offset the number of the frame to use in the animation");
RNA_def_property_update(prop, 0, "rna_ImageUser_update");
prop= RNA_def_property(srna, "frame_start", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "sfra");
RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF);
RNA_def_property_ui_text(prop, "Start Frame", "Sets the global starting frame of the movie/sequence, assuming first picture has a #1");
RNA_def_property_ui_text(prop, "Start Frame", "Global starting frame of the movie/sequence, assuming first picture has a #1");
RNA_def_property_update(prop, 0, "rna_ImageUser_update");
prop= RNA_def_property(srna, "fields_per_frame", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "fie_ima");
RNA_def_property_range(prop, 1, 200);
RNA_def_property_ui_text(prop, "Fields per Frame", "The number of fields per rendered frame (2 fields is 1 image)");
RNA_def_property_ui_text(prop, "Fields per Frame", "Number of fields per rendered frame (2 fields is 1 image)");
RNA_def_property_update(prop, 0, "rna_ImageUser_update");
prop= RNA_def_property(srna, "multilayer_layer", PROP_INT, PROP_UNSIGNED);

@ -179,10 +179,11 @@ static void rna_Lattice_points_w_set(PointerRNA *ptr, int value)
static void rna_Lattice_vg_name_set(PointerRNA *ptr, const char *value)
{
Lattice *lt= ptr->data;
strcpy(lt->vgroup, value);
BLI_strncpy(lt->vgroup, value, sizeof(lt->vgroup));
if(lt->editlatt)
strcpy(lt->editlatt->latt->vgroup, value);
if(lt->editlatt) {
BLI_strncpy(lt->editlatt->latt->vgroup, value, sizeof(lt->editlatt->latt->vgroup));
}
}
/* annoying, but is a consequence of RNA structures... */

@ -1383,20 +1383,20 @@ static void rna_def_mtface(BlenderRNA *brna)
prop= RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_MeshTextureFaceLayer_active_get", "rna_MeshTextureFaceLayer_active_set");
RNA_def_property_ui_text(prop, "Active", "Sets the layer as active for display and editing");
RNA_def_property_ui_text(prop, "Active", "Set the layer as active for display and editing");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
prop= RNA_def_property(srna, "active_render", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "active_rnd", 0);
RNA_def_property_boolean_funcs(prop, "rna_MeshTextureFaceLayer_active_render_get",
"rna_MeshTextureFaceLayer_active_render_set");
RNA_def_property_ui_text(prop, "Active Render", "Sets the layer as active for rendering");
RNA_def_property_ui_text(prop, "Active Render", "Set the layer as active for rendering");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
prop= RNA_def_property(srna, "active_clone", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "active_clone", 0);
RNA_def_property_boolean_funcs(prop, "rna_MeshTextureFaceLayer_clone_get", "rna_MeshTextureFaceLayer_clone_set");
RNA_def_property_ui_text(prop, "Active Clone", "Sets the layer as active for cloning");
RNA_def_property_ui_text(prop, "Active Clone", "Set the layer as active for cloning");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
prop= RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE);
@ -1835,7 +1835,8 @@ static void rna_def_mesh(BlenderRNA *brna)
/* UV textures */
prop= RNA_def_property(srna, "uv_textures", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "fdata.layers", "fdata.totlayer");
RNA_def_property_collection_funcs(prop, "rna_Mesh_uv_textures_begin", NULL, NULL, NULL, "rna_Mesh_uv_textures_length", NULL, NULL, NULL);
RNA_def_property_collection_funcs(prop, "rna_Mesh_uv_textures_begin", NULL, NULL, NULL,
"rna_Mesh_uv_textures_length", NULL, NULL, NULL);
RNA_def_property_struct_type(prop, "MeshTextureFaceLayer");
RNA_def_property_ui_text(prop, "UV Textures", "");
rna_def_uv_textures(brna, prop);
@ -1865,26 +1866,30 @@ static void rna_def_mesh(BlenderRNA *brna)
prop= RNA_def_property(srna, "vertex_colors", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "fdata.layers", "fdata.totlayer");
RNA_def_property_collection_funcs(prop, "rna_Mesh_vertex_colors_begin", NULL, NULL, NULL, "rna_Mesh_vertex_colors_length", NULL, NULL, NULL);
RNA_def_property_collection_funcs(prop, "rna_Mesh_vertex_colors_begin", NULL, NULL, NULL,
"rna_Mesh_vertex_colors_length", NULL, NULL, NULL);
RNA_def_property_struct_type(prop, "MeshColorLayer");
RNA_def_property_ui_text(prop, "Vertex Colors", "");
rna_def_vertex_colors(brna, prop);
prop= RNA_def_property(srna, "layers_float", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "fdata.layers", "fdata.totlayer");
RNA_def_property_collection_funcs(prop, "rna_Mesh_float_layers_begin", NULL, NULL, NULL, "rna_Mesh_float_layers_length", NULL, NULL, NULL);
RNA_def_property_collection_funcs(prop, "rna_Mesh_float_layers_begin", NULL, NULL, NULL,
"rna_Mesh_float_layers_length", NULL, NULL, NULL);
RNA_def_property_struct_type(prop, "MeshFloatPropertyLayer");
RNA_def_property_ui_text(prop, "Float Property Layers", "");
prop= RNA_def_property(srna, "layers_int", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "fdata.layers", "fdata.totlayer");
RNA_def_property_collection_funcs(prop, "rna_Mesh_int_layers_begin", NULL, NULL, NULL, "rna_Mesh_int_layers_length", NULL, NULL, NULL);
RNA_def_property_collection_funcs(prop, "rna_Mesh_int_layers_begin", NULL, NULL, NULL,
"rna_Mesh_int_layers_length", NULL, NULL, NULL);
RNA_def_property_struct_type(prop, "MeshIntPropertyLayer");
RNA_def_property_ui_text(prop, "Int Property Layers", "");
prop= RNA_def_property(srna, "layers_string", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "fdata.layers", "fdata.totlayer");
RNA_def_property_collection_funcs(prop, "rna_Mesh_string_layers_begin", NULL, NULL, NULL, "rna_Mesh_string_layers_length", NULL, NULL, NULL);
RNA_def_property_collection_funcs(prop, "rna_Mesh_string_layers_begin", NULL, NULL, NULL,
"rna_Mesh_string_layers_length", NULL, NULL, NULL);
RNA_def_property_struct_type(prop, "MeshStringPropertyLayer");
RNA_def_property_ui_text(prop, "String Property Layers", "");

@ -1403,19 +1403,19 @@ static void def_cmp_image(StructRNA *srna)
prop = RNA_def_property(srna, "frame_duration", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "frames");
RNA_def_property_range(prop, 0, MAXFRAMEF);
RNA_def_property_ui_text(prop, "Frames", "Sets the number of images of a movie to use"); /* copied from the rna_image.c */
RNA_def_property_ui_text(prop, "Frames", "Number of images of a movie to use"); /* copied from the rna_image.c */
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
prop = RNA_def_property(srna, "frame_start", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "sfra");
RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF);
RNA_def_property_ui_text(prop, "Start Frame", "Sets the global starting frame of the movie/sequence, assuming first picture has a #1"); /* copied from the rna_image.c */
RNA_def_property_ui_text(prop, "Start Frame", "Global starting frame of the movie/sequence, assuming first picture has a #1"); /* copied from the rna_image.c */
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
prop = RNA_def_property(srna, "frame_offset", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "offset");
RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF);
RNA_def_property_ui_text(prop, "Offset", "Offsets the number of the frame to use in the animation"); /* copied from the rna_image.c */
RNA_def_property_ui_text(prop, "Offset", "Offset the number of the frame to use in the animation"); /* copied from the rna_image.c */
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
prop = RNA_def_property(srna, "use_cyclic", PROP_BOOLEAN, PROP_NONE);

@ -1397,7 +1397,7 @@ static void rna_def_object_game_settings(BlenderRNA *brna)
prop= RNA_def_property(srna, "controllers", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "Controller");
RNA_def_property_ui_text(prop, "Controllers",
"Game engine controllers to process events, connecting sensor to actuators");
"Game engine controllers to process events, connecting sensors to actuators");
prop= RNA_def_property(srna, "actuators", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "Actuator");
@ -1426,7 +1426,7 @@ static void rna_def_object_game_settings(BlenderRNA *brna)
RNA_def_property_enum_sdna(prop, NULL, "body_type");
RNA_def_property_enum_items(prop, body_type_items);
RNA_def_property_enum_funcs(prop, "rna_GameObjectSettings_physics_type_get", "rna_GameObjectSettings_physics_type_set", NULL);
RNA_def_property_ui_text(prop, "Physics Type", "Selects the type of physical representation");
RNA_def_property_ui_text(prop, "Physics Type", "Select the type of physical representation");
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "use_actor", PROP_BOOLEAN, PROP_NONE);
@ -1488,20 +1488,20 @@ static void rna_def_object_game_settings(BlenderRNA *brna)
/* lock rotation */
prop= RNA_def_property(srna, "lock_rotation_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "gameflag2", OB_LOCK_RIGID_BODY_X_ROT_AXIS);
RNA_def_property_ui_text(prop, "Lock X Rotation Axis", "Disable simulation of angular motion along the X axis");
RNA_def_property_ui_text(prop, "Lock X Rotation Axis", "Disable simulation of angular motion along the X axis");
prop= RNA_def_property(srna, "lock_rotation_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "gameflag2", OB_LOCK_RIGID_BODY_Y_ROT_AXIS);
RNA_def_property_ui_text(prop, "Lock Y Rotation Axis", "Disable simulation of angular motion along the Y axis");
RNA_def_property_ui_text(prop, "Lock Y Rotation Axis", "Disable simulation of angular motion along the Y axis");
prop= RNA_def_property(srna, "lock_rotation_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "gameflag2", OB_LOCK_RIGID_BODY_Z_ROT_AXIS);
RNA_def_property_ui_text(prop, "Lock Z Rotation Axis", "Disable simulation of angular motion along the Z axis");
RNA_def_property_ui_text(prop, "Lock Z Rotation Axis", "Disable simulation of angular motion along the Z axis");
/* is this used anywhere ? */
prop= RNA_def_property(srna, "use_activity_culling", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "gameflag2", OB_NEVER_DO_ACTIVITY_CULLING);
RNA_def_property_ui_text(prop, "Lock Z Rotation Axis", "Disable simulation of angular motion along the Z axis");
RNA_def_property_ui_text(prop, "Lock Z Rotation Axis", "Disable simulation of angular motion along the Z axis");
prop= RNA_def_property(srna, "use_material_physics_fh", PROP_BOOLEAN, PROP_NONE);
@ -1526,7 +1526,7 @@ static void rna_def_object_game_settings(BlenderRNA *brna)
RNA_def_property_float_sdna(prop, NULL, "anisotropicFriction");
RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_ui_text(prop, "Friction Coefficients",
"Relative friction coefficient in the in the X, Y and Z directions, "
"Relative friction coefficients in the in the X, Y and Z directions, "
"when anisotropic friction is enabled");
prop= RNA_def_property(srna, "use_collision_bounds", PROP_BOOLEAN, PROP_NONE);
@ -1537,7 +1537,7 @@ static void rna_def_object_game_settings(BlenderRNA *brna)
RNA_def_property_enum_sdna(prop, NULL, "boundtype");
RNA_def_property_enum_items(prop, collision_bounds_items);
RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Object_collision_bounds_itemf");
RNA_def_property_ui_text(prop, "Collision Bounds", "Selects the collision type");
RNA_def_property_ui_text(prop, "Collision Bounds", "Select the collision type");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
prop= RNA_def_property(srna, "use_collision_compound", PROP_BOOLEAN, PROP_NONE);

@ -193,7 +193,7 @@ static void rna_Cache_idname_change(Main *UNUSED(bmain), Scene *UNUSED(scene), P
pid2 = pid;
else if(cache->name[0] != '\0' && strcmp(cache->name,pid->cache->name)==0) {
/*TODO: report "name exists" to user */
strcpy(cache->name, cache->prev_name);
BLI_strncpy(cache->name, cache->prev_name, sizeof(cache->name));
new_name = 0;
}
}
@ -203,13 +203,13 @@ static void rna_Cache_idname_change(Main *UNUSED(bmain), Scene *UNUSED(scene), P
char old_name[80];
char new_name[80];
strcpy(old_name, cache->prev_name);
strcpy(new_name, cache->name);
BLI_strncpy(old_name, cache->prev_name, sizeof(old_name));
BLI_strncpy(new_name, cache->name, sizeof(new_name));
BKE_ptcache_disk_cache_rename(pid2, old_name, new_name);
}
strcpy(cache->prev_name, cache->name);
BLI_strncpy(cache->prev_name, cache->name, sizeof(cache->prev_name));
}
}
@ -679,7 +679,8 @@ static void rna_softbody_update(Main *UNUSED(bmain), Scene *UNUSED(scene), Point
}
static EnumPropertyItem *rna_Effector_shape_itemf(bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *UNUSED(free))
static EnumPropertyItem *rna_Effector_shape_itemf(bContext *UNUSED(C), PointerRNA *ptr,
PropertyRNA *UNUSED(prop), int *UNUSED(free))
{
Object *ob= NULL;
@ -725,7 +726,8 @@ static void rna_def_ptcache_point_caches(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_struct_ui_text(srna, "Point Caches", "Collection of point caches");
prop= RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_funcs(prop, "rna_Cache_active_point_cache_index_get", "rna_Cache_active_point_cache_index_set", "rna_Cache_active_point_cache_index_range");
RNA_def_property_int_funcs(prop, "rna_Cache_active_point_cache_index_get", "rna_Cache_active_point_cache_index_set",
"rna_Cache_active_point_cache_index_range");
RNA_def_property_ui_text(prop, "Active Point Cache Index", "");
RNA_def_property_update(prop, NC_OBJECT, "rna_Cache_change");
}
@ -827,7 +829,8 @@ static void rna_def_pointcache(BlenderRNA *brna)
RNA_def_property_update(prop, NC_OBJECT, "rna_Cache_idname_change");
prop= RNA_def_property(srna, "point_caches", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_funcs(prop, "rna_Cache_list_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", NULL, NULL, NULL, NULL);
RNA_def_property_collection_funcs(prop, "rna_Cache_list_begin", "rna_iterator_listbase_next",
"rna_iterator_listbase_end", "rna_iterator_listbase_get", NULL, NULL, NULL, NULL);
RNA_def_property_struct_type(prop, "PointCache");
RNA_def_property_ui_text(prop, "Point Cache List", "Point cache list");
rna_def_ptcache_point_caches(brna, prop);
@ -914,7 +917,8 @@ static void rna_def_collision(BlenderRNA *brna)
prop= RNA_def_property(srna, "absorption", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_range(prop, 0.0f, 1.0f, 1, 2);
RNA_def_property_ui_text(prop, "Absorption", "How much of effector force gets lost during collision with this object (in percent)");
RNA_def_property_ui_text(prop, "Absorption",
"How much of effector force gets lost during collision with this object (in percent)");
RNA_def_property_update(prop, 0, "rna_CollisionSettings_update");
}
@ -1128,7 +1132,9 @@ static void rna_def_field(BlenderRNA *brna)
prop= RNA_def_property(srna, "texture_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "tex_mode");
RNA_def_property_enum_items(prop, texture_items);
RNA_def_property_ui_text(prop, "Texture Mode", "How the texture effect is calculated (RGB & Curl need a RGB texture else Gradient will be used instead)");
RNA_def_property_ui_text(prop, "Texture Mode",
"How the texture effect is calculated (RGB & Curl need a RGB texture, "
"else Gradient will be used instead)");
RNA_def_property_update(prop, 0, "rna_FieldSettings_update");
prop= RNA_def_property(srna, "z_direction", PROP_ENUM, PROP_NONE);
@ -1423,7 +1429,10 @@ static void rna_def_game_softbody(BlenderRNA *brna)
prop= RNA_def_property(srna, "weld_threshold", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "welding");
RNA_def_property_range(prop, 0.0f, 0.01f);
RNA_def_property_ui_text(prop, "Welding", "Welding threshold: distance between nearby vertices to be considered equal => set to 0.0 to disable welding test and speed up scene loading (ok if the mesh has no duplicates)");
RNA_def_property_ui_text(prop, "Welding",
"Welding threshold: distance between nearby vertices to be considered equal "
"=> set to 0.0 to disable welding test and speed up scene loading "
"(ok if the mesh has no duplicates)");
/* Integers */
@ -1435,7 +1444,7 @@ static void rna_def_game_softbody(BlenderRNA *brna)
prop= RNA_def_property(srna, "cluster_iterations", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "numclusteriterations");
RNA_def_property_range(prop, 1, 128);
RNA_def_property_ui_text(prop, "Cluster Iterations", "Specify the number of cluster iterations");
RNA_def_property_ui_text(prop, "Cluster Iterations", "Number of cluster iterations");
/* Booleans */
@ -1519,7 +1528,8 @@ static void rna_def_softbody(BlenderRNA *brna)
prop= RNA_def_property(srna, "vertex_group_goal", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "vertgroup");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); /* not impossible .. but not supported yet */
RNA_def_property_string_funcs(prop, "rna_SoftBodySettings_goal_vgroup_get", "rna_SoftBodySettings_goal_vgroup_length", "rna_SoftBodySettings_goal_vgroup_set");
RNA_def_property_string_funcs(prop, "rna_SoftBodySettings_goal_vgroup_get", "rna_SoftBodySettings_goal_vgroup_length",
"rna_SoftBodySettings_goal_vgroup_set");
RNA_def_property_ui_text(prop, "Goal Vertex Group", "Control point weight values");
prop= RNA_def_property(srna, "goal_min", PROP_FLOAT, PROP_NONE);
@ -1641,7 +1651,8 @@ static void rna_def_softbody(BlenderRNA *brna)
prop= RNA_def_property(srna, "error_threshold", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "rklimit");
RNA_def_property_range(prop, 0.001f, 10.0f);
RNA_def_property_ui_text(prop, "Error Limit", "The Runge-Kutta ODE solver error limit, low value gives more precision, high values speed");
RNA_def_property_ui_text(prop, "Error Limit",
"The Runge-Kutta ODE solver error limit, low value gives more precision, high values speed");
RNA_def_property_update(prop, 0, "rna_softbody_update");
prop= RNA_def_property(srna, "step_min", PROP_INT, PROP_NONE);
@ -1665,7 +1676,8 @@ static void rna_def_softbody(BlenderRNA *brna)
prop= RNA_def_property(srna, "fuzzy", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "fuzzyness");
RNA_def_property_range(prop, 1, 100);
RNA_def_property_ui_text(prop, "Fuzzy", "Fuzziness while on collision, high values make collision handling faster but less stable");
RNA_def_property_ui_text(prop, "Fuzzy",
"Fuzziness while on collision, high values make collision handling faster but less stable");
RNA_def_property_update(prop, 0, "rna_softbody_update");
prop= RNA_def_property(srna, "use_auto_step", PROP_BOOLEAN, PROP_NONE);

@ -48,13 +48,14 @@
// XXX: this RNA enum define is currently duplicated for objects, since there is some text here which is not applicable
EnumPropertyItem posebone_rotmode_items[] = {
{ROT_MODE_QUAT, "QUATERNION", 0, "Quaternion (WXYZ)", "No Gimbal Lock (default)"},
{ROT_MODE_XYZ, "XYZ", 0, "XYZ Euler", "XYZ Rotation Order. Prone to Gimbal Lock"},
{ROT_MODE_XZY, "XZY", 0, "XZY Euler", "XZY Rotation Order. Prone to Gimbal Lock"},
{ROT_MODE_YXZ, "YXZ", 0, "YXZ Euler", "YXZ Rotation Order. Prone to Gimbal Lock"},
{ROT_MODE_YZX, "YZX", 0, "YZX Euler", "YZX Rotation Order. Prone to Gimbal Lock"},
{ROT_MODE_ZXY, "ZXY", 0, "ZXY Euler", "ZXY Rotation Order. Prone to Gimbal Lock"},
{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"},
{ROT_MODE_XYZ, "XYZ", 0, "XYZ Euler", "XYZ Rotation Order (prone to Gimbal Lock)"},
{ROT_MODE_XZY, "XZY", 0, "XZY Euler", "XZY Rotation Order (prone to Gimbal Lock)"},
{ROT_MODE_YXZ, "YXZ", 0, "YXZ Euler", "YXZ Rotation Order (prone to Gimbal Lock)"},
{ROT_MODE_YZX, "YZX", 0, "YZX Euler", "YZX Rotation Order (prone to Gimbal Lock)"},
{ROT_MODE_ZXY, "ZXY", 0, "ZXY Euler", "ZXY Rotation Order (prone to Gimbal Lock)"},
{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}};
#ifdef RNA_RUNTIME
@ -717,7 +718,8 @@ static void rna_def_pose_channel_constraints(BlenderRNA *brna, PropertyRNA *cpro
/* Collection active property */
prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Constraint");
RNA_def_property_pointer_funcs(prop, "rna_PoseChannel_active_constraint_get", "rna_PoseChannel_active_constraint_set", NULL, NULL);
RNA_def_property_pointer_funcs(prop, "rna_PoseChannel_active_constraint_get",
"rna_PoseChannel_active_constraint_set", NULL, NULL);
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Active Constraint", "Active PoseChannel constraint");
@ -820,7 +822,8 @@ static void rna_def_pose_channel(BlenderRNA *brna)
*/
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", "rna_PoseChannel_rotation_axis_angle_set", NULL);
RNA_def_property_float_funcs(prop, "rna_PoseChannel_rotation_axis_angle_get",
"rna_PoseChannel_rotation_axis_angle_set", NULL);
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");
@ -853,7 +856,7 @@ static void rna_def_pose_channel(BlenderRNA *brna)
prop= RNA_def_property(srna, "matrix_basis", PROP_FLOAT, PROP_MATRIX);
RNA_def_property_multi_array(prop, 2, matrix_dimsize);
RNA_def_property_ui_text(prop, "Basis Matrix",
"Provides an alternative access to loc/scale/rotation relative to the parent and own rest bone");
"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");
@ -1039,7 +1042,8 @@ static void rna_def_pose_channel(BlenderRNA *brna)
RNA_def_property_int_sdna(prop, NULL, "agrp_index");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_int_funcs(prop, "rna_PoseChannel_bone_group_index_get", "rna_PoseChannel_bone_group_index_set", "rna_PoseChannel_bone_group_index_range");
RNA_def_property_int_funcs(prop, "rna_PoseChannel_bone_group_index_get", "rna_PoseChannel_bone_group_index_set",
"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");
@ -1072,7 +1076,8 @@ static void rna_def_pose_channel(BlenderRNA *brna)
// 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_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");
@ -1080,7 +1085,8 @@ static void rna_def_pose_channel(BlenderRNA *brna)
// 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_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");
@ -1098,13 +1104,17 @@ static void rna_def_pose_channel(BlenderRNA *brna)
static void rna_def_pose_itasc(BlenderRNA *brna)
{
static const EnumPropertyItem prop_itasc_mode_items[]= {
{0, "ANIMATION", 0, "Animation", "Stateless solver computing pose starting from current action and non-IK constraints"},
{ITASC_SIMULATION, "SIMULATION", 0, "Simulation", "Statefull solver running in real-time context and ignoring actions and non-IK constraints"},
{0, "ANIMATION", 0, "Animation",
"Stateless solver computing pose starting from current action and non-IK constraints"},
{ITASC_SIMULATION, "SIMULATION", 0, "Simulation",
"Statefull solver running in real-time context and ignoring actions and non-IK constraints"},
{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", "The solver reiterates (converges) on the first frame but not on subsequent frame"},
{ITASC_INITIAL_REITERATION|ITASC_REITERATION, "ALWAYS", 0, "Always", "The solver reiterates (converges) on all frames"},
{ITASC_INITIAL_REITERATION, "INITIAL", 0, "Initial",
"The solver reiterates (converges) on the first frame but not on subsequent frame"},
{ITASC_INITIAL_REITERATION|ITASC_REITERATION, "ALWAYS", 0, "Always",
"The solver reiterates (converges) on all frames"},
{0, NULL, 0, NULL, NULL}};
StructRNA *srna;
@ -1141,12 +1151,15 @@ static void rna_def_pose_itasc(BlenderRNA *brna)
prop= RNA_def_property(srna, "reiteration_method", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
RNA_def_property_enum_items(prop, prop_itasc_reiteration_items);
RNA_def_property_ui_text(prop, "Reiteration", "Defines if the solver is allowed to reiterate (converges until precision is met) on none, first or all frames");
RNA_def_property_ui_text(prop, "Reiteration",
"Defines if the solver is allowed to reiterate (converges until "
"precision is met) on none, first or all frames");
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_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");
prop= RNA_def_property(srna, "step_min", PROP_FLOAT, PROP_NONE);
@ -1164,7 +1177,8 @@ static void rna_def_pose_itasc(BlenderRNA *brna)
prop= RNA_def_property(srna, "feedback", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "feedback");
RNA_def_property_range(prop, 0.0f,100.0f);
RNA_def_property_ui_text(prop, "Feedback", "Feedback coefficient for error correction. Average response time=1/feedback. Default=20");
RNA_def_property_ui_text(prop, "Feedback",
"Feedback coefficient for error correction. Average response time=1/feedback. Default=20");
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update");
prop= RNA_def_property(srna, "velocity_max", PROP_FLOAT, PROP_NONE);
@ -1182,13 +1196,17 @@ static void rna_def_pose_itasc(BlenderRNA *brna)
prop= RNA_def_property(srna, "damping_max", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "dampmax");
RNA_def_property_range(prop, 0.0f,1.0f);
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_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");
prop= RNA_def_property(srna, "damping_epsilon", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "dampeps");
RNA_def_property_range(prop, 0.0f,1.0f);
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_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");
}
@ -1232,7 +1250,8 @@ static void rna_def_bone_groups(BlenderRNA *brna, PropertyRNA *cprop)
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_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");
}
@ -1265,7 +1284,8 @@ static void rna_def_pose(BlenderRNA *brna)
RNA_def_property_enum_sdna(prop, NULL, "iksolver");
RNA_def_property_enum_funcs(prop, NULL, "rna_Pose_ik_solver_set", NULL);
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_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");
prop= RNA_def_property(srna, "ik_param", PROP_POINTER, PROP_NONE);

@ -88,12 +88,14 @@ void RE_engines_exit(void)
static void engine_render(RenderEngine *engine, struct Scene *scene)
{
extern FunctionRNA rna_RenderEngine_render_func;
PointerRNA ptr;
ParameterList list;
FunctionRNA *func;
RNA_pointer_create(NULL, engine->type->ext.srna, engine, &ptr);
func= RNA_struct_find_function(&ptr, "render");
func= &rna_RenderEngine_render_func; /* RNA_struct_find_function(&ptr, "render"); */
RNA_parameter_list_create(&list, &ptr, func);
RNA_parameter_set_lookup(&list, "scene", &scene);

@ -167,7 +167,7 @@ static int rna_idproperty_known(CollectionPropertyIterator *iter, void *data)
return 0;
}
static int rna_property_builtin(CollectionPropertyIterator *iter, void *data)
static int rna_property_builtin(CollectionPropertyIterator *UNUSED(iter), void *data)
{
PropertyRNA *prop= (PropertyRNA*)data;
@ -176,7 +176,7 @@ static int rna_property_builtin(CollectionPropertyIterator *iter, void *data)
return (prop->flag & PROP_BUILTIN);
}
static int rna_function_builtin(CollectionPropertyIterator *iter, void *data)
static int rna_function_builtin(CollectionPropertyIterator *UNUSED(iter), void *data)
{
FunctionRNA *func= (FunctionRNA*)data;
@ -775,7 +775,7 @@ static int rna_EnumProperty_default_get(PointerRNA *ptr)
return ((EnumPropertyRNA*)prop)->defaultvalue;
}
static int rna_enum_check_separator(CollectionPropertyIterator *iter, void *data)
static int rna_enum_check_separator(CollectionPropertyIterator *UNUSED(iter), void *data)
{
EnumPropertyItem *item= (EnumPropertyItem*)data;

@ -1061,7 +1061,7 @@ static void rna_SceneCamera_update(Main *UNUSED(bmain), Scene *UNUSED(scene), Po
* is not for general use and only for the few cases where changing scene
* settings and NOT for general purpose updates, possibly this should be
* given its own notifier. */
static void rna_Scene_update_active_object_data(Main *bmain, Scene *scene, PointerRNA *ptr)
static void rna_Scene_update_active_object_data(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr)
{
Object *ob= OBACT;
if(ob) {
@ -1762,13 +1762,13 @@ static void rna_def_scene_game_recast_data(BlenderRNA *brna)
prop= RNA_def_property(srna, "region_min_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "regionminsize");
RNA_def_property_ui_range(prop, 0, 150, 1, 2);
RNA_def_property_ui_text(prop, "Min Region Size", "Minimum regions size. Smaller regions will be deleted");
RNA_def_property_ui_text(prop, "Min Region Size", "Minimum regions size (smaller regions will be deleted)");
RNA_def_property_update(prop, NC_SCENE, NULL);
prop= RNA_def_property(srna, "region_merge_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "regionmergesize");
RNA_def_property_ui_range(prop, 0, 150, 1, 2);
RNA_def_property_ui_text(prop, "Merged Region Size", "Minimum regions size. Smaller regions will be merged");
RNA_def_property_ui_text(prop, "Merged Region Size", "Minimum regions size (smaller regions will be merged)");
RNA_def_property_update(prop, NC_SCENE, NULL);
prop= RNA_def_property(srna, "edge_max_len", PROP_FLOAT, PROP_NONE);
@ -1984,7 +1984,7 @@ static void rna_def_scene_game_data(BlenderRNA *brna)
RNA_def_property_int_sdna(prop, NULL, "occlusionRes");
RNA_def_property_range(prop, 128.0, 1024.0);
RNA_def_property_ui_text(prop, "Occlusion Resolution",
"The size of the occlusion buffer in pixel, use higher value for better precision (slower)");
"Size of the occlusion buffer in pixel, use higher value for better precision (slower)");
RNA_def_property_update(prop, NC_SCENE, NULL);
prop= RNA_def_property(srna, "fps", PROP_INT, PROP_NONE);
@ -1992,7 +1992,7 @@ static void rna_def_scene_game_data(BlenderRNA *brna)
RNA_def_property_ui_range(prop, 1, 60, 1, 1);
RNA_def_property_range(prop, 1, 250);
RNA_def_property_ui_text(prop, "Frames Per Second",
"The nominal number of game frames per second "
"Nominal number of game frames per second "
"(physics fixed timestep = 1/fps, independently of actual frame rate)");
RNA_def_property_update(prop, NC_SCENE, NULL);
@ -2001,7 +2001,7 @@ static void rna_def_scene_game_data(BlenderRNA *brna)
RNA_def_property_ui_range(prop, 1, 5, 1, 1);
RNA_def_property_range(prop, 1, 5);
RNA_def_property_ui_text(prop, "Max Logic Steps",
"Sets the maximum number of logic frame per game frame if graphics slows down the game, "
"Maximum number of logic frame per game frame if graphics slows down the game, "
"higher value allows better synchronization with physics");
RNA_def_property_update(prop, NC_SCENE, NULL);
@ -2010,7 +2010,7 @@ static void rna_def_scene_game_data(BlenderRNA *brna)
RNA_def_property_ui_range(prop, 1, 5, 1, 1);
RNA_def_property_range(prop, 1, 5);
RNA_def_property_ui_text(prop, "Max Physics Steps",
"Sets the maximum number of physics step per game frame if graphics slows down the game, "
"Maximum number of physics step per game frame if graphics slows down the game, "
"higher value allows physics to keep up with realtime");
RNA_def_property_update(prop, NC_SCENE, NULL);
@ -2019,7 +2019,7 @@ static void rna_def_scene_game_data(BlenderRNA *brna)
RNA_def_property_ui_range(prop, 1, 5, 1, 1);
RNA_def_property_range(prop, 1, 5);
RNA_def_property_ui_text(prop, "Physics Sub Steps",
"Sets the number of simulation substep per physic timestep, "
"Number of simulation substep per physic timestep, "
"higher value give better physics precision");
RNA_def_property_update(prop, NC_SCENE, NULL);
@ -2073,7 +2073,7 @@ static void rna_def_scene_game_data(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_animation_record", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_ENABLE_ANIMATION_RECORD);
RNA_def_property_ui_text(prop, "Record Animation", "Record animation to fcurves");
RNA_def_property_ui_text(prop, "Record Animation", "Record animation to F-Curves");
prop= RNA_def_property(srna, "use_auto_start", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_GameSettings_auto_start_get", "rna_GameSettings_auto_start_set");
@ -2082,8 +2082,8 @@ static void rna_def_scene_game_data(BlenderRNA *brna)
prop= RNA_def_property(srna, "restrict_animation_updates", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_RESTRICT_ANIM_UPDATES);
RNA_def_property_ui_text(prop, "Restrict Animation Updates",
"Restrict the number of animation updates to the animation FPS. This is "
"better for performance, but can cause issues with smooth playback");
"Restrict the number of animation updates to the animation FPS (this is "
"better for performance, but can cause issues with smooth playback)");
/* materials */
prop= RNA_def_property(srna, "material_mode", PROP_ENUM, PROP_NONE);

@ -127,7 +127,8 @@ static void rna_ParticleEdit_tool_set(PointerRNA *ptr, int value)
pset->brushtype = value;
}
static EnumPropertyItem *rna_ParticleEdit_tool_itemf(bContext *C, PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), int *UNUSED(free))
static EnumPropertyItem *rna_ParticleEdit_tool_itemf(bContext *C, PointerRNA *UNUSED(ptr),
PropertyRNA *UNUSED(prop), int *UNUSED(free))
{
Scene *scene= CTX_data_scene(C);
Object *ob= (scene->basact)? scene->basact->object: NULL;
@ -275,7 +276,8 @@ static void rna_def_sculpt(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_symmetry_feather", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_SYMMETRY_FEATHER);
RNA_def_property_ui_text(prop, "Symmetry Feathering", "Reduce the strength of the brush where it overlaps symmetrical daubs");
RNA_def_property_ui_text(prop, "Symmetry Feathering",
"Reduce the strength of the brush where it overlaps symmetrical daubs");
prop= RNA_def_property(srna, "use_threaded", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_USE_OPENMP);
@ -283,7 +285,9 @@ static void rna_def_sculpt(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_deform_only", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_ONLY_DEFORM);
RNA_def_property_ui_text(prop, "Use Deform Only", "Use only deformation modifiers (temporary disable all constructive modifiers except multi-resolution)");
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");
}
@ -345,7 +349,8 @@ static void rna_def_image_paint(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_clone_layer", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", IMAGEPAINT_PROJECT_LAYER_CLONE);
RNA_def_property_ui_text(prop, "Clone Layer", "Use another UV layer as clone source, otherwise use 3D the cursor as the source");
RNA_def_property_ui_text(prop, "Clone Layer",
"Use another UV layer as clone source, otherwise use 3D the cursor as the source");
/* integers */
@ -357,7 +362,8 @@ static void rna_def_image_paint(BlenderRNA *brna)
RNA_def_property_range(prop, 0, 90);
RNA_def_property_ui_text(prop, "Angle", "Paint most on faces pointing towards the view according to this angle");
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);
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);
RNA_def_property_range(prop, 512, 16384);
}
@ -518,7 +524,8 @@ static void rna_def_particle_edit(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_puff_volume", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_BRUSH_DATA_PUFF_VOLUME);
RNA_def_property_ui_text(prop, "Puff Volume", "Apply puff to unselected end-points, (helps maintain hair volume when puffing root)");
RNA_def_property_ui_text(prop, "Puff Volume",
"Apply puff to unselected end-points (helps maintain hair volume when puffing root)");
prop= RNA_def_property(srna, "length_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "invert");

@ -1190,7 +1190,7 @@ static void rna_def_editor(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Overlay Offset", "");
RNA_def_property_int_funcs(prop, "rna_SequenceEditor_overlay_frame_get", "rna_SequenceEditor_overlay_frame_set", NULL);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
RNA_def_property_ui_text(prop, "Active Strip", "Sequencers active strip");
RNA_def_property_ui_text(prop, "Active Strip", "Sequencer's active strip");
}
static void rna_def_filter_video(StructRNA *srna)

@ -177,14 +177,14 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna)
RNA_def_property_float_sdna(prop, NULL, "alpha");
RNA_def_property_range(prop, -5.0, 5.0);
RNA_def_property_ui_range(prop, -5.0, 5.0, 0.02, 5);
RNA_def_property_ui_text(prop, "Density", "How much density effects smoke motion, higher value results in faster rising smoke");
RNA_def_property_ui_text(prop, "Density", "How much density affects smoke motion (higher value results in faster rising smoke)");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
prop= RNA_def_property(srna, "beta", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "beta");
RNA_def_property_range(prop, -5.0, 5.0);
RNA_def_property_ui_range(prop, -5.0, 5.0, 0.02, 5);
RNA_def_property_ui_text(prop, "Heat", "How much heat effects smoke motion, higher value results in faster rising smoke");
RNA_def_property_ui_text(prop, "Heat", "How much heat affects smoke motion (higher value results in faster rising smoke)");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
prop= RNA_def_property(srna, "collision_group", PROP_POINTER, PROP_NONE);
@ -245,7 +245,7 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna)
prop= RNA_def_property(srna, "collision_extents", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "border_collisions");
RNA_def_property_enum_items(prop, smoke_domain_colli_items);
RNA_def_property_ui_text(prop, "Border Collisions", "Selects which domain border will be treated as collision object");
RNA_def_property_ui_text(prop, "Border Collisions", "Select which domain border will be treated as collision object");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
prop= RNA_def_property(srna, "effector_weights", PROP_POINTER, PROP_NONE);
@ -313,7 +313,7 @@ static void rna_def_smoke_flow_settings(BlenderRNA *brna)
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 it's velocity from the emitter particle");
RNA_def_property_ui_text(prop, "Initial Velocity", "Smoke inherits its velocity from the emitter particle");
prop= RNA_def_property(srna, "velocity_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "vel_multi");

@ -881,7 +881,7 @@ static int rna_SpaceNodeEditor_node_tree_poll(PointerRNA *ptr, PointerRNA value)
return (ntree->nodetype==0 && ntree->type == snode->treetype);
}
static void rna_SpaceNodeEditor_node_tree_update(Main *bmain, Scene *scene, PointerRNA *ptr)
static void rna_SpaceNodeEditor_node_tree_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr)
{
SpaceNode *snode= (SpaceNode*)ptr->data;

@ -133,7 +133,7 @@ static StructRNA *rna_Texture_refine(struct PointerRNA *ptr)
}
}
static void rna_Texture_update(Main *bmain, Scene *scene, PointerRNA *ptr)
static void rna_Texture_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
Tex *tex= ptr->id.data;
@ -162,7 +162,7 @@ static void rna_Texture_voxeldata_image_update(Main *bmain, Scene *scene, Pointe
/* Used for Texture Properties, used (also) for/in Nodes */
static void rna_Texture_nodes_update(Main *bmain, Scene *scene, PointerRNA *ptr)
static void rna_Texture_nodes_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
Tex *tex= ptr->id.data;
@ -177,7 +177,7 @@ static void rna_Texture_type_set(PointerRNA *ptr, int value)
tex_set_type(tex, value);
}
void rna_TextureSlot_update(Main *bmain, Scene *scene, PointerRNA *ptr)
void rna_TextureSlot_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
ID *id= ptr->id.data;
@ -388,12 +388,12 @@ static void rna_PointDensity_psys_set(PointerRNA *ptr, PointerRNA value)
pd->psys= BLI_findindex(&ob->particlesystem, value.data) + 1;
}
static char *rna_PointDensity_path(PointerRNA *ptr)
static char *rna_PointDensity_path(PointerRNA *UNUSED(ptr))
{
return BLI_sprintfN("point_density");
}
static char *rna_VoxelData_path(PointerRNA *ptr)
static char *rna_VoxelData_path(PointerRNA *UNUSED(ptr))
{
return BLI_sprintfN("voxel_data");
}
@ -698,7 +698,7 @@ static EnumPropertyItem prop_noise_basis_items[] = {
{TEX_VORONOI_CRACKLE, "VORONOI_CRACKLE", 0, "Voronoi Crackle",
"Noise algorithm - Voronoi Crackle: Voronoi tessellation with sharp edges"},
{TEX_CELLNOISE, "CELL_NOISE", 0, "Cell Noise",
"Noise algorithm - Cell Noise: Square cell tessallation"},
"Noise algorithm - Cell Noise: Square cell tessellation"},
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem prop_noise_type[] = {
@ -1525,13 +1525,13 @@ static void rna_def_texture_pointdensity(BlenderRNA *brna)
prop= RNA_def_property(srna, "particle_cache_space", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "psys_cache_space");
RNA_def_property_enum_items(prop, particle_cache_items);
RNA_def_property_ui_text(prop, "Particle Cache", "Co-ordinate system to cache particles in");
RNA_def_property_ui_text(prop, "Particle Cache", "Coordinate system to cache particles in");
RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "vertex_cache_space", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "ob_cache_space");
RNA_def_property_enum_items(prop, vertice_cache_items);
RNA_def_property_ui_text(prop, "Vertices Cache", "Co-ordinate system to cache vertices in");
RNA_def_property_ui_text(prop, "Vertices Cache", "Coordinate system to cache vertices in");
RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "radius", PROP_FLOAT, PROP_NONE);
@ -1657,9 +1657,9 @@ static void rna_def_texture_voxeldata(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem voxeldata_extension[] = {
{TEX_EXTEND, "EXTEND", 0, "Extend", "Extends by repeating edge pixels of the image"},
{TEX_CLIP, "CLIP", 0, "Clip", "Clips to image size and sets exterior pixels as transparent"},
{TEX_REPEAT, "REPEAT", 0, "Repeat", "Causes the image to repeat horizontally and vertically"},
{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}};
static EnumPropertyItem smoked_type_items[] = {

Some files were not shown because too many files have changed in this diff Show More