Commit: ff2a74906a7b70625a4e941c6a805f7734491204 Author: Lukas Tönne Date: Thu Dec 1 10:29:46 2016 +0100 Branches: blender2.8 https://developer.blender.org/rBff2a74906a7b70625a4e941c6a805f7734491204
Merge branch 'master' into blender2.8 =================================================================== =================================================================== diff --cc intern/cycles/blender/addon/ui.py index 7ed8c5f,3f7730e..9573156 --- a/intern/cycles/blender/addon/ui.py +++ b/intern/cycles/blender/addon/ui.py @@@ -1523,22 -1587,40 +1525,35 @@@ class CyclesScene_PT_simplify(CyclesBut cscene = scene.cycles layout.active = rd.use_simplify - split = layout.split() - col = split.column() - col.label(text="Viewport:") - col.prop(rd, "simplify_subdivision", text="Subdivision") + col = layout.column(align=True) + col.label(text="Subdivision") + row = col.row(align=True) + row.prop(rd, "simplify_subdivision", text="Viewport") + row.prop(rd, "simplify_subdivision_render", text="Render") - col = split.column() - col.label(text="Render:") - col.prop(rd, "simplify_subdivision_render", text="Subdivision") - col = layout.column(align=True) - col.label(text="Child Particles") - row = col.row(align=True) - row.prop(rd, "simplify_child_particles", text="Viewport") - row.prop(rd, "simplify_child_particles_render", text="Render") - col = layout.column() + col = layout.column(align=True) + split = col.split() + sub = split.column() + sub.label(text="Texture Limit Viewport") + sub.prop(cscene, "texture_limit", text="") + sub = split.column() + sub.label(text="Texture Limit Render") + sub.prop(cscene, "texture_limit_render", text="") + + split = layout.split() + col = split.column() col.prop(cscene, "use_camera_cull") - subsub = col.column() - subsub.active = cscene.use_camera_cull - subsub.prop(cscene, "camera_cull_margin") + row = col.row() + row.active = cscene.use_camera_cull + row.prop(cscene, "camera_cull_margin") + col = split.column() + col.prop(cscene, "use_distance_cull") + row = col.row() + row.active = cscene.use_distance_cull + row.prop(cscene, "distance_cull_margin", text="Distance") def draw_device(self, context): scene = context.scene diff --cc intern/cycles/blender/blender_object.cpp index 16e32cb,681a22e..0d1b2fc --- a/intern/cycles/blender/blender_object.cpp +++ b/intern/cycles/blender/blender_object.cpp @@@ -586,16 -691,22 +662,15 @@@ void BlenderSync::sync_objects(BL::Spac BL::Array<int, OBJECT_PERSISTENT_ID_SIZE> persistent_id = b_dup->persistent_id(); /* sync object and mesh or light data */ - Object *object = sync_object(b_ob, - persistent_id.data, - *b_dup, - tfm, - ob_layer, - motion_time, - hide_tris, - culling, - &use_portal); - - /* sync possible particle data, note particle_id - * starts counting at 1, first is dummy particle */ - if(!motion && object) { - sync_dupli_particle(b_ob, *b_dup, object); - } - + sync_object(b_ob, + persistent_id.data, + *b_dup, + tfm, + ob_layer, + motion_time, + hide_tris, - use_camera_cull, - camera_cull_margin, ++ culling, + &use_portal); } } diff --cc source/blender/blenlib/BLI_math_matrix.h index fc4bca1,d0dfad2..029f687 --- a/source/blender/blenlib/BLI_math_matrix.h +++ b/source/blender/blenlib/BLI_math_matrix.h @@@ -232,15 -219,14 +232,14 @@@ void mat4_to_size(float r[3], const flo void translate_m4(float mat[4][4], float tx, float ty, float tz); void rotate_m4(float mat[4][4], const char axis, const float angle); - void rotate_m2(float mat[2][2], const float angle); void transform_pivot_set_m4(float mat[4][4], const float pivot[3]); -void mat3_to_rot_size(float rot[3][3], float size[3], float mat3[3][3]); -void mat4_to_loc_rot_size(float loc[3], float rot[3][3], float size[3], float wmat[4][4]); -void mat4_to_loc_quat(float loc[3], float quat[4], float wmat[4][4]); -void mat4_decompose(float loc[3], float quat[4], float size[3], float wmat[4][4]); +void mat3_to_rot_size(float rot[3][3], float size[3], const float mat3[3][3]); +void mat4_to_loc_rot_size(float loc[3], float rot[3][3], float size[3], const float wmat[4][4]); +void mat4_to_loc_quat(float loc[3], float quat[4], const float wmat[4][4]); +void mat4_decompose(float loc[3], float quat[4], float size[3], const float wmat[4][4]); -void mat3_polar_decompose(float mat3[3][3], float r_U[3][3], float r_P[3][3]); +void mat3_polar_decompose(const float mat3[3][3], float r_U[3][3], float r_P[3][3]); void loc_eul_size_to_mat4(float R[4][4], const float loc[3], const float eul[3], const float size[3]); diff --cc source/blender/blenlib/intern/math_matrix.c index d95371b,9a60c67..50b92f5 --- a/source/blender/blenlib/intern/math_matrix.c +++ b/source/blender/blenlib/intern/math_matrix.c @@@ -1680,12 -1625,17 +1680,18 @@@ void translate_m4(float mat[4][4], floa mat[3][2] += (Tx * mat[0][2] + Ty * mat[1][2] + Tz * mat[2][2]); } +/* TODO: enum for axis? */ + /** + * Rotate a matrix in-place. + * + * \note To create a new rotation matrix see: + * #axis_angle_to_mat4_single, #axis_angle_to_mat3_single, #angle_to_mat2 + * (axis & angle args are compatible). + */ void rotate_m4(float mat[4][4], const char axis, const float angle) { - int col; - float temp[4] = {0.0f, 0.0f, 0.0f, 0.0f}; - float cosine, sine; + const float angle_cos = cosf(angle); + const float angle_sin = sinf(angle); assert(axis >= 'X' && axis <= 'Z'); diff --cc source/blender/editors/space_view3d/view3d_draw.c index 9184e47,f23e587..2012097 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@@ -70,232 -104,367 +70,233 @@@ #include "view3d_intern.h" /* own include */ /* prototypes */ -static void view3d_stereo3d_setup(Scene *scene, View3D *v3d, ARegion *ar); -static void view3d_stereo3d_setup_offscreen(Scene *scene, View3D *v3d, ARegion *ar, - float winmat[4][4], const char *viewname); - -/* handy utility for drawing shapes in the viewport for arbitrary code. - * could add lines and points too */ -// #define DEBUG_DRAW -#ifdef DEBUG_DRAW -static void bl_debug_draw(void); -/* add these locally when using these functions for testing */ -extern void bl_debug_draw_quad_clear(void); -extern void bl_debug_draw_quad_add(const float v0[3], const float v1[3], const float v2[3], const float v3[3]); -extern void bl_debug_draw_edge_add(const float v0[3], const float v1[3]); -extern void bl_debug_color_set(const unsigned int col); -#endif +static void draw_all_objects(const bContext *C, ARegion *ar, const bool only_depth, const bool use_depth); -void circf(float x, float y, float rad) -{ - GLUquadricObj *qobj = gluNewQuadric(); - - gluQuadricDrawStyle(qobj, GLU_FILL); - - glPushMatrix(); - - glTranslatef(x, y, 0.0); - - gluDisk(qobj, 0.0, rad, 32, 1); - - glPopMatrix(); - - gluDeleteQuadric(qobj); -} +typedef struct DrawData { + rcti border_rect; + bool render_border; + bool clip_border; + bool is_render; + GPUViewport *viewport; +} DrawData; -void circ(float x, float y, float rad) +static void view3d_draw_data_init(const bContext *C, ARegion *ar, RegionView3D *rv3d, DrawData *draw_data) { - GLUquadricObj *qobj = gluNewQuadric(); - - gluQuadricDrawStyle(qobj, GLU_SILHOUETTE); - - glPushMatrix(); - - glTranslatef(x, y, 0.0); - - gluDisk(qobj, 0.0, rad, 32, 1); - - glPopMatrix(); - - gluDeleteQuadric(qobj); -} - + Scene *scene = CTX_data_scene(C); + View3D *v3d = CTX_wm_view3d(C); -/* ********* custom clipping *********** */ + draw_data->is_render = (v3d->drawtype == OB_RENDER); -static void view3d_draw_clipping(RegionView3D *rv3d) -{ - BoundBox *bb = rv3d->clipbb; - - if (bb) { - const unsigned int clipping_index[6][4] = { - {0, 1, 2, 3}, - {0, 4, 5, 1}, - {4, 7, 6, 5}, - {7, 3, 2, 6}, - {1, 5, 6, 2}, - {7, 4, 0, 3} - }; - - /* fill in zero alpha for rendering & re-projection [#31530] */ - unsigned char col[4]; - UI_GetThemeColor4ubv(TH_V3D_CLIPPING_BORDER, col); - glColor4ubv(col); - - glEnable(GL_BLEND); - glEnableClientState(GL_VERTEX_ARRAY); - glVertexPointer(3, GL_FLOAT, 0, bb->vec); - glDrawElements(GL_QUADS, sizeof(clipping_index) / sizeof(unsigned int), GL_UNSIGNED_INT, clipping_index); - glDisableClientState(GL_VERTEX_ARRAY); - glDisable(GL_BLEND); - } -} + draw_data->render_border = ED_view3d_calc_render_border(scene, v3d, ar, &draw_data->border_rect); + draw_data->clip_border = (draw_data->render_border && !BLI_rcti_compare(&ar->drawrct, &draw_data->border_rect)); -void ED_view3d_clipping_set(RegionView3D *rv3d) -{ - double plane[4]; - const unsigned int tot = (rv3d->viewlock & RV3D_BOXCLIP) ? 4 : 6; - unsigned int a; - - for (a = 0; a < tot; a++) { - copy_v4db_v4fl(plane, rv3d->clip[a]); - glClipPlane(GL_CLIP_PLANE0 + a, plane); - glEnable(GL_CLIP_PLANE0 + a); - } + draw_data->viewport = rv3d->viewport; } -/* use these to temp disable/enable clipping when 'rv3d->rflag & RV3D_CLIPPING' is set */ -void ED_view3d_clipping_disable(void) -{ - unsigned int a; +/* ******************** general functions ***************** */ - for (a = 0; a < 6; a++) { - glDisable(GL_CLIP_PLANE0 + a); - } -} -void ED_view3d_clipping_enable(void) +static bool use_depth_doit(Scene *scene, View3D *v3d) { - unsigned int a; + if (v3d->drawtype > OB_WIRE) + return true; - for (a = 0; a < 6; a++) { - glEnable(GL_CLIP_PLANE0 + a); + /* special case (depth for wire color) */ + if (v3d->drawtype <= OB_WIRE) { + if (scene->obedit && scene->obedit->type == OB_MESH) { + @@ Diff output truncated at 10240 characters. @@ _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs