Home Technical Talk

turboTools v1

Just put up my toolbar I made for 3DS Max over the last couple of weeks. Let me know if you find any issues, or would like some other features added.


turboToolsv1.jpg

http://www.matthewlichy.com/Scripts.html



-Matt

Replies

  • mLichy
    Options
    Offline / Send Message
    Oh... I should mention... the only thing hotkeyable right now is the toolbar itself..

    I can probably hotkey the others if u guys want. Maybe even through a rightclick menu, then say Assign to hotkey "Key".


    Edit: Also, thank you to Enrico Gullotti for your help :D.

    Note: These Tools MAY work on Max 7-2010, but some tools will only work for Max 2008 +. I will have to note which ones on my site/and/or change the tools to work for all versions, or disable for certain ones.
  • mLichy
    Options
    Offline / Send Message
    Update: You can get turboTools v 1.2.2 now on my site if u want.

    http://www.matthewlichy.com/Scripts.html

    M
  • pior
    Options
    Offline / Send Message
    pior grand marshal polycounter
    looking very cool man, will try it out. I dont think it will fit my workflow 100% but its bound to spark cool ideas !

    How did you put the interface together btw? Looks like a very clean way to organize scripts ...
  • mLichy
    Options
    Offline / Send Message
    I used a Floating Rollout window, then just added rollouts to it. Right now it will save the position if u want it to. But Enrico mentioned I can do the same with an .ini file, and do other functions easier as well.

    So I am going to look into saving the windows position today, plus the rollouts open/close state, and the windows height.
  • mLichy
  • BradMyers82
    Options
    Offline / Send Message
    BradMyers82 interpolator
    Hey man, this is a really good idea. I would definitely make it possible to set hotkeys though. I have some freelance work lined up where I will be making a bunch of guns. I'm going to give this a try for sure. Thanks!
  • mLichy
    Options
    Offline / Send Message
    Brad, my newest version on my site now has almost all (but maybe 4) buttons Macros. Although if u set shortcuts, they won't work unless the Keyboard Shortcut Over-Ride toggle is off... this is a max issue I guess.


    Anyways, I have Version 1.2.3 on my site now, now with Videos for each tool!

    http://www.matthewlichy.com/Scripts.html

    Note: In the videos I'm running my 1.2.4 version, so some of those tools won't be in yet.

    I will be updating to Version 1.2.4 Tonight or tomorrow with new tools/bug fixes, and so on.


    M
  • Joshua Stubbles
    Options
    Offline / Send Message
    Joshua Stubbles polycounter lvl 19
    Cool! But not nearly as cool as if you'd have used "Z" at the end of "Tools"... ;D

    I'll be trying these out as well, looks like I could use some of those for sure.
  • renderhjs
    Options
    Offline / Send Message
    renderhjs sublime tool
    I hope you don't mind but here are some code snippets for tools I use frequently and collected or wrote over the years.
    1. single click turbo smooth swap (on \ off)
      function switch_turbosmooth obj=(
      	for o in obj do if  superclassof  o == geometryClass do (
      		for mod in o.modifiers where classof mod == turbosmooth do(
      			if o.turbosmooth.enabled then(
      				o.turboSmooth.enabled = false;
      			)else(
      				o.turboSmooth.enabled = true;
      			)
      		)
      	)
      )
      
    2. merge selected object to 1 single poly: (most used script, I press it as well whenever I need to convert anything to a poly)
      try(
      			disableSceneRedraw()
      			for i in 1 to selection.count do
      				Try(ConvertTo Selection[i] Editable_Poly)Catch()
      		
      			baseObj = selection[1]
      			items = #()
      			for s in selection do append items s
      			
      			for i in items do (
      				if (i != baseObj) then (
      					if (classof i == Editable_mesh) or (classof i == Editable_Poly) then
      						baseObj.EditablePoly.attach i baseObj
      				)
      			)
      			enableSceneRedraw()
      			completeRedraw()
      		)catch()
      
    3. place to 0 on closest axis like x,y or z (useful when modeling symmetrical, just execute it and it snaps to the closest axis)
      disableSceneRedraw()
      			
      			x = abs $.pos[1];
      			y = abs $.pos[2];
      			z = abs $.pos[3];
      			placed = false;
      			
      			if (x!=0  and placed == false)then(
      				if ((x<y and y!=0) or y==0) then(
      					$.pos = [0, $.pos[2], $.pos[3]];
      					placed = true;		
      				)		
      			)
      			
      			if (y!=0  and placed == false)then(
      				if ((y<z and z!=0) or z==0) then(
      					$.pos = [$.pos[1],0, $.pos[3]];
      					placed = true;		
      				)
      			)
      			if (z!=0  and placed == false)then(
      				$.pos = [$.pos[1],$.pos[2],0];
      				placed = true;		
      			)
      
    4. shuffle object positions under each other (places will stay intact but the objects will be shuffled on those positions). Usefull when you want to scatter a set of objects randomly around a area. Just duplicate them several times, move them a bit apart and then execute this script with all of them selected)
      plist = for i in 1 to selection.count collect selection[i].pos
      			--rlist = for i in 1 to selection.count collect selection[i].rotation
      			for i in selection do(
      				local theidx = (random 1 plist.count)
      				i.pos = plist[theidx]
      				--i.rotation = rlist[theidx]
      				deleteitem plist theidx
      				--deleteitem rlist theidx
      			)
      
    5. random wireframe colors for selected objects
      for i = 1 to selection.count do
      			(
      				obj = selection[i];
      				obj.wirecolor = color (random 0 255) (random 0 255) (random 0 255)
      			)
      
    6. random rotation offset for selected objects (make scenes look more natural)
      (local range=5;
      			for i in 1 to selection.count do(
      				local x = ceil(random 0.0 2) as integer-1;
      				local y = ceil(random 0.0 2) as integer-1;
      				local z = ceil(random 0.0 2) as integer-1;
      				local new_angle = ceil(random 0.0 (2*range))-range;
      				rotate selection[i] (angleaxis new_angle [x,y,z]);
      			)
      )
      
    7. fix simple primitive objects values (box, plane, cylinder,...) to modeling friendly values. I.e no intersections on planes, 1 height intersection on cylinders,.... I execute this every time I create a primitive shape, it will automatically detect the supported type and apply my favorite settings.
      for i in 1 to selection.count do(
      				local obj = selection[i];
      				
      				try(
      					obj.backfacecull = true;--enable backface culling
      					
      				)catch();
      				
      				case (classof obj) of
      				(
      					Editable_Poly:(
      						--check for turbo smooth on/off
      						switch_turbosmooth obj;
      					)
      					PolyMeshObject:(
      						switch_turbosmooth obj;
      					)
      					Editable_mesh:(
      						switch_turbosmooth obj;
      					)
      					Box:(
      						selection[i].widthsegs = 1;
      						selection[i].heightsegs = 1;
      						selection[i].lengthsegs = 1;
      					)
      					Cylinder:(
      						selection[i].capsegs = 1;
      						selection[i].heightsegs = 1;
      						selection[i].sides = 12;
      					)
      					Plane:(
      						selection[i].lengthsegs = 1;
      						selection[i].widthsegs = 1;
      					)
      					Sphere:(
      						selection[i].segs = 8;
      					)
      	
      					default:(
      						local string_obj = (classof obj) as string+".*";
      						print("not supported");
      						showclass string_obj;
      					)
      				)
      				
      				
      				--print("type: "+(classof selection[i]) as string);
      			)
      
    8. sort objects in a row based on the size (I have a similar one for names as well)
      function sort_object_selection_by_size =(
      	local sel = selection as array
      	if (sel.count > 0)then(
      		
      		local min_pos = [sel[1].min.x, sel[1].min.y, 0];
      		
      		local sort_scale = #();
      		--local copies = #();--the instanced copy nodes
      		for a in sel do(
      			a.rotation = (quat 0 0 0 1); 
      			a.rotation = (quat 0 0 0 1); 
      			a.scale = [1,1,1];
      			
      			local bb= a.max - a.min;
      			sort_scale[sort_scale.count+1] = sqrt (bb[1]*bb[1] +bb[2]*bb[2] + bb[3]*bb[3]) + sort_scale.count;
      			
      			if (a.min.x < min_pos.x)then(
      				min_pos.x = a.min.x;
      			)
      			if (a.min.y < min_pos.y)then(
      				min_pos.y = a.min.y;
      			)
      		)
      		local sorted = deepCopy sort_scale;
      		sort sorted;
      		
      		local shift_x = 0;
      		min_pos.y+=128;
      		
      		for a = 1 to sel.count do(
      			--local idx = findItem (sort_scale) (sorted[copies.count-a+1]);
      			local idx = findItem (sort_scale) (sorted[sel.count-a+1]);
      			local b = sel[idx];
      
      			b.rotation = (quat 0 0 0 1); 	
      			local w = (amax #(b.max.x,  b.min.x) - amin #(b.max.x,  b.min.x))+32;
      			
      			b.pos.x = min_pos.x+shift_x + (b.pos.x - amin #(b.max.x,b.min.x) );
      			b.pos.y = min_pos.y+ (b.pos.y - amax #(b.max.y,b.min.y) );
      			
      			b.pos.z = min_pos.z;
      			
      			shift_x+=w;
      		)
      		select sel;
      	)
      )
      
    9. object snap to units (the snap tool in max snaps only relatively, this is always absolute)
      function snapPosition obj snap_units =(
      	local x = float (in coordsys parent obj.pos.x) / snap_units;
      	local y = float (in coordsys parent obj.pos.y) / snap_units;
      	local z = float (in coordsys parent obj.pos.z) / snap_units;
      	
      	if x - (floor x) < .5 then( x = floor x; )else( x = ceil x;)
      	if y - (floor y) < .5 then( y = floor y; )else( y = ceil y;)
      	if z - (floor z) < .5 then( z = floor z; )else( z = ceil z;)
      
      	x = x*snap_units;
      	y = y*snap_units;
      	z = z*snap_units;
      	
      	in coordsys parent obj.pos = [x,y,z];
      )
      
    10. snap vertex selection to absolute world units, perfect for prefab modeling that needs to snap to other prefabs:
      function vertex_snap obj snap_units xAxisUse yAxisUse zAxisUse = (
      	if (classof obj == Editable_Poly) then(
      		
      		local num_verts = polyop.getNumVerts obj;
      		local vert_selct = polyOp.getVertSelection obj;
      		local selected_verts_count = 0;
      		
      		for i = 1 to vert_selct.count do(--check how many verts are selected
      			if ( vert_selct[i] == true)then(
      				selected_verts_count+=1;
      			)
      		)
      		if (selected_verts_count == 0 or subobjectlevel != 1)then(--set selection to all
      			print("select ALLL");
      			vert_selct = #{1..num_verts};--set all selected to true in this byteArray
      			for i = 1 to num_verts do(
      				vert_selct[i] = true;
      			)
      			
      		)
      
      		for i = 1 to vert_selct.count do(
      			if ( vert_selct[i] == true)then(
      
      				local v = polyop.getVert obj i;--get the vertex point
      	
      				if (xAxisUse == true) then(
      					v.x = float v.x/snap_units;
      					if v.x - (floor v.x) < .5 then(
      						v.x = floor v.x;
      					)else(
      						v.x = ceil v.x;
      					)
      					v.x = v.x*snap_units;
      				)
      				if (yAxisUse == true) then(
      					v.y = float v.y/snap_units;
      					if v.y - (floor v.y) < .5 then(
      						v.y = floor v.y;
      					)else(
      						v.y = ceil v.y;
      					)
      					v.y = v.y*snap_units;
      				)
      				if (zAxisUse == true) then(
      					v.z = float v.z/snap_units;
      					if v.z - (floor v.z) < .5 then(
      						v.z = floor v.z;
      					)else(
      						v.z = ceil v.z;
      					)
      					v.z = v.z*snap_units;
      				)
      	
      				polyop.setVert obj i v;--update the vertex poistion
      			)
      		)
      	)
      )
      

    Those are some I really like and use in every project by adding and improving them every time a bit more.
    Feel free to copy them or use some snippets for your toolbar.

    I personally always prefer smart button that are very context sensitive, so for example if you have a convert to poly button not only will it convert to a poly but for example also merge several objects to one poly if more objects are selected.
    Or the same concept with opening the UV editor, just make it so that if there is not yet a UVW unwrap modifier available add it before calling the edit method in the UVWunwrap modfier.
    That way you can combine several tools that are all kind of related into 1 button and one has to think less when using the tools because the script will adapt to your selection type (single, multiple, edges, verts, faces,...) or object type.

    If you are into Baking or UV editing scripts have a look at the TexTools scripts that are all located in the MZP archive (just a zip archive) where every button of TexTools comes with its own maxscript file.
  • mLichy
    Options
    Offline / Send Message
    Updated my Tools again, now with VIDEOS!

    Thanks ALOT man for all that stuff :). Will look through it and see what I can learn :).

    Yeah, some of my tools do account for selections, and will warn u, or apply that function to multiple objects.

    The Convert Poly way your describing sounds nice, but I'm not sure if people would want that or not. I could however, add that function as a right click. :)



    Edit: Actually. I'm going to Add a Right Click Edit UVW to the Add & Edit, so you can just Edit and not Add a UVW. Will update video/site/download soon. So hold off :)
  • mLichy
    Options
    Offline / Send Message
    K, NOW you can download it.. :)
  • mLichy
    Options
    Offline / Send Message
    Alright... so after using my new release at work today quite a bit, I ran into a decent amount of bugs with my UVW Stuff, and also some other small bugs with other tools.

    I will be hopefully rolling out 1.2.5 tonight or tomorrow to fix all that stuff.

    Sorry for any issues I may have caused....
  • mLichy
    Options
    Offline / Send Message
    Fixed up alot of issues.. but still not going to update my site yet and officially announce 1.2.5. But if anyone who uses my tools wants the UV stuff to not crash, and same goes with some of the other tools (Poke Fake), download this for now...

    http://matthewlichy.com/turboTools_1.2.5_test.zip
  • mLichy
    Options
    Offline / Send Message
    Update:

    you can now download turboTools v.1.2.5

    http://www.matthewlichy.com/Scripts.html
  • mLichy
    Options
    Offline / Send Message
    Been a while, turboTools is up to version 1.2.8 now.

    turboTools_1.jpg


    http://www.matthewlichy.com/Scripts.html
  • Eric Chadwick
    Options
    Offline / Send Message
    Awesomeness, much appreciated.
  • kdm3d
    Options
    Offline / Send Message
    These tools are F'ING AWESOME. A great tool set for game asset pipeline. They pick up a lot of max's faults and make things go SO MUCH FASTER! Holy shit dude... much props.
  • Mime
    Options
    Offline / Send Message
    Mime polycounter lvl 14
    kdm3d wrote: »
    These tools are F'ING AWESOME. A great tool set for game asset pipeline. They pick up a lot of max's faults and make things go SO MUCH FASTER! Holy shit dude... much props.

    What he said.. helped me out a TON.
  • mLichy
    Options
    Offline / Send Message
    Thanks fellas :D.

    I want to add more to it.. but can't think of anything right now. I was working on a better Make Planar tool, which I had more or less working, but it wasn't accurate enough, so I didn't add it.
  • Mime
    Options
    Offline / Send Message
    Mime polycounter lvl 14
    I have a few suggestions if you don't mind.
    Some sort of UNIFY NORMALS (i hate going after that one small inverted face, or subobject)
    Also i would like a select n-sided poligons option. :)
    And last if possible, some sort of visual option to show where the meshes are open.


    Also i dont know if resetting xform always inverts the mesh , but if it does an option to reset xform and invert would be nice.


    Hope it helps :D

    Edit :

    Softimage screenshot of an open edge :

    openmesh_cr.jpg
  • BradMyers82
    Options
    Offline / Send Message
    BradMyers82 interpolator
    This is simply fantastic, great improvements!

    I have 2 sugggestions. I have high resolution monitors I use (1900x1200), And I notice that the menu gets cut off 2/3rds of the way down on my screen. It would be nice to see the whole menu at once, since my resolution permits it.

    The other thing is the "Turbo Settings" That would be great if we could also choose "isoline display" and "Explict Normals" for the "Add Turbo w/ Settings" shortcut. I always tick these options evertime I add turbo smooth, which is why I ask.

    This is a ton of work you have done here, and all for free! Very kind man, thanks a lot!
  • mLichy
    Options
    Offline / Send Message
    Thanks guys.

    Mime:

    Yeah, I can add a tick for the invert normals for Xforms, or change it back to how it was.. although having to flip them is annoying. But basically, if u do the reset, and the normals don't flip, your xforms were probably fine. But I will see if I can squeeze in the flip tick box or something.

    The unify normals I will look into, and also N-Sided faces. The open edges thing though, if you have max 2010, maybe 2009 does this too, but if you click on
    Smooth + Highlights or whatever, and go down to X-View, you can click on Open Edges.

    Brad:

    Yeah, I can add the isoline and explict normals stuff to that section.

    I have to look into the Add turbo w/settings stuff, I was right now actually. For some resaon it doesn't always take your values u enter.. at least it wasn't today at work... not sure why.. I need to look into that.



    I think I can fix the height issue too. I'll play around with that.....


    Edit:

    If you have 1.2.8 installed already, you can download the .zip again and just drop the .mzp into the viewport again and do install. I re-uploaded it again, but with the height fix and Attach to Epoly fix.

    Now when you close the toolbar with the X or close max, the height is saved, so that when u open the bar again, the area inside the toolbar is the height you'd expect. But u have to scale the toolbar height, then close the bar, and re-open to see the effect.

    For the Attach to Epoly fix, it now will attach Shape objects and not deselect them, or stop working and not do anything.

    More to come..... :)
  • mLichy
    Options
    Offline / Send Message
    Ok, updated my site and the download to 1.2.9.

    I fixed up a couple things, but mostly added new features/functions

    I added in:

    - Flip Faces for Xforms
    - Isolate Mesh Faces + UV Faces for the UV Isolation function
    - Unify Normals
    - Isoline and Explicit Normals check boxes for Add turbo with settings.
    - Now adjusts/saves the height of the bar properly when u scale it (After bar close/re-open).


    http://www.matthewlichy.com/Scripts.html

    M
  • Mime
    Options
    Offline / Send Message
    Mime polycounter lvl 14
    You are AWESOME. Thank you .
  • CompanionCube
    Options
    Offline / Send Message
    CompanionCube polycounter lvl 12
    nice update thanks :)
  • mLichy
    Options
    Offline / Send Message
    Updated again.

    Now v. 1.3.0
  • renderhjs
    Options
    Offline / Send Message
    renderhjs sublime tool
  • mLichy
    Options
    Offline / Send Message
    Not alot,

    Fixed:

    Fixed up the toggle Mods on Seletction so now it works properly. Before it would only toggle the mods if they were originally On, now it toggles each Modifier On/Off depending what was On/Off when the tool is run.


    Added:

    Created the Average Object Align tool. It lets you select an object, and align its position in many ways, to the average position of x amount of other objects.


    http://www.matthewlichy.com/videos/Avg_Obj_Align/Avg_Obj_Align.html
  • MattLichy
    Options
    Offline / Send Message
    Updated to 1.3.2 now

    Too lazy to reformat the text for html, so here's a screenshot. (taken with my new tool!)

    turboChanges.jpeg


    ****New to 1.3.2 ****

    Take Screen Shot

    http://www.matthewlichy.com/videos/screenshot/screenshot.html
  • Nysuatro
    Options
    Offline / Send Message
    Installed it and there is some really usefull stuff in your tool. Thanks for sharing.
  • MattLichy
Sign In or Register to comment.