Please help me about modifier in Maxscript.

Please help me about modifier in Maxscript.

mihi0315
Participant Participant
568 Views
5 Replies
Message 1 of 6

Please help me about modifier in Maxscript.

mihi0315
Participant
Participant

I am creating a modifier to inset and then extrude, but only the extrusion is being executed.

Please help me understand what’s wrong.

 

plugin modifier Test
name:"Test"
classID:#(0x3bc16b9f, 0x740a29ad)
extends:Edit_Poly
replaceUI:on
(  
    parameters main rollout:params  
    (  
        Gap type:#float default:1 ui:spnAmount  

        on Gap set val do (  
           
            delegate.setOperation #Inset
            delegate.insetType = 1
            delegate.insetAmount = val
            delegate.modifier.Commit()

            delegate.setOperation #ExtrudeFace
            delegate.extrudeFaceHeight  = val
            delegate.modifier.Commit()          
        )
    )

     
    rollout params "Parameters"  
    (  
        spinner spnAmount "Gap: " type:#WorldUnits range:  [0, 1e6, 1]  
         
    )  

    on create do  
    (  
        delegate.setEPolySelLevel #Face      
    )
)
 
regards!
0 Likes
Accepted solutions (1)
569 Views
5 Replies
Replies (5)
Message 2 of 6

denisT.MaxDoctor
Advisor
Advisor
Accepted solution

I don't think more than one operation is allowed ... I think only one local data change is intended.
The only solution I see is to use two modifiers - #insert and #extrude.

0 Likes
Message 3 of 6

mihi0315
Participant
Participant

Thank you for your reply.
It seems that only one operation is allowed.

I will try the solution!

0 Likes
Message 4 of 6

denisT.MaxDoctor
Advisor
Advisor

look https://www.scriptspot.com/3ds-max/scripts/extrudeinsetoutline-faces-modifiers
Kudos to Swordslayer for showing a skillful way to extend the Edit_Poly modifier.


(Note. To those interested, the scripts were written five years ago, and using a Change Handler is no longer necessary in recent MAX versions.)

Message 5 of 6

mihi0315
Participant
Participant

Thank you for the reference site.
I also used it as a reference.

I thought it would be easier to work if I could create a script that could perform multiple operations at the same time.

0 Likes
Message 6 of 6

denisT.MaxDoctor
Advisor
Advisor

@mihi0315 wrote:

 

I thought it would be easier to work if I could create a script that could perform multiple operations at the same time.


“Multi-operations” will work better. But this cannot be done by extending Edit_Poly.
Maybe there's a hack, but I don't see it yet.

0 Likes