Assign hotkey for the command change Vray Proxy display mode?

So there're a lot of scripts that allow change/switch display mode of Vrayproxy, but all of them are written for UI interaction.

I've some code, how can I modify to allow assign hotkey to each display mode of this task, thanks.

global vmesh_roll 
try ( destroydialog vmesh_rol ) catch()
rollout vmesh_roll "  Vray Proxy Displays" --- by Budi G ( Oct 2010 )
( -- dialog
 
  group " Display :"
	(
	 radiobuttons display_btn "" labels:#("bounding box", "preview from file", "point", "faces", "whole mesh") default:0 columns:1
	)
 
fn display_type sel type = ( for i in sel do if classof i == VRayProxy then ( i.display = type ) else () )
 
on display_btn changed thestate do (
 
case thestate of 
	(
 
        1: display_type selection 0
 
        2: display_type selection 1
 
        3: display_type selection 2
 
        4: ( display_type selection 1 ; display_type selection 3 ) -- mesh
 
		5: display_type selection 4
	)
)--end on pressed
 
 
) -- dialog
createdialog vmesh_roll width:135 height:110 style:#(#style_sysmenu, #style_toolwindow)

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
miauu's picture

.

Try this:

macroscript macro_vrProxyBoundingBox
category:"miauu"
tooltip:"vrProxyBoundingBox"
buttonText:"vrProxyBoundingBox"
(
	for o in selection where classof o == VRayProxy do
	(
		o.display = 0 
	)
)
macroscript macro_vrProxyPreviewFromFile
category:"miauu"
tooltip:"vrProxyPreviewFromFile"
buttonText:"vrProxyPreviewFromFile"
(
	for o in selection where classof o == VRayProxy do
	(
		o.display = 1 
	)
)
macroscript macro_vrProxyPoint
category:"miauu"
tooltip:"vrProxyPoint"
buttonText:"vrProxyPoint"
(
	for o in selection where classof o == VRayProxy do
	(
		o.display = 2 
	)
)
macroscript macro_vrProxyFaces
category:"miauu"
tooltip:"vrProxyFaces"
buttonText:"vrProxyFaces"
(
	for o in selection where classof o == VRayProxy do
	(
		o.display = 1 
		o.display = 3
	)
)
macroscript macro_vrProxyWholeMesh
category:"miauu"
tooltip:"vrProxyWholeMesh"
buttonText:"vrProxyWholeMesh"
(
	for o in selection where classof o == VRayProxy do
	(
		o.display = 4 
	)
)
nnq2603's picture

Thanks miauu about your help

Thanks a lot, man. I didn't notice the topic got approved since after a week I didn't see it show up, I thought it got removed from pending list.

Just see your answer today, thanks, I'll try and feedback if any issue. Thanks again, have a nice week Miauu.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.