Run script from OSX command line?

#1
Run script from OSX command line?

I would like to run a Cheetah JS script from the command line. Is it possible to run Cheetah from the command line with arguments?

TIA
Jeff
 
#3
Thank you for your reply. I was afraid of that however. I'm trying to do some work with DEM data and developing a workaround for linking node output to a displacement modifier using a frame-by-frame animation script. Any help on this would be appreciated.

Jeff
 
#4
a workaround for linking node output to a displacement modifier
Dunno if this helps but C3D accepts movie clips as image input for the displacement modifier.
But there is no "bake animation" command.
If you could manage to render your node output with a solid shader or diffuse ambient to a plane with an orthographic camera, but fractured according to the UV texture mapping, you might get somewhere...
 

Attachments

Last edited:

podperson

Active member
#5
Actually you can do it but it's pretty gnarly.

Apple has added the ability to script ANY Cocoa app via AppleScript if Accessibility settings permit it.

So, you need to set up your Accessibility settings and then you'll need to write (ugh) AppleScript:

e.g.

Code:
on listScripts(type)
	set menu_name to type & " Script"
	tell application "System Events"
		tell process "Cheetah3D"
			name of every menu item of menu of menu item menu_name of menu of menu item "Script" of menu "Tools" of menu bar 1
		end tell
	end tell
end listScripts

on runScriptByName(type, name)
	tell application "Cheetah3D"
		activate
	end tell
	set menu_name to type & " Script"
	tell application "System Events"
		tell process "Cheetah3D"
			click menu item name of menu of menu item menu_name of menu of menu item "Script" of menu "Tools" of menu bar 1
		end tell
	end tell
end runScriptByName

runScriptByName("Macro", "Parameter Info.js")
listScripts("Polygon")
Edit: I've refactored the code above to be more readable and reusable. listScripts() will spit out all the scripts of a given type, while runScriptByName() does what it says on the lid.

So you can so something like the following:

  1. do all this crazy stuff
  2. write data into a javascript macro file inside the Cheetah 3D scripts folder.
  3. call the applescript from the command line which causes C3D to execute the script by name.
 
Last edited:
#6
Thank you for your response. That is the workaround I have been using. I would like to do this without the overhead of AS by calling a Cheetah macro from the command line using a JS file as an argument. But gnarly as it is, the above method gets at the 'workaround for linking node output to a displacement modifier' issue very effectively. By writing some JS dynamically, this method allows for some intermediate work on-the-fly. Using this method I'm creating dynamic changes to the input texture images of displacement modifier(s), while scripting the animation process.
 
Top