Merge branch 'master' into blender2.8
authorJulian Eisel <eiseljulian@gmail.com>
Thu, 22 Sep 2016 23:40:19 +0000 (01:40 +0200)
committerJulian Eisel <eiseljulian@gmail.com>
Thu, 22 Sep 2016 23:40:19 +0000 (01:40 +0200)
Conflicts:
intern/ghost/intern/GHOST_ContextCGL.mm
intern/ghost/intern/GHOST_WindowCocoa.mm
source/blender/makesrna/intern/rna_main.c

35 files changed:
1  2 
intern/cycles/blender/addon/properties.py
intern/cycles/blender/blender_sync.cpp
intern/cycles/blender/blender_util.h
intern/ghost/intern/GHOST_ContextCGL.h
intern/ghost/intern/GHOST_ContextCGL.mm
intern/ghost/intern/GHOST_WindowCocoa.mm
release/scripts/startup/bl_ui/space_view3d.py
source/blender/alembic/intern/abc_mesh.cc
source/blender/blenkernel/intern/library_query.c
source/blender/blenkernel/intern/library_remap.c
source/blender/blenloader/intern/versioning_270.c
source/blender/blenloader/intern/writefile.c
source/blender/editors/animation/anim_channels_defines.c
source/blender/editors/animation/anim_channels_edit.c
source/blender/editors/interface/interface_draw.c
source/blender/editors/interface/interface_templates.c
source/blender/editors/object/object_relations.c
source/blender/editors/render/render_shading.c
source/blender/editors/screen/area.c
source/blender/editors/space_buttons/buttons_context.c
source/blender/editors/space_nla/nla_channels.c
source/blender/editors/space_outliner/outliner_draw.c
source/blender/editors/space_view3d/drawobject.c
source/blender/gpu/intern/gpu_framebuffer.c
source/blender/makesdna/DNA_scene_types.h
source/blender/makesdna/DNA_userdef_types.h
source/blender/makesrna/RNA_access.h
source/blender/makesrna/intern/rna_ID.c
source/blender/makesrna/intern/rna_action.c
source/blender/makesrna/intern/rna_main.c
source/blender/makesrna/intern/rna_nodetree.c
source/blender/makesrna/intern/rna_object.c
source/blender/makesrna/intern/rna_scene.c
source/blender/makesrna/intern/rna_space.c
source/blender/makesrna/intern/rna_userdef.c

index be395b9f253ee639166b1e4dd7a03f1f9becb8a2,4ca202ac40db84ae52a29523a9150e750a28bfc8..e77cc122cc581b54f01c625042e18e1d70433bde
@@@ -143,6 -124,34 +123,28 @@@ bool BlenderSync::sync_recalc(
                }
        }
  
 -              
 -              if(b_ob->is_updated_data()) {
 -                      BL::Object::particle_systems_iterator b_psys;
 -                      for(b_ob->particle_systems.begin(b_psys); b_psys != b_ob->particle_systems.end(); ++b_psys)
 -                              particle_system_map.set_recalc(*b_ob);
 -              }
+       BL::BlendData::objects_iterator b_ob;
+       for(b_data.objects.begin(b_ob); b_ob != b_data.objects.end(); ++b_ob) {
+               if(b_ob->is_updated()) {
+                       object_map.set_recalc(*b_ob);
+                       light_map.set_recalc(*b_ob);
+               }
+               if(object_is_mesh(*b_ob)) {
+                       if(b_ob->is_updated_data() || b_ob->data().is_updated() ||
+                          (dicing_prop_changed && object_subdivision_type(*b_ob, preview, experimental) != Mesh::SUBDIVISION_NONE))
+                       {
+                               BL::ID key = BKE_object_is_modified(*b_ob)? *b_ob: b_ob->data();
+                               mesh_map.set_recalc(key);
+                       }
+               }
+               else if(object_is_light(*b_ob)) {
+                       if(b_ob->is_updated_data() || b_ob->data().is_updated())
+                               light_map.set_recalc(*b_ob);
+               }
+       }
        BL::BlendData::meshes_iterator b_mesh;
  
        for(b_data.meshes.begin(b_mesh); b_mesh != b_data.meshes.end(); ++b_mesh) {
Simple merge
index c2f1ce176adde6400972a9f04631ab0bf425e78d,dd49b81b561ee04acf910b8923e83d83ef716240..8186eaa759d54ea6fc667a85f4816e23b596bab5
@@@ -134,10 -134,10 +134,12 @@@ private
        /** The OpenGL drawing context */
        NSOpenGLContext *m_openGLContext;
  
 +      bool m_coreProfile;
 +
        //static CGLEWContext *s_cglewContext;
  
+       const bool m_debug;
        /** The first created OpenGL context (for sharing display lists) */
        static NSOpenGLContext *s_sharedOpenGLContext;
        static int              s_sharedCount;
index 6a39d76e752c82d70b07c99ff24ed97bffb3a488,03c45f9945bc8ff3f803ac10e073bb1b084af07e..1ab0301f7b247b3221cb11e8d82857514938c8a4
@@@ -59,26 -59,10 +59,27 @@@ GHOST_ContextCGL::GHOST_ContextCGL
          int contextResetNotificationStrategy)
      : GHOST_Context(stereoVisual, numOfAASamples),
        m_openGLView(openGLView),
-       m_openGLContext(nil)
+       m_openGLContext(nil),
+       m_debug(contextFlags)
  {
        assert(openGLView != nil);
 +
 +      // for now be very strict about OpenGL version requested
 +      switch (contextMajorVersion) {
 +              case 2:
 +                      assert(contextMinorVersion == 1);
 +                      assert(contextProfileMask == 0);
 +                      m_coreProfile = false;
 +                      break;
 +              case 3:
 +                      // Apple didn't implement 3.0 or 3.1
 +                      assert(contextMinorVersion == 2);
 +                      assert(contextProfileMask == GL_CONTEXT_CORE_PROFILE_BIT);
 +                      m_coreProfile = true;
 +                      break;
 +              default:
 +                      assert(false);
 +      }
  }
  
  
@@@ -189,12 -173,11 +190,14 @@@ static void makeAttribList
          bool stereoVisual,
          int numOfAASamples,
          bool needAlpha,
-         bool needStencil)
+         bool needStencil,
+         bool softwareGL)
  {
+       attribs.clear();
 +      attribs.push_back(NSOpenGLPFAOpenGLProfile);
 +      attribs.push_back(coreProfile ? NSOpenGLProfileVersion3_2Core : NSOpenGLProfileVersionLegacy);
 +      
        // Pixel Format Attributes for the windowed NSOpenGLContext
        attribs.push_back(NSOpenGLPFADoubleBuffer);
  
        }
        else {
                attribs.push_back(NSOpenGLPFAAccelerated);
+               attribs.push_back(NSOpenGLPFANoRecovery);
        }
  
 -      /* Removed to allow 10.4 builds, and 2 GPUs rendering is not used anyway */
 -      //attribs.push_back(NSOpenGLPFAAllowOfflineRenderers);
 +      attribs.push_back(NSOpenGLPFAAllowOfflineRenderers); // for automatic GPU switching
  
        attribs.push_back(NSOpenGLPFADepthSize);
        attribs.push_back((NSOpenGLPixelFormatAttribute) 32);
@@@ -268,9 -258,12 +277,12 @@@ GHOST_TSuccess GHOST_ContextCGL::initia
        static const bool needStencil = false;
  #endif
  
-       makeAttribList(attribs, m_coreProfile, m_stereoVisual, m_numOfAASamples, needAlpha, needStencil);
+       static bool softwareGL = getenv("BLENDER_SOFTWAREGL"); // command-line argument would be better
+       GLint major = 0, minor = 0;
        NSOpenGLPixelFormat *pixelFormat;
 -      makeAttribList(attribs, m_stereoVisual, m_numOfAASamples, needAlpha, needStencil, softwareGL);
+       // TODO: keep pixel format for subsequent windows/contexts instead of recreating each time
++      makeAttribList(attribs, coreProfile, m_stereoVisual, m_numOfAASamples, needAlpha, needStencil, softwareGL);
  
        pixelFormat = [[NSOpenGLPixelFormat alloc] initWithAttributes:&attribs[0]];
  
                // (Now that I think about it, does WGL really require the code that it has for finding a lesser match?)
  
                attribs.clear();
-               makeAttribList(attribs, m_coreProfile, m_stereoVisual, 0, needAlpha, needStencil);
 -              makeAttribList(attribs, m_stereoVisual, 0, needAlpha, needStencil, softwareGL);
++              makeAttribList(attribs, coreProfile, m_stereoVisual, 0, needAlpha, needStencil, softwareGL);
                pixelFormat = [[NSOpenGLPixelFormat alloc] initWithAttributes:&attribs[0]];
        }
  
Simple merge
Simple merge
index 6686b23e847a6e619ea19358adf7966d49e5e483,d432f086dbaf9ed2d0543a2064d8bdfd6a3dcf2a..59f079b42590c364959e4b531d31e8d86c6d5ac9
@@@ -329,38 -335,39 +329,38 @@@ void RNA_def_main(BlenderRNA *brna
  
        /* plural must match idtypes in readblenentry.c */
        MainCollectionDef lists[] = {
-               {"cameras", "Camera", "rna_Main_camera_begin", "Cameras", "Camera datablocks", RNA_def_main_cameras},
-               {"scenes", "Scene", "rna_Main_scene_begin", "Scenes", "Scene datablocks", RNA_def_main_scenes},
-               {"objects", "Object", "rna_Main_object_begin", "Objects", "Object datablocks", RNA_def_main_objects},
-               {"materials", "Material", "rna_Main_mat_begin", "Materials", "Material datablocks", RNA_def_main_materials},
-               {"node_groups", "NodeTree", "rna_Main_nodetree_begin", "Node Groups", "Node group datablocks", RNA_def_main_node_groups},
-               {"meshes", "Mesh", "rna_Main_mesh_begin", "Meshes", "Mesh datablocks", RNA_def_main_meshes},
-               {"lamps", "Lamp", "rna_Main_lamp_begin", "Lamps", "Lamp datablocks", RNA_def_main_lamps},
-               {"libraries", "Library", "rna_Main_library_begin", "Libraries", "Library datablocks", RNA_def_main_libraries},
-               {"screens", "Screen", "rna_Main_screen_begin", "Screens", "Screen datablocks", RNA_def_main_screens},
-               {"window_managers", "WindowManager", "rna_Main_wm_begin", "Window Managers", "Window manager datablocks", RNA_def_main_window_managers},
-               {"images", "Image", "rna_Main_image_begin", "Images", "Image datablocks", RNA_def_main_images},
-               {"lattices", "Lattice", "rna_Main_latt_begin", "Lattices", "Lattice datablocks", RNA_def_main_lattices},
-               {"curves", "Curve", "rna_Main_curve_begin", "Curves", "Curve datablocks", RNA_def_main_curves},
-               {"metaballs", "MetaBall", "rna_Main_mball_begin", "Metaballs", "Metaball datablocks", RNA_def_main_metaballs},
-               {"fonts", "VectorFont", "rna_Main_font_begin", "Vector Fonts", "Vector font datablocks", RNA_def_main_fonts},
-               {"textures", "Texture", "rna_Main_tex_begin", "Textures", "Texture datablocks", RNA_def_main_textures},
-               {"brushes", "Brush", "rna_Main_brush_begin", "Brushes", "Brush datablocks", RNA_def_main_brushes},
-               {"worlds", "World", "rna_Main_world_begin", "Worlds", "World datablocks", RNA_def_main_worlds},
-               {"groups", "Group", "rna_Main_group_begin", "Groups", "Group datablocks", RNA_def_main_groups},
-               {"shape_keys", "Key", "rna_Main_key_begin", "Shape Keys", "Shape Key datablocks", NULL},
-               {"texts", "Text", "rna_Main_text_begin", "Texts", "Text datablocks", RNA_def_main_texts},
-               {"speakers", "Speaker", "rna_Main_speaker_begin", "Speakers", "Speaker datablocks", RNA_def_main_speakers},
-               {"sounds", "Sound", "rna_Main_sound_begin", "Sounds", "Sound datablocks", RNA_def_main_sounds},
-               {"armatures", "Armature", "rna_Main_armature_begin", "Armatures", "Armature datablocks", RNA_def_main_armatures},
-               {"actions", "Action", "rna_Main_action_begin", "Actions", "Action datablocks", RNA_def_main_actions},
-               {"palettes", "Palette", "rna_Main_palettes_begin", "Palettes", "Palette datablocks", RNA_def_main_palettes},
-               {"grease_pencil", "GreasePencil", "rna_Main_gpencil_begin", "Grease Pencil", "Grease Pencil datablocks", RNA_def_main_gpencil},
-               {"movieclips", "MovieClip", "rna_Main_movieclips_begin", "Movie Clips", "Movie Clip datablocks", RNA_def_main_movieclips},
-               {"masks", "Mask", "rna_Main_masks_begin", "Masks", "Masks datablocks", RNA_def_main_masks},
-               {"linestyles", "FreestyleLineStyle", "rna_Main_linestyle_begin", "Line Styles", "Line Style datablocks", RNA_def_main_linestyles},
-               {"cache_files", "CacheFile", "rna_Main_cachefiles_begin", "Cache Files", "Cache Files datablocks", RNA_def_main_cachefiles},
-               {"paint_curves", "PaintCurve", "rna_Main_paintcurves_begin", "Paint Curves", "Paint Curves datablocks", RNA_def_main_paintcurves},
+               {"cameras", "Camera", "rna_Main_camera_begin", "Cameras", "Camera data-blocks", RNA_def_main_cameras},
+               {"scenes", "Scene", "rna_Main_scene_begin", "Scenes", "Scene data-blocks", RNA_def_main_scenes},
+               {"objects", "Object", "rna_Main_object_begin", "Objects", "Object data-blocks", RNA_def_main_objects},
+               {"materials", "Material", "rna_Main_mat_begin", "Materials", "Material data-blocks", RNA_def_main_materials},
+               {"node_groups", "NodeTree", "rna_Main_nodetree_begin", "Node Groups", "Node group data-blocks", RNA_def_main_node_groups},
+               {"meshes", "Mesh", "rna_Main_mesh_begin", "Meshes", "Mesh data-blocks", RNA_def_main_meshes},
+               {"lamps", "Lamp", "rna_Main_lamp_begin", "Lamps", "Lamp data-blocks", RNA_def_main_lamps},
+               {"libraries", "Library", "rna_Main_library_begin", "Libraries", "Library data-blocks", RNA_def_main_libraries},
+               {"screens", "Screen", "rna_Main_screen_begin", "Screens", "Screen data-blocks", RNA_def_main_screens},
+               {"window_managers", "WindowManager", "rna_Main_wm_begin", "Window Managers", "Window manager data-blocks", RNA_def_main_window_managers},
+               {"images", "Image", "rna_Main_image_begin", "Images", "Image data-blocks", RNA_def_main_images},
+               {"lattices", "Lattice", "rna_Main_latt_begin", "Lattices", "Lattice data-blocks", RNA_def_main_lattices},
+               {"curves", "Curve", "rna_Main_curve_begin", "Curves", "Curve data-blocks", RNA_def_main_curves},
+               {"metaballs", "MetaBall", "rna_Main_mball_begin", "Metaballs", "Metaball data-blocks", RNA_def_main_metaballs},
+               {"fonts", "VectorFont", "rna_Main_font_begin", "Vector Fonts", "Vector font data-blocks", RNA_def_main_fonts},
+               {"textures", "Texture", "rna_Main_tex_begin", "Textures", "Texture data-blocks", RNA_def_main_textures},
+               {"brushes", "Brush", "rna_Main_brush_begin", "Brushes", "Brush data-blocks", RNA_def_main_brushes},
+               {"worlds", "World", "rna_Main_world_begin", "Worlds", "World data-blocks", RNA_def_main_worlds},
+               {"groups", "Group", "rna_Main_group_begin", "Groups", "Group data-blocks", RNA_def_main_groups},
+               {"shape_keys", "Key", "rna_Main_key_begin", "Shape Keys", "Shape Key data-blocks", NULL},
+               {"texts", "Text", "rna_Main_text_begin", "Texts", "Text data-blocks", RNA_def_main_texts},
+               {"speakers", "Speaker", "rna_Main_speaker_begin", "Speakers", "Speaker data-blocks", RNA_def_main_speakers},
+               {"sounds", "Sound", "rna_Main_sound_begin", "Sounds", "Sound data-blocks", RNA_def_main_sounds},
+               {"armatures", "Armature", "rna_Main_armature_begin", "Armatures", "Armature data-blocks", RNA_def_main_armatures},
+               {"actions", "Action", "rna_Main_action_begin", "Actions", "Action data-blocks", RNA_def_main_actions},
 -              {"particles", "ParticleSettings", "rna_Main_particle_begin", "Particles", "Particle data-blocks", RNA_def_main_particles},
+               {"palettes", "Palette", "rna_Main_palettes_begin", "Palettes", "Palette data-blocks", RNA_def_main_palettes},
+               {"grease_pencil", "GreasePencil", "rna_Main_gpencil_begin", "Grease Pencil", "Grease Pencil data-blocks", RNA_def_main_gpencil},
+               {"movieclips", "MovieClip", "rna_Main_movieclips_begin", "Movie Clips", "Movie Clip data-blocks", RNA_def_main_movieclips},
+               {"masks", "Mask", "rna_Main_masks_begin", "Masks", "Masks data-blocks", RNA_def_main_masks},
+               {"linestyles", "FreestyleLineStyle", "rna_Main_linestyle_begin", "Line Styles", "Line Style data-blocks", RNA_def_main_linestyles},
+               {"cache_files", "CacheFile", "rna_Main_cachefiles_begin", "Cache Files", "Cache Files data-blocks", RNA_def_main_cachefiles},
+               {"paint_curves", "PaintCurve", "rna_Main_paintcurves_begin", "Paint Curves", "Paint Curves data-blocks", RNA_def_main_paintcurves},
                {NULL, NULL, NULL, NULL, NULL, NULL}
        };