svn merge ^/trunk/blender -r40950:40997, bmesh is in sync with head again

This commit is contained in:
2011-10-14 01:49:37 +00:00
54 changed files with 1539 additions and 1405 deletions

View File

@@ -145,6 +145,9 @@ help:
@echo " * check_splint - run blenders source through splint (C only)" @echo " * check_splint - run blenders source through splint (C only)"
@echo " * check_sparse - run blenders source through sparse (C only)" @echo " * check_sparse - run blenders source through sparse (C only)"
@echo "" @echo ""
@echo "Documentation Targets"
@echo " * doc_py - generate sphinx python api docs"
@echo ""
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
# Packages # Packages
@@ -222,6 +225,17 @@ check_sparse:
cd $(BUILD_DIR) ; python3 $(BLENDER_DIR)/build_files/cmake/cmake_static_check_sparse.py cd $(BUILD_DIR) ; python3 $(BLENDER_DIR)/build_files/cmake/cmake_static_check_sparse.py
# -----------------------------------------------------------------------------
# Documentation
#
# 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
cd doc/python_api ; sphinx-build -n -b html sphinx-in sphinx-out
@echo "docs written into: 'doc/python_api/sphinx-out/index.html'"
clean: clean:
$(MAKE) -C $(BUILD_DIR) clean $(MAKE) -C $(BUILD_DIR) clean

View File

@@ -53,10 +53,11 @@ SET(_opencollada_FIND_COMPONENTS
) )
# Fedora openCOLLADA package links these statically # Fedora openCOLLADA package links these statically
# note that order is important here ot it wont link
SET(_opencollada_FIND_STATIC_COMPONENTS SET(_opencollada_FIND_STATIC_COMPONENTS
UTF
ftoa
buffer buffer
ftoa
UTF
) )
SET(_opencollada_SEARCH_DIRS SET(_opencollada_SEARCH_DIRS

View File

@@ -1,7 +1,10 @@
GPU functions (gpu) GPU functions (gpu)
=================== ===================
.. module:: gpu
This module provides access to materials GLSL shaders.
***** *****
Intro Intro
***** *****
@@ -16,7 +19,6 @@ and in the game engine.
are are closely related to Blender's internal GLSL code and may change if the GLSL code are are closely related to Blender's internal GLSL code and may change if the GLSL code
is modified (e.g. new uniform type). is modified (e.g. new uniform type).
.. module:: gpu
********* *********
Constants Constants

View File

@@ -83,6 +83,7 @@ else:
"aud", "aud",
"bgl", "bgl",
"blf", "blf",
"gpu",
"mathutils", "mathutils",
"mathutils.geometry", "mathutils.geometry",
) )
@@ -1122,6 +1123,8 @@ def rna2sphinx(BASEPATH):
fw(" bgl.rst\n\n") fw(" bgl.rst\n\n")
if "blf" not in EXCLUDE_MODULES: if "blf" not in EXCLUDE_MODULES:
fw(" blf.rst\n\n") fw(" blf.rst\n\n")
if "gpu" not in EXCLUDE_MODULES:
fw(" gpu.rst\n\n")
if "aud" not in EXCLUDE_MODULES: if "aud" not in EXCLUDE_MODULES:
fw(" aud.rst\n\n") fw(" aud.rst\n\n")
if "bpy_extras" not in EXCLUDE_MODULES: if "bpy_extras" not in EXCLUDE_MODULES:
@@ -1262,6 +1265,13 @@ def rna2sphinx(BASEPATH):
import shutil import shutil
shutil.copy2(os.path.join(BASEPATH, "..", "rst", "bgl.rst"), BASEPATH) shutil.copy2(os.path.join(BASEPATH, "..", "rst", "bgl.rst"), BASEPATH)
if "gpu" not in EXCLUDE_MODULES:
#import gpu as module
#pymodule2sphinx(BASEPATH, "gpu", module, "GPU Shader Module")
#del module
import shutil
shutil.copy2(os.path.join(BASEPATH, "..", "rst", "gpu.rst"), BASEPATH)
if "aud" not in EXCLUDE_MODULES: if "aud" not in EXCLUDE_MODULES:
import aud as module import aud as module
pymodule2sphinx(BASEPATH, "aud", module, "Audio System") pymodule2sphinx(BASEPATH, "aud", module, "Audio System")

View File

@@ -69,7 +69,7 @@ bool AUD_NULLDevice::AUD_NULLHandle::seek(float position)
float AUD_NULLDevice::AUD_NULLHandle::getPosition() float AUD_NULLDevice::AUD_NULLHandle::getPosition()
{ {
return 0.0f; return std::numeric_limits<float>::quiet_NaN();
} }
AUD_Status AUD_NULLDevice::AUD_NULLHandle::getStatus() AUD_Status AUD_NULLDevice::AUD_NULLHandle::getStatus()
@@ -79,7 +79,7 @@ AUD_Status AUD_NULLDevice::AUD_NULLHandle::getStatus()
float AUD_NULLDevice::AUD_NULLHandle::getVolume() float AUD_NULLDevice::AUD_NULLHandle::getVolume()
{ {
return 0.0f; return std::numeric_limits<float>::quiet_NaN();
} }
bool AUD_NULLDevice::AUD_NULLHandle::setVolume(float volume) 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() float AUD_NULLDevice::AUD_NULLHandle::getPitch()
{ {
return 0.0f; return std::numeric_limits<float>::quiet_NaN();
} }
bool AUD_NULLDevice::AUD_NULLHandle::setPitch(float pitch) bool AUD_NULLDevice::AUD_NULLHandle::setPitch(float pitch)
@@ -153,7 +153,7 @@ void AUD_NULLDevice::unlock()
float AUD_NULLDevice::getVolume() const float AUD_NULLDevice::getVolume() const
{ {
return 0; return std::numeric_limits<float>::quiet_NaN();
} }
void AUD_NULLDevice::setVolume(float volume) void AUD_NULLDevice::setVolume(float volume)

View File

@@ -259,10 +259,11 @@ class DATA_PT_active_spline(CurveButtonsPanelActive, Panel):
if not is_surf: if not is_surf:
split = layout.split() split = layout.split()
col = split.column() col = split.column()
col.active = (curve.dimensions == '3D')
col.label(text="Interpolation:") col.label(text="Interpolation:")
col.prop(act_spline, "tilt_interpolation", text="Tilt") colsub = col.column()
colsub.active = (curve.dimensions == '3D')
colsub.prop(act_spline, "tilt_interpolation", text="Tilt")
col.prop(act_spline, "radius_interpolation", text="Radius") col.prop(act_spline, "radius_interpolation", text="Radius")
layout.prop(act_spline, "use_smooth") layout.prop(act_spline, "use_smooth")

View File

@@ -60,7 +60,6 @@ class SEQUENCER_HT_header(Header):
layout.separator() layout.separator()
layout.operator("sequencer.refresh_all") layout.operator("sequencer.refresh_all")
layout.template_running_jobs()
elif st.view_type == 'SEQUENCER_PREVIEW': elif st.view_type == 'SEQUENCER_PREVIEW':
layout.separator() layout.separator()
layout.operator("sequencer.refresh_all") layout.operator("sequencer.refresh_all")
@@ -76,6 +75,8 @@ class SEQUENCER_HT_header(Header):
row.prop(ed, "overlay_frame", text="") row.prop(ed, "overlay_frame", text="")
row.prop(ed, "overlay_lock", text="", icon='LOCKED') row.prop(ed, "overlay_lock", text="", icon='LOCKED')
layout.template_running_jobs()
class SEQUENCER_MT_view_toggle(Menu): class SEQUENCER_MT_view_toggle(Menu):
bl_label = "View Type" bl_label = "View Type"

View File

@@ -185,7 +185,7 @@ bGPDlayer *gpencil_layer_addnew (bGPdata *gpd)
/* auto-name */ /* auto-name */
strcpy(gpl->info, "GP_Layer"); strcpy(gpl->info, "GP_Layer");
BLI_uniquename(&gpd->layers, gpl, "GP_Layer", '.', offsetof(bGPDlayer, info[0]), sizeof(gpl->info)); BLI_uniquename(&gpd->layers, gpl, "GP_Layer", '.', offsetof(bGPDlayer, info), sizeof(gpl->info));
/* make this one the active one */ /* make this one the active one */
gpencil_layer_setactive(gpd, gpl); gpencil_layer_setactive(gpd, gpl);

View File

@@ -295,7 +295,10 @@ void sound_cache(struct bSound* sound)
AUD_unload(sound->cache); AUD_unload(sound->cache);
sound->cache = AUD_bufferSound(sound->handle); sound->cache = AUD_bufferSound(sound->handle);
if(sound->cache)
sound->playback_handle = sound->cache; sound->playback_handle = sound->cache;
else
sound->playback_handle = sound->handle;
} }
void sound_cache_notifying(struct Main* main, struct bSound* sound) void sound_cache_notifying(struct Main* main, struct bSound* sound)
@@ -332,6 +335,8 @@ void sound_load(struct Main *bmain, struct bSound* sound)
sound->playback_handle = NULL; sound->playback_handle = NULL;
} }
sound_free_waveform(sound);
// XXX unused currently // XXX unused currently
#if 0 #if 0
switch(sound->type) switch(sound->type)
@@ -625,7 +630,7 @@ float sound_sync_scene(struct Scene *scene)
else else
return AUD_getPosition(scene->sound_scene_handle); return AUD_getPosition(scene->sound_scene_handle);
} }
return 0.0f; return .0f/.0f;
} }
int sound_scene_playing(struct Scene *scene) int sound_scene_playing(struct Scene *scene)
@@ -782,7 +787,7 @@ static void sound_start_play_scene(struct Scene *UNUSED(scene)) {}
void sound_play_scene(struct Scene *UNUSED(scene)) {} void sound_play_scene(struct Scene *UNUSED(scene)) {}
void sound_stop_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)) {} 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 .0f/.0f; }
int sound_scene_playing(struct Scene *UNUSED(scene)) { return -1; } 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; } 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; } void sound_read_waveform(struct bSound* sound) { (void)sound; }

View File

@@ -7134,6 +7134,19 @@ void convert_tface_mt(FileData *fd, Main *main)
} }
} }
static void do_versions_nodetree_image_default_alpha_output(bNodeTree *ntree)
{
bNode *node;
bNodeSocket *sock;
for (node=ntree->nodes.first; node; node=node->next) {
if (ELEM(node->type, CMP_NODE_IMAGE, CMP_NODE_R_LAYERS)) {
/* default Image output value should have 0 alpha */
sock = node->outputs.first;
((bNodeSocketValueRGBA*)sock->default_value)->value[3] = 0.0f;
}
}
}
static void do_versions(FileData *fd, Library *lib, Main *main) static void do_versions(FileData *fd, Library *lib, Main *main)
{ {
/* WATCH IT!!!: pointers from libdata have not been converted */ /* WATCH IT!!!: pointers from libdata have not been converted */
@@ -12211,6 +12224,24 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
/* put compatibility code here until next subversion bump */ /* put compatibility code here until next subversion bump */
{ {
{
/* set default alpha value of Image outputs in image and render layer nodes to 0 */
Scene *sce;
bNodeTree *ntree;
for (sce=main->scene.first; sce; sce=sce->id.next) {
/* there are files with invalid audio_channels value, the real cause
is unknown, but we fix it here anyway to avoid crashes */
if(sce->r.ffcodecdata.audio_channels == 0)
sce->r.ffcodecdata.audio_channels = 2;
if (sce->nodetree)
do_versions_nodetree_image_default_alpha_output(sce->nodetree);
}
for (ntree=main->nodetree.first; ntree; ntree=ntree->id.next)
do_versions_nodetree_image_default_alpha_output(ntree);
}
} }
/* WATCH IT!!!: pointers from libdata have not been converted yet here! */ /* WATCH IT!!!: pointers from libdata have not been converted yet here! */

View File

@@ -147,7 +147,7 @@ static void gp_draw_stroke_buffer (tGPspoint *points, int totpoints, short thick
} }
glEnd(); glEnd();
/* reset for pradictable OpenGL context */ /* reset for predictable OpenGL context */
glLineWidth(1.0f); glLineWidth(1.0f);
if (G.f & G_DEBUG) setlinestyle(0); if (G.f & G_DEBUG) setlinestyle(0);

View File

@@ -246,6 +246,17 @@ static void get_keyframe_extents (bAnimContext *ac, float *min, float *max, cons
/* go through channels, finding max extents */ /* go through channels, finding max extents */
for (ale= anim_data.first; ale; ale= ale->next) { for (ale= anim_data.first; ale; ale= ale->next) {
AnimData *adt= ANIM_nla_mapping_get(ac, ale); AnimData *adt= ANIM_nla_mapping_get(ac, ale);
if (ale->datatype == ALE_GPFRAME) {
bGPDlayer *gpl= ale->data;
bGPDframe *gpf;
/* find gp-frame which is less than or equal to cframe */
for (gpf= gpl->frames.first; gpf; gpf= gpf->next) {
*min= MIN2(*min, gpf->framenum);
*max= MAX2(*max, gpf->framenum);
}
}
else {
FCurve *fcu= (FCurve *)ale->key_data; FCurve *fcu= (FCurve *)ale->key_data;
float tmin, tmax; float tmin, tmax;
@@ -261,6 +272,7 @@ static void get_keyframe_extents (bAnimContext *ac, float *min, float *max, cons
*min= MIN2(*min, tmin); *min= MIN2(*min, tmin);
*max= MAX2(*max, tmax); *max= MAX2(*max, tmax);
} }
}
/* free memory */ /* free memory */
BLI_freelistN(&anim_data); BLI_freelistN(&anim_data);

View File

@@ -192,6 +192,9 @@ static void drawseqwave(Scene *scene, Sequence *seq, float x1, float y1, float x
waveform = seq->sound->waveform; waveform = seq->sound->waveform;
if(!waveform)
return;
startsample = floor((seq->startofs + seq->anim_startofs)/FPS * SOUND_WAVE_SAMPLES_PER_SECOND); 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); endsample = ceil((seq->startofs + seq->anim_startofs + seq->enddisp - seq->startdisp)/FPS * SOUND_WAVE_SAMPLES_PER_SECOND);
samplestep = (endsample-startsample) * stepsize / (x2-x1); samplestep = (endsample-startsample) * stepsize / (x2-x1);

View File

@@ -312,6 +312,15 @@ static void calcSpringFactor(MouseInput *mi)
void initMouseInputMode(TransInfo *t, MouseInput *mi, MouseInputMode mode) void initMouseInputMode(TransInfo *t, MouseInput *mi, MouseInputMode mode)
{ {
/* may have been allocated previously */
/* TODO, holding R-key can cause mem leak, but this causes [#28903]
* disable for now. */
#if 0
if(mi->data) {
MEM_freeN(mi->data);
mi->data= NULL;
}
#endif
switch(mode) switch(mode)
{ {

View File

@@ -745,9 +745,9 @@ static int ffmpeg_decode_video_frame(struct anim * anim)
" FRAME DONE: " " FRAME DONE: "
"next_pts=%lld pkt_pts=%lld\n", "next_pts=%lld pkt_pts=%lld\n",
(anim->pFrame->pts == AV_NOPTS_VALUE) ? (anim->pFrame->pts == AV_NOPTS_VALUE) ?
-1 : anim->pFrame->pts, -1 : (long long int)anim->pFrame->pts,
(anim->pFrame->pkt_pts == AV_NOPTS_VALUE) ? (anim->pFrame->pkt_pts == AV_NOPTS_VALUE) ?
-1 : anim->pFrame->pkt_pts); -1 : (long long int)anim->pFrame->pkt_pts);
anim->next_pts = anim->next_pts =
av_get_pts_from_frame(anim->pFormatCtx, av_get_pts_from_frame(anim->pFormatCtx,
anim->pFrame); anim->pFrame);
@@ -767,9 +767,9 @@ static int ffmpeg_decode_video_frame(struct anim * anim)
anim->next_packet.stream_index, anim->next_packet.stream_index,
anim->videoStream, anim->videoStream,
(anim->next_packet.dts == AV_NOPTS_VALUE) ? -1: (anim->next_packet.dts == AV_NOPTS_VALUE) ? -1:
anim->next_packet.dts, (long long int)anim->next_packet.dts,
(anim->next_packet.pts == AV_NOPTS_VALUE) ? -1: (anim->next_packet.pts == AV_NOPTS_VALUE) ? -1:
anim->next_packet.pts, (long long int)anim->next_packet.pts,
(anim->next_packet.flags & AV_PKT_FLAG_KEY) ? (anim->next_packet.flags & AV_PKT_FLAG_KEY) ?
" KEY" : ""); " KEY" : "");
if (anim->next_packet.stream_index == anim->videoStream) { if (anim->next_packet.stream_index == anim->videoStream) {
@@ -796,11 +796,11 @@ static int ffmpeg_decode_video_frame(struct anim * anim)
" FRAME DONE: next_pts=%lld " " FRAME DONE: next_pts=%lld "
"pkt_pts=%lld, guessed_pts=%lld\n", "pkt_pts=%lld, guessed_pts=%lld\n",
(anim->pFrame->pts == AV_NOPTS_VALUE) ? (anim->pFrame->pts == AV_NOPTS_VALUE) ?
-1 : anim->pFrame->pts, -1 : (long long int)anim->pFrame->pts,
(anim->pFrame->pkt_pts (anim->pFrame->pkt_pts
== AV_NOPTS_VALUE) ? == AV_NOPTS_VALUE) ?
-1 : anim->pFrame->pkt_pts, -1 : (long long int)anim->pFrame->pkt_pts,
anim->next_pts); (long long int)anim->next_pts);
} }
} }
av_free_packet(&anim->next_packet); av_free_packet(&anim->next_packet);
@@ -824,13 +824,13 @@ static void ffmpeg_decode_video_frame_scan(
av_log(anim->pFormatCtx, av_log(anim->pFormatCtx,
AV_LOG_DEBUG, AV_LOG_DEBUG,
"SCAN start: considering pts=%lld in search of %lld\n", "SCAN start: considering pts=%lld in search of %lld\n",
anim->next_pts, pts_to_search); (long long int)anim->next_pts, (long long int)pts_to_search);
while (count > 0 && anim->next_pts < pts_to_search) { while (count > 0 && anim->next_pts < pts_to_search) {
av_log(anim->pFormatCtx, av_log(anim->pFormatCtx,
AV_LOG_DEBUG, AV_LOG_DEBUG,
" WHILE: pts=%lld in search of %lld\n", " WHILE: pts=%lld in search of %lld\n",
anim->next_pts, pts_to_search); (long long int)anim->next_pts, (long long int)pts_to_search);
if (!ffmpeg_decode_video_frame(anim)) { if (!ffmpeg_decode_video_frame(anim)) {
break; break;
} }
@@ -841,7 +841,7 @@ static void ffmpeg_decode_video_frame_scan(
AV_LOG_ERROR, AV_LOG_ERROR,
"SCAN failed: completely lost in stream, " "SCAN failed: completely lost in stream, "
"bailing out at PTS=%lld, searching for PTS=%lld\n", "bailing out at PTS=%lld, searching for PTS=%lld\n",
anim->next_pts, pts_to_search); (long long int)anim->next_pts, (long long int)pts_to_search);
} }
if (anim->next_pts == pts_to_search) { if (anim->next_pts == pts_to_search) {
av_log(anim->pFormatCtx, av_log(anim->pFormatCtx,
@@ -938,13 +938,13 @@ static ImBuf * ffmpeg_fetchibuf(struct anim * anim, int position,
av_log(anim->pFormatCtx, AV_LOG_DEBUG, av_log(anim->pFormatCtx, AV_LOG_DEBUG,
"FETCH: looking for PTS=%lld " "FETCH: looking for PTS=%lld "
"(pts_timebase=%g, frame_rate=%g, st_time=%lld)\n", "(pts_timebase=%g, frame_rate=%g, st_time=%lld)\n",
pts_to_search, pts_time_base, frame_rate, st_time); (long long int)pts_to_search, pts_time_base, frame_rate, st_time);
if (anim->last_frame && if (anim->last_frame &&
anim->last_pts <= pts_to_search && anim->next_pts > pts_to_search){ anim->last_pts <= pts_to_search && anim->next_pts > pts_to_search){
av_log(anim->pFormatCtx, AV_LOG_DEBUG, av_log(anim->pFormatCtx, AV_LOG_DEBUG,
"FETCH: frame repeat: last: %lld next: %lld\n", "FETCH: frame repeat: last: %lld next: %lld\n",
anim->last_pts, anim->next_pts); (long long int)anim->last_pts, (long long int)anim->next_pts);
IMB_refImBuf(anim->last_frame); IMB_refImBuf(anim->last_frame);
anim->curposition = position; anim->curposition = position;
return anim->last_frame; return anim->last_frame;
@@ -957,7 +957,8 @@ static ImBuf * ffmpeg_fetchibuf(struct anim * anim, int position,
av_log(anim->pFormatCtx, AV_LOG_DEBUG, av_log(anim->pFormatCtx, AV_LOG_DEBUG,
"FETCH: no seek necessary: " "FETCH: no seek necessary: "
"next: %lld next undecoded: %lld\n", "next: %lld next undecoded: %lld\n",
anim->next_pts, anim->next_undecoded_pts); (long long int)anim->next_pts,
(long long int)anim->next_undecoded_pts);
/* we are already done :) */ /* we are already done :) */
@@ -1031,7 +1032,7 @@ static ImBuf * ffmpeg_fetchibuf(struct anim * anim, int position,
"FETCH: " "FETCH: "
"error while seeking to DTS = %lld " "error while seeking to DTS = %lld "
"(frameno = %d, PTS = %lld): errcode = %d\n", "(frameno = %d, PTS = %lld): errcode = %d\n",
pos, position, pts_to_search, ret); pos, position, (long long int)pts_to_search, ret);
} }
avcodec_flush_buffers(anim->pCodecCtx); avcodec_flush_buffers(anim->pCodecCtx);

View File

@@ -87,7 +87,7 @@ anim_index_builder * IMB_index_builder_create(const char * name)
BLI_make_existing_file(rv->temp_name); BLI_make_existing_file(rv->temp_name);
rv->fp = fopen(rv->temp_name, "w"); rv->fp = fopen(rv->temp_name, "wb");
if (!rv->fp) { if (!rv->fp) {
fprintf(stderr, "Couldn't open index target: %s! " fprintf(stderr, "Couldn't open index target: %s! "
@@ -797,7 +797,7 @@ static int index_rebuild_ffmpeg(struct anim * anim,
while(av_read_frame(iFormatCtx, &next_packet) >= 0) { while(av_read_frame(iFormatCtx, &next_packet) >= 0) {
int frame_finished = 0; int frame_finished = 0;
float next_progress = ((int)floor(((double) next_packet.pos) * 100 / float next_progress = (float)((int)floor(((double) next_packet.pos) * 100 /
((double) stream_size)+0.5)) / 100; ((double) stream_size)+0.5)) / 100;
if (*progress != next_progress) { if (*progress != next_progress) {
@@ -840,8 +840,8 @@ static int index_rebuild_ffmpeg(struct anim * anim,
start_pts_set = TRUE; start_pts_set = TRUE;
} }
frameno = (pts - start_pts) frameno = floor((pts - start_pts)
* pts_time_base * frame_rate; * pts_time_base * frame_rate + 0.5f);
/* decoding starts *always* on I-Frames, /* decoding starts *always* on I-Frames,
so: P-Frames won't work, even if all the so: P-Frames won't work, even if all the

View File

@@ -99,7 +99,8 @@ typedef struct bGPDlayer {
float color[4]; /* color that should be used to draw all the strokes in this layer */ float color[4]; /* color that should be used to draw all the strokes in this layer */
char info[128]; /* optional reference info about this layer (i.e. "director's comments, 12/3") */ char info[128]; /* optional reference info about this layer (i.e. "director's comments, 12/3")
* this is used for the name of the layer too and kept unique. */
} bGPDlayer; } bGPDlayer;
/* bGPDlayer->flag */ /* bGPDlayer->flag */

View File

@@ -416,8 +416,8 @@ typedef struct DupliObject {
#define OB_BOUND_SPHERE 1 #define OB_BOUND_SPHERE 1
#define OB_BOUND_CYLINDER 2 #define OB_BOUND_CYLINDER 2
#define OB_BOUND_CONE 3 #define OB_BOUND_CONE 3
#define OB_BOUND_POLYH 4 #define OB_BOUND_TRIANGLE_MESH 4
#define OB_BOUND_POLYT 5 #define OB_BOUND_CONVEX_HULL 5
/* #define OB_BOUND_DYN_MESH 6 */ /*UNUSED*/ /* #define OB_BOUND_DYN_MESH 6 */ /*UNUSED*/
#define OB_BOUND_CAPSULE 7 #define OB_BOUND_CAPSULE 7

View File

@@ -40,6 +40,8 @@
#ifdef RNA_RUNTIME #ifdef RNA_RUNTIME
#include "BLI_path_util.h"
static int rna_GPencilLayer_active_frame_editable(PointerRNA *ptr) static int rna_GPencilLayer_active_frame_editable(PointerRNA *ptr)
{ {
bGPDlayer *gpl= (bGPDlayer *)ptr->data; bGPDlayer *gpl= (bGPDlayer *)ptr->data;
@@ -90,6 +92,17 @@ static void rna_GPencil_active_layer_set(PointerRNA *ptr, PointerRNA value)
} }
} }
void rna_GPencilLayer_info_set(PointerRNA *ptr, const char *value)
{
bGPdata *gpd= ptr->id.data;
bGPDlayer *gpl= ptr->data;
/* copy the new name into the name slot */
BLI_strncpy_utf8(gpl->info, value, sizeof(gpl->info));
BLI_uniquename(&gpd->layers, gpl, "GP_Layer", '.', offsetof(bGPDlayer, info), sizeof(gpl->info));
}
#else #else
static void rna_def_gpencil_stroke_point(BlenderRNA *brna) static void rna_def_gpencil_stroke_point(BlenderRNA *brna)
@@ -176,6 +189,7 @@ static void rna_def_gpencil_layer(BlenderRNA *brna)
/* Name */ /* Name */
prop= RNA_def_property(srna, "info", PROP_STRING, PROP_NONE); prop= RNA_def_property(srna, "info", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Info", "Layer name"); RNA_def_property_ui_text(prop, "Info", "Layer name");
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_GPencilLayer_info_set");
RNA_def_struct_name_property(srna, prop); RNA_def_struct_name_property(srna, prop);
/* Frames */ /* Frames */

View File

@@ -84,8 +84,8 @@ static EnumPropertyItem collision_bounds_items[] = {
{OB_BOUND_SPHERE, "SPHERE", 0, "Sphere", ""}, {OB_BOUND_SPHERE, "SPHERE", 0, "Sphere", ""},
{OB_BOUND_CYLINDER, "CYLINDER", 0, "Cylinder", ""}, {OB_BOUND_CYLINDER, "CYLINDER", 0, "Cylinder", ""},
{OB_BOUND_CONE, "CONE", 0, "Cone", ""}, {OB_BOUND_CONE, "CONE", 0, "Cone", ""},
{OB_BOUND_POLYT, "CONVEX_HULL", 0, "Convex Hull", ""}, {OB_BOUND_CONVEX_HULL, "CONVEX_HULL", 0, "Convex Hull", ""},
{OB_BOUND_POLYH, "TRIANGLE_MESH", 0, "Triangle Mesh", ""}, {OB_BOUND_TRIANGLE_MESH, "TRIANGLE_MESH", 0, "Triangle Mesh", ""},
{OB_BOUND_CAPSULE, "CAPSULE", 0, "Capsule", ""}, {OB_BOUND_CAPSULE, "CAPSULE", 0, "Capsule", ""},
//{OB_DYN_MESH, "DYNAMIC_MESH", 0, "Dynamic Mesh", ""}, //{OB_DYN_MESH, "DYNAMIC_MESH", 0, "Dynamic Mesh", ""},
{0, NULL, 0, NULL, NULL}}; {0, NULL, 0, NULL, NULL}};
@@ -431,8 +431,8 @@ static EnumPropertyItem *rna_Object_collision_bounds_itemf(bContext *UNUSED(C),
EnumPropertyItem *item= NULL; EnumPropertyItem *item= NULL;
int totitem= 0; 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_TRIANGLE_MESH);
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_CONVEX_HULL);
if(ob->body_type!=OB_BODY_TYPE_SOFT) { if(ob->body_type!=OB_BODY_TYPE_SOFT) {
RNA_enum_items_add_value(&item, &totitem, collision_bounds_items, OB_BOUND_CONE); RNA_enum_items_add_value(&item, &totitem, collision_bounds_items, OB_BOUND_CONE);
@@ -935,9 +935,9 @@ static void rna_GameObjectSettings_physics_type_set(PointerRNA *ptr, int value)
ob->gameflag &= ~(OB_RIGID_BODY|OB_OCCLUDER|OB_SENSOR|OB_NAVMESH); ob->gameflag &= ~(OB_RIGID_BODY|OB_OCCLUDER|OB_SENSOR|OB_NAVMESH);
/* assume triangle mesh, if no bounds chosen for soft body */ /* 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 */ /* create a BulletSoftBody structure if not already existing */
if (!ob->bsoft) if (!ob->bsoft)
@@ -1805,7 +1805,7 @@ static void rna_def_object(BlenderRNA *brna)
{OB_BOUND_SPHERE, "SPHERE", 0, "Sphere", "Draw bounds as sphere"}, {OB_BOUND_SPHERE, "SPHERE", 0, "Sphere", "Draw bounds as sphere"},
{OB_BOUND_CYLINDER, "CYLINDER", 0, "Cylinder", "Draw bounds as cylinder"}, {OB_BOUND_CYLINDER, "CYLINDER", 0, "Cylinder", "Draw bounds as cylinder"},
{OB_BOUND_CONE, "CONE", 0, "Cone", "Draw bounds as cone"}, {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"}, {OB_BOUND_CAPSULE, "CAPSULE", 0, "Capsule", "Draw bounds as capsule"},
{0, NULL, 0, NULL, NULL}}; {0, NULL, 0, NULL, NULL}};

View File

@@ -453,6 +453,8 @@ static void rna_Sequence_filepath_set(PointerRNA *ptr, const char *value)
PointerRNA id_ptr; PointerRNA id_ptr;
RNA_id_pointer_create((ID *)seq->sound, &id_ptr); RNA_id_pointer_create((ID *)seq->sound, &id_ptr);
RNA_string_set(&id_ptr, "filepath", value); 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_split_dirfile(value, dir, name);

View File

@@ -38,7 +38,7 @@
/* **************** IMAGE (and RenderResult, multilayer image) ******************** */ /* **************** IMAGE (and RenderResult, multilayer image) ******************** */
static bNodeSocketTemplate cmp_node_rlayers_out[]= { static bNodeSocketTemplate cmp_node_rlayers_out[]= {
{ SOCK_RGBA, 0, "Image", 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f}, { SOCK_RGBA, 0, "Image", 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
{ SOCK_FLOAT, 0, "Alpha", 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, { SOCK_FLOAT, 0, "Alpha", 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
{ SOCK_FLOAT, 0, "Z", 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, { SOCK_FLOAT, 0, "Z", 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
{ SOCK_VECTOR, 0, "Normal", 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, { SOCK_VECTOR, 0, "Normal", 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},

View File

@@ -199,6 +199,9 @@ bNode *node_group_make_from_selected(bNodeTree *ntree)
} }
} }
/* node groups don't use internal cached data */
ntreeFreeCache(ngroup);
/* make group node */ /* make group node */
ntemp.type = NODE_GROUP; ntemp.type = NODE_GROUP;
ntemp.ngroup = ngroup; ntemp.ngroup = ngroup;

View File

@@ -174,11 +174,13 @@ bNodeTreeExec *ntree_exec_begin(bNodeTree *ntree)
exec->stacksize = index; exec->stacksize = index;
exec->stack = MEM_callocN(exec->stacksize * sizeof(bNodeStack), "bNodeStack"); exec->stack = MEM_callocN(exec->stacksize * sizeof(bNodeStack), "bNodeStack");
/* all non-const results are considered inputs */
for (n=0; n < exec->stacksize; ++n)
exec->stack[n].hasinput = 1;
/* prepare group tree inputs */ /* prepare group tree inputs */
for (sock=ntree->inputs.first; sock; sock=sock->next) { for (sock=ntree->inputs.first; sock; sock=sock->next) {
ns = setup_stack(exec->stack, sock); ns = setup_stack(exec->stack, sock);
if (ns->hasoutput)
ns->hasinput = 1;
} }
/* prepare all internal nodes for execution */ /* prepare all internal nodes for execution */
for(n=0, nodeexec= exec->nodeexec; n < totnodes; ++n, ++nodeexec) { for(n=0, nodeexec= exec->nodeexec; n < totnodes; ++n, ++nodeexec) {
@@ -191,14 +193,12 @@ bNodeTreeExec *ntree_exec_begin(bNodeTree *ntree)
node->need_exec= 0; node->need_exec= 0;
ns = setup_stack(exec->stack, sock); ns = setup_stack(exec->stack, sock);
if (ns->hasoutput) ns->hasoutput = 1;
ns->hasinput = 1;
} }
/* tag all outputs */ /* tag all outputs */
for (sock=node->outputs.first; sock; sock=sock->next) { for (sock=node->outputs.first; sock; sock=sock->next) {
ns = setup_stack(exec->stack, sock); ns = setup_stack(exec->stack, sock);
ns->hasoutput = 1;
} }
if(node->typeinfo->initexecfunc) if(node->typeinfo->initexecfunc)

View File

@@ -72,10 +72,11 @@ void operator_wrapper(wmOperatorType *ot, void *userdata)
RNA_pointer_create(NULL, ot->srna, NULL, &ptr); RNA_pointer_create(NULL, ot->srna, NULL, &ptr);
prop= RNA_struct_find_property(&ptr, "type"); prop= RNA_struct_find_property(&ptr, "type");
if(prop) if (prop) {
ot->prop= prop; ot->prop= prop;
} }
} }
}
void macro_wrapper(wmOperatorType *ot, void *userdata) void macro_wrapper(wmOperatorType *ot, void *userdata)
{ {

View File

@@ -85,14 +85,17 @@ static PyObject* pyrna_struct_Subtype(PointerRNA *ptr);
static PyObject *pyrna_prop_collection_values(BPy_PropertyRNA *self); static PyObject *pyrna_prop_collection_values(BPy_PropertyRNA *self);
#define BPY_DOC_ID_PROP_TYPE_NOTE \ #define BPY_DOC_ID_PROP_TYPE_NOTE \
" .. note:: Only :class:`bpy.types.ID`, :class:`bpy.types.Bone` and \n" \ " .. note::\n" \
"\n" \
" Only :class:`bpy.types.ID`, :class:`bpy.types.Bone` and \n" \
" :class:`bpy.types.PoseBone` classes support custom properties.\n" " :class:`bpy.types.PoseBone` classes support custom properties.\n"
int pyrna_struct_validity_check(BPy_StructRNA *pysrna) int pyrna_struct_validity_check(BPy_StructRNA *pysrna)
{ {
if(pysrna->ptr.type) if (pysrna->ptr.type) {
return 0; return 0;
}
PyErr_Format(PyExc_ReferenceError, PyErr_Format(PyExc_ReferenceError,
"StructRNA of type %.200s has been removed", "StructRNA of type %.200s has been removed",
Py_TYPE(pysrna)->tp_name); Py_TYPE(pysrna)->tp_name);
@@ -101,8 +104,9 @@ int pyrna_struct_validity_check(BPy_StructRNA *pysrna)
int pyrna_prop_validity_check(BPy_PropertyRNA *self) int pyrna_prop_validity_check(BPy_PropertyRNA *self)
{ {
if(self->ptr.type) if (self->ptr.type) {
return 0; return 0;
}
PyErr_Format(PyExc_ReferenceError, PyErr_Format(PyExc_ReferenceError,
"PropertyRNA of type %.200s.%.200s has been removed", "PropertyRNA of type %.200s.%.200s has been removed",
Py_TYPE(self)->tp_name, RNA_property_identifier(self->prop)); Py_TYPE(self)->tp_name, RNA_property_identifier(self->prop));
@@ -2015,7 +2019,8 @@ static PyObject *pyrna_prop_array_subscript_int(BPy_PropertyArrayRNA *self, int
if (keynum >= 0 && keynum < len) if (keynum >= 0 && keynum < len)
return pyrna_prop_array_to_py_index(self, keynum); return pyrna_prop_array_to_py_index(self, keynum);
PyErr_Format(PyExc_IndexError, "bpy_prop_array[index]: index %d out of range", keynum); PyErr_Format(PyExc_IndexError,
"bpy_prop_array[index]: index %d out of range", keynum);
return NULL; return NULL;
} }
@@ -2501,7 +2506,8 @@ static int prop_subscript_ass_array_int(BPy_PropertyArrayRNA *self, Py_ssize_t k
if (keynum >= 0 && keynum < len) if (keynum >= 0 && keynum < len)
return pyrna_py_to_prop_array_index(self, keynum, value); return pyrna_py_to_prop_array_index(self, keynum, value);
PyErr_SetString(PyExc_IndexError, "bpy_prop_array[index] = value: index out of range"); PyErr_SetString(PyExc_IndexError,
"bpy_prop_array[index] = value: index out of range");
return -1; return -1;
} }
@@ -2934,7 +2940,7 @@ static PyObject *pyrna_struct_path_resolve(BPy_StructRNA *self, PyObject *args)
if (r_prop) { if (r_prop) {
if (index != -1) { if (index != -1) {
if (index >= RNA_property_array_length(&r_ptr, r_prop) || index < 0) { if (index >= RNA_property_array_length(&r_ptr, r_prop) || index < 0) {
PyErr_Format(PyExc_TypeError, PyErr_Format(PyExc_IndexError,
"%.200s.path_resolve(\"%.200s\") index out of range", "%.200s.path_resolve(\"%.200s\") index out of range",
RNA_struct_identifier(self->ptr.type), path); RNA_struct_identifier(self->ptr.type), path);
return NULL; return NULL;
@@ -2957,7 +2963,7 @@ static PyObject *pyrna_struct_path_resolve(BPy_StructRNA *self, PyObject *args)
} }
} }
else { else {
PyErr_Format(PyExc_TypeError, PyErr_Format(PyExc_ValueError,
"%.200s.path_resolve(\"%.200s\") could not be resolved", "%.200s.path_resolve(\"%.200s\") could not be resolved",
RNA_struct_identifier(self->ptr.type), path); RNA_struct_identifier(self->ptr.type), path);
return NULL; return NULL;
@@ -2972,7 +2978,7 @@ PyDoc_STRVAR(pyrna_struct_path_from_id_doc,
" :arg property: Optional property name which can be used if the path is\n" " :arg property: Optional property name which can be used if the path is\n"
" to a property of this object.\n" " to a property of this object.\n"
" :type property: string\n" " :type property: string\n"
" :return: The path from :class:`bpy_struct.id_data`\n" " :return: The path from :class:`bpy.types.bpy_struct.id_data`\n"
" to this struct and property (when given).\n" " to this struct and property (when given).\n"
" :rtype: str\n" " :rtype: str\n"
); );
@@ -2991,7 +2997,7 @@ static PyObject *pyrna_struct_path_from_id(BPy_StructRNA *self, PyObject *args)
if (name) { if (name) {
prop= RNA_struct_find_property(&self->ptr, name); prop= RNA_struct_find_property(&self->ptr, name);
if (prop==NULL) { if (prop==NULL) {
PyErr_Format(PyExc_TypeError, PyErr_Format(PyExc_AttributeError,
"%.200s.path_from_id(\"%.200s\") not found", "%.200s.path_from_id(\"%.200s\") not found",
RNA_struct_identifier(self->ptr.type), name); RNA_struct_identifier(self->ptr.type), name);
return NULL; return NULL;
@@ -3005,12 +3011,12 @@ static PyObject *pyrna_struct_path_from_id(BPy_StructRNA *self, PyObject *args)
if (path==NULL) { if (path==NULL) {
if (name) { if (name) {
PyErr_Format(PyExc_TypeError, PyErr_Format(PyExc_ValueError,
"%.200s.path_from_id(\"%s\") found but does not support path creation", "%.200s.path_from_id(\"%s\") found but does not support path creation",
RNA_struct_identifier(self->ptr.type), name); RNA_struct_identifier(self->ptr.type), name);
} }
else { else {
PyErr_Format(PyExc_TypeError, PyErr_Format(PyExc_ValueError,
"%.200s.path_from_id() does not support path creation for this type", "%.200s.path_from_id() does not support path creation for this type",
RNA_struct_identifier(self->ptr.type)); RNA_struct_identifier(self->ptr.type));
} }
@@ -3028,7 +3034,7 @@ PyDoc_STRVAR(pyrna_prop_path_from_id_doc,
"\n" "\n"
" Returns the data path from the ID to this property (string).\n" " Returns the data path from the ID to this property (string).\n"
"\n" "\n"
" :return: The path from :class:`bpy_struct.id_data` to this property.\n" " :return: The path from :class:`bpy.types.bpy_struct.id_data` to this property.\n"
" :rtype: str\n" " :rtype: str\n"
); );
static PyObject *pyrna_prop_path_from_id(BPy_PropertyRNA *self) static PyObject *pyrna_prop_path_from_id(BPy_PropertyRNA *self)
@@ -3040,7 +3046,7 @@ static PyObject *pyrna_prop_path_from_id(BPy_PropertyRNA *self)
path= RNA_path_from_ID_to_property(&self->ptr, self->prop); path= RNA_path_from_ID_to_property(&self->ptr, self->prop);
if (path==NULL) { if (path==NULL) {
PyErr_Format(PyExc_TypeError, PyErr_Format(PyExc_ValueError,
"%.200s.%.200s.path_from_id() does not support path creation for this type", "%.200s.%.200s.path_from_id() does not support path creation for this type",
RNA_struct_identifier(self->ptr.type), RNA_property_identifier(prop)); RNA_struct_identifier(self->ptr.type), RNA_property_identifier(prop));
return NULL; return NULL;
@@ -3059,7 +3065,7 @@ PyDoc_STRVAR(pyrna_struct_type_recast_doc,
" such as textures can be changed at runtime.\n" " such as textures can be changed at runtime.\n"
"\n" "\n"
" :return: a new instance of this object with the type initialized again.\n" " :return: a new instance of this object with the type initialized again.\n"
" :rtype: subclass of :class:`bpy_struct`\n" " :rtype: subclass of :class:`bpy.types.bpy_struct`\n"
); );
static PyObject *pyrna_struct_type_recast(BPy_StructRNA *self) static PyObject *pyrna_struct_type_recast(BPy_StructRNA *self)
{ {
@@ -3132,10 +3138,11 @@ static void pyrna_dir_members_rna(PyObject *list, PointerRNA *ptr)
PyList_Append(list, pystring); PyList_Append(list, pystring);
Py_DECREF(pystring); Py_DECREF(pystring);
if(name != nameptr) if (name != nameptr) {
MEM_freeN(nameptr); MEM_freeN(nameptr);
} }
} }
}
RNA_PROP_END; RNA_PROP_END;
} }
} }
@@ -3664,6 +3671,11 @@ static PyObject *pyrna_struct_get_id_data(BPy_DummyPointerRNA *self)
Py_RETURN_NONE; Py_RETURN_NONE;
} }
static PyObject *pyrna_struct_get_data(BPy_DummyPointerRNA *self)
{
return pyrna_struct_CreatePyObject(&self->ptr);
}
static PyObject *pyrna_struct_get_rna_type(BPy_PropertyRNA *self) static PyObject *pyrna_struct_get_rna_type(BPy_PropertyRNA *self)
{ {
PointerRNA tptr; PointerRNA tptr;
@@ -3679,6 +3691,7 @@ static PyObject *pyrna_struct_get_rna_type(BPy_PropertyRNA *self)
static PyGetSetDef pyrna_prop_getseters[]= { static PyGetSetDef pyrna_prop_getseters[]= {
{(char *)"id_data", (getter)pyrna_struct_get_id_data, (setter)NULL, (char *)"The :class:`bpy.types.ID` object this datablock is from or None, (not available for all data types)", NULL}, {(char *)"id_data", (getter)pyrna_struct_get_id_data, (setter)NULL, (char *)"The :class:`bpy.types.ID` object this datablock is from or None, (not available for all data types)", NULL},
{(char *)"data", (getter)pyrna_struct_get_data, (setter)NULL, (char *)"The data this property is using, *type* :class:`bpy.types.bpy_struct`", NULL},
{(char *)"rna_type", (getter)pyrna_struct_get_rna_type, (setter)NULL, (char *)"The property type for introspection", NULL}, {(char *)"rna_type", (getter)pyrna_struct_get_rna_type, (setter)NULL, (char *)"The property type for introspection", NULL},
{NULL, NULL, NULL, NULL, NULL} /* Sentinel */ {NULL, NULL, NULL, NULL, NULL} /* Sentinel */
}; };
@@ -3714,10 +3727,11 @@ static PyObject *pyrna_prop_collection_keys(BPy_PropertyRNA *self)
Py_DECREF(item); Py_DECREF(item);
/* done */ /* done */
if(name != nameptr) if (name != nameptr) {
MEM_freeN(nameptr); MEM_freeN(nameptr);
} }
} }
}
RNA_PROP_END; RNA_PROP_END;
return ret; return ret;
@@ -3816,9 +3830,10 @@ static PyObject *pyrna_struct_get(BPy_StructRNA *self, PyObject *args)
if (group) { if (group) {
idprop= IDP_GetPropertyFromGroup(group, key); idprop= IDP_GetPropertyFromGroup(group, key);
if(idprop) if (idprop) {
return BPy_IDGroup_WrapData(self->ptr.id.data, idprop); return BPy_IDGroup_WrapData(self->ptr.id.data, idprop);
} }
}
return Py_INCREF(def), def; return Py_INCREF(def), def;
} }
@@ -6680,10 +6695,11 @@ static int bpy_class_call(bContext *C, PointerRNA *ptr, FunctionRNA *func, Param
/* only useful for single argument returns, we'll need another list loop for multiple */ /* only useful for single argument returns, we'll need another list loop for multiple */
if (flag & PROP_OUTPUT) { if (flag & PROP_OUTPUT) {
err= pyrna_py_to_prop(&funcptr, parm, iter.data, PyTuple_GET_ITEM(ret, i++), "calling class function:"); err= pyrna_py_to_prop(&funcptr, parm, iter.data, PyTuple_GET_ITEM(ret, i++), "calling class function:");
if(err) if (err) {
break; break;
} }
} }
}
RNA_parameter_list_end(&iter); RNA_parameter_list_end(&iter);
} }

View File

@@ -659,9 +659,11 @@ int pyrna_array_contains_py(PointerRNA *ptr, PropertyRNA *prop, PyObject *value)
RNA_property_float_get_array(ptr, prop, tmp_arr); RNA_property_float_get_array(ptr, prop, tmp_arr);
for(i=0; i<len; i++) for (i=0; i<len; i++) {
if(tmp_arr[i] == value_f) if (tmp_arr[i] == value_f) {
break; break;
}
}
if (tmp_arr != tmp) if (tmp_arr != tmp)
PyMem_FREE(tmp_arr); PyMem_FREE(tmp_arr);
@@ -694,9 +696,11 @@ int pyrna_array_contains_py(PointerRNA *ptr, PropertyRNA *prop, PyObject *value)
else else
RNA_property_int_get_array(ptr, prop, tmp_arr); RNA_property_int_get_array(ptr, prop, tmp_arr);
for(i=0; i<len; i++) for (i=0; i<len; i++) {
if(tmp_arr[i] == value_i) if (tmp_arr[i] == value_i) {
break; break;
}
}
if (tmp_arr != tmp) if (tmp_arr != tmp)
PyMem_FREE(tmp_arr); PyMem_FREE(tmp_arr);

View File

@@ -2235,7 +2235,7 @@ static int row_vector_multiplication(float rvec[MAX_DIMENSIONS], VectorObject *v
return -1; return -1;
memcpy(vec_cpy, vec->vec, vec_size * sizeof(float)); memcpy(vec_cpy, vec->vec, vec_size * sizeof(float));
printf("asasas\n");
rvec[3] = 1.0f; rvec[3] = 1.0f;
//muliplication //muliplication
for (x = 0; x < mat->row_size; x++) { for (x = 0; x < mat->row_size; x++) {

View File

@@ -1790,6 +1790,8 @@ void wm_event_do_handlers(bContext *C)
} }
if(playing == 0) { if(playing == 0) {
float time = sound_sync_scene(scene);
if(finite(time)) {
int ncfra = sound_sync_scene(scene) * (float)FPS + 0.5f; int ncfra = sound_sync_scene(scene) * (float)FPS + 0.5f;
if(ncfra != scene->r.cfra) { if(ncfra != scene->r.cfra) {
scene->r.cfra = ncfra; scene->r.cfra = ncfra;
@@ -1797,6 +1799,7 @@ void wm_event_do_handlers(bContext *C)
WM_event_add_notifier(C, NC_WINDOW, NULL); WM_event_add_notifier(C, NC_WINDOW, NULL);
} }
} }
}
CTX_data_scene_set(C, NULL); CTX_data_scene_set(C, NULL);
CTX_wm_screen_set(C, NULL); CTX_wm_screen_set(C, NULL);

View File

@@ -1590,7 +1590,7 @@ 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[1]=2.f*bb.m_extends[1];
objprop.m_boundobject.box.m_extends[2]=2.f*bb.m_extends[2]; objprop.m_boundobject.box.m_extends[2]=2.f*bb.m_extends[2];
break; break;
case OB_BOUND_POLYT: case OB_BOUND_CONVEX_HULL:
if (blenderobject->type == OB_MESH) if (blenderobject->type == OB_MESH)
{ {
objprop.m_boundclass = KX_BOUNDPOLYTOPE; objprop.m_boundclass = KX_BOUNDPOLYTOPE;
@@ -1598,7 +1598,7 @@ void BL_CreatePhysicsObjectNew(KX_GameObject* gameobj,
} }
// Object is not a mesh... fall through OB_BOUND_POLYH to // Object is not a mesh... fall through OB_BOUND_POLYH to
// OB_BOUND_SPHERE // OB_BOUND_SPHERE
case OB_BOUND_POLYH: case OB_BOUND_TRIANGLE_MESH:
if (blenderobject->type == OB_MESH) if (blenderobject->type == OB_MESH)
{ {
objprop.m_boundclass = KX_BOUNDMESH; objprop.m_boundclass = KX_BOUNDMESH;