Hi,
last I have got this great script at the Rhino forum. I would say, a must.
The script help to set the focus of rendering with DOF effect to nay point in the perspective viewport without to change the view.
-Micha
PS: Joe or Corey, could be great, if this script could be added to the V-Ray menu - "set focus point" could be a good command name.
Copy the code to a button and ready.
last I have got this great script at the Rhino forum. I would say, a must.
The script help to set the focus of rendering with DOF effect to nay point in the perspective viewport without to change the view.
-Micha
PS: Joe or Corey, could be great, if this script could be added to the V-Ray menu - "set focus point" could be a good command name.
Copy the code to a button and ready.
Code:
-_RunScript ( ' Tested with Rhino3 SR4 only. ' Move a perspective projection view's target plane to pass through a given point. ' Affected view is that which is active when the script is launched. ' User is prompted to pick a point, in any view, through which the initial view's ' target plane is to pass. Option Explicit MoveTargetPlane Sub MoveTargetPlane() Dim viewName Dim cameraPoint Dim viewCPlane Dim targetCPlane Dim userPoint, userPointCP Dim targetPoint, targetPointCP Dim newTargetPoint, newTargetPointCP Dim deltaZCP viewName = Rhino.CurrentView If Not Rhino.IsViewPerspective(viewName) Then Rhino.Print "MoveTargetPlane works in perspective projection views only." Exit Sub End If cameraPoint = Rhino.ViewCamera(viewName) viewCPlane = Rhino.ViewCPlane(viewName) Rhino.EnableRedraw False Rhino.Command "_CPlane _View" targetCPlane = Rhino.ViewCPlane(viewName) Rhino.ViewCPlane viewName, viewCPlane Rhino.EnableRedraw True userPoint = Rhino.GetPoint("Pick point in desired target plane") If IsNull(userPoint) Then Rhino.Print "No point was picked." Exit Sub End If userPointCP = Rhino.XformWorldToCPlane(userPoint, targetCPlane) targetPoint = Rhino.ViewTarget(viewName) targetPointCP = Rhino.XformWorldToCPlane(targetPoint, targetCPlane) newTargetPointCP = targetPointCP newTargetPointCP(2) = userPointCP(2) newTargetPoint = Rhino.XformCPlaneToWorld(newTargetPointCP, targetCPlane) Rhino.ViewCameraTarget viewName, cameraPoint, newTargetPoint deltaZCP = newTargetPointCP(2) - targetPointCP(2) Rhino.Print "Target plane moved by " & CStr(Abs(deltaZCP)) & " units." End Sub )
Comment