Jump to content
Developer Wiki and Function Reference Links ×

Button MARIONETTE - Possible for OIP???


Recommended Posts

Hello everyone. I would like to understand how this Marionette 'button' works. It seems like a simple button, but maybe it’s just me—I can’t figure out how to place it inside a wrapper or even make it visible in the Object Info Palette (OIP).
Does anyone have examples of how to use it? Or perhaps let me know if it’s even possible to use it within a Marionette node and then implement it!

Screenshot2026-01-19alle11_59_20.png.9920fa146926ba22e25435ccbd5c500a.png

THANKS

Edited by Giobbe
Link to comment

It does not look like it works inside a wrapper unless it is the only object in the wrapper.

 

And it does not work as a button in the drawing. It just provides a button in the OIP that will let you run a script that has been edited into the button node code.

 

So you would need to duplicate the node and edit each version to have a different script. Then to use you would have to select the button in the drawing and then click the button line in the OIP.

 

I think this is probably more of a demonstrator on how to create a node that will have buttons in the OIP than a useful node as part of a network of Marionette Object.

 

@Marissa FarrellAm I missing anything?

  • Like 1
Link to comment
  • Marionette Maven
On 1/19/2026 at 12:18 PM, Pat Stanford said:

I think this is probably more of a demonstrator on how to create a node that will have buttons in the OIP than a useful node as part of a network of Marionette Object

Yes, the Button, Radio Button, Popup, and Slider nodes that we ship are all essentially template nodes so that users have easier access to starting points for those OIP controls, although the latter three can be modified directly and used in a network as-is.

  • Like 3
Link to comment

Hi,


I’m not sure I understand correctly what you’re trying to do. But maybe you just want to name the button-node inside your wrapper and then you see the button appears on the wrapper or the PIO Object?
 

 

  • Like 1
Link to comment

 @Pat Stanford for now I've done this:

 

import Marionette
import vs

@Marionette.NodeDefinition
class Params(metaclass = Marionette.OrderedClass):
    #APPEARANCE
    #Name
    this = Marionette.Node( 'Button Trigger 0.1i' )    
    this.SetDescription('Modifica Texture 2') 

    #OIP Controls
    btn = Marionette.OIPControl( 'Modifica Texture 2', Marionette.WidgetType.Button, 'script', 'Apri editor Texture 1')
    
    #Output Ports
    outTrig = Marionette.PortOut('trigger')
    
def RunNode(self):
    self.Params.outTrig.value = 1
    
def script(self):
    # CANALE FISSO PER TEXTURE 1
    channelID = '2'
    
    settingName = 'EditTex_Trigger_' + channelID
    vs.SetSavedSetting('Marionette_Custom', settingName, '1')
    
    hObj = vs.GetCustomObjectInfo()[0]
    if hObj != vs.Handle(0):
        vs.ResetObject(hObj)

The button call:
 

import Marionette
import vs

@Marionette.NodeDefinition
class Params(metaclass = Marionette.OrderedClass):
    #APPEARANCE
    #Name
    this = Marionette.Node( "Edit Texture 0.1i" )
    this.SetDescription( 'Edit Texture 2 - Chanel 2' )

    #Input Ports
    inObj = Marionette.PortIn( 0, 'hObj' ) 
    sTexName = Marionette.PortIn( 'sTexName' )
    trigger = Marionette.PortIn( 0, 'trigger' )

    #Output Ports
    outObj = Marionette.PortOut('hObj')
    texNameOut = Marionette.PortOut('sTexName')

def RunNode(self):
    inObj = self.Params.inObj.value
    texName = self.Params.sTexName.value
    
    # CANALE FISSO PER TEXTURE 2
    channelID = '2'
    
    if isinstance(inObj, int) or inObj is None:
        if inObj == 0: inObj = vs.Handle(0)
    
    settingName = 'EditTex_Trigger_' + channelID
    ok, val = vs.GetSavedSetting('Marionette_Custom', settingName)
    
    should_edit = False
    if ok and val == '1':
        should_edit = True
        vs.SetSavedSetting('Marionette_Custom', settingName, '0')

    if should_edit and texName != '':
        texH = vs.GetObject(texName)
        if texH != vs.Handle(0):
            vs.EditTexture(texH)

    self.Params.outObj.value = inObj
    self.Params.texNameOut.value = texName


Screenshot2026-02-03alle09_44_15.png.87b2494cbc6dca1109dd66bb9cd11f13.png

 

 

When you press the button in the Button Trigger 0.1i node, the script(self) function is executed.


Sorry for the Italian, but I sometimes write in my own language!

 

PARETE .vwx

  • Like 2
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...