Cool, thanks for sharing that Fabricio, it's brilliant.

Here's one I have in my personal menu - creates an annotation log of
distance measurements. Select two objects and run, places the distance
between the two in an annotation, or adds to an existing annotation.

I made it during a time when I was doing a lot of DoF work, and it's turned
out handy ever since.

Not packaged up in any particular way, pretty much ripped right out of my
menu ;)



On Wed, Jan 16, 2013 at 1:27 PM, Fabricio Chamon <[email protected]> wrote:

> For what's worth, here's my CVO (Custom view opener) dual monitor script
> for the icetree.
>  Rename to CVO.js (can't attach js files!) > Copy to "application\plugins"
> > Map it to any key combination (mine is always ctrl+[original shortcut]).
>
> - Screen resolution must be set inside the file (currently is 1920x1080).
> - you may also adjust some pixel offsets to better accomodate for your OS
> layout.
> - "viewname" has to match any file from the "application\views" folder
>
> You can register more commands to it, I always do:
>
> - icetree
> - rendertree
> - script editor
> - object view (ctrl+alt+1)
> - fx tree  (ctrl+alt+2): opens fxtree maximized at monitor 1 and fxviewer
> at monitor 2
>
>
> 2013/1/16 Eugen Sares <[email protected]>
>
>> Let's share the good stuff, definitely!
>>
>> Which reminds me: shouldn't ol' Netview be the easy-to-access repository
>> we all would like to have?
>> What happened to it, and why?
>>
>>
>> Am 16.01.2013 18:07, schrieb Ben Houston:
>>
>>  I wonder if it would be possible to share some Workgroups via Dropbox
>>> or maybe just a set of installers grouped in various ways.  Might
>>> allow for one person to damage the whole thing though. :-/
>>>
>>>
>>
>
#----------------------------------------
xsi = Application
xsiRoot = xsi.ActiveSceneRoot
lm = xsi.LogMessage
root = xsi.ActiveSceneRoot

def SelectionCheck():
        sel = xsi.Selection
        if sel.Count <= 1:
                lm("Select two objects.",4)
                return False
        if sel.Count >= 3:
                lm("More than two objects selected.",4)
                return False

        else: 
                lm("\nLog Distance\n------------------------",32)
                return True

#------------------------
#Distance Between Centers
 
def ctr_dist( objA, objB ):
        from math import sqrt,pow
        # Thx to Alan F for this function
 
        Ax, Ay, Az = objA.Kinematics.Global.Transform.GetTranslationValues2()
        Bx, By, Bz = objB.Kinematics.Global.Transform.GetTranslationValues2()
 
        return sqrt(  pow(Ax-Bx,2) + pow(Ay-By,2) + pow(Az-Bz,2)  )
        
#-----------------------

#Annotate Distance

def annotate( nDist ):
        if xsi.ClassName(root.Properties["MeasuredDistances"]):
                prevText = 
xsi.getValue(str(root.Properties["MeasuredDistances"])+".text")
                lm("Logging new distance measurement...\n",32)
                xsi.SetValue(str(root.Properties["MeasuredDistances"])+".text", 
str(prevText)+nDist, "")
                
        else:
                oSet = root.AddProperty("Annotation",0,"MeasuredDistances")
                lm("Annotation Created.\n",32)
                xsi.SetValue(str(oSet)+".text", "Distance Measurement 
Log\r"+"\r  -------------------------------------\n\r" + nDist, "")
                
        
        return

#-----------------------

#Log Distance

def LogDist():
        try:
                if SelectionCheck():
                        fromObj, toObj = xsi.Selection(0), xsi.Selection(1)
 
                        newDist = "\r\nDistance between <"+fromObj.FullName+"> 
to <"+toObj.FullName+"> is: " +str( ctr_dist(fromObj, toObj))
                        lm(newDist+"\n\n------------------------\n",32)
                        annotate(newDist)

        except:
                lm ("\n-------\nDistance Script Error.",4)
        return True
        
#----------------------------------------
#Call the function -
LogDist()

Reply via email to