Houdini Engine 1.9
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
HAPI.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * Produced by:
7  * Side Effects Software Inc
8  * 123 Front Street West, Suite 1401
9  * Toronto, Ontario
10  * Canada M5J 2M2
11  * 416-504-9876
12  *
13  * COMMENTS:
14  */
15 
16 #ifndef __HAPI_h__
17 #define __HAPI_h__
18 
19 #include "HAPI_API.h"
20 #include "HAPI_Common.h"
21 
22  // INITIALIZATION / CLEANUP ---------------------------------------------
23 
24  /// @brief Check whether the runtime has been intialized yet using
25  /// ::HAPI_Initialize(). Function will return ::HAPI_RESULT_SUCCESS
26  /// if the runtime has been initialized and ::HAPI_RESULT_FAILURE
27  /// otherwise.
28  ///
30 
31  /// @brief Create the asset manager, set up environment variables, and
32  /// initialize the main Houdini scene. No license checking is
33  /// during this step. Only when you try to load an asset library
34  /// (OTL) do we actually check for licenses.
35  ///
36  /// @param[in] otl_search_path
37  /// The directory where OTLs are searched for. You can
38  /// pass NULL here which will only use the default
39  /// Houdini OTL search paths. You can also pass in
40  /// multiple paths separated by a ";" on Windows and a ":"
41  /// on Linux and Mac. If something other than NULL is
42  /// passed the default Houdini search paths will be
43  /// appended to the end of the path string.
44  ///
45  /// @param[in] dso_search_path
46  /// The directory where DSOs (custom plugins) are
47  /// searched for. You can pass NULL here which will
48  /// only use the default Houdini DSO search paths. You
49  /// can also pass in multiple paths separated by a ";"
50  /// on Windows and a ":" on Linux and Mac. If something
51  /// other than NULL is passed the default Houdini search
52  /// paths will be appended to the end of the path string.
53  ///
54  /// @param[in] cook_options
55  /// Global cook options used by subsequent default cooks.
56  /// This can be overwritten by individual cooks but if
57  /// you choose to instantiate assets with cook_on_load
58  /// set to true then these cook options will be used.
59  ///
60  /// @param[in] use_cooking_thread
61  /// Use a separate thread for cooking of assets. This
62  /// allows for asynchronous cooking and larger stack size.
63  ///
64  /// @param[in] cooking_thread_stack_size
65  /// Set the stack size of the cooking thread. Use -1 to
66  /// set the stack size to the Houdini default. This
67  /// value is in bytes.
68  ///
69  /// [HAPI_Initialize]
70  HAPI_DECL HAPI_Initialize( const char * otl_search_path,
71  const char * dso_search_path,
72  const HAPI_CookOptions * cook_options,
73  HAPI_Bool use_cooking_thread,
74  int cooking_thread_stack_size );
75  /// [HAPI_Initialize]
76 
77  /// @brief Clean up memory. This will unload all assets and you will
78  /// need to call ::HAPI_Initialize() again to be able to use any
79  /// HAPI methods again.
80  ///
81  /// @note This does NOT release any licenses.
82  ///
84 
85  // DIAGNOSTICS ----------------------------------------------------------
86 
87  /// @brief Gives back a certain environment integer like version number.
88  ///
89  /// @param[in] int_type
90  /// One of ::HAPI_EnvIntType.
91 
92  ///
93  /// @param[out] value
94  /// Int value.
95  ///
96  HAPI_DECL HAPI_GetEnvInt( HAPI_EnvIntType int_type, int * value );
97 
98  /// @brief Gives back the status code for a specific status type.
99  ///
100  /// @param[in] status_type
101  /// One of ::HAPI_StatusType.
102  ///
103  /// @param[out] status
104  /// Actual status code for the status type given. That is,
105  /// if you pass in ::HAPI_STATUS_CALL_RESULT as
106  /// status_type, you'll get back a ::HAPI_Result for this
107  /// argument. If you pass in ::HAPI_STATUS_COOK_STATE
108  /// as status_type, you'll get back a ::HAPI_State enum
109  /// for this argument.
110  ///
111  HAPI_DECL HAPI_GetStatus( HAPI_StatusType status_type, int * status );
112 
113  /// @brief Return length of string buffer storing status string message.
114  ///
115  /// If called with ::HAPI_STATUS_COOK_RESULT this will actually
116  /// parse the node networks for the previously cooked asset(s)
117  /// and aggregate all node errors, warnings, and messages
118  /// (depending on the @c verbosity level set). Usually this is done
119  /// just for the last cooked single asset but if you load a whole
120  /// Houdini scene using ::HAPI_LoadHIPFile() then you'll have
121  /// multible "previously cooked assets".
122  ///
123  /// You MUST call ::HAPI_GetStatusStringBufLength() before calling
124  /// ::HAPI_GetStatusString() because ::HAPI_GetStatusString() will
125  /// not return the real status string and instead return a
126  /// cached version of the string that was created inside
127  /// ::HAPI_GetStatusStringBufLength(). The reason for this is that
128  /// the length of the real status string may change between
129  /// the call to ::HAPI_GetStatusStringBufLength() and the call to
130  /// ::HAPI_GetStatusString().
131  ///
132  /// @param[in] status_type
133  /// One of ::HAPI_StatusType.
134  ///
135  /// @param[in] verbosity
136  /// Preferred verbosity level.
137  ///
138  /// @param[out] buffer_size
139  /// Length of buffer char array ready to be filled.
140  ///
142  HAPI_StatusVerbosity verbosity,
143  int * buffer_size );
144 
145  /// @brief Return status string message.
146  ///
147  /// You MUST call ::HAPI_GetStatusStringBufLength() before calling
148  /// ::HAPI_GetStatusString() because ::HAPI_GetStatusString() will
149  /// not return the real status string and instead return a
150  /// cached version of the string that was created inside
151  /// ::HAPI_GetStatusStringBufLength(). The reason for this is that
152  /// the length of the real status string may change between
153  /// the call to ::HAPI_GetStatusStringBufLength() and the call to
154  /// ::HAPI_GetStatusString().
155  ///
156  /// @param[in] status_type
157  /// One of ::HAPI_StatusType.
158  ///
159  /// @param[out] buffer
160  /// Buffer char array ready to be filled.
161  ///
162  /// @param[in] buffer_length
163  /// Length of the string buffer (must match size of
164  /// string_value - so including NULL terminator).
165  ///
167  char * buffer,
168  int buffer_length );
169 
170  /// @brief Get total number of nodes that need to cook in the current
171  /// session.
172  ///
173  /// @param[out] count
174  /// Total cook count.
175  ///
176  HAPI_DECL HAPI_GetCookingTotalCount( int * count );
177 
178  /// @brief Get current number of nodes that have already cooked in the
179  /// current session. Note that this is a very crude approximation
180  /// of the cooking progress - it may never make it to 100% or it
181  /// might spend another hour at 100%. Use ::HAPI_GetStatusString
182  /// to get a better idea of progress if this number gets stuck.
183  ///
184  /// @param[out] count
185  /// Current cook count.
186  ///
187  HAPI_DECL HAPI_GetCookingCurrentCount( int * count );
188 
189  // UTILITY --------------------------------------------------------------
190 
191  /// @brief Converts the transform described by a ::HAPI_TransformEuler
192  /// struct into a different transform and rotation order.
193  ///
194  /// @param[in,out] transform_in_out
195  /// Used for both input and output.
196  ///
197  /// @param[in] rst_order
198  /// The desired transform order of the output.
199  ///
200  /// @param[in] rot_order
201  /// The desired rotation order of the output.
202  ///
204  HAPI_RSTOrder rst_order,
205  HAPI_XYZOrder rot_order );
206 
207  /// @brief Converts a 4x4 matrix into its TRS form.
208  ///
209  /// @param[in] mat
210  /// A 4x4 matrix expressed in a 16 element float array.
211  ///
212  /// @param[in] rst_order
213  /// The desired transform order of the output.
214  ///
215  /// @param[out] transform_out
216  /// Used for the output.
217  ///
218  HAPI_DECL HAPI_ConvertMatrixToQuat( const float * mat,
219  HAPI_RSTOrder rst_order,
220  HAPI_Transform * transform_out );
221 
222  /// @brief Converts a 4x4 matrix into its TRS form.
223  ///
224  /// @param[in] mat
225  /// A 4x4 matrix expressed in a 16 element float array.
226  ///
227  /// @param[in] rst_order
228  /// The desired transform order of the output.
229  ///
230  /// @param[in] rot_order
231  /// The desired rotation order of the output.
232  ///
233  /// @param[out] transform_out
234  /// Used for the output.
235  ///
236  HAPI_DECL HAPI_ConvertMatrixToEuler( const float * mat,
237  HAPI_RSTOrder rst_order,
238  HAPI_XYZOrder rot_order,
239  HAPI_TransformEuler * transform_out );
240 
241  /// @brief Converts ::HAPI_Transform into a 4x4 transform matrix.
242  ///
243  /// @param[in] transform
244  /// The ::HAPI_Transform you wish to convert.
245  ///
246  /// @param[out] matrix
247  /// A 16 element float array that will contain the result.
248  ///
250  const HAPI_Transform * transform,
251  float * matrix );
252 
253  /// @brief Converts ::HAPI_TransformEuler into a 4x4 transform matrix.
254  ///
255  /// @param[in] transform
256  /// The ::HAPI_TransformEuler you wish to convert.
257  ///
258  /// @param[out] matrix
259  /// A 16 element float array that will contain the result.
260  ///
262  const HAPI_TransformEuler * transform,
263  float * matrix );
264 
265  /// @brief Acquires or releases the Python interpreter lock. This is
266  /// needed if HAPI is called from Python and HAPI is in threaded
267  /// mode (see ::HAPI_Initialize()).
268  ///
269  /// The problem arises when async functions like
270  /// ::HAPI_InstantiateAsset() may start a cooking thread that
271  /// may try to run Python code. That is, we would now have
272  /// Python running on two different threads - something not
273  /// allowed by Python by default.
274  ///
275  /// We need to tell Python to explicitly "pause" the Python state
276  /// on the client thread while we run Python in our cooking thread.
277  ///
278  /// You must call this function first with locked == true before
279  /// any async HAPI call. Then, after the async call finished,
280  /// detected via calls to ::HAPI_GetStatus(), call this method
281  /// again to release the lock with locked == false.
282  ///
283  /// @param[in] locked
284  /// True will acquire the interpreter lock to use it for
285  /// the HAPI cooking thread. False will release the lock
286  /// back to the client thread.
287  ///
289 
290  // STRINGS --------------------------------------------------------------
291 
292  /// @brief Gives back the string length of the string with the
293  /// given handle.
294  ///
295  /// @param[in] string_handle
296  /// Handle of the string to query.
297  ///
298  /// @param[out] buffer_length
299  /// Buffer length of the queried string (including NULL
300  /// terminator).
301  ///
303  int * buffer_length );
304 
305  /// @brief Gives back the string value of the string with the
306  /// given handle.
307  ///
308  /// @param[in] string_handle
309  /// Handle of the string to query.
310  ///
311  /// @param[out] string_value
312  /// Actual string value (character array).
313  ///
314  /// @param[in] buffer_length
315  /// Length of the string buffer (must match size of
316  /// string_value - so including NULL terminator).
317  ///
319  char * string_value,
320  int buffer_length );
321 
322  // TIME -----------------------------------------------------------------
323 
324  /// @brief Gets the global time of the scene. All API calls deal with
325  /// this time to cook.
326  ///
327  /// @param[out] time
328  /// Time as a float in seconds.
329  ///
330  HAPI_DECL HAPI_GetTime( float * time );
331 
332  /// @brief Sets the global time of the scene. All API calls will deal
333  /// with this time to cook.
334  ///
335  /// @param[in] time
336  /// Time as a float in seconds.
337  ///
338  HAPI_DECL HAPI_SetTime( float time );
339 
340  /// @brief Gets the current global timeline options.
341  ///
342  /// @param[in] timeline_options
343  /// The global timeline options struct.
344  ///
346  HAPI_TimelineOptions * timeline_options );
347 
348  /// @brief Sets the global timeline options.
349  ///
350  /// @param[in] timeline_options
351  /// The global timeline options struct.
352  ///
354  const HAPI_TimelineOptions * timeline_options );
355 
356  // ASSETS ---------------------------------------------------------------
357 
358  /// @brief Determine if your instance of the asset actually still exists
359  /// inside the Houdini scene. This is what can be used to
360  /// determine when the Houdini scene needs to be re-populated
361  /// using the host application's instances of the assets.
362  /// Note that this function will ALWAYS return
363  /// ::HAPI_RESULT_SUCCESS.
364  ///
365  /// @param[in] asset_id
366  /// The asset id.
367  ///
368  /// @param[in] asset_validation_id
369  /// The asset validation id that's found in the
370  /// ::HAPI_AssetInfo struct returned by
371  /// ::HAPI_GetAssetInfo.
372  ///
373  /// @param[out] answer
374  /// Answer to the question. 1 for valid, 0 for invalid.
375  ///
377  int asset_validation_id,
378  int * answer );
379 
380  /// @brief Loads a Houdini asset library (OTL) from a .otl file.
381  /// It does NOT instantiate anything inside the Houdini scene.
382  ///
383  /// @note This is when we actually check for valid licenses.
384  ///
385  /// The next step is to call ::HAPI_GetAvailableAssetCount()
386  /// to get the number of assets contained in the library using the
387  /// returned library_id. Then call ::HAPI_GetAvailableAssets()
388  /// to get the list of available assets by name. Use the asset
389  /// names with ::HAPI_InstantiateAsset() to actually instantiate
390  /// one of these assets in the Houdini scene and get back
391  /// an asset_id.
392  ///
393  /// @note The HIP file saved using ::HAPI_SaveHIPFile() will only
394  /// have an absolute path reference to the loaded OTL meaning
395  /// that if the OTL is moved or renamed the HIP file won't
396  /// load properly. It also means that if you change the OTL
397  /// using the saved HIP scene the same OTL file will change
398  /// as the one used with Houdini Engine.
399  /// See @ref HAPI_Fundamentals_SavingHIPFile.
400  ///
401  /// @param[in] file_path
402  /// Absolute path to the .otl file.
403  ///
404  /// @param[in] allow_overwrite
405  /// With this true, if the library file being loaded
406  /// contains asset defintions that have already been
407  /// loaded they will overwrite the existing definitions.
408  /// Otherwise, a library containing asset defintions that
409  /// already exist will fail to load, returning a
410  /// ::HAPI_Result of
411  /// ::HAPI_RESULT_ASSET_DEF_ALREADY_LOADED.
412  ///
413  /// @param[out] library_id
414  /// Newly loaded otl id to be used with
415  /// ::HAPI_GetAvailableAssetCount() and
416  /// ::HAPI_GetAvailableAssets().
417  ///
418  HAPI_DECL HAPI_LoadAssetLibraryFromFile( const char * file_path,
419  HAPI_Bool allow_overwrite,
420  HAPI_AssetLibraryId* library_id );
421 
422  /// @brief Loads a Houdini asset library (OTL) from memory.
423  /// It does NOT instantiate anything inside the Houdini scene.
424  ///
425  /// @note This is when we actually check for valid licenses.
426  ///
427  /// Please note that the performance benefit of loading a library
428  /// from memory are negligible at best. Due to limitations of
429  /// Houdini's library manager, there is still some disk access
430  /// and file writes because every asset library needs to be
431  /// saved to a real file. Use this function only as a convenience
432  /// if you already have the library file in memory and don't wish
433  /// to have to create your own temporary library file and then
434  /// call ::HAPI_LoadAssetLibraryFromFile().
435  ///
436  /// The next step is to call ::HAPI_GetAvailableAssetCount()
437  /// to get the number of assets contained in the library using the
438  /// returned library_id. Then call ::HAPI_GetAvailableAssets()
439  /// to get the list of available assets by name. Use the asset
440  /// names with ::HAPI_InstantiateAsset() to actually instantiate
441  /// one of these assets in the Houdini scene and get back
442  /// an asset_id.
443  ///
444  /// @note The saved HIP file using ::HAPI_SaveHIPFile() will
445  /// @a contain the OTL loaded as part of its @b Embedded OTLs.
446  /// This means that you can safely move or rename the original
447  /// OTL file and the HIP will continue to work but if you make
448  /// changes to the OTL while using the saved HIP the changes
449  /// won't be saved to the original OTL.
450  /// See @ref HAPI_Fundamentals_SavingHIPFile.
451  ///
452  /// @param[in] library_buffer
453  /// The memory buffer containing the asset definitions
454  /// in the same format as a standard Houdini .otl file.
455  ///
456  /// @param[in] library_buffer_size
457  /// The size of the OTL memory buffer.
458  ///
459  /// @param[in] allow_overwrite
460  /// With this true, if the library file being loaded
461  /// contains asset defintions that have already been
462  /// loaded they will overwrite the existing definitions.
463  /// Otherwise, a library containing asset defintions that
464  /// already exist will fail to load, returning a
465  /// ::HAPI_Result of
466  /// ::HAPI_RESULT_ASSET_DEF_ALREADY_LOADED.
467  ///
468  /// @param[out] library_id
469  /// Newly loaded otl id to be used with
470  /// ::HAPI_GetAvailableAssetCount() and
471  /// ::HAPI_GetAvailableAssets().
472  ///
474  const char * library_buffer,
475  int library_buffer_size,
476  HAPI_Bool allow_overwrite,
477  HAPI_AssetLibraryId * library_id );
478 
479  /// @brief Get the number of assets contained in an asset library.
480  /// You should call ::HAPI_LoadAssetLibraryFromFile() prior to
481  /// get a library_id.
482  ///
483  /// @param[in] library_id
484  /// Returned by ::HAPI_LoadAssetLibraryFromFile().
485  ///
486  /// @param[out] asset_count
487  /// The number of assets contained in this asset library.
488  ///
490  int * asset_count );
491 
492  /// @brief Get the names of the assets contained in an asset library.
493  ///
494  /// The asset names will contain additional information about
495  /// the type of asset, namespace, and version, along with the
496  /// actual asset name. For example, if you have an Object type
497  /// asset, in the "hapi" namespace, of version 2.0, named
498  /// "foo", the asset name returned here will be:
499  /// hapi::Object/foo::2.0
500  ///
501  /// However, you should not need to worry about this detail. Just
502  /// pass this string directly to ::HAPI_InstantiateAsset() to
503  /// instantiate the asset. You can then get the pretty name
504  /// using ::HAPI_GetAssetInfo().
505  ///
506  /// You should call ::HAPI_LoadAssetLibraryFromFile() prior to
507  /// get a library_id. Then, you should call
508  /// ::HAPI_GetAvailableAssetCount() to get the number of assets to
509  /// know how large of a string handles array you need to allocate.
510  ///
511  /// @param[in] library_id
512  /// Returned by ::HAPI_LoadAssetLibraryFromFile().
513  ///
514  /// @param[out] asset_names
515  /// Array of string handles (integers) that should be
516  /// at least the size of asset_count.
517  ///
518  /// @param[out] asset_count
519  /// Should be the same or less than the value returned by
520  /// ::HAPI_GetAvailableAssetCount().
521  ///
523  HAPI_StringHandle * asset_names,
524  int asset_count );
525 
526  /// @brief Instantiate an asset by name. The asset has to have been
527  /// loaded as part of an asset library, using
528  /// ::HAPI_LoadAssetLibraryFromFile().
529  ///
530  /// @note In threaded mode, this is an _async call_!
531  ///
532  /// @note This is also when we actually check for valid licenses.
533  ///
534  /// This API will invoke the cooking thread if threading is
535  /// enabled. This means it will return immidiately with a call
536  /// result of ::HAPI_RESULT_SUCCESS, even if fed garbage. Use
537  /// the status and cooking count APIs under DIAGNOSTICS to get
538  /// a sense of the progress. All other API calls will block
539  /// until the instatiation (and, optionally, the first cook)
540  /// has finished.
541  ///
542  /// Also note that the cook result won't be of type
543  /// ::HAPI_STATUS_CALL_RESULT like all calls (including this one).
544  /// Whenever the threading cook is done it will fill the
545  /// @a cook result which is queried using
546  /// ::HAPI_STATUS_COOK_RESULT.
547  ///
548  /// @param[in] asset_name
549  /// The name of the asset to load. Use
550  /// ::HAPI_GetAvailableAssets() to get the available
551  /// asset names in a loaded asset library.
552  ///
553  /// @param[out] cook_on_load
554  /// Set to true if you wish the asset to cook as soon
555  /// as it is instantiated. Otherwise, you will have to
556  /// call ::HAPI_CookAsset() explicitly after you call
557  /// this function.
558  ///
559  /// Normally you should set this to true but if you want
560  /// to change parameters on an asset before the first
561  /// cook set this to false. You can then use
562  /// ::HAPI_GetAssetInfo() to get the node_id of the asset
563  /// and use the parameter APIs to update the values.
564  /// Then, call ::HAPI_CookAsset() explicitly. To know
565  /// whether an asset as cooked at least once there is a
566  /// flag in ::HAPI_AssetInfo called hasEverCooked.
567  ///
568  /// @param[out] asset_id
569  /// Newly created asset's id. Use ::HAPI_GetAssetInfo()
570  /// to get more information about the asset.
571  ///
572  HAPI_DECL HAPI_InstantiateAsset( const char * asset_name,
573  HAPI_Bool cook_on_load,
574  HAPI_AssetId * asset_id );
575 
576  /// @brief Creates a special curve asset that can be used as input for
577  /// other assets in the scene.
578  ///
579  /// @note In threaded mode, this is an _async call_!
580  ///
581  /// Note that when saving the Houdini scene using
582  /// ::HAPI_SaveHIPFile() the curve nodes created with this
583  /// method will be yellow and will start with the name "curve".
584  ///
585  /// @param[out] asset_id
586  /// Newly created curve's asset id. Use
587  /// ::HAPI_GetAssetInfo() to get more information
588  /// about the asset.
589  ///
591 
592  /// @brief Creates a special asset that can accept geometry input.
593  /// This will create a dummy OBJ node with a Null SOP inside that
594  /// you can set the geometry of using the geometry SET APIs.
595  /// You can then connect this asset to any other asset using
596  /// inter-asset connection APIs.
597  ///
598  /// @note In threaded mode, this is an _async call_!
599  ///
600  /// All you need to remember is that this asset has a single
601  /// object and a single geo which means that for all subsequent
602  /// geometry setter functions just pass in 0 (zero) for the
603  /// object id and 0 (zero) for the geo id.
604  ///
605  /// Note that when saving the Houdini scene using
606  /// ::HAPI_SaveHIPFile() the curve nodes created with this
607  /// method will be green and will start with the name "input".
608  ///
609  /// @param[out] asset_id
610  /// Newly created asset's id. Use ::HAPI_GetAssetInfo()
611  /// to get more information about the asset.
612  ///
613  /// @param[in] name
614  /// Give this input asset a name for easy debugging.
615  /// The asset's obj node and the null SOP node will both
616  /// get this given name with "input_" prepended.
617  /// You can also pass NULL in which case the name will
618  /// be "input#" where # is some number.
619  ///
621  const char * name );
622 
623  /// @brief Destroy the asset instance.
624  ///
625  /// @param[in] asset_id
626  /// The asset id.
627  ///
629 
630  /// @brief Fill an asset_info struct.
631  ///
632  /// @param[in] asset_id
633  /// The asset id.
634  ///
635  /// @param[out] asset_info
636  /// Return value - contains things like asset id.
637  ///
639  HAPI_AssetInfo * asset_info );
640 
641  /// @brief Initiate a cook on this asset. Note that this may trigger
642  /// cooks on other assets if they are connected.
643  ///
644  /// @note In threaded mode, this is an _async call_!
645  ///
646  /// This API will invoke the cooking thread if threading is
647  /// enabled. This means it will return immidiately. Use
648  /// the status and cooking count APIs under DIAGNOSTICS to get
649  /// a sense of the progress. All other API calls will block
650  /// until the cook operation has finished.
651  ///
652  /// Also note that the cook result won't be of type
653  /// ::HAPI_STATUS_CALL_RESULT like all calls (including this one).
654  /// Whenever the threading cook is done it will fill the
655  /// @a cook result which is queried using
656  /// ::HAPI_STATUS_COOK_RESULT.
657  ///
658  /// @param[in] asset_id
659  /// The asset id.
660  ///
661  /// @param[in] cook_options
662  /// The cook options. Pass in NULL to use the global
663  /// cook options that you specified when calling
664  /// ::HAPI_Initialize().
665  ///
667  const HAPI_CookOptions * cook_options );
668 
669  /// @brief Interrupt a cook or load operation.
670  ///
672 
673  /// @brief Get the transform of an asset to match the transform of the
674  /// asset on the client side.
675  ///
676  /// @param[in] asset_id
677  /// The asset id.
678  ///
679  /// @param[in] rst_order
680  /// The order of application of translation, rotation and
681  /// scale.
682  ///
683  /// @param[in] rot_order
684  /// The desired rotation order of the output.
685  ///
686  /// @param[out] transform
687  /// The actual transform struct.
688  ///
690  HAPI_RSTOrder rst_order,
691  HAPI_XYZOrder rot_order,
692  HAPI_TransformEuler * transform );
693 
694  /// @brief Set the transform of an asset to match the transform of the
695  /// asset on the client side.
696  ///
697  /// @param[in] asset_id
698  /// The asset id.
699  ///
700  /// @param[in] transform
701  /// The actual transform struct.
702  ///
704  HAPI_TransformEuler * transform );
705 
706  /// @brief Get the name of an asset's input. This function will return
707  /// a string handle for the name which will be valid (persist)
708  /// until the next call to this function.
709  ///
710  /// @param[in] asset_id
711  /// The asset id.
712  ///
713  /// @param[in] input_idx
714  /// Input index of the asset.
715  ///
716  /// @param[in] input_type
717  /// Of type ::HAPI_InputType.
718  ///
719  /// @param[out] name
720  /// Input name string handle return value - valid until
721  /// the next call to this function.
722  ///
724  int input_idx, int input_type,
725  HAPI_StringHandle * name );
726 
727  // HIP FILES ------------------------------------------------------------
728 
729  /// @brief Loads a .hip file into the main Houdini scene.
730  ///
731  /// @note In threaded mode, this is an _async call_!
732  ///
733  /// @param[in] file_name
734  /// Absolute path to the .hip file to load.
735  ///
736  /// @param[in] cook_on_load
737  /// Set to true if you wish the assets to cook as soon
738  /// as they are instantiated. Otherwise, you will have to
739  /// call ::HAPI_CookAsset() explicitly for each after you
740  /// call this function.
741  ///
742  HAPI_DECL HAPI_LoadHIPFile( const char * file_name,
743  HAPI_Bool cook_on_load );
744 
745 
746  /// @brief Resyncs a HAPI to the underlying Houdini scene after one more
747  /// more nodes have been created by an asset (say using python)
748  /// at the /OBJ level, or a new scene has been loaded using
749  /// ::HAPI_LoadHIPFile().
750  /// Note that function will always return the same thing until
751  /// you call ::HAPI_GetNewAssetIds() to clear the results.
752  ///
753  /// @param[out] new_asset_count
754  /// A pointer to an int that will receive the asset count.
755  ///
756  HAPI_DECL HAPI_CheckForNewAssets( int * new_asset_count );
757 
758  /// @brief Retrieves the asset ids from the previous call to
759  /// ::HAPI_CheckForNewAssets().
760  ///
761  /// @param[out] asset_ids
762  /// A buffer of length num_assets as returned
763  /// by the call to ::HAPI_CheckForNewAssets().
764  /// When the function returns this buffer
765  /// will be filled with the asset ids.
766  ///
768 
769  /// @brief Saves a .hip file of the current Houdini scene.
770  ///
771  /// @param[in] file_path
772  /// Absolute path to the .hip file to save to.
773  ///
774  HAPI_DECL HAPI_SaveHIPFile( const char * file_path );
775 
776  // NODES ----------------------------------------------------------------
777 
778  /// @brief Fill an ::HAPI_NodeInfo struct.
779  ///
780  /// @param[in] node_id
781  /// The node id.
782  ///
783  /// @param[out] node_info
784  /// Return value - contains things like asset id.
785  ///
787  HAPI_NodeInfo * node_info );
788 
789  /// @brief Fill a ::HAPI_GlobalNodes struct. This contains node ids for
790  /// the default special nodes that are created by HAPI in the
791  /// default Houdini scene underneath. These nodes will be used
792  /// for global asset-independent functionality like rendering
793  /// material to file. Use ::HAPI_GetNodeInfo() to get details
794  /// for each of these special nodes.
795  ///
796  /// @param[out] global_nodes
797  /// The global nodes struct.
798  ///
800 
801  // PARAMETERS -----------------------------------------------------------
802 
803  /// @brief Fill an array of ::HAPI_ParmInfo structs with parameter
804  /// information from the asset instance node.
805  ///
806  /// @param[in] node_id
807  /// The node id.
808  ///
809  /// @param[out] parm_infos
810  /// Array of ::HAPI_ParmInfo at least the size of
811  /// length.
812  ///
813  /// @param[in] start
814  /// First index of range. Must be at least 0 and at
815  /// most ::HAPI_NodeInfo::parmCount - 1.
816  ///
817  /// @param[in] length
818  /// Must be at least 0 and at most
819  /// ::HAPI_NodeInfo::parmCount - start.
820  ///
822  HAPI_ParmInfo * parm_infos,
823  int start, int length );
824 
825  /// @brief Get the parm info of a parameter by parm id.
826  ///
827  /// @param[in] node_id
828  /// The node id.
829  ///
830  /// @param[in] parm_id
831  /// The parm id.
832  ///
833  /// @param[out] parm_info
834  /// The returned parm info.
835  ///
837  HAPI_ParmId parm_id,
838  HAPI_ParmInfo * parm_info );
839 
840  /// @brief All parameter APIs require a ::HAPI_ParmId but if you know the
841  /// parameter you wish to operate on by name than you can use
842  /// this function to get its ::HAPI_ParmId. If the parameter with
843  /// the given name is not found the parameter id returned
844  /// will be -1.
845  ///
846  /// @param[in] node_id
847  /// The node id.
848  ///
849  /// @param[in] parm_name
850  /// The parm name.
851  ///
852  /// @param[out] parm_id
853  /// The return value. The parameter's ::HAPI_ParmId. If
854  /// the parameter with the given name is not found the
855  /// parameter id returned will be -1.
856  ///
858  const char * parm_name,
859  HAPI_ParmId * parm_id );
860 
861  /// @brief Get the parm info of a parameter by name.
862  ///
863  /// @param[in] node_id
864  /// The node id.
865  ///
866  /// @param[in] parm_name
867  /// The parm name.
868  ///
869  /// @param[out] parm_info
870  /// The returned parm info.
871  ///
873  const char * parm_name,
874  HAPI_ParmInfo * parm_info );
875 
876  /// @brief Get single parm int value by name.
877  ///
878  /// @param[in] node_id
879  /// The node id.
880  ///
881  /// @param[in] parm_name
882  /// The parm name.
883  ///
884  /// @param[in] index
885  /// Index within the parameter's values tuple.
886  ///
887  /// @param[out] value
888  /// The returned int value.
889  ///
891  const char * parm_name,
892  int index,
893  int * value );
894 
895  /// @brief Fill an array of parameter int values. This is more efficient
896  /// than calling ::HAPI_GetParmIntValue() individually for each
897  /// parameter value.
898  ///
899  /// @param[in] node_id
900  /// The node id.
901  ///
902  /// @param[out] values
903  /// Array of ints at least the size of length.
904  ///
905  /// @param[in] start
906  /// First index of range. Must be at least 0 and at
907  /// most ::HAPI_NodeInfo::parmIntValueCount - 1.
908  ///
909  /// @param[in] length
910  /// Must be at least 0 and at most
911  /// ::HAPI_NodeInfo::parmIntValueCount - start.
912  ///
914  int * values,
915  int start, int length );
916 
917  /// @brief Get single parm float value by name.
918  ///
919  /// @param[in] node_id
920  /// The node id.
921  ///
922  /// @param[in] parm_name
923  /// The parm name.
924  ///
925  /// @param[in] index
926  /// Index within the parameter's values tuple.
927  ///
928  /// @param[out] value
929  /// The returned float value.
930  ///
932  const char * parm_name,
933  int index,
934  float * value );
935 
936  /// @brief Fill an array of parameter float values. This is more efficient
937  /// than calling ::HAPI_GetParmFloatValue() individually for each
938  /// parameter value.
939  ///
940  /// @param[in] node_id
941  /// The node id.
942  ///
943  /// @param[out] values
944  /// Array of floats at least the size of length.
945  ///
946  /// @param[in] start
947  /// First index of range. Must be at least 0 and at
948  /// most ::HAPI_NodeInfo::parmFloatValueCount - 1.
949  ///
950  /// @param[in] length
951  /// Must be at least 1 and at most
952  /// ::HAPI_NodeInfo::parmFloatValueCount - start.
953  ///
954  HAPI_DECL HAPI_GetParmFloatValues( HAPI_NodeId node_id, float * values,
955  int start, int length );
956 
957  /// @brief Get single parm string value by name.
958  ///
959  /// @param[in] node_id
960  /// The node id.
961  ///
962  /// @param[in] parm_name
963  /// The name of the parameter.
964  ///
965  /// @param[in] index
966  /// Index within the parameter's values tuple.
967  ///
968  /// @param[in] evaluate
969  /// Whether or not to evaluate the string expression.
970  /// For example, the string "$F" would evaluate to the
971  /// current frame number. So, passing in evaluate = false
972  /// would give you back the string "$F" and passing
973  /// in evaluate = true would give you back "1" (assuming
974  /// the current frame is 1).
975  ///
976  /// @param[out] value
977  /// The returned string value.
978  ///
980  const char * parm_name,
981  int index,
982  HAPI_Bool evaluate,
983  HAPI_StringHandle * value );
984 
985  /// @brief Fill an array of parameter string handles. These handles must
986  /// be used in conjunction with ::HAPI_GetString() to get the
987  /// actual string values. This is more efficient than calling
988  /// ::HAPI_GetParmStringValue() individually for each
989  /// parameter value.
990  ///
991  /// @param[in] node_id
992  /// The node id.
993  ///
994  /// @param[in] evaluate
995  /// Whether or not to evaluate the string expression.
996  /// For example, the string "$F" would evaluate to the
997  /// current frame number. So, passing in evaluate = false
998  /// would give you back the string "$F" and passing
999  /// in evaluate = true would give you back "1" (assuming
1000  /// the current frame is 1).
1001  ///
1002  /// @param[out] values
1003  /// Array of ints at least the size of length.
1004  ///
1005  /// @param[in] start
1006  /// First index of range. Must be at least 0 and at
1007  /// most ::HAPI_NodeInfo::parmStringValueCount - 1.
1008  ///
1009  /// @param[in] length
1010  /// Must be at least 1 and at most
1011  /// ::HAPI_NodeInfo::parmStringValueCount - start.
1012  ///
1014  HAPI_Bool evaluate,
1015  HAPI_StringHandle * values,
1016  int start, int length );
1017 
1018  /// @brief Fill an array of ::HAPI_ParmChoiceInfo structs with parameter
1019  /// choice list information from the asset instance node.
1020  ///
1021  /// @param[in] node_id
1022  /// The node id.
1023  ///
1024  /// @param[out] parm_choices
1025  /// Array of ::HAPI_ParmChoiceInfo exactly the size of
1026  /// length.
1027  ///
1028  /// @param[in] start
1029  /// First index of range. Must be at least 0 and at
1030  /// most ::HAPI_NodeInfo::parmChoiceCount - 1.
1031  ///
1032  /// @param[in] length
1033  /// Must be at least 1 and at most
1034  /// ::HAPI_NodeInfo::parmChoiceCount - start.
1035  ///
1037  HAPI_ParmChoiceInfo * parm_choices,
1038  int start, int length );
1039 
1040  /// @brief Set single parm int value by name.
1041  ///
1042  /// @note Regardless of the value, when calling this function
1043  /// on a parameter, if that parameter has a callback function
1044  /// attached to it, that callback function will be called. For
1045  /// example, if the parameter is a button the button will be
1046  /// pressed.
1047  ///
1048  /// @note In threaded mode, this is an _async call_!
1049  ///
1050  /// This API will invoke the cooking thread if threading is
1051  /// enabled. This means it will return immidiately. Use
1052  /// the status and cooking count APIs under DIAGNOSTICS to get
1053  /// a sense of the progress. All other API calls will block
1054  /// until the cook operation has finished.
1055  ///
1056  /// Also note that the cook result won't be of type
1057  /// ::HAPI_STATUS_CALL_RESULT like all calls (including this one).
1058  /// Whenever the threading cook is done it will fill the
1059  /// @a cook result which is queried using
1060  /// ::HAPI_STATUS_COOK_RESULT.
1061  ///
1062  /// @param[in] node_id
1063  /// The node id.
1064  ///
1065  /// @param[in] parm_name
1066  /// The parm name.
1067  ///
1068  /// @param[in] index
1069  /// Index within the parameter's values tuple.
1070  ///
1071  /// @param[in] value
1072  /// The int value.
1073  ///
1075  const char * parm_name,
1076  int index,
1077  int value );
1078 
1079  /// @brief Set (push) an array of parameter int values.
1080  ///
1081  /// @note Regardless of the values, when calling this function
1082  /// on a set of parameters, if any parameter has a callback
1083  /// function attached to it, that callback function will be called.
1084  /// For example, if the parameter is a button the button will be
1085  /// pressed.
1086  ///
1087  /// @note In threaded mode, this is an _async call_!
1088  ///
1089  /// This API will invoke the cooking thread if threading is
1090  /// enabled. This means it will return immidiately. Use
1091  /// the status and cooking count APIs under DIAGNOSTICS to get
1092  /// a sense of the progress. All other API calls will block
1093  /// until the cook operation has finished.
1094  ///
1095  /// Also note that the cook result won't be of type
1096  /// ::HAPI_STATUS_CALL_RESULT like all calls (including this one).
1097  /// Whenever the threading cook is done it will fill the
1098  /// @a cook result which is queried using
1099  /// ::HAPI_STATUS_COOK_RESULT.
1100  ///
1101  /// @param[in] node_id
1102  /// The node id.
1103  ///
1104  /// @param[in] values
1105  /// Array of ints at least the size of length.
1106  ///
1107  /// @param[in] start
1108  /// First index of range. Must be at least 0 and at
1109  /// most ::HAPI_NodeInfo::parmIntValueCount - 1.
1110  ///
1111  /// @param[in] length
1112  /// Must be at least 1 and at most
1113  /// ::HAPI_NodeInfo::parmIntValueCount - start.
1114  ///
1115  HAPI_DECL HAPI_SetParmIntValues( HAPI_NodeId node_id, const int * values,
1116  int start, int length );
1117 
1118  /// @brief Set single parm float value by name.
1119  ///
1120  /// @note Regardless of the value, when calling this function
1121  /// on a parameter, if that parameter has a callback function
1122  /// attached to it, that callback function will be called. For
1123  /// example, if the parameter is a button the button will be
1124  /// pressed.
1125  ///
1126  /// @note In threaded mode, this is an _async call_!
1127  ///
1128  /// This API will invoke the cooking thread if threading is
1129  /// enabled. This means it will return immidiately. Use
1130  /// the status and cooking count APIs under DIAGNOSTICS to get
1131  /// a sense of the progress. All other API calls will block
1132  /// until the cook operation has finished.
1133  ///
1134  /// Also note that the cook result won't be of type
1135  /// ::HAPI_STATUS_CALL_RESULT like all calls (including this one).
1136  /// Whenever the threading cook is done it will fill the
1137  /// @a cook result which is queried using
1138  /// ::HAPI_STATUS_COOK_RESULT.
1139  ///
1140  /// @param[in] node_id
1141  /// The node id.
1142  ///
1143  /// @param[in] parm_name
1144  /// The parm name.
1145  ///
1146  /// @param[in] index
1147  /// Index within the parameter's values tuple.
1148  ///
1149  /// @param[in] value
1150  /// The float value.
1151  ///
1153  const char * parm_name,
1154  int index,
1155  float value );
1156 
1157  /// @brief Set (push) an array of parameter float values.
1158  ///
1159  /// @note Regardless of the values, when calling this function
1160  /// on a set of parameters, if any parameter has a callback
1161  /// function attached to it, that callback function will be called.
1162  /// For example, if the parameter is a button the button will be
1163  /// pressed.
1164  ///
1165  /// @note In threaded mode, this is an _async call_!
1166  ///
1167  /// This API will invoke the cooking thread if threading is
1168  /// enabled. This means it will return immidiately. Use
1169  /// the status and cooking count APIs under DIAGNOSTICS to get
1170  /// a sense of the progress. All other API calls will block
1171  /// until the cook operation has finished.
1172  ///
1173  /// Also note that the cook result won't be of type
1174  /// ::HAPI_STATUS_CALL_RESULT like all calls (including this one).
1175  /// Whenever the threading cook is done it will fill the
1176  /// @a cook result which is queried using
1177  /// ::HAPI_STATUS_COOK_RESULT.
1178  ///
1179  /// @param[in] node_id
1180  /// The node id.
1181  ///
1182  /// @param[in] values
1183  /// Array of floats at least the size of length.
1184  ///
1185  /// @param[in] start
1186  /// First index of range. Must be at least 0 and at
1187  /// most ::HAPI_NodeInfo::parmFloatValueCount - 1.
1188  ///
1189  /// @param[in] length
1190  /// Must be at least 1 and at most
1191  /// ::HAPI_NodeInfo::parmFloatValueCount - start.
1192  ///
1194  const float * values,
1195  int start, int length );
1196 
1197  /// @brief Set (push) a string value. We can only set a single value at
1198  /// a time because we want to avoid fixed size string buffers.
1199  ///
1200  /// @note Regardless of the value, when calling this function
1201  /// on a parameter, if that parameter has a callback function
1202  /// attached to it, that callback function will be called. For
1203  /// example, if the parameter is a button the button will be
1204  /// pressed.
1205  ///
1206  /// @note In threaded mode, this is an _async call_!
1207  ///
1208  /// This API will invoke the cooking thread if threading is
1209  /// enabled. This means it will return immidiately. Use
1210  /// the status and cooking count APIs under DIAGNOSTICS to get
1211  /// a sense of the progress. All other API calls will block
1212  /// until the cook operation has finished.
1213  ///
1214  /// Also note that the cook result won't be of type
1215  /// ::HAPI_STATUS_CALL_RESULT like all calls (including this one).
1216  /// Whenever the threading cook is done it will fill the
1217  /// @a cook result which is queried using
1218  /// ::HAPI_STATUS_COOK_RESULT.
1219  ///
1220  /// @param[in] node_id
1221  /// The node id.
1222  ///
1223  /// @param[in] value
1224  /// The string value.
1225  ///
1226  /// @param[in] parm_id
1227  /// Parameter id of the parameter being updated.
1228  ///
1229  /// @param[in] index
1230  /// Index within the parameter's values tuple.
1231  ///
1233  const char * value,
1234  HAPI_ParmId parm_id, int index );
1235 
1236 
1237  /// @brief Insert an instance of a multiparm before instance_position.
1238  ///
1239  /// @param[in] node_id
1240  /// The node id.
1241  ///
1242  /// @param[in] parm_id
1243  /// A parm id given by a ::HAPI_ParmInfo struct that
1244  /// has type ::HAPI_PARMTYPE_MULTIPARMLIST.
1245  ///
1246  /// @param[in] instance_position
1247  /// The new instance will be inserted at this position
1248  /// index. Do note the multiparms can start at position
1249  /// 1 or 0. Use ::HAPI_ParmInfo::instanceStartOffset to
1250  /// distinguish.
1251  ///
1253  HAPI_ParmId parm_id,
1254  int instance_position );
1255 
1256  /// @brief Remove the instance of a multiparm given by instance_position.
1257  ///
1258  /// @param[in] node_id
1259  /// The node id.
1260  ///
1261  /// @param[in] parm_id
1262  /// A parm id given by a ::HAPI_ParmInfo struct that
1263  /// has type ::HAPI_PARMTYPE_MULTIPARMLIST.
1264  ///
1265  /// @param[in] instance_position
1266  /// The instance at instance_position will removed.
1267  ///
1269  HAPI_ParmId parm_id,
1270  int instance_position );
1271 
1272  // HANDLES --------------------------------------------------------------
1273 
1274  /// @brief Fill an array of ::HAPI_HandleInfo structs with information
1275  /// about every exposed user manipulation handle on the asset.
1276  ///
1277  /// @param[in] asset_id
1278  /// The asset id.
1279  ///
1280  /// @param[out] handle_infos
1281  /// Array of ::HAPI_HandleInfo at least the size of length.
1282  ///
1283  /// @param[in] start
1284  /// First index of range. Must be at least 0 and at
1285  /// most ::HAPI_AssetInfo::handleCount - 1.
1286  ///
1287  /// @param[in] length
1288  /// Must be at least 1 and at most
1289  /// ::HAPI_AssetInfo::handleCount - start.
1290  ///
1292  HAPI_HandleInfo * handle_infos,
1293  int start, int length );
1294 
1295  /// @brief Fill an array of ::HAPI_HandleInfo structs with information
1296  /// about every exposed user manipulation handle on the asset.
1297  ///
1298  /// @param[in] asset_id
1299  /// The asset id.
1300  ///
1301  /// @param[in] handle_index
1302  /// The index of the handle, from 0 to handleCount - 1
1303  /// from the call to ::HAPI_GetAssetInfo().
1304  ///
1305  /// @param[out] handle_infos
1306  /// Array of ::HAPI_HandleInfo at least the size of length.
1307  ///
1308  /// @param[in] start
1309  /// First index of range. Must be at least 0 and at
1310  /// most ::HAPI_HandleInfo::bindingsCount - 1.
1311  ///
1312  /// @param[in] length
1313  /// Must be at least 0 and at most
1314  /// ::HAPI_HandleInfo::bindingsCount - start.
1315  ///
1317  int handle_index,
1318  HAPI_HandleBindingInfo * handle_infos,
1319  int start, int length );
1320 
1321  // PRESETS --------------------------------------------------------------
1322 
1323  /// @brief Generate a preset blob of the current state of all the
1324  /// parameter values, cache it, and return its size in bytes.
1325  ///
1326  /// @param[in] node_id
1327  /// The exposed node id.
1328  ///
1329  /// @param[in] preset_type
1330  /// The preset type.
1331  ///
1332  /// @param[in] preset_name
1333  /// Optional. This is only used if the @p preset_type is
1334  /// ::HAPI_PRESETTYPE_IDX. If NULL is given, the preset
1335  /// name will be the same as the name of the node with
1336  /// the given @p node_id.
1337  ///
1338  /// @param[out] buffer_length
1339  /// Size of the buffer.
1340  ///
1342  HAPI_PresetType preset_type,
1343  const char * preset_name,
1344  int * buffer_length );
1345 
1346  /// @brief Generates a preset for the given asset.
1347  ///
1348  /// @param[in] node_id
1349  /// The exposed node id.
1350  ///
1351  /// @param[out] buffer
1352  /// Buffer to hold the preset data.
1353  ///
1354  /// @param[in] buffer_length
1355  /// Size of the buffer. Should be the same as the length
1356  /// returned by ::HAPI_GetPresetBufLength().
1357  ///
1358  HAPI_DECL HAPI_GetPreset( HAPI_NodeId node_id, char * buffer,
1359  int buffer_length );
1360 
1361  /// @brief Sets a particular asset to a given preset.
1362  ///
1363  /// @param[in] node_id
1364  /// The exposed node id.
1365  ///
1366  /// @param[in] preset_type
1367  /// The preset type.
1368  ///
1369  /// @param[in] preset_name
1370  /// Optional. This is only used if the @p preset_type is
1371  /// ::HAPI_PRESETTYPE_IDX. If NULL is give, the first
1372  /// preset in the IDX file will be chosen.
1373  ///
1374  /// @param[in] buffer
1375  /// Buffer to hold the preset data.
1376  ///
1377  /// @param[in] buffer_length
1378  /// Size of the buffer.
1379  ///
1381  HAPI_PresetType preset_type,
1382  const char * preset_name,
1383  const char * buffer,
1384  int buffer_length );
1385 
1386  // OBJECTS --------------------------------------------------------------
1387 
1388  /// @brief Fill an array of ::HAPI_ObjectInfo structs with information
1389  /// on each visible object in the scene that has a SOP network
1390  /// (is not a sub-network).
1391  /// Note that this function will reset all the objects'
1392  /// ::HAPI_ObjectInfo.haveGeosChanged flags to false after
1393  /// it returns the original flag values.
1394  ///
1395  /// @param[in] asset_id
1396  /// The asset id.
1397  ///
1398  /// @param[out] object_infos
1399  /// Array of ::HAPI_ObjectInfo at least the size of
1400  /// length.
1401  ///
1402  /// @param[in] start
1403  /// First object index to begin fill. Must be at least
1404  /// 0 and at most length - 1.
1405  ///
1406  /// @param[in] length
1407  /// Must be at least 0 and at most
1408  /// ::HAPI_AssetInfo::objectCount - start.
1409  ///
1411  HAPI_ObjectInfo * object_infos,
1412  int start, int length );
1413 
1414  /// @brief Fill an array of ::HAPI_Transform structs with the transforms
1415  /// of each visible object in the scene that has a SOP network
1416  /// (is not a sub-network).
1417  /// Note that this function will reset all the objects'
1418  /// ::HAPI_ObjectInfo::hasTransformChanged flags to false after
1419  /// it returns the original flag values.
1420  ///
1421  /// @param[in] asset_id
1422  /// The asset id.
1423  ///
1424  /// @param[in] rst_order
1425  /// The order of application of translation, rotation and
1426  /// scale.
1427  ///
1428  /// @param[out] transforms
1429  /// Array of ::HAPI_Transform at least the size of
1430  /// length.
1431  ///
1432  /// @param[in] start
1433  /// First index of range. Must be at least 0 and at
1434  /// most ::HAPI_AssetInfo::objectCount - 1.
1435  ///
1436  /// @param[in] length
1437  /// Must be at least 0 and at most
1438  /// ::HAPI_AssetInfo::objectCount - start.
1439  ///
1441  HAPI_RSTOrder rst_order,
1442  HAPI_Transform * transforms,
1443  int start, int length );
1444 
1445  /// @brief Fill an array of ::HAPI_Transform structs with the transforms
1446  /// of each instance of this instancer object
1447  ///
1448  /// @param[in] asset_id
1449  /// The asset id.
1450  ///
1451  /// @param[in] object_id
1452  /// The object id.
1453  ///
1454  /// @param[in] geo_id
1455  /// The geometry id.
1456  ///
1457  /// @param[in] rst_order
1458  /// The order of application of translation, rotation and
1459  /// scale.
1460  ///
1461  /// @param[out] transforms
1462  /// Array of ::HAPI_Transform at least the size of length.
1463  ///
1464  /// @param[in] start
1465  /// First index of range. Must be at least 0 and at
1466  /// most ::HAPI_PartInfo::pointCount - 1.
1467  ///
1468  /// @param[in] length
1469  /// Must be at least 0 and at most
1470  /// ::HAPI_PartInfo::pointCount - @p start.
1471  ///
1473  HAPI_ObjectId object_id,
1474  HAPI_GeoId geo_id,
1475  HAPI_RSTOrder rst_order,
1476  HAPI_Transform * transforms,
1477  int start, int length );
1478 
1479  /// @brief Set the transform of an individual object. This is mostly used
1480  /// with marshaled geometry objects. Trying to modify the
1481  /// transform of an object belonging to an asset other than
1482  /// the special External Input Asset with object id 0 will most
1483  /// likely fail, unless the transforms are exposed as editable
1484  /// via exposed parameters.
1485  ///
1486  /// @param[in] asset_id
1487  /// The asset id.
1488  ///
1489  /// @param[in] object_id
1490  /// The object id.
1491  ///
1492  /// @param[in] transform
1493  /// A ::HAPI_TransformEuler that stores the transform.
1494  ///
1496  HAPI_ObjectId object_id,
1497  const HAPI_TransformEuler * transform );
1498 
1499  // GEOMETRY GETTERS -----------------------------------------------------
1500 
1501  /// @brief Get the main geometry info struct (::HAPI_GeoInfo). Note that
1502  /// this function will reset all the geo_infos'
1503  /// ::HAPI_GeoInfo::hasGeoChanged flags to false after it returns
1504  /// the original flag values.
1505  ///
1506  /// @param[in] asset_id
1507  /// The asset id.
1508  ///
1509  /// @param[in] object_id
1510  /// The object id.
1511  ///
1512  /// @param[in] geo_id
1513  /// The geometry id.
1514  ///
1515  /// @param[out] geo_info
1516  /// ::HAPI_GeoInfo return value.
1517  ///
1519  HAPI_ObjectId object_id,
1520  HAPI_GeoId geo_id,
1521  HAPI_GeoInfo * geo_info );
1522 
1523  /// @brief Get a particular part info struct.
1524  ///
1525  /// @param[in] asset_id
1526  /// The asset id.
1527  ///
1528  /// @param[in] object_id
1529  /// The object id.
1530  ///
1531  /// @param[in] geo_id
1532  /// The geometry id.
1533  ///
1534  /// @param[in] part_id
1535  /// The part id.
1536  ///
1537  /// @param[out] part_info
1538  /// ::HAPI_PartInfo return value.
1539  ///
1541  HAPI_GeoId geo_id, HAPI_PartId part_id,
1542  HAPI_PartInfo * part_info );
1543 
1544  /// @brief Get the array of faces where the nth integer in the array is
1545  /// the number of vertices the nth face has.
1546  ///
1547  /// @param[in] asset_id
1548  /// The asset id.
1549  ///
1550  /// @param[in] object_id
1551  /// The object id.
1552  ///
1553  /// @param[in] geo_id
1554  /// The geometry id.
1555  ///
1556  /// @param[in] part_id
1557  /// The part id.
1558  ///
1559  /// @param[out] face_counts
1560  /// An integer array at least the size of length.
1561  ///
1562  /// @param[in] start
1563  /// First index of range. Must be at least 0 and at
1564  /// most ::HAPI_PartInfo::faceCount - 1.
1565  ///
1566  /// @param[in] length
1567  /// Must be at least 0 and at most
1568  /// ::HAPI_PartInfo::faceCount - @p start.
1569  ///
1571  HAPI_ObjectId object_id,
1572  HAPI_GeoId geo_id,
1573  HAPI_PartId part_id,
1574  int * face_counts,
1575  int start, int length );
1576 
1577  /// @brief Get array containing the vertex-point associations where the
1578  /// ith element in the array is the point index the ith vertex
1579  /// associates with.
1580  ///
1581  /// @param[in] asset_id
1582  /// The asset id.
1583  ///
1584  /// @param[in] object_id
1585  /// The object id.
1586  ///
1587  /// @param[in] geo_id
1588  /// The geometry id.
1589  ///
1590  /// @param[in] part_id
1591  /// The part id.
1592  ///
1593  /// @param[out] vertex_list
1594  /// An integer array at least the size of length.
1595  ///
1596  /// @param[in] start
1597  /// First index of range. Must be at least 0 and at
1598  /// most ::HAPI_PartInfo::vertexCount - 1.
1599  ///
1600  /// @param[in] length
1601  /// Must be at least 0 and at most
1602  /// ::HAPI_PartInfo::vertexCount - @p start.
1603  ///
1605  HAPI_ObjectId object_id,
1606  HAPI_GeoId geo_id,
1607  HAPI_PartId part_id,
1608  int * vertex_list,
1609  int start, int length );
1610 
1611  /// @brief Get the main geometry info struct (::HAPI_GeoInfo).
1612  ///
1613  /// @param[in] asset_id
1614  /// The asset id.
1615  ///
1616  /// @param[in] object_id
1617  /// The object id.
1618  ///
1619  /// @param[in] geo_id
1620  /// The geometry id.
1621  ///
1622  /// @param[in] part_id
1623  /// The part id.
1624  ///
1625  /// @param[in] name
1626  /// Attribute name.
1627  ///
1628  /// @param[in] owner
1629  /// Attribute owner.
1630  ///
1631  /// @param[out] attr_info
1632  /// ::HAPI_AttributeInfo to be filled. Check
1633  /// ::HAPI_AttributeInfo::exists to see if this attribute
1634  /// exists.
1635  ///
1637  HAPI_ObjectId object_id,
1638  HAPI_GeoId geo_id,
1639  HAPI_PartId part_id,
1640  const char * name,
1641  HAPI_AttributeOwner owner,
1642  HAPI_AttributeInfo * attr_info );
1643 
1644  /// @brief Get list of attribute names by attribute owner. Note that the
1645  /// name string handles are only valid until the next time this
1646  /// function is called.
1647  ///
1648  /// @param[in] asset_id
1649  /// The asset id.
1650  ///
1651  /// @param[in] object_id
1652  /// The object id.
1653  ///
1654  /// @param[in] geo_id
1655  /// The geometry id.
1656  ///
1657  /// @param[in] part_id
1658  /// The part id.
1659  ///
1660  /// @param[in] owner
1661  /// The ::HAPI_AttributeOwner enum value specifying the
1662  /// owner of the attribute.
1663  ///
1664  /// @param[out] attribute_names
1665  /// Array of ints (string handles) to house the
1666  /// attribute names. Should be exactly the size of the
1667  /// appropriate attribute owner type count
1668  /// in ::HAPI_PartInfo.
1669  ///
1670  /// @param[in] count
1671  /// Sanity check count. Must be equal to the appropriate
1672  /// attribute owner type count in ::HAPI_PartInfo.
1673  ///
1675  HAPI_ObjectId object_id,
1676  HAPI_GeoId geo_id,
1677  HAPI_PartId part_id,
1678  HAPI_AttributeOwner owner,
1679  HAPI_StringHandle * attribute_names,
1680  int count );
1681 
1682  /// @brief Get attribute integer data.
1683  ///
1684  /// @param[in] asset_id
1685  /// The asset id.
1686  ///
1687  /// @param[in] object_id
1688  /// The object id.
1689  ///
1690  /// @param[in] geo_id
1691  /// The geometry id.
1692  ///
1693  /// @param[in] part_id
1694  /// The part id.
1695  ///
1696  /// @param[in] name
1697  /// Attribute name.
1698  ///
1699  /// @param[in] attr_info
1700  /// ::HAPI_AttributeInfo used as input for what tuple size.
1701  /// you want. Also contains some sanity checks like
1702  /// data type. Generally should be the same struct
1703  /// returned by ::HAPI_GetAttributeInfo().
1704  ///
1705  /// @param[out] data
1706  /// An integer array at least the size of length.
1707  ///
1708  /// @param[in] start
1709  /// First index of range. Must be at least 0 and at
1710  /// most ::HAPI_AttributeInfo::count - 1.
1711  ///
1712  /// @param[in] length
1713  /// Must be at least 0 and at most
1714  /// ::HAPI_AttributeInfo::count - @p start.
1715  ///
1717  HAPI_ObjectId object_id,
1718  HAPI_GeoId geo_id,
1719  HAPI_PartId part_id,
1720  const char * name,
1721  HAPI_AttributeInfo * attr_info,
1722  int * data,
1723  int start, int length );
1724 
1725  /// @brief Get attribute float data.
1726  ///
1727  /// @param[in] asset_id
1728  /// The asset id.
1729  ///
1730  /// @param[in] object_id
1731  /// The object id.
1732  ///
1733  /// @param[in] geo_id
1734  /// The geometry id.
1735  ///
1736  /// @param[in] part_id
1737  /// The part id.
1738  ///
1739  /// @param[in] name
1740  /// Attribute name.
1741  ///
1742  /// @param[in] attr_info
1743  /// ::HAPI_AttributeInfo used as input for what tuple size.
1744  /// you want. Also contains some sanity checks like
1745  /// data type. Generally should be the same struct
1746  /// returned by ::HAPI_GetAttributeInfo().
1747  ///
1748  /// @param[out] data
1749  /// An float array at least the size of length.
1750  ///
1751  /// @param[in] start
1752  /// First index of range. Must be at least 0 and at
1753  /// most ::HAPI_AttributeInfo::count - 1.
1754  ///
1755  /// @param[in] length
1756  /// Must be at least 0 and at most
1757  /// ::HAPI_AttributeInfo::count - @p start.
1758  ///
1760  HAPI_ObjectId object_id,
1761  HAPI_GeoId geo_id,
1762  HAPI_PartId part_id,
1763  const char * name,
1764  HAPI_AttributeInfo * attr_info,
1765  float * data,
1766  int start, int length );
1767 
1768  /// @brief Get attribute string data. Note that the string handles
1769  /// returned are only valid until the next time this function
1770  /// is called.
1771  ///
1772  /// @param[in] asset_id
1773  /// The asset id.
1774  ///
1775  /// @param[in] object_id
1776  /// The object id.
1777  ///
1778  /// @param[in] geo_id
1779  /// The geometry id.
1780  ///
1781  /// @param[in] part_id
1782  /// The part id.
1783  ///
1784  /// @param[in] name
1785  /// Attribute name.
1786  ///
1787  /// @param[in] attr_info
1788  /// ::HAPI_AttributeInfo used as input for what tuple size.
1789  /// you want. Also contains some sanity checks like
1790  /// data type. Generally should be the same struct
1791  /// returned by ::HAPI_GetAttributeInfo().
1792  ///
1793  /// @param[out] data
1794  /// An int (string handles) array at least the
1795  /// size of length.
1796  ///
1797  /// @param[in] start
1798  /// First index of range. Must be at least 0 and at
1799  /// most ::HAPI_AttributeInfo::count - 1.
1800  ///
1801  /// @param[in] length
1802  /// Must be at least 0 and at most
1803  /// ::HAPI_AttributeInfo::count - @p start.
1804  ///
1806  HAPI_ObjectId object_id,
1807  HAPI_GeoId geo_id,
1808  HAPI_PartId part_id,
1809  const char * name,
1810  HAPI_AttributeInfo * attr_info,
1811  int * data,
1812  int start, int length );
1813 
1814  /// @brief Get group names for an entire geo. Please note that this
1815  // function is NOT per-part, but it is per-geo. The companion
1816  /// function ::HAPI_GetGroupMembership() IS per-part. Also keep
1817  /// in mind that the name string handles are only
1818  /// valid until the next time this function is called.
1819  ///
1820  /// @param[in] asset_id
1821  /// The asset id.
1822  ///
1823  /// @param[in] object_id
1824  /// The object id.
1825  ///
1826  /// @param[in] geo_id
1827  /// The geometry id.
1828  ///
1829  /// @param[in] group_type
1830  /// The group type.
1831  ///
1832  /// @param[out] group_names
1833  /// The array of names to be filled. Should be the size
1834  /// given by ::HAPI_GeoInfo_GetGroupCountByType() with
1835  /// @p group_type and the ::HAPI_GeoInfo of @p geo_id.
1836  /// @note These string handles are only valid until the
1837  /// next call to ::HAPI_GetGroupNames().
1838  ///
1839  /// @param[in] group_count
1840  /// Sanity check. Should be less than or equal to the size
1841  /// of @p group_names.
1842  ///
1844  HAPI_ObjectId object_id,
1845  HAPI_GeoId geo_id,
1846  HAPI_GroupType group_type,
1847  HAPI_StringHandle * group_names,
1848  int group_count );
1849 
1850  /// @brief Get group membership.
1851  ///
1852  /// @param[in] asset_id
1853  /// The asset id.
1854  ///
1855  /// @param[in] object_id
1856  /// The object id.
1857  ///
1858  /// @param[in] geo_id
1859  /// The geometry id.
1860  ///
1861  /// @param[in] part_id
1862  /// The part id.
1863  ///
1864  /// @param[in] group_type
1865  /// The group type.
1866  ///
1867  /// @param[in] group_name
1868  /// The group name.
1869  ///
1870  /// @param[out] membership
1871  /// Array of ints that represent the membership of this
1872  /// group. Should be the size given by
1873  /// ::HAPI_PartInfo_GetElementCountByGroupType() with
1874  /// @p group_type and the ::HAPI_PartInfo of @p part_id.
1875  ///
1876  /// @param[in] start
1877  /// Start offset into the membership array. Must be
1878  /// less than ::HAPI_PartInfo_GetElementCountByGroupType().
1879  ///
1880  /// @param[in] length
1881  /// Should be less than or equal to the size
1882  /// of @p membership.
1883  ///
1885  HAPI_ObjectId object_id,
1886  HAPI_GeoId geo_id,
1887  HAPI_PartId part_id,
1888  HAPI_GroupType group_type,
1889  const char * group_name,
1890  int * membership,
1891  int start, int length );
1892 
1893  // GEOMETRY SETTERS -----------------------------------------------------
1894 
1895  /// @brief Set the main geometry info struct (::HAPI_GeoInfo).
1896  /// TODO: This function does nothing at the moment. (Placeholder)
1897  ///
1898  /// @param[in] asset_id
1899  /// The asset id.
1900  ///
1901  /// @param[in] object_id
1902  /// The object id.
1903  ///
1904  /// @param[in] geo_id
1905  /// The geometry id.
1906  ///
1907  /// @param[in] geo_info
1908  /// ::HAPI_GeoInfo value.
1909  ///
1911  HAPI_ObjectId object_id,
1912  HAPI_GeoId geo_id,
1913  HAPI_GeoInfo * geo_info );
1914 
1915  /// @brief Set the main part info struct (::HAPI_PartInfo).
1916  ///
1917  /// @param[in] asset_id
1918  /// The asset id.
1919  ///
1920  /// @param[in] object_id
1921  /// The object id.
1922  ///
1923  /// @param[in] geo_id
1924  /// The geometry id.
1925  ///
1926  /// @param[in] part_info
1927  /// ::HAPI_PartInfo value that describes the input
1928  /// geometry.
1929  ///
1931  HAPI_ObjectId object_id,
1932  HAPI_GeoId geo_id,
1933  const HAPI_PartInfo * part_info );
1934 
1935  /// @brief Set the array of faces where the nth integer in the array is
1936  /// the number of vertices the nth face has.
1937  ///
1938  /// @param[in] asset_id
1939  /// The asset id.
1940  ///
1941  /// @param[in] object_id
1942  /// The object id.
1943  ///
1944  /// @param[in] geo_id
1945  /// The geometry id.
1946  ///
1947  /// @param[in] face_counts
1948  /// An integer array at least the size of @p length.
1949  ///
1950  /// @param[in] start
1951  /// First index of range. Must be at least 0 and at
1952  /// most ::HAPI_PartInfo::faceCount - 1.
1953  ///
1954  /// @param[in] length
1955  /// Must be at least 0 and at most
1956  /// ::HAPI_PartInfo::faceCount - @p start.
1957  ///
1959  HAPI_ObjectId object_id,
1960  HAPI_GeoId geo_id,
1961  const int * face_counts,
1962  int start, int length );
1963 
1964  /// @brief Set array containing the vertex-point associations where the
1965  /// ith element in the array is the point index the ith vertex
1966  /// associates with.
1967  ///
1968  /// @param[in] asset_id
1969  /// The asset id.
1970  ///
1971  /// @param[in] object_id
1972  /// The object id.
1973  ///
1974  /// @param[in] geo_id
1975  /// The geometry id.
1976  ///
1977  /// @param[in] vertex_list
1978  /// An integer array at least the size of length.
1979  ///
1980  /// @param[in] start
1981  /// First index of range. Must be at least 0 and at
1982  /// most ::HAPI_PartInfo::vertexCount - 1.
1983  ///
1984  /// @param[in] length
1985  /// Must be at least 0 and at most
1986  /// ::HAPI_PartInfo::vertexCount - @p start.
1987  ///
1989  HAPI_ObjectId object_id,
1990  HAPI_GeoId geo_id,
1991  const int * vertex_list,
1992  int start, int length );
1993 
1994  /// @brief Add an attribute.
1995  ///
1996  /// @param[in] asset_id
1997  /// The asset id.
1998  ///
1999  /// @param[in] object_id
2000  /// The object id.
2001  ///
2002  /// @param[in] geo_id
2003  /// The geometry id.
2004  ///
2005  /// @param[in] name
2006  /// Attribute name.
2007  ///
2008  /// @param[in] attr_info
2009  /// ::HAPI_AttributeInfo stores attribute properties.
2010  ///
2012  HAPI_ObjectId object_id,
2013  HAPI_GeoId geo_id,
2014  const char * name,
2015  const HAPI_AttributeInfo * attr_info );
2016 
2017  /// @brief Set attribute integer data.
2018  ///
2019  /// @param[in] asset_id
2020  /// The asset id.
2021  ///
2022  /// @param[in] object_id
2023  /// The object id.
2024  ///
2025  /// @param[in] geo_id
2026  /// The geometry id.
2027  ///
2028  /// @param[in] name
2029  /// Attribute name.
2030  ///
2031  /// @param[in] attr_info
2032  /// ::HAPI_AttributeInfo used as input for what tuple size.
2033  /// you want. Also contains some sanity checks like
2034  /// data type. Generally should be the same struct
2035  /// returned by ::HAPI_GetAttributeInfo().
2036  ///
2037  /// @param[in] data
2038  /// An integer array at least the size of length.
2039  ///
2040  /// @param[in] start
2041  /// First index of range. Must be at least 0 and at
2042  /// most ::HAPI_AttributeInfo::count - 1.
2043  ///
2044  /// @param[in] length
2045  /// Must be at least 0 and at most
2046  /// ::HAPI_AttributeInfo::count - @p start.
2047  ///
2049  HAPI_ObjectId object_id,
2050  HAPI_GeoId geo_id,
2051  const char * name,
2052  const HAPI_AttributeInfo * attr_info,
2053  const int * data,
2054  int start, int length );
2055 
2056  /// @brief Set attribute float data.
2057  ///
2058  /// @param[in] asset_id
2059  /// The asset id.
2060  ///
2061  /// @param[in] object_id
2062  /// The object id.
2063  ///
2064  /// @param[in] geo_id
2065  /// The geometry id.
2066  ///
2067  /// @param[in] name
2068  /// Attribute name.
2069  ///
2070  /// @param[in] attr_info
2071  /// ::HAPI_AttributeInfo used as input for what tuple size.
2072  /// you want. Also contains some sanity checks like
2073  /// data type. Generally should be the same struct
2074  /// returned by ::HAPI_GetAttributeInfo().
2075  ///
2076  /// @param[in] data
2077  /// An float array at least the size of length.
2078  ///
2079  /// @param[in] start
2080  /// First index of range. Must be at least 0 and at
2081  /// most ::HAPI_AttributeInfo::count - 1.
2082  ///
2083  /// @param[in] length
2084  /// Must be at least 0 and at most
2085  /// ::HAPI_AttributeInfo::count - @p start.
2086  ///
2088  HAPI_ObjectId object_id,
2089  HAPI_GeoId geo_id,
2090  const char * name,
2091  const HAPI_AttributeInfo * attr_info,
2092  const float * data,
2093  int start, int length );
2094 
2095  /// @brief Set attribute string data.
2096  ///
2097  /// @param[in] asset_id
2098  /// The asset id.
2099  ///
2100  /// @param[in] object_id
2101  /// The object id.
2102  ///
2103  /// @param[in] geo_id
2104  /// The geometry id.
2105  ///
2106  /// @param[in] name
2107  /// Attribute name.
2108  ///
2109  /// @param[in] attr_info
2110  /// ::HAPI_AttributeInfo used as input for what tuple size.
2111  /// you want. Also contains some sanity checks like
2112  /// data type. Generally should be the same struct
2113  /// returned by ::HAPI_GetAttributeInfo().
2114  ///
2115  /// @param[in] data
2116  /// A strings array at least the size of length.
2117  ///
2118  /// @param[in] start
2119  /// First index of range. Must be at least 0 and at
2120  /// most ::HAPI_AttributeInfo::count - 1.
2121  ///
2122  /// @param[in] length
2123  /// Must be at least 0 and at most
2124  /// ::HAPI_AttributeInfo::count - @p start.
2125  ///
2127  HAPI_ObjectId object_id,
2128  HAPI_GeoId geo_id,
2129  const char * name,
2130  const HAPI_AttributeInfo *attr_info,
2131  const char ** data,
2132  int start, int length );
2133 
2134  /// @brief Get group names. Note that the name string handles are only
2135  /// valid until the next time this function is called.
2136  ///
2137  /// @param[in] asset_id
2138  /// The asset id.
2139  ///
2140  /// @param[in] object_id
2141  /// The object id.
2142  ///
2143  /// @param[in] geo_id
2144  /// The geometry id.
2145  ///
2146  /// @param[in] group_type
2147  /// The group type.
2148  ///
2149  /// @param[out] group_name
2150  /// Name of new group to be added.
2151  ///
2153  HAPI_ObjectId object_id,
2154  HAPI_GeoId geo_id,
2155  HAPI_GroupType group_type,
2156  const char * group_name );
2157 
2158  /// @brief Set group membership.
2159  ///
2160  /// @param[in] asset_id
2161  /// The asset id.
2162  ///
2163  /// @param[in] object_id
2164  /// The object id.
2165  ///
2166  /// @param[in] geo_id
2167  /// The geometry id.
2168  ///
2169  /// @param[in] group_type
2170  /// The group type.
2171  ///
2172  /// @param[in] group_name
2173  /// The group name.
2174  ///
2175  /// @param[out] membership
2176  /// Array of ints that represent the membership of this
2177  /// group. Should be the size given by
2178  /// ::HAPI_PartInfo_GetElementCountByGroupType() with
2179  /// @p group_type and the ::HAPI_PartInfo of @p part_id.
2180  ///
2181  /// @param[in] start
2182  /// Start offset into the membership array. Must be
2183  /// less than ::HAPI_PartInfo_GetElementCountByGroupType().
2184  ///
2185  /// @param[in] length
2186  /// Should be less than or equal to the size
2187  /// of @p membership.
2188  ///
2190  HAPI_ObjectId object_id,
2191  HAPI_GeoId geo_id,
2192  HAPI_GroupType group_type,
2193  const char * group_name,
2194  int * membership,
2195  int start, int length );
2196 
2197  /// @brief Commit the current input geometry to the cook engine. Nodes
2198  /// that use this geometry node will re-cook using the input
2199  /// geometry given through the geometry setter API calls.
2200  ///
2201  /// @param[in] asset_id
2202  /// The asset id.
2203  ///
2204  /// @param[in] object_id
2205  /// The object id.
2206  ///
2207  /// @param[in] geo_id
2208  /// The geometry id.
2209  ///
2211  HAPI_ObjectId object_id,
2212  HAPI_GeoId geo_id );
2213 
2214  /// @brief Remove all changes that have been committed to this
2215  /// geometry. Only applies to geometry nodes that are
2216  /// exposed edit nodes.
2217  ///
2218  /// @param[in] asset_id
2219  /// The asset id.
2220  ///
2221  /// @param[in] object_id
2222  /// The object id.
2223  ///
2224  /// @param[in] geo_id
2225  /// The geometry id.
2226  ///
2228  HAPI_ObjectId object_id,
2229  HAPI_GeoId geo_id );
2230 
2231  // INTER-ASSET ----------------------------------------------------------
2232 
2233  /// @brief Connect the transform of two assets together.
2234  ///
2235  /// @param[in] asset_id_from
2236  /// The asset id of the source asset.
2237  ///
2238  /// @param[in] asset_id_to
2239  /// The asset id of the destination asset.
2240  ///
2241  /// @param[in] input_idx
2242  /// The index on the destination asset where the
2243  /// connection should be made.
2244  ///
2246  HAPI_AssetId asset_id_to,
2247  int input_idx );
2248 
2249  /// @brief Break an existing transform connection
2250  ///
2251  /// @param[in] asset_id
2252  /// The asset id of the asset.
2253  ///
2254  /// @param[in] input_idx
2255  /// The index on the asset where the connection
2256  /// should be broken.
2257  ///
2259  int input_idx );
2260 
2261  /// @brief Connect the geometry of two assets together. For
2262  /// example we can connect a particular piece of geometry from
2263  /// an object level asset to a sop level asset or even another
2264  /// object level asset. This method gives you the fine grained
2265  /// control over the exact piece of geometry to connect by
2266  /// allowing you to specify the exact object and group of the
2267  /// geometry you are trying to connect.
2268  ///
2269  /// @param[in] asset_id_from
2270  /// The asset id of the source asset.
2271  ///
2272  /// @param[in] object_id_from
2273  /// The object within the asset that contains the
2274  /// geometry to send.
2275  ///
2276  /// @param[in] asset_id_to
2277  /// The asset id of the destination asset.
2278  ///
2279  /// @param[in] input_idx
2280  /// The index on the destination asset where the
2281  /// connection should be made.
2282  ///
2284  HAPI_ObjectId object_id_from,
2285  HAPI_AssetId asset_id_to,
2286  int input_idx );
2287 
2288  /// @brief Break an existing geometry connection
2289  ///
2290  /// @param[in] asset_id
2291  /// The asset id of the asset.
2292  ///
2293  /// @param[in] input_idx
2294  /// The index on the asset where the connection
2295  /// should be broken.
2296  ///
2298  int input_idx );
2299 
2300  // MATERIALS ------------------------------------------------------------
2301 
2302  /// @brief Get material ids by face/primitive. The material ids returned
2303  /// will be valid as long as the asset is alive. You should query
2304  /// this list after every cook to see if the material assignments
2305  /// have changed. You should also query each material individually
2306  /// using ::HAPI_GetMaterialInfo() to see if it is dirty and needs
2307  /// to be re-imported.
2308  ///
2309  /// @param[in] asset_id
2310  /// The asset id.
2311  ///
2312  /// @param[in] object_id
2313  /// The object id.
2314  ///
2315  /// @param[in] geo_id
2316  /// The geometry id.
2317  ///
2318  /// @param[in] part_id
2319  /// The part id.
2320  ///
2321  /// @param[out] are_all_the_same
2322  /// (optional) If true, all faces on this part have the
2323  /// same material assignment. You can pass NULL here.
2324  ///
2325  /// @param[out] material_ids
2326  /// An array of ::HAPI_MaterialId at least the size of
2327  /// @p length and at most the size of
2328  /// ::HAPI_PartInfo::faceCount.
2329  ///
2330  /// @param[in] start
2331  /// The starting index into the list of faces from which
2332  /// you wish to get the material ids from. Note that
2333  /// this should be less than ::HAPI_PartInfo::faceCount.
2334  ///
2335  /// @param[in] length
2336  /// The number of material ids you wish to get. Note that
2337  /// this should be at most:
2338  /// ::HAPI_PartInfo::faceCount - @p start.
2339  ///
2341  HAPI_ObjectId object_id,
2342  HAPI_GeoId geo_id,
2343  HAPI_PartId part_id,
2344  HAPI_Bool * are_all_the_same,
2345  HAPI_MaterialId * material_ids,
2346  int start, int length );
2347 
2348  /// @brief Get the material info.
2349  ///
2350  /// @param[in] asset_id
2351  /// The asset id.
2352  ///
2353  /// @param[in] material_id
2354  /// The material id as given from
2355  /// ::HAPI_GetMaterialIdsOnFaces().
2356  ///
2357  /// @param[out] material_info
2358  /// The returned material info.
2359  ///
2361  HAPI_MaterialId material_id,
2362  HAPI_MaterialInfo * material_info );
2363 
2364  /// @brief Get the material on a part.
2365  ///
2366  /// @param[in] asset_id
2367  /// The asset id.
2368  ///
2369  /// @param[in] object_id
2370  /// The object id.
2371  ///
2372  /// @param[in] geo_id
2373  /// The geometry id.
2374  ///
2375  /// @param[in] part_id
2376  /// The part id.
2377  ///
2378  /// @param[out] material_info
2379  /// The returned ::HAPI_MaterialInfo. If there is no
2380  /// material on this part the call will still succeed
2381  /// but the ::HAPI_MaterialInfo::exists will be set to
2382  /// false.
2383  ///
2386  HAPI_ObjectId object_id,
2387  HAPI_GeoId geo_id,
2388  HAPI_PartId part_id,
2389  HAPI_MaterialInfo * material_info );
2390 
2391  /// @brief Get the material on a group. Use the
2392  /// ::HAPI_GetGroupMembership() call to determine where the
2393  /// material should be applied.
2394  ///
2395  /// @param[in] asset_id
2396  /// The asset id.
2397  ///
2398  /// @param[in] object_id
2399  /// The object id.
2400  ///
2401  /// @param[in] geo_id
2402  /// The geometry id.
2403  ///
2404  /// @param[in] group_name
2405  /// The group name.
2406  ///
2407  /// @param[out] material_info
2408  /// The returned ::HAPI_MaterialInfo. If there is no
2409  /// material on this group the call will still succeed
2410  /// but the ::HAPI_MaterialInfo::exists will be set to
2411  /// false.
2412  ///
2415  HAPI_ObjectId object_id,
2416  HAPI_GeoId geo_id,
2417  const char * group_name,
2418  HAPI_MaterialInfo * material_info );
2419 
2420  /// @brief Render the entire material to an image for later extraction.
2421  /// This process will use the shader specified to render the
2422  /// object assigned with the material you specified (by id) in
2423  /// UV space, flattening the material into an image that can be
2424  /// later mapped back onto the object.
2425  ///
2426  /// Note that you must call either this method or
2427  /// ::HAPI_RenderTextureToImage() for any of the other material
2428  /// APIs to work.
2429  ///
2430  /// @param[in] asset_id
2431  /// The asset id.
2432  ///
2433  /// @param[in] material_id
2434  /// The material id as given in ::HAPI_MaterialInfo.
2435  ///
2436  /// @param[in] shader_type
2437  /// The shader that will be used to bake this material.
2438  ///
2440  HAPI_MaterialId material_id,
2441  HAPI_ShaderType shader_type );
2442 
2443  /// @brief Render only a single texture to an image for later extraction.
2444  /// An example use of this method might be to render the diffuse,
2445  /// normal, and bump texture maps of a material to individual
2446  /// texture files for use within the client application.
2447  ///
2448  /// Note that you must call either this method or
2449  /// ::HAPI_RenderMaterialToImage() for any of the other material
2450  /// APIs to work.
2451  ///
2452  /// @param[in] asset_id
2453  /// The asset id.
2454  ///
2455  /// @param[in] material_id
2456  /// The material id as given in ::HAPI_MaterialInfo.
2457  ///
2458  /// @param[in] parm_id
2459  /// This is the index in the parameter list of the
2460  /// material_id's node of the parameter containing the
2461  /// texture map file path.
2462  ///
2464  HAPI_MaterialId material_id,
2465  HAPI_ParmId parm_id );
2466 
2467  /// @brief Get the number of supported texture file formats.
2468  ///
2469  /// @param[out] file_format_count
2470  /// The number of supported texture file formats.
2471  ///
2472  HAPI_DECL HAPI_GetSupportedImageFileFormatCount( int * file_format_count );
2473 
2474  /// @brief Get a list of support image file formats - their names,
2475  /// descriptions and a list of recognized extensions.
2476  ///
2477  /// Note that you MUST call
2478  /// ::HAPI_GetSupportedImageFileFormatCount()
2479  /// before calling this function for the first time.
2480  ///
2481  /// @param[out] formats
2482  /// The list of ::HAPI_ImageFileFormat structs to
2483  /// be filled.
2484  ///
2485  /// @param[in] file_format_count
2486  /// The number of supported texture file formats. This
2487  /// should be at least as large as the count returned
2488  /// by ::HAPI_GetSupportedImageFileFormatCount().
2489  ///
2491  int file_format_count );
2492 
2493  /// @brief Get information about the image that was just rendered, like
2494  /// resolution and default file format. This information will be
2495  /// used when extracting planes to an image.
2496  ///
2497  /// Note that you must call either ::HAPI_RenderMaterialToImage()
2498  /// or ::HAPI_RenderTextureToImage() first for this method call
2499  /// to make sense.
2500  ///
2501  /// @param[in] asset_id
2502  /// The asset id.
2503  ///
2504  /// @param[in] material_id
2505  /// The material id as given in ::HAPI_MaterialInfo.
2506  ///
2507  /// @param[out] image_info
2508  /// The struct containing the image information.
2509  ///
2511  HAPI_MaterialId material_id,
2512  HAPI_ImageInfo * image_info );
2513 
2514  /// @brief Set image information like resolution and file format.
2515  /// This information will be used when extracting planes to
2516  /// an image.
2517  ///
2518  /// Note that you must call either ::HAPI_RenderMaterialToImage()
2519  /// or ::HAPI_RenderTextureToImage() first for this method call
2520  /// to make sense.
2521  ///
2522  /// You should also first call ::HAPI_GetImageInfo() to get the
2523  /// current Image Info and change only the properties
2524  /// you don't like.
2525  ///
2526  /// @param[in] asset_id
2527  /// The asset id.
2528  ///
2529  /// @param[in] material_id
2530  /// The material id as given in ::HAPI_MaterialInfo.
2531  ///
2532  /// @param[in] image_info
2533  /// The struct containing the new image information.
2534  ///
2536  HAPI_MaterialId material_id,
2537  const HAPI_ImageInfo * image_info );
2538 
2539  /// @brief Get the number of image planes for the just rendered image.
2540  ///
2541  /// Note that you must call either ::HAPI_RenderMaterialToImage()
2542  /// or ::HAPI_RenderTextureToImage() first for this method call
2543  /// to make sense.
2544  ///
2545  /// @param[in] asset_id
2546  /// The asset id.
2547  ///
2548  /// @param[in] material_id
2549  /// The material id as given in ::HAPI_MaterialInfo.
2550  ///
2551  /// @param[out] image_plane_count
2552  /// The number of image planes.
2553  ///
2555  HAPI_MaterialId material_id,
2556  int * image_plane_count );
2557 
2558  /// @brief Get the names of the image planes of the just rendered image.
2559  ///
2560  /// Note that you must call either ::HAPI_RenderMaterialToImage()
2561  /// or ::HAPI_RenderTextureToImage() first for this method call
2562  /// to make sense.
2563  ///
2564  /// You should also call ::HAPI_GetImagePlaneCount() first to get
2565  /// the total number of image planes so you know how large the
2566  /// image_planes string handle array should be.
2567  ///
2568  /// @param[in] asset_id
2569  /// The asset id.
2570  ///
2571  /// @param[in] material_id
2572  /// The material id as given in ::HAPI_MaterialInfo.
2573  ///
2574  /// @param[out] image_planes
2575  /// The image plane names.
2576  ///
2577  /// @param[in] image_plane_count
2578  /// The number of image planes to get names for. This
2579  /// must be less than or equal to the count returned
2580  /// by ::HAPI_GetImagePlaneCount().
2581  ///
2583  HAPI_MaterialId material_id,
2584  HAPI_StringHandle * image_planes,
2585  int image_plane_count );
2586 
2587  /// @brief Extract a rendered image to a file.
2588  ///
2589  /// Note that you must call either ::HAPI_RenderMaterialToImage()
2590  /// or ::HAPI_RenderTextureToImage() first for this method call
2591  /// to make sense.
2592  ///
2593  /// @param[in] asset_id
2594  /// The asset id.
2595  ///
2596  /// @param[in] material_id
2597  /// The material id as given in ::HAPI_MaterialInfo.
2598  ///
2599  /// @param[in] image_file_format_name
2600  /// The image file format name you wish the image to be
2601  /// extracted as. You can leave this parameter NULL to
2602  /// get the image in the original format if it comes from
2603  /// another texture file or in the default HAPI format,
2604  /// which is ::HAPI_DEFAULT_IMAGE_FORMAT_NAME, if the image
2605  /// is generated.
2606  ///
2607  /// You can get some of the very common standard image
2608  /// file format names from HAPI_Common.h under the
2609  /// "Defines" section.
2610  ///
2611  /// You can also get a list of all supported file formats
2612  /// (and the exact names this parameter expects)
2613  /// by using ::HAPI_GetSupportedImageFileFormats(). This
2614  /// list will include custom file formats you created via
2615  /// custom DSOs (see HDK docs about IMG_Format). You will
2616  /// get back a list of ::HAPI_ImageFileFormat. This
2617  /// parameter expects the ::HAPI_ImageFileFormat::nameSH
2618  /// of a given image file format.
2619  ///
2620  /// @param[in] image_planes
2621  /// The image planes you wish to extract into the file.
2622  /// Multiple image planes should be separated by spaces.
2623  ///
2624  /// @param[in] destination_folder_path
2625  /// The folder where the image file should be created.
2626  ///
2627  /// @param[in] destination_file_name
2628  /// Optional parameter to overwrite the name of the
2629  /// extracted texture file. This should NOT include
2630  /// the extension as the file type will be decided
2631  /// by the ::HAPI_ImageInfo you can set using
2632  /// ::HAPI_SetImageInfo(). You still have to use
2633  /// destination_file_path to get the final file path.
2634  ///
2635  /// Pass in NULL to have the file name be automatically
2636  /// generated from the name of the material SHOP node,
2637  /// the name of the texture map parameter if the
2638  /// image was rendered from a texture, and the image
2639  /// plane names specified.
2640  ///
2641  /// @param[out] destination_file_path
2642  /// The full path string handle, including the
2643  /// destination_folder_path and the texture file name,
2644  /// to the extracted file. Note that this string handle
2645  /// will only be valid until the next call to
2646  /// this function.
2647  ///
2649  HAPI_MaterialId material_id,
2650  const char * image_file_format_name,
2651  const char * image_planes,
2652  const char * destination_folder_path,
2653  const char * destination_file_name,
2654  int * destination_file_path );
2655 
2656  /// @brief Extract a rendered image to memory.
2657  ///
2658  /// Note that you must call either ::HAPI_RenderMaterialToImage()
2659  /// or ::HAPI_RenderTextureToImage() first for this method call
2660  /// to make sense.
2661  ///
2662  /// Also note that this function will do all the work of
2663  /// extracting and composoting the image into a memory buffer
2664  /// but will not return to you that buffer, only its size. Use
2665  /// the returned size to allocated a sufficiently large buffer
2666  /// and call ::HAPI_GetImageMemoryBuffer() to fill your buffer
2667  /// with the just extracted image.
2668  ///
2669  /// @param[in] asset_id
2670  /// The asset id.
2671  ///
2672  /// @param[in] material_id
2673  /// The material id as given in ::HAPI_MaterialInfo.
2674  ///
2675  /// @param[in] image_file_format_name
2676  /// The image file format name you wish the image to be
2677  /// extracted as. You can leave this parameter NULL to
2678  /// get the image in the original format if it comes from
2679  /// another texture file or in the default HAPI format,
2680  /// which is ::HAPI_DEFAULT_IMAGE_FORMAT_NAME, if the image
2681  /// is generated.
2682  ///
2683  /// You can get some of the very common standard image
2684  /// file format names from HAPI_Common.h under the
2685  /// "Defines" section.
2686  ///
2687  /// You can also get a list of all supported file formats
2688  /// (and the exact names this parameter expects)
2689  /// by using ::HAPI_GetSupportedImageFileFormats(). This
2690  /// list will include custom file formats you created via
2691  /// custom DSOs (see HDK docs about IMG_Format). You will
2692  /// get back a list of ::HAPI_ImageFileFormat. This
2693  /// parameter expects the ::HAPI_ImageFileFormat::nameSH
2694  /// of a given image file format.
2695  ///
2696  /// @param[in] image_planes
2697  /// The image planes you wish to extract into the file.
2698  /// Multiple image planes should be separated by spaces.
2699  ///
2700  /// @param[out] buffer_size
2701  /// The extraction will be done to an internal buffer
2702  /// who's size you get via this parameter. Use the
2703  /// returned buffer_size when calling
2704  /// ::HAPI_GetImageMemoryBuffer() to get the image
2705  /// buffer you just extracted.
2706  ///
2708  HAPI_MaterialId material_id,
2709  const char * image_file_format_name,
2710  const char * image_planes,
2711  int * buffer_size );
2712 
2713  /// @brief Fill your allocated buffer with the just extracted
2714  /// image buffer.
2715  ///
2716  /// Note that you must call either ::HAPI_RenderMaterialToImage()
2717  /// or ::HAPI_RenderTextureToImage() first for this method call
2718  /// to make sense.
2719  ///
2720  /// Also note that you must call ::HAPI_ExtractImageToMemory()
2721  /// first in order to perform the extraction and get the
2722  /// extracted image buffer size that you need to know how much
2723  /// memory to allocated to fit your extracted image.
2724  ///
2725  /// @param[in] asset_id
2726  /// The asset id.
2727  ///
2728  /// @param[in] material_id
2729  /// The material id as given in ::HAPI_MaterialInfo.
2730  ///
2731  /// @param[out] buffer
2732  /// The buffer passed in here will be filled with the
2733  /// image buffer created during the call to
2734  /// ::HAPI_ExtractImageToMemory().
2735  ///
2736  /// @param[in] buffer_size
2737  /// Sanity check. This size should be the same as the
2738  /// size allocated for the buffer passed in and should
2739  /// be at least as large as the buffer_size returned by
2740  /// the call to ::HAPI_ExtractImageToMemory().
2741  ///
2743  HAPI_MaterialId material_id,
2744  char * buffer, int buffer_size );
2745 
2746  // SIMULATION/ANIMATION -------------------------------------------------
2747 
2748  /// @brief Set an animation curve on a parameter of an exposed node.
2749  ///
2750  /// @param[in] node_id
2751  /// The exposed node id.
2752  ///
2753  /// @param[in] parm_id
2754  /// The id of an exposed parameter within the node.
2755  /// @param[in] parm_index
2756  /// The index of the parameter, if it is for example
2757  /// a 3 tuple
2758  ///
2759  ///
2760  /// @param[in] curve_keyframes
2761  /// An array of ::HAPI_Keyframe structs that describes
2762  /// the keys on this curve.
2763  ///
2764  /// @param[in] keyframe_count
2765  /// The number of keys on the curve.
2766  ///
2768  int parm_index,
2769  const HAPI_Keyframe * curve_keyframes,
2770  int keyframe_count );
2771 
2772  /// @brief A specialized convenience function to set the T,R,S values
2773  /// on an exposed node.
2774  ///
2775  /// @param[in] node_id
2776  /// The exposed node id.
2777  ///
2778  /// @param[in] trans_comp
2779  /// A value of ::HAPI_TransformComponent that
2780  /// identifies the particular comopnent of the
2781  /// transform to attach the curve to, for example
2782  /// ::HAPI_TRANSFORM_TX.
2783  ///
2784  /// @param[in] curve_keyframes
2785  /// An array of ::HAPI_Keyframe structs that describes
2786  /// the keys on this curve.
2787  ///
2788  /// @param[in] keyframe_count
2789  /// The number of keys on the curve.
2790  ///
2792  HAPI_TransformComponent trans_comp,
2793  const HAPI_Keyframe *curve_keyframes,
2794  int keyframe_count );
2795 
2796  /// @brief Resets the simulation cache of the asset. This is very useful
2797  /// for assets that use dynamics, to be called after some
2798  /// setup has changed for the asset - for example, asset inputs
2799  ///
2800  /// @param[in] asset_id
2801  /// The asset id.
2802  ///
2804 
2805  // VOLUMES --------------------------------------------------------------
2806 
2807  /// @brief Retrieve any meta-data about the volume primitive, including
2808  /// its transform, location, scale, taper, resolution.
2809  ///
2810  /// @param[in] asset_id
2811  /// The asset id.
2812  ///
2813  /// @param[in] object_id
2814  /// The object id.
2815  ///
2816  /// @param[in] geo_id
2817  /// The geometry id.
2818  ///
2819  /// @param[in] part_id
2820  /// The part id.
2821  ///
2822  /// @param[out] volume_info
2823  /// The meta-data associated with the volume on the
2824  /// part specified by the previous parameters.
2825  ///
2827  HAPI_ObjectId object_id,
2828  HAPI_GeoId geo_id,
2829  HAPI_PartId part_id,
2830  HAPI_VolumeInfo * volume_info );
2831 
2832  /// @brief Iterate through a volume based on 8x8x8 sections of the volume
2833  /// Start iterating through the value of the volume at part_id.
2834  ///
2835  /// @param[in] asset_id
2836  /// The asset id.
2837  ///
2838  /// @param[in] object_id
2839  /// The object id.
2840  ///
2841  /// @param[in] geo_id
2842  /// The geometry id.
2843  ///
2844  /// @param[in] part_id
2845  /// The part id.
2846  ///
2847  /// @param[out] tile
2848  /// The tile info referring to the first tile in the
2849  /// volume at part_id.
2850  ///
2852  HAPI_ObjectId object_id,
2853  HAPI_GeoId geo_id,
2854  HAPI_PartId part_id,
2855  HAPI_VolumeTileInfo * tile );
2856 
2857  /// @brief Iterate through a volume based on 8x8x8 sections of the volume
2858  /// Continue iterating through the value of the volume at part_id.
2859  ///
2860  /// @param[in] asset_id
2861  /// The asset id.
2862  ///
2863  /// @param[in] object_id
2864  /// The object id.
2865  ///
2866  /// @param[in] geo_id
2867  /// The geometry id.
2868  ///
2869  /// @param[in] part_id
2870  /// The part id.
2871  ///
2872  /// @param[out] tile
2873  /// The tile info referring to the next tile in the
2874  /// set of tiles associated with the volume at this part.
2875  ///
2877  HAPI_ObjectId object_id,
2878  HAPI_GeoId geo_id,
2879  HAPI_PartId part_id,
2880  HAPI_VolumeTileInfo * tile );
2881 
2882  /// @brief Retrieve floating point values of the voxels pointed to
2883  /// by a tile.
2884  ///
2885  /// @param[in] asset_id
2886  /// The asset id.
2887  ///
2888  /// @param[in] object_id
2889  /// The object id.
2890  ///
2891  /// @param[in] geo_id
2892  /// The geometry id.
2893  ///
2894  /// @param[in] part_id
2895  /// The part id.
2896  ///
2897  /// @param[in] tile
2898  /// The tile to retrieve.
2899  ///
2900  /// @param[out] values
2901  /// The values of the tile.
2902  ///
2904  HAPI_ObjectId object_id,
2905  HAPI_GeoId geo_id,
2906  HAPI_PartId part_id,
2907  HAPI_VolumeTileInfo * tile,
2908  float * values );
2909 
2910  /// @brief Retrieve integer values of the voxels pointed to by a tile.
2911  ///
2912  /// @param[in] asset_id
2913  /// The asset id.
2914  ///
2915  /// @param[in] object_id
2916  /// The object id.
2917  ///
2918  /// @param[in] geo_id
2919  /// The geometry id.
2920  ///
2921  /// @param[in] part_id
2922  /// The part id.
2923  ///
2924  /// @param[in] tile
2925  /// The tile to retrieve.
2926  ///
2927  /// @param[out] values
2928  /// The values of the tile.
2929  ///
2931  HAPI_ObjectId object_id,
2932  HAPI_GeoId geo_id,
2933  HAPI_PartId part_id,
2934  HAPI_VolumeTileInfo * tile,
2935  int * values );
2936 
2937  /// @brief Set the volume info of a geo on a geo input.
2938  ///
2939  /// @param[in] asset_id
2940  /// An asset that this volume will be input into.
2941  ///
2942  /// @param[in] object_id
2943  /// The object id.
2944  ///
2945  /// @param[in] geo_id
2946  /// The geometry id.
2947  ///
2948  /// @param[in] volume_info
2949  /// All volume information that can be specified per
2950  /// volume. This includes the position, orientation, scale,
2951  /// data format, tuple size, and taper. The tile size is
2952  /// always 8x8x8.
2953  ///
2955  HAPI_ObjectId object_id,
2956  HAPI_GeoId geo_id,
2957  const HAPI_VolumeInfo * volume_info );
2958 
2959  /// @brief Set the values of a float tile: this is an 8x8x8 subsection of
2960  /// the volume.
2961  ///
2962  /// @param[in] asset_id
2963  /// The asset that the volume will be input into.
2964  ///
2965  /// @param[in] object_id
2966  /// The object id.
2967  ///
2968  /// @param[in] geo_id
2969  /// The geometry id.
2970  ///
2971  /// @param[in] tile
2972  /// The tile that the volume will be input into.
2973  ///
2974  /// @param[in] values
2975  /// The values of the individual voxel tiles in the
2976  /// volume. The length of this array should
2977  /// be 8^3*tupleSize.
2978  ///
2980  HAPI_ObjectId object_id,
2981  HAPI_GeoId geo_id,
2982  const HAPI_VolumeTileInfo * tile,
2983  const float * values );
2984 
2985  /// @brief Set the values of an int tile: this is an 8x8x8 subsection of
2986  /// the volume.
2987  ///
2988  /// @param[in] asset_id
2989  /// The asset that the volume will be input into.
2990  ///
2991  /// @param[in] object_id
2992  /// The object id.
2993  ///
2994  /// @param[in] geo_id
2995  /// The geometry id.
2996  ///
2997  /// @param[in] tile
2998  /// The tile that the volume will be input into.
2999  ///
3000  /// @param[in] values
3001  /// The values of the individual voxel tiles in the
3002  /// volume. The length of this array should
3003  /// be 8^3*tupleSize.
3004  ///
3006  HAPI_ObjectId object_id,
3007  HAPI_GeoId geo_id,
3008  const HAPI_VolumeTileInfo * tile,
3009  const int * values );
3010 
3011  // CURVES ---------------------------------------------------------------
3012 
3013  /// @brief Retrieve any meta-data about the curves, including the
3014  /// curve's type, order, and periodicity.
3015  ///
3016  /// @param[in] asset_id
3017  /// The asset id.
3018  ///
3019  /// @param[in] object_id
3020  /// The object id.
3021  ///
3022  /// @param[in] geo_id
3023  /// The geometry id.
3024  ///
3025  /// @param[in] part_id
3026  /// The part id.
3027  ///
3028  /// @param[out] info
3029  /// The curve info represents the meta-data about
3030  /// the curves, including the type, order,
3031  /// and periodicity.
3032  ///
3034  HAPI_ObjectId object_id,
3035  HAPI_GeoId geo_id,
3036  HAPI_PartId part_id,
3037  HAPI_CurveInfo * info );
3038 
3039  /// @brief Retrieve the number of vertices for each curve in the part.
3040  ///
3041  /// @param[in] asset_id
3042  /// The asset id.
3043  ///
3044  /// @param[in] object_id
3045  /// The object id.
3046  ///
3047  /// @param[in] geo_id
3048  /// The geometry id.
3049  ///
3050  /// @param[in] part_id
3051  /// The part id.
3052  ///
3053  /// @param[out] counts
3054  /// The number of cvs each curve contains
3055  ///
3056  /// @param[in] start
3057  /// The index of the first curve.
3058  ///
3059  /// @param[in] length
3060  /// The number of curves' counts to retrieve.
3061  ///
3063  HAPI_ObjectId object_id,
3064  HAPI_GeoId geo_id,
3065  HAPI_PartId part_id,
3066  int * counts,
3067  int start, int length );
3068 
3069  /// @brief Retrieve the orders for each curve in the part if the
3070  /// curve has varying order.
3071  ///
3072  /// @param[in] asset_id
3073  /// The asset id.
3074  ///
3075  /// @param[in] object_id
3076  /// The object id.
3077  ///
3078  /// @param[in] geo_id
3079  /// The geometry id.
3080  ///
3081  /// @param[in] part_id
3082  /// The part id.
3083  ///
3084  /// @param[out] orders
3085  /// The order of each curve will be returned in this
3086  /// array.
3087  ///
3088  /// @param[in] start
3089  /// The index of the first curve.
3090  ///
3091  /// @param[in] length
3092  /// The number of curves' orders to retrieve.
3093  ///
3095  HAPI_ObjectId object_id,
3096  HAPI_GeoId geo_id,
3097  HAPI_PartId part_id,
3098  int * orders,
3099  int start, int length );
3100 
3101  /// @brief Retrieve the knots of the curves in this part.
3102  ///
3103  /// @param[in] asset_id
3104  /// The asset id.
3105  ///
3106  /// @param[in] object_id
3107  /// The object id.
3108  ///
3109  /// @param[in] geo_id
3110  /// The geometry id.
3111  ///
3112  /// @param[in] part_id
3113  /// The part id.
3114  ///
3115  /// @param[out] knots
3116  /// The knots of each curve will be returned in this
3117  /// array.
3118  ///
3119  /// @param[in] start
3120  /// The index of the first curve.
3121  ///
3122  /// @param[in] length
3123  /// The number of curves' knots to retrieve. The
3124  /// length of all the knots on a single curve is
3125  /// the order of that curve plus the number of
3126  /// vertices (see ::HAPI_GetCurveOrders(),
3127  /// and ::HAPI_GetCurveCounts()).
3128  ///
3130  HAPI_ObjectId object_id,
3131  HAPI_GeoId geo_id,
3132  HAPI_PartId part_id,
3133  float * knots,
3134  int start, int length );
3135 
3136  /// @brief Set meta-data for the curve mesh, including the
3137  /// curve type, order, and periodicity.
3138  ///
3139  /// @param[in] asset_id
3140  /// The asset id.
3141  ///
3142  /// @param[in] object_id
3143  /// The object id.
3144  ///
3145  /// @param[in] geo_id
3146  /// The geometry id.
3147  ///
3148  /// @param[in] part_id
3149  /// Currently unused. Input asset geos are assumed
3150  /// to have only one part.
3151  ///
3152  /// @param[in] info
3153  /// The curve info represents the meta-data about
3154  /// the curves, including the type, order,
3155  /// and periodicity.
3156  ///
3158  HAPI_ObjectId object_id,
3159  HAPI_GeoId geo_id,
3160  HAPI_PartId part_id,
3161  const HAPI_CurveInfo * info );
3162 
3163  /// @brief Set the number of vertices for each curve in the part.
3164  ///
3165  /// @param[in] asset_id
3166  /// The asset id.
3167  ///
3168  /// @param[in] object_id
3169  /// The object id.
3170  ///
3171  /// @param[in] geo_id
3172  /// The geometry id.
3173  ///
3174  /// @param[in] part_id
3175  /// Currently unused. Input asset geos are assumed
3176  /// to have only one part.
3177  ///
3178  /// @param[in] counts
3179  /// The number of cvs each curve contains.
3180  ///
3181  /// @param[in] start
3182  /// The index of the first curve.
3183  ///
3184  /// @param[in] length
3185  /// The number of curves' counts to set.
3186  ///
3188  HAPI_ObjectId object_id,
3189  HAPI_GeoId geo_id,
3190  HAPI_PartId part_id,
3191  const int * counts,
3192  int start, int length );
3193 
3194  /// @brief Set the orders for each curve in the part if the
3195  /// curve has varying order.
3196  ///
3197  /// @param[in] asset_id
3198  /// The asset id.
3199  ///
3200  /// @param[in] object_id
3201  /// The object id.
3202  ///
3203  /// @param[in] geo_id
3204  /// The geometry id.
3205  ///
3206  /// @param[in] part_id
3207  /// Currently unused. Input asset geos are assumed
3208  /// to have only one part.
3209  ///
3210  /// @param[in] orders
3211  /// The orders of each curve.
3212  ///
3213  /// @param[in] start
3214  /// The index of the first curve.
3215  ///
3216  /// @param[in] length
3217  /// The number of curves' orders to retrieve.
3218  ///
3220  HAPI_ObjectId object_id,
3221  HAPI_GeoId geo_id,
3222  HAPI_PartId part_id,
3223  const int * orders,
3224  int start, int length );
3225 
3226  /// @brief Set the knots of the curves in this part.
3227  ///
3228  /// @param[in] asset_id
3229  /// The asset id.
3230  ///
3231  /// @param[in] object_id
3232  /// The object id.
3233  ///
3234  /// @param[in] geo_id
3235  /// The geometry id.
3236  ///
3237  /// @param[in] part_id
3238  /// Currently unused. Input asset geos are assumed
3239  /// to have only one part.
3240  ///
3241  /// @param[in] knots
3242  /// The knots of each curve.
3243  ///
3244  /// @param[in] start
3245  /// The index of the first curve.
3246  ///
3247  /// @param[in] length
3248  /// The number of curves' knots to set. The
3249  /// length of all the knots on a single curve is
3250  /// the order of that curve plus the number of
3251  /// vertices (see ::HAPI_SetCurveOrders(),
3252  /// and ::HAPI_SetCurveCounts()).
3253  ///
3255  HAPI_ObjectId object_id,
3256  HAPI_GeoId geo_id,
3257  HAPI_PartId part_id,
3258  const float * knots,
3259  int start, int length );
3260 
3261  // CACHING --------------------------------------------------------------
3262 
3263  /// @brief Saves a geometry to file. The type of file to save is
3264  /// to be determined by the extension ie. .bgeo, .obj
3265  ///
3266  /// @param[in] asset_id
3267  /// The asset id.
3268  ///
3269  /// @param[in] object_id
3270  /// The object id.
3271  ///
3272  /// @param[in] geo_id
3273  /// The geometry id.
3274  ///
3275  /// @param[in] file_name
3276  /// The name of the file to be saved. The extension
3277  /// of the file determines its type.
3278  ///
3280  HAPI_ObjectId object_id,
3281  HAPI_GeoId geo_id,
3282  const char * file_name );
3283 
3284  /// @brief Loads a geometry file and put its contents onto a SOP
3285  /// node.
3286  ///
3287  /// @param[in] asset_id
3288  /// The asset id.
3289  ///
3290  /// @param[in] object_id
3291  /// The object id.
3292  ///
3293  /// @param[in] geo_id
3294  /// The geometry id.
3295  ///
3296  /// @param[in] file_name
3297  /// The name of the file to be loaded
3298  ///
3300  HAPI_ObjectId object_id,
3301  HAPI_GeoId geo_id,
3302  const char * file_name );
3303 
3304  /// @brief Cache the current state of the geo to memory, given the
3305  /// format, and return the size. Use this size with your call
3306  /// to ::HAPI_SaveGeoToMemory() to copy the cached geo to your
3307  /// buffer. It is guaranteed that the size will not change between
3308  /// your call to ::HAPI_GetGeoSize() and ::HAPI_SaveGeoToMemory().
3309  ///
3310  /// @param[in] asset_id
3311  /// The asset id.
3312  ///
3313  /// @param[in] object_id
3314  /// The object id.
3315  ///
3316  /// @param[in] geo_id
3317  /// The geometry id.
3318  ///
3319  /// @param[in] format
3320  /// The file format, ie. "obj", "bgeo" etc.
3321  ///
3322  /// @param[out] size
3323  /// The size of the buffer required to hold the output.
3324  ///
3326  HAPI_ObjectId object_id,
3327  HAPI_GeoId geo_id,
3328  const char * format,
3329  int * size );
3330 
3331  /// @brief Saves the cached geometry to your buffer in memory,
3332  /// whose format and required size is identified by the call to
3333  /// ::HAPI_GetGeoSize(). The call to ::HAPI_GetGeoSize() is
3334  /// required as ::HAPI_GetGeoSize() does the actual saving work.
3335  ///
3336  /// Also note that this call to ::HAPI_SaveGeoToMemory will delete
3337  /// the internal geo buffer that was cached in the previous call
3338  /// to ::HAPI_GetGeoSize(). This means that you will need to call
3339  /// ::HAPI_GetGeoSize() again before you can call this function.
3340  ///
3341  /// @param[in] asset_id
3342  /// The asset id.
3343  ///
3344  /// @param[in] object_id
3345  /// The object id.
3346  ///
3347  /// @param[in] geo_id
3348  /// The geometry id.
3349  ///
3350  /// @param[out] buffer
3351  /// The buffer we will write into.
3352  ///
3353  /// @param[in] size
3354  /// The size of the buffer passed in.
3355  ///
3357  HAPI_ObjectId object_id,
3358  HAPI_GeoId geo_id,
3359  char * buffer,
3360  int size );
3361 
3362  /// @brief Loads a geometry from memory and put its
3363  /// contents onto a SOP node.
3364  ///
3365  /// @param[in] asset_id
3366  /// The asset id.
3367  ///
3368  /// @param[in] object_id
3369  /// The object id.
3370  ///
3371  /// @param[in] geo_id
3372  /// The geometry id.
3373  ///
3374  /// @param[in] format
3375  /// The file format, ie. "obj", "bgeo" etc.
3376  ///
3377  /// @param[in] buffer
3378  /// The buffer we will read the geomtry from.
3379  ///
3380  /// @param[in] size
3381  /// The size of the buffer passed in.
3382  ///
3384  HAPI_ObjectId object_id,
3385  HAPI_GeoId geo_id,
3386  const char * format,
3387  const char * buffer,
3388  int size );
3389 
3390 #endif // __HAPI_h__
HAPI_DECL HAPI_SetCurveKnots(HAPI_AssetId asset_id, HAPI_ObjectId object_id, HAPI_GeoId geo_id, HAPI_PartId part_id, const float *knots, int start, int length)
Set the knots of the curves in this part.
HAPI_DECL HAPI_GetAttributeStringData(HAPI_AssetId asset_id, HAPI_ObjectId object_id, HAPI_GeoId geo_id, HAPI_PartId part_id, const char *name, HAPI_AttributeInfo *attr_info, int *data, int start, int length)
Get attribute string data. Note that the string handles returned are only valid until the next time t...
HAPI_DECL HAPI_SetVolumeInfo(HAPI_AssetId asset_id, HAPI_ObjectId object_id, HAPI_GeoId geo_id, const HAPI_VolumeInfo *volume_info)
Set the volume info of a geo on a geo input.
HAPI_DECL HAPI_CookAsset(HAPI_AssetId asset_id, const HAPI_CookOptions *cook_options)
Initiate a cook on this asset. Note that this may trigger cooks on other assets if they are connected...
HAPI_DECL HAPI_SetVolumeTileIntData(HAPI_AssetId asset_id, HAPI_ObjectId object_id, HAPI_GeoId geo_id, const HAPI_VolumeTileInfo *tile, const int *values)
Set the values of an int tile: this is an 8x8x8 subsection of the volume.
HAPI_DECL HAPI_GetHandleInfo(HAPI_AssetId asset_id, HAPI_HandleInfo *handle_infos, int start, int length)
Fill an array of HAPI_HandleInfo structs with information about every exposed user manipulation handl...
HAPI_DECL HAPI_GetSupportedImageFileFormatCount(int *file_format_count)
Get the number of supported texture file formats.
HAPI_DECL HAPI_GetNodeInfo(HAPI_NodeId node_id, HAPI_NodeInfo *node_info)
Fill an HAPI_NodeInfo struct.
HAPI_DECL HAPI_GetAssetInfo(HAPI_AssetId asset_id, HAPI_AssetInfo *asset_info)
Fill an asset_info struct.
HAPI_DECL HAPI_AddAttribute(HAPI_AssetId asset_id, HAPI_ObjectId object_id, HAPI_GeoId geo_id, const char *name, const HAPI_AttributeInfo *attr_info)
Add an attribute.
HAPI_DECL HAPI_CheckForNewAssets(int *new_asset_count)
Resyncs a HAPI to the underlying Houdini scene after one more more nodes have been created by an asse...
HAPI_DECL HAPI_CommitGeo(HAPI_AssetId asset_id, HAPI_ObjectId object_id, HAPI_GeoId geo_id)
Commit the current input geometry to the cook engine. Nodes that use this geometry node will re-cook ...
HAPI_DECL HAPI_GetParmStringValues(HAPI_NodeId node_id, HAPI_Bool evaluate, HAPI_StringHandle *values, int start, int length)
Fill an array of parameter string handles. These handles must be used in conjunction with HAPI_GetStr...
HAPI_DECL HAPI_IsAssetValid(HAPI_AssetId asset_id, int asset_validation_id, int *answer)
Determine if your instance of the asset actually still exists inside the Houdini scene. This is what can be used to determine when the Houdini scene needs to be re-populated using the host application's instances of the assets. Note that this function will ALWAYS return HAPI_RESULT_SUCCESS.
HAPI_DECL HAPI_SaveGeoToMemory(HAPI_AssetId asset_id, HAPI_ObjectId object_id, HAPI_GeoId geo_id, char *buffer, int size)
Saves the cached geometry to your buffer in memory, whose format and required size is identified by t...
HAPI_DECL HAPI_GetGlobalNodes(HAPI_GlobalNodes *global_nodes)
Fill a HAPI_GlobalNodes struct. This contains node ids for the default special nodes that are created...
HAPI_DECL HAPI_CreateInputAsset(HAPI_AssetId *asset_id, const char *name)
Creates a special asset that can accept geometry input. This will create a dummy OBJ node with a Null...
HAPI_DECL HAPI_GetHandleBindingInfo(HAPI_AssetId asset_id, int handle_index, HAPI_HandleBindingInfo *handle_infos, int start, int length)
Fill an array of HAPI_HandleInfo structs with information about every exposed user manipulation handl...
HAPI_DECL HAPI_SetGroupMembership(HAPI_AssetId asset_id, HAPI_ObjectId object_id, HAPI_GeoId geo_id, HAPI_GroupType group_type, const char *group_name, int *membership, int start, int length)
Set group membership.
HAPI_DECL HAPI_RemoveMultiparmInstance(HAPI_NodeId node_id, HAPI_ParmId parm_id, int instance_position)
Remove the instance of a multiparm given by instance_position.
HAPI_DECL HAPI_LoadGeoFromMemory(HAPI_AssetId asset_id, HAPI_ObjectId object_id, HAPI_GeoId geo_id, const char *format, const char *buffer, int size)
Loads a geometry from memory and put its contents onto a SOP node.
HAPI_DECL HAPI_SetImageInfo(HAPI_AssetId asset_id, HAPI_MaterialId material_id, const HAPI_ImageInfo *image_info)
Set image information like resolution and file format. This information will be used when extracting ...
HAPI_RSTOrder
Definition: HAPI_Common.h:434
HAPI_DECL HAPI_SetTime(float time)
Sets the global time of the scene. All API calls will deal with this time to cook.
HAPI_DECL HAPI_GetParmFloatValue(HAPI_NodeId node_id, const char *parm_name, int index, float *value)
Get single parm float value by name.
HAPI_DECL HAPI_SetPreset(HAPI_NodeId node_id, HAPI_PresetType preset_type, const char *preset_name, const char *buffer, int buffer_length)
Sets a particular asset to a given preset.
HAPI_DECL HAPI_SaveGeoToFile(HAPI_AssetId asset_id, HAPI_ObjectId object_id, HAPI_GeoId geo_id, const char *file_name)
Saves a geometry to file. The type of file to save is to be determined by the extension ie...
HAPI_DECL HAPI_GetParmIdFromName(HAPI_NodeId node_id, const char *parm_name, HAPI_ParmId *parm_id)
All parameter APIs require a HAPI_ParmId but if you know the parameter you wish to operate on by name...
HAPI_DECL HAPI_ConvertTransformEulerToMatrix(const HAPI_TransformEuler *transform, float *matrix)
Converts HAPI_TransformEuler into a 4x4 transform matrix.
HAPI_DECL HAPI_GetObjects(HAPI_AssetId asset_id, HAPI_ObjectInfo *object_infos, int start, int length)
Fill an array of HAPI_ObjectInfo structs with information on each visible object in the scene that ha...
HAPI_DECL HAPI_GetNewAssetIds(HAPI_AssetId *asset_ids)
Retrieves the asset ids from the previous call to HAPI_CheckForNewAssets().
HAPI_EnvIntType
Definition: HAPI_Common.h:495
HAPI_DECL HAPI_SetParmStringValue(HAPI_NodeId node_id, const char *value, HAPI_ParmId parm_id, int index)
Set (push) a string value. We can only set a single value at a time because we want to avoid fixed si...
HAPI_DECL HAPI_SetAttributeIntData(HAPI_AssetId asset_id, HAPI_ObjectId object_id, HAPI_GeoId geo_id, const char *name, const HAPI_AttributeInfo *attr_info, const int *data, int start, int length)
Set attribute integer data.
HAPI_DECL HAPI_GetFaceCounts(HAPI_AssetId asset_id, HAPI_ObjectId object_id, HAPI_GeoId geo_id, HAPI_PartId part_id, int *face_counts, int start, int length)
Get the array of faces where the nth integer in the array is the number of vertices the nth face has...
int HAPI_ObjectId
Definition: HAPI_Common.h:118
HAPI_DECL HAPI_GetAttributeNames(HAPI_AssetId asset_id, HAPI_ObjectId object_id, HAPI_GeoId geo_id, HAPI_PartId part_id, HAPI_AttributeOwner owner, HAPI_StringHandle *attribute_names, int count)
Get list of attribute names by attribute owner. Note that the name string handles are only valid unti...
HAPI_DECL HAPI_GetStatusStringBufLength(HAPI_StatusType status_type, HAPI_StatusVerbosity verbosity, int *buffer_size)
Return length of string buffer storing status string message.
HAPI_DECL HAPI_PythonThreadInterpreterLock(HAPI_Bool locked)
Acquires or releases the Python interpreter lock. This is needed if HAPI is called from Python and HA...
HAPI_DECL HAPI_ConvertMatrixToEuler(const float *mat, HAPI_RSTOrder rst_order, HAPI_XYZOrder rot_order, HAPI_TransformEuler *transform_out)
Converts a 4x4 matrix into its TRS form.
HAPI_DECL HAPI_SetAttributeStringData(HAPI_AssetId asset_id, HAPI_ObjectId object_id, HAPI_GeoId geo_id, const char *name, const HAPI_AttributeInfo *attr_info, const char **data, int start, int length)
Set attribute string data.
HAPI_DECL HAPI_GetObjectTransforms(HAPI_AssetId asset_id, HAPI_RSTOrder rst_order, HAPI_Transform *transforms, int start, int length)
Fill an array of HAPI_Transform structs with the transforms of each visible object in the scene that ...
HAPI_DECL HAPI_GetCurveCounts(HAPI_AssetId asset_id, HAPI_ObjectId object_id, HAPI_GeoId geo_id, HAPI_PartId part_id, int *counts, int start, int length)
Retrieve the number of vertices for each curve in the part.
HAPI_DECL HAPI_ResetSimulation(HAPI_AssetId asset_id)
Resets the simulation cache of the asset. This is very useful for assets that use dynamics...
HAPI_AttributeOwner
Definition: HAPI_Common.h:342
HAPI_DECL HAPI_SetAssetTransform(HAPI_AssetId asset_id, HAPI_TransformEuler *transform)
Set the transform of an asset to match the transform of the asset on the client side.
int HAPI_StringHandle
Definition: HAPI_Common.h:104
HAPI_StatusVerbosity
Definition: HAPI_Common.h:154
HAPI_DECL HAPI_LoadAssetLibraryFromMemory(const char *library_buffer, int library_buffer_size, HAPI_Bool allow_overwrite, HAPI_AssetLibraryId *library_id)
Loads a Houdini asset library (OTL) from memory. It does NOT instantiate anything inside the Houdini ...
HAPI_DECL HAPI_GetStatusString(HAPI_StatusType status_type, char *buffer, int buffer_length)
Return status string message.
HAPI_DECL HAPI_SetCurveInfo(HAPI_AssetId asset_id, HAPI_ObjectId object_id, HAPI_GeoId geo_id, HAPI_PartId part_id, const HAPI_CurveInfo *info)
Set meta-data for the curve mesh, including the curve type, order, and periodicity.
HAPI_DECL HAPI_GetAvailableAssetCount(HAPI_AssetLibraryId library_id, int *asset_count)
Get the number of assets contained in an asset library. You should call HAPI_LoadAssetLibraryFromFile...
HAPI_DECL HAPI_GetCookingCurrentCount(int *count)
Get current number of nodes that have already cooked in the current session. Note that this is a very...
HAPI_DECL HAPI_LoadHIPFile(const char *file_name, HAPI_Bool cook_on_load)
Loads a .hip file into the main Houdini scene.
See Attributes.
Definition: HAPI_Common.h:1160
HAPI_DECL HAPI_SetParmFloatValue(HAPI_NodeId node_id, const char *parm_name, int index, float value)
Set single parm float value by name.
HAPI_DECL HAPI_GetParmIntValues(HAPI_NodeId node_id, int *values, int start, int length)
Fill an array of parameter int values. This is more efficient than calling HAPI_GetParmIntValue() ind...
HAPI_DECL HAPI_RenderTextureToImage(HAPI_AssetId asset_id, HAPI_MaterialId material_id, HAPI_ParmId parm_id)
Render only a single texture to an image for later extraction. An example use of this method might be...
HAPI_DECL HAPI_GetMaterialInfo(HAPI_AssetId asset_id, HAPI_MaterialId material_id, HAPI_MaterialInfo *material_info)
Get the material info.
HAPI_DECL HAPI_LoadGeoFromFile(HAPI_AssetId asset_id, HAPI_ObjectId object_id, HAPI_GeoId geo_id, const char *file_name)
Loads a geometry file and put its contents onto a SOP node.
HAPI_DECL HAPI_GetString(HAPI_StringHandle string_handle, char *string_value, int buffer_length)
Gives back the string value of the string with the given handle.
HAPI_DECL HAPI_GetImagePlanes(HAPI_AssetId asset_id, HAPI_MaterialId material_id, HAPI_StringHandle *image_planes, int image_plane_count)
Get the names of the image planes of the just rendered image.
HAPI_DECL HAPI_ConnectAssetGeometry(HAPI_AssetId asset_id_from, HAPI_ObjectId object_id_from, HAPI_AssetId asset_id_to, int input_idx)
Connect the geometry of two assets together. For example we can connect a particular piece of geometr...
HAPI_DECL HAPI_SetTimelineOptions(const HAPI_TimelineOptions *timeline_options)
Sets the global timeline options.
HAPI_XYZOrder
Definition: HAPI_Common.h:445
HAPI_DECL HAPI_GetParmChoiceLists(HAPI_NodeId node_id, HAPI_ParmChoiceInfo *parm_choices, int start, int length)
Fill an array of HAPI_ParmChoiceInfo structs with parameter choice list information from the asset in...
HAPI_DECL HAPI_GetImagePlaneCount(HAPI_AssetId asset_id, HAPI_MaterialId material_id, int *image_plane_count)
Get the number of image planes for the just rendered image.
int HAPI_ParmId
Definition: HAPI_Common.h:114
HAPI_DECL HAPI_GetGeoSize(HAPI_AssetId asset_id, HAPI_ObjectId object_id, HAPI_GeoId geo_id, const char *format, int *size)
Cache the current state of the geo to memory, given the format, and return the size. Use this size with your call to HAPI_SaveGeoToMemory() to copy the cached geo to your buffer. It is guaranteed that the size will not change between your call to HAPI_GetGeoSize() and HAPI_SaveGeoToMemory().
HAPI_DECL HAPI_SetFaceCounts(HAPI_AssetId asset_id, HAPI_ObjectId object_id, HAPI_GeoId geo_id, const int *face_counts, int start, int length)
Set the array of faces where the nth integer in the array is the number of vertices the nth face has...
#define HAPI_DECL_DEPRECATED_REPLACE(hapi_ver, houdini_ver, replacement)
Definition: HAPI_API.h:106
HAPI_DECL HAPI_SetCurveCounts(HAPI_AssetId asset_id, HAPI_ObjectId object_id, HAPI_GeoId geo_id, HAPI_PartId part_id, const int *counts, int start, int length)
Set the number of vertices for each curve in the part.
HAPI_DECL HAPI_SetParmIntValue(HAPI_NodeId node_id, const char *parm_name, int index, int value)
Set single parm int value by name.
HAPI_DECL HAPI_GetStatus(HAPI_StatusType status_type, int *status)
Gives back the status code for a specific status type.
int HAPI_GeoId
Definition: HAPI_Common.h:122
HAPI_DECL HAPI_GetCookingTotalCount(int *count)
Get total number of nodes that need to cook in the current session.
HAPI_DECL HAPI_GetAttributeFloatData(HAPI_AssetId asset_id, HAPI_ObjectId object_id, HAPI_GeoId geo_id, HAPI_PartId part_id, const char *name, HAPI_AttributeInfo *attr_info, float *data, int start, int length)
Get attribute float data.
HAPI_DECL HAPI_GetPreset(HAPI_NodeId node_id, char *buffer, int buffer_length)
Generates a preset for the given asset.
HAPI_ShaderType
Definition: HAPI_Common.h:456
HAPI_DECL HAPI_ConvertTransformQuatToMatrix(const HAPI_Transform *transform, float *matrix)
Converts HAPI_Transform into a 4x4 transform matrix.
HAPI_DECL HAPI_SetCurveOrders(HAPI_AssetId asset_id, HAPI_ObjectId object_id, HAPI_GeoId geo_id, HAPI_PartId part_id, const int *orders, int start, int length)
Set the orders for each curve in the part if the curve has varying order.
HAPI_DECL HAPI_GetAttributeIntData(HAPI_AssetId asset_id, HAPI_ObjectId object_id, HAPI_GeoId geo_id, HAPI_PartId part_id, const char *name, HAPI_AttributeInfo *attr_info, int *data, int start, int length)
Get attribute integer data.
HAPI_DECL HAPI_GetGeoInfo(HAPI_AssetId asset_id, HAPI_ObjectId object_id, HAPI_GeoId geo_id, HAPI_GeoInfo *geo_info)
Get the main geometry info struct (HAPI_GeoInfo). Note that this function will reset all the geo_info...
HAPI_DECL HAPI_GetCurveOrders(HAPI_AssetId asset_id, HAPI_ObjectId object_id, HAPI_GeoId geo_id, HAPI_PartId part_id, int *orders, int start, int length)
Retrieve the orders for each curve in the part if the curve has varying order.
HAPI_DECL HAPI_GetImageInfo(HAPI_AssetId asset_id, HAPI_MaterialId material_id, HAPI_ImageInfo *image_info)
Get information about the image that was just rendered, like resolution and default file format...
HAPI_DECL HAPI_GetParmFloatValues(HAPI_NodeId node_id, float *values, int start, int length)
Fill an array of parameter float values. This is more efficient than calling HAPI_GetParmFloatValue()...
HAPI_DECL HAPI_GetParameters(HAPI_NodeId node_id, HAPI_ParmInfo *parm_infos, int start, int length)
Fill an array of HAPI_ParmInfo structs with parameter information from the asset instance node...
HAPI_DECL HAPI_GetPartInfo(HAPI_AssetId asset_id, HAPI_ObjectId object_id, HAPI_GeoId geo_id, HAPI_PartId part_id, HAPI_PartInfo *part_info)
Get a particular part info struct.
int HAPI_MaterialId
Definition: HAPI_Common.h:128
HAPI_DECL HAPI_GetGroupMembership(HAPI_AssetId asset_id, HAPI_ObjectId object_id, HAPI_GeoId geo_id, HAPI_PartId part_id, HAPI_GroupType group_type, const char *group_name, int *membership, int start, int length)
Get group membership.
HAPI_DECL HAPI_Initialize(const char *otl_search_path, const char *dso_search_path, const HAPI_CookOptions *cook_options, HAPI_Bool use_cooking_thread, int cooking_thread_stack_size)
Create the asset manager, set up environment variables, and initialize the main Houdini scene...
HAPI_DECL HAPI_GetVolumeTileFloatData(HAPI_AssetId asset_id, HAPI_ObjectId object_id, HAPI_GeoId geo_id, HAPI_PartId part_id, HAPI_VolumeTileInfo *tile, float *values)
Retrieve floating point values of the voxels pointed to by a tile.
HAPI_DECL HAPI_GetVolumeInfo(HAPI_AssetId asset_id, HAPI_ObjectId object_id, HAPI_GeoId geo_id, HAPI_PartId part_id, HAPI_VolumeInfo *volume_info)
Retrieve any meta-data about the volume primitive, including its transform, location, scale, taper, resolution.
HAPI_DECL HAPI_GetParmInfoFromName(HAPI_NodeId node_id, const char *parm_name, HAPI_ParmInfo *parm_info)
Get the parm info of a parameter by name.
HAPI_DECL HAPI_ConvertTransform(HAPI_TransformEuler *transform_in_out, HAPI_RSTOrder rst_order, HAPI_XYZOrder rot_order)
Converts the transform described by a HAPI_TransformEuler struct into a different transform and rotat...
HAPI_DECL HAPI_SetTransformAnimCurve(HAPI_NodeId node_id, HAPI_TransformComponent trans_comp, const HAPI_Keyframe *curve_keyframes, int keyframe_count)
A specialized convenience function to set the T,R,S values on an exposed node.
HAPI_DECL HAPI_SetPartInfo(HAPI_AssetId asset_id, HAPI_ObjectId object_id, HAPI_GeoId geo_id, const HAPI_PartInfo *part_info)
Set the main part info struct (HAPI_PartInfo).
HAPI_DECL HAPI_AddGroup(HAPI_AssetId asset_id, HAPI_ObjectId object_id, HAPI_GeoId geo_id, HAPI_GroupType group_type, const char *group_name)
Get group names. Note that the name string handles are only valid until the next time this function i...
HAPI_DECL HAPI_Cleanup()
[HAPI_Initialize]
HAPI_DECL HAPI_IsInitialized()
Check whether the runtime has been intialized yet using HAPI_Initialize(). Function will return HAPI_...
HAPI_DECL HAPI_RenderMaterialToImage(HAPI_AssetId asset_id, HAPI_MaterialId material_id, HAPI_ShaderType shader_type)
Render the entire material to an image for later extraction. This process will use the shader specifi...
HAPI_DECL HAPI_ConnectAssetTransform(HAPI_AssetId asset_id_from, HAPI_AssetId asset_id_to, int input_idx)
Connect the transform of two assets together.
HAPI_DECL HAPI_SetVertexList(HAPI_AssetId asset_id, HAPI_ObjectId object_id, HAPI_GeoId geo_id, const int *vertex_list, int start, int length)
Set array containing the vertex-point associations where the ith element in the array is the point in...
HAPI_DECL HAPI_RevertGeo(HAPI_AssetId asset_id, HAPI_ObjectId object_id, HAPI_GeoId geo_id)
Remove all changes that have been committed to this geometry. Only applies to geometry nodes that are...
#define HAPI_DECL
Definition: HAPI_API.h:112
HAPI_DECL HAPI_Interrupt()
Interrupt a cook or load operation.
HAPI_DECL HAPI_SetObjectTransform(HAPI_AssetId asset_id, HAPI_ObjectId object_id, const HAPI_TransformEuler *transform)
Set the transform of an individual object. This is mostly used with marshaled geometry objects...
HAPI_DECL HAPI_SetAnimCurve(HAPI_NodeId node_id, HAPI_ParmId parm_id, int parm_index, const HAPI_Keyframe *curve_keyframes, int keyframe_count)
Set an animation curve on a parameter of an exposed node.
HAPI_DECL HAPI_ConvertMatrixToQuat(const float *mat, HAPI_RSTOrder rst_order, HAPI_Transform *transform_out)
Converts a 4x4 matrix into its TRS form.
HAPI_DECL HAPI_GetGroupNames(HAPI_AssetId asset_id, HAPI_ObjectId object_id, HAPI_GeoId geo_id, HAPI_GroupType group_type, HAPI_StringHandle *group_names, int group_count)
Get group names for an entire geo. Please note that this.
HAPI_DECL HAPI_DestroyAsset(HAPI_AssetId asset_id)
Destroy the asset instance.
int HAPI_AssetId
Definition: HAPI_Common.h:107
HAPI_DECL HAPI_GetPresetBufLength(HAPI_NodeId node_id, HAPI_PresetType preset_type, const char *preset_name, int *buffer_length)
Generate a preset blob of the current state of all the parameter values, cache it, and return its size in bytes.
HAPI_DECL HAPI_SetParmIntValues(HAPI_NodeId node_id, const int *values, int start, int length)
Set (push) an array of parameter int values.
HAPI_DECL HAPI_GetFirstVolumeTile(HAPI_AssetId asset_id, HAPI_ObjectId object_id, HAPI_GeoId geo_id, HAPI_PartId part_id, HAPI_VolumeTileInfo *tile)
Iterate through a volume based on 8x8x8 sections of the volume Start iterating through the value of t...
HAPI_DECL HAPI_GetCurveKnots(HAPI_AssetId asset_id, HAPI_ObjectId object_id, HAPI_GeoId geo_id, HAPI_PartId part_id, float *knots, int start, int length)
Retrieve the knots of the curves in this part.
HAPI_DECL HAPI_LoadAssetLibraryFromFile(const char *file_path, HAPI_Bool allow_overwrite, HAPI_AssetLibraryId *library_id)
Loads a Houdini asset library (OTL) from a .otl file. It does NOT instantiate anything inside the Hou...
HAPI_DECL HAPI_GetNextVolumeTile(HAPI_AssetId asset_id, HAPI_ObjectId object_id, HAPI_GeoId geo_id, HAPI_PartId part_id, HAPI_VolumeTileInfo *tile)
Iterate through a volume based on 8x8x8 sections of the volume Continue iterating through the value o...
HAPI_DECL HAPI_SetAttributeFloatData(HAPI_AssetId asset_id, HAPI_ObjectId object_id, HAPI_GeoId geo_id, const char *name, const HAPI_AttributeInfo *attr_info, const float *data, int start, int length)
Set attribute float data.
HAPI_DECL HAPI_GetAssetTransform(HAPI_AssetId asset_id, HAPI_RSTOrder rst_order, HAPI_XYZOrder rot_order, HAPI_TransformEuler *transform)
Get the transform of an asset to match the transform of the asset on the client side.
HAPI_DECL HAPI_SetGeoInfo(HAPI_AssetId asset_id, HAPI_ObjectId object_id, HAPI_GeoId geo_id, HAPI_GeoInfo *geo_info)
Set the main geometry info struct (HAPI_GeoInfo). TODO: This function does nothing at the moment...
HAPI_DECL HAPI_GetParmInfo(HAPI_NodeId node_id, HAPI_ParmId parm_id, HAPI_ParmInfo *parm_info)
Get the parm info of a parameter by parm id.
HAPI_DECL HAPI_ExtractImageToMemory(HAPI_AssetId asset_id, HAPI_MaterialId material_id, const char *image_file_format_name, const char *image_planes, int *buffer_size)
Extract a rendered image to memory.
char HAPI_Bool
Definition: HAPI_Common.h:99
HAPI_DECL HAPI_GetStringBufLength(HAPI_StringHandle string_handle, int *buffer_length)
Gives back the string length of the string with the given handle.
HAPI_StatusType
Definition: HAPI_Common.h:145
HAPI_DECL HAPI_SetParmFloatValues(HAPI_NodeId node_id, const float *values, int start, int length)
Set (push) an array of parameter float values.
HAPI_DECL HAPI_ExtractImageToFile(HAPI_AssetId asset_id, HAPI_MaterialId material_id, const char *image_file_format_name, const char *image_planes, const char *destination_folder_path, const char *destination_file_name, int *destination_file_path)
Extract a rendered image to a file.
HAPI_DECL HAPI_InstantiateAsset(const char *asset_name, HAPI_Bool cook_on_load, HAPI_AssetId *asset_id)
Instantiate an asset by name. The asset has to have been loaded as part of an asset library...
HAPI_PresetType
Definition: HAPI_Common.h:292
HAPI_DECL HAPI_SaveHIPFile(const char *file_path)
Saves a .hip file of the current Houdini scene.
HAPI_DECL HAPI_DisconnectAssetTransform(HAPI_AssetId asset_id, int input_idx)
Break an existing transform connection.
HAPI_DECL HAPI_SetVolumeTileFloatData(HAPI_AssetId asset_id, HAPI_ObjectId object_id, HAPI_GeoId geo_id, const HAPI_VolumeTileInfo *tile, const float *values)
Set the values of a float tile: this is an 8x8x8 subsection of the volume.
HAPI_GetMaterialOnGroup(HAPI_AssetId asset_id, HAPI_ObjectId object_id, HAPI_GeoId geo_id, const char *group_name, HAPI_MaterialInfo *material_info)
Get the material on a group. Use the HAPI_GetGroupMembership() call to determine where the material s...
HAPI_DECL HAPI_InsertMultiparmInstance(HAPI_NodeId node_id, HAPI_ParmId parm_id, int instance_position)
Insert an instance of a multiparm before instance_position.
HAPI_DECL HAPI_GetCurveInfo(HAPI_AssetId asset_id, HAPI_ObjectId object_id, HAPI_GeoId geo_id, HAPI_PartId part_id, HAPI_CurveInfo *info)
Retrieve any meta-data about the curves, including the curve's type, order, and periodicity.
HAPI_DECL HAPI_GetInputName(HAPI_AssetId asset_id, int input_idx, int input_type, HAPI_StringHandle *name)
Get the name of an asset's input. This function will return a string handle for the name which will b...
HAPI_DECL HAPI_GetInstanceTransforms(HAPI_AssetId asset_id, HAPI_ObjectId object_id, HAPI_GeoId geo_id, HAPI_RSTOrder rst_order, HAPI_Transform *transforms, int start, int length)
Fill an array of HAPI_Transform structs with the transforms of each instance of this instancer object...
HAPI_GetMaterialOnPart(HAPI_AssetId asset_id, HAPI_ObjectId object_id, HAPI_GeoId geo_id, HAPI_PartId part_id, HAPI_MaterialInfo *material_info)
Get the material on a part.
HAPI_DECL HAPI_GetParmStringValue(HAPI_NodeId node_id, const char *parm_name, int index, HAPI_Bool evaluate, HAPI_StringHandle *value)
Get single parm string value by name.
HAPI_GroupType
Definition: HAPI_Common.h:333
HAPI_DECL HAPI_GetAttributeInfo(HAPI_AssetId asset_id, HAPI_ObjectId object_id, HAPI_GeoId geo_id, HAPI_PartId part_id, const char *name, HAPI_AttributeOwner owner, HAPI_AttributeInfo *attr_info)
Get the main geometry info struct (HAPI_GeoInfo).
int HAPI_NodeId
See Nodes.
Definition: HAPI_Common.h:110
HAPI_DECL HAPI_GetImageMemoryBuffer(HAPI_AssetId asset_id, HAPI_MaterialId material_id, char *buffer, int buffer_size)
Fill your allocated buffer with the just extracted image buffer.
HAPI_DECL HAPI_GetEnvInt(HAPI_EnvIntType int_type, int *value)
Gives back a certain environment integer like version number.
HAPI_DECL HAPI_GetVertexList(HAPI_AssetId asset_id, HAPI_ObjectId object_id, HAPI_GeoId geo_id, HAPI_PartId part_id, int *vertex_list, int start, int length)
Get array containing the vertex-point associations where the ith element in the array is the point in...
int HAPI_AssetLibraryId
Definition: HAPI_Common.h:106
HAPI_DECL HAPI_GetParmIntValue(HAPI_NodeId node_id, const char *parm_name, int index, int *value)
Get single parm int value by name.
HAPI_DECL HAPI_GetMaterialIdsOnFaces(HAPI_AssetId asset_id, HAPI_ObjectId object_id, HAPI_GeoId geo_id, HAPI_PartId part_id, HAPI_Bool *are_all_the_same, HAPI_MaterialId *material_ids, int start, int length)
Get material ids by face/primitive. The material ids returned will be valid as long as the asset is a...
HAPI_DECL HAPI_GetVolumeTileIntData(HAPI_AssetId asset_id, HAPI_ObjectId object_id, HAPI_GeoId geo_id, HAPI_PartId part_id, HAPI_VolumeTileInfo *tile, int *values)
Retrieve integer values of the voxels pointed to by a tile.
HAPI_TransformComponent
Definition: HAPI_Common.h:416
HAPI_DECL HAPI_CreateCurve(HAPI_AssetId *asset_id)
Creates a special curve asset that can be used as input for other assets in the scene.
HAPI_DECL HAPI_GetTimelineOptions(HAPI_TimelineOptions *timeline_options)
Gets the current global timeline options.
HAPI_DECL HAPI_GetTime(float *time)
Gets the global time of the scene. All API calls deal with this time to cook.
HAPI_DECL HAPI_GetSupportedImageFileFormats(HAPI_ImageFileFormat *formats, int file_format_count)
Get a list of support image file formats - their names, descriptions and a list of recognized extensi...
int HAPI_PartId
Definition: HAPI_Common.h:126
HAPI_DECL HAPI_DisconnectAssetGeometry(HAPI_AssetId asset_id, int input_idx)
Break an existing geometry connection.
HAPI_DECL HAPI_GetAvailableAssets(HAPI_AssetLibraryId library_id, HAPI_StringHandle *asset_names, int asset_count)
Get the names of the assets contained in an asset library.