File: render_test.javascript

package info (click to toggle)
k3d 0.4.3.0-3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 51,716 kB
  • ctags: 81,610
  • sloc: cpp: 283,698; ansic: 64,095; xml: 61,533; sh: 9,026; makefile: 5,282; python: 431; perl: 308; awk: 130
file content (31 lines) | stat: -rw-r--r-- 847 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
//javascript

/// Boilerplate to determine which document to modify ...
function FindDocument(ScriptName)
{
	if(Document)
			return Document;
	else
			{
					if(Application.Documents.length == 1)
							return Application.Documents[0];
					else if(Application.Documents.length == 0)
							Application.UI.ErrorMessage("You must have an open document to run this script!", ScriptName + ":");
					else
							Application.UI.ErrorMessage("Not sure which document to use ... try using the desired document's Document Window > Tools > Play Script.", ScriptName + ":");
			}
			
	return null;
}

document = FindDocument("rendertest");
if(document)
	{
		camera = document.Object("Camera");
		if(camera)
			camera.RenderPreview();
		else
			Application.UI.ErrorMessage("Couldn't find object named \"Camera\" to preview", "render_test.javascript");
	}