Notifications
Clear all

[Closed] in coordsys (getRefCoordSys()) ?

Is it possible to do anything in coordsys context of the current refererence coord sys?

getRefCoordSys() returns name values, but ‘in coordsys’ requires a non-name argument eg

this works:
in coordsys local (do something)

this does not work:
in coordsys (getRefCoordSys()) (do something)
which evaluates to :
in coordsys #local (do something)

I would prefer not to use a case-of process.

3 Replies

use toolMode.coordsys instead getRefCoordSys()

Thanks DenisT, but I don’t think that’s what I’m looking for.
The toolmode is used to CHANGE the mode rather than get it.

in coordsys (toolMode.coordsys()) (print “test”)
– Argument count error: toolMode.coordsys wanted 1, got 0

Maybe I should explain better what I need.
I have object transforms in a dgv, and I want them to behave the same as the transform dialog; eg switching from local, to parent, to world etc depending on the coordsys selected.

Perhaps my approach is wrong, and instead of getting(to display in the dgv) and setting transforms “in coordsys x” I should be doing any transforms using the correct matrix maths for the coordsys returned by getRefCoordSys(). Sadly, my maths skills are coming a bit of a cropper when it comes to nailing down how to juggle my matrices and ref coord systems!

Ohhh… my bad.
I forgot that toolMode.coordsys is not a MAX global… it’s a function to set.

(in my mxs extension it’s a global :))

so that was probably the reason for me to add it as global to max extension.

the only solution is use IF of CASE… but of course you can define this function once on ‘startup’ and use it later where you need.