SceneComposer Spatial "Scale to..." Tool

I have created a new tool in the SceneComposer: “Scale To…”. There you can enter the target size and
its calculating and setting the local scale appropriately.

Nothing fancy… Should I commit it?

3 Likes

Like scale to - percent? Sounds cool. I am not really into the whole input thing but @nehon added stuff like pressing x and y etc. to define along which axis the tool works, maybe when adding numbers this can just jump in somehow?

Currently you just right-click on any spatial and select “Scale to…”. Then you get a dialog that shows the current
x,y,z size values and you can enter a target x-, y- or z- value and press ok. Then the local scale is calculated and
set to the spatial.

I implemented it because I wanted to have a fast solution to guarantee that all my character models are e.g. 1.85m
and did not want to edit it in blender, reimport, split animation, materials, … just to get this working.

Integrating it into any existing tool should be no real problem - just let me know how you would like to have it and
I change it before comitting.

Just wanted to ask you guys before committing anything new into the core…

The SDK already has this implemented. A while ago we added in a blender-esque tool. So you just select the object, hit ‘S’, and then type in the scale value you want, and then hit ‘Enter’.

Really? I just pressed th 'S" key and then I can scale the object with the mouse - not really what I want.
And I do not see the size anywhere.

Yes I can enter the scale maually, but this is not really what I need?!

@Sploreg said: hit 'S', and then type in the scale value you want, and then hit 'Enter'.

Scale is not size. If you have a box it would work, but if the box is rotated or some strange shape then entering in “105wu” on the X axis can be a little ambiguous.

@Sploreg said: Scale is not size. If you have a box it would work, but if the box is rotated or some strange shape then entering in "105wu" on the X axis can be a little ambiguous.

Really do not understand what you mean. Maybe an example helps:

  • I have a model with a size of 5/10/5 (BoundingBox)
  • I enter 2 as a target y size
  • The scale of 0.2/0.2/0.2 gets calculated and applied (because I want to keep the proportions)

I see, so you want some proportional local scaling.
The tool would have to be integrated with the existing scale, grab (translate) and rotate tools, using the same key system so everything can stay consistent.
Look at SelectTool.java in the SceneComposer module. This is the main tool we are working towards. (ScaleTool, MoveTool, and RotateTool are the old tools that we might phase out).
If you can integrate it into that I can add it into core.

1 Like

Yes I can;) Should I introduce a new ScaleToTool with a serperate button or do you have a different preference?

No button needed, we want to stick with keyboard controls and maybe eventually have a menu that lists all of these operations. SelectTool.java has the current 3 tools in it, so I guess this one can just go in there. Afterwards I can refactor that class to make it a little more pluggable.

Ok - I will do it in the next few days…