[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [47568] branches/soc-2011-tomato: Merging r47535 through r47566 from trunk into soc-2011-tomato
Sergey Sharybin
sergey.vfx at gmail.com
Thu Jun 7 11:32:46 CEST 2012
Revision: 47568
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=47568
Author: nazgul
Date: 2012-06-07 09:32:39 +0000 (Thu, 07 Jun 2012)
Log Message:
-----------
Merging r47535 through r47566 from trunk into soc-2011-tomato
Revision Links:
--------------
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=47535
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=47566
Modified Paths:
--------------
branches/soc-2011-tomato/CMakeLists.txt
branches/soc-2011-tomato/intern/container/CTR_UHeap.h
branches/soc-2011-tomato/intern/cycles/blender/blender_camera.cpp
branches/soc-2011-tomato/intern/cycles/blender/blender_session.cpp
branches/soc-2011-tomato/intern/cycles/blender/blender_sync.h
branches/soc-2011-tomato/intern/cycles/kernel/kernel_light.h
branches/soc-2011-tomato/intern/cycles/kernel/kernel_path.h
branches/soc-2011-tomato/intern/cycles/render/buffers.cpp
branches/soc-2011-tomato/intern/cycles/render/camera.cpp
branches/soc-2011-tomato/intern/cycles/render/camera.h
branches/soc-2011-tomato/intern/cycles/render/session.cpp
branches/soc-2011-tomato/intern/cycles/util/util_system.cpp
branches/soc-2011-tomato/intern/ghost/GHOST_Types.h
branches/soc-2011-tomato/intern/itasc/Armature.cpp
branches/soc-2011-tomato/intern/itasc/CMakeLists.txt
branches/soc-2011-tomato/intern/itasc/Distance.cpp
branches/soc-2011-tomato/intern/itasc/SConscript
branches/soc-2011-tomato/intern/itasc/kdl/jntarray.cpp
branches/soc-2011-tomato/intern/itasc/kdl/jntarray.hpp
branches/soc-2011-tomato/intern/itasc/kdl/joint.cpp
branches/soc-2011-tomato/intern/itasc/kdl/joint.hpp
branches/soc-2011-tomato/intern/itasc/kdl/kinfam_io.cpp
branches/soc-2011-tomato/intern/itasc/kdl/segment.cpp
branches/soc-2011-tomato/intern/itasc/kdl/segment.hpp
branches/soc-2011-tomato/intern/itasc/kdl/utilities/utility.h
branches/soc-2011-tomato/intern/mikktspace/mikktspace.c
branches/soc-2011-tomato/intern/mikktspace/mikktspace.h
branches/soc-2011-tomato/source/blender/blenkernel/BKE_cloth.h
branches/soc-2011-tomato/source/blender/blenkernel/BKE_collision.h
branches/soc-2011-tomato/source/blender/blenkernel/BKE_customdata.h
branches/soc-2011-tomato/source/blender/blenkernel/BKE_mask.h
branches/soc-2011-tomato/source/blender/blenkernel/BKE_mesh.h
branches/soc-2011-tomato/source/blender/blenkernel/BKE_node.h
branches/soc-2011-tomato/source/blender/blenkernel/BKE_sketch.h
branches/soc-2011-tomato/source/blender/blenkernel/intern/customdata.c
branches/soc-2011-tomato/source/blender/blenkernel/intern/implicit.c
branches/soc-2011-tomato/source/blender/blenkernel/intern/mask.c
branches/soc-2011-tomato/source/blender/blenkernel/intern/mesh.c
branches/soc-2011-tomato/source/blender/blenkernel/intern/object.c
branches/soc-2011-tomato/source/blender/blenkernel/intern/particle_system.c
branches/soc-2011-tomato/source/blender/blenkernel/intern/scene.c
branches/soc-2011-tomato/source/blender/blenkernel/intern/seqcache.c
branches/soc-2011-tomato/source/blender/blenloader/intern/readfile.c
branches/soc-2011-tomato/source/blender/bmesh/intern/bmesh_marking.h
branches/soc-2011-tomato/source/blender/editors/armature/editarmature_retarget.c
branches/soc-2011-tomato/source/blender/editors/include/ED_transform.h
branches/soc-2011-tomato/source/blender/editors/mask/mask_add.c
branches/soc-2011-tomato/source/blender/editors/space_file/filelist.c
branches/soc-2011-tomato/source/blender/editors/space_file/filelist.h
branches/soc-2011-tomato/source/blender/editors/space_node/node_intern.h
branches/soc-2011-tomato/source/blender/editors/space_outliner/outliner_draw.c
branches/soc-2011-tomato/source/blender/editors/space_outliner/outliner_tools.c
branches/soc-2011-tomato/source/blender/editors/space_view3d/drawarmature.c
branches/soc-2011-tomato/source/blender/editors/space_view3d/drawmesh.c
branches/soc-2011-tomato/source/blender/editors/space_view3d/drawobject.c
branches/soc-2011-tomato/source/blender/editors/space_view3d/view3d_draw.c
branches/soc-2011-tomato/source/blender/editors/transform/transform.c
branches/soc-2011-tomato/source/blender/editors/transform/transform_conversions.c
branches/soc-2011-tomato/source/blender/editors/transform/transform_ops.c
branches/soc-2011-tomato/source/blender/gpu/shaders/gpu_shader_material.glsl
branches/soc-2011-tomato/source/blender/ikplugin/CMakeLists.txt
branches/soc-2011-tomato/source/blender/ikplugin/SConscript
branches/soc-2011-tomato/source/blender/ikplugin/intern/itasc_plugin.cpp
branches/soc-2011-tomato/source/blender/imbuf/intern/openexr/openexr_api.cpp
branches/soc-2011-tomato/source/blender/makesdna/DNA_actuator_types.h
branches/soc-2011-tomato/source/blender/makesdna/DNA_cloth_types.h
branches/soc-2011-tomato/source/blender/makesdna/DNA_listBase.h
branches/soc-2011-tomato/source/blender/makesdna/DNA_mask_types.h
branches/soc-2011-tomato/source/blender/makesdna/DNA_particle_types.h
branches/soc-2011-tomato/source/blender/python/intern/bpy_interface.c
branches/soc-2011-tomato/source/blender/render/extern/include/RE_shader_ext.h
branches/soc-2011-tomato/source/blender/render/intern/include/render_types.h
branches/soc-2011-tomato/source/blender/render/intern/include/rendercore.h
branches/soc-2011-tomato/source/blender/render/intern/include/sunsky.h
branches/soc-2011-tomato/source/blender/render/intern/include/voxeldata.h
branches/soc-2011-tomato/source/blender/render/intern/include/zbuf.h
branches/soc-2011-tomato/source/blender/render/intern/raytrace/rayobject_instance.cpp
branches/soc-2011-tomato/source/blender/render/intern/source/convertblender.c
branches/soc-2011-tomato/source/blender/render/intern/source/pointdensity.c
branches/soc-2011-tomato/source/blender/windowmanager/WM_types.h
branches/soc-2011-tomato/source/blender/windowmanager/intern/wm_window.c
branches/soc-2011-tomato/source/blenderplayer/CMakeLists.txt
branches/soc-2011-tomato/source/gameengine/Converter/BL_ArmatureObject.cpp
branches/soc-2011-tomato/source/gameengine/Converter/BL_BlenderDataConversion.cpp
branches/soc-2011-tomato/source/gameengine/Converter/BL_DeformableGameObject.cpp
branches/soc-2011-tomato/source/gameengine/Converter/BL_ShapeActionActuator.cpp
branches/soc-2011-tomato/source/gameengine/Converter/KX_BlenderSceneConverter.cpp
branches/soc-2011-tomato/source/gameengine/Expressions/PyObjectPlus.h
branches/soc-2011-tomato/source/gameengine/Expressions/Value.h
branches/soc-2011-tomato/source/gameengine/GameLogic/Joystick/SCA_Joystick.h
branches/soc-2011-tomato/source/gameengine/GameLogic/SCA_JoystickSensor.cpp
branches/soc-2011-tomato/source/gameengine/GameLogic/SCA_JoystickSensor.h
branches/soc-2011-tomato/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
branches/soc-2011-tomato/source/gameengine/GamePlayer/xembed/blender_plugin_types.h
branches/soc-2011-tomato/source/gameengine/Ketsji/KX_BulletPhysicsController.h
branches/soc-2011-tomato/source/gameengine/Ketsji/KX_Dome.cpp
branches/soc-2011-tomato/source/gameengine/Ketsji/KX_GameObject.h
branches/soc-2011-tomato/source/gameengine/Ketsji/KX_IpoActuator.cpp
branches/soc-2011-tomato/source/gameengine/Ketsji/KX_KetsjiEngine.h
branches/soc-2011-tomato/source/gameengine/Ketsji/KX_LightIpoSGController.h
branches/soc-2011-tomato/source/gameengine/Ketsji/KX_MaterialIpoController.h
branches/soc-2011-tomato/source/gameengine/Ketsji/KX_ObColorIpoSGController.h
branches/soc-2011-tomato/source/gameengine/Ketsji/KX_SoundActuator.h
branches/soc-2011-tomato/source/gameengine/Ketsji/KX_WorldIpoController.h
branches/soc-2011-tomato/source/gameengine/Rasterizer/RAS_LightObject.h
branches/soc-2011-tomato/source/gameengine/SceneGraph/SG_ParentRelation.h
Property Changed:
----------------
branches/soc-2011-tomato/
branches/soc-2011-tomato/doc/python_api/examples/bpy.types.Object.py
branches/soc-2011-tomato/source/blender/editors/interface/interface.c
branches/soc-2011-tomato/source/blender/editors/space_outliner/
Property changes on: branches/soc-2011-tomato
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/ge_harmony:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/branches/soc-2011-cucumber:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/vgroup_modifiers:38694-39989
/trunk/blender:36831-47534
+ /branches/ge_harmony:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/branches/soc-2011-cucumber:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/vgroup_modifiers:38694-39989
/trunk/blender:36831-47566
Modified: branches/soc-2011-tomato/CMakeLists.txt
===================================================================
--- branches/soc-2011-tomato/CMakeLists.txt 2012-06-07 09:29:06 UTC (rev 47567)
+++ branches/soc-2011-tomato/CMakeLists.txt 2012-06-07 09:32:39 UTC (rev 47568)
@@ -1,4 +1,3 @@
-set(Boost_DEBUG TRUE)
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
Property changes on: branches/soc-2011-tomato/doc/python_api/examples/bpy.types.Object.py
___________________________________________________________________
Added: svn:eol-style
+ native
Modified: branches/soc-2011-tomato/intern/container/CTR_UHeap.h
===================================================================
--- branches/soc-2011-tomato/intern/container/CTR_UHeap.h 2012-06-07 09:29:06 UTC (rev 47567)
+++ branches/soc-2011-tomato/intern/container/CTR_UHeap.h 2012-06-07 09:32:39 UTC (rev 47568)
@@ -56,7 +56,7 @@
public :
int &
HeapPos(
- ){
+ ) {
return m_ind;
};
float &
@@ -93,7 +93,7 @@
};
~CTR_UHeapable(
- ){
+ ) {
};
};
@@ -214,7 +214,7 @@
HeapType *base,
int i,
int j
- ){
+ ) {
std::swap(m_vector[i],m_vector[j]);
CTR_UHeapable *heap_i = base + m_vector[i];
Modified: branches/soc-2011-tomato/intern/cycles/blender/blender_camera.cpp
===================================================================
--- branches/soc-2011-tomato/intern/cycles/blender/blender_camera.cpp 2012-06-07 09:29:06 UTC (rev 47567)
+++ branches/soc-2011-tomato/intern/cycles/blender/blender_camera.cpp 2012-06-07 09:32:39 UTC (rev 47568)
@@ -56,6 +56,11 @@
float sensor_width;
float sensor_height;
+ float border_left;
+ float border_right;
+ float border_bottom;
+ float border_top;
+
Transform matrix;
};
@@ -70,6 +75,8 @@
bcam->sensor_height = 18.0f;
bcam->sensor_fit = BlenderCamera::AUTO;
bcam->shuttertime = 1.0f;
+ bcam->border_right = 1.0f;
+ bcam->border_top = 1.0f;
}
static float blender_camera_focal_distance(BL::Object b_ob, BL::Camera b_camera)
@@ -188,86 +195,95 @@
return transform_clear_scale(result);
}
-static void blender_camera_sync(Camera *cam, BlenderCamera *bcam, int width, int height)
+static void blender_camera_viewplane(BlenderCamera *bcam, int width, int height,
+ float *left, float *right, float *bottom, float *top, float *aspectratio, float *sensor_size)
{
- /* copy camera to compare later */
- Camera prevcam = *cam;
-
/* dimensions */
float xratio = width*bcam->pixelaspect.x;
float yratio = height*bcam->pixelaspect.y;
/* compute x/y aspect and ratio */
- float aspectratio, xaspect, yaspect;
+ float xaspect, yaspect;
/* sensor fitting */
bool horizontal_fit;
- float sensor_size;
- cam->sensorwidth = bcam->sensor_width;
- cam->sensorheight = bcam->sensor_height;
-
if(bcam->sensor_fit == BlenderCamera::AUTO) {
horizontal_fit = (xratio > yratio);
- sensor_size = bcam->sensor_width;
+ *sensor_size = bcam->sensor_width;
}
else if(bcam->sensor_fit == BlenderCamera::HORIZONTAL) {
horizontal_fit = true;
- sensor_size = bcam->sensor_width;
+ *sensor_size = bcam->sensor_width;
}
else {
horizontal_fit = false;
- sensor_size = bcam->sensor_height;
+ *sensor_size = bcam->sensor_height;
}
if(horizontal_fit) {
- aspectratio= xratio/yratio;
- xaspect= aspectratio;
+ *aspectratio= xratio/yratio;
+ xaspect= *aspectratio;
yaspect= 1.0f;
}
else {
- aspectratio= yratio/xratio;
+ *aspectratio= yratio/xratio;
xaspect= 1.0f;
- yaspect= aspectratio;
+ yaspect= *aspectratio;
}
/* modify aspect for orthographic scale */
if(bcam->type == CAMERA_ORTHOGRAPHIC) {
- xaspect = xaspect*bcam->ortho_scale/(aspectratio*2.0f);
- yaspect = yaspect*bcam->ortho_scale/(aspectratio*2.0f);
- aspectratio = bcam->ortho_scale/2.0f;
+ xaspect = xaspect*bcam->ortho_scale/(*aspectratio*2.0f);
+ yaspect = yaspect*bcam->ortho_scale/(*aspectratio*2.0f);
+ *aspectratio = bcam->ortho_scale/2.0f;
}
if(bcam->type == CAMERA_PANORAMA) {
/* set viewplane */
- cam->left = 0.0f;
- cam->right = 1.0f;
- cam->bottom = 0.0f;
- cam->top = 1.0f;
+ *left = 0.0f;
+ *right = 1.0f;
+ *bottom = 0.0f;
+ *top = 1.0f;
}
else {
/* set viewplane */
- cam->left = -xaspect;
- cam->right = xaspect;
- cam->bottom = -yaspect;
- cam->top = yaspect;
+ *left = -xaspect;
+ *right = xaspect;
+ *bottom = -yaspect;
+ *top = yaspect;
/* zoom for 3d camera view */
- cam->left *= bcam->zoom;
- cam->right *= bcam->zoom;
- cam->bottom *= bcam->zoom;
- cam->top *= bcam->zoom;
+ *left *= bcam->zoom;
+ *right *= bcam->zoom;
+ *bottom *= bcam->zoom;
+ *top *= bcam->zoom;
/* modify viewplane with camera shift and 3d camera view offset */
- float dx = 2.0f*(aspectratio*bcam->shift.x + bcam->offset.x*xaspect*2.0f);
- float dy = 2.0f*(aspectratio*bcam->shift.y + bcam->offset.y*yaspect*2.0f);
+ float dx = 2.0f*(*aspectratio*bcam->shift.x + bcam->offset.x*xaspect*2.0f);
+ float dy = 2.0f*(*aspectratio*bcam->shift.y + bcam->offset.y*yaspect*2.0f);
- cam->left += dx;
- cam->right += dx;
- cam->bottom += dy;
- cam->top += dy;
+ *left += dx;
+ *right += dx;
+ *bottom += dy;
+ *top += dy;
}
+}
+static void blender_camera_sync(Camera *cam, BlenderCamera *bcam, int width, int height)
+{
+ /* copy camera to compare later */
+ Camera prevcam = *cam;
+ float aspectratio, sensor_size;
+
+ /* viewplane */
+ blender_camera_viewplane(bcam, width, height,
+ &cam->left, &cam->right, &cam->bottom, &cam->top, &aspectratio, &sensor_size);
+
+ /* sensor */
+ cam->sensorwidth = bcam->sensor_width;
+ cam->sensorheight = bcam->sensor_height;
+
/* clipping distances */
cam->nearclip = bcam->nearclip;
cam->farclip = bcam->farclip;
@@ -294,6 +310,12 @@
cam->use_motion = false;
cam->shuttertime = bcam->shuttertime;
+ /* border */
+ cam->border_left = bcam->border_left;
+ cam->border_right = bcam->border_right;
+ cam->border_bottom = bcam->border_bottom;
+ cam->border_top = bcam->border_top;
+
/* set update flag */
if(cam->modified(prevcam))
cam->tag_update();
@@ -313,6 +335,14 @@
bcam.pixelaspect.y = r.pixel_aspect_y();
bcam.shuttertime = r.motion_blur_shutter();
+ /* border */
+ if(r.use_border()) {
+ bcam.border_left = r.border_min_x();
+ bcam.border_right = r.border_max_x();
+ bcam.border_bottom = r.border_min_y();
+ bcam.border_top = r.border_max_y();
+ }
+
/* camera object */
BL::Object b_ob = b_scene.camera();
@@ -348,67 +378,142 @@
/* Sync 3D View Camera */
-void BlenderSync::sync_view(BL::SpaceView3D b_v3d, BL::RegionView3D b_rv3d, int width, int height)
+static void blender_camera_from_view(BlenderCamera *bcam, BL::Scene b_scene, BL::SpaceView3D b_v3d, BL::RegionView3D b_rv3d, int width, int height)
{
- BlenderCamera bcam;
- blender_camera_init(&bcam);
-
/* 3d view parameters */
- bcam.nearclip = b_v3d.clip_start();
- bcam.farclip = b_v3d.clip_end();
- bcam.lens = b_v3d.lens();
- bcam.shuttertime = b_scene.render().motion_blur_shutter();
+ bcam->nearclip = b_v3d.clip_start();
+ bcam->farclip = b_v3d.clip_end();
+ bcam->lens = b_v3d.lens();
+ bcam->shuttertime = b_scene.render().motion_blur_shutter();
if(b_rv3d.view_perspective() == BL::RegionView3D::view_perspective_CAMERA) {
/* camera view */
BL::Object b_ob = (b_v3d.lock_camera_and_layers())? b_scene.camera(): b_v3d.camera();
if(b_ob) {
- blender_camera_from_object(&bcam, b_ob);
+ blender_camera_from_object(bcam, b_ob);
/* magic zoom formula */
- bcam.zoom = (float)b_rv3d.view_camera_zoom();
- bcam.zoom = (1.41421f + bcam.zoom/50.0f);
- bcam.zoom *= bcam.zoom;
- bcam.zoom = 2.0f/bcam.zoom;
+ bcam->zoom = (float)b_rv3d.view_camera_zoom();
+ bcam->zoom = (1.41421f + bcam->zoom/50.0f);
+ bcam->zoom *= bcam->zoom;
+ bcam->zoom = 2.0f/bcam->zoom;
/* offset */
- bcam.offset = get_float2(b_rv3d.view_camera_offset());
+ bcam->offset = get_float2(b_rv3d.view_camera_offset());
}
}
else if(b_rv3d.view_perspective() == BL::RegionView3D::view_perspective_ORTHO) {
/* orthographic view */
- bcam.farclip *= 0.5;
- bcam.nearclip = -bcam.farclip;
+ bcam->farclip *= 0.5;
+ bcam->nearclip = -bcam->farclip;
- bcam.type = CAMERA_ORTHOGRAPHIC;
- bcam.ortho_scale = b_rv3d.view_distance();
+ bcam->type = CAMERA_ORTHOGRAPHIC;
+ bcam->ortho_scale = b_rv3d.view_distance();
}
- bcam.zoom *= 2.0f;
+ bcam->zoom *= 2.0f;
/* 3d view transform */
- bcam.matrix = transform_inverse(get_transform(b_rv3d.view_matrix()));
+ bcam->matrix = transform_inverse(get_transform(b_rv3d.view_matrix()));
+}
- /* sync */
+static void blender_camera_border(BlenderCamera *bcam, BL::Scene b_scene, BL::SpaceView3D b_v3d,
+ BL::RegionView3D b_rv3d, int width, int height)
+{
+ BL::RenderSettings r = b_scene.render();
+
+ if(!r.use_border())
+ return;
+
+ /* camera view? */
+ if(!(b_rv3d && b_rv3d.view_perspective() == BL::RegionView3D::view_perspective_CAMERA))
+ return;
+
+ BL::Object b_ob = (b_v3d.lock_camera_and_layers())? b_scene.camera(): b_v3d.camera();
+
+ if(!b_ob)
+ return;
+
+ bcam->border_left = r.border_min_x();
+ bcam->border_right = r.border_max_x();
+ bcam->border_bottom = r.border_min_y();
+ bcam->border_top = r.border_max_y();
+
+ float cam_left, cam_right, cam_bottom, cam_top;
+ float view_left, view_right, view_bottom, view_top;
+ float view_aspect, cam_aspect, sensor_size;
+
+ /* get viewport viewplane */
+ BlenderCamera view_bcam;
+ blender_camera_init(&view_bcam);
+ blender_camera_from_view(&view_bcam, b_scene, b_v3d, b_rv3d, width, height);
+
+ blender_camera_viewplane(&view_bcam, width, height,
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list