Notifications
Clear all

[Closed] sub-object-Gizmo

Hi, I’m working on Lattice and vol. Select modifiers.
How do I access sub-objects? This doesn’t work for using the default box select volume:
obj.volSelect.position = [0,0,1]
Nor this:
obj.volSelect.gizmo.position = [0,0,1]

7 Replies

obj.volSelect.gizmo.position = [0,0,1]

this should work. Could you post a part of your script? maybe the problem lies elsewhere

Martijn

Here’s the section about VolumeSelect modifier:

addModifier bObjLattice (VolumeSelect())

bObjLattice.VolSelect.volume = 0 –box
–bObjLattice.VolSelect.node = bObjLattice.VolSelect.volume
bObjLattice.VolSelect.invert = true
–hello = bObjLattice.VolSelect.gizmo
bObjLattice.VolSelect.gizmo.position = [0,0,-0.01]
bObjLattice.VolSelect.gizmo.scale = [2,2,1]

Error popup:
–Unkown property: “gizmo” in Vol__Select:Vol. Select

That code works fine for me. What happens if you do it by first creating the modifier and setting its properties, then assigning it to the object and setting the gizmo, something like this:

vsMod = volumeSelect()
vsMod.volume = 0
vsMod.invert = true
addModifier bObjLattice vsMod
vsMod.gizmo.position = [0,0,-0.01]
vsMod.gizmo.scale = [2,2,1]

RH

Hey, LFShade, I tried your code in a macro. Somehow trying your code sparked an epiphany: Maybe I can’t add vol. Select onto a parametric object (box in my case) stably. So converting to mesh solved it. Anyways, great thanks!

I’m using max4, waiting for my max6, so hopefully the help file would improve and mention things like I can use mesh, but not param objs and such.

Wait, the problem is not in the parametrix object. I noticed if the modify panel is not open, then it doesn’t work. And there are no ways to tell it to “open” the mod panel. Is there?

You can use max modify mode to open the modify panel, then do the rest. Funny thing is, I tried running it (my version) with the create panel open because I thought that might be the problem, but it worked just fine. Then again, I’m using Max5 and I don’t really remember if this would be a version issue.

RH

Sorry for the late reply…working furiously at this city script.
The max modify mode does work here, thanks.

This thing is users might feels strange when the panel jumps from utility to modifier panel 50+ times when running it. I made an alternative: using a mesh node as volume. It take more memory herhaps, but avoids accessing the gizmos (and problems in Max4).

About the city script: The lattice is for the modern skyscraper glass panels, with the roof deselected to prevent the lattice there, which is one of several styles of buildings in the city.
And the city starts to need a hierarchy to organize all the city parts. I’m wondering, is it easy to migrate my script from Utility to Geometry superclass? making user manipulation easier, with stored values in the scene for later editing.

How do I start learning the geometry plug-in? The Wad-O-maxscript tuts are mostly utility, floating, or controller scripts.