Making a translation move in full numbers

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
  06 June 2013
Making a translation move in full numbers

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 :]
__________________
My Blog
 
  06 June 2013
short of a better solution you could get a scriptJob to monitor the attribute, round up and set it?
__________________
ldunham.blogspot.com
 
  06 June 2013
add integer custom attribute, connect translateY to that custom attribute
 
  06 June 2013
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! :]
__________________
My Blog
 
  06 June 2013
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.
 
  06 June 2013
Thread automatically closed

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.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 10:36 PM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.