Announcement

Collapse
No announcement yet.

Very simple script help please :)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Very simple script help please :)

    I'd like to create a very simple button so that when I click it, it will change the selected objects properties to be from "By Object" to "By Layer" for its Display Properties, Rendering Control and Motion Blur.

    Maybe even if it were a toggle so that it could switch from By Object to By Layer and back again etc, that'd would be great too.

    Can someone help me with the script code needed for all of that

    Many thanks.
    Jez

    ------------------------------------
    3DS Max 2023.3.4 | V-Ray 6.10.08 | Phoenix FD 4.40.00 | PD Player 64 1.0.7.32 | Forest Pack Pro 8.2.2 | RailClone 6.1.3
    Windows 11 Pro 22H2 | NVidia Drivers 535.98 (Game Drivers)

    Asus X299 Sage (Bios 4001), i9-7980xe, 128Gb, 1TB m.2 OS, 2 x NVidia RTX 3090 FE
    ---- Updated 06/09/23 -------

  • #2
    Does this work for you?
    Code:
    (
        try (destroyDialog sdpRoll);catch()
    
        global sdpRoll = rollout sdp "Switch Display Props." width:190 height:30
        (
            fn switchProps opt =
            (
                if opt == 1 then state = false else state = true
                for obj in getCurrentSelection() where isProperty obj #displayByLayer and isProperty obj #motionByLayer and isProperty obj #renderByLayer  do
                (
                    obj.displayByLayer = obj.motionByLayer = obj.renderByLayer = state
                )
            )
            radiobuttons copyInst pos:[5,5] columns:2 default:0 align:#left labels:#("By Object", "By Layer") offsets:#([15,0], [5,0])
            on copyInst changed opt do switchProps opt
        )
        createdialog ::sdpRoll
    )
    Dan Brew

    Comment

    Working...
    X