Jump to content

rescaleFactor and the MODEL node


kaldak

Recommended Posts

So I'm trying to alter some config files. One of the things I'd like to be able to do is resize a part. It's simple enough if the part uses "mesh=..." to define the model, but rescaleFactor doesn't seem to work correctly when the new model definition format is used

MODEL{
model=...
scale=1,1,1
}
rescaleFactor=2
scale=1

Specifically, the model scales correctly, but the nodes don't scale with it. I have tried different combinations of changing those "scale" variables, but the nodes continue to be an issue. I've searching for solutions and come across other people having this problem, but most of the discussions are a few versions out of date and don't seem to do the trick. I'm not sure if it's still a bug, or I'm just missing something. Has anyone figured out how to make this work?


EDIT: Ugh... I could swear I had already tried this, but one of the previous solutions does indeed work. I guess I'll leave this post here in case anyone else is wondering about how it works in 0.22.

Credit goes to Greys

MODEL{
model=...
scale=X,X,X
}
rescaleFactor=Y
scale=Z

Set Y equal to the scale you want. Leave Z as 1. Set X equal to 1/Y.

On my first test part, it also seemed to work by setting X and Z to the scale you want, and leaving Y as 1... but on closer examination that may have been a fluke.

This doesn't make very much sense... but at least it works.

Edited by kaldak
Link to comment
Share on other sites

"scale = Z" outside of the MODEL{} node has NOTHING to do with the scale your model appears as. Its a config parameter that existed since the beginning and tells KSP what measurement scale the model is in (meters, centimeters, decimeters, or whatever)

This ONLY affects the positions of Stack nodes and FX offsets in relation to the origin of the part/model.

for instance if you have scale = 1, then KSP assumes your part is modeled in Meters, and a unit of 1 = 1 meter.

so a stacknode like this:

node_stack_top = 0.0, 1.0, 0.0, 0.0, 1.0, 0.0

Means that the node will be 1 meter above the origin point on the Y axis. If the scale = z was set to 0.01 then it would only be 1 centimeter from the origin.

To summarize:

scale = X (inside a MODEL{} node) and rescaleFactor = Y both affect the actual scale of the model via scalar transforms (and rescaleFactor will also scale your stack nodes and such to match, whereas a model{} node scale will not)

scale = Z outside of the MODEL{} node only affects the node 'scales' - it also has the side affect of changing the precision of your nodes, since KSP only respects stack node entries up to 3 significant digits after the decimal (at least in the old loader, and I assume this is unchanged)

This used to confuse me as well, but I had it explained to me by Chad/C7 quite a while ago, and I have used that config parameter quite a lot during my upkeep of Novapunch - Novasilisko used one scalar precision and Sundaypunch used another, so some parts were scale = 1 and others were 0.1, which meant I always had to multiply my node entries by 10 to make them work. And this was several updates before rescaleFactor was ever a thing.

I've had this discussion before, and I maintain that if you're seeing otherwise you have found a bug, and I would love to see proof of it.

----------------------------------------------------------------------------

Edit #1: The rest of your information is indeed correct - you can correctly use rescale factor by setting your MODEL{} node scale to 1/Y - this is a bug and is hopefully on the chopping block to get fixed. When it does get fixed you'll have to change your scales in the MODEL nodes again to undo the workaround of course.

-----------------------------------------------------------------------------

Edit #2: here's an illustration: http://i.imgur.com/Y8OGxJo.jpg

I cloned the stock fueltank, changed it scale from 0.1 to 1.0, and changed the name.

As you can see, they're the same size ingame, but their stack and attach nodes are 10x scale now, so the attach node went from 0.5m to 5m and the stack nodes ~0.7m up and down to 7meters.

--------------------------------------------------------------------------

Also, I thought of another important thing to remember when using model{} nodes.

The default rescaleFactor is NOT 1.0, it's 1.25. So if you do not define it in the config file (like in the example above) then if you use a model node you need to set the scale inside your model{} node to 1/1.25 or 0.8

This is a hold-over from the old KSP scale where parts were 1m and 2m instead of 1.25m and 2.5m. The stock fuel tank in the example is modeled as a 1m fuel tank, which is why the surface attach node is set to half a meter (equal to the radius) - since the default rescaleFactor is 1.25, the part is scaled to the 1.25m standard, and nodes are scaled too. so ingame those node_attach nodes are actually 0.62625m (0.501 X 1.25)

Long Story short: best practice is to model in the proper scale and use rescaleFactor = 1 when possible, and then use the 1/y workaround when needed for scaled parts.

Edited by Tiberion
Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...