Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Dim containers as Array[container]
- Dim filters As Array[String]
- filters.Push("All")
- filters.Push("by Name")
- Sub OnInitParameters()
- RegisterParameterBool("edit", "Edit Parameters", False)
- RegisterParameterContainer("Container", "Root Container")
- RegisterRadioButton("filter", "Find Noggi", 0, filters)
- RegisterParameterString("cName", "Name", "", 32, 100, "")
- RegisterParameterDouble("width", "Width", 100, 0, 10000)
- RegisterParameterDouble("height", "Height", 100, 0, 10000)
- 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
- Dim filterType = GetParameterInt("filter")
- For i = 0 To containers.UBound
- Dim plugin As PluginInstance = containers[i].Geometry.PluginInstance
- If plugin.Valid Then
- Select Case filterType
- Case 0 ' All
- If plugin.PluginName = "Noggi" Then
- ApplyPluginChanges(plugin, parameterName)
- End If
- Case 1 ' by Name
- If plugin.PluginName = "Noggi" And containers[i].name = GetParameterString("cName") Then
- ApplyPluginChanges(plugin, parameterName)
- End If
- End Select
- End If
- Next
- End If
- End Sub
- Sub ApplyPluginChanges(plugin As PluginInstance, parameterName As String)
- Select Case parameterName
- Case "width"
- plugin.SetParameterDouble("width", GetParameterDouble("width"))
- Case "height"
- plugin.SetParameterDouble("height", GetParameterDouble("height"))
- 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 Sub
- Sub OnGuiStatus()
- Select Case GetParameterBool("edit")
- Case True
- If GetParameterInt("filter") = 1 Then
- SendGuiParameterShow("cName", SHOW)
- Else
- SendGuiParameterShow("cName", HIDE)
- End If
- SendGuiParameterShow("Container", SHOW)
- SendGuiParameterShow("filter", SHOW)
- SendGuiParameterShow("height", SHOW)
- SendGuiParameterShow("width", 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("filter", HIDE)
- SendGuiParameterShow("width", HIDE)
- SendGuiParameterShow("height", 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
Comments
-
- Sample scene with alternative methods using the "Datapool" plugin or scripting
- https://mega.nz/file/BrJiHRiZ#3rU24HzIbGE3C5AFeo-j3Z2EAoHiPYLyyPTqXIY9cjQ
Add Comment
Please, Sign In to add comment
Advertisement