Making a translation move in full numbers


#1

Hey everyone,

I was wondering, if there is a way to make translate Y on my attribute to jump in full integers
instead of float.

I am trying to setup a Control which will swap between different shapes, and it works, only thing is the Control will end up a lot of times in an in between number, and not in a full number, so for the sake of working clean, I want to find a solution for it, any remedy for that?

Thanks :]


#2

short of a better solution you could get a scriptJob to monitor the attribute, round up and set it?


#3

add integer custom attribute, connect translateY to that custom attribute


#4

Hey TheJackson, the problem with that is we lose the usability of using the translate manipulators, makes it less intuitive.

Idunham1, I don’t know much about scriptJob’s how would you go about setting that up?
let’s see the control’s attribute it

facialShape_Ctl.translateY

thanks for the help guys! :]


#5

Say you have a locator controlling the position of a cube (or at least the Y translation).

You could use an expression such as:
pCube1.translateY=floor(locator1.translateY);

The floor function basically returns the truncated version of the argument. Unfortunately, I don’t think there’s a node to let you use direct connections, but the expression will run rather fast anyway. If you wanted the number to be rounded up to the nearest integer, you could use the ceil() function instead of floor. The names are pretty self explanatory.


#6

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.