[Maxscript] Setting a UVW map modifier to view align

Hi guys,
Part of a script I’m writing needs to make a UVW mapping modifier align the mapping gizmo to “View Align”.
The Listener doesn’t return any values on View Align pressed and the maxscript help doesn’t seem to have the information I was hoping for.

I did find this section

<Uvwmap>.gizmo SubAnim
<Uvwmap.Gizmo>.position Point3 default: [0,0,0] – animatable
<Uvwmap.Gizmo>.rotation Quat default: (quat 0 0 -1 0) – animatable
<Uvwmap.Gizmo>.scale Point3 default: [1,1,1] – animatable

I’m guessing that I have to get the view matrix of the camera and apply it to the <Uvwmap.Gizmo>.rotation, I’m unsure as to how to do that and I’m probably barking up the wrong tree.

Any help would be appreciated.

Hey, I’ve been searching and the unwrap uvw has a mappingAlignToView() method, you have to enter in subobject mode first, select planar and then call that method. But you should try to do it manually with the macro recorder enabled, when you press the align to view this happens: $.modifiers[#unwrap_uvw].unwrap5.setGizmoTM (matrix3 [23.8303,-23.8303,0] [11.8896,11.8896,29.1236] [-20.5935,-20.5935,16.8145] [0.682937,2.59019,8.25906e-007])

So I guess you’re in the right way, I don’t have time to finish this but I hope this helps.

Cheers.