Merging r43909 through r43951 from trunk into soc-2011-tomato
authorSergey Sharybin <sergey.vfx@gmail.com>
Tue, 7 Feb 2012 15:04:56 +0000 (15:04 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Tue, 7 Feb 2012 15:04:56 +0000 (15:04 +0000)
28 files changed:
intern/ghost/intern/GHOST_SystemWin32.cpp
release/scripts/modules/bpy/utils.py
release/scripts/startup/bl_ui/space_info.py
release/text/readme.html
source/blender/blenkernel/BKE_blender.h
source/blender/blenkernel/intern/depsgraph.c
source/blender/blenloader/intern/readfile.c
source/blender/collada/AnimationExporter.cpp
source/blender/collada/AnimationExporter.h
source/blender/collada/ArmatureExporter.cpp
source/blender/collada/DocumentExporter.cpp
source/blender/collada/ExportSettings.h
source/blender/collada/TransformWriter.cpp
source/blender/collada/collada.cpp
source/blender/collada/collada.h
source/blender/editors/animation/anim_markers.c
source/blender/editors/interface/interface_ops.c
source/blender/editors/mesh/loopcut.c
source/blender/editors/space_clip/space_clip.c
source/blender/editors/space_image/image_ops.c
source/blender/editors/space_image/space_image.c
source/blender/editors/space_node/node_edit.c
source/blender/editors/space_view3d/view3d_buttons.c
source/blender/makesrna/intern/rna_mesh.c
source/blender/makesrna/intern/rna_scene_api.c
source/blender/makesrna/intern/rna_wm_api.c
source/blender/windowmanager/intern/wm_operators.c
source/gameengine/Ketsji/KX_PythonInit.cpp

index 9cae2c27e65f17be4c6be82f3c2bef3016c8af19..98c4785797db171a0f8c7db2328aa5f0d3f700cf 100644 (file)
@@ -717,10 +717,11 @@ GHOST_EventKey* GHOST_SystemWin32::processKeyEvent(GHOST_IWindow *window, RAWINP
 
        if (key != GHOST_kKeyUnknown) {
                char utf8_char[6] = {0} ;
+               char ascii = 0;
 
                wchar_t utf16[2]={0};
-               BYTE state[256];
-               GetKeyboardState((PBYTE)state);  
+               BYTE state[256] ={0};
+               GetKeyboardState(state);  
 
                if(ToUnicodeEx(vk, 0, state, utf16, 2, 0, system->m_keylayout))
                        WideCharToMultiByte(CP_UTF8, 0, 
@@ -728,9 +729,14 @@ GHOST_EventKey* GHOST_SystemWin32::processKeyEvent(GHOST_IWindow *window, RAWINP
                                                                        (LPSTR) utf8_char, 5,
                                                                        NULL,NULL); else *utf8_char = 0;
 
-               if(!keyDown) utf8_char[0] = '\0';
                
-               event = new GHOST_EventKey(system->getMilliSeconds(), keyDown ? GHOST_kEventKeyDown: GHOST_kEventKeyUp, window, key, (*utf8_char & 0x80)?'?':*utf8_char, utf8_char);
+
+               if(!keyDown) {utf8_char[0] = '\0'; ascii='\0';}
+                       else ascii = utf8_char[0]& 0x80?'?':utf8_char[0];
+
+               if(0x80&state[VK_MENU]) utf8_char[0]='\0';
+
+               event = new GHOST_EventKey(system->getMilliSeconds(), keyDown ? GHOST_kEventKeyDown: GHOST_kEventKeyUp, window, key, ascii, utf8_char);
                
 #ifdef GHOST_DEBUG
                std::cout << ascii << std::endl;
index d5abcb03164e7697d5352b134a57c42daa8f90cf..63ba213f9b1721885a178a582ba98e4673561ec2 100644 (file)
@@ -327,9 +327,6 @@ def refresh_script_paths():
             _sys_path_ensure(path)
 
 
-_presets = _os.path.join(_scripts[0], "presets")  # FIXME - multiple paths
-
-
 def preset_paths(subdir):
     """
     Returns a list of paths for a specific preset.
index 901f709fb5b4531b2fb61649e7964571d2bd305b..95eb49062c01ff5a7631523299c77c855449f579 100644 (file)
@@ -362,7 +362,7 @@ class INFO_MT_help(Menu):
         layout = self.layout
 
         layout.operator("wm.url_open", text="Manual", icon='HELP').url = 'http://wiki.blender.org/index.php/Doc:2.6/Manual'
-        layout.operator("wm.url_open", text="Release Log", icon='URL').url = 'http://www.blender.org/development/release-logs/blender-261/'
+        layout.operator("wm.url_open", text="Release Log", icon='URL').url = 'http://www.blender.org/development/release-logs/blender-262/'
 
         layout.separator()
 
index 0627624d2e70e01a2afd8cc04aea595fb0fe0629..a9f5e705b3d4d0468bc411913327a59ace966fc4 100644 (file)
   </style>
 </head>
 <body>
-<p class="title"><b>Blender 2.61</b></p>
+<p class="title"><b>Blender 2.62</b></p>
 <p><br></p>
 <p class="header"><b>About</b></p>
 <p class="body">Welcome to Blender, the free, open source 3D application for modeling, animation, rendering, compositing, video editing and game creation. Blender is available for Linux, Mac OS X, Windows, Solaris and FreeBSD and has a large world-wide community.</p>
 <p class="body">Blender can be used freely for any purpose, including commercial use and distribution. It's free and open-source software, released under the GNU GPL licence. The entire source code is available on our website.</p>
 <p class="body">For more information, visit <a href="http://www.blender.org">blender.org</a>.</p>
 <p><br></p>
-<p class="header"><b>2.61</b></p>
-<p class="body">The Blender Foundation and online developer community is proud to present Blender 2.61. This release is the second official stable release of the Blender 2.6 series, in which we will refine the 2.5 series and add exciting new features again.<a href="http://www.blender.org/development/release-logs/blender-261/">More information about this release</a>.</p>
+<p class="header"><b>2.62</b></p>
+<p class="body">The Blender Foundation and online developer community is proud to present Blender 2.62. This release is the third official stable release of the Blender 2.6 series, in which we will refine the 2.5 series and add exciting new features again.<a href="http://www.blender.org/development/release-logs/blender-262/">More information about this release</a>.</p>
 <p><br></p>
 <p class="header"><b>Bugs</b></p>
-<p class="body">Although Blender 2.61 is considered a stable release, you may encounter a bug. If you do, please help us by posting it in the bug tracker or using Help → Report a Bug from inside Blender. If it wasn’t reported yet, please log in (or register) and fill in detailed information about the error. Please post detailed instructions on how to reproduce it or post a .blend file showcasing the bug.</p>
+<p class="body">Although Blender 2.62 is considered a stable release, you may encounter a bug. If you do, please help us by posting it in the bug tracker or using Help → Report a Bug from inside Blender. If it wasn’t reported yet, please log in (or register) and fill in detailed information about the error. Please post detailed instructions on how to reproduce it or post a .blend file showcasing the bug.</p>
 <p><br></p>
 <p class="header"><b>Package Contents</b></p>
 <p class="body">The downloaded Blender package includes:</p>
@@ -47,7 +47,7 @@
 <p class="header"><b>Links</b></p>
 <p class="body">Users:</p>
 <p class="body">       General information             <a href="http://www.blender.org">www.blender.org</a> <br>
-       Full release log                        <a href="http://www.blender.org/development/release-logs/blender-261/">www.blender.org/development/release-logs/blender-261/</a><br>
+       Full release log                        <a href="http://www.blender.org/development/release-logs/blender-262/">www.blender.org/development/release-logs/blender-262/</a><br>
        Tutorials                       <a href="http://www.blender.org/education-help/">www.blender.org/education-help/</a>    <br>
        Manual                  <a href="http://wiki.blender.org/index.php/Doc:Manual">wiki.blender.org/index.php/Doc:Manual</a><br>
        User Forum                      <a href="http://www.blenderartists.org">www.blenderartists.org</a><br>
index 50fef032b75ff3271eadb0c01c0c8db07f0ba4d8..7236015054d5b0f4b28ff3cb59c5ce1a4ba474fa 100644 (file)
@@ -51,7 +51,7 @@ extern "C" {
                /* can be left blank, otherwise a,b,c... etc with no quotes */
 #define BLENDER_VERSION_CHAR   
                /* alpha/beta/rc/release, docs use this */
-#define BLENDER_VERSION_CYCLE  beta
+#define BLENDER_VERSION_CYCLE  rc
 
 extern char versionstr[]; /* from blender.c */
 
index e67056cdd9e1ada39983826eb4057adfc88ee268..19fc75a88fe8ac36949aca9b5c0e4ee97b4bf21a 100644 (file)
@@ -398,8 +398,11 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Scene *scene, O
                                                                // fprintf(stderr,"armature %s target :%s \n", ob->id.name, target->id.name);
                                                                node3 = dag_get_node(dag, ct->tar);
                                                                
-                                                               if (ct->subtarget[0])
+                                                               if (ct->subtarget[0]) {
                                                                        dag_add_relation(dag,node3,node, DAG_RL_OB_DATA|DAG_RL_DATA_DATA, cti->name);
+                                                                       if(ct->tar->type == OB_MESH)
+                                                                               node3->customdata_mask |= CD_MASK_MDEFORMVERT;
+                                                               }
                                                                else if(ELEM3(con->type, CONSTRAINT_TYPE_FOLLOWPATH, CONSTRAINT_TYPE_CLAMPTO, CONSTRAINT_TYPE_SPLINEIK))        
                                                                        dag_add_relation(dag,node3,node, DAG_RL_DATA_DATA|DAG_RL_OB_DATA, cti->name);
                                                                else
index b30d04b31cc7d486516bc82ba200ccc09adbe25b..cff4f3965fa34bf8760a7fdcab16e971f3e67f8e 100644 (file)
@@ -4769,8 +4769,8 @@ static void lib_link_scene(FileData *fd, Main *main)
                        (void)marker;
 #endif
 
-                       if(sce->ed)
-                               seq_update_muting(sce->ed);
+                       seq_update_muting(sce->ed);
+                       seq_update_sound_bounds_all(sce);
                        
                        if(sce->nodetree) {
                                lib_link_ntree(fd, &sce->id, sce->nodetree);
index 7b57ed243a17167350572b20e270153e1cc3ce57..c2d8c356aae19663e28c270ec23428809a670c4c 100644 (file)
@@ -773,6 +773,27 @@ std::string AnimationExporter::create_4x4_source(std::vector<float> &frames , Ob
                        copy_m4_m4(mat, pchan->pose_mat);
                UnitConverter converter;
 
+               // SECOND_LIFE_COMPATIBILITY
+               // AFAIK animation to second life is via BVH, but no
+               // reason to not have the collada-animation be correct
+               if(export_settings->second_life)
+               {
+                       float temp[4][4];
+                       copy_m4_m4(temp, bone->arm_mat);
+                       temp[3][0] = temp[3][1] = temp[3][2] = 0.0f;
+                       invert_m4(temp);
+
+                       mult_m4_m4m4(mat, mat, temp);
+
+                       if(bone->parent)
+                       {
+                               copy_m4_m4(temp, bone->parent->arm_mat);
+                               temp[3][0] = temp[3][1] = temp[3][2] = 0.0f;
+
+                               mult_m4_m4m4(mat, temp, mat);
+                       }
+               }
+
                float outmat[4][4];
                converter.mat4_to_dae(outmat,mat);
 
index c3a5c7a5383d1515331124d282df7c5a599554dc..ba7ec6859cc92f2e35f16fbb2197e07d0af4fa14 100644 (file)
@@ -83,7 +83,9 @@ private:
 
 public:
 
-       AnimationExporter(COLLADASW::StreamWriter *sw): COLLADASW::LibraryAnimations(sw) { this->sw = sw; }
+       AnimationExporter(COLLADASW::StreamWriter *sw, const ExportSettings *export_settings):
+                       COLLADASW::LibraryAnimations(sw), export_settings(export_settings)
+                       { this->sw = sw; }
        
 
        void exportAnimations(Scene *sce);
@@ -92,6 +94,7 @@ public:
        void operator() (Object *ob); 
        
 protected:
+       const ExportSettings *export_settings;
 
        void dae_animation(Object* ob, FCurve *fcu, char* transformName , bool is_param, Material *ma = NULL);
 
index fcfc197ce804a3de2b51296cda96bb07733896b1..0e89f2db74bed49f21b836fa5c4856692f7bf6c3 100644 (file)
@@ -221,8 +221,31 @@ void ArmatureExporter::add_bone_transform(Object *ob_arm, Bone *bone, COLLADASW:
                mult_m4_m4m4(mat, invpar, pchan->pose_mat);
        }
        else {
-               // get world-space from armature-space
-               mult_m4_m4m4(mat, ob_arm->obmat, pchan->pose_mat);
+               copy_m4_m4(mat, pchan->pose_mat);
+               // Why? Joint's localspace is still it's parent node
+               //get world-space from armature-space
+               //mult_m4_m4m4(mat, ob_arm->obmat, pchan->pose_mat);
+       }
+
+       // SECOND_LIFE_COMPATIBILITY
+       if(export_settings->second_life)
+       {
+               // Remove rotations vs armature from transform
+               // parent_rest_rot * mat * irest_rot
+               float temp[4][4];
+               copy_m4_m4(temp, bone->arm_mat);
+               temp[3][0] = temp[3][1] = temp[3][2] = 0.0f;
+               invert_m4(temp);
+
+               mult_m4_m4m4(mat, mat, temp);
+
+               if(bone->parent)
+               {
+                       copy_m4_m4(temp, bone->parent->arm_mat);
+                       temp[3][0] = temp[3][1] = temp[3][2] = 0.0f;
+
+                       mult_m4_m4m4(mat, temp, mat);
+               }
        }
 
        TransformWriter::add_node_transform(node, mat,NULL );
@@ -341,10 +364,16 @@ std::string ArmatureExporter::add_inv_bind_mats_source(Object *ob_arm, ListBase
 {
        std::string source_id = controller_id + BIND_POSES_SOURCE_ID_SUFFIX;
 
+       int totjoint = 0;
+       for (bDeformGroup *def = (bDeformGroup*)defbase->first; def; def = def->next) {
+               if (is_bone_defgroup(ob_arm, def))
+                       totjoint++;
+       }
+
        COLLADASW::FloatSourceF source(mSW);
        source.setId(source_id);
        source.setArrayId(source_id + ARRAY_ID_SUFFIX);
-       source.setAccessorCount(BLI_countlist(defbase));
+       source.setAccessorCount(totjoint); //BLI_countlist(defbase));
        source.setAccessorStride(16);
        
        source.setParameterTypeName(&COLLADASW::CSWC::CSW_VALUE_TYPE_FLOAT4x4);
@@ -366,16 +395,27 @@ std::string ArmatureExporter::add_inv_bind_mats_source(Object *ob_arm, ListBase
 
        for (bDeformGroup *def = (bDeformGroup*)defbase->first; def; def = def->next) {
                if (is_bone_defgroup(ob_arm, def)) {
-
                        bPoseChannel *pchan = get_pose_channel(pose, def->name);
 
                        float mat[4][4];
                        float world[4][4];
                        float inv_bind_mat[4][4];
 
-                       // make world-space matrix, arm_mat is armature-space
-                       mult_m4_m4m4(world, ob_arm->obmat, pchan->bone->arm_mat);
-                       
+                       // SECOND_LIFE_COMPATIBILITY
+                       if(export_settings->second_life)
+                       {
+                               // Only translations, no rotation vs armature
+                               float temp[4][4];
+                               unit_m4(temp);
+                               copy_v3_v3(temp[3], pchan->bone->arm_mat[3]);
+                               mult_m4_m4m4(world, ob_arm->obmat, temp);
+                       }
+                       else
+                       {
+                               // make world-space matrix, arm_mat is armature-space
+                               mult_m4_m4m4(world, ob_arm->obmat, pchan->bone->arm_mat);
+                       }
+
                        invert_m4_m4(mat, world);
                        converter.mat4_to_dae(inv_bind_mat, mat);
 
index 6e8abc083580a27c44c5250c0eaa009e5682f439..6e04a1773bb6118e715fb3ce22e9390272bafb9e 100644 (file)
@@ -257,7 +257,7 @@ void DocumentExporter::exportCurrentScene(Scene *sce)
        }
 
        // <library_animations>
-       AnimationExporter ae(&sw);
+       AnimationExporter ae(&sw, this->export_settings);
        ae.exportAnimations(sce);
 
        // <library_controllers>
index 1ad7c8c370e7b52e470f314aad5a2ae8781abe0d..80e20acbe4895635c82cbdcba8d0751089bb9793 100644 (file)
@@ -31,6 +31,7 @@ struct ExportSettings
 {
  public:
  bool selected;
+ bool second_life;
  char *filepath;
 };
 
index 379a0619040a9ff13dd716eab1255378d3f7e3c0..a2bca6733e1d4670d78055173fd09792947c36f2 100644 (file)
@@ -59,6 +59,7 @@ void TransformWriter::add_node_transform(COLLADASW::Node& node, float mat[][4],
 
 void TransformWriter::add_node_transform_ob(COLLADASW::Node& node, Object *ob)
 {
+       /*
        float rot[3], loc[3], scale[3];
 
        if (ob->parent) {
@@ -91,6 +92,27 @@ void TransformWriter::add_node_transform_ob(COLLADASW::Node& node, Object *ob)
        }
 
        add_transform(node, loc, rot, scale);
+       */
+
+       /* Using parentinv should allow use of existing curves */
+       // If parentinv is identity don't add it.
+       bool add_parinv = false;
+       for(int i = 0; i < 16; ++i)
+       {
+               float f = (i%4 == i/4) ? 1.0f : 0.0f ;
+               if(ob->parentinv[i%4][i/4] != f) add_parinv = true;
+       }
+
+       // Eat this 3ds Max et friends
+       if(add_parinv)
+       {
+               double dmat[4][4];
+               UnitConverter converter;
+               converter.mat4_to_dae_double(dmat, ob->parentinv);
+               node.addMatrix("parentinverse", dmat);
+       }
+
+       add_transform(node, ob->loc, ob->rot, ob->size);
 }
 
 void TransformWriter::add_node_transform_identity(COLLADASW::Node& node)
index 0731faceeedc412169a52db8858ca0690ca1b9d9..39114f6543b725fbca4299dbab555b3aa2778c88 100644 (file)
@@ -49,11 +49,12 @@ extern "C"
                return 0;
        }
 
-       int collada_export(Scene *sce, const char *filepath, int selected)
+       int collada_export(Scene *sce, const char *filepath, int selected, int second_life)
        {
                ExportSettings export_settings;
                
                export_settings.selected = selected != 0;
+               export_settings.second_life = second_life != 0;
                export_settings.filepath = (char *)filepath;
 
                /* annoying, collada crashes if file cant be created! [#27162] */
index b86f37b7af62a9ae407a265ec994eb851100635d..161977368db8204fc71c7f8ab8689823cfd42456 100644 (file)
@@ -37,7 +37,7 @@ extern "C" {
         * both return 1 on success, 0 on error
         */
        int collada_import(bContext *C, const char *filepath);
-       int collada_export(Scene *sce, const char *filepath, int selected);
+       int collada_export(Scene *sce, const char *filepath, int selected, int second_life);
 #ifdef __cplusplus
 }
 #endif
index 216bb8d0e082071228b9ae27f6db17302d069a81..79d767be63cb04d989583355195e77110931475c 100644 (file)
@@ -439,22 +439,28 @@ static void draw_marker(View2D *v2d, TimeMarker *marker, int cfra, int flag)
 void draw_markers_time(const bContext *C, int flag)
 {
        ListBase *markers= ED_context_get_markers(C);
-       View2D *v2d= UI_view2d_fromcontext(C);
+       View2D *v2d;
        TimeMarker *marker;
-       
+       Scene *scene;
+
        if (markers == NULL)
                return;
-       
+
+       scene = CTX_data_scene(C);
+       v2d = UI_view2d_fromcontext(C);
+
        /* unselected markers are drawn at the first time */
        for (marker= markers->first; marker; marker= marker->next) {
-               if ((marker->flag & SELECT) == 0) 
-                       draw_marker(v2d, marker, CTX_data_scene(C)->r.cfra, flag);
+               if ((marker->flag & SELECT) == 0) {
+                       draw_marker(v2d, marker, scene->r.cfra, flag);
+               }
        }
        
        /* selected markers are drawn later */
        for (marker= markers->first; marker; marker= marker->next) {
-               if (marker->flag & SELECT) 
-                       draw_marker(v2d, marker, CTX_data_scene(C)->r.cfra, flag);
+               if (marker->flag & SELECT) {
+                       draw_marker(v2d, marker, scene->r.cfra, flag);
+               }
        }
 }
 
@@ -550,7 +556,8 @@ static int ed_marker_add(bContext *C, wmOperator *UNUSED(op))
        if (markers == NULL)
                return OPERATOR_CANCELLED;
        
-       /* two markers can't be at the same place */
+       /* prefer not having 2 markers at the same place,
+        * though the user can move them to overlap once added */
        for (marker= markers->first; marker; marker= marker->next) {
                if (marker->frame == frame) 
                        return OPERATOR_CANCELLED;
index 40cf0213203fb3f7104019e92fe991afd03870b3..0521ecbf0d093cdc744622cfb956ab910b4e951d 100644 (file)
@@ -103,7 +103,8 @@ static int eyedropper_cancel(bContext *C, wmOperator *op)
 static void eyedropper_sample(bContext *C, Eyedropper *eye, int mx, int my)
 {
        if(RNA_property_type(eye->prop) == PROP_FLOAT) {
-               const int color_manage = CTX_data_scene(C)->r.color_mgt_flag & R_COLOR_MANAGEMENT;
+               Scene *scene = CTX_data_scene(C);
+               const int color_manage = scene->r.color_mgt_flag & R_COLOR_MANAGEMENT;
                float col[4];
        
                RNA_property_float_get_array(&eye->ptr, eye->prop, col);
index 6ff62b16bde0df04300bdba4628bbf4484a6f67b..c317eabd48a21dda8df78424d9c75fde3093bced 100644 (file)
@@ -380,8 +380,16 @@ static int ringsel_invoke (bContext *C, wmOperator *op, wmEvent *evt)
        lcd = op->customdata;
        
        if (lcd->em->selectmode == SCE_SELECT_FACE) {
+               PointerRNA props_ptr;
+               int extend = RNA_boolean_get(op->ptr, "extend");
+
                ringsel_exit(op);
-               WM_operator_name_call(C, "MESH_OT_loop_select", WM_OP_INVOKE_REGION_WIN, NULL);
+
+               WM_operator_properties_create(&props_ptr, "MESH_OT_loop_select");
+               RNA_boolean_set(&props_ptr, "extend", extend);
+               WM_operator_name_call(C, "MESH_OT_loop_select", WM_OP_INVOKE_REGION_WIN, &props_ptr);
+               WM_operator_properties_free(&props_ptr);
+
                return OPERATOR_CANCELLED;
        }
 
index 7cd7060e1d457ade3e260a51bb1afac4e369fc2d..41c52e6fa0b2129c2f6650720061e6f8289a2b70 100644 (file)
@@ -596,6 +596,7 @@ static void clip_refresh(const bContext *C, ScrArea *sa)
 {
        wmWindowManager *wm= CTX_wm_manager(C);
        wmWindow *window= CTX_wm_window(C);
+       Scene *scene = CTX_data_scene(C);
        SpaceClip *sc= (SpaceClip *)sa->spacedata.first;
        ARegion *ar_main= BKE_area_find_region_type(sa, RGN_TYPE_WINDOW);
        ARegion *ar_preview= clip_has_preview_region(C, sa);
@@ -637,7 +638,7 @@ static void clip_refresh(const bContext *C, ScrArea *sa)
                ED_area_tag_redraw(sa);
        }
 
-       BKE_movieclip_user_set_frame(&sc->user, CTX_data_scene(C)->r.cfra);
+       BKE_movieclip_user_set_frame(&sc->user, scene->r.cfra);
 }
 
 /********************* main region ********************/
index ea58b4aa7375933d392ddafdf01a82b75bbf29a5..e1fe3788d05eda2f5302fab71182b5d1683db671 100644 (file)
@@ -594,7 +594,7 @@ static int image_view_selected_exec(bContext *C, wmOperator *UNUSED(op))
        /* retrieve state */
        sima= CTX_wm_space_image(C);
        ar= CTX_wm_region(C);
-       scene= (Scene*)CTX_data_scene(C);
+       scene= CTX_data_scene(C);
        obedit= CTX_data_edit_object(C);
 
        ima= ED_space_image(sima);
@@ -1445,7 +1445,7 @@ static int image_new_exec(bContext *C, wmOperator *op)
 
        /* retrieve state */
        sima= CTX_wm_space_image(C);
-       scene= (Scene*)CTX_data_scene(C);
+       scene= CTX_data_scene(C);
        obedit= CTX_data_edit_object(C);
 
        RNA_string_get(op->ptr, "name", name);
index fd7895052f146b2935321755a01e0b0ca9bf135a..3a5793461eaf46a8257c30b8512768d9b1a6a82e 100644 (file)
@@ -581,7 +581,7 @@ static void image_refresh(const bContext *C, ScrArea *UNUSED(sa))
        ima= ED_space_image(sima);
 
        if(sima->iuser.flag & IMA_ANIM_ALWAYS)
-               BKE_image_user_calc_frame(&sima->iuser, CTX_data_scene(C)->r.cfra, 0);
+               BKE_image_user_calc_frame(&sima->iuser, scene->r.cfra, 0);
        
        /* check if we have to set the image from the editmesh */
        if(ima && (ima->source==IMA_SRC_VIEWER || sima->pin));
index fe734e53651cf0c514766ba3cc2452c0535dcbde..906b5d01e326cbe3da346eb9f69c365b64447cd2 100644 (file)
@@ -1341,9 +1341,10 @@ typedef struct ImageSampleInfo {
 
 static void sample_draw(const bContext *C, ARegion *ar, void *arg_info)
 {
+       Scene *scene = CTX_data_scene(C);
        ImageSampleInfo *info= arg_info;
 
-       ED_image_draw_info(ar, (CTX_data_scene(C)->r.color_mgt_flag & R_COLOR_MANAGEMENT), info->channels,
+       ED_image_draw_info(ar, (scene->r.color_mgt_flag & R_COLOR_MANAGEMENT), info->channels,
                           info->x, info->y, info->col, info->colf,
                           NULL, NULL /* zbuf - unused for nodes */
                           );
index 985d70d21446579a1341c4ef80f27363987d203f..5238fd30ae69c70371095fb687e9f457a7f4d180 100644 (file)
@@ -1269,7 +1269,7 @@ static void do_view3d_region_buttons(bContext *C, void *UNUSED(index), int event
        }
 
        /* default for now */
-       WM_event_add_notifier(C, NC_SPACE|ND_SPACE_VIEW3D, ob);
+       WM_event_add_notifier(C, NC_SPACE|ND_SPACE_VIEW3D, v3d);
 }
 
 static void view3d_panel_object(const bContext *C, Panel *pa)
index c2faf20749d0c9d6824da64333138e69ebf9886d..f0320d85bb8d8d2a87f95a7e15951dcc52972f15 100644 (file)
@@ -2192,14 +2192,13 @@ static void rna_def_mesh(BlenderRNA *brna)
        RNA_def_property_boolean_sdna(prop, NULL, "editflag", ME_EDIT_PAINT_MASK);
        RNA_def_property_ui_text(prop, "Paint Mask", "Face selection masking for painting");
        RNA_def_property_ui_icon(prop, ICON_FACESEL_HLT, 0);
-       RNA_def_property_update(prop, 0, "rna_Mesh_update_facemask");
-
+       RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, "rna_Mesh_update_facemask");
        
        prop= RNA_def_property(srna, "use_paint_mask_vertex", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "editflag", ME_EDIT_VERT_SEL);
        RNA_def_property_ui_text(prop, "Vertex Selection", "Vertex selection masking for painting (weight paint only)");
        RNA_def_property_ui_icon(prop, ICON_VERTEXSEL, 0);
-       RNA_def_property_update(prop, 0, "rna_Mesh_update_vertmask");
+       RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, "rna_Mesh_update_vertmask");
 
        /* readonly editmesh info - use for extrude menu */
        prop= RNA_def_property(srna, "total_vert_sel", PROP_INT, PROP_UNSIGNED);
index 153317fb687b2507badc073b3f64da9fda92f671..6d588632c95f6f20fadb092332831c662d1e74de 100644 (file)
@@ -84,9 +84,9 @@ static void rna_SceneRender_get_frame_path(RenderData *rd, int frame, char *name
 /* don't remove this, as COLLADA exporting cannot be done through operators in render() callback. */
 #include "../../collada/collada.h"
 
-static void rna_Scene_collada_export(Scene *scene, const char *filepath, int selected)
+static void rna_Scene_collada_export(Scene *scene, const char *filepath, int selected, int second_life)
 {
-       collada_export(scene, filepath, selected);
+       collada_export(scene, filepath, selected, second_life);
 }
 
 #endif
@@ -110,10 +110,11 @@ void RNA_api_scene(StructRNA *srna)
 #ifdef WITH_COLLADA
        /* don't remove this, as COLLADA exporting cannot be done through operators in render() callback. */
        func= RNA_def_function(srna, "collada_export", "rna_Scene_collada_export");
-       RNA_def_string(func, "filepath", "", FILE_MAX, "File Path", "File path to write Collada file");
-       parm= RNA_def_boolean(func, "selected", 0, "Export only selected", "Export only selected elements");
+       parm= RNA_def_string(func, "filepath", "", FILE_MAX, "File Path", "File path to write Collada file");
        RNA_def_property_flag(parm, PROP_REQUIRED);
        RNA_def_property_subtype(parm, PROP_FILEPATH); /* allow non utf8 */
+       parm= RNA_def_boolean(func, "selected", 0, "Export only selected", "Export only selected elements");
+       parm= RNA_def_boolean(func, "second_life", 0, "Export for Second Life", "Compatibility mode for Second Life");
        RNA_def_function_ui_description(func, "Export to collada file");
 #endif
 }
index 95488ead70d19535de53b7a4b48a4dfc5769cd81..35f12114a4e510d8fd6356e6ad73411bf7ff32e6 100644 (file)
@@ -197,7 +197,9 @@ void RNA_api_wm(StructRNA *srna)
        PropertyRNA *parm;
 
        func= RNA_def_function(srna, "fileselect_add", "WM_event_add_fileselect");
-       RNA_def_function_ui_description(func, "Show up the file selector");
+       RNA_def_function_ui_description(func, "Opens a file selector with an operator. "
+                                       "The string properties 'filepath', 'filename', 'directory' and a 'files' collection "
+                                       "are assigned when present in the operator");
        rna_generic_op_invoke(func, 0);
 
        func= RNA_def_function(srna, "modal_handler_add", "rna_event_modal_handler_add");
index 4052c2219356688bbe4c1e38e61daa06c27a4b6b..19c45164b5307e66eb017719db9e76f19c871a0b 100644 (file)
@@ -1324,7 +1324,7 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *UNUSED(ar
        uiItemL(col, "Links", ICON_NONE);
        uiItemStringO(col, IFACE_("Donations"), ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org/blenderorg/blender-foundation/donation-payment");
        uiItemStringO(col, IFACE_("Credits"), ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org/development/credits");
-       uiItemStringO(col, IFACE_("Release Log"), ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org/development/release-logs/blender-261");
+       uiItemStringO(col, IFACE_("Release Log"), ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org/development/release-logs/blender-262");
        uiItemStringO(col, IFACE_("Manual"), ICON_URL, "WM_OT_url_open", "url", "http://wiki.blender.org/index.php/Doc:2.5/Manual");
        uiItemStringO(col, IFACE_("Blender Website"), ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org");
        uiItemStringO(col, IFACE_("User Community"), ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org/community/user-community");
@@ -2135,7 +2135,7 @@ static int wm_collada_export_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED
 static int wm_collada_export_exec(bContext *C, wmOperator *op)
 {
        char filename[FILE_MAX];
-       int selected;
+       int selected, second_life;
        
        if(!RNA_struct_property_is_set(op->ptr, "filepath")) {
                BKE_report(op->reports, RPT_ERROR, "No filename given");
@@ -2144,7 +2144,8 @@ static int wm_collada_export_exec(bContext *C, wmOperator *op)
 
        RNA_string_get(op->ptr, "filepath", filename);
        selected = RNA_boolean_get(op->ptr, "selected");
-       if(collada_export(CTX_data_scene(C), filename, selected)) {
+       second_life = RNA_boolean_get(op->ptr, "second_life");
+       if(collada_export(CTX_data_scene(C), filename, selected, second_life)) {
                return OPERATOR_FINISHED;
        }
        else {
@@ -2164,6 +2165,8 @@ static void WM_OT_collada_export(wmOperatorType *ot)
        WM_operator_properties_filesel(ot, FOLDERFILE|COLLADAFILE, FILE_BLENDER, FILE_SAVE, WM_FILESEL_FILEPATH, FILE_DEFAULTDISPLAY);
        RNA_def_boolean(ot->srna, "selected", 0, "Export only selected",
                "Export only selected elements");
+       RNA_def_boolean(ot->srna, "second_life", 0, "Export for Second Life",
+               "Compatibility mode for Second Life");
 }
 
 /* function used for WM_OT_save_mainfile too */
index 82084700d6cabc5e8026a9e94af5a7822f218fa4..401474b21a91a37e4ae6a2033cd6183a0477644e 100644 (file)
@@ -1880,6 +1880,14 @@ PyObject* initGamePlayerPythonScripting(const STR_String& progname, TPythonSecur
                Py_DECREF(mod);
        }
 
+#ifdef WITH_AUDASPACE
+       /* accessing a SoundActuator's sound results in a crash if aud is not initialised... */
+       {
+               PyObject *mod= PyImport_ImportModuleLevel((char *)"aud", NULL, NULL, NULL, 0);
+               Py_DECREF(mod);
+       }
+#endif
+
        initPyTypes();
        
        bpy_import_main_set(maggie);
@@ -1924,6 +1932,14 @@ PyObject* initGamePythonScripting(const STR_String& progname, TPythonSecurityLev
        Py_NoSiteFlag=1;
        Py_FrozenFlag=1;
 
+#ifdef WITH_AUDASPACE
+       /* accessing a SoundActuator's sound results in a crash if aud is not initialised... */
+       {
+               PyObject *mod= PyImport_ImportModuleLevel((char *)"aud", NULL, NULL, NULL, 0);
+               Py_DECREF(mod);
+       }
+#endif
+
        initPyTypes();
        
        bpy_import_main_set(maggie);