Jump to content

Blender CTL A oddity


Pamela Galli
 Share

You are about to reply to a thread that has been inactive for 4362 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

I joined 5 pillows and before exporting, did CTL A to set location and rotation.  I noticed the pillow shading turned darker.  When I textured them inworld, I noticed that they remained significantly darker next to the ones I had imported individually earlier:

 

Screen shot 2012-05-26 at 12.59.30 AM.png

 

So I went back into Blender and undid the CTL A and reexported and they look fine now.

What is going on with CTL A?  Does it always affect the shading in this way?  I have tried to get into the habit of doing CTL A but now I am wondering what effects it is having.  Anyone? (<cough>Drongle<cough>)

Link to comment
Share on other sites

Applying scale changes the shape of the mesh if the scaling is not uniform (i.e. the same factor along each axis). This will also change the orientation of the vertex normals, because they are supposed to be perpendicular to the unscaled mesh surface. The vertex normals determine how a face gets shaded in response to light sources. This is why applying non-uniform scale has a visible effect on smoothly shaded meshes.

I guess you applied scale to the joined pillows but not to the unjoined ones you imported earlier. Applying scale did not make the pillows darker; it just made them reflect light correctly. The reflection angle on the scaled ones is physically wrong because the vertex normals are stretched non-uniformly and no longer perpendicular to the surface.

Here's an example to illustrate the effect:

Start with an empty scene in Blender. Add two mesh cubes and change their shading from flat to smooth. Now switch one cube into edit mode and scale it by factor 100 along the Z-axis. Then switch back to object mode and scale it by factor 0.01 along the Z-axis. This will bring the cube back to the original size, but you'll notice that its shading is now very different from the other cube that was not touched. The scaled one will look flat and either be much brighter or much darker than the other one, depending on the viewing angle. Only after you apply scale, the second cube will return to normal.

  • Like 2
Link to comment
Share on other sites

Thank you, I thought it had to be some kind of normals thing.  In this case, the CTL A pillows look darker on the side that should be getting the (SL default midday) light, and on the back side is bright, as if the light is coming from below.

 

So as usual, I don't get it.

Link to comment
Share on other sites

This appears to be a Blender bug. The following was done wityh 2.63 (sorry, haven't downloaded 2.63a yet).

The top row in the picture shows three copies (ShftD) of the same, smooth-shaded,  UV-mapped mesh object, all subjected to 90 degree rotation about the z axis. The left one was rotated by selecting all vertices in edit mode and Rz90. The middle one was rotated in object mode (Rz90), then the rotation was applied with CtrlA (rotation & scale). The third was the same as the middle, but was then toggled to edit mode and back into object mode. The three were exported as shown into one collada file, and imported into Aditi.

The two lower rows in the picture show the imported objects viewed from both sides. Using Develop->Render Metadata->Normals confirms that the normals of the middle object are aberrant, as is evident from the anomalous shading in both SL and Blender. It appears that, in this case at least, using CtrlA has caused incorrect calculation of normals which leads to aberrant shading. The incorrect normals are exported into the Collada file. Toggling edit mode causes a correction of the normals, providing a simple work-around.

Note that the normals are not corrupted when CtrlA is applied to the untransformed object. Neither are they corrupted simply by rotating in object mode without applying CtrlA. I have not investigated whether the corruption occurs with other transformations or with alternative options chosen after CtrlA.

tyrx.jpg

ETA - this corruption of normals does not happen in Blender 2.49b in the same sequence of manipulations.

  • Like 2
Link to comment
Share on other sites


Drongle McMahon wrote:

The following was done wityh 2.63 (sorry, haven't downloaded 2.63a yet).

I guess that explains it. I'm running 2.63.7 here and can't reproduce the problem at all.

Note to self: Make sure Pamela is up to date before investigating any of her reports... :P

Link to comment
Share on other sites

Thanks for illustrating that issue and showing the workaround, Drongle. I've never seen it before. I suppose it is because I avoid working at the Object level like the plague. But, this does explain an issue with a file someone sent me recently. I'm glad to see that it can be easily fixed.

 

And, thanks for noticing it and pointing it out, Pam.

Link to comment
Share on other sites


Pamela Galli wrote:

Oh I did not know I was supposed to avoid doing things at object level! That's pretty important to know.

That's not what Drongle was saying. You can work at the object level just fine; you just have to remember to apply object-level modifications to the mesh before exporting. But you already knew that. You don't have to change your way of working at all.

Link to comment
Share on other sites


Masami Kuramoto wrote:

Instead of working around a bug that has been fixed already, you could as well just update Blender and forget about it. This way you'd also get the latest fixes and improvements to the COLLADA exporter.


Actually, I do work with the latest builds of Blender. I'm not working around a bug. As I already stated, I didn't know that bug existed until this thread. I prefer to work at the Edit mode level and avoid the extra step of applying rotations and scaling operations. Over the years, it has become a workflow choice that has kept me from having issues because of forgetting the application step.

Link to comment
Share on other sites


Ashasekayi Ra wrote:


Masami Kuramoto wrote:

Instead of working around a bug that has been fixed already, you could as well just update Blender and forget about it. This way you'd also get the latest fixes and improvements to the COLLADA exporter.


Actually, I do work with the latest builds of Blender. I'm not working around a bug. As I already stated, I didn't know that bug existed until this thread. I prefer to work at the Edit mode level and avoid the extra step of applying rotations and scaling operations. Over the years, it has become a workflow choice that has kept me from having issues because of forgetting the application step.

Ah a light is dawning. I did not realize that CTL A was to apply these when done in Obj mode.  I just throught it was some random thing I was supposed to do for some reason.

 

Link to comment
Share on other sites

Object properties are like a lens that is used to look at the mesh. When you change object properties, you are not changing the mesh itself. You only change the lens to make the mesh appear bigger or smaller, squeezed, stretched or otherwise manipulated. Ctrl-A applies one or more of these effects to the mesh itself and then resets the corresponding lens property to default. Alt-G, Alt-R and Alt-S on the other hand reset lens properties without applying their effects to the mesh.

Modifiers (such as Mirror, Subdivision, Decimate, Shrinkwrap, Armature etc.) are extensions to that concept. They also do not modify the mesh itself but make it appear different, until you either apply or delete them. Modifiers are extended object properties, which explains why you have to be in object mode to apply them to the mesh.

What's cool about this concept is that you can make several linked copies of a mesh, attach different modifiers to them, and then watch all the copies change in realtime while you sculpt the first one.

  • Like 1
Link to comment
Share on other sites


Pamela Galli wrote:

Ah a light is dawning. I did not realize that CTL A was to apply these when done in Obj mode.  I just throught it was some random thing I was supposed to do for some reason.

 

Yessah... Masami just gave a great explanation of it. But yes, CTRL+A  applies transformations that you make at the Object level. There are operations in Blender that need you to be at the Object level to work. I haven't run into many of them while modeling assets thought.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 4362 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...