Kronso Posted September 29, 2019 Share Posted September 29, 2019 Hi, I've been learning some procedural modeling, and have run into something probably suuuuper simple, that I can't figure out. I've been searching through help menus to find an answer but haven't had any luck. Also apologies if I have trouble verbalizing my problem. What is the easiest way to scale an object on an axis to a specific value? I have two imported obj's of some arbitrary size. I'm trying to scale object #1 down, to make room for object #2, based on obj #2's size. Like Obj1.z = Obj1.z-Obj2.z. I was hoping something like using a transform node and scaling an axis by bbox("../object1",D_ZSIZE)-bbox("../object2",D_ZSIZE) but that doesn't seem to work unless the object was originally exactly 1 in scale? I've made some convoluted way of creating a line across the z axis of each object, and measuring that. Then in a wrangle, dividing obj2 size by obj1 size and subtracting that from 1, then plugging it into a transform nodes z scale. It does work, but I was hoping for something a bit easier/quicker moving forward. Any help would be super appreciated! This is all still pretty foreign to me, coming from maya. Thanks! Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted September 29, 2019 Share Posted September 29, 2019 You can squeeze an arbitrary object between two other objects by translating it to the center of the gap: (bbox('../LEFT', D_XMAX) + bbox('../RIGHT', D_XMIN)) / 2 temporarily scaling it to unit size: 1 / $SIZEX and scaling it by the size of the gap: abs(bbox('../LEFT', D_XMAX) - bbox('../RIGHT', D_XMIN)) Not entirely sure whether this is what you have requested, though. squeeze_inbetween_objects.hipnc 1 Quote Link to comment Share on other sites More sharing options...
Kronso Posted September 30, 2019 Author Share Posted September 30, 2019 Thanks so much Konstantin! This is exactly what I was looking for. I was getting way over complicated with VEX, when this is way simpler and with less nodes. Super appreciated, that'll help simplify a ton of stuff I've been working on. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.