Easy way to proportionally scale multiple objects in one go?


#1

Hi Gang!

 If you want to scale multiple (differently sized) objects at the same time, to the same

Y-height while retaining their relative X & Z proportions, how do you do it without having
to tediously scale each object individually?

 Background:
 I've got a whole bunch of spline-silhouettes of people to be placed into an arch-viz scene

and am searching for a quick and painless way to make them all 175 cm tall in one
swoop so to speak.

 Any ideas?
 
 Cheers / Alex
 
 
 
 [img]http://badtastic.com/cg/props.png[/img]

#2

Select them all, select all three channels for scale (x, y and z), type in your desired y value into the y box and hold down the CTRL key while you press return/enter.


#3

You could also put them all into a null and scale the Y value of the null.


#4

Won’t that just scale the axes and distort them, you can’t type in the exact height you want with this method?


#5

I just made a quick Py4D plugin that will do what you want. Not COFFEE. Why!? COFFEE doesn’t have any (at all) ways to get the ‘size’ of objects (boo hiss shame on Maxon!). C++ does offer this with GetRad() but then I would need to build fifty versions of a very, very, very simplistically simple solution - for that work, I want dineros (it is not economical anymore to give away the pain and sweat of ‘at least’ four different builds). So, Py4D is the quintessential medium compromise.

So, if you can get Py4D installed, let me know and I’ll send you the Python plugin that works in R11 on any system. Otherwise, you’ll have to wait for a really bored plugin dev to do it in C++ because the COFFEE alternative is pain and suffering (sizes for every type and flavor of object would need to be considered by the developer - again, boo…). :slight_smile:

Robert


#6

I’ve created a script for point objects but the limitation you mention means that it doesn’t work for parametric objects.

The Python plugin sounds like the ideal solution but I’ll post my effort here anyway.

Just set the axis and new size at the top of the script, select the objects to be resized and run the script.


#7

Another old alternative in COFFEE for scaling/sizing proportionally http://forums.cgsociety.org/showpost.php?p=5099049&postcount=41


#8

Indispensable.

Thanks again, Per.

Leonard


#9

Sorry for not responding until now…(been off sick today)
Wow, these scripts are great! Very helpful. Thanks Per & Darter!

As much as I love C4D as my main app, I do miss Rhino's ability to scale an object proportionately, on all three axis's by simply manipulating one of then in actual units as opposed to it's scale or relative size increase either up or down in percentage.

[(video) If an object is 10 meters deep but needs to be 13 and have its width and height change accordingly, its really a no-brainer in Rhino.](http://badtastic.com/cg/iShowU-Capture2.mov) 

This is the only thing I miss in C4D and would gladly pay for this ease and functionality (plugin? hint ;)

Cheers / Alex

#10

Here is the Py4D plugin to do ‘sizing’. It can size proportionally or per-axis for all selected objects. It supports undos and is open source so feel free to improve it (!). This changes the objects’ Scales to match the user-input size values - it isn’t expecting a point object and doesn’t apply a scale matrix to points.

Download the attached zip file, extract, and place the KDZ_SameSize folder into your 'Cinema 4D install folder'\plugins\Py4D\plugins folder.  Restart Cinema 4D.

Thanks,
Robert

#11

The plugin isn’t appearing on the Py4D->Plugins menu. It’s installed in the …\Py4D\plugins\ folder along with the original sample plugins, which do appear.

 R11.026, Win XP 32 bit.

EDIT: The console displays this error message. The issue appears to be the presence of the last 2 arguments in c4d.plugins.register_commanddata(). The plugin loads if I remove these but the dialog is empty. Interesting that this doesn’t seem to cause problems for everyone…


#12

I cant wait to try this out…as soon as I get my PY4D serials…
:slight_smile:

Cheers / Alex


#13

Ok, I’m back at work and just tried your script.
Click…Boom! all scaled equally and proportionately. :bowdown: So easy and time saving!

Thanks again! :slight_smile:

Cheers / Alex


#14

Thanks for the feedback, glad to hear that it did the job.

I can add a dialog so that settings can be changed without editing the script but I’ll wait to see Robert’s plugin before deciding whether this is worthwhile. It sounds like the plugin does the same as the script and more.


#15

Make sure that you have the latest version of Py4D (v0.9.5555). Also, a couple of tabs escaped the last edit, so a tabs to spaces on the samesize.pyp might help. I’ve already corrected it since - let me see if I can change the attachment in my previous message.

ETA: Okay, that worked. The attachment is the latest with no tabs. Python and tabs - sheesh. :slight_smile:

Robert


#16

Sorry, my mistake, I was running the previous Py4D version. I’ve been waiting for a solid block of time before diving in and so haven’t been checking the blog.

The plugin works perfectly and the Proportional option is nice added touch. A useful addition would be an option for resizing without altering the object’s Scale values. I like to leave these alone unless animating the size of an object.


#17

Yep, but then it gets complicated. :slight_smile:

There are three options for this: scale, scale points (multiplying by a matrix), set parameters.

For everything, scale works.
For point objects (SplineObject, PointObject, or PolygonObject), scale and scale points works.
For primitives, scale and set parameters works.

So, the ‘easy’ way (albeit less acceptable) is to set the scale. It covers every object. The best way would be to divide object types into ‘point objects’ and ‘primitives’ and do scale points or set parameters respectively. But then there are like a hundred primitives to consider, many with different parameters. One can get a PolygonObject or LineObject representation of just about any object but still the ‘result’ has to effect the existing object. Can’t scale the ‘points’ of a Cube primitive. You either set the scale or set the parameters.

Maybe I’ll look into the best way after I’ve settled from my move.

Robert


#18

Yes, setting parameters for all of the various parametric objects would be certainly be cumbersome. Of course, the desired behaviour is currently available for individual parametric objects via the Coordinate Manager with the Model Tool active. It’s a shame that this can’t be done for multiple selected parametric objects.


#19

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.