Home Technical Talk

Single hotkey for bevel and chamfer in 3Ds MAX

polycounter lvl 5
Offline / Send Message
leplatin polycounter lvl 5
Trying to figure out how to assign single hotkey to chamfer and bevel in 3Ds Max (want this to be like Modo's all-in-one bevel tool). Supposed to be working (it's beveling and chamfering so far) but I'm not sure it's proper way of scripting. Any maxscript gurus? Is this script legit?

macroScript PolyBevelChamfer
category:"custom whatewer"
tooltip:"PolyBevelChamfer"
(
    if subObjectLevel == 1 or subObjectLevel == 2 or subObjectLevel == 3 then macros.run "Ribbon - Modeling" "EPoly_ChamferOptions" else macros.run "Ribbon - Modeling" "EPoly_BevelOptions"
)

Replies

  • monster
    Offline / Send Message
    monster polycounter
    Your script should work. Dipping your toes into scripting is always a good idea!

    If I were to critique it I would say it's only missing some error checks. For example, if you didn't have an object select, or were at Object Level and not in Sub Object Level the script would crash.

    Not that I'm the best scripter, but this is how I would write this type of operation.

    macroScript PolyBevelChamfer
    category:"custom whatewer"
    tooltip:"PolyBevelChamfer"
    (
    	if filters.Is_EPoly() do
    	(
    		s = subObjectLevel
    	
    		local cmd = undefined
    		
    		case of
    		(
    			(s <= 3) : cmd = "EPoly_ChamferOptions"
    			(s >= 4) : cmd = "EPoly_BevelOptions"
    		)
    		
    		if cmd != undefined do
    		(
    			macros.run "Ribbon - Modeling" cmd
    		)
    	)
    )

  • leplatin
    Offline / Send Message
    leplatin polycounter lvl 5
    Great! Thank you for the answer.
Sign In or Register to comment.