Tuesday, November 13, 2012

The shape of things to come: it's a resolution thing


So you want to know what the heck all those resolution buttons are and do.  It depends on the prim shapes you use, first.

For this article, I'll use the box (or cube), cylinder, sphere and torus.


I linked these and added the Object2JoinedMesh script.

First I do Default resolution which is 4/24.


For each of these examples, I created a .dae and imported the .dae to Blender so you could more easily see the mesh and how it looks in 3D.


In Blender, you will see that the mesh is triangulated and this is the way it comes into Second Life.  However, it makes it very difficult to select loops (rows of faces, verts, edges), so we use the Alt-J command (all verts selected on the object(s) in edit mode, and this creates quads wherever possible.  It's just much easier to work with quads for many reasons.

So below is that these four prims look like in Blender (after quadded).

Time for a 3D term:  UV

While our objects are three-dimensional, XYZ, the UVs for meshes get laid out in a two-dimensional format and these are, in turn used as a template that guides us when we texture.  A UV map; a map of the coordinates of the 3D object in a flat 2D way.

When looking at a UV map, you will see rows going across and up/down.  Now mind you, the UVs can end up being rotated and such, but we basically refer to rows going across the UV space as "U" and going up and down vertically as "V"(as demonstrated by the yellow and grey bars on the the box in the image above).

At Default Resolution, 4/24

  • Boxes (known as cubes in some 3D programs) have 12 faces on a U row and 12 on the V rows.  There are four sides around and four sides up and around.  Each side of the cube shows 3 faces on each row U or V.
  • The Cylinder has 24 faces going around in U.  There are three going up in V, if the cap ends are visible, they also have 24 faces.
  • The Sphere has 24 faces going around in U, but only 12 going up in V.
  • The Torus has 24 faces going around in U  and going around in the other direction in V.


At Low Poly Resolution, 2/16
  • Boxes/cubes have 4 faces on U and on V.
  • Cylinders have 16 faces U and 3 on V (the 2 cap ends, if visible, only have 8 faces)
  • Spheres have 16 faces U and 8 V.
  • Torus prims end up with 16 faces U and V.


At Low LOD Resolution, 2/8
  • Boxes/cubes still have four faces on U/V.  This is the minimum number a box can have when all sides are left opaque to generate mesh.
  • Cylinders have 8 faces on U with only one row vertical on V and if the cap ends are visible, they have only four faces.
  • Spheres have 8 faces on U and 4 faces going vertically on V.
  • The torus has 8 faces on U/V.
So we've covered the main resolution buttons, now how about all those plus and minus functions for Straight and Circle.

Straight pertains to prims based on the box.  So box, prism, pyramid and tetrahedron.  Adding or subtracting straight will ignore prims based on circles.


In the following example, the prims were set up with Default.  I then press Straight+1 five times.  In default, if you recall, the U/V rows had 12 faces; 3 faces, in the row, on each side of the box.  I wanted to end up with 32 which meant I needed 5 more faces on each side (4x8=32).

Only the box was affected here; the rest of the prims are based on circles and ignored.
NOTE: Notice that the rows on the cylinder increased in V. This is because this is considered a straight side. It just didn't increase around the circle in U.

Here, below, I added Circle+1 eight times to get 32 faces on the mesh.  Again, notice on the cylinder that this time the increase occured on the U rows where they are defined by the circle.  The straight side remain untouched.  (Mind you, these examples was only for illustration; I wouldn't go above default settings myself.)


Now let's look at how subtracting from the circle changes these prims.  I wanted a pentagon, five sided cylinder, for a table in a lower LOD level mesh I was making.  Using Low Poly resolution makes the cylinder eight sided, so I applied Circle-1 three times to make it five and it worked as expected.  Different prims can have other effects.



So what uses do you have for these.  As mentioned, the most obvious is for lowering the triangle count on your LOD levels.  This is why even using just the Default, LowPoly, and LowLOD buttons will work for your high, medium and low LOD levels in the Uploader.  Now, armed with how the rest of the buttons work, you can experiment and get lower if you need to.

Always check your results in Blender, another 3D program or Aditi, the beta grid.

Knowledge is power.  More power to ya!

Happy Meshing!
~ele

Sunday, November 4, 2012

Points of Inspiration: Ashira Legien


CREATED BY ASHIRA LEGIEN

You may or may not have seen or heard of Ashira Legien.  I assure you, however, once you see her jewelry, you'll agree she's unforgettable.   A long time user of Sculpt Studio, she started right in to Mesh Studio and now uses her sculpts (through the SS 2MS dropbox) in her Mesh Studio creations with great flare and creativity.  Here is a short interview before we take a look at her jewelry, true gems of Second Life.

1.  How long have you been in Second Life?

  • Six years this December.


2.  Did you start out to be a merchant?

  • Yes .. my dream was to own my own private island.  It took me 6 months to learn to build and script and get a store going to where I could afford one.  I've owned Isle of Mists for over 5 years now.


3.  What kind of products do you make?

  • Jewelry mostly .. but also tree houses .. fun vehicles .. and a unique sculpted blanket that covers you like a real blanket and changes with each pose.


4.  Is your interest in jewerly based on what you do or would like to do in real life?

  • No.  I took the Master Jeweler class mostly because the owner said I wasn't a good enough builder to take it :-)   The beauty of SL is that you can make things here without expensive supplies or tools.  I couldn't afford the materials to make jewelry like this in RL.


5.  How did you first get started with Sculpt Studio and Mesh Studio?

  • I got Sculpt Studio when it first came out v1.0 (boy you don't know how good you guys have it with v6.1 lol)  I let TheBlack Box use pictures of some of my creations as examples to get Sculpt Studio going.  Mesh Studio was just a natural extension.


6.  How much of your work is done with one or both of these tools?

  • ALL of the sculpted and mesh items I create are made with Sculpt Studio and Mesh Studio.


7.  What pieces would you say have been your most favorite that you made with Mesh Studio?  Are they for sale and where can they be found?

  • My current favorite is the Phoenix Necklace set.  It took me about two weeks and 700 sculpted pieces to make the mesh necklace and earrings.  






8.  What would you like people to know about your work with Mesh Studio?

  • Mesh Studio allows me to create jewelry with highly detailed sculpted prims and condense them down to a few mesh pieces with less land impact and more detail than the same pieces made with just sculpts.  Mesh objects are also easier to script for color change and rez faster than sculpted prims.


9.  Where would you like to see Mesh Studio go in terms of what you would like it to do?

  • For jewelry Mesh Studio seems to work fine just the way it is.



Ashira has been making beautiful things in Second Life for some years now.  She was an early adopter of Sculpt Studio and is now working with Mesh Studio as well to make her wonderful jewerly and other creations.

Ashira uses sculpts she has made in Sculpt Studio and then transforms them with the SS 2 MS dropbox so that she can use them with Mesh Studio.

These are some of her marvelous creations:





You can see them in her online Marketplace store, https://marketplace.secondlife.com/stores/7297 and inworld, http://slurl.com/secondlife/Isle%20of%20Mists/84/123/45.

Hope you find's Ashira's work as inspirational as I do.

Happy Meshing!
~ele

Monday, October 29, 2012

Rethink your Sculpts for Mesh


First, let's go over the procedure for using sculpts you have made in Sculpt Studio.  For those of you not familiar with Sculpt Studio, this is Mesh Studio's inworld sculpting sister product.  Follow this link for more information.

In the latest Sculpt Studio version (set a new mat out if you haven't lately, this is how you update), is the "SS 2 MS - Dropbox".

In order to use a sculpt from Sculpt Studio, a copy of it must be on the server.  This means you must have just made the sculpt.  If you want to use a sculpt that is no longer on the server, you will need the notecard data for that sculpt and place it's -SCULPT card in the mat, rerez it and use the Sculpt Frame to generate a new sculpt.  This places it on the server again.  Sculpts are only on the server for approximately 24 hours after being generated.


  1. Before you generate the sculpt through the Sculpt Frame, name the sculpt with the name button and then use the Sculptie! button to make the sculpt.  If this is a new sculpt, download the ZIP from your server page (this contains all files for your sculpt) and upload one of the sculpt tga maps.  If this is a regeneration to use a sculpt you made before that is no longer on the server, you don't need to download anything if the sculpt map is already inworld.  
  2. KEY INFO: It is critical that the name of the sculpt on the server be the same name you use on the sculpt map; the names MUST match.  The names will be used by the drop box to match up.
  3. Rez your SS 2 MS - Dropbox.
  4. Make sure your sculpt map is full perm in your Inventory.
  5. Ctrl drag a copy of the sculpt map, from your Inventory, to the contents of the dropbox (alternately, open the dropbox in edit and place a copy directly in the contents).
  6. The map has been used to register and "mesh-ize"it.  This means the original in your Inventory is registered.  Mesh Studio will now recognize it.  Any sculpt you make from it, by putting the sculpt map on a Sculpt Type prim, can be used alone or along with prims in a linkset to genereate mesh with your Mesh Studio.

Recommendation: In the description field of your sculpt map, add Mesh Studio, so that you know this is a sculpt that can be used for mesh generation in Mesh Studio.  A folder for these "mesh'ized" items is not a bad idea either.  Do this to any sculpt made with this map so that you know it can be used with Mesh Studio.


SOME THINGS TO KNOW ABOUT MESH-IZED SCULPTS

  • Mesh Studio always loads sculpts at their highest LoD (comparable to resolution 4/24 in Mesh Studio) regardless of what settings you use on the Mesh Studio menu. This is because the Mesh Studio script can only affect prims and not sculpts.
  • Poles, in these mesh-ized sculpts, will merge to a single point (also known as verts or vertices).  BTW, textures on these triangular ends (produced by the poles) will texture fine and not have the same radiating texture problems we have with sculpts.
  • Wherever points are in the exact same position (example, double points, slices copied to the same position), these points merge into one single point.
  • We do not have to reinforce points in mesh to strengthen LoD.

What was that last point?  We don't have to reinforce for mesh?

If you've been reading my articles, you have seen that we control LoD in mesh by either letting SL generate the lower LoD meshes, or better yet, we create them for exact control of the shape that each level degrades to as you cam away.

So what does this mean for sculpts?

You can:

  • use as much or as little of the sculpt mesh as you want for your shapes.
  • use separations in a sculpt.   If you will only be working inworld, separations between parts in the sculpt are done with poles as usual, but you only need one per separation; not two as in sculpts.  (ex. Table with legs: each closing end of the table top, each closing end, top and bottom of each leg all require only one pole for use in mesh.)  The poles will merge and give you clean separations on your mesh (one pole per each end on a separation).  If you use a 3D program such as Blender, you can remove the merged poles if you want to do anything different.
  • use Cylinder stitch if you want the ends of your sculpt open.  As noted above, you will need poles to make physical separations so cannot have more than two open ends.

Here is an example of two sculpts done similarly (because I made a slight error on one and joined slices in the center that I didn't intend).  In figure 1, you can see the slices as they were setup for the second example I made.  The first example had slices evenly distributed and only the poles and slices were copy/pasted together producing the separations.  You can see the result, where I imported the dae into Blender, in figure 3.  You can also see that the openings made by using Cylinder stitch produced no mesh in the Blender examples.  There is a separation where there was a pole on each separating end and where there was one pole on top of a slice, and no pole on the next section (very bottom of object), the pole simply merged and closed the bottom and continues on to the next slice in a taper.


fig. 1

fig. 2

fig. 3

fig.4
In figure 2, you can see more clearly what the SS 2 MS dropbox (found in your Sculpt Studio accessories box) looks like.  You can also see each of the two sculpts I made.  If you look carefully, you can see the sculpt on the right has a slightly different look to the texture because of all the slices copy pasted on top of each other.  So in figure 4, that second sculpt is shown and there are 226 verts on the mesh because so many slices were pasted on top of each other.  All the points on top of each other merged into one.  The result is a less dense mesh with far fewer triangles.

One thing you can do if you are closing at least one end of a sculpt, for MS, is to, say, use a 128 slice stack because you wanted 8 points in each row.  You make your sculpt with the minimum of slices and then take all remaining, make them poles and put them in the same position as your last slice.  Remember all poles merge, so all poles on top of each other will merge, too.  Then you have a low poly sculpt that will be low poly mesh.

If you wanted the two ends of your sculpt open, you can collapse (copy/paste) the slices together one each end with no poles, set to cylinder stitch on the frame, and it will leave the ends open and MS will use that to indicate that no mesh should be created on the ends.

There is much more to explore, but this should give you some things to think about and play with.

Happy Meshing!
~ele

Thursday, October 25, 2012

Thinking Outside of the Box: Let's get Physical


So many people have been begging for information on Physics that I'm posting the text first and will add graphics to illustrate the examples and such as I am able.

The outside of the lowly prim Box can be your best friend when it comes to physics meshes.  Min Barzane and I spent a good bit of time, a while ago, talking about and figuring out things about physics.  The conclusion we came to is you should:
  • simplify the physics shape as much as you can
  • concern yourself primarily with the actual collision surfaces: walkable surfaces, wall surfaces you don't pass through
  • use boxes, where only one face is visible, to create your physics meshes when needed.  This, in essence, creates a plane and a single plane generates two tris.  We will refer to boxes with only one face as a plane from here on in.
  • remember that you do not have to have perfectly aligned pieces when making your physics shape.  You always want to test your shapes (try Aditi where the Lindens give you money that can be used in this test grid and not come out of your own pocket) to make sure you can walk well on and not walk through any gaps.
Creating a plane with which to work.
  1. Create a box prim.
  2. Go into Edit on it and set the box's transparency to 100%.
  3. If you have trouble locating your faces, use Ctrl-Alt-T which will show all transparencies in red.
  4. To give you a more workable plane, select one of the side faces of the box to make opaque by zeroing the transparency.
  5. Depending on which side you chose, you will be able to taper the plane on X or Y.  You can also shear on X or Y.  This gives you more flexibility for fitting areas as you make your physics shape.





Whether you are making a house, a staircase, a doorway, or a chair, it is the actual surfaces that require collision that matter.  Let's look at some examples:

A wall with windows and a doorway.  Unless you intend to have people walk through your windows, you can treat them as part of the wall (meaning they don't need a hole in the physics mesh).  Use common sense.  If the walls aren't very thick, you may only need to collide with the inner wall.  If you do need to collide with both sides of the walls, only do surfaces for the walls and not the sides of the prims making up the walls.

You want to walk through a doorway, so you devise your "planes" to allow the entry way.  If the doorway is on a wall, make the prims 100% transparent and use Ctrl-Alt-R to see the transparent areas in red.  Use "Select Face, on the SL Edit window, and select the wall surfaces and set the transparency to 0% to make those wall surfaces opaque.  On the door way, you want the wall surfaces, but don't need to make the inner surfaces of the doorway opaque; the walls provide the perimeter of the area you walk through.

If you are creating a pre-hung door for sale (consists of 5 parts: the two side uprights known as the jambs, the top piece called the jamb header, the bottom threshold piece and the door), you can do the same, and make all the edge pieces 100% transparent.  Just the door?  The same holds true.  Check out the blog post on doing pivots for your doors.

Floors.  The box will be used for square floors.  The sides and bottom of the boxes are not walked on and are thus made 100% transparent.  With round floors you have to take care as you want to use the full cylinder.  Minimizing the sides on a cylinder could result in pockets where someone could fall through, so you really want to experiment and see if you can get away with any minimization.  How do you minimize?  The settings on the Mesh Studio Menu.  A setting of Low Poly on a cylinder creates 8 edges.  You can use that as a starting point and then use Circle + 1 or Circle -1 to add or lower the number of edges on your cylinder's circle till you have a walkable floor for your particular "floor plan".

A round balcony.  The inner part of the balcony needs to keep the user from going through it, but it does not need to be completely round to be effective.  Use your planes to define the arc of the balcony railing with as few box planes as possible.

Railings.  A railing is a good example of how much or how little of the mesh needs to be involved in the physics shape.  The collision surface is merely to keep the user from falling off the side of the steps where your railing is positioned.  Any single surface side will provide this, whether it is the top of the hand rail, its side, or the side made up by the balusters (again, treat it as if you're shoddily covering them up with planks since the physics mesh does not need to be perfect).

A roof on a house.  If you think your users will walk on your roof or fly through it, then by all means choose the inner or outer surface of your roof to supply collision.  If the roof extends past the boundary of the house, it is not necessary to match the dimensions.

Staircases.  Steps can be handled with one long or several short ramp planes depending on the direction and formation of the steps (like a spiral staircase).  

Chairs, benches and other seats.  The only important collision surface on a chair may be where the avatar actually sits.  First, this may be enough to define the area of the chair itself and second, it may be an effective way to handle the avvie being able to sit on the chair without the assistance of an animation.

These are just some examples to get you thinking.  So what else do you need to know?  When the physics shape is ultra simple you can sometimes get away with having to do little else than loading your LoD daes in the Level of Detail tab and the Physics dae file in the Physics tab of the SL Mesh Uploader window.

Aditi, aditi, aditi.  Experiment your heart out on on the Linden's dime.  Make sure your physics work right and THEN take it live to Agni (the main grid we're all on).

Until any of the  TPVs (Third Party Viewers) get the full Havoc license, only the LL Viewer has it, so you should definitely use it to upload any mesh particularly with physics.  I have had people tell me they successfully upload with their TPV and all I can say is after the first time mine failed me (a doorway that couldn't be entered), I chose not to lose money again by sticking to the LL Viewer.  Feel free to try the odds if you like.  The Lindens will love you for it.

Once you upload your mesh, don't forget to set your mesh to Prim in the Edit window's Features tab.  This is the one thing that almost everyone forgets sooner or later and wail their physics aren't working.

If it still isn't working the way it should, here are some videos that explain the decomposition  method:



Plus some other reference pages to help you out:

What is Decomposition?
http://wiki.secondlife.com/wiki/Mesh/Decomposing_a_mesh_for_physics_shape

Making Mesh Physics for SL:



Recently the Lindens updated the Physics Optimization wiki page.  Some good info here:

https://sites.google.com/site/tamaproducts/home/mesh-studio

So I hope this helps you understand this topic a bit better.  As always, please let me now how you like the articles and if you would like to see certain things covered.  More to come as always.

Happy Meshing!
~ele

KWIKTIP #1: Transparency vs. Transparent texture

KWIKTIP

When you don't want prim faces to generate mesh, you go into edit on the prim and in the Textures tab, set whichever faces you don't want meshed to 100% transparent.

Recently, there have been a couple of MS users who have used textures that are 100% transparent instead. The problem with this is that the texture setting remains zeroed and the script is tied to the transparency setting of 100% as the indicator to ignore a prim face so that it doesn't make mesh from it.  Textures are UUID based, so using one on a prim face only tells the MS script there is a texture on it.

Why is this important?  If the face has a texture that is transparent, it will:
  • become visible when a texture with opacity is applied
  • generate mesh which can contribute to LI
  • possibly become an obstacle if you set the mesh to convex hull or set to physical
  • possibly impede accessing a nano mesh if the faces surround the nano
  • add a Prim Face material to your linkset

The steps to "TRI" for nanos


To make a nano mesh with Mesh Studio, you can use this method to trick SL into thinking the mesh you want to nano is larger than it is in reality by using single or double triangles.  There are a few things to consider for nanos.  These three steps create a single "tri" (triangle) from a prim box.



  1. Create a box and color one face red (or other color).  Remember that when you create a box, the top and bottom of the box is what can be tapered, which is good because the next step is...
  2. Taper the top of the box on X or Y to the full extent (1.0).
  3. Now make all the faces 100% transparent except the red, triangular face.  Since fully transparent faces generate no mesh, you are now left with something that will give you a single triangle.  
You can use this for many things, but for today, we are using it to trick SL as mentioned above.  Here are some things to consider:
  • We can create a Prim Face material by coloring one or more faces with a texture or tint.
  • We can apply full transparency to this Prim Face material once the object is made mesh, if we so desire.
  • The smallest an object can scale to is 0.01 on any given axis.
So what if I have a sphere that I want to use as a pearl or a gem, as a simple example, and I want this to be smaller than 0.01?

Let's call this example sphere the target or target nano piece.

A single tri will tell SL the size of two axes for height and depth or height and width or width and depth.  If all you need to do is regulate two axes, then the tri is your solution.  Put the target prim, you want as the nano, at the center of the triangle (remember these prims don't have to be tiny to begin with since we can scale them down).


Center the target prim on the triangle?  Kinda hard to get centers without some math here, you know.  

Yeah, which is why I always work on grid so the centers of the objects I work with are on whole numbers (25 instead of 25.8738).  It's easier to subtract or add to a whole number (helps if the prims are not odd sizes, too).  This is the recommended way for all builders to work.  Makes life a whole lot easier.  Don't know how?  Watch this classic video by Torley Linden:


If you need to be able to scale on all three axes, then you can:
  1.  use a box with a double taper (1.0 on X and Y)
  2.  make all the faces transparent except one on the left and one on the right.  

  • The height of the tapered prim will give the Z height.  
  • The length of the red triangle base will give the Y length and 
  • the distance between the red triangles will give the X width (if the triangles happen to be on the opposing side than my example, it is not a problem; this is just explaining that the size all three axes are being described through this double-faced triangular setup).  
  • Centering the target prim on this setup is easier since you just use the XYZ position of the tapered box
  • If you need to be able to size more on one or two axes, increase the size of the tapered prim on height or width or length or a combination of any two.
  • While you would normally use the  Stretch both button on the Edit menu, you may want to experiment with it off if you need to affect one side of the target more than the other.  This means the target would be off-center within the tapered prim (can be done with the single tri as well).


Why go to all the trouble of making a tri or two when you could just use a box?
  • a full box is 6 sided.  Each side generates at least two tris.  This means 12 tris for a box.
  • if your nano is fully enclosed, you can't reach it to texture.  Making the box material alpha doesn't mean you can easily reach in to the inner nano'd piece.
  • a single tri can be used at any angle or rotation; even if you use two singles together, they are still independent of each other at the prim level.  The double taper that creates two tris, leaves an opening to your target nano (transparent faces prior to generation, don't create mesh), but remain interdependent to each other being part of a single box prim in the build stage.
  • if you are working with a comlex linkset for which you are doing the custom LoDs, the fewer tris in the lowest levels, the better, has been my experience, to keep down the LI.
  • keep in mind that anything I say to you in my blog has been from what I have learned and what has been my experience.  No hard and fast rules, just suggestions from what little I know.  :)
Once you have set up either the single or double tri with your target prim, make sure the target prim is the root.  As always, name your linksets and drop in the Object2JoinedMesh script.  In this case, I used just the Low LoD setting in the MS menu and used it for the top three LoD levels and dropped the last two zero.

The result:


Once uploaded, you can make the triangular faces alpha.  I used a single prim for the demonstration; you can place a full necklace or other linkset in place of the sphere used here.  For mesh, really, you nomally would be making linksets that may have to come down in size.  If you have an object that sizes well on all but one axis, the single tri is a good thing to use.


Want a gem-like cut to your sphere?



I used the Low LoD setting, on the MS menu, which produces fewer triangles on the sphere.  The one on the left, above, used a Crease Angle of 10.000 in the uploader window (see image below).  This sharpened the edges on the lower polygon sphere I called for in MS.  The sphere you see on the right side is the same sphere with the default crease angle of 75.

To enable Crease Angle, you must checkmark Generate Normals.
What is the Crease Angle?

There's a good wiki page on various ways of testing the functionality of Mesh and gives an overview of much of what you find in the uploader window.  It's an older page; you can tell because the Uploader window you see on the page is different than the one you open in your present viewer.  Still, it has some good info.

Under Crease Angle, we have the following:

The Crease Angle adjusts the smoothness of the model.
  • Change the Crease Angle to 0 or 1.
  • Hit Enter in the text entry box
  • Verify nearly every polygon on the face should be apparent. In this case there is no smoothing - the normal of the face is used at all vertices producing a faceted look with a crease or hard edge between faces.
  • Change the Crease Angle to 180
  • Verify that the model now has smooth shading, no creases.
  • Confirm the bounds for entry are 0.000 to 180.00. Entering a value higher or lower will default back to boundary. Ex. entering 5000 will default to 180.00. Entering -20 will default to 0.000.
  • Confirm non-numeric characters cannot be entered for crease angle.
  • Confirm entering a blank value uses the previous value entered.
  • Confirm setting values for this field works for large and small models


You can see the model in the preview window and use the same commands for move, rotate and scale as you do for your camera controls.  When you work with the Crease Angle, watch your object in the preview and you'll see how the angles sharpen or smooth as you change the numbers.  A box has six sides that are all 90 degrees.  So on a box a crease angle of 89 will sharpen all of them.  The sphere will need a decrease in angle depending on how many faces on it.

I hope you found this helpful.  Please leave comments or questions.

Happy Meshing!
~ele

The Pivotal Point of this Message

This is the first in a series of posts on physics with your Mesh Studio.  In this particular example, we will also cover creating a pivot point on a door.  As I worked on this, I realized it really was almost identical in content to a tutorial made by Ashasekayi Ra for Blender.  For those that work in Blender as well, I highly recommend Asha's great tutorials.  The main difference in mine will be how you can create a pivot point using Mesh Studio.

First, I've set up my prims for the door utilizing a full box and four more boxes that are hollowed for the decorative trim.  Presently, I have everything left unlinked because I need to set up a center at the hinge end to the left of the door.


For this, I can easily do it by utilizing a setting in the Edit Menu called Copy Selection.  With the main, large prim of the door selected, I touch the hinge end of the prim and it creates a copy of the prim perfectly aligned to the original.

Copy Selection is a function you should really play with as it not only copies single prims, but will also duplicate linksets, sculpts and meshes.  This includes the textures.
I've added a red tint to the newly created prim.  I am making this a Prim Face material so I can make it transparent once I've uploaded it.


Always try to make faces, you don't want to generate mesh, 100% transparent to lower the number of tris in your build on upload.  For the prim we are using to define the new pivot center, we only really need the top face of the box as it will both tell the uploader what the overall width of the door is (faking it out) and the depth (which is identical to the main door prim as my choice).  At this point, I can link everything with the main, large door prim as my root.  I add the Object2JoinedMesh script to the root.


I use this setup to create the highest LoD by choosing the default setting of 4/24 on the MS menu.  Make sure you name the root.  It's just easier to identify things when named.  Now I will make a version for the Medium LoD level with just the menu.  This time I set to Low Poly after I renamed the root to identify it as the Medium LoD.  Next, I'll make some modifications to create and use for the lower LoDs.  The easiest thing is to remove detail, in this case, that is the hollowed boxes.  When I create the DAE file, I use the Low LoD setting as this will take it down to 2/8.  What this does, is create the minimum amount of tris per face.  Each prim face generates 2 tries.  (Example, a box has 6 sides, so that is 12 tris).


Last I now turn to making the physics shape.  Hopefully you noticed that the red face we made was included in all the LoD levels I've made.  It MUST also be included in the physics shape.  However, with physics, the key is to leave only the necessary collision surfaces.  We know we need to keep that red face for the pivot to work.  I think I only need the front and back faces on the remaining door prim, so I make all the others transparent.  This leaves me with only 3 faces or 6 tris.  Very good, indeed!


On upload, I use the the high version, the medium and set the low version in both the Low LoD and Lowest LoD.  Then in the physics tab, I load from file and use this last version I made.  When I calculate, I see that I have
  • Server cost: 0.750000
  • Streaming cost: 0.403195
  • Physics cost: 0.360000
Sweet!

When I upload  and rez the door, I use Select Face in the Edit Menu and to select the single top face material to 100% transparent.  I also go into the Features tab on the mesh and set it to Prim (important to do this).  This is what allows me to walk through the area on the left of the door, but not through the closed door.  


One thing to note: If you upload a mesh that does not have physics assigned through the dae, it seems only the convex hull and none choices appear. When the mesh has physics assigned through the dae, all three appear. If you link your non-physics mesh to a prim, all three appear. If you link a prim to your non-physics mesh, only convex hull and prim are available.

And now when you rotate the door, you'll see it rotates on it's hinged edge as expected.

Something to keep in mind. The piece you create to enlarge the bounding box and set the pivot point can be made even smaller than I've shown. This piece is mesh even if set to transparent. So it will block someone from moving through it. I didn't worry about the size because I placed it at the top and it is only one face (2 tris) and I would expect this to end up within a wall. It could have easily been put at the bottom to end up on the floor. So just remember this when designing the piece you use and where best to put it.

Happy Meshing!
~ele

Tip: Use a Pre-alignment on textures for more freedom


Sometimes when you make something, you may not know what textures you want to use right away.  Or you may want to change them later.  We know that in Mesh Studio, if we texture beforehand, we set the repeats and offsets.  Here's a way to give you a bit of flexibility.

I built a wall with a door and a window.


The yellow shows the box shapes I used to make it.  I next used a texture alignment pattern.  Now you can do this by hand, but I use Skidz Primz' TNT.  With this I aligned the prims.  I used the texture function to align all the textures.  It does a very nice job.  As with any tool in SL, it can have its problems, but overall does a remarkable job without ever using the SL Edit window.

I added a tint to the prims that make the doorway and window inset.
By using this alignment texture, my goal was to even out all the prim texture repeats and offsets so everything would match up.  My goal is to then have a mesh that will be able to accept a texture that I can repeat and offset in SL for varied needs and it would work across all the prims with the same Prim Face material.

What you see here is only the surfaces that will be the interior wall plus the surface you step on as you go through the door.
A note on Physics:  I removed all the back faces on my wall.  I removed the prims for the doorway, except the bottom one which would be stepped on to enter the doorway and then only made that top face visible.  I removed the prims that made up the window and the surrounding prims and extended the one above the window, so that it reached the floor (I don't feel you need to walk through windows).  This left only the actual collision prims I needed and cut down the number of triangles, when I uploaded, to eight.  So I did my LoDs the way I've presented in past posts and used the physics dae for the Physics tab and the wall came in at 3 LI.  Set to prim, you could walk through the door.

Repeats set to one on the left hand mesh; set to 2 horizontal on the right.
Repeats set to one on left; horizontal repeats at two on right (Cottage rosewood wallpaper by Robin Sojourner).
Repeats at one on left; 4 horizontal/2 vertical on right (Tiles by Nicole Stiles).

This should always be tested and planned out ahead of time, but can give you much more freedom in your designing with the ability to choose more textures since they should all line up nicely.

Happy Meshing!
~ele

I'm a Material girl!


In Second Life, the primary building component is the prim.  These are a set of primitive shapes that can be created through the SL Edit window and put together to build cities, hair, clothing, animated creatures, statues and more.  They can be cut a number of ways and when we taper, shear and apply other types of deformations, this has come to be known as Prim Torture.

If you go into edit on a prim and choose "Select Face", you can isolate one of the surfaces on a prim and texture it independently from the rest of the faces on the prim.  You can shift-left click additional faces to make a grouping that can be textured at the same time.

There are two ways to generate mesh with Mesh Studio.  One is to use the "Object-2-Mesh-MS-Node" script in the root of you linkset.  This basically treats each prim as a separate prim.  When you upload this mesh's Collada .dae file, the meshes are linked and can, therefore, be separated either with "Edit this link" in edit, or you can completely unlink one or more of the links.  The advantage is that you retain the texturability of each prim's faces as if you were texturing prims in Second Life.  Of course, they are mesh at that point, so you lose the ability to do any further cuts or torture.  The downside can sometimes be that the LI can be higher than using the second script included in Mesh Studio.

The second way to generate mesh is with the "Object-2-Joined-Mesh-MS-Node"script.  This treats the linkset as one, inseparable mesh object, similar to sculpts, with only one surface.


However, we have the ability to create more than one texturable section on this single surface.  One way we do it is by putting a color tint on the face of a prim in our prim linkset.


Here I have tinted several faces with red and blue.  Even if the colors are on different prims, as long as they are the same tint, they will all be chosen as if they are a single area to texture or tint when you use "Select Face" on the SL Edit menu.


You can designate up to 8 tint colors total.  The joined script will notate them as "Prim Faces" in the hovertext.  It is also a good idea to use this hovertext as an indicator as it will tell you if you have ended up with more than eight Prim Faces.

There is one other way to make your Prim Faces and that is with the use of textures.


Take a look at the above image.  On the left, I have one area left as white, creating our first Prim Face.  The bird's eye maple creates Prim Face 2.  The reddish wood creates Prim Face 3.  The combination of Burr Maple with Tiger Oak Trin on the lectern's flat face is now Prim Face 4.  I used the textures to get the texture and offsets I needed to make the texture look as I wanted (read the post on texturing the prims to texture the mesh from an earlier entry).  I can still put other textures on these areas, after I make the mesh, but they will have the same repeats and offsets that were used when I initially prepared the prim linkset.  The white area, I've left, will accept both textures and/or tints.  Any tints you add, on top of textures, would colorize that whole Prim Face material area on the generated mesh.

Now examine the linkset on the right of the above image.  This is the same linkset, but I have added some color tints on some of the faces.  These faces all have the bird's eye maple, but some of the faces have blue (making Prim Face 5), pink (making Prim Face 6), and red (making Face Prim 7).  Finally, which may be hard to make out on the small image, I added green to the top of the back slats.


Here, above, you see the final result.  I used the textures where I had the blue, pink and red tints and added tints more in keeping with the textures on my build.  You may have to click on the image for a larger version to see that I added a tint plus low shine and the siding bump to create a pattern on the prim faces that had been left white.

The texture, btw, with the border on the lectern large face, is the 4-in-one texture I used in the previous texturing tutorial.  If you create your Prim Face materials (of which you can do eight) and then also use 4-in-one textures, you can really extend how many textures you can use on a single joined mesh.

So the ways to mark your linkset to create Prim Faces (sometimes called just Faces, Materials or Material Faces or Prim Face Material) is to use:
  • either a tint color or a texture (or both as explained below).
  • the SL Edit menu choices of Blank or Plywood.  White would constitute one Prim Face (essentially being a tint) and Plywood would constitute a second (essentially being a texture).
  •  texture or tint, alone (which would each create a Prim Face material).
  • a texture with a tint (which would create a Prim Face material, and be in addition, if the texture is used alone or with an entirely different tint on the same mesh).
Once you have created your mesh, you would use:
  • he SL Edit menu, with "Select Face" enabled to select all faces within a Prim Face material (example: texture was used with and without tint; each is its own Prim Face material so even if they share the same texture, there are two separate areas to choose since you could also conceivably put two separate textures on each Prim Face material).  This selects the entire area that was designated as one Prim Face material when you prepared your prim linkset.  All areas, even if on different parts of the mesh, are selected when one part of that Prim Face material is selected with "Select Face".
  • experiment with shine, glow, transparency and bumps from the SL Edit menu in conjunction with your textures and tints.  Each Prim Face material can have it's own texture, tint, shine, glow, transparency and bump.
I hope you will find this useful as you continue to explore the world of mesh with your Mesh Studio.

Happy Meshing!
~ele