Quantcast
Channel: Scripting - McNeel Forum
Viewing all articles
Browse latest Browse all 5800

Moving Rhino cameras using Rhino Python editor doesn't move enscape views

$
0
0

Hi,
when trying to move the rhino origin (geometry and views) from the old origin to the new origin, it moves all views and geometry correctly except views created through enscape. Wondering if anybody else has dealt through this?
Thanks
Here is the script

import rhinoscriptsyntax as rs 

def move_named_views(vect):

    named_views = rs.NamedViews()

    for view in named_views:

        rs.RestoreNamedView(view)

        camera,target = rs.ViewCameraTarget(rs.CurrentView())

        camera += vect

        target += vect

        rs.ViewCameraTarget(rs.CurrentView(),camera,target)

        view = view.replace(" ","\r")

        view = "MovedView_" + view

        print(view)

        rs.Command('-_namedView S ' + view + ' ENTER',True)

def MoveEverythingInFile():

    oPt=rs.GetPoint('Current "origin" - Point to move all geometry FROM')

    if not oPt: return

    nPt=rs.GetPoint('New "origin" - Point to move all geometry TO')

    if not nPt: return

    

    objs=rs.AllObjects(include_lights=True,include_grips=True)

    if objs==None: return

    tVec=nPt-oPt

    rs.EnableRedraw(False)

    rs.MoveObjects(objs,tVec)

    move_named_views(tVec)

MoveEverythingInFile()

3 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 5800

Trending Articles