Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

UI for the walkthrough mode

UI for the walkthrough mode

Haider_of_Sweden
Collaborator Collaborator
1,536 Views
18 Replies
Message 1 of 19

UI for the walkthrough mode

Haider_of_Sweden
Collaborator
Collaborator

Hi!

 

I built a UI and gathered the necessary code, but I need help to put it together.

 

Macroscript that activates walkThrough + it needs to open the UI:

(
	on execute do
	(
		if walkThroughOps.isActive == false then 
	(
		walkThroughOps.start()
	)
	else
	(
		walkThroughOps.stop()
	)
	)
	On isChecked return (walkThroughOps.IsActive)
)

 

 the UI:

rollout WalkThrough_Rollout "WalkThrough" width:600 height:267
(
	slider 'slider_rotSens' "Rotation Sensitivity" pos:[25,35] width:315 height:44 range:[1,100,40] ticks:1 align:#left
	slider 'slider_stepSize' "Step Size" pos:[25,95] width:315 height:44 range:[1,1000,50] ticks:1 align:#left
	button 'btn_LockHorizRot' "Lock Horizontal Rotation" pos:[360,180] width:55 height:55 align:#left
	button 'btn_LockVertRot' "Lock Vertical Rotation" pos:[435,180] width:55 height:55 align:#left
	button 'btn_InvertVertRot' "Invert Vertical Rotation" pos:[510,180] width:55 height:55 align:#left
	button 'btn_LevelView' "Level View" pos:[155,180] width:55 height:55 align:#left
	button 'btn_camUp' "Up" pos:[435,35] width:55 height:55 align:#left
	button 'btn_camDown' "Down" pos:[435,106] width:55 height:55 align:#left
	button 'btn_camLeft' "Left" pos:[360,64] width:55 height:55 align:#left
	button 'btn_camRight' "Right" pos:[510,65] width:55 height:55 align:#left
	button 'btn_accelToggle' "Accelleration Toggle" pos:[35,179] width:74 height:55 align:#left
		

	on slider_rotSens changed val do
	(
			-- it works like this, eg walkThroughOps.sensitivity=1
			-- so we need the value from the slider to be reflected
		)
	on slider_stepSize changed val do
	(
			-- it works like this, eg walkThroughOps.stepSize=1000
			-- so we need the value from the slider to be reflected
		)
	on btn_LockHorizRot pressed do
		actionMan.executeAction 1127307088 "50"  -- WalkThrough: Lock Horizontal Rotation
	on btn_LockVertRot pressed do
		actionMan.executeAction 1127307088 "48"  -- WalkThrough: Lock Vertical Rotation
	on btn_InvertVertRot pressed do
		actionMan.executeAction 1127307088 "53"  -- WalkThrough: Invert Vertical Rotation Toggle
	on btn_LevelView pressed do
		actionMan.executeAction 1127307088 "47"  -- WalkThrough: Level
	on btn_camUp pressed do
		actionMan.executeAction 1127307088 "51"  -- WalkThrough: Up
	on btn_camDown pressed do
		actionMan.executeAction 1127307088 "52"  -- WalkThrough: Down
	on btn_camLeft pressed do
		actionMan.executeAction 1127307088 "19"  -- WalkThrough: Left
	on btn_camRight pressed do
		actionMan.executeAction 1127307088 "21"  -- WalkThrough: Right
	on btn_accelToggle pressed do
	-- not sure if you can have a on execute and on isChecked.
	-- But we need this one to be pressed if this mode is on. Or a color
	-- change on the button or somethign indicating it is on.
	
	--on execute do
		(
			if walkThroughOps.accelerate == true then 
		(
			walkThroughOps.accelerate=false
			format "Accellerate Off   "
		)
		else
		(
			walkThroughOps.accelerate=true
			format "Accellerate On  "
		)
		)
	--On isChecked return (walkThroughOps.accelerate)
)

 

 

Would be even better if it would be dockable (I might redo the design once I see it in action)

0 Likes
Accepted solutions (1)
1,537 Views
18 Replies
Replies (18)
Message 2 of 19

denisT.MaxDoctor
Advisor
Advisor
Accepted solution

Here is a snippet that shows how I would do something like your task...

try (destroydialog ::EZ_WALK_STRUCT.dialog) catch()

macroscript WalkThroughUI 
	tooltip:"EZ Walk Through" 
	buttontext:"EZ WALK"
	category:"with denisT"
	silentErrors:on
(	
	struct walkthrough_struct
	(
		opened = off,
		
		dialog =
		(
			rollout dialog "EZ Walk" width:191
			(
				local owner = owner
				local updating = on
				
				timer walk_timer  interval:200 active:off
				
				group ""
				(
					checkbox enabled_ch "Enabled" checked:walkthroughops.isEnabled offset:[0,-4]
					checkbutton active_cb "Active" checked:walkthroughops.isActive highlightColor:(orange*0.8) width:173 align:#left offset:[-4,2]
				)
				group "Settings: "
				(
					checkbox vert_lock_ch "Lock Vectical" checked:walkthroughops.lockVertical align:#left offset:[0,2]
					checkbox horz_lock_ch "Lock Horizontal" checked:walkthroughops.lockHorizontal align:#left offset:[0,0]
					checkbox accelerate_ch "Accelerate" checked:walkthroughops.accelerate align:#left offset:[0,4]
					
					spinner step_size_sp "Step Size: " type:#float range:[0, 1e6, walkthroughops.stepSize] fieldwidth:56 align:#right offset:[4,0]
					spinner sensitivity_sp "Sensitivity: " type:#float range:[0, 1e6, walkthroughops.sensitivity] fieldwidth:56 align:#right offset:[4,0]
				)
				group "Navigation: "
				(
				)
				local ui_controls = 
				#(
					#(enabled_ch, 		#checked, 	#isEnabled),
					#(active_cb, 		#checked, 	#isActive),

					#(vert_lock_ch, 	#checked, 	#lockVertical),
					#(horz_lock_ch, 	#checked, 	#lockHorizontal),
					#(accelerate_ch, 	#checked, 	#accelerate),
					
					#(step_size_sp, 	#value, 	#stepSize),
					#(sensitivity_sp, 	#value, 	#sensitivity)
				)
				fn updateUI id:#get =
				(
					updating = on
						
					if id == #set then
					(
						for c in ui_controls do if (v = getproperty c[1] c[2]) != getproperty walkthroughops c[3] do setproperty walkthroughops c[3] v
					)
					else if id == #get then
					(
						for c in ui_controls do if (v = getproperty walkthroughops c[3]) != getproperty c[1] c[2] do setproperty c[1] c[2] v
					)
					else
					(
						c = ui_controls[id]
						setproperty walkthroughops c[3] (getproperty c[1] c[2])
					)
					
					updating = off
				)
				
				on walk_timer tick do if not updating do
				(
					updateUI()
					--updateToolbarButtons()
				)
				
				on active_cb changed state do
				(
					if state and not walkthroughops.isactive do 
					(
						walkthroughops.start()
					)
					if not state and walkthroughops.isactive do 
					(
						walkthroughops.stop()
						max select
					)
					updateUI()
				)
				
				on vert_lock_ch changed state do updateUI id:3
				on horz_lock_ch changed state do updateUI id:4
				on accelerate_ch changed state do updateUI id:5
				on step_size_sp changed value do updateUI id:6
				on sensitivity_sp changed value do updateUI id:7
				
				on dialog close do
				(
					walk_timer.active = off
					owner.opened = off
					
					updateToolbarButtons()
				)
				on dialog open do
				(
					owner.opened = on
					walk_timer.active = on
					updating = off
					updateToolbarButtons()
				)
			)
		),
		fn distroy =
		(
			destroydialog dialog
		),
		fn create =
		(
			createdialog dialog
		),
		on create do
		(
			try
			(
				destroydialog ::EZ_WALK_STRUCT.dialog
			)
			catch()
			
			global EZ_WALK_STRUCT = dialog.owner = this
		)
	)
	local walkthrough_str = walkthrough_struct()
	
	on isenabled do
	(
		walkthroughops.isEnabled
	)
	on ischecked do 
	(
		walkthrough_str.opened
	)
	on execute do 
	(
		if not walkthrough_str.opened then walkthrough_str.create() else walkthrough_str.distroy()
 		updateToolbarButtons()
	)
)

 

You need to add navigation functionality, storing/restoring dialog recent placement and dock state, and maybe something else

Message 3 of 19

Haider_of_Sweden
Collaborator
Collaborator

Thank you very much @denisT.MaxDoctor 

 

This is a very beautiful solution.

I will mark the post as a solution and if anyone who sees this wants to add features to it, please share your solution with the community by posting a reply here.

0 Likes
Message 4 of 19

denisT.MaxDoctor
Advisor
Advisor

I was interested in this task, although I don’t see much point in such a substitution ... but nevertheless.
I'm assuming you want by pressing (releasing) a button to simulate typing DOWN/UP arrow keys (up, down, left, right)?
Built-in rollout button controls cannot work this way. They capture focus. They must be released to release the focus. Here's how they're made. Maybe ImgTags can be used instead. Or it's probably possible to use .Net or Qt buttons. But they also need to be set to something other than the default.

0 Likes
Message 5 of 19

Haider_of_Sweden
Collaborator
Collaborator

@denisT.MaxDoctor wrote:

I was interested in this task, although I don’t see much point in such a substitution ... but nevertheless.


 

You're right Denis - the navigation itself is of little use. I made that mockup to have something to work on.

The commands were taken from the macroscripts below.

Haider_of_Sweden_0-1649567663048.png

 

 

What is of bigger use is the possibility to dock and store its dock location upon the next Max launch.

This should be something rather common, no? Do you have the time to make your EZ Walk dockable? 

0 Likes
Message 6 of 19

denisT.MaxDoctor
Advisor
Advisor

I'm not an art content developer, so I don't (almost never) use the Walk Through navigation mode.

Could you (or someone else) explain to me who the target users are and how they typically use it?

Why a custom UI for the Walk Through might be better or more useful than the MAX built-in solution? 

Is the built-in missing some useful features?

 

0 Likes
Message 7 of 19

Haider_of_Sweden
Collaborator
Collaborator

@denisT.MaxDoctor wrote:

I'm not an art content developer, so I don't (almost never) use the Walk Through navigation mode.

Could you (or someone else) explain to me who the target users are and how they typically use it?

Why a custom UI for the Walk Through might be better or more useful than the MAX built-in solution? 

Is the built-in missing some useful features?

 


The features you added are probably enough. Additions like a dockable window would make it more usable (people would use it more often).

 

As for who is the target user; people working with archviz or one way or another need to control the camera. Compared to the viewport that you can control with hotkeys, press Z to zoom in to selected objects, etc, the camera won't give you all the keyboard hotkey controls.

 

Sometimes I select the target and move it around.

But the best way, in my opinion, is using Walkthrough mode. Until your UI, being able to change the speed was tedious because you had to press Increase/Decrease so many times until you finally reached the speed you needed.

0 Likes
Message 8 of 19

denisT.MaxDoctor
Advisor
Advisor

@Haider_of_Sweden wrote:


As for who is the target user; people working with archviz or one way or another need to control the camera. Compared to the viewport that you can control with hotkeys, press Z to zoom in to selected objects, etc, the camera won't give you all the keyboard hotkey controls.

 


The scenario you describe, however strange it may seem, has little to do with the built-in walkthrough mechanism. In walkthrough, the most and fundamentally important thing is to keep the speed of movement (this uses a quite complicated asynchronous timer). It's very easy to just move the camera (or change camera (view) transform) using custom UI. Moreover, we could not only translate the camera, but also rotate, spin, or orbit it. The maintaining the speed (keep specified timing) is necessary for walkthrough to set transform keys correctly, and if you don't care about it, everything becomes much easier. The camera control functionality can be significantly improved and expanded compared to the built-in walkthrough.

0 Likes
Message 9 of 19

klvnk
Collaborator
Collaborator

a little fun script for walkthrough.....

 

-- file: surface_walker_demo.ms
-- about: creates a terrain mesh with RayMeshGridIntersect custom attribute which is used as a collision detection in
-- viewport redraw callback and walkthrough mode.

rayGrid= attributes raygrid_attr_desc
attribID:#(0x4d193339, 0x60f3f7b8)
(
	local cGrid = undefined;
	parameters main rollout:params
	(
		gridsize type:#float ui:gridsize_spnr default:100.0;
	)
	fn IsRayGridInitialized = (cGrid != undefined);
	fn Initialize obj size:100 =
	(
		gridsize = size;
		if cGrid != undefined then
			cGrid.free();
		else
			cGrid = RayMeshGridIntersect();
		cGrid.Initialize gridsize;
		cGrid.addNode obj;
		cGrid.buildGrid();
	)	
	fn getNode = refs.dependentnodes (custAttributes.getOwner this) firstonly:on
	rollout params "Ray Mesh Grid Params"
	(	
		button delete_btn images:#("enss_tools_16i.bmp", "enss_tools_16a.bmp", 13, 3, 3, 4, 4, true) across:2 align:#left offset:[-2,0]
		spinner gridsize_spnr "Grid Size:" range:[0.0, 10000.0, 0] fieldwidth:48 type:#float scale:1.0 align:#right offset:[0,3]
			
		on gridsize_spnr entered fromspinner canceled do
		(
			if not canceled then Initialize (getNode()) size:gridsize;
		)	
		on delete_btn pressed do 
		(
			if cGrid != undefined do 
				cGrid.free();
			gc();
			custAttributes.delete (getNode()) rayGrid;
		)
	)
)	

struct SurfWalkerInterface
(
private

	sw_surface_walk_mode = off,
	sw_surface_object = undefined,
	sw_surface_offset = 1.93212,
	sw_yshift = 2.43396,
	sw_surface_script =	"tempI.sw_surface_following_vpcb()",
	sw_surface_fov = 84.0,
	sw_surface_savefov,
	sw_command_mode,

public	
	
	fn setSurfaceWalkObj obj 		= (sw_surface_object = obj),
	fn getSurfaceWalkObj 			= (sw_surface_object),
	fn setSurfaceWalkMode mde 		= (sw_surface_walk_mode = mde),	
	fn getSurfaceWalkMode  			= (sw_surface_walk_mode),
	fn getSurfaceWalkfov			= (sw_surface_fov),
	fn setSurfaceWalkfov fov		= (sw_surface_fov = fov),
	fn getSurfaceWalksavefov		= (sw_surface_savefov),
	fn setSurfaceWalksavefov fov	= (sw_surface_savefov = fov),

	
	fn sw_surface_following_vpcb = if not isdeleted sw_surface_object do
	(
		tm = inverse (viewport.getTM());	
		i = sw_surface_object.cGrid.intersectRay (tm.row4) [0,0,-1.0] false;	
		if i != 0 then
		(		
			ipos = (tm.row4) + [0,0,-1.0] * sw_surface_object.cGrid.getHitDist i;
			tm.row4 = ipos + [0,0,sw_surface_offset];
			viewport.setTM (inverse tm);
		)
		gw.hRect (box2 10 10 10 10) red;
		gw.hText [25,6,0] "surfwalker on" color:black
	),
	
	on create do sw_surface_object = undefined;
)	

tempI = SurfWalkerInterface();

fn CreateScene =
(
	p = plane width:200 length:200 lengthsegs:100 widthsegs:100 pos:[0,0,0];
	p.mat = standard();
	p.wirecolor = color 32 32 48; 
	m = Noisemodifier fractal:true strength:[0.0,0.0,20.0];
	addModifier p m;
	converttoPoly p;
	viewport.setLayout #layout_1;
	viewport.setType #view_persp_user;
	viewport.setTM (matrix3 [0.754708,-0.140881,0.640756] [0.656061,0.162066,-0.737102] [-1.2964e-006,0.976671,0.214739] [-14.1606,6.68998,-114.909]);
	if (viewport.getGridVisibility viewport.activeViewport) then max grid toggle;
	viewport.SetShowEdgeFaces true;
	TargetDirectionallight rgb:(color 255 255 255) transform:(matrix3 [1,0,0] [0,0,1] [0,-1,0] [107.367,-3.44621e-006,78.84]) target:(Targetobject transform:(matrix3 [1,0,0] [0,1,0] [0,0,1] [0,0,0]))
	hide lights;
	tempI.setSurfaceWalkObj p;
	custAttributes.add p rayGrid;
	p.initialize p;	
	tempI.setSurfaceWalkMode on;
	registerRedrawViewsCallback tempI.sw_surface_following_vpcb;
	tempI.setSurfaceWalksavefov (viewport.GetFOV());
	viewport.SetFOV (tempI.getSurfaceWalkfov());
	walkThroughOps.start();
)	

unRegisterRedrawViewsCallback tempI.sw_surface_following_vpcb;
delete objects;
CreateScene();

-- uncomment the next line and evaluate the script to exit the terrain following mode
-- unRegisterRedrawViewsCallback tempI.sw_surface_following_vpcb

 

Message 10 of 19

Haider_of_Sweden
Collaborator
Collaborator

@denisT.MaxDoctor wrote:

As for who is the target user; people working with archviz or one way or another need to control the camera. Compared to the viewport that you can control with hotkeys, press Z to zoom in to selected objects, etc, the camera won't give you all the keyboard hotkey controls.

The scenario you describe, however strange it may seem, has little to do with the built-in walkthrough mechanism. In walkthrough, the most and fundamentally important thing is to keep the speed of movement (this uses a quite complicated asynchronous timer). 


The Walkthrough tool is indeed useful for looking and walking.

Other tools have similar features, for example, Sketchup

Haider_of_Sweden_1-1650947530326.png

 

Or Revit

Haider_of_Sweden_0-1650947522558.png

 

 

What I was missing was a proper way to adjust the speeds.

But I might be missing something. What else would you suggest can be done with Walkthrough?

 

 

The camera control functionality can be significantly improved and expanded compared to the built-in walkthrough.


Again, I don't know what you know - if you have any examples of how to improve and expand the camera functionality, please do share some examples and solutions.

As a non-developer, I don have any insights into the possibilities, but love to see them 🙂

0 Likes
Message 11 of 19

Haider_of_Sweden
Collaborator
Collaborator



@klvnk wrote:

a little fun script for walkthrough.....


Wow! This is soo cool! 

Thanks for sharing!

 

Three questions:

1) After turning it off

 

 

 

 

unRegisterRedrawViewsCallback tempI.sw_surface_following_vpcb

 

 

 

 

How can I turn it on again without evaluating the whole code? The code does generate the terrain and all, but since its already there, I assume you can just bring back the view onto the terrain

 

 

2) How can I use this to attach the "person" onto a given terrain?

This "fun script" is a game-changer in ways - you can control the movement in relation to a surface that is missing right now

 

3) I assume you can activate this feature with a camera too.

 

If you have the time, I would love to see a small UI that lets you pick a surface to walk on + exposing values like sw_surface_offset etc  

0 Likes
Message 12 of 19

denisT.MaxDoctor
Advisor
Advisor

here is a very simple example how to navigate the active viewport...

you can play with the parameters and implement FOV and ZOOM if you like.

 

 

 

try(destroydialog ViewNavigatorDialog) catch()
rollout ViewNavigatorDialog "Viewport Navigation" width:191
(
	timer mover_tm active:off interval:50
	dotnetcontrol cam_up_bt    "Button" text:"Up" width:56 height:23 align:#center offset:[0,2]
	dotnetcontrol cam_left_bt  "Button" text:"Left" width:56 height:23 align:#left offset:[-5,0] across:3
	dotnetcontrol cam_front_bt "Button" text:"Front" width:56 height:23 align:#center offset:[0,0]
	dotnetcontrol cam_right_bt "Button" text:"Right" width:56 height:23 align:#right offset:[4,0]
	dotnetcontrol cam_down_bt  "Button" text:"Down" width:56 height:23 align:#center offset:[0,0]
	dotnetcontrol cam_back_bt  "Button" text:"Back" width:56 height:23 align:#center offset:[0,4]
	dotnetcontrol cam_fov_bt   "Button" text:"FOV" width:56 height:23 align:#center offset:[0,4] enabled:off
	dotnetcontrol cam_zoom_bt  "Button" text:"Zoom" width:56 height:23 align:#center offset:[0,0] enabled:off

	dotnetcontrol cam_yaw_bt "Button" text:"Yaw" width:56 height:23 align:#center offset:[0,4]
	dotnetcontrol cam_pitch_bt "Button" text:"Pitch" width:56 height:23 align:#center offset:[0,0]
	dotnetcontrol cam_roll_bt "Button" text:"Roll" width:56 height:23 align:#center offset:[0,0]
	
	local navigation_controls = 
	#(
		cam_front_bt, cam_back_bt, cam_left_bt, cam_right_bt, cam_up_bt, cam_down_bt, 
		cam_yaw_bt, cam_pitch_bt, cam_roll_bt,
		cam_fov_bt, cam_zoom_bt
	)
						
	local tick_time = -1
	local can_move = false
	local inverse_action = off
	local current_action = #none

	fn navigate = 
	(
		can_move = (tick_time > 0)
		
		tm = getviewtm()
		tm = inverse tm
			
		h = 0.1 ---------------- set STEP SIZE (might be different for MOVE and ROTATE action)
		
		if inverse_action do h *= -1
		if keyboard.controlPressed do h *= 4
		if keyboard.shiftPressed do h *= 0.5
				
		t = timestamp()	
		delta = t - tick_time
		tick_time = t
		if can_move do 
		(
			a = h*delta
			tm = case current_action of
			(
				  #yaw: prerotatey tm a
				#pitch: prerotatex tm a
				 #roll: prerotatez tm a
				   #up: pretranslate tm [0, -a,  0]
				 #down: pretranslate tm [0, a,  0]
				 #left: pretranslate tm [a,  0,  0]
				#right: pretranslate tm [-a, 0,  0]
				#front: pretranslate tm [0,  0,  a]
				 #back: pretranslate tm [0,  0, -a]
			   default: tm
			)
			tm = inverse tm			
			viewport.settm tm
		)
	)
		
	on mover_tm tick do navigate()
	
	fn onMouseDown s a action:#move = 
	(
		tick_time = timestamp() - mover_tm.interval
		inverse_action = (s.mouseButtons != s.mouseButtons.Left)  
		current_action = action
	
		--format "mouse down\t % %\n" s a
		mover_tm.active = on
		navigate()
	)
	fn onMouseUp s a = 
	(
		tick_time = -1
		mover_tm.active = off
		--format "mouse up...\n" 
	)
	
	on cam_front_bt mouseDown s a do onMouseDown s a action:#front
	on cam_back_bt  mouseDown s a do onMouseDown s a action:#back
	on cam_left_bt  mouseDown s a do onMouseDown s a action:#left
	on cam_right_bt mouseDown s a do onMouseDown s a action:#right
	on cam_up_bt    mouseDown s a do onMouseDown s a action:#up
	on cam_down_bt  mouseDown s a do onMouseDown s a action:#down
	on cam_fov_bt   mouseDown s a do onMouseDown s a action:#fov
	on cam_zoom_bt  mouseDown s a do onMouseDown s a action:#zoom

	on cam_yaw_bt   mouseDown s a do onMouseDown s a action:#yaw
	on cam_pitch_bt mouseDown s a do onMouseDown s a action:#pitch
	on cam_roll_bt  mouseDown s a do onMouseDown s a action:#roll

	on cam_front_bt mouseUp s a do onMouseUp s a 
	on cam_back_bt  mouseUp s a do onMouseUp s a 
	on cam_left_bt  mouseUp s a do onMouseUp s a 
	on cam_right_bt mouseUp s a do onMouseUp s a 
	on cam_up_bt    mouseUp s a do onMouseUp s a 
	on cam_down_bt  mouseUp s a do onMouseUp s a 
	on cam_fov_bt   mouseUp s a do onMouseUp s a 
	on cam_zoom_bt  mouseUp s a do onMouseUp s a 

	on cam_yaw_bt   mouseUp s a do onMouseUp s a
	on cam_pitch_bt mouseUp s a do onMouseUp s a
	on cam_roll_bt  mouseUp s a do onMouseUp s a
	
	mapped fn initButton bt =
	(
		bt.backcolor = if bt.enabled then bt.backcolor.LightGray else bt.backcolor.Gray
		bt.FlatStyle = bt.FlatStyle.Flat
	)	
	on ViewNavigatorDialog open do
	(
		initButton navigation_controls
	)
)
createdialog ViewNavigatorDialog

 

 

all buttons work the same:
Left press - action
Right press - inverse action

 

+ CTRL - faster
+ SHIFT - slower

 

Release - stop action

 

 

Message 13 of 19

denisT.MaxDoctor
Advisor
Advisor

I see that some possible improvements could be added:


RESET/ALIGN

ACCELERATION/DECELERATION

INERTIA/DAMPING

SNAPPING

 

 

0 Likes
Message 14 of 19

Haider_of_Sweden
Collaborator
Collaborator

Thank you very much for this addition. 😻

(Sorry for not replying immediately, I am not ungrateful, just so much else that calls for my attention)

 

Your previous tool, EZ Walk is compatible with cameras.

Do you know why this latter one, the Viewport Navigation, is only supported by the viewport and not cameras?

 

 


@denisT.MaxDoctor wrote:

I see that some possible improvements could be added:


RESET/ALIGN

ACCELERATION/DECELERATION

INERTIA/DAMPING

SNAPPING


All improvements are welcome. 😀

 

Also, @klvnk - if you are around.

could you please have a look at my latest reply to your post:

https://forums.autodesk.com/t5/3ds-max-programming/ui-for-the-walkthrough-mode/m-p/11128457/highligh...

 

Thank you! 🙏

0 Likes
Message 15 of 19

Swordslayer
Advisor
Advisor

@Haider_of_Sweden wrote:

Haider_of_Sweden_0-1650947522558.png


Since you mention Revit and its navigation wheel which has a direct counterpart in max, I take it you already tried using that one (Views > SteeringWheels > Toggle SteeringWheels (Shift+W))?

0 Likes
Message 16 of 19

domo.spaji
Advisor
Advisor

I didn't want to ruin the fun  😁

In AutoCad also

0 Likes
Message 17 of 19

Haider_of_Sweden
Collaborator
Collaborator

Yes, and the same thing is missing with the Steering Wheel; the ability to read and set the value for the walk speed. That goes for all the Autodesk tools that offer the Steering Wheel. You're forced to fiddle with the value until you find a good speed.

 

With that said, I find the steering wheel useful for its other features.

Haider_of_Sweden_0-1660368608559.png

 

 

 

@Swordslayer and @denisT.MaxDoctor 

 

Any chance you could help me with klvnk's script?

 

Copy paste of the questions I had:

 

1) After turning it off...

unRegisterRedrawViewsCallback tempI.sw_surface_following_vpcb

 

How can I turn it on again without evaluating the whole code? The code does generate the terrain and all, but since its already there, I assume you can just bring back the view onto the terrain

 

2) How can I use this to attach the "person" onto a given terrain?

This "fun script" is a game-changer in ways - you can control the movement in relation to a surface that is missing right now

 

3) I assume you can activate this feature with a camera too, how?

0 Likes
Message 18 of 19

Swordslayer
Advisor
Advisor

@Haider_of_Sweden wrote:

Yes, and the same thing is missing with the Steering Wheel; the ability to read and set the value for the walk speed. That goes for all the Autodesk tools that offer the Steering Wheel. You're forced to fiddle with the value until you find a good speed.


SteeringWheelsOps.SpeedFactor = xyz
SteeringWheelsOps.IncreaseWalkSpeed()
SteeringWheelsOps.DecreaseWalkSpeed()

 

0 Likes
Message 19 of 19

Haider_of_Sweden
Collaborator
Collaborator

@Swordslayer wrote:


 

SteeringWheelsOps.SpeedFactor = xyz
SteeringWheelsOps.IncreaseWalkSpeed()
SteeringWheelsOps.DecreaseWalkSpeed()

 


So how would you set a speed?

I ran SteeringWheelsOps.IncreaseWalkSpeed() a couple of times, and then SteeringWheelsOps.SpeedFactor and I got the same number (speed value?) no matter how much I increased or decreased.

 

 

 

0 Likes