HowTo:Take full advantage of the Insert menu

From POV-Wiki
Revision as of 08:49, 31 December 2007 by Reactor (talk | contribs) (started article. Provided first example)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
This article is for users of all levels of experience, and applies to Win32-bit and Win64-bit POV-ray versions 3.0 and higher.

As noted in the documentation, it is possible to edit the Insert Menu. This is not an insignificant thing! Adding your own code to the Insert Menu or changing existing code to better suit your needs can make setting up a scene much easier.

This guide discusses some things that you might want to consider modifying:

Making Changes to Fit Your Coding Style

Over time I've developed some strong preferences when it comes to coding styles that I feel enhances a scene's readability, and I am sure others have also. When adding a lot of things to your code at once, reorganizing and cleaning up your code can take a while. With that in mind, why not change the code you frequently insert to fit your style?

Example: Insert Menu's standard version of a point light_source

// create a regular point light source
light_source {
  0*x                  // light's position (translated below)
  color rgb <1,1,1>    // light's color
  translate <-20, 40, -20>
}

My version of a point light_source, changed to match my coding style and the way I typically use them in a scene:

//****  SUN  (light source name)
light_source
{
	<100, 100, 100> * 10
	color rgb <1,1,1>
}

I prefer to use tabs instead of spaces for indents and I don't need the comments anymore because I know what the parameters do.

This may seem like a very minor change, but cleanliness and uniformity in code helps to increase readability. If you change all of the code you frequently insert to match your style, it will be much easier to rapidly enter understandable code.


Adding Your Own Blocks of Code

I recommend adding your own menu with submenus...