View c4d-messagetostring.cpp
#include "c4d_general.h"
#include "c4d_plugin.h"
#include "ge_sys_math.h"
#include "c4d_string.h"
#include "ge_prepass.h"
#include "c4d_baselist.h"
#include "c4d_commanddata.h"
#include "c4d_falloffdata.h"
#include "c4d_messageplugin.h"
#include "c4d_baseeffectordata.h"
View c4d-hidedescription.cpp
/// Show or hide an element from a node's description
///
/// param[in] node The node whose description we're changing
/// param[in] descr The description we're changing
/// param[in] MyDescID The ID of the element
/// param[in] show Pass true to show, or false to hide
/// return False if an error occurred, otherwise true
static Bool ShowDescription(GeListNode *node, Description *descr, Int32 descID, Bool show)
{
AutoAlloc<AtomArray> ar;
View c4d-matrix-target.cpp
/// Align a matrix to a target, using an up vector
///
/// @param[in] pos The position we're targeting from
/// @param[in] targetPos The position we're targeting at
/// @param[in] upVector The up vector, to avoid gimbal lock. Defaults to +Y
/// @return A matrix with an offset of 'pos', targeting 'targetPos' with its Z axis.
static inline Matrix Target(const Vector &pos, const Vector &targetPos, const Vector &upVector = Vector(0.0, 1.0, 0.0))
{
Matrix m(DC); // New matrix. Don't call default constructor, as we're filling the values now anyway.
m.off = pos; // Set position
View c4d-restartcommand.cpp
#include "c4d.h"
class RestartCommand : public CommandData
{
virtual Bool Execute(BaseDocument *doc)
{
if (GeOutString("Really restart?", GEMB_ICONQUESTION|GEMB_YESNO) == GEMB_R_YES)
RestartApplication();
return true;
}
View c4d-get-vertex-normal.cpp
/// Return the normal vector for a vertex of a polygon object.
/// The normal is computed as an average of the normals of all polygons that are neighbors to the specified vertex.
///
/// @param[in] op The PolygonObject
/// @param[in] neighbor Pointer to a Neighbor object. Must already be initialized, caller owns the pointed object.
/// @param[in] pointIndex The index of the vertex we want the normal of
/// @return The normal of the point in local object space
static Vector GetVertexNormal(PolygonObject *op, Neighbor *neighbor, Int32 pointIndex)
{
// Variables
View c4d-dynamicdescription.cpp
#include "c4d-dynamicdescription.h"
Bool IsSingleID(const DescID &id, const DescID *singleid)
{
return !singleid || id.IsPartOf(*singleid, NULL);
}
Bool DescriptionAddCycle(Description *description, Int32 id, Int32 groupId, const String &name, const BaseContainer &cycleItems, BaseContainer *cycleIcons, Int32 defaultValue)
View c4d-csto.cpp
/// Calls MCOMMAND_CURRENTSTATETOOBJECT on an object and returns the result
///
/// @note: This is time and memory consuming, so only do it when necessary, and then cache the result!
///
/// @param[in] op The object you want to CSTO
/// @return The resulting object. Caller owns the pointed object.
PolygonObject* CurrentStateToObject(BaseObject *op)
{
// Create AliasTranslate
AutoAlloc<AliasTrans> aliasTrans;
View c4d-round-grid.cpp
/// Round a value to a grid.
/// This is an extended version of Round(), rounding not just to the nearest whole number but to the nearest point in a grid with arbitrary spacing.
/// Using "1.0" as value for grid will give the same results as Round().
///
/// @param[in] value The input value
/// @param[in] grid The grid spacing
/// @return The rounded value
static inline Float RoundGrid(Float value, Float grid = 1.0)
{
if (grid == 0.0)
View c4d-map-range.cpp
/// Maps a value from an input range to an output range
/// e.g. from -180° ... 180° to 0.0 ... 1.0
/// Basically like the range mapper node in XPresso.
///
/// @param[in] value The input value
/// @param[in] minInput Defines the lower limit of the input range
/// @param[in] maxInput Defines the upper limit of the input range
/// @param[in] minOutput Defines the lower limit of the output range
/// @param[in] maxOutput Defines the upper limit of the output range
/// @return The mapped value