ShiVa3D Application Programming Interface

The ShiVa3D API documentation is accessed by clicking on Help | Online Documentation. On the ShiVa Developer web page, expand the Script menu on the left-hand side of the pane, as shown in the following screenshot:

ShiVa3D Application Programming Interface

There is also a Search documentaion box in the top-left, which is incredibly handy—let's face it, browsing through an API is not always the best way to find something. The other thing that comes in handy for referencing the API is the Script Editor window itself. When the editor recognizes a function, it will show the arguments that it expects from you, as shown in the following screenshot:

ShiVa3D Application Programming Interface

In the previous screenshot, you can see that at the top of the editor it is telling us that it wants a handle to an object, three numbers, and the coordinate space. Recall the naming convention that we looked at earlier; the coordinate space is labeled kSpace, so it is a ShiVa constant. Since the translate function is a member of the object class, you can also find the constants for the coordinate space in the object class. Examples of kSpace values are object.kGlobalSpace, object.kLocalSpace, and object.kParentSpace. Once you get familiar with what those hints mean, then it really helps. Something similar pops up when we use the autocomplete feature, as shown in the following screenshot:

ShiVa3D Application Programming Interface

We can see that as we highlight a potential completion, a tooltip pops up with the basics of the function.

With these tools, it becomes easier to figure out what you need, but the tool that helps the most is experience. Spend some time using functions just to see what they do—you may find something surprising!

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.186.46