AndrewVK Posted September 24, 2003 Share Posted September 24, 2003 Suppose i have an custom expression function which returns vector type. How can i refer to vector components from within Point SOP? For example...i want assign this vector to point normal. Quote Link to comment Share on other sites More sharing options...
anakin78z Posted September 24, 2003 Share Posted September 24, 2003 ok, the syntax seems to be this: vector( specify vector )[ specify component id ] so say I set a global variable that is a vector: set -g x = `vector("[1,40,23]")` then I can extract 40 by typing into any parameter field: vector($x)[1] Cheers! Quote Link to comment Share on other sites More sharing options...
AndrewVK Posted September 24, 2003 Author Share Posted September 24, 2003 Yes, its true for variables, but its not works for CUSTOM FUNCTIONS like this (megasimplified): vector solver() { a = 0.5; b = 0.3; c = 0.1; vector newN = [a,b,c]; return newN; } I cant refer to this function by typing solver()[0] in X field solver()[1] in Y field solver()[2] in Z field Quote Link to comment Share on other sites More sharing options...
anakin78z Posted September 25, 2003 Share Posted September 25, 2003 the problem seems to be in the way you're setting the vector. Try this instead: vector solver() { a = 0.5; b = 0.3; c = 0.1; vector newN = vector3(a,b,c); return newN; } That should fix your woes. Quote Link to comment Share on other sites More sharing options...
AndrewVK Posted September 25, 2003 Author Share Posted September 25, 2003 Bingo!!! Thank You anakin! 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.