PfPOV

PfPOV is a plug-in for AC3D, and its main purpose is to export .pov files for POVRay in a non-destructive way.

Main features

Feature Description
Configuration PfPOV will read the .pov file before it overwrites it. By putting certain directives into the file PfPOV's behavior can be modified.
Object declarations All objectes are declared with unique names and can thus easily be accessed in POVRay for adjustments.
Group declarations The object & group hierachy in the AC3D model will be reflected in the .pov file.
Array declarations Object that is just a bunch of vertices results in an array declaration of vectors.
Palette Only the palettes that are used are declared.
Comments Comments are generated to give structure to the file.

Configuration:

The directive syntax is triple slash followed by PfPOV_Something.
DirectiveDescription
///PfPOV_BEGINPreserve file's contents up to the directive. Whatever is in the file before the directive will not be lost when it is re-generated.
///PfPOV_ENDPreserve file's contents following the directive. Whatever is in the file after the directive will not be lost when it is re-generated.
///PfPOV_NOCAMERASupress generating the camera.
///PfPOV_NORENDERDon't generate objects to render (ie only declare them).
///PfPOV_NOLIGHTSupress generating lights.
///PfPOV_NOPALETTESupress generating palette.
///PfPOV_LOCALUse #local instead of #declare when declaring.

Object specific configuration:

There are some directives that can be placed in an object's Data Text property.
DirectiveDescription
///PfPOV_CENTREPut in object's data text to only generate the centre position of the object, not the opbject itself. Useful when the object is only acting as a reference or representing a location.
///PfPOV_CUBIC_SPLINEOnly applicable to objects without surfaces. Use this directive to produce a cubic spline instead of an simple array of vectors.

The idea with the various suppressing-directives (///PfPOV_NO...) is that one can modify (translate, scale, whatever) objects, camera, lights etc. in POVRay and put them outside the PfPOV_BEGIN/PfPOV_END scope.
The directives help avoid conflicts like having 2 cameras in the file if the model is exported again.

Example:

With a model like this:
Example of model
Something like this is generated:
//--------------------------------------------------------
// File: C:/3d/example.pov
// Originally generated by PfPOV v1.0
//--------------------------------------------------------
// Triple slash followed by PfPOV_something are directives
// used if PfPOV is to generate the file again.

// Directives:
//   PfPOV_BEGIN
//   Preserve file's contents up to the directive
//   PfPOV_END
//   Preserve file's contents following the directive
//   PfPOV_NOCAMERA
//   Don't generate the camera
//   PfPOV_NOLIGHT
//   Don't generate lights
//   PfPOV_NORENDER
//   Don't generate objects to render (ie only declare them)
//   PfPOV_NOPALETTE
//   Don't generate the palette
//   PfPOV_LOCAL
//   Use the #local directive instead of #declare

// PfPOV will preserve contents up to the PfPOV_BEGIN directive:
///PfPOV_BEGIN

//--------------------------------------------------------
// Palette Declaration
//--------------------------------------------------------
#declare ac3dColor_1 = texture { ... }
#declare ac3dColor_8 = texture { ... }

//--------------------------------------------------------
// Object Declarations
//--------------------------------------------------------
#declare obj_S = union {
	triangle ...
	texture { ac3dColor_8 }
} // obj_S
#declare obj_o = union {
	triangle ...
	texture { ac3dColor_8 }
} // obj_o
#declare obj_m = union {
	triangle ...
	texture { ac3dColor_8 }
} // obj_m
#declare obj_e = union {
	triangle ...
	texture { ac3dColor_8 }
} // obj_e
#declare obj_T = union {
	triangle ...
	texture { ac3dColor_8 }
} // obj_T
#declare obj_e_2 = union {
	triangle ...
	texture { ac3dColor_8 }
} // obj_e_2
#declare obj_x = union {
	triangle ...
	texture { ac3dColor_8 }
} // obj_x
#declare obj_t = union {
	triangle ...
	texture { ac3dColor_8 }
} // obj_t
#declare obj_sphere = union {
	smooth_triangle ...
	texture { ac3dColor_1 }
} // obj_sphere

//--------------------------------------------------------
// Group Declarations
//--------------------------------------------------------
#declare grp_SomeText = union {
	object { obj_S }
	object { obj_o }
	object { obj_m }
	object { obj_e }
	object { obj_T }
	object { obj_e_2 }
	object { obj_x }
	object { obj_t }
}

//--------------------------------------------------------
// Render Objects
//--------------------------------------------------------
union {
	object { grp_SomeText }
	object { obj_sphere }
}

//--------------------------------------------------------
// Light Definition
//--------------------------------------------------------
light_source {<0, 0, 0> color rgb < 1 1 1 >}

//--------------------------------------------------------
// Camera Definition
//--------------------------------------------------------
camera
{
	location < 2.13 , 0.53, 5 >
	right < -1.33, 0, 0>
	look_at < 2.13, 0.53, 0 >
	up < 0, 1, 0>
	angle 50
}

///PfPOV_END
// PfPOV will preserve contents following the PfPOV_END
//       directive above.

Downloads:

The plugin:PfPOV.zip (72kb)

Source (VC++ 6 project) is available. Let me know if you want it.Note, you will need to have the AC3D SDK to be able to compile the source code.

Installation:

Put the plugin in AC3D's plugin folder and start AC3D. You'll find a new "PfPOV..." entry in the File->Export menu.

Change log:

That's about it. Feedback, suggestions, criticism etc is most welcome...

Downloads

Valid XHTML 1.0 Strict Valid CSS!