[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [18080] branches/blender2.5/blender/source /blender: * Added bSound to rna ( still need to do bSample and bSoundListener structs)

Campbell Barton ideasman42 at gmail.com
Fri Dec 26 17:50:06 CET 2008


Revision: 18080
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=18080
Author:   campbellbarton
Date:     2008-12-26 17:50:05 +0100 (Fri, 26 Dec 2008)

Log Message:
-----------
* Added bSound to rna (still need to do bSample and bSoundListener structs)
* rna epy doc-gen was failing when trying to sort None

Modified Paths:
--------------
    branches/blender2.5/blender/source/blender/makesrna/RNA_access.h
    branches/blender2.5/blender/source/blender/makesrna/intern/makesrna.c
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_ID.c
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_internal.h
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_object.c
    branches/blender2.5/blender/source/blender/python/epy_doc_gen.py

Added Paths:
-----------
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_sound.c

Modified: branches/blender2.5/blender/source/blender/makesrna/RNA_access.h
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/RNA_access.h	2008-12-26 15:52:59 UTC (rev 18079)
+++ branches/blender2.5/blender/source/blender/makesrna/RNA_access.h	2008-12-26 16:50:05 UTC (rev 18080)
@@ -151,6 +151,7 @@
 extern StructRNA RNA_ShapeKeyBezierPoint;
 extern StructRNA RNA_ShapeKeyCurvePoint;
 extern StructRNA RNA_ShapeKeyPoint;
+extern StructRNA RNA_Sound;
 extern StructRNA RNA_SoundSequence;
 extern StructRNA RNA_SpeedControlSequence;
 extern StructRNA RNA_StringProperty;

Modified: branches/blender2.5/blender/source/blender/makesrna/intern/makesrna.c
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/intern/makesrna.c	2008-12-26 15:52:59 UTC (rev 18079)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/makesrna.c	2008-12-26 16:50:05 UTC (rev 18080)
@@ -925,6 +925,7 @@
 	{"rna_screen.c", RNA_def_screen},
 	{"rna_sensor.c", RNA_def_sensor},
 	{"rna_sequence.c", RNA_def_sequence},
+	{"rna_sound.c", RNA_def_sound},
 	{"rna_vfont.c", RNA_def_vfont},
 	{"rna_wm.c", RNA_def_wm},
 	{"rna_world.c", RNA_def_world},	

Modified: branches/blender2.5/blender/source/blender/makesrna/intern/rna_ID.c
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_ID.c	2008-12-26 15:52:59 UTC (rev 18079)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_ID.c	2008-12-26 16:50:05 UTC (rev 18080)
@@ -76,6 +76,7 @@
 		case ID_OB: return &RNA_Object;
 		case ID_SCE: return &RNA_Scene;
 		case ID_SCR: return &RNA_Screen;
+		case ID_SO: return &RNA_Sound;
 		case ID_VF: return &RNA_VectorFont;
 		case ID_WO: return &RNA_World;
 		case ID_WM: return &RNA_WindowManager;

Modified: branches/blender2.5/blender/source/blender/makesrna/intern/rna_internal.h
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_internal.h	2008-12-26 15:52:59 UTC (rev 18079)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_internal.h	2008-12-26 16:50:05 UTC (rev 18080)
@@ -124,6 +124,7 @@
 void RNA_def_screen(struct BlenderRNA *brna);
 void RNA_def_sensor(struct BlenderRNA *brna);
 void RNA_def_sequence(struct BlenderRNA *brna);
+void RNA_def_sound(struct BlenderRNA *brna);
 void RNA_def_vfont(struct BlenderRNA *brna);
 void RNA_def_wm(struct BlenderRNA *brna);
 void RNA_def_world(struct BlenderRNA *brna);

Modified: branches/blender2.5/blender/source/blender/makesrna/intern/rna_object.c
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_object.c	2008-12-26 15:52:59 UTC (rev 18079)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_object.c	2008-12-26 16:50:05 UTC (rev 18080)
@@ -56,7 +56,7 @@
 	RNA_def_property_ui_text(prop, "Track", "Object being tracked to define the rotation (Old Track).");
 
 	prop= RNA_def_property(srna, "loc", PROP_FLOAT, PROP_VECTOR);
-	RNA_def_property_ui_text(prop, "Location", "");
+	RNA_def_property_ui_text(prop, "Location", "DOC_BROKEN");
 	
 	//prop= RNA_def_property(srna, "rot", PROP_FLOAT, PROP_ROTATION);
 	//RNA_def_property_ui_text(prop, "Rotation", "");
@@ -64,27 +64,31 @@
 	RNA_def_property_ui_text(prop, "Rotation", "");
 	
 	prop= RNA_def_property(srna, "size", PROP_FLOAT, PROP_VECTOR);
-	RNA_def_property_ui_text(prop, "Scale", "");
-	
+	RNA_def_property_ui_text(prop, "Scale", "DOC_BROKEN");
+
+	prop= RNA_def_property(srna, "ipo", PROP_POINTER, PROP_NONE);
+	RNA_def_property_struct_type(prop, "Ipo");
+	RNA_def_property_ui_text(prop, "Ipo", "DOC_BROKEN");
+
 	prop= RNA_def_property(srna, "constraints", PROP_COLLECTION, PROP_NONE);
 	RNA_def_property_struct_type(prop, "Constraint");
-	RNA_def_property_ui_text(prop, "Constraints", "");
+	RNA_def_property_ui_text(prop, "Constraints", "DOC_BROKEN");
 	
 	prop= RNA_def_property(srna, "modifiers", PROP_COLLECTION, PROP_NONE);
 	RNA_def_property_struct_type(prop, "Modifier");
-	RNA_def_property_ui_text(prop, "Modifiers", "");
+	RNA_def_property_ui_text(prop, "Modifiers", "DOC_BROKEN");
 
 	prop= RNA_def_property(srna, "sensors", PROP_COLLECTION, PROP_NONE);
 	RNA_def_property_struct_type(prop, "Sensor");
-	RNA_def_property_ui_text(prop, "Sensors", "");
+	RNA_def_property_ui_text(prop, "Sensors", "DOC_BROKEN");
 
 	prop= RNA_def_property(srna, "controllers", PROP_COLLECTION, PROP_NONE);
 	RNA_def_property_struct_type(prop, "Controller");
-	RNA_def_property_ui_text(prop, "Controllers", "");
+	RNA_def_property_ui_text(prop, "Controllers", "DOC_BROKEN");
 
 	prop= RNA_def_property(srna, "actuators", PROP_COLLECTION, PROP_NONE);
 	RNA_def_property_struct_type(prop, "Actuator");
-	RNA_def_property_ui_text(prop, "Actuators", "");
+	RNA_def_property_ui_text(prop, "Actuators", "DOC_BROKEN");
 
 	prop= RNA_def_property(srna, "game_properties", PROP_COLLECTION, PROP_NONE);
 	RNA_def_property_collection_sdna(prop, NULL, "prop", NULL);

Added: branches/blender2.5/blender/source/blender/makesrna/intern/rna_sound.c
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_sound.c	                        (rev 0)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_sound.c	2008-12-26 16:50:05 UTC (rev 18080)
@@ -0,0 +1,129 @@
+/**
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ *
+ * Contributor(s): Campbell Barton
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <stdlib.h>
+
+#include "RNA_define.h"
+#include "RNA_types.h"
+
+#include "rna_internal.h"
+
+#include "DNA_sound_types.h"
+
+#ifdef RNA_RUNTIME
+
+#else
+
+void RNA_def_sound(BlenderRNA *brna)
+{
+	/* TODO - bSample and bSoundListener structs */
+
+	StructRNA *srna;
+	PropertyRNA *prop;
+
+	srna= RNA_def_struct(brna, "Sound", "ID");
+	RNA_def_struct_sdna(srna, "bSound");
+	RNA_def_struct_ui_text(srna, "Sound", "DOC_BROKEN");
+
+	prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILEPATH);
+	RNA_def_property_string_sdna(prop, NULL, "name");
+	RNA_def_property_flag(prop, PROP_NOT_EDITABLE); /* ? */
+	RNA_def_property_ui_text(prop, "Filename", "DOC_BROKEN");
+
+	/* floats */
+	prop= RNA_def_property(srna, "volume", PROP_FLOAT, PROP_NONE);
+	RNA_def_property_float_sdna(prop, NULL, "volume");
+	RNA_def_property_ui_text(prop, "Volume", "the volume for this sound in the game engine only");
+	RNA_def_property_ui_range(prop, 0.0, 1.0, 10, 4);
+
+	prop= RNA_def_property(srna, "panning", PROP_FLOAT, PROP_NONE);
+	RNA_def_property_float_sdna(prop, NULL, "panning");
+	RNA_def_property_ui_text(prop, "Panning", "Pan the sound from left to right");
+	RNA_def_property_ui_range(prop, -1.0, 1.0, 10, 4); /* TODO - this isnt used anywhere :/ */
+
+	prop= RNA_def_property(srna, "attenuation", PROP_FLOAT, PROP_NONE);
+	RNA_def_property_float_sdna(prop, NULL, "attenuation");
+	RNA_def_property_ui_text(prop, "Attenuation", "DOC_BROKEN");
+	RNA_def_property_ui_range(prop, 0.0, 100.0, 10, 4); /* TODO check limits */
+
+	prop= RNA_def_property(srna, "pitch", PROP_FLOAT, PROP_NONE);
+	RNA_def_property_float_sdna(prop, NULL, "pitch");
+	RNA_def_property_ui_text(prop, "Pitch", "Set the pitch of this sound for the game engine only");
+	RNA_def_property_ui_range(prop, -12.0, 12.0, 10, 4);
+
+	prop= RNA_def_property(srna, "min_gain", PROP_FLOAT, PROP_NONE);
+	RNA_def_property_float_sdna(prop, NULL, "min_gain");
+	RNA_def_property_ui_text(prop, "Min Gain", "DOC_BROKEN");
+	RNA_def_property_ui_range(prop, 0.0, 1.0, 10, 4); /* NOT used anywhere */
+
+	prop= RNA_def_property(srna, "max_gain", PROP_FLOAT, PROP_NONE);
+	RNA_def_property_float_sdna(prop, NULL, "max_gain");
+	RNA_def_property_ui_text(prop, "Max Gain", "DOC_BROKEN");
+	RNA_def_property_ui_range(prop, 0.0, 1.0, 10, 4); /* NOT used anywhere */
+
+	prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_NONE);
+	RNA_def_property_float_sdna(prop, NULL, "distance");
+	RNA_def_property_ui_text(prop, "Distance", "reference distance at which the listener will experience gain");
+	RNA_def_property_ui_range(prop, 0.0, 1000.0, 10, 4); /* NOT used anywhere */
+
+	prop= RNA_def_property(srna, "ipo", PROP_POINTER, PROP_NONE);
+	RNA_def_property_struct_type(prop, "Ipo");
+	RNA_def_property_ui_text(prop, "Ipo", "DOC_BROKEN");
+
+
+	/* flags */
+	prop= RNA_def_property(srna, "loop", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "flags", SOUND_FLAGS_LOOP); /* use bitflags */
+	RNA_def_property_ui_text(prop, "Sound Loop", "DOC_BROKEN");
+
+	prop= RNA_def_property(srna, "fixed_volume", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "flags", SOUND_FLAGS_FIXED_VOLUME); /* use bitflags */
+	RNA_def_property_ui_text(prop, "Fixed Volume", "DOC_BROKEN");
+
+	prop= RNA_def_property(srna, "fixed_panning", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "flags", SOUND_FLAGS_FIXED_PANNING); /* use bitflags */
+	RNA_def_property_ui_text(prop, "Fixed Panning", "DOC_BROKEN");
+
+	prop= RNA_def_property(srna, "spacial", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "flags", SOUND_FLAGS_3D); /* use bitflags */
+	RNA_def_property_ui_text(prop, "3D", "DOC_BROKEN");
+
+	prop= RNA_def_property(srna, "bidirectional_loop", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "flags", SOUND_FLAGS_BIDIRECTIONAL_LOOP); /* use bitflags */
+	RNA_def_property_ui_text(prop, "Bidirectional Loop", "DOC_BROKEN");
+

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list