hoknamahn Posted October 5, 2004 Share Posted October 5, 2004 How to call an expression function embedded into OTL? For example I have a custom object... say Foo. And a function (something like float Five() { return 5.0; }) embedded into one of sections (section have a name SomeFunc) of Foo. If we follow usual syntax, then access to the section, in which is located the function, it must look like opdef:/Object/Foo?SomeFunc But this is certainly illogical because the name of function is not indicated and in one section can be (???) several functions. How to call a function Five() in my example? Quote Link to comment Share on other sites More sharing options...
thekenny Posted October 5, 2004 Share Posted October 5, 2004 doesn't : `five()` work? Quote Link to comment Share on other sites More sharing options...
edward Posted October 6, 2004 Share Posted October 6, 2004 In the Type Properties of your custom operator type, go to the Events page. For the Event Handler, "Before First Create", put in the text: exread opdef:/Object/Foo?SomeFunc That will source the definition for your operator type so that it can use the expressions defined in the SomeFunc section. You just refer to the function like what thekenny says. Quote Link to comment Share on other sites More sharing options...
hoknamahn Posted October 6, 2004 Author Share Posted October 6, 2004 Thanks! It works. Quote Link to comment Share on other sites More sharing options...
thekenny Posted October 6, 2004 Share Posted October 6, 2004 thanks ed, i always forget about that darn exread thing. -k Quote Link to comment Share on other sites More sharing options...
hoknamahn Posted October 8, 2004 Author Share Posted October 8, 2004 Hi guys! I have a similar question again. I want to share some piece of a VEX code between several shaders and it would be logical to include the header file into the OTL section. Is it possible to make this and if it is possible, then how? And I don't want to write the same piece of code in each shader. I like to use #include <header.h> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.