Shrinking mesh

Blitz3D Forums/Blitz3D Beginners Area/Shrinking mesh

Trek(Posted 2013) [#1]
When I use the Copymesh() command, the copy created is about 1/10 the original size. I'm making my model from Blender, and it contains multiple objects in it, so when I load the model I use loadanimentity. I'm using copymesh() instead of copyentity() because I want to manipulate the copy without changing the original. The code basically looks like this...although it is from memory...

large_combined_model = createmesh()

original_model = loadanimmesh(mesh)
hideentity original_model

temp_model = copymesh(findchild(original_model, "part1"))
addmesh(temp_model, large_combined_model)
freeentity temp_model

I think it might have something to do with how I modeled it in Blender, but it might be something in coding as well, so I thought I'd ask.

(an example of the difference in blender modeling is that you will get different values from meshwidth() whether you scale your mesh in "Object mode" or in "Edit mode")


Yasha(Posted 2013) [#2]
What's most likely happening here is that the scale is being inherited from a parent somewhere higher up the animation hierarchy. Since CopyMesh doesn't copy any entity properties, only mesh data, the new copy won't inherit the entity-level scale effect caused by a scaled parent (or by a keyframe, if you were to do this during an animation).

If at all possible the "cleanest" way to do this is likely going to be to try to export from Blender with all submeshes using an entity-level scale of 1, only using actual scaling of the mesh data to make your original model the right shape and size (I don't know what that would be in Blender parlance). Otherwise you'll have a messy time extracting components later as they rely on data no longer in their hierarchy chain.


Yan(Posted 2013) [#3]
(an example of the difference in blender modeling is that you will get different values from meshwidth() whether you scale your mesh in "Object mode" or in "Edit mode")
When you scale in object mode, you're adding a transformation to the object's mesh data. When you scale in edit mode, however, you're 'editing' the mesh data directly.

You can see the difference if you look at 'Transforms->Scale' in the properties panel on the right (by default). Press 'N' to bring this up, if you haven't already.

In comparison with Max2D, scaling in object mode is like using SetScale() on an image; the image's pixmap isn't directly affected. Scaling a mesh in edit mode, on the other hand, is akin to scaling the image's pixmap.
[edit]
LOL...I've just realised this is in the B3D section...I'm so used to people using Max/MiniB3D, I didn't twig...:o/
[/edit]


...I don't know what that would be in Blender parlance...
That'd be 'Apply Scale'. Yes, it's really that simple ;o) ...

Object->Apply->Scale...or...CTRL+A -> Scale

The exporter may allow you to do this directly (check the export panel on the left). I haven't exported anything from Blender in an age, so can't remember.


Forgetting to apply transforms trips *everyone* up at some point. ;o)


Trek(Posted 2013) [#4]
You two are absolutely correct, it's in the scaling. I fixed it in a round about way, though. I made a temp mesh, joined all the parts to it so they adopted it's default scaling, separated the parts again and deleted the temp mesh. Everything scaled correctly after that. Thanks Yasha, and thanks Yan for the hot buttons for Blender.