Boolean : Modifier
BooleanMod - superclass: modifier; super-superclass:MAXWrapper - 15:0 - classID: #(2076314029L, 29076573L); creatable: trueThe BooleanMod modifier provides exposure to the Boolean Modifier functionality.
Example
resetMaxFile #noprompt
s = sphere()
s2 = sphere pos:[15,15,0] radius:15
s3 = sphere pos:[-15, 0, 0] radius:15
s4 = sphere pos:[15, -15,0] radius:15
b = BooleanMod()
addModifier s b
b.appendOperand #single operandNode:s2 operationType:#subtraction
b.appendOperand #single operandNode:s3 operationType:#attach
b.appendOperand #single operandNode:s4 operationType:#unionProperties
<BooleanMod>.disableInteractiveUpdates BooleanClass default: false -- booleanSpecifies whether to disable viewport updates during operand transformation.
<BooleanMod>.displayShading Integer default: 2 -- integerSpecifies how to display operands (depending on .DisplayType), where:
- 0 = wire
- 1 = shaded
- 2 = wire and shaded
<BooleanMod>.DisplayType Integer default: 2 -- integerSpecifies what to display, where:
- 0 = Results
- 1 = Operands
- 2 = Selected Operands only
<BooleanMod>.doDeterministicEdgeSort BooleanClass default: true -- booleanSpecifies whether to perform edge sorting at each evaluation. This is true by default in 3ds Max 2024.1 Update and later, but will be non-existent or false in previous versions. This resolves an issue with vertex painting on geometry that uses the boolean modifier. Note that this property is exposed to MAXScript only, it does not appear in the UI.
<BooleanMod>.doTinyFragmentCleanup BooleanClass default: true -- booleanSpecifies whether to clean up leftover triangles and closed pairs of triangles or quads.
Note that this property is exposed to MAXScript only, it does not appear in the UI.
<BooleanMod>.hideBooleanOnCreate BooleanClass default: true -- booleanGets/sets the state of the Hide Boolean checkbox in the Boolean Modifier UI. This specifies whether the original boolean object is hidden when the user clicks the Create Objects button, or if CreateObjects() (below) is called.
<BooleanMod>.hideReference BooleanClass default: true -- booleanSpecifies whether to automatically hide operands when they are added to the operand list.
<BooleanMod>.method Integer default: 0 -- integerGets/sets the boolean's calculation method where:
- 0 = Mesh
- 1 = OpenVDB
<BooleanMod>.operandItems ArrayParameter default: #() -- paramBlock2 array; SubAnimContains an array of operands for the boolean.
<BooleanMod>.Operands ArrayParameter default: #(ReferenceTarget:ParamBlock2) -- paramBlock2 array; SubAnim
<BooleanMod.Operands[1]>.SeamSize Float default: 0.0 -- animatable<BooleanMod>.operationVersion Integer default: 5 -- integerGets the internal version of the Boolean Modifier.
<BooleanMod>.pivotAlign BooleanClass default: false -- booleanSpecifies whether to align an operand's pivot with the base object's pivot when the operand is selected. Note that .useLiveReference must also be true for this setting to have an effect.
<BooleanMod>.preserveNormalData BooleanClass default: false -- booleanSpecifies whether to retain explicit normals from the operands.
<BooleanMod>.retainNonPlanarFaces BooleanClass default: true -- booleanSpecifies whether to keep non-planar faces from the operands.
<BooleanMod>.selectedOpacity Float default: 0.15 -- floatGets/sets the opacity of selected operands when Selected Operands are displayed as shaded or wired and shaded.
this option is not exposed in the UI.
<BooleanMod>.toleranceFactor Float default: 3.0e-8f -- animatable; worldUnitsFor internal use. Used internally by the Boolean computation. The longest dimension of the bounding box of the Boolean operands is multiplied by this value to determine the Boolean intersection tolerance for a given operation. Smaller values can generally provide more accurate results, but values nearing 0.0 can cause failures due to numeric imprecision. Default = 3.0e-8f, Range = 0.0 - 1.0e-3f.
<BooleanMod>.Transform ArrayParameter default: #() -- maxObject array; SubAnimContains an array of transforms for the boolean's operands.
<BooleanMod>.unselectedOpacity Float default: 0.05 -- floatGets/sets the opacity of unselected operands.
<BooleanMod>.useLiveReference BooleanClass default: false -- booleanSpecifies whether to retain the operand's scene node and transform as a "live" reference when it is picked. When true, operands are treated as live references - the object remains in its original node and uses the node's transform to position and orient the operand. The node remains in the scene but is hidden. When false, the operand object's geometry is incorporated into the Boolean, its node is deleted from the scene, and the operand obtains a position and orientation that is relative to the modified object. Both options allow for manipulation of the operand's geometry and modifier stack, but the "Live" reference is more computationally expensive, requiring re-evaluation when either the operand's node or the modified object's node is transformed.
<BooleanMod>.useOperandMaterial BooleanClass default: true -- booleanSpecifies whether the Boolean results should use the operand's material. This takes place only when the operand is initially picked. The operand's material is evaluated, and if it contains any materials (single or multi/sub-object) that differ from those in the modified object, the modified object's material is updated to a multi/sub-object material which includes the operand's materials, and the material IDs of the operand are re-mapped to use the corresponding material IDs of the new material.
<BooleanMod>.voxelSize Float default: 1.0 -- animatable; worldUnitsWhen the boolean method is OpenVDB, this property controls how finely the mesh is encoded into a volume. The lower the voxel size, the sharper the results. A higher size produces rounder features.
The smaller the voxel size, the more memory is used to store the object. Using extremely small voxel sizes can result in the computer running out of memory.
BooleanMod interfaces:
Interface: BooleanModifier
Methods:
<integer>GetNumOperands()Returns the number of operands in the boolean. This includes the base object and operands in folders, but does not include folders.
<boolean>GetRootOperandName <index>operandIndex <&string>nameout
nameout is Out parameterGets the name of the operand at the operandIndex in the nameout by reference parameter. For this method, the index only applies to items at the root level, items inside folders are not part of the index.
<boolean>SetRootOperandName <index>operandIndex <string>nameSets the name of the operand at the operandIndex to the specified name. For this method, the index only applies to items at the root level, items inside folders are not part of the index.
<boolean>GetFlatOperandName <index>operandIndex <&string>nameout
nameout is Out parameterGets the name of the operand at the flat index operandIndex, returned in the nameout by reference parameter. The "flat index" is the index in the operand list flattened out so that items in folders are considered part of the top-level. For example, the first operand in a folder at index position 2 would have a flat index of 3.
<boolean>SetFlatOperandName <index>operandIndex <string>nameSets the name of the operand at the flat index operandIndex to the name. The "flat index" is the index in the operand list flattened out so that items in folders are considered part of the top-level. For example, the first operand in a folder at index position 2 would have a flat index of 3.
<boolean>GetFolderOperandName <index>operandIndex <index>subOperandIndex <&string>nameout
nameout is Out parameterGets the name of an operand or sub-folder in operandIndex, where subOperandIndex is the position of the item in the folder, returning the name in the nameout by-reference parameter.
<boolean>SetFolderOperandName <index>operandIndex <index>subOperandIndex <string>nameSets the name of an operand in folder operandIndex, where subOperandIndex is the position of the item in the folder. Returns true if the operation succeeded.
<boolean>GetRootOperandType <index>operandIndex <&enum>type
type enums: {#modified|#single|#folder}
type is Out parameterGets the type of object at operandIndex, returned in the type by-reference parameter. The type can be one of:
#modified- the modified base object#single- an operand object#folder- a folder
<boolean>GetNumFolderOperands <index>operandIndex <&integer>count
count is Out parameterReturns the number of operands contained in the folder at operandIndex, returned in the count by-reference parameter.
<boolean>GetOperationType <index>operandIndex <&enum>type
type enums: {#union|#intersection|#subtraction|#merge|#attach|#insert|#split}
type is Out parameterGets the operation type for the operand or folder at operandIndex, returned in the type by-reference parameter.
<boolean>SetOperationType <index>operandIndex <enum>type
type enums: {#union|#intersection|#subtraction|#merge|#attach|#insert|#split}Sets the operation type for the operand or folder at operandIndex to the specified type.
<boolean>GetOperationOption <index>operandIndex <&enum>option
option enums: {#none|#imprint|#cookie}
option is Out parameterGets the operation option for the operand at operandIndex, returned in the by-reference option parameter.
<boolean>SetOperationOption <index>operandIndex <enum>option
option enums: {#none|#imprint|#cookie}Sets the operation option for the operand at operandIndex to the option.
<boolean>GetDisable <index>operandIndex <&boolean>disable
disable is Out parameterGets the disabled status of the operand at operandIndex, returning it in the by-reference disable parameter.
<boolean>SetDisable <index>operandIndex <boolean>disableSets the disabled status of the operand at operandIndex to the disable value, where true is disabled, and false is enabled. Returns true if the operation succeeds, false otherwise.
<boolean>RemoveOperand <index>operandIndexRemoves the operand at the operandIndex. Returns true if the operation succeeds, false otherwise.
<boolean>AppendOperand <enum>operandtype operandNode:<node> operationType:<enum> operationOption:<enum>
operandtype enums: {#modified|#single|#folder}
operandNode default value: undefined
operationType enums: {#union|#intersection|#subtraction|#merge|#attach|#insert|#split}
operationType default value: #union
operationOption enums: {#none|#imprint|#cookie}
operationOption default value: #noneAppends an operand to the boolean, returning true on success, false on failure. The operand is added at the end of the operand list.
The operandType specifies whether this is the base modified object, a single operand, or a folder containing other operands.
The operandNode specifies the scene node to add as an operand. This is not required if operandType is #folder.
The operationType specifies what type of boolean operation to perform.
the operationOption specifies additional options for the boolean operation. #cookie means the faces from the operand are not added to the boolean mesh, cutting a hole in it. #imprint means new edges are added to the boolean mesh where the operand intersects with the base object.
Returns true if the operation succeeds, false otherwise.
<boolean>InsertOperand <enum>operandtype <index>where operandNode:<node> operationType:<enum> operationOption:<enum>
operandtype enums: {#modified|#single|#folder}
operandNode default value: undefined
operationType enums: {#union|#intersection|#subtraction|#merge|#attach|#insert|#split}
operationType default value: #union
operationOption enums: {#none|#imprint|#cookie}
operationOption default value: #noneInserts an operand into the boolean between existing operands, at the index specified by where, returning true on success, false on failure.
The operandType specifies whether this is the base modified object, a single operand, or a folder containing other operands.
The operandNode specifies the scene node to add as an operand. This is not required if operandType is #folder.
The operationType specifies what type of boolean operation to perform.
the operationOption specifies additional options for the boolean operation. #cookie means the faces from the operand are not added to the boolean mesh, cutting a hole in it. #imprint means new edges are added to the boolean mesh where the operand intersects with the base object.
Returns true if the operation succeeds, false otherwise.
<boolean>RemoveFolderOperand <index>operandIndex <index>subOperandIndexRemoves the operand at the position subOperandIndex in the folder at operandIndex. Returns true if the operation succeeds, false otherwise.
<boolean>AppendFolderOperand <index>operandIndex <node>operandNodeAppends the operand operandNode to the list of operands in the folder at the operandIndex position. Returns true if the operation succeeds, false otherwise.
<boolean>InsertFolderOperand <index>operandIndex <index>where <node>operandNodeInserts the operand operandNode into the folder at operandIndex at location where in the folder. Returns true if the operation succeeds, false otherwise.
<boolean>AlignPivot <index>operandIndexAligns the pivot of the node containing the "Live" operand at flat index operandIndex with the pivot of the base object. Has no effect on 'captured' operands. Returns true if the operation succeeds, false otherwise.
<boolean>ExtractAsObject <index>operandIndexExtracts the operand at the specified operandIndex as an object. Returns true if the operation succeeds, false otherwise.
<boolean>CutOperand()Cuts the currently selected operand. Returns true if the operation succeeds, false otherwise.
<boolean>PasteOperand <index>operandIndexPastes the operand on the clipboard at the position specified by operandIndex. Returns true if the operation succeeds, false otherwise.
<boolean>PasteToNewModifier()Pastes the operand on the clipboard to a new boolean modifier. Returns true if the operation succeeds, false otherwise.
<boolean>ExtractSeams <index>operandIndexCreates a new shape from the seams of the operand at operandIndex. Returns true if the operation succeeds, false otherwise.
<boolean>CreateObjects <&node array>createdNodes
createdNodes is In and Out parameterCreates objects from the boolean, returning them in the createdNodes by-reference parameter. Returns true if the operation succeeds, false otherwise.
Related Interfaces
BooleanModifierInterface : Interface
This interface provides backwards-compatibility for scenes using the Boolean Modifier.
Properties:
.SaveFinalResult : boolean : Read|WriteIn 3ds Max 2024.1 Update and later, the Boolean Modifier uses a caching mechanism, and therefore scenes created in these versions cannot be opened in 3ds Max 2024. Setting this property to false before saving turns off the cache and makes the scene compatible with 3ds Max 2024.
