summaryrefslogtreecommitdiffstats
path: root/tools/trackeditor/code/scripts/te_treelineContext.mel
blob: c8120ab63db5159f1ad6dd4bfb7628ed775cbaf5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
//-----------------------------------------------------------------------------
// Copyright (C) 2001 Radical Entertainment Ltd.  All rights reserved.
//
// te_treelineContext.mel
//
// Description: Defines all the scripts required by the TreeLineContext tool
//              As a convention all Terrain Editor global procedures 
//              and global variables are prefixed with "te_".  All commands 
//              exposed through TE plugins are prefixed with "TE_".
//
//              MCB = Menu Call Back
//              BCB = Button Call Back
//
// Modification History:
//  + Created -- CBrisebois
//-----------------------------------------------------------------------------

//This is the global instance of the tree line context tool.

global proc te_MCB_CreateTreeLines()
{
    //Start the tree line context...
    if ( ! `contextInfo -exists TreeLineCtx` ) 
    {
        TreeLineContext TreeLineCtx;
    }

    setToolTo TreeLineCtx;
}

global proc te_Delete_TreeLineContext()
{
    if ( `contextInfo -exists TreeLineCtx` )
    {
        deleteUI -toolContext TreeLineCtx;
    }
}

global proc te_MCB_SnapTreelines()
{
    TE_SnapSelectedTreelines();
}

global proc te_MCB_ConvertToGeometry()
{
    string $whichCtx = `currentCtx`;

    if ( $whichCtx == "TreeLineCtx" )
    {
        ctxAbort;   
    }

    TE_ConvertTreelineToGeometry();
}

global int $gDeleteTreelines = true;

global proc te_MCB_TreelineOptions()
{
    global int $gDeleteTreelines;

    if ( `window -exists TE_TreelineOptions` )
    {
        deleteUI -window TE_TreelineOptions;
    }

    window -rtf true -title "TE Treeline Options" TE_TreelineOptions;

    columnLayout -adjustableColumn true;

        checkBox -label "Delete Treelines" -value $gDeleteTreelines -cc "te_BCB_SetDeleteTreelines(#1)";

    setParent ..;

    showWindow;
}

global proc te_BCB_SetDeleteTreelines( int $delete )
{
    global int $gDeleteTreelines;

    $gDeleteTreelines = $delete;
    TE_SetDeleteTreeline($delete);
}