technical architecture.

process execution across a network

by on Dec.02, 2008, under Admin, Batching

A couple simple tricks you can do with the remote process execution of the Slave Utils for fun. (Also corresponding commandlines for use with the psexec, which is what the slave utils is batching

you can start a remote command line on any of the machines in your list simply by doing a cmd.exe in the ‘ProcessToStart’ line.. its a small thing, but its helpful for certain things.. ie: copying files from one remote machine to another remote machine.. its *MUCH* faster if you do something like that FROM one of the remote machines, and skip the middleman.

How to start VNC on a remote machine, and have it work interactively… when you’re not allowed to install it as a service! (Read: Our IT uses its own copy of vnc that we aren’t allowed to Co-Opt for our own uses.. so we end up with 2 copies running!)

Apparently its tricky to run interactive remote processes that are allowed to interact with the desktop under full local privileges?! Go figure. Anyway, This is what you would enter to launch the vnc with the same privileges as if you were at that computer and hit the shortcut.

cmd.exe /c start “c:\program files\Realvnc\winvnc\winvnc.exe” “c:\program files\Realvnc\winvnc\winvnc.exe”

what this converts to in actual command line is something along the lines of:

psexec \\computer -i -d -u DOMAIN\Login -p password cmd.exe /c start “c:\program files\Realvnc\winvnc\winvnc.exe” “c:\program files\Realvnc\winvnc\winvnc.exe”

so it used the login and pass to launch the remote cmd.exe, but then used the local system privileges with the start command. allowing it to have full network and desktop interaction privileges.

More to come later.

Leave a Comment :, , more...

DMG Reel

by on Dec.01, 2008, under Architecture, Portfolio, video

A quick dmg reel one of the guys cooked up a few months back, page: EwingColeDMG
[kaltura-widget wid=”jp5u0sa7ug” width=”410″ height=”364″ addpermission=”3″ editpermission=”3″ /]

testing out this Kaltura video plugin..

Leave a Comment :, , , , more...

3dsmax DirectX oddity

by on Nov.25, 2008, under maxscript, utility

Basic Problem: IT has enforced a Screensaver password policy here now Now, with the D3D view port driver, when you come back from a locked workstation, it doesn’t always instantiate the DX display correctly. we’re noticing on our workstations that it will come back working to a point.. IE: All of the geometry on screen is selectable, but only ~20% of it is displayed with edges in max.

a hack to fix it without having to restart max every time the computer locks on you, I’ve found i can Disable and then Enable the Direct3D Cached meshes.. this works.. in a crappy sort of way.

Here’s some code that toggles the d3d cached.. it also helps to show how to access things in max that are not readily open to the maxscript language, by using windows messaging to “push” buttons on dialogs! most credit to Richard at cgtalk!

toolTip="toggle the Use Cached D3DXMeshes Viewport"
buttonText="toggle the Use Cached D3DXMeshes Viewport"
--start macro
-- toggles the "Use Cached D3DXMeshes" checkbox of the Viewport configuration
--diable it while
 dialogMonitorOps.enabled = false
 global prefsDialog_hwnd = undefined
 global retMessage=""
 fn toggleCachedD3DMeshes = (
	 --Constants for sendMessage method	
	local BM_GETSTATE = 0xF2
	local BM_CLICK = 0xF5
	local BM_SETCHECK = 0xF1
	local BST_CHECKED = 0x1	 
 	local hwnd = dialogMonitorOps.getWindowHandle()
 	local dialogTitle = uiAccessor.getWindowText hwnd
 	if (dialogTitle != undefined) then (
 		if (dialogTitle == "Preference Settings") then (
			prefsDialog_hwnd = hwnd
			format "We're in the preferences dialog\n" 
			local hwnd_children = uiAccessor.getChildWindows hwnd
 			for i = 1 to hwnd_children.count do (
 				local hwnd_child_title = uiAccessor.getWindowText hwnd_children[i]
				if (findString hwnd_child_title "Configure Driver..." == 1) then (
					format "found config button... pressing\n"
					local hwnd_config = hwnd_children[i]
 					uiAccessor.pressButton hwnd_config
		else if (dialogTitle == "Configure Direct3D") then (
			local hwnd_children = uiAccessor.getChildWindows hwnd
 			for i = 1 to hwnd_children.count do (
 				local hwnd_child_title = uiAccessor.getWindowText hwnd_children[i]
				if (findString hwnd_child_title "Use Cached D3DXMeshes" == 1) then (
					format "found the cached button\n"
					local hwnd_cached = hwnd_children[i]
					local CheckState = windows.sendMessage hwnd_cached BM_GETSTATE 0 0
					local IsChecked = bit.get CheckState BST_CHECKED
					format "the checkbox was: %\n" IsChecked
					-- Uncheck it
					if IsChecked then
						windows.sendMessage hwnd_cached BM_CLICK 0 0
						windows.sendMessage hwnd_cached BM_SETCHECK 0 0
						format "Cached D3DXMeshes has been disabled.\n"
						format "Pressing OK on the ConfigureD3D page\n"
						uiAccessor.sendMessageID hwnd #IDOK
						format "Pressing OK on the Preferences page\n"
						uiAccessor.sendMessageID prefsDialog_hwnd #IDOK
						retMessage="Turning the CachedD3DXMeshes *OFF*"
					-- Check it
					else if not IsChecked then
						windows.sendMessage hwnd_cached BM_CLICK 0 0
						windows.sendMessage hwnd_cached BM_SETCHECK 1 0
						format "Cached D3DXMeshes has been enabled.\n"
						format "Pressing OK on the ConfigureD3D page\n"
						uiAccessor.sendMessageID hwnd #IDOK
						format "Pressing OK on the Preferences page\n"
						uiAccessor.sendMessageID prefsDialog_hwnd #IDOK
						retMessage="Turning the CachedD3DXMeshes *ON*"
fn toggleUseCache =
	dialogMonitorOps.interactive = false
	dialogMonitorOps.unregisterNotification id:#setD3DCache
	dialogMonitorOps.registerNotification toggleCachedD3DMeshes id:#setD3DCache
	dialogMonitorOps.enabled = true
	--run it
	max file preferences
	--disable it!
	dialogMonitorOps.enabled = false
	dialogMonitorOps.unregisterNotification id:#setD3DCache
	--messagebox retMessage
format retMessage
Leave a Comment :, , more...

Maxscript: Grid by Name

by on Nov.07, 2008, under Architecture, maxscript, utility

Here’s a useful one i made in 2003, one of my first scripts actually! posting it up because i find myself using it ~60 times a day on this current project with curved/angled bits all over it!

A Helper dialog to speed up working with custom Grids. Helps immensely in the workflow of angular modeling (read: silly modern architecture) when combined with a hotkey to create grid and autogrid >:)

Basics: It populates the dialog with all current grids in the scene, including the HomeGrid. you can double click on any grid to activate that, also has buttons to change the view to match the grid, and to select the current active grid. also includes a cycle of the Toolmodes (View/World/Parent/Screen/Local/Gimbal/Grid)

— if there are no grids in the scene, then toggle between the toolmodes
— if there is just 1 grid in the scene, toggle between it and the Home Grid
— if there are grids in the scene, open the window
— if there are grids in the scene and the window is already open, toggle between the grids

1 Comment :, , more...

Maxscript: Vray Light Calc Filenames

by on Nov.02, 2008, under maxscript, vray

Here’s a relatively simple script thats already saved me many headaches.

Vray Light Calc switcherizer

Vray Light Calc switcherizer, click image to download script.

Basic Gist: as its set up It will create a directory called ‘Calcs’ under the directory where your maxfile is at, and will switch your filenames for vray irradiance maps and light cache back and forth between saving to, and loading from file in that directory, it will save the calcs as “maxfilename_cameraname.vrlmap/vrmap’

its set to use a UNC directory where possible, and to use irradiance map and light cache. Theres not much error checking in it, its currently set up to work for us internally, If anyone has issues with it, you can contact me. I think its helpful, but not ‘solid?’ enough to drop up onto scriptspot as yet.


1 Comment :, , more...

Recent work

by on Nov.02, 2008, under Architecture, Portfolio, video

I’ve been a bit busy this month oversee’ing a fair sized animation project, so I’ve been a bit away from the scripting fun of late. There’s a few useful tricks I’ve picked up and will work out some posts shortly 🙂

Here’s a couple shot snippets from one of the latest projects. 2 out of 20ish from a pretty large site 😉

Leave a Comment :, , more...

working :)

by on Oct.04, 2008, under python, utility

yay, all the right clickies work.

9 Comments :, more...

Diving into Python.

by on Sep.28, 2008, under python

So I got a few hours over this last week to start poking my nose into this Python thing that everyone seems so up in arms about. And I must say, its pretty damn neat so far!

from a suggestion on the forum I took a look into the Wing IDE to help get started and its very very nice. its a bit pricey however, so I’m going to poke through a couple different IDE’s after my trial expires and see what all the fuss is about all around.

So! I decided a good thing to do would be to go for a speedier version of my asset browser maxscript, as in maxscript it takes ~20 seconds to parse through a fair sized directory structure, and I had to build my own caching mechanisms and data structures to even speed that up to 5seconds at startup. Another problem was the generation of the dynamic webpage when you change directory views could take up a few seconds each click also. all this to essentially pass a filename to max? Pssh!

Well, I’ve got a start going in python by using a slight modification of the Lazy Evaluation Directory Treeview sample found on the wxPyWiki. combined with the ThumbnailCtrl from Andrea Gavana. And its blazing fast in terms of thumbnail generation from even very large images and directory structures.!

combine those with the fun examples of using the COM classes to talk to max from Adam, and lets see how this turns out!

Not bad for a night.. Now to finish it off and connect it to max.. someday when i get more free time 😉

Leave a Comment :, , , more...

Adventures in maxscript.. (Or, asset management part 2.)

by on Aug.26, 2008, under maxscript

A couple days later, and a few hours of learning in, and i’ve built up the starting point for what i think is a somewhat useful asset/library management system.

The Basics as they stand so far:

  • Choose a root directory that you have your meshes stored at.
  • for each directory in the root tree, add an entry to the treeview on the left, a’la explorer.
  • when you click on any leaflet of the treeview, we build on the fly an html thumbnail page of the Maxfiles/Thumbnails in the directory with a few basic informational items.
  • clicking on a thumbnail, imports a model.

That glosses over some of the fun parts of getting the thumbnails of each model, and general organizational bits involved in maintaining your asset library, but thats it, clean and simple.

Its what i imagine that Utilities menu ‘Asset Library’ would do, if it didn’t just make max fast exit.


Now to evaluate the work involved in making it bulletproof enough to possibly be useful outside of our small studio.

  • Features on the horizon:
  • fully cached directories (Done!, only recurse the filesystem once.)
  • Multiple Library Classes:
    • Mesh
    • Material
    • Texture
    • Texture as Billboard
  • Queue of meshes to load
  • Placement of meshes on load? OR integrate the idrop functionality
  • include maxfiles that do not have thumbnails (extracting the explorer thumbnail preview)

Well, that’s probably enough to kill off my free time for a few more days.. Heh!

6 Comments more...

Maxscript: Zoom Extents

by on Aug.18, 2008, under maxscript

Who would have thought this would be a pain? All i wanted to do was have a default camera zoom to fit on all objects in a scene, regardless of their size/distrobution.

turns out theres code in the maxscript docs that can do it, but it does it by way of modifying the FOV of the camera to fit. thats all good, as long as you’re not working with hugely varying size objects.. re: how far away from the objects is your camera to start will determine how wide the view is. functional, but not ideal.

here’s a little function snippet that does the same functions, but will create a camera, rig it up to a certain direction, and then move it out on its local Z axis until the set of objects is fully in view.

Again, something i’m using in conjunction with Paul’s Batching script refrenced below.

7 Comments : more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!