[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [57502] trunk/blender/release/scripts/ modules/bpy_extras/object_utils.py: rename world_to_camera -> world_to_camera_view

Campbell Barton ideasman42 at gmail.com
Sun Jun 16 16:35:15 CEST 2013


Revision: 57502
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=57502
Author:   campbellbarton
Date:     2013-06-16 14:35:15 +0000 (Sun, 16 Jun 2013)
Log Message:
-----------
rename world_to_camera -> world_to_camera_view

Modified Paths:
--------------
    trunk/blender/release/scripts/modules/bpy_extras/object_utils.py

Modified: trunk/blender/release/scripts/modules/bpy_extras/object_utils.py
===================================================================
--- trunk/blender/release/scripts/modules/bpy_extras/object_utils.py	2013-06-16 13:30:37 UTC (rev 57501)
+++ trunk/blender/release/scripts/modules/bpy_extras/object_utils.py	2013-06-16 14:35:15 UTC (rev 57502)
@@ -25,7 +25,7 @@
     "object_add_grid_scale",
     "object_add_grid_scale_apply_operator",
     "object_image_guess",
-    "world_to_camera",
+    "world_to_camera_view",
     )
 
 
@@ -268,12 +268,14 @@
     return None
 
 
-def world_to_camera(scene, obj, coord):
+def world_to_camera_view(scene, obj, coord):
     """
-    Returns the 2d camera space coords for a 3d point.
+    Returns the camera space coords for a 3d point.
+    (also known as: normalized device coordinates - NDC).
 
     Where (0, 0) is the bottom left and (1, 1) is the top right of the camera frame.
     values outside 0-1 are also supported.
+    A negative 'z' value means the point is behind the camera.
 
     Takes shift-x/y, lens angle and sensor size into account
     as well as perspective/ortho projections.
@@ -284,7 +286,7 @@
     :type obj: :class:`bpy.types.Object`
     :arg coord: World space location.
     :type coord: :class:`mathutils.Vector`
-    :return: normalized 2d vector.
+    :return: a vector where X and Y map to the view plane and Z is the depth on the view axis.
     :rtype: :class:`mathutils.Vector`
     """
     from mathutils import Vector




More information about the Bf-blender-cvs mailing list