HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
OBJ_LightLink Class Reference

#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< ObjectIdObjectSet
 
typedef UT_Map< ObjectId,
ObjectData
ObjectMap
 
typedef UT_Array< SOPDataSOPList
 

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...
 

Detailed Description

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.

Member Typedef Documentation

Definition at line 40 of file OBJ_LightLink.h.

Definition at line 38 of file OBJ_LightLink.h.

Definition at line 148 of file OBJ_LightLink.h.

Definition at line 43 of file OBJ_LightLink.h.

Definition at line 149 of file OBJ_LightLink.h.

Definition at line 39 of file OBJ_LightLink.h.

Constructor & Destructor Documentation

OBJ_LightLink::OBJ_LightLink ( )
OBJ_LightLink::~OBJ_LightLink ( )

Member Function Documentation

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:

  • "save_material" [True]
    Save materials for objects/SOPs
  • "save_visibility" [True]
    Save visibility for objects/SOPs
  • "save_linking" [True]
    Save linking information for objects/SOPs
  • "root" ["/obj"]
    Root of network to save
void OBJ_LightLink::getChanged ( ObjectSet objects)

Get a list of all objects modified by set operations.

void OBJ_LightLink::getMatching ( ObjectSet objects,
const char *  tag 
)

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.

void OBJ_LightLink::setAllMatching ( const char *  tag,
fpreal  t 
)

Set all objects to be matching the given tag.

void OBJ_LightLink::setMatching ( const ObjectSet objects,
const char *  tag,
fpreal  t 
)

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.


The documentation for this class was generated from the following file: