Go Back   AC3D Forums > Technical > AC3D Developers
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 21st July 2006, 12:09 AM   #1
Dennis
Senior Member
Professional user
 
Dennis's Avatar
 
Join Date: Jul 2003
Posts: 899
Default Toggle orth/3d state w/toolbar button

Hi all,

Is there a way to create a toolbar button (as in toolbar.tcl) to toggle Orth/3D view elements (like wireframe, headlight, etc) so that it will sync with the menu checkboxes? I'm sure it's a matter of calling the menu items, but I'm not sure how to do this...

Dennis
Dennis is offline   Reply With Quote
Old 21st July 2006, 02:48 AM   #2
Andy
Administrator
Professional user
 
Andy's Avatar
 
Join Date: Jun 2003
Posts: 4,366
Default Re: Toggle orth/3d state w/toolbar button

For most of the visual settings, there are two variables (one for orth and 3d) - so you can have different settings in each type of view.

Adding check buttons is more complicated but it's easy to add some buttons to the toolbar.

You can put this in a file in the scripts folder (e.g. wirefilled.tcl)

Code:
toolbar_add_button "Wire"  "set prefs_view3dmode 1; set prefs_filled_orth  0; ac3d redraw_all" "set views to wireframe"
toolbar_add_button "Filled"  "set prefs_view3dmode 0; set prefs_filled_orth  1; ac3d redraw_all" "set views to filled"
These buttons will set all views (orth and 3D) either to wireframe or filled.

Note that it's probably currently easier to press 'w' for this function (in orth or 3d windows) but it's a simple example.

For other variables that control the views, look in tcl/ac3d.tcl, at the menu commands.

Andy
Andy is offline   Reply With Quote
Old 21st July 2006, 03:37 AM   #3
Dennis
Senior Member
Professional user
 
Dennis's Avatar
 
Join Date: Jul 2003
Posts: 899
Default Re: Toggle orth/3d state w/toolbar button

Thanks Andy --- any way to make a single button that toggles the state (like a single "headlight" button)? Would be nice to save on the toolbar real estate...
Dennis is offline   Reply With Quote
Old 21st July 2006, 04:29 AM   #4
Andy
Administrator
Professional user
 
Andy's Avatar
 
Join Date: Jun 2003
Posts: 4,366
Default Re: Toggle orth/3d state w/toolbar button

Code:
global UI
checkbutton $UI(toolbar).light3d -text "3D Light"  -variable prefs_headlight -command "ac3d redraw_3d" 
pack $UI(toolbar).light3d -side left
Put this in a .tcl file in the scripts folder.
Andy is offline   Reply With Quote
Old 21st July 2006, 04:35 AM   #5
Dennis
Senior Member
Professional user
 
Dennis's Avatar
 
Join Date: Jul 2003
Posts: 899
Default Re: Toggle orth/3d state w/toolbar button

Perfect --- thanks again.
Dennis is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT -4. The time now is 01:14 PM.


AC3D Forum
(C) Inivis Limited 2020