You are currently in the Forum Archive. All content within this area is Read-Only and cannot be modified. Active Forums can be found here.
Reply
Honored Resident
Jason Keegan
Posts: 12

Blender - Possible to change rotational axis?

Hi all,

I have made a door sculpty in Blender. When I add my door script it obviously rotates across its center point. opening the door from the dead center of the sculpted door.

What I was wondering is, Can I or more so how do I make the door's center point to the spine of the door? Im thinking I need to somehow if possible increas the width of the bounding box to double the width of the door.

Can this be done in blender?

Thanks for your help!

- Jason

Rolig Loon
Posts: 24,528
Registered: ‎10-05-2009

Re: Blender - Possible to change rotational axis?

Reply to Jason Keegan - view message

When I add my door script it obviously rotates across its center point.  opening the door from the dead center of the sculpted door.

It only obviously rotates across its center point because that's the type of door script you are using. I prefer doors that use that simple approach myself, but it's not the only way to do it. An alternative obvious solution is to find yourself a door script that rotates from a side hinge.  That will also let you avoid potential collision problems from messing with the bounding box.

Not as dumb as I look
Honored Resident
Jason Keegan
Posts: 12

Re: Blender - Possible to change rotational axis?

Reply to Jason Keegan - view message

Thank you for answering although it don't help me with my problem. I have to use that type of script so the door can be linked to a building.

Not saying its the only way to do it just the only one I know how with the door being linked.

- Jason

Honored Resident
Jason Keegan
Posts: 12

Re: Blender - Possible to change rotational axis?

Reply to Jason Keegan - view message

This is exactly what I was after, Thank you VERY much!

- Jason

Gaia Clary
Posts: 1,605
Registered: ‎06-30-2009

Re: Blender - Possible to change rotational axis?

Reply to Jason Keegan - view message

What you describe sounds like you want to do this:

  • go to Object mode
  • Place the 3D cursor exactly on the anticipated rotation axis of the door.
  • Object -> Transform -> Center Cursor

Now the object center lies besides the object (the object center is marked as a small pink dot).

  • Render -> Bake (and check "keep center")

Now your Bounding Box will be enlarged such that your door lies only on one side of the entire box. The Object center becomes the geometric Center of the bounding box. And now your door script will rotate the obect exactly along the side axis.

the mesh weaver
Gaia Clary
Posts: 1,605
Registered: ‎06-30-2009

Re: Blender - Possible to change rotational axis?

Reply to Jason Keegan - view message

As far as i understand it, the OP has asked for a sculptie door, not a mesh door ...

the mesh weaver
Drongle McMahon
Posts: 2,765
Topics: 38
Solutions: 18
Registered: ‎02-25-2009

Re: Blender - Possible to change rotational axis?

Reply to Jason Keegan - view message

Ah yes. You are right. My mistake. I guess I am too obsessed with meshes to read straight . Sorry. Of course you are exactly right for sculpties.

Unless otherwise stated, any viewer-related information refers to the official LL viewer.
Drongle McMahon
Posts: 2,765
Topics: 38
Solutions: 18
Registered: ‎02-25-2009

Re: Blender - Possible to change rotational axis?

Reply to Jason Keegan - view message

Ignore this. It applies only to meshes. I leave it in case anyone is interested in mesh doors, and so the following posts are clear (and to show how stupid I can be).

Unfortunately, unless they have changed it already (https://jira.secondlife.com/browse/CTS-297)  that will not work. This is because the uploader does not retain the origin of the geometry in the Collada file. Instead, it adjusts the vertex positions so that the origin is at the centre of the bounding box. This is done to maximise the accuracy available in the 16-bit integers used to up/download the vertex position data. Thus you have to make the meshes with invisible extensions so that the bounding box has its centre at the hinge. Fortunately, provided you use solid decomposition fort the physics shape, the extra 2D flap that moves the centre for the physics shape will dispapear so that there is no physical obstruction. This is explained in more detail in a file accompanying the example doors made that way (http://wiki.secondlife.com/wiki/Mesh/Sample_Content). Given the popularity of that jira, it is quite likely this will be changed. In that case, the hack described will not be required.

Unless otherwise stated, any viewer-related information refers to the official LL viewer.
Honored Resident
Jason Keegan
Posts: 12

Re: Blender - Possible to change rotational axis?

Reply to Jason Keegan - view message

Ok,

I used the above method which was exactly what I asked for (Thanks for that), but due to the collisions I chose for another option.

I wrote a door script which will open and close on is spine with just a regular door, no need to cut it or have an oversized bounding box.

NOTE: This script will also work for sliding doors

To get the needed calculations I also wrote this script to give someone the idea of what we are after:

This is a basic door and I will happy to help people set this up if needed, Just contact me in world.

Instructions Script: (Place this in your door first)

default
{
    state_entry()
    {
        llOwnerSay("\n\n_________ Instructions for door set up _________");
        llSleep(2);
       
        llOwnerSay("\n1. If you wish to have the door linked. Please make sure it is not the root prim.");
        llSleep(1);
        llOwnerSay("\n2. Set the door in to the position you wish it to be when closed.");
        llSleep(1);
       
        llOwnerSay("\n3. Click the door to get the first reading.");
        llSleep(1);
       
        llOwnerSay("\n4. Now, Using Edit linked in the edit options adjust the doors position to where you want it when it is open.");
        llSleep(1);
       
        llOwnerSay("\n5. Click the door to get the second reading.");
        llSleep(1);
       
        llOwnerSay("\n6. Copy and paste your readings in to the correct locations in to your door script.");
        llSleep(1);
       
        llOwnerSay("\n7. You are now done with this script and can delete it and add the door script to your door.");
    }

    touch_start(integer total_number)
    {
        llOwnerSay("\nPoition: "+(string) llGetLocalPos()+" | Rotation: "+(string) llGetLocalRot());
    }
    on_rez(integer start_param)
    {
        llResetScript();
    }
}

As the instructions say, You will need to copy the information this script gives you to your new door script.

The Door Script:


//This is a very basic door script written by Jason Keegan. //The door will rotate on its spine //No need to cut prims or over size the bounding box //This is position for the door when its closed vector gClosePos = <0.05238, 1.53876, 1.47184>; //This is the rotation for the door when its closed rotation gCloseRot = <0.00000, 0.00000, -0.70711, 0.70711>; //This is the position for the door when its open vector gOpenPos = <-1.01759, 2.59343, 1.47185>; //This is the rotation for the door when its opened rotation gOpenRot = <-0.00000, -0.00000, -0.00000, 1.00000>; //How long the door stays open for float gTime2StayOpen = 30; //____________________Do Not Edit Below This Line__________________ integer gOpenSwitch = FALSE; fOpenDoor() {     llSetPrimitiveParams();     gOpenSwitch = TRUE;     llSetTimerEvent(gTime2StayOpen); } fCloseDoor() {     llSetTimerEvent(0.0);     llSetPrimitiveParams();     gOpenSwitch = FALSE; } default {     touch_start(integer num_detected)     {         if(gOpenSwitch == FALSE)         {             fOpenDoor();         }         else         {             fCloseDoor();         }     }                 timer()     {         fCloseDoor();               }         on_rez(integer start_param)     {         llResetScript();     } }        

As previously stated, This is a very basic door but I will be happy to help people with this. Just contact me in world.

- Jason Keegan