bool GetShaderItem ( CLxLoc_Item &item) { LXtObjectID obj; if (LXx_FAIL (ShaderItemGet (&obj))) return false; return item.take (obj); }
bool MakeBranch ( CLxLoc_EvaluationStack &branch) { LXtObjectID obj; if (LXx_FAIL (Branch (&obj))) return false; return branch.take (obj); }
bool duplicate ( CLxLoc_Shader &acc) { LXtObjectID obj; acc.clear (); if (LXx_FAIL (Spawn (&obj))) return false; return acc.take (obj); }
bool GetBin ( unsigned index, CLxLoc_SurfaceBin &bin) { LXtObjectID obj; if (LXx_FAIL (BinByIndex (index, &obj))) return false; return bin.take (obj); }
bool EditMeshByIndex ( unsigned int index, CLxLoc_Mesh &mesh) { LXtObjectID obj; if (LXx_FAIL (MeshEdit (index, &obj))) return false; return mesh.take (obj); }
bool ItemByIndex ( unsigned int index, CLxLoc_Item &item) { LXtObjectID obj; if (LXx_FAIL (MeshItem (index, &obj))) return false; return item.take (obj); }
bool BeginXfrm ( ILxUnknownID toolVec, CLxLoc_TransformScan &xfrm) { LXtObjectID obj; if (LXx_FAIL (XfrmAllocate (toolVec, &obj))) return false; return xfrm.take (obj); }
bool BeginScan ( unsigned int flags, CLxLoc_LayerScan &scan) { LXtObjectID obj; if (LXx_FAIL (ScanAllocate (flags, &obj))) return false; return scan.take (obj); }
bool GetMeshShaders ( CLxLoc_Item &meshItem, CLxLoc_Shader &acc) { LXtObjectID obj; acc.clear (); if (LXx_FAIL (MeshShaderAccessor (meshItem, &obj))) return false; return acc.take (obj); }
bool AllocSurf ( ILxUnknownID attr, unsigned index, CLxLoc_Surface &surf) { LXtObjectID obj; if (LXx_FAIL (Evaluate (attr, index, &obj))) return false; return surf.take (obj); }
bool AllocSurf ( ILxUnknownID chanRead, bool morph, CLxLoc_Surface &surf) { LXtObjectID obj; if (LXx_FAIL (GetSurface (chanRead, morph ? 1 : 0, &obj))) return false; return surf.take (obj); }
bool GetPolyShaders ( CLxLoc_Item &meshItem, LXtPolygonID polyID, CLxLoc_Shader &acc) { LXtObjectID obj; acc.clear (); if (LXx_FAIL (PolyShaderAccessor (meshItem, polyID, &obj))) return false; return acc.take (obj); }
void CCommandLoadFile::cmd_Interact () { /* * When the command is executed, this function is first called. * It's the ideal place to open a file dialog and ask for user * interaction. The resulting path can then be passed to the * commands execute method using the filename argument. * * No scene or state altering code should be performed here. */ CLxUser_CommandService cmd_svc; CLxUser_Command command; CLxUser_ValueArray val_array; std::string filename = ""; unsigned n = 0; /* * Check if the filename argument is set, if it is, return early. */ if (dyna_IsSet (ARGi_FILENAME)) return; /* * Fire the commands to open the file dialog. */ cmd_svc.ExecuteArgString (-1, LXiCTAG_NULL, "dialog.setup fileOpen"); cmd_svc.ExecuteArgString (-1, LXiCTAG_NULL, "dialog.title {Browse For Files...}"); cmd_svc.ExecuteArgString (-1, LXiCTAG_NULL, "dialog.fileTypeCustom model {OpenVDB model} {*.vdb} vdb"); cmd_svc.ExecuteArgString (-1, LXiCTAG_NULL, "dialog.open"); /* * Spawn a command that can be queried for the result. */ if (LXx_FAIL(cmd_svc.NewCommand (command, "dialog.result"))) return; /* * Query the first argument on the dialog.result command * and store the results in a value array. */ if (LXx_FAIL(cmd_svc.QueryIndex (command, 0, val_array))) return; /* * Get the number of elements in the array. There should * only be one. If there are none, return early. */ n = val_array.Count (); if (!n) return; /* * Read the string from the value array and set the filename * argument to the value of the string. */ val_array.String (0, filename); attr_SetString (ARGi_FILENAME, filename.c_str ()); }