Page 1 of 1

Bench

PostPosted: Fri Jul 25, 2008 10:32 am
by Jonnee
Hiho! It's me again. :D

The today's problem: I have created a bench and did it the way as the tutorial explained it.
The avatar starts to sit down - but it doesn't keep sitting. My player walks through the wall across from the bench. Finally the avatar sits down at a point that is identic with the coords 0/0/0 of the blender file, somewhere in the air. It happens too if I want to make a simple cube sitable.
Anyone knows that phenomenon?

a pic of the bench in blender:
Image

The axes are set as explained.

Re: Bench

PostPosted: Fri Jul 25, 2008 12:10 pm
by Marcello
I had the same thing going on. I repositioned the object center and made sure the Y axis in edit mode was positioned as the tutorial says.

Re: Bench

PostPosted: Fri Jul 25, 2008 12:50 pm
by Jonnee
Ok, reading the tutorial twice (or more) helped a bit:
I did not mark the bench as an anctor. I did so in the logic panel, and... Now the avatar sits down where it should do.
But... What is this??? The size of the bench shrinked dramatically. It is not displayed as large as I've created it in blender. *lol*
Who can tell me what I did wrong?

Image

Re: Bench

PostPosted: Fri Jul 25, 2008 12:56 pm
by Jojon
It should do that automagically, from what I hear, but still; try applying object mode transformations. This will screw up your neatly arranged rotation of the bench, so you'll have to rotate it back. :P

Re: Bench

PostPosted: Fri Jul 25, 2008 10:19 pm
by Jonnee
Interesting.
I clicked in blender Object, Clear/Apply, Apply Scale Rotation. Now it works fine. Nice!
Thanks Jojon for the clue! :)
Now I remember that Clear/Apply from the past in another context. But don't know it extact.
May anybody explain it for me and the other writers please? Could be important for further applyings.

Re: Bench

PostPosted: Sat Jul 26, 2008 1:30 am
by D'Lanor
PyPRP is just a like a Microsoft program. :D It makes assumptions about what is best for the user. Based on the object type it will use some of the settings in Blender and ignore others. It has to do that in order to avoid excessive export errors, but this makes the whole process rather obscure.

As a rule I always apply scaling to avoid problems. Although I believe only clickables are affected by the scaling bug. It is a pity that Clear/Apply affects rotation too because some objects need rotation to function correctly. If there is a way to apply only scaling in Blender I have not found it yet.

Re: Bench

PostPosted: Sat Jul 26, 2008 2:44 am
by Jojon
It goes something like this:

If an object is, say a box, that is just supposed to to sit there, wherever you placed it, pyPRP applies object translation and transformations at time of export, fitting its geometry into world coordinates.

If the object needs to bounce around, however, or as in cases like this and with ladders; simply know which directions are up and back, we need to keep the object's coordinate system (so that it can be used for moving the object around, through animation or physics and read by the engine, to seat you in the right direction) -- we tell pyPRP to do this by ticking the "Actor" button. In this case transformations are NOT applied automatically when exporting - doing so would result in loss of needed information, which is exactly what happened to you first, when you didn't know about the "actor" button. Now, with the included coodinate interface, Plasma will fit the object into place, in the world.


Now, from what I understand (having half-read some animation-related discussions), Plasma SHOULD not only translate and rotate, but also scale coordinate interface-owning objects, according to their transformation matrices, but apparently there is some sort of issue with scale filtering down through object child levels, so in your case, do you perhaps have the bench object as child to another object, which is the one that has received your scaling? This is something I myself like to do, so it doesn't seem unlikely to me that others too collect related stuff under a parent, whether "real" object or an empty.

One might for example have something like:

Code: Select all
Bench (The actual object)
  |
  +-Clicking "button" for seating to the left of the bench
  |
  +-Same for centre
  |
  +-Same for right end
  |
  +-Click region


Here, if I'm not misunderstanding completely, if I scale the bench, I will see the children (buttons and region) scale accordingly in Blender, but in the exported .prp, they MAY not have inherited that particular transformation from the Bench object - only have their own. Note that I'm guessing here - I do know from testing, that hierarchical animation works with translation and rotation, at least - I just heard that with scale, inheritance can go screwy.


Hope I'm not just spreading falsehoods here.. :P

Re: Bench

PostPosted: Sat Jul 26, 2008 5:15 am
by Jonnee
Thanks for your explanations. Now I'm a bit more wise. :D