Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2006-08-06 13:51:40 +0400
committerCampbell Barton <ideasman42@gmail.com>2006-08-06 13:51:40 +0400
commitaaec0005452e17ba06e727736b6f92c13550bf7a (patch)
tree0e842b57cbd5a0fa7ff316eef0307a7c9fcdf35d /source/blender/python/api2_2x/Sound.c
parent80f5a232d9ebddd37afadaccc030b74dd26d93cc (diff)
Made Font.c's pack/unpack work like Sound.c's
Diffstat (limited to 'source/blender/python/api2_2x/Sound.c')
-rw-r--r--source/blender/python/api2_2x/Sound.c24
1 files changed, 9 insertions, 15 deletions
diff --git a/source/blender/python/api2_2x/Sound.c b/source/blender/python/api2_2x/Sound.c
index 2b7316b4045..7dddb348472 100644
--- a/source/blender/python/api2_2x/Sound.c
+++ b/source/blender/python/api2_2x/Sound.c
@@ -444,25 +444,19 @@ static PyObject *Sound_unpack( BPy_Sound * self, PyObject * args )
int mode;
if( !PyArg_ParseTuple( args, "i", &mode ) )
return EXPP_ReturnPyObjError( PyExc_TypeError,
- "expected 1 integer" );
+ "expected an integer from Blender.UnpackModes" );
- if (!sound_sample_is_null(sound))
- {
+ if (!sound_sample_is_null(sound)) {
bSample *sample = sound_find_sample(sound);
- if (sample->packedfile==NULL)
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "sound not packed" );
- if (unpackSample(sample, mode) == RET_ERROR)
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "error unpacking sound" );
- }
- else
- {
- return EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "sound has no samples" );
+ if (sample->packedfile) {
+ if (unpackSample(sample, mode) == RET_ERROR)
+ return EXPP_ReturnPyObjError( PyExc_RuntimeError,
+ "error unpacking sound");
+ }
+ } else {
+ return EXPP_ReturnPyObjError( PyExc_RuntimeError, "sound has no samples" );
}
Py_RETURN_NONE;
-
}
/* pack sound */