Cult3D Java API Documentation

Connect Java with Cult3D Designer


Connect Java with Cult3D Designer

In order to add functionality to Cult3D with Java, you must have methods in your Java startup class which are public and takes a string as its only parameter. Note, In the Cult3D Designer you should only call methods from your startup class.

EXAMPLE CODE

public void cult3dMethod(String designerArg)
{
}

In the Cult3D Designer choose View->Java Actions. In the window that pops up choose to add your compiled Java classes to the Cult3D Designer.
In the field where it says Startup class you choose the Java class which implements the com.cult3d.Cult3DScript.
If you have a Cult3D Designer prior to 5.2 you must write the name of the class which implements the com.cult3d.Cult3DScript, note you must also supply the extension .class for your startup class the first time you add it.

Click the (+) sign in front of your startup class and all your methods which are public and have a string as its only parameter is becoming visible. You can drag this Java methods to any Cult3D Designer events.

If you connect a Java method to a mouse event, the string parameter in the Java code will hold the name of the object you clicked on with the mouse. If you connect a Java method to a KeyEvent the key pressed will be passed to the string parameter, etc.

See the enclosed Cult3D Designer documentation for more information and some screenshots.