Notifications
Clear all

[Closed] Show/hide decay gizmo via script?

I’ve been doing some light-related scripting and noticed something odd.

Next to the “Start” decay radius spinner in the Intensity/Color/Attenuation rollout on all standard lights, there is a “Show” checkbox that either shows or hides a gizmo which indicates the spinner value.

I cannot find any way to access this checkbox or duplicate its functionality via maxscript. I even did a quick scan through the SDK sample files and can’t figure out what parameter this is supposed to be.

It’s a minor concern, but it’s bugging me. What am I missing?

14 Replies
1 Reply
(@denist)
Joined: 11 months ago

Posts: 0

… 3ds Max … SDK\maxsdk\samples\objects\light.cpp

Looks like a buggy control. It should toggle on/off the Decay Gizmo but if you set the decay to Inverse or Inverse Square it has no effect.

<light>.attenDecay
1 = None
2 = Inverse
3 = Inverse Square

I guess if the built-in control doesn’t even work properly, then I shouldn’t bother with it.

1 Reply
(@denist)
Joined: 11 months ago

Posts: 0

why? it works. did you look into light.cpp and light.h?

you can see that decayDisplay is an internal parameter (not a paramBlock parameter). Also because of that the setting of its value is not undoable.

I suppose you are right. The checkbox does seem to work only when the decay is set to None, in which case it shouldn’t be a concern to display the Decay Gizmo as it has no effect.

It is undoable from the Max UI.

2 Replies
(@denist)
Joined: 11 months ago

Posts: 0

look at its checkbox. it doesn’t update on undo/redo as i can see in my max (2016).

(@polytools3d)
Joined: 11 months ago

Posts: 0

It’s a redraw issue.

If you check it you will see the Decay Gizmo. Undo it and the Gizmo is not shown. Or you can switch to another tab and the checkbox is updated when you go back to the modify panel.

The Undo is handled by a callback in the .CPP.

case IDC_SHOW_DECAY:
	theHold.Begin();
	gl->SetDecayDisplay( IsDlgButtonChecked( hDlg, IDC_SHOW_DECAY) );
	theHold.Accept(GetString(IDS_DS_PARAMCHG));
	gl->iObjParams->RedrawViews(t);
	break;

this is not really undo on parameter change. it registers undo only on checkbox pressed … not on parameter change. the checkbox doesn’t automatically redraw because the UI control is not bound to the parameter.

1 Reply
(@polytools3d)
Joined: 11 months ago

Posts: 0

Yes, of course. I never said it was a parameter Undo. It is handle by a callback in the UI, which by the way, is a weird mechanism of handling Undo.

So as I understand it, there is no way to access this parameter from Maxscript?

via mxs it’s possible by only using a trick with UI reading. (get/set checkbox state).

with sdk you can get access to this parameter.

I determined that the SDK would be overkill for my current project. So how do I do this UI trick?