This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// 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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// 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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// 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 |
NewerOlder