Assign Display Vertex Colors to Hotkey

Assign Display Vertex Colors to Hotkey

bsaliga
Participant Participant
1,040 Views
5 Replies
Message 1 of 6

Assign Display Vertex Colors to Hotkey

bsaliga
Participant
Participant

Is there a way to assign the Vertex Colors check box under the display properties panel to a hotkey. I want to toggle the box on and off with a hotkey, or at least drag it into a custom toolbar and then assign that button to a hotkey. Oddly enough the "Vertex Ticks" toggle above that one is found in the Customize User interface window, but not "vertex colors"....  (See image attached).

 

**I'm using 3ds Max 2024**

0 Likes
Accepted solutions (2)
1,041 Views
5 Replies
Replies (5)
Message 2 of 6

dmitriy.shpilevoy
Collaborator
Collaborator
Accepted solution
(
	obj = selection[1]
	if obj != undefined and classof obj == Editable_Poly do (
		if polyop.getMapSupport obj 0 do (
			obj.vertexColorType = #color
			if obj.showVertexColors then (
				obj.showVertexColors = off
			) else (
				obj.showVertexColors = on
			)
		)
	)
)
Message 3 of 6

bsaliga
Participant
Participant

Thanks this works. Had to have the material on the mesh for it to work.

0 Likes
Message 4 of 6

bsaliga
Participant
Participant
Is there any way to get it to work with multiple selected objects and also in editable mesh mode?
0 Likes
Message 5 of 6

dmitriy.shpilevoy
Collaborator
Collaborator
Accepted solution

Strange. I tested it on teapot with no material.

 

 

(
	function isValidObject obj = (
		valid = false
		case classOf(obj) of (
			Editable_Poly: (
				if polyop.getMapSupport obj 0 do (
					valid = true
				)
			)
			Editable_mesh: (
				if meshop.getMapSupport obj 0 do (
					valid = true
				)
			)
		)
		valid
	)
	
	for i in selection do (
		obj = i
		if isValidObject obj then (
			obj.vertexColorType = #color
			if obj.showVertexColors then (
				obj.showVertexColors = off
			) else (
				obj.showVertexColors = on
			)
		)
	)
)

 

Message 6 of 6

bsaliga
Participant
Participant
Thank you! Can confirm this now works in Editable Mesh/Poly and with multiple objects selected. I appreciate it!
0 Likes