Maxscript Tool Wishlist

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
Old 04 April 2013   #61
Originally Posted by JokerMartini: YEAH THAT would be great. I appreciate it.


-- Load your custome cui for hotkeys and colors

MaxRibbon.ShowRibbon False
ViewCubeOps.Visibility =False
cui.commandPanelOpen= false
ComponentManager = (dotnetclass "Autodesk.Windows.ComponentManager")
qatbar = ComponentManager.QuickAccessToolBar
qatbar.IsVisible = false
qatbar.IsMenuBarVisible = false
ComponentManager.InfoCenterToolBar.MaxWidth = 0
ComponentManager.InfoCenterToolBar.MinWidth = 0

--just little icon top-left will remain, create a little rollout and pin rollout to top of that icon.
__________________
http://3dcutout.com/

Last edited by MZ : 04 April 2013 at 09:46 PM.
 
Old 04 April 2013   #62
Originally Posted by JokerMartini: I know users could do it through maxscript but the point is to make a custom ui for artists to use and navigate about. Giving them less options and places to mess up.


i'm agreeing with you. we must remove all unused tools, update existing tools and create new tools.
__________________
http://3dcutout.com/
 
Old 04 April 2013   #63
Originally Posted by MZ: ...
--just little icon top-left will remain, create a little rollout and pin rollout to top of that icon.

that's my favorite
 
Old 04 April 2013   #64
Originally Posted by denisT: that's my favorite

he he, seems we had to life with it, I do'n know how we can remove(or optional) some other unused (for general users! not developers) tools from bottom toolbar like listener window, statusbar, curveeditor etc. maybe I had to remove toolbar and recreate my own.
__________________
http://3dcutout.com/
 
Old 04 April 2013   #65
Originally Posted by MZ: he he, seems we had to life with it, I do'n know how we can remove(or optional) some other unused (for general users! not developers) tools from bottom toolbar like listener window, statusbar, curveeditor etc. maybe I had to remove toolbar and recreate my own.


Invoke Expert Mode then add your UI back in?
__________________
Maxscript Made Easy...
http://davewortley.wordpress.com/
 
Old 04 April 2013   #66
Speaking of UI hacks, here is one I wanted to post for April Fools but forgot.
You can put it in your co-workers /scripts/startup folder. It is guaranteed to make you the most hated person in the office

(
global toolbarRandomizer
struct toolbarRandomizerStr
(		
	randomizer,

	--FUNCTIONS
	fn createAssembly =
	(		
		str="using System;\n"
		str+="using System.Runtime.InteropServices;\n"
		str+="using System.Windows.Forms;\n"
		str+="using System.Text;\n"
		str+="using System.Collections.Generic;\n"
		
		str+="namespace ToolbarRandomizer\n"
		str+="{\n"
		str+="class ToolbarRandomizer : NativeWindow\n"
		str+="{\n"		
			
		str+="public IntPtr HWnd
		{
			get { return Handle; }
			set 
			{
				if (Handle != IntPtr.Zero)
				{
					ReleaseHandle();
				}
				AssignHandle(value);
			}
		}\n"		
		
		str+="private static IntPtr ParentWindow;\n"
		
		str+="protected override void WndProc(ref Message m)\n"
		str+="{\n"		
		
		str+="	if (m.Msg == 0x210 && Handle != IntPtr.Zero) {\n"
		str+="		Randomize();\n"
		str+="	}\n"		
		str+="	base.WndProc(ref m);\n"		
		str+="}\n"		
		
		str+="[DllImport(\"user32.dll\", SetLastError = true, CharSet = CharSet.Auto)]
        private static extern int GetClassName(IntPtr hWnd, StringBuilder lpClassName, int nMaxCount);

        private static string GetClassName(IntPtr hWnd)
        {
            StringBuilder sb = new StringBuilder(255);
            GetClassName(hWnd, sb, 255);
            return sb.ToString();
        }"
		
		str+="[DllImport(\"user32.dll\", ExactSpelling = true, CharSet = CharSet.Auto)]
        public static extern IntPtr GetParent(IntPtr hWnd);\n"
		
		str+="[DllImport(\"user32\")]
        [return: MarshalAs(UnmanagedType.Bool)]
        public static extern bool EnumChildWindows(IntPtr window, EnumWindowProc callback, IntPtr i);\n"
		
		str+="public static List<IntPtr> GetChildWindows(IntPtr parent)
        {
            ParentWindow = parent;
            List<IntPtr> result = new List<IntPtr>();
            GCHandle listHandle = GCHandle.Alloc(result);
            try
            {
                EnumWindowProc childProc = new EnumWindowProc(EnumWindow);
                EnumChildWindows(parent, childProc, GCHandle.ToIntPtr(listHandle));
            }
            finally
            {
                if (listHandle.IsAllocated)
                    listHandle.Free();
            }
            return result;
        }\n"
					
		str+="private static bool EnumWindow(IntPtr handle, IntPtr pointer)
        {
            GCHandle gch = GCHandle.FromIntPtr(pointer);
            List<IntPtr> list = gch.Target as List<IntPtr>;
            if (list == null)
            {
                throw new InvalidCastException(\"GCHandle Target could not be cast as List<IntPtr>\");
            }
            if (GetParent(handle) != ParentWindow) return true;
            if (GetClassName(handle) != \"CustButton\") return true;
			RECT r;
			GetWindowRect(handle, out r);
			if (Math.Abs((r.Right - r.Left) - (r.Bottom - r.Top)) > 2) return true;
			list.Add(handle);            
            return true;
        }\n"
		
		str+="public delegate bool EnumWindowProc(IntPtr hWnd, IntPtr parameter);\n"
		
		str+="private void Randomize()
		{
			
			List<IntPtr> children = GetChildWindows(HWnd);
			List<RECT> rects = new List<RECT>(children.Count);
			List<RECT> newRects = new List<RECT>(children.Count);
			foreach (IntPtr c in children)
			{
				RECT r;
				GetWindowRect(c, out r);
				rects.Add(r);
			}
			
			Random rand = new Random(Environment.TickCount);
			for (int i = 0; i < children.Count; i++)
			{
				int index = rand.Next(rects.Count);
				POINT P = new POINT();
				P.X = rects[index].Left;
				P.Y = rects[index].Top;
				ScreenToClient(Handle, ref P);
				
				SetWindowPos(children[i], 0, P.X, P.Y, 0, 0, 5);
				rects.RemoveAt(index);
			}			
		}\n"	
		
		str+="public void Stop() { base.ReleaseHandle(); }\n"
		
		str+="[StructLayout(LayoutKind.Sequential)] 
		public struct POINT	{ public int X;	public int Y; }\n"
		
		str+="public struct RECT { public int Left; public int Top; public int Right; public int Bottom; }\n"     
		
		str+="[DllImport(\"user32.dll\")]
			static extern bool ScreenToClient(IntPtr hWnd, ref POINT lpPoint);\n"
		
		str+="[DllImport(\"user32.dll\")]\n"
		str+="private static extern bool GetWindowRect(IntPtr hWnd, out RECT rect);\n" 
		
		str+="[DllImport(\"user32.dll\")]\n"
		str+="[return: MarshalAs(UnmanagedType.Bool)]\n"
		str+="public static extern bool SetWindowPos(IntPtr hWnd, int hWndInsertAfter, int X, int Y, int cx, int cy, uint uFlags);\n"
		str+="}\n"
		str+="}\n"

		local csharpProvider = dotnetobject "Microsoft.CSharp.CSharpCodeProvider"
		local compilerParams = dotnetobject "System.CodeDom.Compiler.CompilerParameters"
		compilerParams.ReferencedAssemblies.addRange #("System.dll","System.Windows.Forms.dll","System.Drawing.dll")
		compilerParams.GenerateInMemory = on
		local compilerResults = csharpProvider.CompileAssemblyFromSource compilerParams #(str)
		
		for er =0 to compilerResults.errors.count-1 do print (compilerResults.errors.item[er].tostring())
		return compilerResults.CompiledAssembly.createInstance "ToolbarRandomizer.ToolbarRandomizer"
	),
	
	fn init =
	(
		if (randomizer != undefined) do randomizer.stop()
		randomizer = createAssembly()
		local hwnd = for w in windows.GetChildrenHwnd #max where w[5] == "Main Toolbar" collect uiAccessor.getFirstChildWindow w[1]
		randomizer.hwnd = dotnetObject "System.IntPtr" hwnd[1]
		
	),
	
	_init = init()
)
::toolbarRandomizer = toolbarRandomizerStr()
ok
)
 
Old 04 April 2013   #67
Originally Posted by DaveWortley: Invoke Expert Mode then add your UI back in?

What can i do when user exit expert mode?
__________________
http://3dcutout.com/
 
Old 04 April 2013   #68
Originally Posted by lo: Speaking of UI hacks, here is one I wanted to post for April Fools but forgot.
You can put it in your co-workers /scripts/startup folder. It is guaranteed to make you the most hated person in the office


Really? , it would be great if you show us an example.
__________________
http://3dcutout.com/
 
Old 04 April 2013   #69
Example of what? Run the code and click a button on the main toolbar. It could help train workers to use keyboard shortcuts instead of the mouse.
 
Old 04 April 2013   #70
lol , it was very fun, is it possible to access bottom toolbar by this method?
__________________
http://3dcutout.com/
 
Old 04 April 2013   #71
Sure, you just need to find the right handles. You can then hide controls using the ShowWindow native win32 function.
 
Old 04 April 2013   #72
Originally Posted by MZ: What can i do when user exit expert mode?


Disable the Expert-mode short-cut key and put a floating window over the button
__________________
Maxscript Made Easy...
http://davewortley.wordpress.com/
 
Old 04 April 2013   #73
Originally Posted by DaveWortley: Disable the Expert-mode short-cut key and put a floating window over the button

you forgot about the max script... cui.expertModeOff()
 
Old 04 April 2013   #74
Also recreating navigation section is hard and time consuming for me.
__________________
http://3dcutout.com/
 
Old 04 April 2013   #75
Originally Posted by MZ: Also recreating navigation section is hard and time consuming for me.

expert mode keeps trackbar visible
 
Thread Closed share thread



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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 01:16 AM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.