Merge branch 'master' into blender2.8
[blender.git] / source / blender / makesrna / intern / rna_space.c
index 53b89336bb509a13b4e31793a9a266bd808784c3..0b8717fc982b4c5833a8dfeca300e501837c7602 100644 (file)
@@ -206,7 +206,6 @@ static EnumPropertyItem buttons_context_items[] = {
        {BCONTEXT_BONE_CONSTRAINT, "BONE_CONSTRAINT", ICON_CONSTRAINT_BONE, "Bone Constraints", "Bone constraints"},
        {BCONTEXT_MATERIAL, "MATERIAL", ICON_MATERIAL, "Material", "Material"},
        {BCONTEXT_TEXTURE, "TEXTURE", ICON_TEXTURE, "Texture", "Texture"},
-       {BCONTEXT_PARTICLE, "PARTICLES", ICON_PARTICLES, "Particles", "Particle"},
        {BCONTEXT_PHYSICS, "PHYSICS", ICON_PHYSICS, "Physics", "Physics"},
        {0, NULL, 0, NULL, NULL}
 };
@@ -216,7 +215,6 @@ static EnumPropertyItem buttons_texture_context_items[] = {
        {SB_TEXC_MATERIAL, "MATERIAL", ICON_MATERIAL, "", "Show material textures"},
        {SB_TEXC_WORLD, "WORLD", ICON_WORLD, "", "Show world textures"},
        {SB_TEXC_LAMP, "LAMP", ICON_LAMP, "", "Show lamp textures"},
-       {SB_TEXC_PARTICLES, "PARTICLES", ICON_PARTICLES, "", "Show particles textures"},
        {SB_TEXC_LINESTYLE, "LINESTYLE", ICON_LINE_DATA, "", "Show linestyle textures"},
        {SB_TEXC_OTHER, "OTHER", ICON_TEXTURE, "", "Show other data textures"},
        {0, NULL, 0, NULL, NULL}
@@ -689,6 +687,15 @@ static int rna_SpaceView3D_viewport_shade_get(PointerRNA *ptr)
        return drawtype;
 }
 
+static void rna_SpaceView3D_viewport_shade_set(PointerRNA *ptr, int value)
+{
+       View3D *v3d = (View3D *)ptr->data;
+       if (value != v3d->drawtype && value == OB_RENDER) {
+               v3d->prev_drawtype = v3d->drawtype;
+       }
+       v3d->drawtype = value;
+}
+
 static EnumPropertyItem *rna_SpaceView3D_viewport_shade_itemf(bContext *UNUSED(C), PointerRNA *ptr,
                                                               PropertyRNA *UNUSED(prop), bool *r_free)
 {
@@ -939,7 +946,7 @@ static EnumPropertyItem *rna_SpaceImageEditor_pivot_itemf(bContext *UNUSED(C), P
                {V3D_AROUND_CENTER_MEAN, "MEDIAN", ICON_ROTATECENTER, "Median Point", ""},
                {V3D_AROUND_CURSOR, "CURSOR", ICON_CURSOR, "2D Cursor", ""},
                {V3D_AROUND_LOCAL_ORIGINS, "INDIVIDUAL_ORIGINS", ICON_ROTATECOLLECTION,
-                           "Individual Origins", "Pivot around each object's own origin"},
+                           "Individual Origins", "Pivot around each selected island's own median point"},
                {0, NULL, 0, NULL, NULL}
        };
 
@@ -1088,10 +1095,6 @@ static EnumPropertyItem *rna_SpaceProperties_context_itemf(bContext *UNUSED(C),
                RNA_enum_items_add_value(&item, &totitem, buttons_context_items, BCONTEXT_TEXTURE);
        }
 
-       if (sbuts->pathflag & (1 << BCONTEXT_PARTICLE)) {
-               RNA_enum_items_add_value(&item, &totitem, buttons_context_items, BCONTEXT_PARTICLE);
-       }
-
        if (sbuts->pathflag & (1 << BCONTEXT_PHYSICS)) {
                RNA_enum_items_add_value(&item, &totitem, buttons_context_items, BCONTEXT_PHYSICS);
        }
@@ -1102,6 +1105,14 @@ static EnumPropertyItem *rna_SpaceProperties_context_itemf(bContext *UNUSED(C),
        return item;
 }
 
+static void rna_SpaceProperties_context_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
+{
+       SpaceButs *sbuts = (SpaceButs *)(ptr->data);
+       if (ELEM(sbuts->mainb, BCONTEXT_WORLD, BCONTEXT_MATERIAL, BCONTEXT_TEXTURE)) {
+               sbuts->preview = 1;
+       }
+}
+
 static void rna_SpaceProperties_align_set(PointerRNA *ptr, int value)
 {
        SpaceButs *sbuts = (SpaceButs *)(ptr->data);
@@ -1127,10 +1138,6 @@ static EnumPropertyItem *rna_SpaceProperties_texture_context_itemf(bContext *C,
                RNA_enum_items_add_value(&item, &totitem, buttons_texture_context_items, SB_TEXC_MATERIAL);
        }
 
-       if (ED_texture_context_check_particles(C)) {
-               RNA_enum_items_add_value(&item, &totitem, buttons_texture_context_items, SB_TEXC_PARTICLES);
-       }
-
        if (ED_texture_context_check_linestyle(C)) {
                RNA_enum_items_add_value(&item, &totitem, buttons_texture_context_items, SB_TEXC_LINESTYLE);
        }
@@ -1227,7 +1234,7 @@ static void rna_SpaceDopeSheetEditor_action_set(PointerRNA *ptr, PointerRNA valu
        }
 }
 
-static void rna_SpaceDopeSheetEditor_action_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr)
+static void rna_SpaceDopeSheetEditor_action_update(Main *bmain, Scene *scene, PointerRNA *ptr)
 {
        SpaceAction *saction = (SpaceAction *)(ptr->data);
        Object *obact = (scene->basact) ? scene->basact->object : NULL;
@@ -1297,6 +1304,8 @@ static void rna_SpaceDopeSheetEditor_action_update(Main *UNUSED(bmain), Scene *s
                
                /* force depsgraph flush too */
                DAG_id_tag_update(&obact->id, OB_RECALC_OB | OB_RECALC_DATA);
+               /* Update relations as well, so new time source dependency is added. */
+               DAG_relations_tag_update(bmain);
        }
 }
 
@@ -1353,6 +1362,12 @@ static int rna_SpaceGraphEditor_has_ghost_curves_get(PointerRNA *ptr)
        return (BLI_listbase_is_empty(&sipo->ghostCurves) == false);
 }
 
+static void rna_SpaceConsole_rect_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
+{
+       SpaceConsole *sc = ptr->data;
+       WM_main_add_notifier(NC_SPACE | ND_SPACE_CONSOLE | NA_EDITED, sc);
+}
+
 static void rna_Sequencer_view_type_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
 {
        ScrArea *sa = rna_area_from_space(ptr);
@@ -2034,7 +2049,7 @@ static void rna_def_space_outliner(BlenderRNA *brna)
                {SO_ALL_SCENES, "ALL_SCENES", 0, "All Scenes", "Display data-blocks in all scenes"},
                {SO_CUR_SCENE, "CURRENT_SCENE", 0, "Current Scene", "Display data-blocks in current scene"},
                {SO_VISIBLE, "VISIBLE_LAYERS", 0, "Visible Layers", "Display data-blocks in visible layers"},
-               {SO_SELECTED, "SELECTED", 0, "Selected", "Display data-blocks of selected objects"},
+               {SO_SELECTED, "SELECTED", 0, "Selected", "Display data-blocks of selected, visible objects"},
                {SO_ACTIVE, "ACTIVE", 0, "Active", "Display data-blocks of active object"},
                {SO_SAME_TYPE, "SAME_TYPES", 0, "Same Types",
                               "Display data-blocks of all objects of same type as selected object"},
@@ -2392,16 +2407,11 @@ static void rna_def_space_view3d(BlenderRNA *brna)
        RNA_def_property_boolean_sdna(prop, NULL, "ob_centre_cursor", 1);
        RNA_def_property_ui_text(prop, "Lock to Cursor", "3D View center is locked to the cursor's position");
        RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
-       
-       prop = RNA_def_property(srna, "lock_cursor_location", PROP_BOOLEAN, PROP_NONE);
-       RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_LOCK_CURSOR);
-       RNA_def_property_ui_text(prop, "Lock Cursor Location", "3D Cursor location is locked to prevent it from being accidentally moved");
-       RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
 
        prop = RNA_def_property(srna, "viewport_shade", PROP_ENUM, PROP_NONE);
        RNA_def_property_enum_sdna(prop, NULL, "drawtype");
        RNA_def_property_enum_items(prop, rna_enum_viewport_shade_items);
-       RNA_def_property_enum_funcs(prop, "rna_SpaceView3D_viewport_shade_get", NULL,
+       RNA_def_property_enum_funcs(prop, "rna_SpaceView3D_viewport_shade_get", "rna_SpaceView3D_viewport_shade_set",
                                    "rna_SpaceView3D_viewport_shade_itemf");
        RNA_def_property_ui_text(prop, "Viewport Shading", "Method to display/shade objects in the 3D View");
        RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_SpaceView3D_viewport_shade_update");
@@ -2639,7 +2649,7 @@ static void rna_def_space_view3d(BlenderRNA *brna)
                                          "rna_iterator_listbase_end", "rna_SpaceView3D_region_quadviews_get",
                                          NULL, NULL, NULL, NULL);
        RNA_def_property_ui_text(prop, "Quad View Regions", "3D regions (the third one defines quad view settings, "
-                                                           "the forth one is same as 'region_3d')");
+                                                           "the fourth one is same as 'region_3d')");
 
        prop = RNA_def_property(srna, "show_reconstruction", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_SHOW_RECONSTRUCTION);
@@ -2842,7 +2852,7 @@ static void rna_def_space_buttons(BlenderRNA *brna)
        RNA_def_property_enum_items(prop, buttons_context_items);
        RNA_def_property_enum_funcs(prop, NULL, "rna_SpaceProperties_context_set", "rna_SpaceProperties_context_itemf");
        RNA_def_property_ui_text(prop, "Context", "Type of active data to display and edit");
-       RNA_def_property_update(prop, NC_SPACE | ND_SPACE_PROPERTIES, NULL);
+       RNA_def_property_update(prop, NC_SPACE | ND_SPACE_PROPERTIES, "rna_SpaceProperties_context_update");
        
        prop = RNA_def_property(srna, "align", PROP_ENUM, PROP_NONE);
        RNA_def_property_enum_sdna(prop, NULL, "align");
@@ -3644,11 +3654,6 @@ static void rna_def_space_time(BlenderRNA *brna)
        RNA_def_property_ui_text(prop, "Softbody", "Show the active object's softbody point cache");
        RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TIME, NULL);
        
-       prop = RNA_def_property(srna, "cache_particles", PROP_BOOLEAN, PROP_NONE);
-       RNA_def_property_boolean_sdna(prop, NULL, "cache_display", TIME_CACHE_PARTICLES);
-       RNA_def_property_ui_text(prop, "Particles", "Show the active object's particle point cache");
-       RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TIME, NULL);
-       
        prop = RNA_def_property(srna, "cache_cloth", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "cache_display", TIME_CACHE_CLOTH);
        RNA_def_property_ui_text(prop, "Cloth", "Show the active object's cloth point cache");
@@ -3718,7 +3723,7 @@ static void rna_def_space_console(BlenderRNA *brna)
        RNA_def_property_int_sdna(prop, NULL, "lheight");
        RNA_def_property_range(prop, 8, 32);
        RNA_def_property_ui_text(prop, "Font Size", "Font size to use for displaying the text");
-       RNA_def_property_update(prop, NC_SPACE | ND_SPACE_CONSOLE, NULL);
+       RNA_def_property_update(prop, 0, "rna_SpaceConsole_rect_update");
 
 
        prop = RNA_def_property(srna, "select_start", PROP_INT, PROP_UNSIGNED); /* copied from text editor */
@@ -3786,8 +3791,6 @@ static void rna_def_fileselect_params(BlenderRNA *brna)
                {FILTER_ID_MSK, "MASK", ICON_MOD_MASK, "Masks", "Show/hide Mask data-blocks"},
                {FILTER_ID_NT, "NODE_TREE", ICON_NODETREE, "Node Trees", "Show/hide Node Tree data-blocks"},
                {FILTER_ID_OB, "OBJECT", ICON_OBJECT_DATA, "Objects", "Show/hide Object data-blocks"},
-               {FILTER_ID_PA, "PARTICLE_SETTINGS", ICON_PARTICLE_DATA,
-                              "Particles Settings", "Show/hide Particle Settings data-blocks"},
                {FILTER_ID_PAL, "PALETTE", ICON_COLOR, "Palettes", "Show/hide Palette data-blocks"},
                {FILTER_ID_PC, "PAINT_CURVE", ICON_CURVE_BEZCURVE, "Paint Curves", "Show/hide Paint Curve data-blocks"},
                {FILTER_ID_SCE, "SCENE", ICON_SCENE_DATA, "Scenes", "Show/hide Scene data-blocks"},
@@ -3816,7 +3819,7 @@ static void rna_def_fileselect_params(BlenderRNA *brna)
             "IMAGE", ICON_IMAGE_DATA, "Images & Sounds", "Show/hide images, movie clips, sounds and masks"},
                {FILTER_ID_CA | FILTER_ID_LA | FILTER_ID_SPK | FILTER_ID_WO,
             "ENVIRONMENT", ICON_WORLD_DATA, "Environment", "Show/hide worlds, lamps, cameras and speakers"},
-               {FILTER_ID_BR | FILTER_ID_GD | FILTER_ID_PA | FILTER_ID_PAL | FILTER_ID_PC | FILTER_ID_TXT | FILTER_ID_VF,
+               {FILTER_ID_BR | FILTER_ID_GD | FILTER_ID_PAL | FILTER_ID_PC | FILTER_ID_TXT | FILTER_ID_VF,
             "MISC", ICON_GREASEPENCIL, "Miscellaneous", "Show/hide other data types"},
            {0, NULL, 0, NULL, NULL}
        };