View Single Post
Old 19th September 2014, 08:17 PM   #1
avesthefox
Member
Expert member
 
Join Date: Sep 2009
Posts: 59
Cool Hack: Shift/Nudge in TCE

I edited the UI of the TCE and changed the Shift section to instead edit the nudge variable(s)

you can now set a custom x and y nudge distance using this area of the TCE

(edit the code or download the attached tcl file and replace it in the tcl folder... be sure to make a copy of the old one in case of errors or you dont like the changes)

in ac3duvedit.tcl :

first, add these globals to the 'proc menu_uveditor { }' section

Code:
global nudgeX
global nudgeY
then edit and replace the shift section with this code:

Code:
set shiftf [section_frame $cp.shiftf "Shift/Nudge" ]
	pack $cp.shiftf -fill x
	
	set nudgeX prefs_uv_shift_x
	set nudgeY prefs_uv_shift_y
	
	entry $shiftf.mx -width 7 -textvariable prefs_uv_shift_x
	grid $shiftf.mx -row 0 -column 0
	entry $shiftf.my -width 7  -textvariable prefs_uv_shift_y
	grid $shiftf.my -row 0 -column 1
	
	set UI(uvmoveabs) [cbutton $shiftf.b2  "  set  " { set nudgeX $prefs_uv_shift_x ; set nudgeY $prefs_uv_shift_y  } "set the nudge variables"]
	grid $UI(uvmoveabs) -row 1 -column 0  -sticky e
	set UI(uvmoveabsneg) [cbutton $shiftf.b3  " shift " {set nudgeX $prefs_uv_shift_x ; set nudgeY $prefs_uv_shift_y ; ac3d uv_move_relative $nudgeX $nudgeY } "manually shift selected uvs by this amount"]
	grid $UI(uvmoveabsneg) -row 1 -column 1  -sticky w
	
	bind .uvedit <Up> { ac3d uv_move_relative 0 $nudgeY }
	bind .uvedit <Down> { ac3d uv_move_relative 0 -$nudgeY }
	bind .uvedit <Left> { ac3d uv_move_relative -$nudgeX 0 }
	bind .uvedit <Right> { ac3d uv_move_relative $nudgeX 0 }
once applied, start a new session of AC3D, open the TCE, set the desired nudge variables (then hit the 'set' button) and simply use the arrow keys to nudge the selected surface around.

I'm sure someone could improve on this. Maybe even make a better version. I simply just used the shift variables to set the nudge variables. :P

edit: special thanks to Andy for the nudge code in that other thread!
Attached Files
File Type: zip ac3duvedit.zip (4.9 KB, 228 views)

Last edited by avesthefox; 19th September 2014 at 08:27 PM.
avesthefox is offline   Reply With Quote