Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Dim containers as Array[container]
- Sub OnInitParameters()
- RegisterParameterBool("edit", "Edit Parameters", False)
- RegisterParameterContainer("Container", "Root Container")
- RegisterParameterString("cName", "Find Containers by Name", "", 32, 100, "")
- RegisterParameterBool("doCrop", "Crop", False)
- RegisterParameterDouble("crop_left", "Left Crop Face", - 50, - 10000, 10000)
- RegisterParameterDouble("crop_right", "Right Crop Face", 50, - 10000, 10000)
- RegisterParameterDouble("crop_bottom", "Bottom Crop Face", - 50, - 10000, 10000)
- RegisterParameterDouble("crop_top", "Top Crop Face", 50, - 10000, 10000)
- End Sub
- Sub OnParameterChanged(parameterName As String)
- Dim c = GetParameterContainer("Container")
- If Not c.Valid Then
- c = this
- End If
- c.GetContainerAndSubContainers(containers, False)
- If GetParameterBool("edit") Then
- For i = 0 To containers.UBound
- Dim plugin As PluginInstance = containers[i].Geometry.PluginInstance
- If plugin.PluginName = "Noggi" And containers[i].Name = GetParameterString("cName") Then
- Select Case parameterName
- Case "doCrop"
- plugin.SetParameterBool("doCrop", GetParameterBool("doCrop"))
- Case "crop_left"
- plugin.SetParameterDouble("crop_left", GetParameterDouble("crop_left"))
- Case "crop_right"
- plugin.SetParameterDouble("crop_right", GetParameterDouble("crop_right"))
- Case "crop_bottom"
- plugin.SetParameterDouble("crop_bottom", GetParameterDouble("crop_bottom"))
- Case "crop_top"
- plugin.SetParameterDouble("crop_top", GetParameterDouble("crop_top"))
- End Select
- End If
- Next
- End If
- End Sub
- Sub OnGuiStatus()
- Select Case GetParameterBool("edit")
- Case True
- SendGuiParameterShow("Container", SHOW)
- SendGuiParameterShow("cName", SHOW)
- SendGuiParameterShow("doCrop", SHOW)
- SendGuiParameterShow("crop_left", SHOW)
- SendGuiParameterShow("crop_right", SHOW)
- SendGuiParameterShow("crop_bottom", SHOW)
- SendGuiParameterShow("crop_top", SHOW)
- Case False
- SendGuiParameterShow("Container", HIDE)
- SendGuiParameterShow("cName", HIDE)
- SendGuiParameterShow("doCrop", HIDE)
- SendGuiParameterShow("crop_left", HIDE)
- SendGuiParameterShow("crop_right", HIDE)
- SendGuiParameterShow("crop_bottom", HIDE)
- SendGuiParameterShow("crop_top", HIDE)
- End Select
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement