HDK
|
#include <OBJ_LightLink.h>
Classes | |
class | ObjectData |
class | SOPData |
Public Types | |
typedef std::string | ObjectId |
typedef std::string | SourceTagList |
typedef UT_TagListPtr | CompiledTagList |
typedef std::string | SourceTagExpression |
typedef UT_TagExpressionPtr | CompiledTagExpression |
typedef UT_Set< ObjectId > | ObjectSet |
typedef UT_Map< ObjectId, ObjectData > | ObjectMap |
typedef UT_Array< SOPData > | SOPList |
Public Member Functions | |
void | runLightSelection (const char *title, const char *tag, bool include_packed=true, OP_Network *parent=NULL) |
bool | runObjectCentric (const char *title, OBJ_Node *node, const char *packed_path=NULL) const |
OBJ_LightLink () | |
~OBJ_LightLink () | |
void | populateFromNetwork (OP_Network *net, fpreal t) |
bool | addObject (const ObjectId &path, const SourceTagExpression &expr, int opid=-1) |
Add geometry which can be lit or might not be lit. More... | |
bool | addSOP (const std::string &soppath, const SOP_ObjectAppearancePtr &app) |
void | getMatching (ObjectSet &objects, const char *tag) |
void | setMatching (const ObjectSet &objects, const char *tag, fpreal t) |
void | setAllMatching (const char *tag, fpreal t) |
Set all objects to be matching the given tag. More... | |
void | getChanged (ObjectSet &objects) |
Get a list of all objects modified by set operations. More... | |
bool | getSourceExpression (const ObjectId &path, UT_WorkBuffer &expr) const |
Get the expression source for the given object. More... | |
bool | exportLighting (UT_JSONWriter &os, const UT_Options &save_options, UT_StringArray &errors) const |
bool | importLighting (UT_JSONParser &is, const UT_Options &load_options, UT_StringArray &errors) const |
Import lighting information from a file. More... | |
Helper class to assist with managing tags and expressions on objects.
The class contains a simple representation for objects that have tag expressions (i.e. objects which have a light selection expression). This class allows you to make edits to the tag expressions using a list object centric view. That is, the object that stores the list of tags can add/remove tags from the expression objects.
Definition at line 35 of file OBJ_LightLink.h.
Definition at line 42 of file OBJ_LightLink.h.
Definition at line 40 of file OBJ_LightLink.h.
typedef std::string OBJ_LightLink::ObjectId |
Definition at line 38 of file OBJ_LightLink.h.
typedef UT_Map<ObjectId, ObjectData> OBJ_LightLink::ObjectMap |
Definition at line 148 of file OBJ_LightLink.h.
typedef UT_Set<ObjectId> OBJ_LightLink::ObjectSet |
Definition at line 43 of file OBJ_LightLink.h.
typedef UT_Array<SOPData> OBJ_LightLink::SOPList |
Definition at line 149 of file OBJ_LightLink.h.
Definition at line 41 of file OBJ_LightLink.h.
Definition at line 39 of file OBJ_LightLink.h.
OBJ_LightLink::OBJ_LightLink | ( | ) |
OBJ_LightLink::~OBJ_LightLink | ( | ) |
bool OBJ_LightLink::addObject | ( | const ObjectId & | path, |
const SourceTagExpression & | expr, | ||
int | opid = -1 |
||
) |
Add geometry which can be lit or might not be lit.
bool OBJ_LightLink::addSOP | ( | const std::string & | soppath, |
const SOP_ObjectAppearancePtr & | app | ||
) |
bool OBJ_LightLink::exportLighting | ( | UT_JSONWriter & | os, |
const UT_Options & | save_options, | ||
UT_StringArray & | errors | ||
) | const |
Export lighting information to a file Save options:
Get a list of all objects modified by set operations.
Get objects which match a given tag. Non-const since tag manager is modified.
bool OBJ_LightLink::getSourceExpression | ( | const ObjectId & | path, |
UT_WorkBuffer & | expr | ||
) | const |
Get the expression source for the given object.
bool OBJ_LightLink::importLighting | ( | UT_JSONParser & | is, |
const UT_Options & | load_options, | ||
UT_StringArray & | errors | ||
) | const |
Import lighting information from a file.
void OBJ_LightLink::populateFromNetwork | ( | OP_Network * | net, |
fpreal | t | ||
) |
Helper function to populate the light linker database with objects from the given network.
void OBJ_LightLink::runLightSelection | ( | const char * | title, |
const char * | tag, | ||
bool | include_packed = true , |
||
OP_Network * | parent = NULL |
||
) |
Open a chooser of all objects, selecting the objects with the given tag. On completion, the user selected objects will be lit by the tag.
bool OBJ_LightLink::runObjectCentric | ( | const char * | title, |
OBJ_Node * | node, | ||
const char * | packed_path = NULL |
||
) | const |
The node_path
refers to the geometry object (or SOP). When referring to a packed SOP, the packed_path
refers to the path attribute. As a note, when referring to a SOP, the SOP must support the SOP_ObjectAppearance interface.
Set all objects to be matching the given tag.
The given set of objects
will be set to match the tag
. All other objects will be adjusted to no longer match the given tag
. The list of changed
objects is returned.