forked from bartvdbraak/blender
Merging r40990 through r41036 from trunk into soc-2011-tomato
This commit is contained in:
commit
70c8e65021
@ -233,7 +233,7 @@ check_sparse:
|
||||
doc_py:
|
||||
$(BUILD_DIR)/bin/blender --background --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: 'doc/python_api/sphinx-out/index.html'"
|
||||
@echo "docs written into: '$(BLENDER_DIR)/doc/python_api/sphinx-out/contents.html'"
|
||||
|
||||
|
||||
clean:
|
||||
|
@ -51,9 +51,9 @@ ELSE (WIN32)
|
||||
ENDIF (WIN32)
|
||||
|
||||
IF (GLEW_INCLUDE_PATH)
|
||||
SET( GLEW_FOUND 1 CACHE STRING "Set to 1 if GLEW is found, 0 otherwise")
|
||||
SET(GLEW_FOUND TRUE)
|
||||
ELSE (GLEW_INCLUDE_PATH)
|
||||
SET( GLEW_FOUND 0 CACHE STRING "Set to 1 if GLEW is found, 0 otherwise")
|
||||
SET(GLEW_FOUND FALSE)
|
||||
ENDIF (GLEW_INCLUDE_PATH)
|
||||
|
||||
MARK_AS_ADVANCED( GLEW_FOUND )
|
||||
|
@ -3,17 +3,24 @@
|
||||
# Authors: Rohit Yadav <rohityadav89@gmail.com>
|
||||
#
|
||||
|
||||
find_program(RPMBUILD
|
||||
if(NOT DEFINED RPMBUILD)
|
||||
|
||||
find_program(RPMBUILD
|
||||
NAMES rpmbuild
|
||||
PATHS "/usr/bin")
|
||||
|
||||
mark_as_advanced(RPMBUILD)
|
||||
mark_as_advanced(RPMBUILD)
|
||||
|
||||
if(RPMBUILD)
|
||||
message(STATUS "RPM Build Found: ${RPMBUILD}")
|
||||
else(RPMBUILD)
|
||||
message(STATUS "RPM Build Not Found (rpmbuild). RPM generation will not be available")
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
||||
if(RPMBUILD)
|
||||
get_filename_component(RPMBUILD_PATH ${RPMBUILD} ABSOLUTE)
|
||||
message(STATUS "Found rpmbuild : ${RPMBUILD_PATH}")
|
||||
set(RPMBUILD_FOUND "YES")
|
||||
set(RPMBUILD_FOUND TRUE)
|
||||
else(RPMBUILD)
|
||||
message(STATUS "rpmbuild NOT found. RPM generation will not be available")
|
||||
set(RPMBUILD_FOUND "NO")
|
||||
set(RPMBUILD_FOUND FALSE)
|
||||
endif()
|
@ -586,6 +586,20 @@ def AppIt(target=None, source=None, env=None):
|
||||
commands.getoutput(cmd)
|
||||
cmd = 'find %s/%s.app -name __MACOSX -exec rm -rf {} \;'%(installdir, binary)
|
||||
commands.getoutput(cmd)
|
||||
if env['CC'].endswith('4.6.1'): # for correct errorhandling with gcc 4.6.1 we need the gcc.dylib to link, thus distribute in app-bundle
|
||||
cmd = 'mkdir %s/%s.app/Contents/MacOS/lib'%(installdir, binary)
|
||||
commands.getoutput(cmd)
|
||||
instname = env['BF_CXX']
|
||||
cmd = 'cp %s/lib/libgcc_s.1.dylib %s/%s.app/Contents/MacOS/lib/'%(instname, installdir, binary)
|
||||
commands.getoutput(cmd)
|
||||
cmd = 'install_name_tool -id @executable_path/lib/libgcc_s.1.dylib %s/%s.app/Contents/MacOS/lib/libgcc_s.1.dylib'%(installdir, binary)
|
||||
commands.getoutput(cmd)
|
||||
cmd = 'install_name_tool -change %s/lib/libgcc_s.1.dylib @executable_path/lib/libgcc_s.1.dylib %s/%s.app/Contents/MacOS/%s'%(instname, installdir, binary, binary)
|
||||
commands.getoutput(cmd)
|
||||
cmd = 'rm -rf %s/set_simulation_threads.app'%(installdir) # first clear omp_num_threads applescript
|
||||
commands.getoutput(cmd)
|
||||
cmd = 'cp -R %s/source/darwin/set_simulation_threads.app %s/'%(bldroot, installdir) # copy the omp_num_threads applescript
|
||||
commands.getoutput(cmd)
|
||||
|
||||
# extract copy system python, be sure to update other build systems
|
||||
# when making changes to the files that are copied.
|
||||
|
@ -32,7 +32,8 @@
|
||||
|
||||
AUD_DynamicIIRFilterReader::AUD_DynamicIIRFilterReader(AUD_Reference<AUD_IReader> reader,
|
||||
AUD_Reference<AUD_DynamicIIRFilterFactory> factory) :
|
||||
AUD_IIRFilterReader(reader, std::vector<float>(), std::vector<float>())
|
||||
AUD_IIRFilterReader(reader, std::vector<float>(), std::vector<float>()),
|
||||
m_factory(factory)
|
||||
{
|
||||
sampleRateChanged(reader->getSpecs().rate);
|
||||
}
|
||||
|
@ -36,11 +36,14 @@ AUD_IIRFilterReader::AUD_IIRFilterReader(AUD_Reference<AUD_IReader> reader,
|
||||
const std::vector<float>& a) :
|
||||
AUD_BaseIIRFilterReader(reader, b.size(), a.size()), m_a(a), m_b(b)
|
||||
{
|
||||
if(m_a.size())
|
||||
{
|
||||
for(int i = 1; i < m_a.size(); i++)
|
||||
m_a[i] /= m_a[0];
|
||||
for(int i = 0; i < m_b.size(); i++)
|
||||
m_b[i] /= m_a[0];
|
||||
m_a[0] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
sample_t AUD_IIRFilterReader::filter()
|
||||
@ -58,7 +61,7 @@ sample_t AUD_IIRFilterReader::filter()
|
||||
void AUD_IIRFilterReader::setCoefficients(const std::vector<float>& b,
|
||||
const std::vector<float>& a)
|
||||
{
|
||||
setLengths(m_b.size(), m_a.size());
|
||||
setLengths(b.size(), a.size());
|
||||
m_a = a;
|
||||
m_b = b;
|
||||
}
|
||||
|
@ -826,7 +826,12 @@ float* AUD_readSoundBuffer(const char* filename, float low, float high,
|
||||
|
||||
AUD_Reference<AUD_IFactory> file = new AUD_FileFactory(filename);
|
||||
|
||||
int position = 0;
|
||||
|
||||
try
|
||||
{
|
||||
AUD_Reference<AUD_IReader> reader = file->createReader();
|
||||
|
||||
AUD_SampleRate rate = reader->getSpecs().rate;
|
||||
|
||||
sound = new AUD_ChannelMapperFactory(file, specs);
|
||||
@ -853,7 +858,6 @@ float* AUD_readSoundBuffer(const char* filename, float low, float high,
|
||||
return NULL;
|
||||
|
||||
int len;
|
||||
int position = 0;
|
||||
bool eos;
|
||||
do
|
||||
{
|
||||
@ -862,6 +866,11 @@ float* AUD_readSoundBuffer(const char* filename, float low, float high,
|
||||
reader->read(len, eos, buffer.getBuffer() + position);
|
||||
position += len;
|
||||
} while(!eos);
|
||||
}
|
||||
catch(AUD_Exception&)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
float* result = (float*)malloc(position * sizeof(float));
|
||||
memcpy(result, buffer.getBuffer(), position * sizeof(float));
|
||||
|
@ -69,7 +69,7 @@ bool AUD_NULLDevice::AUD_NULLHandle::seek(float position)
|
||||
|
||||
float AUD_NULLDevice::AUD_NULLHandle::getPosition()
|
||||
{
|
||||
return 0.0f;
|
||||
return std::numeric_limits<float>::quiet_NaN();
|
||||
}
|
||||
|
||||
AUD_Status AUD_NULLDevice::AUD_NULLHandle::getStatus()
|
||||
@ -79,7 +79,7 @@ AUD_Status AUD_NULLDevice::AUD_NULLHandle::getStatus()
|
||||
|
||||
float AUD_NULLDevice::AUD_NULLHandle::getVolume()
|
||||
{
|
||||
return 0.0f;
|
||||
return std::numeric_limits<float>::quiet_NaN();
|
||||
}
|
||||
|
||||
bool AUD_NULLDevice::AUD_NULLHandle::setVolume(float volume)
|
||||
@ -89,7 +89,7 @@ bool AUD_NULLDevice::AUD_NULLHandle::setVolume(float volume)
|
||||
|
||||
float AUD_NULLDevice::AUD_NULLHandle::getPitch()
|
||||
{
|
||||
return 0.0f;
|
||||
return std::numeric_limits<float>::quiet_NaN();
|
||||
}
|
||||
|
||||
bool AUD_NULLDevice::AUD_NULLHandle::setPitch(float pitch)
|
||||
@ -153,7 +153,7 @@ void AUD_NULLDevice::unlock()
|
||||
|
||||
float AUD_NULLDevice::getVolume() const
|
||||
{
|
||||
return 0;
|
||||
return std::numeric_limits<float>::quiet_NaN();
|
||||
}
|
||||
|
||||
void AUD_NULLDevice::setVolume(float volume)
|
||||
|
@ -136,9 +136,11 @@ def dump_messages_rna(messages):
|
||||
)
|
||||
# Here identifier and name can be the same!
|
||||
if item.name: # and item.name != item.identifier:
|
||||
messages.setdefault(item.name, []).append(msgsrc)
|
||||
messages.setdefault(item.name,
|
||||
[]).append(msgsrc)
|
||||
if item.description:
|
||||
messages.setdefault(item.description, []).append(msgsrc)
|
||||
messages.setdefault(item.description,
|
||||
[]).append(msgsrc)
|
||||
|
||||
def walkRNA(bl_rna):
|
||||
|
||||
|
@ -54,10 +54,11 @@ class VIEW3D_HT_header(Header):
|
||||
else:
|
||||
sub.menu("VIEW3D_MT_object")
|
||||
|
||||
row = layout.row()
|
||||
# Contains buttons like Mode, Pivot, Manipulator, Layer, Mesh Select Mode...
|
||||
row.template_header_3D()
|
||||
|
||||
# Contains buttons like Mode, Pivot, Manipulator, Layer, Mesh Select Mode...
|
||||
layout.template_header_3D()
|
||||
|
||||
row = layout.row()
|
||||
if obj:
|
||||
# Particle edit
|
||||
if obj.mode == 'PARTICLE_EDIT':
|
||||
@ -985,6 +986,7 @@ class VIEW3D_MT_make_links(Menu):
|
||||
|
||||
layout.operator("object.join_uvs") # stupid place to add this!
|
||||
|
||||
|
||||
class VIEW3D_MT_object_game(Menu):
|
||||
bl_label = "Game"
|
||||
|
||||
|
34
release/scripts/templates/driver_functions.py
Normal file
34
release/scripts/templates/driver_functions.py
Normal file
@ -0,0 +1,34 @@
|
||||
# This script defines functions to be used directly in drivers expressions to
|
||||
# extend the builtin set of python functions.
|
||||
#
|
||||
# This can be executed on manually or set to 'Register' to
|
||||
# initialize thefunctions on file load.
|
||||
|
||||
|
||||
# two sample functions
|
||||
def invert(f):
|
||||
""" Simple function call:
|
||||
|
||||
invert(val)
|
||||
"""
|
||||
return 1.0 - f
|
||||
|
||||
|
||||
uuid_store = {}
|
||||
|
||||
def slow_value(value, fac, uuid):
|
||||
""" Delay the value by a factor, use a unique string to allow
|
||||
use in multiple drivers without conflict:
|
||||
|
||||
slow_value(val, 0.5, "my_value")
|
||||
"""
|
||||
value_prev = uuid_store.get(uuid, value)
|
||||
uuid_store[uuid] = value_new = (value_prev * fac) + (value * (1.0 - fac))
|
||||
return value_new
|
||||
|
||||
|
||||
import bpy
|
||||
|
||||
# Add variable defined in this script into the drivers namespace.
|
||||
bpy.app.driver_namespace["invert"] = invert
|
||||
bpy.app.driver_namespace["slow_value"] = slow_value
|
@ -217,7 +217,7 @@ void blf_font_buffer(FontBLF *font, const char *str)
|
||||
unsigned int i= 0;
|
||||
GlyphBLF **glyph_ascii_table= font->glyph_cache->glyph_ascii_table;
|
||||
|
||||
/* buffer spesific vars*/
|
||||
/* buffer specific vars*/
|
||||
const unsigned char b_col_char[4]= {font->b_col[0] * 255,
|
||||
font->b_col[1] * 255,
|
||||
font->b_col[2] * 255,
|
||||
|
@ -1073,7 +1073,7 @@ static void trackto_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *ta
|
||||
cob->matrix[2][2]=size[2];
|
||||
|
||||
/* targetmat[2] instead of ownermat[2] is passed to vectomat
|
||||
* for backwards compatability it seems... (Aligorith)
|
||||
* for backwards compatibility it seems... (Aligorith)
|
||||
*/
|
||||
sub_v3_v3v3(vec, cob->matrix[3], ct->matrix[3]);
|
||||
vectomat(vec, ct->matrix[2],
|
||||
@ -2110,7 +2110,7 @@ static void actcon_new_data (void *cdata)
|
||||
{
|
||||
bActionConstraint *data= (bActionConstraint *)cdata;
|
||||
|
||||
/* set type to 20 (Loc X), as 0 is Rot X for backwards compatability */
|
||||
/* set type to 20 (Loc X), as 0 is Rot X for backwards compatibility */
|
||||
data->type = 20;
|
||||
}
|
||||
|
||||
@ -2167,7 +2167,7 @@ static void actcon_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstraint
|
||||
constraint_target_to_mat4(ct->tar, ct->subtarget, tempmat, CONSTRAINT_SPACE_WORLD, ct->space, con->headtail);
|
||||
|
||||
/* determine where in transform range target is */
|
||||
/* data->type is mapped as follows for backwards compatability:
|
||||
/* data->type is mapped as follows for backwards compatibility:
|
||||
* 00,01,02 - rotation (it used to be like this)
|
||||
* 10,11,12 - scaling
|
||||
* 20,21,22 - location
|
||||
|
@ -1034,12 +1034,14 @@ static ChannelDriver *idriver_to_cdriver (IpoDriver *idriver)
|
||||
/* first bone target */
|
||||
dtar= &dvar->targets[0];
|
||||
dtar->id= (ID *)idriver->ob;
|
||||
dtar->idtype= ID_OB;
|
||||
if (idriver->name[0])
|
||||
BLI_strncpy(dtar->pchan_name, idriver->name, sizeof(dtar->pchan_name));
|
||||
|
||||
/* second bone target (name was stored in same var as the first one) */
|
||||
dtar= &dvar->targets[1];
|
||||
dtar->id= (ID *)idriver->ob;
|
||||
dtar->idtype= ID_OB;
|
||||
if (idriver->name[0]) // xxx... for safety
|
||||
BLI_strncpy(dtar->pchan_name, idriver->name+DRIVER_NAME_OFFS, sizeof(dtar->pchan_name));
|
||||
}
|
||||
@ -1051,6 +1053,7 @@ static ChannelDriver *idriver_to_cdriver (IpoDriver *idriver)
|
||||
/* only requires a single target */
|
||||
dtar= &dvar->targets[0];
|
||||
dtar->id= (ID *)idriver->ob;
|
||||
dtar->idtype= ID_OB;
|
||||
if (idriver->name[0])
|
||||
BLI_strncpy(dtar->pchan_name, idriver->name, sizeof(dtar->pchan_name));
|
||||
dtar->transChan= adrcode_to_dtar_transchan(idriver->adrcode);
|
||||
@ -1065,6 +1068,7 @@ static ChannelDriver *idriver_to_cdriver (IpoDriver *idriver)
|
||||
/* only requires single target */
|
||||
dtar= &dvar->targets[0];
|
||||
dtar->id= (ID *)idriver->ob;
|
||||
dtar->idtype= ID_OB;
|
||||
dtar->transChan= adrcode_to_dtar_transchan(idriver->adrcode);
|
||||
}
|
||||
}
|
||||
|
@ -169,7 +169,7 @@ static void get_proxy_fname(MovieClip *clip, int proxy_render_size, int undistor
|
||||
int size= rendersize_to_number(proxy_render_size);
|
||||
char dir[FILE_MAX], clipdir[FILE_MAX], clipfile[FILE_MAX];
|
||||
|
||||
BLI_split_dirfile(clip->name, clipdir, clipfile);
|
||||
BLI_split_dirfile(clip->name, clipdir, clipfile, FILE_MAX, FILE_MAX);
|
||||
|
||||
if(clip->flag&MCLIP_USE_PROXY_CUSTOM_DIR) {
|
||||
strcpy(dir, clip->proxy.dir);
|
||||
|
@ -1607,8 +1607,8 @@ void psys_get_birth_coordinates(ParticleSimulationData *sim, ParticleData *pa, P
|
||||
}
|
||||
|
||||
|
||||
/* -velocity */
|
||||
if(part->randfac != 0.0f){
|
||||
/* -velocity (boids need this even if there's no random velocity) */
|
||||
if(part->randfac != 0.0f || (part->phystype==PART_PHYS_BOIDS && pa->boid)){
|
||||
r_vel[0] = 2.0f * (PSYS_FRAND(p + 10) - 0.5f);
|
||||
r_vel[1] = 2.0f * (PSYS_FRAND(p + 11) - 0.5f);
|
||||
r_vel[2] = 2.0f * (PSYS_FRAND(p + 12) - 0.5f);
|
||||
|
@ -910,7 +910,7 @@ static int ptcache_path(PTCacheID *pid, char *filename)
|
||||
else if (G.relbase_valid || lib) {
|
||||
char file[MAX_PTCACHE_PATH]; /* we dont want the dir, only the file */
|
||||
|
||||
BLI_split_dirfile(blendfilename, NULL, file);
|
||||
BLI_split_dirfile(blendfilename, NULL, file, 0, sizeof(file));
|
||||
i = strlen(file);
|
||||
|
||||
/* remove .blend */
|
||||
|
@ -3651,7 +3651,7 @@ Sequence *sequencer_add_sound_strip(bContext *C, ListBase *seqbasep, SeqLoadInfo
|
||||
/* we only need 1 element to store the filename */
|
||||
strip->stripdata= se= MEM_callocN(sizeof(StripElem), "stripelem");
|
||||
|
||||
BLI_split_dirfile(seq_load->path, strip->dir, se->name);
|
||||
BLI_split_dirfile(seq_load->path, strip->dir, se->name, sizeof(strip->dir), sizeof(se->name));
|
||||
|
||||
seq->scene_sound = sound_add_scene_sound(scene, seq, seq_load->start_frame, seq_load->start_frame + strip->len, 0);
|
||||
|
||||
@ -3710,7 +3710,7 @@ Sequence *sequencer_add_movie_strip(bContext *C, ListBase *seqbasep, SeqLoadInfo
|
||||
/* we only need 1 element for MOVIE strips */
|
||||
strip->stripdata= se= MEM_callocN(sizeof(StripElem), "stripelem");
|
||||
|
||||
BLI_split_dirfile(seq_load->path, strip->dir, se->name);
|
||||
BLI_split_dirfile(seq_load->path, strip->dir, se->name, sizeof(strip->dir), sizeof(se->name));
|
||||
|
||||
calc_sequence_disp(scene, seq);
|
||||
|
||||
|
@ -63,6 +63,10 @@
|
||||
#include "BKE_sequencer.h"
|
||||
#include "BKE_scene.h"
|
||||
|
||||
// evil quiet NaN definition
|
||||
static const int NAN_INT = 0x7FC00000;
|
||||
#define NAN_FLT *((float*)(&NAN_INT))
|
||||
|
||||
#ifdef WITH_AUDASPACE
|
||||
// evil global ;-)
|
||||
static int sound_cfra;
|
||||
@ -295,7 +299,10 @@ void sound_cache(struct bSound* sound)
|
||||
AUD_unload(sound->cache);
|
||||
|
||||
sound->cache = AUD_bufferSound(sound->handle);
|
||||
if(sound->cache)
|
||||
sound->playback_handle = sound->cache;
|
||||
else
|
||||
sound->playback_handle = sound->handle;
|
||||
}
|
||||
|
||||
void sound_cache_notifying(struct Main* main, struct bSound* sound)
|
||||
@ -332,6 +339,8 @@ void sound_load(struct Main *bmain, struct bSound* sound)
|
||||
sound->playback_handle = NULL;
|
||||
}
|
||||
|
||||
sound_free_waveform(sound);
|
||||
|
||||
// XXX unused currently
|
||||
#if 0
|
||||
switch(sound->type)
|
||||
@ -625,7 +634,7 @@ float sound_sync_scene(struct Scene *scene)
|
||||
else
|
||||
return AUD_getPosition(scene->sound_scene_handle);
|
||||
}
|
||||
return 0.0f;
|
||||
return NAN_FLT;
|
||||
}
|
||||
|
||||
int sound_scene_playing(struct Scene *scene)
|
||||
@ -782,7 +791,7 @@ static void sound_start_play_scene(struct Scene *UNUSED(scene)) {}
|
||||
void sound_play_scene(struct Scene *UNUSED(scene)) {}
|
||||
void sound_stop_scene(struct Scene *UNUSED(scene)) {}
|
||||
void sound_seek_scene(struct Main *UNUSED(bmain), struct Scene *UNUSED(scene)) {}
|
||||
float sound_sync_scene(struct Scene *UNUSED(scene)) { return 0.0f; }
|
||||
float sound_sync_scene(struct Scene *UNUSED(scene)) { return NAN_FLT; }
|
||||
int sound_scene_playing(struct Scene *UNUSED(scene)) { return -1; }
|
||||
int sound_read_sound_buffer(struct bSound* UNUSED(sound), float* UNUSED(buffer), int UNUSED(length), float UNUSED(start), float UNUSED(end)) { return 0; }
|
||||
void sound_read_waveform(struct bSound* sound) { (void)sound; }
|
||||
|
@ -103,7 +103,7 @@ void BLI_setenv_if_new(const char *env, const char* val);
|
||||
void BLI_make_file_string(const char *relabase, char *string, const char *dir, const char *file);
|
||||
void BLI_make_exist(char *dir);
|
||||
void BLI_make_existing_file(const char *name);
|
||||
void BLI_split_dirfile(const char *string, char *dir, char *file);
|
||||
void BLI_split_dirfile(const char *string, char *dir, char *file, const size_t dirlen, const size_t filelen);
|
||||
void BLI_join_dirfile(char *string, const size_t maxlen, const char *dir, const char *file);
|
||||
char *BLI_path_basename(char *path);
|
||||
int BKE_rebase_path(char *abs, size_t abs_len, char *rel, size_t rel_len, const char *base_dir, const char *src_dir, const char *dest_dir);
|
||||
|
@ -400,7 +400,7 @@ static void seq_setpath(struct BPathIterator *bpi, const char *path)
|
||||
|
||||
if (SEQ_HAS_PATH(seq)) {
|
||||
if (ELEM3(seq->type, SEQ_IMAGE, SEQ_MOVIE, SEQ_SOUND)) {
|
||||
BLI_split_dirfile(path, seq->strip->dir, seq->strip->stripdata->name);
|
||||
BLI_split_dirfile(path, seq->strip->dir, seq->strip->stripdata->name, sizeof(seq->strip->dir), sizeof(seq->strip->stripdata->name));
|
||||
}
|
||||
else {
|
||||
/* simple case */
|
||||
@ -903,7 +903,7 @@ void findMissingFiles(Main *bmain, const char *str)
|
||||
|
||||
//XXX waitcursor( 1 );
|
||||
|
||||
BLI_split_dirfile(str, dirname, NULL);
|
||||
BLI_split_dirfile(str, dirname, NULL, sizeof(dirname), 0);
|
||||
|
||||
BLI_bpathIterator_init(&bpi, bmain, bmain->name, 0);
|
||||
|
||||
|
@ -894,7 +894,7 @@ static int get_path_local(char *targetpath, const char *folder_name, const char
|
||||
}
|
||||
|
||||
/* use argv[0] (bprogname) to get the path to the executable */
|
||||
BLI_split_dirfile(bprogname, bprogdir, NULL);
|
||||
BLI_split_dirfile(bprogname, bprogdir, NULL, sizeof(bprogdir), 0);
|
||||
|
||||
/* try EXECUTABLE_DIR/2.5x/folder_name - new default directory for local blender installed files */
|
||||
if(test_path(targetpath, bprogdir, blender_version_decimal(ver), relfolder))
|
||||
@ -966,7 +966,7 @@ static int get_path_system(char *targetpath, const char *folder_name, const char
|
||||
char bprogdir[FILE_MAX];
|
||||
|
||||
/* use argv[0] (bprogname) to get the path to the executable */
|
||||
BLI_split_dirfile(bprogname, bprogdir, NULL);
|
||||
BLI_split_dirfile(bprogname, bprogdir, NULL, sizeof(bprogdir), 0);
|
||||
|
||||
if(folder_name) {
|
||||
if (subfolder_name) {
|
||||
@ -1411,21 +1411,22 @@ int BLI_replace_extension(char *path, size_t maxlen, const char *ext)
|
||||
* - dosnt use CWD, or deal with relative paths.
|
||||
* - Only fill's in *dir and *file when they are non NULL
|
||||
* */
|
||||
void BLI_split_dirfile(const char *string, char *dir, char *file)
|
||||
void BLI_split_dirfile(const char *string, char *dir, char *file, const size_t dirlen, const size_t filelen)
|
||||
{
|
||||
char *lslash_str = BLI_last_slash(string);
|
||||
int lslash= lslash_str ? (int)(lslash_str - string) + 1 : 0;
|
||||
size_t lslash= lslash_str ? (size_t)(lslash_str - string) + 1 : 0;
|
||||
|
||||
if (dir) {
|
||||
if (lslash) {
|
||||
BLI_strncpy( dir, string, lslash + 1); /* +1 to include the slash and the last char */
|
||||
} else {
|
||||
BLI_strncpy( dir, string, MIN2(dirlen, lslash + 1)); /* +1 to include the slash and the last char */
|
||||
}
|
||||
else {
|
||||
dir[0] = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
if (file) {
|
||||
strcpy( file, string+lslash);
|
||||
BLI_strncpy(file, string+lslash, filelen);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1515,7 +1516,7 @@ int BKE_rebase_path(char *abs, size_t abs_len, char *rel, size_t rel_len, const
|
||||
if (rel)
|
||||
rel[0]= 0;
|
||||
|
||||
BLI_split_dirfile(base_dir, blend_dir, NULL);
|
||||
BLI_split_dirfile(base_dir, blend_dir, NULL, sizeof(blend_dir), 0);
|
||||
|
||||
if (src_dir[0]=='\0')
|
||||
return 0;
|
||||
@ -1526,7 +1527,7 @@ int BKE_rebase_path(char *abs, size_t abs_len, char *rel, size_t rel_len, const
|
||||
BLI_path_abs(path, base_dir);
|
||||
|
||||
/* get the directory part */
|
||||
BLI_split_dirfile(path, dir, base);
|
||||
BLI_split_dirfile(path, dir, base, sizeof(dir), sizeof(base));
|
||||
|
||||
len= strlen(blend_dir);
|
||||
|
||||
|
@ -53,11 +53,10 @@
|
||||
|
||||
int BLI_getInstallationDir( char * str ) {
|
||||
char dir[FILE_MAXDIR];
|
||||
char file[FILE_MAXFILE];
|
||||
int a;
|
||||
|
||||
GetModuleFileName(NULL,str,FILE_MAXDIR+FILE_MAXFILE);
|
||||
BLI_split_dirfile(str,dir,file); /* shouldn't be relative */
|
||||
BLI_split_dirfile(str, dir, NULL, sizeof(dir), 0); /* shouldn't be relative */
|
||||
a = strlen(dir);
|
||||
if(dir[a-1] == '\\') dir[a-1]=0;
|
||||
|
||||
|
@ -204,7 +204,7 @@ BLO_blendhandle_close(
|
||||
|
||||
#define GROUP_MAX 32
|
||||
|
||||
int BLO_has_bfile_extension(char *str);
|
||||
int BLO_has_bfile_extension(const char *str);
|
||||
|
||||
/* return ok when a blenderfile, in dir is the filename,
|
||||
* in group the type of libdata
|
||||
|
@ -1051,7 +1051,7 @@ void blo_freefiledata(FileData *fd)
|
||||
|
||||
/* ************ DIV ****************** */
|
||||
|
||||
int BLO_has_bfile_extension(char *str)
|
||||
int BLO_has_bfile_extension(const char *str)
|
||||
{
|
||||
return (BLI_testextensie(str, ".ble") || BLI_testextensie(str, ".blend") || BLI_testextensie(str, ".blend.gz"));
|
||||
}
|
||||
|
@ -2717,8 +2717,8 @@ int BLO_write_file(Main *mainvar, const char *filepath, int write_flags, ReportL
|
||||
if(write_flags & G_FILE_RELATIVE_REMAP) {
|
||||
char dir1[FILE_MAXDIR+FILE_MAXFILE];
|
||||
char dir2[FILE_MAXDIR+FILE_MAXFILE];
|
||||
BLI_split_dirfile(filepath, dir1, NULL);
|
||||
BLI_split_dirfile(mainvar->name, dir2, NULL);
|
||||
BLI_split_dirfile(filepath, dir1, NULL, sizeof(dir1), 0);
|
||||
BLI_split_dirfile(mainvar->name, dir2, NULL, sizeof(dir2), 0);
|
||||
|
||||
/* just incase there is some subtle difference */
|
||||
BLI_cleanup_dir(mainvar->name, dir1);
|
||||
|
@ -962,6 +962,7 @@ void AnimationImporter::translate_Animations ( COLLADAFW::Node * node ,
|
||||
for (unsigned int j = 0; j < matBinds.getCount(); j++) {
|
||||
const COLLADAFW::UniqueId & matuid = matBinds[j].getReferencedMaterial();
|
||||
const COLLADAFW::Effect *ef = (COLLADAFW::Effect *) (FW_object_map[matuid]);
|
||||
if (ef != NULL) { /* can be NULL [#28909] */
|
||||
const COLLADAFW::CommonEffectPointerArray& commonEffects = ef->getCommonEffects();
|
||||
COLLADAFW::EffectCommon *efc = commonEffects[0];
|
||||
if((animType->material & MATERIAL_SHININESS) != 0){
|
||||
@ -990,6 +991,7 @@ void AnimationImporter::translate_Animations ( COLLADAFW::Node * node ,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1051,6 +1053,7 @@ AnimationImporter::AnimMix* AnimationImporter::get_animation_type ( const COLLAD
|
||||
for (unsigned int j = 0; j < matBinds.getCount(); j++) {
|
||||
const COLLADAFW::UniqueId & matuid = matBinds[j].getReferencedMaterial();
|
||||
const COLLADAFW::Effect *ef = (COLLADAFW::Effect *) (FW_object_map[matuid]);
|
||||
if (ef != NULL) { /* can be NULL [#28909] */
|
||||
const COLLADAFW::CommonEffectPointerArray& commonEffects = ef->getCommonEffects();
|
||||
if(!commonEffects.empty()) {
|
||||
COLLADAFW::EffectCommon *efc = commonEffects[0];
|
||||
@ -1062,6 +1065,7 @@ AnimationImporter::AnimMix* AnimationImporter::get_animation_type ( const COLLAD
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return types;
|
||||
}
|
||||
|
||||
|
@ -884,7 +884,7 @@ bool DocumentImporter::writeImage( const COLLADAFW::Image* image )
|
||||
char dir[FILE_MAX];
|
||||
char full_path[FILE_MAX];
|
||||
|
||||
BLI_split_dirfile(filename, dir, NULL);
|
||||
BLI_split_dirfile(filename, dir, NULL, sizeof(dir), 0);
|
||||
BLI_join_dirfile(full_path, sizeof(full_path), dir, filepath.c_str());
|
||||
Image *ima = BKE_add_image_file(full_path);
|
||||
if (!ima) {
|
||||
|
@ -97,7 +97,7 @@ void ImagesExporter::operator()(Material *ma, Object *ob)
|
||||
char src[FILE_MAX];
|
||||
char dir[FILE_MAX];
|
||||
|
||||
BLI_split_dirfile(this->export_settings->filepath, dir, NULL);
|
||||
BLI_split_dirfile(this->export_settings->filepath, dir, NULL, sizeof(dir), 0);
|
||||
|
||||
BKE_rebase_path(abs, sizeof(abs), rel, sizeof(rel), G.main->name, image->name, dir);
|
||||
|
||||
|
@ -361,7 +361,8 @@ short ANIM_animdata_get_context (const bContext *C, bAnimContext *ac)
|
||||
_doSubChannels=2; \
|
||||
else {\
|
||||
filter_mode |= ANIMFILTER_TMP_PEEK; \
|
||||
}
|
||||
} \
|
||||
(void) _doSubChannels;
|
||||
/* ... standard sub-channel filtering can go on here now ... */
|
||||
#define END_ANIMFILTER_SUBCHANNELS \
|
||||
filter_mode = _filter; \
|
||||
|
@ -259,7 +259,7 @@ void duplicate_gplayer_frames (bGPDlayer *gpl)
|
||||
/* Copy and Paste Tools */
|
||||
/* - The copy/paste buffer currently stores a set of GP_Layers, with temporary
|
||||
* GP_Frames with the necessary strokes
|
||||
* - Unless there is only one element in the buffer, names are also tested to check for compatability.
|
||||
* - Unless there is only one element in the buffer, names are also tested to check for compatibility.
|
||||
* - All pasted frames are offset by the same amount. This is calculated as the difference in the times of
|
||||
* the current frame and the 'first keyframe' (i.e. the earliest one in all channels).
|
||||
* - The earliest frame is calculated per copy operation.
|
||||
|
@ -106,7 +106,7 @@ void ED_fileselect_clear(struct bContext *C, struct SpaceFile *sfile);
|
||||
|
||||
void ED_fileselect_exit(struct bContext *C, struct SpaceFile *sfile);
|
||||
|
||||
int ED_file_extension_icon(char *relname);
|
||||
int ED_file_extension_icon(const char *relname);
|
||||
|
||||
#endif /* ED_FILES_H */
|
||||
|
||||
|
@ -575,7 +575,7 @@ static void ui_draw_links(uiBlock *block)
|
||||
/* NOTE: if but->poin is allocated memory for every defbut, things fail... */
|
||||
static int ui_but_equals_old(uiBut *but, uiBut *oldbut)
|
||||
{
|
||||
/* various properties are being compared here, hopfully sufficient
|
||||
/* various properties are being compared here, hopefully sufficient
|
||||
* to catch all cases, but it is simple to add more checks later */
|
||||
if(but->retval != oldbut->retval) return 0;
|
||||
if(but->rnapoin.data != oldbut->rnapoin.data) return 0;
|
||||
@ -640,7 +640,7 @@ static int ui_but_update_from_old_block(const bContext *C, uiBlock *block, uiBut
|
||||
// but->flag= oldbut->flag;
|
||||
#else
|
||||
/* exception! redalert flag can't be update from old button.
|
||||
* perhaps it should only copy spesific flags rather than all. */
|
||||
* perhaps it should only copy specific flags rather than all. */
|
||||
// but->flag= (oldbut->flag & ~UI_BUT_REDALERT) | (but->flag & UI_BUT_REDALERT);
|
||||
#endif
|
||||
// but->active= oldbut->active;
|
||||
@ -748,7 +748,7 @@ static int ui_but_is_rna_undo(uiBut *but)
|
||||
if(but->rnapoin.id.data) {
|
||||
/* avoid undo push for buttons who's ID are screen or wm level
|
||||
* we could disable undo for buttons with no ID too but may have
|
||||
* unforseen conciquences, so best check for ID's we _know_ are not
|
||||
* unforeseen consequences, so best check for ID's we _know_ are not
|
||||
* handled by undo - campbell */
|
||||
ID *id= but->rnapoin.id.data;
|
||||
if(ID_CHECK_UNDO(id) == FALSE) {
|
||||
@ -865,7 +865,7 @@ void uiEndBlock(const bContext *C, uiBlock *block)
|
||||
|
||||
/* inherit flags from 'old' buttons that was drawn here previous, based
|
||||
* on matching buttons, we need this to make button event handling non
|
||||
* blocking, while still alowing buttons to be remade each redraw as it
|
||||
* blocking, while still allowing buttons to be remade each redraw as it
|
||||
* is expected by blender code */
|
||||
for(but=block->buttons.first; but; but=but->next) {
|
||||
if(ui_but_update_from_old_block(C, block, &but))
|
||||
@ -1211,7 +1211,7 @@ void ui_delete_linkline(uiLinkLine *line, uiBut *but)
|
||||
* an edit override pointer while dragging for example */
|
||||
|
||||
/* for buttons pointing to color for example */
|
||||
void ui_get_but_vectorf(uiBut *but, float *vec)
|
||||
void ui_get_but_vectorf(uiBut *but, float vec[3])
|
||||
{
|
||||
PropertyRNA *prop;
|
||||
int a, tot;
|
||||
@ -1249,29 +1249,36 @@ void ui_get_but_vectorf(uiBut *but, float *vec)
|
||||
vec[0]= vec[1]= vec[2]= 0.0f;
|
||||
}
|
||||
}
|
||||
|
||||
if (but->type == BUT_NORMAL) {
|
||||
normalize_v3(vec);
|
||||
}
|
||||
}
|
||||
|
||||
/* for buttons pointing to color for example */
|
||||
void ui_set_but_vectorf(uiBut *but, float *vec)
|
||||
void ui_set_but_vectorf(uiBut *but, const float vec[3])
|
||||
{
|
||||
PropertyRNA *prop;
|
||||
int a, tot;
|
||||
|
||||
if(but->editvec) {
|
||||
VECCOPY(but->editvec, vec);
|
||||
copy_v3_v3(but->editvec, vec);
|
||||
}
|
||||
|
||||
if(but->rnaprop) {
|
||||
prop= but->rnaprop;
|
||||
|
||||
if(RNA_property_type(prop) == PROP_FLOAT) {
|
||||
int tot;
|
||||
int a;
|
||||
|
||||
tot= RNA_property_array_length(&but->rnapoin, prop);
|
||||
tot= MIN2(tot, 3);
|
||||
|
||||
for(a=0; a<tot; a++)
|
||||
for (a=0; a<tot; a++) {
|
||||
RNA_property_float_set_index(&but->rnapoin, prop, a, vec[a]);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(but->pointype == CHA) {
|
||||
char *cp= (char *)but->poin;
|
||||
cp[0]= (char)(0.5f + vec[0]*255.0f);
|
||||
@ -1280,7 +1287,7 @@ void ui_set_but_vectorf(uiBut *but, float *vec)
|
||||
}
|
||||
else if(but->pointype == FLO) {
|
||||
float *fp= (float *)but->poin;
|
||||
VECCOPY(fp, vec);
|
||||
copy_v3_v3(fp, vec);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -179,6 +179,7 @@ int ui_but_anim_expression_create(uiBut *but, const char *str)
|
||||
|
||||
dtar = &dvar->targets[0];
|
||||
dtar->id = (ID *)CTX_data_scene(C); // XXX: should we check that C is valid first?
|
||||
dtar->idtype= ID_SCE;
|
||||
dtar->rna_path = BLI_sprintfN("frame_current");
|
||||
}
|
||||
|
||||
|
@ -1977,8 +1977,6 @@ static void ui_do_but_textedit_select(bContext *C, uiBlock *block, uiBut *but, u
|
||||
|
||||
static void ui_numedit_begin(uiBut *but, uiHandleButtonData *data)
|
||||
{
|
||||
float softrange, softmin, softmax;
|
||||
|
||||
if(but->type == BUT_CURVE) {
|
||||
but->editcumap= (CurveMapping*)but->poin;
|
||||
}
|
||||
@ -1988,10 +1986,12 @@ static void ui_numedit_begin(uiBut *but, uiHandleButtonData *data)
|
||||
}
|
||||
else if(ELEM3(but->type, BUT_NORMAL, HSVCUBE, HSVCIRCLE)) {
|
||||
ui_get_but_vectorf(but, data->origvec);
|
||||
VECCOPY(data->vec, data->origvec);
|
||||
copy_v3_v3(data->vec, data->origvec);
|
||||
but->editvec= data->vec;
|
||||
}
|
||||
else {
|
||||
float softrange, softmin, softmax;
|
||||
|
||||
data->startvalue= ui_get_but_val(but);
|
||||
data->origvalue= data->startvalue;
|
||||
data->value= data->origvalue;
|
||||
@ -3015,6 +3015,9 @@ static int ui_numedit_but_NORMAL(uiBut *but, uiHandleButtonData *data, int mx, i
|
||||
/* button is presumed square */
|
||||
/* if mouse moves outside of sphere, it does negative normal */
|
||||
|
||||
/* note that both data->vec and data->origvec should be normalized
|
||||
* else we'll get a hamrless but annoying jump when first clicking */
|
||||
|
||||
fp= data->origvec;
|
||||
rad= (but->x2 - but->x1);
|
||||
radsq= rad*rad;
|
||||
|
@ -350,8 +350,8 @@ extern void ui_window_to_region(const ARegion *ar, int *x, int *y);
|
||||
extern double ui_get_but_val(uiBut *but);
|
||||
extern void ui_set_but_val(uiBut *but, double value);
|
||||
extern void ui_set_but_hsv(uiBut *but);
|
||||
extern void ui_get_but_vectorf(uiBut *but, float *vec);
|
||||
extern void ui_set_but_vectorf(uiBut *but, float *vec);
|
||||
extern void ui_get_but_vectorf(uiBut *but, float vec[3]);
|
||||
extern void ui_set_but_vectorf(uiBut *but, const float vec[3]);
|
||||
|
||||
extern void ui_hsvcircle_vals_from_pos(float *valrad, float *valdist, rcti *rect, float mx, float my);
|
||||
|
||||
|
@ -368,7 +368,7 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but)
|
||||
/* create tooltip data */
|
||||
data= MEM_callocN(sizeof(uiTooltipData), "uiTooltipData");
|
||||
|
||||
/* special case, enum rna buttons only have enum item description, use general enum description too before the spesific one */
|
||||
/* special case, enum rna buttons only have enum item description, use general enum description too before the specific one */
|
||||
if(but->rnaprop && RNA_property_type(but->rnaprop) == PROP_ENUM) {
|
||||
const char *descr= RNA_property_description(but->rnaprop);
|
||||
if(descr && descr[0]) {
|
||||
|
@ -3966,7 +3966,7 @@ static int project_paint_op(void *state, ImBuf *UNUSED(ibufb), float *lastpos, f
|
||||
copy_v2_v2(handles[a].mval, pos);
|
||||
copy_v2_v2(handles[a].prevmval, lastpos);
|
||||
|
||||
/* thread spesific */
|
||||
/* thread specific */
|
||||
handles[a].thread_index = a;
|
||||
|
||||
handles[a].projImages = (ProjPaintImage *)BLI_memarena_alloc(ps->arena_mt[a], ps->image_tot * sizeof(ProjPaintImage));
|
||||
|
@ -1619,7 +1619,7 @@ static void do_weight_paint_vertex( /* vars which remain the same for every vert
|
||||
}
|
||||
}
|
||||
|
||||
/* important to normalize after mirror, otherwise mirror gets wight
|
||||
/* important to normalize after mirror, otherwise mirror gets weight
|
||||
* which has already been scaled down in relation to other weights,
|
||||
* then scales a second time [#26193]. Tricky multi-paint code doesn't
|
||||
* suffer from this problem - campbell */
|
||||
|
@ -181,7 +181,7 @@ void file_draw_buttons(const bContext *C, ARegion *ar)
|
||||
|
||||
but = uiDefButTextO(block, TEX, "FILE_OT_directory", 0, "",
|
||||
min_x, line1_y, line1_w-chan_offs, btn_h,
|
||||
params->dir, 0.0, (float)FILE_MAX-1, 0, 0,
|
||||
params->dir, 0.0, (float)FILE_MAX, 0, 0,
|
||||
UI_translate_do_tooltip(N_("File path")));
|
||||
uiButSetCompleteFunc(but, autocomplete_directory, NULL);
|
||||
uiButSetFlag(but, UI_BUT_NO_UTF8);
|
||||
@ -189,7 +189,7 @@ void file_draw_buttons(const bContext *C, ARegion *ar)
|
||||
if((params->flag & FILE_DIRSEL_ONLY) == 0) {
|
||||
but = uiDefBut(block, TEX, B_FS_FILENAME, "",
|
||||
min_x, line2_y, line2_w-chan_offs, btn_h,
|
||||
params->file, 0.0, (float)FILE_MAXFILE-1, 0, 0,
|
||||
params->file, 0.0, (float)FILE_MAXFILE, 0, 0,
|
||||
UI_translate_do_tooltip(overwrite_alert ?N_("File name, overwrite existing") : N_("File name")));
|
||||
uiButSetCompleteFunc(but, autocomplete_file, NULL);
|
||||
uiButSetFlag(but, UI_BUT_NO_UTF8);
|
||||
|
@ -666,7 +666,7 @@ void file_operator_to_sfile(SpaceFile *sfile, wmOperator *op)
|
||||
if((prop= RNA_struct_find_property(op->ptr, "filepath"))) {
|
||||
char filepath[FILE_MAX];
|
||||
RNA_property_string_get(op->ptr, prop, filepath);
|
||||
BLI_split_dirfile(filepath, sfile->params->dir, sfile->params->file);
|
||||
BLI_split_dirfile(filepath, sfile->params->dir, sfile->params->file, sizeof(sfile->params->dir), sizeof(sfile->params->file));
|
||||
}
|
||||
else {
|
||||
if((prop= RNA_struct_find_property(op->ptr, "filename"))) {
|
||||
@ -1143,7 +1143,7 @@ int file_directory_exec(bContext *C, wmOperator *UNUSED(unused))
|
||||
if(BLI_exists(sfile->params->dir) && BLI_is_dir(sfile->params->dir) == 0) {
|
||||
char path[sizeof(sfile->params->dir)];
|
||||
BLI_strncpy(path, sfile->params->dir, sizeof(path));
|
||||
BLI_split_dirfile(path, sfile->params->dir, sfile->params->file);
|
||||
BLI_split_dirfile(path, sfile->params->dir, sfile->params->file, sizeof(sfile->params->dir), sizeof(sfile->params->file));
|
||||
}
|
||||
|
||||
BLI_cleanup_dir(G.main->name, sfile->params->dir);
|
||||
|
@ -736,7 +736,7 @@ static int file_is_blend_backup(const char *str)
|
||||
}
|
||||
|
||||
|
||||
static int file_extension_type(char *relname)
|
||||
static int file_extension_type(const char *relname)
|
||||
{
|
||||
if(BLO_has_bfile_extension(relname)) {
|
||||
return BLENDERFILE;
|
||||
@ -769,7 +769,7 @@ static int file_extension_type(char *relname)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ED_file_extension_icon(char *relname)
|
||||
int ED_file_extension_icon(const char *relname)
|
||||
{
|
||||
int type= file_extension_type(relname);
|
||||
|
||||
|
@ -113,7 +113,7 @@ short ED_fileselect_set_params(SpaceFile *sfile)
|
||||
if (!sfile->params) {
|
||||
sfile->params= MEM_callocN(sizeof(FileSelectParams), "fileselparams");
|
||||
/* set path to most recently opened .blend */
|
||||
BLI_split_dirfile(G.main->name, sfile->params->dir, sfile->params->file);
|
||||
BLI_split_dirfile(G.main->name, sfile->params->dir, sfile->params->file, sizeof(sfile->params->dir), sizeof(sfile->params->file));
|
||||
sfile->params->filter_glob[0] = '\0';
|
||||
}
|
||||
|
||||
@ -142,7 +142,7 @@ short ED_fileselect_set_params(SpaceFile *sfile)
|
||||
sfile->params->file[0]= '\0';
|
||||
}
|
||||
else {
|
||||
BLI_split_dirfile(name, sfile->params->dir, sfile->params->file);
|
||||
BLI_split_dirfile(name, sfile->params->dir, sfile->params->file, sizeof(sfile->params->dir), sizeof(sfile->params->file));
|
||||
}
|
||||
}
|
||||
else {
|
||||
@ -613,7 +613,7 @@ void autocomplete_directory(struct bContext *C, char *str, void *UNUSED(arg_v))
|
||||
DIR *dir;
|
||||
struct dirent *de;
|
||||
|
||||
BLI_split_dirfile(str, dirname, NULL);
|
||||
BLI_split_dirfile(str, dirname, NULL, sizeof(dirname), 0);
|
||||
|
||||
dir = opendir(dirname);
|
||||
|
||||
|
@ -340,7 +340,7 @@ static void draw_fcurve_handles (SpaceIpo *sipo, FCurve *fcu)
|
||||
int sel, b;
|
||||
|
||||
/* a single call to GL_LINES here around these calls should be sufficient to still
|
||||
* get separate line segments, but which aren't wrapped with GL_LINE_STRIP everytime we
|
||||
* get separate line segments, but which aren't wrapped with GL_LINE_STRIP every time we
|
||||
* want a single line
|
||||
*/
|
||||
glBegin(GL_LINES);
|
||||
|
@ -321,7 +321,7 @@ static int sequencer_add_generic_strip_exec(bContext *C, wmOperator *op, SeqLoad
|
||||
char dir_only[FILE_MAX];
|
||||
char file_only[FILE_MAX];
|
||||
|
||||
BLI_split_dirfile(seq_load.path, dir_only, NULL);
|
||||
BLI_split_dirfile(seq_load.path, dir_only, NULL, sizeof(dir_only), 0);
|
||||
|
||||
RNA_BEGIN(op->ptr, itemptr, "files") {
|
||||
RNA_string_get(&itemptr, "name", file_only);
|
||||
|
@ -192,6 +192,9 @@ static void drawseqwave(Scene *scene, Sequence *seq, float x1, float y1, float x
|
||||
|
||||
waveform = seq->sound->waveform;
|
||||
|
||||
if(!waveform)
|
||||
return;
|
||||
|
||||
startsample = floor((seq->startofs + seq->anim_startofs)/FPS * SOUND_WAVE_SAMPLES_PER_SECOND);
|
||||
endsample = ceil((seq->startofs + seq->anim_startofs + seq->enddisp - seq->startdisp)/FPS * SOUND_WAVE_SAMPLES_PER_SECOND);
|
||||
samplestep = (endsample-startsample) * stepsize / (x2-x1);
|
||||
|
@ -2977,7 +2977,7 @@ static int sequencer_change_path_exec(bContext *C, wmOperator *op)
|
||||
|
||||
RNA_string_get(op->ptr, "directory", directory);
|
||||
if (is_relative_path) {
|
||||
/* TODO, shouldnt this already be relative from the filesel?
|
||||
/* TODO, shouldn't this already be relative from the filesel?
|
||||
* (as the 'filepath' is) for now just make relative here,
|
||||
* but look into changing after 2.60 - campbell */
|
||||
BLI_path_rel(directory, bmain->name);
|
||||
|
@ -362,7 +362,7 @@ static void sequencer_drop_copy(wmDrag *drag, wmDropBox *drop)
|
||||
PointerRNA itemptr;
|
||||
char dir[FILE_MAX], file[FILE_MAX];
|
||||
|
||||
BLI_split_dirfile(drag->path, dir, file);
|
||||
BLI_split_dirfile(drag->path, dir, file, sizeof(dir), sizeof(file));
|
||||
|
||||
RNA_string_set(drop->ptr, "directory", dir);
|
||||
|
||||
|
@ -806,7 +806,7 @@ void view3d_cached_text_draw_end(View3D *v3d, ARegion *ar, int depth_write, floa
|
||||
else glDepthMask(0);
|
||||
|
||||
for(vos= strings->first; vos; vos= vos->next) {
|
||||
#if 0 // too slow, reading opengl info while drawing is very bad, better to see if we cn use the zbuffer while in pixel space - campbell
|
||||
#if 0 // too slow, reading opengl info while drawing is very bad, better to see if we can use the zbuffer while in pixel space - campbell
|
||||
if(v3d->zbuf && (vos->flag & V3D_CACHE_TEXT_ZBUF)) {
|
||||
gluProject(vos->vec[0], vos->vec[1], vos->vec[2], mats.modelview, mats.projection, (GLint *)mats.viewport, &ux, &uy, &uz);
|
||||
glReadPixels(ar->winrct.xmin+vos->mval[0]+vos->xoffs, ar->winrct.ymin+vos->mval[1], 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, &depth);
|
||||
@ -6951,7 +6951,10 @@ void draw_object_backbufsel(Scene *scene, View3D *v3d, RegionView3D *rv3d, Objec
|
||||
}
|
||||
else {
|
||||
Mesh *me= ob->data;
|
||||
if(me->editflag & ME_EDIT_VERT_SEL) {
|
||||
if( (me->editflag & ME_EDIT_VERT_SEL) &&
|
||||
/* currently vertex select only supports weight paint */
|
||||
(ob->mode & OB_MODE_WEIGHT_PAINT))
|
||||
{
|
||||
DerivedMesh *dm = mesh_get_derived_final(scene, ob, scene->customdata_mask);
|
||||
glColor3ub(0, 0, 0);
|
||||
|
||||
|
@ -1960,7 +1960,7 @@ static void protectedQuaternionBits(short protectflag, float *quat, float *oldqu
|
||||
quat[3]= oldquat[3];
|
||||
}
|
||||
else {
|
||||
/* quaternions get limited with euler... (compatability mode) */
|
||||
/* quaternions get limited with euler... (compatibility mode) */
|
||||
float eul[3], oldeul[3], nquat[4], noldquat[4];
|
||||
float qlen;
|
||||
|
||||
|
@ -1,6 +1,4 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
|
@ -340,8 +340,8 @@ typedef struct bPose {
|
||||
void *ikdata; /* temporary IK data, depends on the IK solver. Not saved in file */
|
||||
void *ikparam; /* IK solver parameters, structure depends on iksolver */
|
||||
|
||||
bAnimVizSettings avs; /* settings for visualisation of bone animation */
|
||||
char proxy_act_bone[32]; /*proxy active bone name*/
|
||||
bAnimVizSettings avs; /* settings for visualization of bone animation */
|
||||
char proxy_act_bone[32]; /* proxy active bone name*/
|
||||
} bPose;
|
||||
|
||||
|
||||
@ -423,6 +423,8 @@ typedef enum eItasc_Solver {
|
||||
* This is also exploited for bone-groups. Bone-Groups are stored per bPose, and are used
|
||||
* primarily to color bones in the 3d-view. There are other benefits too, but those are mostly related
|
||||
* to Action-Groups.
|
||||
*
|
||||
* Note that these two uses each have their own RNA 'ActionGroup' and 'BoneGroup'.
|
||||
*/
|
||||
typedef struct bActionGroup {
|
||||
struct bActionGroup *next, *prev;
|
||||
@ -651,7 +653,7 @@ typedef enum eAnimEdit_AutoSnap {
|
||||
* Constraint Channels in certain situations.
|
||||
*
|
||||
* Action-Channels can only belong to one group at a time, but they still live the Action's
|
||||
* list of achans (to preserve backwards compatability, and also minimise the code
|
||||
* list of achans (to preserve backwards compatibility, and also minimize the code
|
||||
* that would need to be recoded). Grouped achans are stored at the start of the list, according
|
||||
* to the position of the group in the list, and their position within the group.
|
||||
*/
|
||||
|
@ -228,7 +228,7 @@ typedef struct bMinMaxConstraint {
|
||||
int minmaxflag;
|
||||
float offset;
|
||||
int flag;
|
||||
short sticky, stuck, pad1, pad2; /* for backward compatability */
|
||||
short sticky, stuck, pad1, pad2; /* for backward compatibility */
|
||||
float cache[3];
|
||||
char subtarget[32];
|
||||
} bMinMaxConstraint;
|
||||
|
@ -30,7 +30,7 @@
|
||||
* \deprecated
|
||||
* The contents of this file are now officially depreceated. They were used for the 'old' animation system,
|
||||
* which has (as of 2.50) been replaced with a completely new system by Joshua Leung (aligorith). All defines,
|
||||
* etc. are only still maintained to provide backwards compatability for old files.
|
||||
* etc. are only still maintained to provide backwards compatibility for old files.
|
||||
*/
|
||||
|
||||
#ifndef DNA_IPO_TYPES_H
|
||||
|
@ -416,8 +416,8 @@ typedef struct DupliObject {
|
||||
#define OB_BOUND_SPHERE 1
|
||||
#define OB_BOUND_CYLINDER 2
|
||||
#define OB_BOUND_CONE 3
|
||||
#define OB_BOUND_POLYH 4
|
||||
#define OB_BOUND_POLYT 5
|
||||
#define OB_BOUND_TRIANGLE_MESH 4
|
||||
#define OB_BOUND_CONVEX_HULL 5
|
||||
/* #define OB_BOUND_DYN_MESH 6 */ /*UNUSED*/
|
||||
#define OB_BOUND_CAPSULE 7
|
||||
|
||||
|
@ -83,8 +83,8 @@ static EnumPropertyItem collision_bounds_items[] = {
|
||||
{OB_BOUND_SPHERE, "SPHERE", 0, "Sphere", ""},
|
||||
{OB_BOUND_CYLINDER, "CYLINDER", 0, "Cylinder", ""},
|
||||
{OB_BOUND_CONE, "CONE", 0, "Cone", ""},
|
||||
{OB_BOUND_POLYT, "CONVEX_HULL", 0, "Convex Hull", ""},
|
||||
{OB_BOUND_POLYH, "TRIANGLE_MESH", 0, "Triangle Mesh", ""},
|
||||
{OB_BOUND_CONVEX_HULL, "CONVEX_HULL", 0, "Convex Hull", ""},
|
||||
{OB_BOUND_TRIANGLE_MESH, "TRIANGLE_MESH", 0, "Triangle Mesh", ""},
|
||||
{OB_BOUND_CAPSULE, "CAPSULE", 0, "Capsule", ""},
|
||||
//{OB_DYN_MESH, "DYNAMIC_MESH", 0, "Dynamic Mesh", ""},
|
||||
{0, NULL, 0, NULL, NULL}};
|
||||
@ -430,8 +430,8 @@ static EnumPropertyItem *rna_Object_collision_bounds_itemf(bContext *UNUSED(C),
|
||||
EnumPropertyItem *item= NULL;
|
||||
int totitem= 0;
|
||||
|
||||
RNA_enum_items_add_value(&item, &totitem, collision_bounds_items, OB_BOUND_POLYH);
|
||||
RNA_enum_items_add_value(&item, &totitem, collision_bounds_items, OB_BOUND_POLYT);
|
||||
RNA_enum_items_add_value(&item, &totitem, collision_bounds_items, OB_BOUND_TRIANGLE_MESH);
|
||||
RNA_enum_items_add_value(&item, &totitem, collision_bounds_items, OB_BOUND_CONVEX_HULL);
|
||||
|
||||
if(ob->body_type!=OB_BODY_TYPE_SOFT) {
|
||||
RNA_enum_items_add_value(&item, &totitem, collision_bounds_items, OB_BOUND_CONE);
|
||||
@ -934,9 +934,9 @@ static void rna_GameObjectSettings_physics_type_set(PointerRNA *ptr, int value)
|
||||
ob->gameflag &= ~(OB_RIGID_BODY|OB_OCCLUDER|OB_SENSOR|OB_NAVMESH);
|
||||
|
||||
/* assume triangle mesh, if no bounds chosen for soft body */
|
||||
if ((ob->gameflag & OB_BOUNDS) && (ob->boundtype<OB_BOUND_POLYH))
|
||||
if ((ob->gameflag & OB_BOUNDS) && (ob->boundtype<OB_BOUND_TRIANGLE_MESH))
|
||||
{
|
||||
ob->boundtype=OB_BOUND_POLYH;
|
||||
ob->boundtype= OB_BOUND_TRIANGLE_MESH;
|
||||
}
|
||||
/* create a BulletSoftBody structure if not already existing */
|
||||
if (!ob->bsoft)
|
||||
@ -1804,7 +1804,7 @@ static void rna_def_object(BlenderRNA *brna)
|
||||
{OB_BOUND_SPHERE, "SPHERE", 0, "Sphere", "Draw bounds as sphere"},
|
||||
{OB_BOUND_CYLINDER, "CYLINDER", 0, "Cylinder", "Draw bounds as cylinder"},
|
||||
{OB_BOUND_CONE, "CONE", 0, "Cone", "Draw bounds as cone"},
|
||||
{OB_BOUND_POLYH, "POLYHEDRON", 0, "Polyhedron", "Draw bounds as polyhedron"},
|
||||
{OB_BOUND_TRIANGLE_MESH, "POLYHEDRON", 0, "Polyhedron", "Draw bounds as polyhedron"},
|
||||
{OB_BOUND_CAPSULE, "CAPSULE", 0, "Capsule", "Draw bounds as capsule"},
|
||||
{0, NULL, 0, NULL, NULL}};
|
||||
|
||||
|
@ -53,7 +53,7 @@ static EnumPropertyItem effector_shape_items[] = {
|
||||
|
||||
#ifdef RNA_RUNTIME
|
||||
|
||||
/* type spesific return values only used from functions */
|
||||
/* type specific return values only used from functions */
|
||||
static EnumPropertyItem curve_shape_items[] = {
|
||||
{PFIELD_SHAPE_POINT, "POINT", 0, "Point", ""},
|
||||
{PFIELD_SHAPE_PLANE, "PLANE", 0, "Plane", ""},
|
||||
|
@ -505,6 +505,17 @@ static int rna_PartSettings_is_fluid_get(PointerRNA *ptr)
|
||||
return part->type == PART_FLUID;
|
||||
}
|
||||
|
||||
void rna_ParticleSystem_name_set(PointerRNA *ptr, const char *value)
|
||||
{
|
||||
Object *ob= ptr->id.data;
|
||||
ParticleSystem *part= (ParticleSystem*)ptr->data;
|
||||
|
||||
/* copy the new name into the name slot */
|
||||
BLI_strncpy_utf8(part->name, value, sizeof(part->name));
|
||||
|
||||
BLI_uniquename(&ob->particlesystem, part, "ParticleSystem", '.', offsetof(ParticleSystem, name), sizeof(part->name));
|
||||
}
|
||||
|
||||
static PointerRNA rna_ParticleSystem_active_particle_target_get(PointerRNA *ptr)
|
||||
{
|
||||
ParticleSystem *psys= (ParticleSystem*)ptr->data;
|
||||
@ -2617,6 +2628,7 @@ static void rna_def_particle_system(BlenderRNA *brna)
|
||||
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
|
||||
RNA_def_property_ui_text(prop, "Name", "Particle system name");
|
||||
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER|NA_RENAME, NULL);
|
||||
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_ParticleSystem_name_set");
|
||||
RNA_def_struct_name_property(srna, prop);
|
||||
|
||||
/* access to particle settings is redirected through functions */
|
||||
|
@ -139,6 +139,17 @@ static void rna_BoneGroup_color_set_set(PointerRNA *ptr, int value)
|
||||
}
|
||||
}
|
||||
|
||||
void rna_BoneGroup_name_set(PointerRNA *ptr, const char *value)
|
||||
{
|
||||
Object *ob= ptr->id.data;
|
||||
bActionGroup *agrp= ptr->data;
|
||||
|
||||
/* copy the new name into the name slot */
|
||||
BLI_strncpy_utf8(agrp->name, value, sizeof(agrp->name));
|
||||
|
||||
BLI_uniquename(&ob->pose->agroups, agrp, "Group", '.', offsetof(bActionGroup, name), sizeof(agrp->name));
|
||||
}
|
||||
|
||||
static IDProperty *rna_PoseBone_idprops(PointerRNA *ptr, int create)
|
||||
{
|
||||
bPoseChannel *pchan= ptr->data;
|
||||
@ -657,6 +668,7 @@ static void rna_def_bone_group(BlenderRNA *brna)
|
||||
/* name */
|
||||
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
|
||||
RNA_def_property_ui_text(prop, "Name", "");
|
||||
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_BoneGroup_name_set");
|
||||
RNA_def_struct_name_property(srna, prop);
|
||||
|
||||
// TODO: add some runtime-collections stuff to access grouped bones
|
||||
|
@ -812,8 +812,8 @@ static void rna_SceneRenderLayer_name_set(PointerRNA *ptr, const char *value)
|
||||
{
|
||||
Scene *scene= (Scene*)ptr->id.data;
|
||||
SceneRenderLayer *rl= (SceneRenderLayer*)ptr->data;
|
||||
|
||||
BLI_strncpy_utf8(rl->name, value, sizeof(rl->name));
|
||||
BLI_uniquename(&scene->r.layers, rl, "RenderLayer", '.', offsetof(SceneRenderLayer, name), sizeof(rl->name));
|
||||
|
||||
if(scene->nodetree) {
|
||||
bNode *node;
|
||||
|
@ -443,7 +443,6 @@ static PointerRNA rna_SequenceEditor_meta_stack_get(CollectionPropertyIterator *
|
||||
static void rna_Sequence_filepath_set(PointerRNA *ptr, const char *value)
|
||||
{
|
||||
Sequence *seq= (Sequence*)(ptr->data);
|
||||
char dir[FILE_MAX], name[FILE_MAX];
|
||||
|
||||
if(seq->type == SEQ_SOUND && seq->sound) {
|
||||
/* for sound strips we need to update the sound as well.
|
||||
@ -453,11 +452,11 @@ static void rna_Sequence_filepath_set(PointerRNA *ptr, const char *value)
|
||||
PointerRNA id_ptr;
|
||||
RNA_id_pointer_create((ID *)seq->sound, &id_ptr);
|
||||
RNA_string_set(&id_ptr, "filepath", value);
|
||||
sound_load(G.main, seq->sound);
|
||||
sound_update_scene_sound(seq->scene_sound, seq->sound);
|
||||
}
|
||||
|
||||
BLI_split_dirfile(value, dir, name);
|
||||
BLI_strncpy(seq->strip->dir, dir, sizeof(seq->strip->dir));
|
||||
BLI_strncpy(seq->strip->stripdata->name, name, sizeof(seq->strip->stripdata->name));
|
||||
BLI_split_dirfile(value, seq->strip->dir, seq->strip->stripdata->name, sizeof(seq->strip->dir), sizeof(seq->strip->stripdata->name));
|
||||
}
|
||||
|
||||
static void rna_Sequence_filepath_get(PointerRNA *ptr, char *value)
|
||||
@ -479,11 +478,7 @@ static int rna_Sequence_filepath_length(PointerRNA *ptr)
|
||||
static void rna_Sequence_proxy_filepath_set(PointerRNA *ptr, const char *value)
|
||||
{
|
||||
StripProxy *proxy= (StripProxy*)(ptr->data);
|
||||
char dir[FILE_MAX], name[FILE_MAX];
|
||||
|
||||
BLI_split_dirfile(value, dir, name);
|
||||
BLI_strncpy(proxy->dir, dir, sizeof(proxy->dir));
|
||||
BLI_strncpy(proxy->file, name, sizeof(proxy->file));
|
||||
BLI_split_dirfile(value, proxy->dir, proxy->file, sizeof(proxy->dir), sizeof(proxy->file));
|
||||
}
|
||||
|
||||
static void rna_Sequence_proxy_filepath_get(PointerRNA *ptr, char *value)
|
||||
@ -539,20 +534,13 @@ static int rna_Sequence_input_count_get(PointerRNA *ptr)
|
||||
/*static void rna_SoundSequence_filename_set(PointerRNA *ptr, const char *value)
|
||||
{
|
||||
Sequence *seq= (Sequence*)(ptr->data);
|
||||
char dir[FILE_MAX], name[FILE_MAX];
|
||||
|
||||
BLI_split_dirfile(value, dir, name);
|
||||
BLI_strncpy(seq->strip->dir, dir, sizeof(seq->strip->dir));
|
||||
BLI_strncpy(seq->strip->stripdata->name, name, sizeof(seq->strip->stripdata->name));
|
||||
BLI_split_dirfile(value, seq->strip->dir, seq->strip->stripdata->name, sizeof(seq->strip->dir), sizeof(seq->strip->stripdata->name));
|
||||
}
|
||||
|
||||
static void rna_SequenceElement_filename_set(PointerRNA *ptr, const char *value)
|
||||
{
|
||||
StripElem *elem= (StripElem*)(ptr->data);
|
||||
char name[FILE_MAX];
|
||||
|
||||
BLI_split_dirfile(value, NULL, name);
|
||||
BLI_strncpy(elem->name, name, sizeof(elem->name));
|
||||
BLI_split_dirfile(value, NULL, elem->name, 0, sizeof(elem->name));
|
||||
}*/
|
||||
|
||||
static void rna_Sequence_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr)
|
||||
|
@ -2594,20 +2594,22 @@ static void rna_def_userdef_system(BlenderRNA *brna)
|
||||
/* locale according to http://www.roseindia.net/tutorials/I18N/locales-list.shtml */
|
||||
/* if you edit here, please also edit the source/blender/blenfont/intern/blf_lang.c 's locales */
|
||||
static EnumPropertyItem language_items[] = {
|
||||
{0, "", 0, "Nearly done", ""},
|
||||
{0, "DEFAULT", 0, N_("Default (Default)"), ""},
|
||||
{1, "ENGLISH", 0, N_("English (English)"), "en_US"},
|
||||
{8, "FRENCH", 0, N_("French (Français)"), "fr_FR"},
|
||||
{9, "SPANISH", 0, N_("Spanish (Español)"), "es_ES"},
|
||||
{13, "SIMPLIFIED_CHINESE", 0, N_("Simplified Chinese (简体中文)"), "zh_CN"},
|
||||
{0, "", 0, "In progress", ""},
|
||||
{2, "JAPANESE", 0, N_("Japanese (日本語)"), "ja_JP"},
|
||||
{3, "DUTCH", 0, N_("Dutch (Nederlandse taal)"), "nl_NL"},
|
||||
{4, "ITALIAN", 0, N_("Italian (Italiano)"), "it_IT"},
|
||||
{5, "GERMAN", 0, N_("German (Deutsch)"), "de_DE"},
|
||||
{6, "FINNISH", 0, N_("Finnish (Suomi)"), "fi_FI"},
|
||||
{7, "SWEDISH", 0, N_("Swedish (Svenska)"), "sv_SE"},
|
||||
{8, "FRENCH", 0, N_("French (Française)"), "fr_FR"},
|
||||
{9, "SPANISH", 0, N_("Spanish (Español)"), "es_ES"},
|
||||
{10, "CATALAN", 0, N_("Catalan (Català)"), "ca_AD"},
|
||||
{11, "CZECH", 0, N_("Czech (Český)"), "cs_CZ"},
|
||||
{12, "BRAZILIAN_PORTUGUESE", 0, N_("Brazilian Portuguese (Português do Brasil)"), "pt_BR"},
|
||||
{13, "SIMPLIFIED_CHINESE", 0, N_("Simplified Chinese (简体中文)"), "zh_CN"},
|
||||
{14, "TRADITIONAL_CHINESE", 0, N_("Traditional Chinese (繁體中文)"), "zh_TW"},
|
||||
{15, "RUSSIAN", 0, N_("Russian (Русский)"), "ru_RU"},
|
||||
{16, "CROATIAN", 0, N_("Croatian (Hrvatski)"), "hr_HR"},
|
||||
|
@ -1,4 +1,4 @@
|
||||
#! /usr/bin/env python3.1
|
||||
#! /usr/bin/env python3
|
||||
|
||||
"""
|
||||
This script is used to help cleaning RNA api.
|
||||
|
@ -1,4 +1,4 @@
|
||||
#! /usr/bin/env python3.1
|
||||
#! /usr/bin/env python3
|
||||
|
||||
import sys
|
||||
|
||||
|
@ -180,7 +180,7 @@ bNodeTreeExec *ntree_exec_begin(bNodeTree *ntree)
|
||||
|
||||
/* prepare group tree inputs */
|
||||
for (sock=ntree->inputs.first; sock; sock=sock->next) {
|
||||
ns = setup_stack(exec->stack, sock);
|
||||
/* ns = */ setup_stack(exec->stack, sock);
|
||||
}
|
||||
/* prepare all internal nodes for execution */
|
||||
for(n=0, nodeexec= exec->nodeexec; n < totnodes; ++n, ++nodeexec) {
|
||||
@ -198,7 +198,7 @@ bNodeTreeExec *ntree_exec_begin(bNodeTree *ntree)
|
||||
|
||||
/* tag all outputs */
|
||||
for (sock=node->outputs.first; sock; sock=sock->next) {
|
||||
ns = setup_stack(exec->stack, sock);
|
||||
/* ns = */ setup_stack(exec->stack, sock);
|
||||
}
|
||||
|
||||
if(node->typeinfo->initexecfunc)
|
||||
|
@ -128,6 +128,21 @@ static bNodeSocketType node_socket_type_boolean = {
|
||||
/* buttonfunc */ NULL,
|
||||
};
|
||||
|
||||
/****************** SHADER ******************/
|
||||
|
||||
static bNodeSocketType node_socket_type_shader = {
|
||||
/* type */ SOCK_SHADER,
|
||||
/* ui_name */ "Shader",
|
||||
/* ui_description */ "Shader",
|
||||
/* ui_icon */ 0,
|
||||
/* ui_color */ {100,200,100,255},
|
||||
|
||||
/* value_structname */ NULL,
|
||||
/* value_structsize */ 0,
|
||||
|
||||
/* buttonfunc */ NULL,
|
||||
};
|
||||
|
||||
/****************** MESH ******************/
|
||||
|
||||
static bNodeSocketType node_socket_type_mesh = {
|
||||
@ -153,6 +168,7 @@ void node_socket_type_init(bNodeSocketType *types[])
|
||||
INIT_TYPE(rgba);
|
||||
INIT_TYPE(int);
|
||||
INIT_TYPE(boolean);
|
||||
INIT_TYPE(shader);
|
||||
INIT_TYPE(mesh);
|
||||
|
||||
#undef INIT_TYPE
|
||||
@ -241,6 +257,17 @@ struct bNodeSocket *nodeAddOutputRGBA(struct bNodeTree *ntree, struct bNode *nod
|
||||
return sock;
|
||||
}
|
||||
|
||||
struct bNodeSocket *nodeAddInputShader(struct bNodeTree *ntree, struct bNode *node, const char *name)
|
||||
{
|
||||
bNodeSocket *sock= nodeAddSocket(ntree, node, SOCK_IN, name, SOCK_SHADER);
|
||||
return sock;
|
||||
}
|
||||
struct bNodeSocket *nodeAddOutputShader(struct bNodeTree *ntree, struct bNode *node, const char *name)
|
||||
{
|
||||
bNodeSocket *sock= nodeAddSocket(ntree, node, SOCK_OUT, name, SOCK_SHADER);
|
||||
return sock;
|
||||
}
|
||||
|
||||
struct bNodeSocket *nodeAddInputMesh(struct bNodeTree *ntree, struct bNode *node, const char *name)
|
||||
{
|
||||
bNodeSocket *sock= nodeAddSocket(ntree, node, SOCK_IN, name, SOCK_MESH);
|
||||
@ -271,6 +298,9 @@ struct bNodeSocket *node_add_input_from_template(struct bNodeTree *ntree, struct
|
||||
case SOCK_RGBA:
|
||||
sock = nodeAddInputRGBA(ntree, node, stemp->name, stemp->val1, stemp->val2, stemp->val3, stemp->val4);
|
||||
break;
|
||||
case SOCK_SHADER:
|
||||
sock = nodeAddInputShader(ntree, node, stemp->name);
|
||||
break;
|
||||
case SOCK_MESH:
|
||||
sock = nodeAddInputMesh(ntree, node, stemp->name);
|
||||
break;
|
||||
@ -299,6 +329,9 @@ struct bNodeSocket *node_add_output_from_template(struct bNodeTree *ntree, struc
|
||||
case SOCK_RGBA:
|
||||
sock = nodeAddOutputRGBA(ntree, node, stemp->name);
|
||||
break;
|
||||
case SOCK_SHADER:
|
||||
sock = nodeAddOutputShader(ntree, node, stemp->name);
|
||||
break;
|
||||
case SOCK_MESH:
|
||||
sock = nodeAddOutputMesh(ntree, node, stemp->name);
|
||||
break;
|
||||
|
@ -58,7 +58,7 @@
|
||||
|
||||
typedef struct {
|
||||
PyObject_HEAD /* required python macro */
|
||||
/* collection iterator spesific parts */
|
||||
/* collection iterator specific parts */
|
||||
char relpath[FILE_MAX];
|
||||
char abspath[FILE_MAX]; /* absolute path */
|
||||
BlendHandle *blo_handle;
|
||||
|
@ -33,7 +33,6 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
|
||||
#include "DNA_listBase.h"
|
||||
#include "DNA_screen_types.h"
|
||||
@ -47,6 +46,7 @@
|
||||
|
||||
#include "BLI_blenlib.h"
|
||||
#include "BLI_utildefines.h"
|
||||
#include "BLI_math.h"
|
||||
|
||||
#include "BKE_blender.h"
|
||||
#include "BKE_context.h"
|
||||
@ -1790,6 +1790,8 @@ void wm_event_do_handlers(bContext *C)
|
||||
}
|
||||
|
||||
if(playing == 0) {
|
||||
float time = sound_sync_scene(scene);
|
||||
if(finite(time)) {
|
||||
int ncfra = sound_sync_scene(scene) * (float)FPS + 0.5f;
|
||||
if(ncfra != scene->r.cfra) {
|
||||
scene->r.cfra = ncfra;
|
||||
@ -1797,6 +1799,7 @@ void wm_event_do_handlers(bContext *C)
|
||||
WM_event_add_notifier(C, NC_WINDOW, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CTX_data_scene_set(C, NULL);
|
||||
CTX_wm_screen_set(C, NULL);
|
||||
|
@ -448,14 +448,6 @@ elseif(WIN32)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
install( # same as linux!, deduplicate
|
||||
DIRECTORY
|
||||
${CMAKE_SOURCE_DIR}/release/bin/.blender/locale
|
||||
${CMAKE_SOURCE_DIR}/release/bin/.blender/fonts
|
||||
DESTINATION ${TARGETDIR_VER}/datafiles
|
||||
PATTERN ".svn" EXCLUDE
|
||||
)
|
||||
|
||||
# plugins in blender 2.5 don't work at the moment.
|
||||
#
|
||||
# install(
|
||||
@ -661,8 +653,8 @@ elseif(APPLE)
|
||||
if(WITH_INTERNATIONAL)
|
||||
install(
|
||||
DIRECTORY
|
||||
${CMAKE_SOURCE_DIR}/release/bin/.blender/fonts
|
||||
${CMAKE_SOURCE_DIR}/release/bin/.blender/locale
|
||||
${CMAKE_SOURCE_DIR}/release/bin/.blender/fonts
|
||||
DESTINATION ${TARGETDIR_VER}/datafiles
|
||||
PATTERN ".svn" EXCLUDE
|
||||
)
|
||||
|
@ -1,36 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
|
||||
<plist version="0.9">
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>blender</string>
|
||||
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>blender icon.icns</string>
|
||||
|
||||
<key>CFBundleName</key>
|
||||
<string>Blender</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>org.blenderfoundation.blender</string>
|
||||
|
||||
<key>CFBundleVersion</key>
|
||||
<string>${MACOSX_BUNDLE_LONG_VERSION_STRING}, Blender Foundation</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>${MACOSX_BUNDLE_SHORT_VERSION_STRING}</string>
|
||||
<key>CFBundleGetInfoString</key>
|
||||
<string>${MACOSX_BUNDLE_LONG_VERSION_STRING}, Blender Foundation</string>
|
||||
|
||||
<key>CFBundleDocumentTypes</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>CFBundleTypeExtensions</key>
|
||||
<array>
|
||||
<string>blend</string>
|
||||
</array>
|
||||
<key>CFBundleTypeIconFile</key>
|
||||
<string>blender file icon.icns</string>
|
||||
<key>CFBundleTypeName</key>
|
||||
@ -39,15 +17,36 @@
|
||||
<array>
|
||||
<string>BLND</string>
|
||||
</array>
|
||||
<key>CFBundleTypeExtensions</key>
|
||||
<array>
|
||||
<string>blend</string>
|
||||
</array>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Editor</string>
|
||||
<key>LSIsAppleDefaultForType</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>blender</string>
|
||||
<key>CFBundleGetInfoString</key>
|
||||
<string>${MACOSX_BUNDLE_LONG_VERSION_STRING}, Blender Foundation</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>blender icon.icns</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>org.blenderfoundation.blender</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>Blender</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>${MACOSX_BUNDLE_SHORT_VERSION_STRING}</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>${MACOSX_BUNDLE_LONG_VERSION_STRING}, Blender Foundation</string>
|
||||
<key>LSEnvironment</key>
|
||||
<dict>
|
||||
<key>OMP_NUM_THREADS</key>
|
||||
<string>2</string>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
||||
|
44
source/darwin/set_simulation_threads.app/Contents/Info.plist
Normal file
44
source/darwin/set_simulation_threads.app/Contents/Info.plist
Normal file
@ -0,0 +1,44 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleAllowMixedLocalizations</key>
|
||||
<true/>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>English</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>applet</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>applet</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>set_simulation_threads</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>aplt</string>
|
||||
<key>LSMinimumSystemVersionByArchitecture</key>
|
||||
<dict>
|
||||
<key>x86_64</key>
|
||||
<string>10.6</string>
|
||||
</dict>
|
||||
<key>LSRequiresCarbon</key>
|
||||
<true/>
|
||||
<key>WindowState</key>
|
||||
<dict>
|
||||
<key>dividerCollapsed</key>
|
||||
<false/>
|
||||
<key>eventLogLevel</key>
|
||||
<integer>-1</integer>
|
||||
<key>name</key>
|
||||
<string>ScriptWindowState</string>
|
||||
<key>positionOfDivider</key>
|
||||
<real>400</real>
|
||||
<key>savedFrame</key>
|
||||
<string>424 473 1435 704 0 0 1920 1178 </string>
|
||||
<key>selectedTabView</key>
|
||||
<string>result</string>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
BIN
source/darwin/set_simulation_threads.app/Contents/MacOS/applet
Executable file
BIN
source/darwin/set_simulation_threads.app/Contents/MacOS/applet
Executable file
Binary file not shown.
@ -0,0 +1 @@
|
||||
APPLaplt
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
After Width: | Height: | Size: 362 B |
@ -0,0 +1,4 @@
|
||||
{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf230
|
||||
{\fonttbl}
|
||||
{\colortbl;\red255\green255\blue255;}
|
||||
}
|
BIN
source/darwin/set_simulation_threads_applescript.scpt
Normal file
BIN
source/darwin/set_simulation_threads_applescript.scpt
Normal file
Binary file not shown.
@ -1590,15 +1590,15 @@ void BL_CreatePhysicsObjectNew(KX_GameObject* gameobj,
|
||||
objprop.m_boundobject.box.m_extends[1]=2.f*bb.m_extends[1];
|
||||
objprop.m_boundobject.box.m_extends[2]=2.f*bb.m_extends[2];
|
||||
break;
|
||||
case OB_BOUND_POLYT:
|
||||
case OB_BOUND_CONVEX_HULL:
|
||||
if (blenderobject->type == OB_MESH)
|
||||
{
|
||||
objprop.m_boundclass = KX_BOUNDPOLYTOPE;
|
||||
break;
|
||||
}
|
||||
// Object is not a mesh... fall through OB_BOUND_POLYH to
|
||||
// Object is not a mesh... fall through OB_BOUND_TRIANGLE_MESH to
|
||||
// OB_BOUND_SPHERE
|
||||
case OB_BOUND_POLYH:
|
||||
case OB_BOUND_TRIANGLE_MESH:
|
||||
if (blenderobject->type == OB_MESH)
|
||||
{
|
||||
objprop.m_boundclass = KX_BOUNDMESH;
|
||||
|
@ -502,7 +502,7 @@ static PyObject* gPyGetBlendFileList(PyObject*, PyObject* args)
|
||||
BLI_path_abs(cpath, gp_GamePythonPath);
|
||||
} else {
|
||||
/* Get the dir only */
|
||||
BLI_split_dirfile(gp_GamePythonPath, cpath, NULL);
|
||||
BLI_split_dirfile(gp_GamePythonPath, cpath, NULL, sizeof(cpath), 0);
|
||||
}
|
||||
|
||||
if((dp = opendir(cpath)) == NULL) {
|
||||
@ -1732,7 +1732,7 @@ static void initPySysObjects__append(PyObject *sys_path, char *filename)
|
||||
PyObject *item;
|
||||
char expanded[FILE_MAXDIR + FILE_MAXFILE];
|
||||
|
||||
BLI_split_dirfile(filename, expanded, NULL); /* get the dir part of filename only */
|
||||
BLI_split_dirfile(filename, expanded, NULL, sizeof(expanded), 0); /* get the dir part of filename only */
|
||||
BLI_path_abs(expanded, gp_GamePythonPath); /* filename from lib->filename is (always?) absolute, so this may not be needed but it wont hurt */
|
||||
BLI_cleanup_file(gp_GamePythonPath, expanded); /* Dont use BLI_cleanup_dir because it adds a slash - BREAKS WIN32 ONLY */
|
||||
item= PyUnicode_DecodeFSDefault(expanded);
|
||||
|
Loading…
Reference in New Issue
Block a user