Notifications
Clear all

[Closed] maxops.getDefaultTangentType

maxops.getDefaultTangentType dfltInTangentType dfltOutTangentType

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

any help is appreciated…

·

4 Replies
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

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

1 Reply
(@bobo)
Joined: 1 year ago

Posts: 0

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
" result1 --and print their local scope values
format "Result2 = % in Local Scope
" result2
)--end local scope
format "Result1 = % in Global Scope
" result1 --print in global scope - gives undefined
format "Result2 = % in Global Scope
" 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…

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.