PDA

View Full Version : maxops.getDefaultTangentType


Ruramuq
01-18-2008, 07:52 PM
maxops.getDefaultTangentType dfltInTangentType dfltOutTangentType

I can't figure it out, how it works?


any help is appreciated..



Bobo
01-18-2008, 09:00 PM
maxops.setDefaultTangentType #slow #slow

Sets the default tangents flyout to Slow for both in and out.

maxops.setDefaultTangentType #slow #fast

If you specify two different types for In and Out, a ? mark appears on the flyout because it does not have an icon for the case, but it would still create new keys with the given tangent types.

To get the tangents:

maxops.getDefaultTangentType &inTangent &outTangent
-> OK
inTangent
-> #slow
outTangent
-> #fast

Ruramuq
01-18-2008, 10:21 PM
oh, this symbol "&" it creates Global variables, so simple,

THANK YOU

I couldn't find about "&" in the maxscript reference..
I was trying something like:
global inTangent
global outTangent
maxops.getDefaultTangentType inTangent outTangent
OK
inTangent
undefined

..

Bobo
01-18-2008, 11:45 PM
oh, this symbol "&" it creates Global variables, so simple,

THANK YOU

I couldn't find about "&" in the maxscript reference..
I was trying something like:
global inTangent
global outTangent
maxops.getDefaultTangentType inTangent outTangent
OK
inTangent
undefined

..

No. The description of the method says

Returns the default In and Out tangent types into the two Out parameters passed by-reference.Available in 3ds Max 8 and higher.

The red text means that the method writes the values using POINTERS - you pass two variables to the method (the variables could be global or local), but you don't pass the VALUES of these variables, but their memory addresses (pointers) using the & sign. So the method writes the results into that memory at the given address and when you ask what is in one of these variables, you get the result!

Check out the topics
"By Reference Parameter Passing"
and
"By-pointer argument handling in FPS methods fixed"

You can say

(--open local scope
local result1, result2 --pre-declare the result vars as local
maxops.getDefaultTangentType &result1 &result2 --get the tangent types
format "Result1 = % in Local Scope\n" result1 --and print their local scope values
format "Result2 = % in Local Scope\n" result2
)--end local scope
format "Result1 = % in Global Scope\n" result1 --print in global scope - gives undefined
format "Result2 = % in Global Scope\n" result2

--OUTPUT:
Result1 = #flat in Local Scope
Result2 = #flat in Local Scope
OK
Result1 = undefined in Global Scope
OK
Result2 = undefined in Global Scope
OK
OK


As you can see, the result1 and result2 variables exist only in the local scope...

Ruramuq
01-19-2008, 12:05 AM
I have so much to learn, but I'll learn those topics, today.

I appreciate your help, Now I'm more motivated to read the whole mxs reference.

CGTalk Moderation
01-19-2008, 12:05 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.