Thursday, October 24, 2013

Creator Resource - Doors in SL

This tutorial is currently at Creator Resource - Doors in SL



You will need basic building skills to follow this tutorial, such as rezzing prims, texturing their faces and know what the root/child prims are. Knowledge about creating sculpt prims and/or mesh is not required to understand what the scripts will do. It's only advisable if you plan modelling your own sculpt/mesh doors :-)

TABLE OF CONTENTS


Introduction: What do we mean by "using doors" in our builds?


When building in SL, when we say that we want to make "a door", we're implying a little more. What we normally mean is that we want to build an object that will work as a door, this is, than apart of having the appearance of a door, it will open and close as a door would do.

Building the door in itself isn't complicated. The issues arise when we want to add our door the desired interactivity. Suddenly we may find that our whole build rotates, or that the door is rotating around the wrong axis, or moving around the wrong axis, or that the way the door rotates, is not how we would like it to be, and the fix has to be performed in the build rather than in the script.

For all those reasons, I've spent some time putting together all the information that I consider essential for builders, and that I hope will help you understanding what you're after when you want to add doors to your builds. It's important because you'll learn how your door should be designed, what kind of script to use and why.

Note: When we talk about doors, we don't refer to doors strictly. If you think about it, a drawer that opens and closes presents the same kind of issues: an object that should slide. A music box's lid that opens and closes, it's again the same case: it's an object, the lid, that should rotate in order to open and close. Like these two, I'm sure that you can think of many other objects and uses, and all of them fall within the same category: "doors". For all of them, the same principles explained here, apply :-)


Sliding doors


Simply put, a sliding door is a door we will expect moving, but not rotating. From a textured door to a mesh door, they don't have specific requirements. The kind of scripts used normally will let you decide which direction to follow, how far the door should move in that desired direction, and during how much time.


Sliding doors: How to build them


We're going to begin our study of sliding doors by completing a "little project" that consists of building a door that will be simply a box using textures from our "Library" folder.

Wait, I don't have a "Library" folder in my inventory...

If that's the case, follow the "Advanced: Show Debug Settings" menu, look for the "NoInventoryLibrary" setting, and set it to FALSE, as the picture shows:


Rez a box. Give it a name under the "General" tab. For example, name it "My Sliding Door Example".

Now position it at integer coordinates (without decimals), like the picture shows:


Resize it to, for example:
X = 1.75
Y = 0.25
Z = 3

Now, to texture, select the "front" and "back" faces, and apply to it the "door51" texture, which is under "Library: Textures: Textures by Marlin Studios". Then select the edges, and apply to it the "Brazillian rosewood" texture, which is under "Library: Textures: Wood".

If you want to have showing only one door on your box (since the texture is of a double door), change the settings of face #1 to the following:

Repeats Per Face
Horizontal (U): 0.5    [X] FLIP
Vertical (V):   1.0

Texture Offset
Horizontal (U): 0.25
Vertical (V):   0.0

and then the settings of the opposite side (face #3) to:

Repeats Per Face
Horizontal (U): 0.5
Vertical (V):   1.0

Texture Offset
Horizontal (U): 0.25
Vertical (V):   0.0

There's no need to modify the repeats and offsets of the edges, so we'll just leave them be with the defaults.

We have a door to slide! :-)


Sliding doors: What we should expect from a "sliding door script", what we should expect to edit in it


There are so many free full permissions scripts to move doors, that is impossible to cover each single variation and say what to change and where exactly. Instead of that, I've decided to talk about the general aspects that all of them cover, so you know what to look for exactly in your particular script, or even, to know if that specific script is of some use for you or not.

A "sliding door script" simply takes the following information into account:

  • How much time the door should be sliding
  • How many steps during that time
    • Few steps will make the motion to be less smooth, but it will cause less lag, for less calculations will be involved
    • Many steps will make the motion to be smoother, but it will cause more lag, for more calculations will be required
  • What axis to follow in the motion. Some force your door to a predefined axis (so you should build it a bit differently than explained: basically rotating and resizing in another way - the script should tell you this in the comments). In that case, they give an extra parameter for the direction the door should move (like "left" and "right").

This means that such a script will have at some place a section where you introduce the new values. Some of those scripts may require from you that you reset it if you change the initial position of the door. You should read all the comments in the script to be aware of that. If there are no comments, you may try to guess by looking if the script contains the text llGetPos(); at some place... but if the script has no comments, I'd rather suggest to look for another script with comments (comments in scripts are colored orange.)

This is important to know because, for example, if it's required to have the script reset manually, you should not give your customers a no modify object. When prims are no modify, we cannot manually reset the scripts they contain.

If what I've just said sounds like "huh?" to you, then I urge you to read this tutorial about the most basic of permissions in SL. What an user can or cannot do with modify/no modify objects is covered specifically in this section.

A simplified sliding door script would just:

Move the door from one initial position to an end position. The motion is almost instant (our viewer will give it some smoothness, over a short time that we do not control), but it has the advantage of not overloading the server with intermediate calculations. If we're having several linked pieces, this is recommended, for performance and lag reasons.

If we want our sliding door being composed of more than one prim (a door and a knob, for example), like it has been pointed before, check the "Linked doors. More than one door prim. What to do?" section at the end of this tutorial. Check it also if editing those values in a script is not your strong suit. A professional door system will save you a lot of headaches and script editing :-)


Rotating doors


In this case, first we have to consider is what we understand as "rotating doors". All prims in SL have the ability of rotating, and they all do taking as a pivot point the center of the prim. So whenever we rotate a prim, we are rotating it around its center.

This is telling us that a "rotating door" is a door that we want to see, well... rotating :-)

But actually, we mean a little more here.

Let's take a look at the following picture, which is basically, the door we designed for the sliding case, which now has a cylinder in the middle, along the Z axis, to make us think of a "pivot":


If we rotate the door around the Z axis, since it will do from its center, this is what will happen:


A script will always do that: if we tell a script "rotate this prim these and these degrees around these and these axes", the script will always apply that rotation making the prim to pivot around the center. It doesn't matter what we do, scripting wise. If we want that the door, instead of rotating that way, visibly (the key word here) rotating, for example, like in the picture:


What we have to do, and the picture is suggesting it... is to alter the prim! We'll cover this by talking how to achieve this with regular prims, sculpt prims and mesh. But before, a word or two about what a script would do exactly...


Rotating doors: What a script would do in this case?


If you've ever joined a scripting group, you likely have realized that barely anybody likes rotations. What is it that makes rotations so hated? It is because of the following facts, which you, as a builder, have to be aware of:

  • If a script rotates the root prim, it will normally rotate the whole build with it
  • If we want to rotate a child prim, we need to perform a calculation that not everybody understands

This is why builders often feel so confused when editing a script to rotate a door, often preferring to leave the doors unlinked. Even scripters have issues with them!

So if we have a basic "rotating door script", this is what we may expect from it: It will rotate the prim containing the script. If this prim is the root prim, everything else that is linked to the door, will also rotate with the door. That's why these simple scripts, when used, don't "like" when we link the door to the build. Because they normally aren't ready to perform the necessary calculations that are required in a linked build.

Are we then left with no other choice than unlinked doors when we want them rotating? Of course not. You may head to the "Linked doors. More than one door prim. What to do?" section and read about it. But whether you read that section or not, what follows is important: in the next three sections, we're explaining how to modify regular prims, sculpts and mesh, so when they are rotated by a script, visually, they will look as expected.


Rotating doors. Building the door: Regular prims


There are some ways of making a regular prim to have visible only half of it, so when it rotates, it does around the visible hinge. For this, we have to understand the following two properties:

  • Path Cut
  • Slice (Boxes and cylinders)

Path Cut

Path cut is a property that operates on the XY plane, around the Z axis of the prim. When we change the path cut property of a box, for example, like in the picture, we see that the prim is indeed "cut":


What we've said before, "operates on the XY plane, around the Z axis of the prim", means that we cannot decide around which axis we want to "cut" (path cut) the prim. It's always around the Z axis:


So if we want the path cut showing in another axis, what we have to do, always, is to rotate the prim:


finding a good angle so it begins to look like a door:


and modifying the path cut to finally have a door that visibly, will rotate around its hinge:


When you texture this, remember that the prim has been rotated, and cut. Don't expect that the door texture will look right at the first try :-)


We will need to rotate the texture:


If the texture isn't of a double door like this one, then we'll also have to change the repeats and offset it:


("door31", also in your "Library: Textures: Textures by Marlin Studios" folder)

This is the principle behind using path cut to get prims that visually will rotate around a hinge. More complex primitives, such as torus, tube and ring, may require from you to also tweak "Profile Cut" (a secondary cut type that these prims allow). When working with spheres, you may also want to check out the "Dimple" property, which is exclusive of spheres.

Slice (Boxes and cylinders)

Slice is a property that we can find in boxes and cylinders, that removes "slices" of the prim, either beginning by its bottom ("Slice Begin"):


or by its top ("Slice End"):


This slice happens only in the Z axis, so once again, if we need a different configuration, we will have to rotate the prim, taking into account also that this will affect too to the texturing.

All clear with regular prims?

Then now let's study how to design our sculpted doors, so they will rotate around their hinges :-)


Rotating doors. Building the door: Sculpt prims


The same idea explained for regular prims applies here: prims rotate around the center, so what we have to do is to make the VISUAL part of the sculpted prim (the door in this case) to occupy just HALF the bounding box. That will make the effect, when the sculpt prim rotates, that it visually does around the hinge:


The prim continues rotating around the center! What we've made here is altering the bounding box. If you don't know what the bounding box of a sculpt prim is, then please check out this tutorial, "Introduction to sculpt prims", which explains what this and other essential terms mean :-)

As we can see, when working with sculpt prims, the important is understanding how we're designing the bounding box: The relevant is that the hinge is in the middle of the bounding box. We have, of course, to make sure that the sculpting tool allows us to manipulate the bounding box if we want to create these doors! The discussion about the tools is also covered in the "Introduction to sculpt prims" class.

Click here to know how to do this using Prim Generator (link to the Prim Generator class)

Now, this is relevant to sculpt prims. The door shows a problem: unless we make it phantom, the part of the bounding box with no visible geometry could hit us if this door is open and we are in its way!

Specifically talking about sculpt prims, this leads us to the need of linking phantom and non phantom prims, having an adequate collision prim. Click here for a detailed, technical explanation about linking phantom and non phantom prims. It covers other relevant details as understanding how the Land Impact works, and why we shouldn't worry about using this method with sculpt prims.

But of course, if we make the sculpt door phantom, that means, when it's closed, users will be able to walk through! Working with sculpts, the solution consists in using one or more extra prims, completely transparent, that will not be phantom, and will have the physical boundaries we need. For example, with a door, we will need a transparent box, having the size of the visible part of the sculpt. And remember! If this is to be controlled by a script... the transparent box should be moved too! Otherwise, the user will stumble against an invisible part :-)

Fortunately, this last is better solved if using mesh. So if you're waiting to know how to proceed in order to make a mesh door... It's that time now! Let's study how to design our mesh doors, so they will rotate too around their hinges and have an adequate physical presence :-)


Rotating doors. Building the door: MESH


We've studied so far how the doors should be built either in prims or sculpted, should we want them to look natural when pivoting around their hinges. Now, how would we model a mesh door having the same feature?

The case of sculpt prims may suggest us that we should, somehow, "modify the bounding box" of the mesh object, so we can offset the door and have the hinge in the center of the bounding box.

I will explain how to make these doors in Blender, because it's the program I use, but I hope that the idea I will develop will be easy enough for a Maya or 3DS Max user to follow. The final step refers to uploading the mesh to SL and setting up the object inworld, so then again that's common regardless of the program used to model the door.

I don't know if there are other ways of achieving the same result. I was exploring this one when I tried to offset a mesh object so particles would emit from the point I wanted them, and it worked. This made me think that it would work with doors too. I tried the concept, and it worked indeed. So having found this one method that can be used, I didn't pursue any other way: that's why I don't know if there are other ways of getting to the same place. If you know of another way, I'd like to hear from it. (Also, I'm not claiming this is my innovative idea, only how I got on my own to this place.)

I'm explaining now the whole process of creating a mesh door that will rotate around its hinge, over a mesh gate I released for the store.

This is the gate in Blender, still having the supporting pillar visible:


You may notice that there's "something" to the left of the pillar. If I now hide the pillar (H key in Blender) and go to the front view (NUM KEY 1), when I select the gate, the outlines tell me that apart than the gate itself, there's a tiny extra to the left:


By changing the "Viewport Shading" to "Bounding Box":


what we see is that the "tiny little thing" is extending the bounding box of my mesh gate:


Going back to "Texture" as "Viewport Shading", and then going to the top view (NUM KEY 7), we see better that this "little thing" is a small triangle:


If you've worked a bit in Blender, you know that each object has a special point known as "pivot point". We can change this pivot point to wherever we want, and within Blender, that will make the object to rotate around the pivot point. I'm pretty sure that Maya/3DS Max have a similar concept.

We could think that just by changing the pivot point to where the hinge is, that would be enough. But it's not enough. When we upload our model to SL, SL will only acknowledge as pivot point the point that is in the center of the model's bounding box. So if we want to have a pivot exactly where we want, we have to modify our model within Blender, extending the bounding box as needed. And how do we extend it? Simply adding a little triangle to either the top or the bottom opposite corner. Only a vertex will not work: it has to be a triangle. Make it small if you will, but not too small that you'll run into issues when uploading (btw, should you run into issues when uploading, check this thread, where Gaia Clary shares what she's found out so far regarding upload errors and what to do to fix them.)

We're not done yet.

Now, we want to assign one separate material to the little triangle face. Why? So once in SL, we can texture it separately, and simply make it completely transparent, so the triangle will not show at all:


Then we have to make sure of applying rotation and scale (CTRL A for the menu showing below, then choose "Rotation & Scale"). That will change all the local references of size and rotation so they will coincide with the world (global) ones. In less technical terms, it's going to save you trouble :o)


How is it going to save you trouble? For example, if you have a different rotation than X = 0, Y = 0, Z = 0, and then start modeling the physical boundaries of the door, it could happen that, once in the mesh uploader, you see that the visible geometry and the physics don't coincide at all: don't continue and upload, because once you have the mesh inworld, the physics will continue not matching the visible geometry. Instead, go back to Blender, apply rotation and scale, and export your models again.

I'm mentioning "physics" more than once. Does this mean that apart than assigning a material for the extra triangle alone, there's yet more work to do? Right, there's still a bit more we have to do.

We also have to create a physics model for our gate. Since the expected is that we can't walk through the gate, just a box makes the role of gate when it comes to physics. And check out the little triangle! We have to add it too in our physics model! Otherwise, we are in the same case than before: the bounding box will not be the same once in SL :-)


So we make sure that the physics model and the visible geometry have the same size of the bounding box, we make sure that the physics "box" will match the boundaries of the gate, and we're ready to export both the geometry and the physics as separate .dae files, and upload the gate into SL.

NOTE: Remember that you can work in wireframe mode (Z key in Blender) and also make more than one layer visible at a time (select one layer, then hit SHIFT and click on to a second layer: both will be visible). So you may have your visible geometry in layer #1 (say), then the physics in layer #2, and make both layers visible by first clicking on the layer 1, then hold SHIFT, then click on the layer 2. Also, remember that the numbers under the "Dimensions" boxes are telling you the size of the bounding box. The door and the physics model, ideally, should have the same numbers there :-)

Next step is uploading the model to SL. So we proceed as usual, and load our geometry:


Then we go to the "Physics" tab and load our .dae containing the physics. We should see the physics "embracing" the geometry, and the little triangle extending the bounding box, at the opposite corner:


Just a bigger view to show it better:


So with this, we upload our door to SL... And we aren't done yet!

Two more details :-)

First: Make sure that you texture the little triangle it being totally transparent. I like to use the "*Default Transparent Texture" from the "Library" folder, under "Textures" here, apart than raising the Transparency amount to 100, for one reason: if your door uses a script that changes the transparency of all faces, that would unveil the little triangle too. So if the texture is transparent, you will not have to modify the script so the little triangle face is skipped.


Second: Under the "Features" tab, make sure of changing "Physics Type" to "Prim", or you will not be able of walking through the part of the bounding box with no visible geometry :-)


Now, finally, our mesh door is ready to pivot around its hinge! \o/


Linked doors. More than one door prim. What to do?


At this point, we know how to build doors (drawers, etc) that will slide, or that will rotate around a pivot (their hinge). Whether they're made of regular prims, sculpt prims or mesh, we now know all the tricks. We also know how very basic scripts will work in very simple cases. We also understand why if we drop a rotation script in the root of a build, the whole build is going to rotate, not the door!

A note from experience as a customer: customers will greatly appreciate that the doors are linked to the build. Even though I know how to move the door and the build all together to another place, it's always a hassle having to remember. Normally, I move the build, realize that the door hasn't moved, undo, select the door, move everything again... It's annoying. It's annoying to an advanced user. So now imagine how this is for a customer that has no idea about what to do if, when moving the house, the doors are left behind.

When we want to have doors linked to our build, or we need our doors being composed of more than one object, or both, we have always to evaluate pros and cons of all the possibilities. If you wish to use one script per door-prim, and have unlinked doors, because to you, it's essential that the rotation happens exactly during 3.84 seconds and not the interpolation the viewers perform for prim-motion, then I will not be the one telling you not to do so. But remember that every script you add, adds to server side lag.

If you don't mind that the motion is the interpolation performed by the viewer, and prefer having all of your doors linked to the build and controlled by ONE single, low lag, script, then you can head to Marketplace and check out my own professional door script, which you can find here, recently upgraded to V2, that performs all the basic functions you would expect from a door script (change position, rotation, size), and then, quite a lot more of extra functions (vehicles compatible, interface with other scripts, AVsitter/MLP compatible, special features to create Murphy beds...), helped by a very complete auxiliary configuration tool, that will simplify your work.

Whatever your choice is, let it be an informed one :-)

Creator Resource - Prim Generator

This tutorial is available at: Creator Resource - Prim Generator



PRIM GENERATOR - TABLE OF CONTENTS



Welcome everybody. I am Auryn Beorn and I'll be your instructor for this class.

First concepts


Prim Generator is an user friendly inworld tool that will allow you to create sculpted prims with ease from our buildings made with regular prims (and some more.)

The basic idea of use is to rez the "*NN* Prim Generator v2.02" object, which is a panel showing a display with several shapes and numbers, and then click the button of the shape that we want to use in our build. This will make the panel to rez the desired shape. From that moment, we edit this shape with the "Edit" controls from SL as we would do with any other prim, and keep clicking buttons for other shapes, editing them... until we have our final build, ready to be turned into a sculpt prim.


The basic version allows us only to build by using regular prims, and a couple of special shapes, "Round Box" and "Round Rect". All the prims rezzed by Prim Generator contain a script: We'll talk about this later.

Also, these regular prims are limited in the smoothness they are generated with (a detail we'll also talk about.)

It is by acquiring some plugins that we can increase our library of shapes to work with, as well as the smoothness of the shapes themselves.

What's the first important detail to take into account?

The amount of slots we have available, and which name Prim Generator uses for them.

Prim Generator allows us to have up to 32 "slots" to fill with our shapes. Some shapes will require more slots than others. The smoother the shape, the more slots it will require.

Prim Generator calls these slots "vertices", but since this term already means something for sculpted prims, we'll refer to them always as slots.

Now, here it is when Prim Generator shows its main strength: the ease of use.

As for regular prims, it supports boxes, cylinders, spheres, torus and tubes.

Not all transformations are supported... but we have not to worry about it! The script contained in each prim that we rez from its panel, will revert the shape if we try to apply a transformation that is not supported.

Let me show an example.

I'm clicking the panel to get a torus.


This basic torus is colored SALMON and will use THREE slots.

Now, when I've rezzed the torus, Prim Generator has said in chat:

[14:32:03] *NN* Prim Generator v2.02: [Torus] Vertices Count: 2-3  Modyfiable: Path Cut, Hole Size, Profile Cut, Taper  NoMod: Hollow, Skew, Twist, Top Shear, Radius, Revolutions

This means that all the properties falling under "NoMod" ("Locked" in previous versions), that is, "Hollow", "Skew", "Twist", "Top Shear", "Radius" and "Revolutions" are not supported for the torus.

What will happen if we try to change any of this "NoMod" properties in the prims generated by Prim Generator?

As you can see now, as I try to apply Skew...


... as soon as I release the mouse from the "Skew" up-arrow, the script will detect that this is a non supported change, and will revert "Skew" to 0.

Depending of the shape, you have more or less "NoMod" (locked) properties. This means that, for example, boxes don't have the "hollow" locked, but torus do.

Prim Generator will always say which ones when we click the panel to get a new prim. The allowed ones under "Modyfiable" and the non supported ones under "NoMod".

Another nice detail it has is that if, an example, we begin with this torus, colored in SALMON, so using THREE slots as we can see in the panel... (yes! the panel is always telling us, for a given shape, if it has a specific color, how many slots is going to use)

... and now we path cut it this way...


... the shape is going to change color, to indicate us the new total of slots that is using! (blue, so two, in this case.)

For the same building block type (box, cylinder, etc.) some transformations will require more slots than others, and Prim Generator will always recolor the shape according to this!

All this ease of use is possible thanks to the scripts that the generated shapes have within when rezzed from the panel.

This has a major advantage that we'll see next, but before... a warning.

There it is an option labeled as "DEL" in the panel.


When we click it, Prim Generator asks to us if we want to delete all the prims contained in 100 meters radius.


If we say yes, since those prims contain a script, and it's the script the one saying to the prim to be deleted... Once the prims are gone... they are gone FOREVER.

They will not go to your trash folder.

And why do we have to be aware of this?

Because if we've made a mistake in our build, there's NO WAY to recover the original build from the generated sculpt map. We should build everything AGAIN, FROM SCRATCH.

So we don't want to use this "DEL" function, unless we really know what we're doing. Normally, we want to link the build created with Prim Generator's blocks and take it to inventory instead :-)

If we've made a mistake and have to fix it, we can always rez the build from inventory... Prim Generator will acknowledge it so we can continue working from it!

It matters not if those building blocks are linked or not, actually. Also, any Prim Generator building block you rez after restoring your build, linked or not to your build, will be acknowledged as a part of the build. The building blocks are acknowledged as a part of the same built if they are within 100 meters of the panel.


Q/A for the first section


Q: Do the plug-ins have these certain features blocked?
A: What the plugins allow you is to have smoother shapes, and a bigger library of shapes which includes not only the regular prims, but also sculpts, like the rocks plugin (which has several predefined sculpted rocks.) The transformations that are locked in the base system for the regular prims, they continue to be locked in the "smooth" plugins.

Q: So, are you saying, this tool supports making sculpts to a maximum of 32 "slots"?
A: Yes, and the sculpts it has in the library of shapes of the plugins use 1-2-3 slots. You can combine them with your regular prims, which is helpful for example to create a sculpted couch, since you can mix regular prims in its construction with rounded cushions, as there are rounded sculpts in a specific plugin for them :-)

Q: So the plugin shapes are those we can't make ourselves with the core system. A way around odd shapes? And is there a limit on plugins you can plug in?
A: Let's say, a plugin is a library of shapes that the creator releases, so they can be combined with the rest of shapes you can work with this, and there's no limit of plugins you can use. I have all of them rezzed and they don't interfere with each other: they work together. There are a few ones that don't need from Prim Generator to work, like the plants generator, or Word Generator. You may have them around with Prim Generator, and they don't interfere either.


Using our already made builds with Prim Generator


Now that we're aware of this, let's talk about the major advantage: we can use our already made builds with Prim Generator.

How?

Proceeding this way. Click the panel to get a BOX.


Right click it to edit, click now the "Content" tab. Copy the script "Tsumiki Box v2" that you can see inside the box to your inventory. You copy the script in your inventory by clicking on it in the "Content" tab, and dragging it to your inventory, to the folder where you want it saved.


Now rez a BOX. (When I've said "Rez a BOX" I mean exactly that: rez a box - not generating another box from Prim Generator - I mean *rez* a box, the way we always rez a box.)


Right click it to edit, click its "Content" tab. Drop this "Tsumiki Box v2" script that you should have now in your inventory within the "Content" tab of this freshly rezzed box.


And there it is! Your regular box is now recognizable under Prim Generator :-)

Also, you all should have seen that the box has turned to yellow as soon as you've dropped the script.

Why is it important to be able to do this? So we don't have to rebuild again our previously made prim-builds: we should only drop a copy of each script in each prim (so, going into edit linked parts).

IMPORTANT: When dropping Prim Generator scripts in our previously made builds, so we can convert them into sculpt prims, keep in mind this detail: Boxes should get in contents the "Tsumiki Box v2" script, cylinders, the "Tsumiki Cylinder v2" script, and so on.

NOTE: If we SHIFT COPY an already rezzed Prim Generator shape, no matter if regular or from the other plugins... it will be acknowledged as a part of our build.

NOTE: The shapes in the build don't need to be "together" as in "touching the other prims". We can do something like this...


... and it all will be a part of the same sculpted prim.

Q: Will this allow phantom to be linked to non phantom?
A: That has nothing to do with the sculpting tool you use. The topic is covered here, the rewriting of the "Linking Phantom and non phantom prims" class (version 3!)


Generating our sculpt map


Let's talk now about the process of generating the sculpt map, and how to manipulate the bounding box in Prim Generator. If you don't know what "bounding box" means, please check the "Introduction to Sculpted Prims" class, where this topic is thoroughly covered.

When we have finished our build, we should click the "GENERATE" word in the panel.


This will calculate the total of slots used, showing its progress over the panel:


and if this total is less or equal than 32, it will show a menu with several options:


Generate!This calculates the MINIMAL bounding box at X = 0, Y = 0, Z = 0 rotation that CONTAINS the whole build
x1.5This calculates a bounding box 1.5 times the minimal for the same size of the build
x2This calculates a bounding box 2 times the minimal for the same size of the build
x3This calculates a bounding box 3 times the minimal for the same size of the build
x4This calculates a bounding box 4 times the minimal for the same size of the build

The x1.5, x2, x3 and x4 options could be useful, for example, to create nano-jewelry, as it was discussed in the "Introduction to Sculpted Prims" class.

We select one of these options, and after some seconds, when Prim Generator is calculating (which will lock the panel):


we obtain both a link in chat AND a popup asking us to open a website link:


Suggestion: Disregard the popup, for the link with the generated sculpt map could not load in the internal browser. Copy the link from chat and paste it in an external browser. Then right click over the image, select "Save Image As..." from your browser menu, and make sure you save it as PNG.

IMPORTANT NOTE: As soon as you generate a new sculpt map, the previous link will be no longer valid. Remember to download your maps before generating new ones!

The default options (x1.5, x2, etc.) are not enough for us to manipulate the bounding box in all cases. What if we wanted to create a door that pivots around the hinge?


Manipulating the Bounding Box


Well, let me show :-)

Let's assume that this is the door we want to convert into sculpt prim by using Prim Generator:


We click the "0" in the Prim Generator panel, and a special box is rezzed.


Prim Generator will say:

[03:49] *NN* Prim Generator v2.02: [Dummy] Vertices Count: 0  The dummy box to adjust the range of the sculpted map.

This "dummy box" ... is in fact... the bounding box!

It's not the best choice for the name, I know!

So now, all that we have to do is resize the "dummy" (BOUNDING BOX), move it to make sure that our door will pivot around the hinge... and then, click "GENERATE" in the panel.


The generated sculpt map will be the door that, visually, will pivot around the hinge :-)


Smoother shapes? How?


Now, this is important... Let me show a sample of the generated shapes. This is how the generated sculpt shapes look like when created with the basic Prim Generator system:


All round shapes are generated with 8 sides per slice.

In SculptCrafter, if we wanted a different number of sides/faces for a cylinder than 8, we had to change the description to a number indicating the number of faces.

In Prim Generator, we need one or more plugins, it being the "Smooth shapes" one the first to consider. So if we want a cylinder, torus or tube being smoother, we have to rez it... from the smooth shapes plugin panel.


Notice that the plugin panels have no "Generate" button, nor they have "Dummy" (bounding box) or "Delete" buttons. The plugin panels give us more shapes, but we still need the basic panel to obtain the sculpt map, or the bounding box functionality. The plugin panels remind us indeed that we need the main Prim Generator panel for this to work, by printing an owner message each time we rez it:

[08:54] *NN* Prim Generator Smooth Add-On v1.00: This is add-on of Prim Generator. Please use with Prim Generator.

Now, if, for example, we click the shape pointed at in the picture:


Prim Generator says:

[08:59] *NN* Prim Generator Smooth Add-On v1.00: [Holed Cylinder] (12 sides) Vertices Count: 2-4  Modyfiable: Path Cut, Hollow, Twist, Taper, Top Shear  Locked: Hollow Shape, Slice

Of course, smoother shapes mean more slots used in the sculpt map. In this case, the addition of the smoother cylinder will have a cost of four slots from the total of 32 that we have available. Smoothness always means more faces of the sculpt prim used to give that detail, and so, less available space for the rest of prims we want to include.


What about texturing?


Texturing sculpt prims is not easy, and texturing sculpt prims produced by using programs such as Prim Generator or Sculpt Crafter is even more complex if possible, if we don't want to be constrained to having the same texture applied to each and every face. Normally, the latter is what's done: have the texture applied to each face, and for that, it's required to change the number of repeats of the texture. The reasons are way far from the scope of this class. We'll just use the texture repeats by using one of the provided scripts with Prim Generator, or change those repeats manually in the "Texture" tab the way Prim Generator suggests to us after it has generated the sculpt map and given to us the URL to download it from:

[09:41] *NN* Prim Generator v2.02: Success! When you upload the sculpt map, make sure "Use lossless compression" is check.
[09:41] *NN* Prim Generator v2.02: Prim Size: <1.24889, 1.33330, 1.00000>  Texture: Repeats=<4, 32> Offset=<0.5, 0.5> or Repeats=<1, 8> Offset=<0.0, 0.5> or Repeats=<1, 16> Offset=<0.0, 0.5>
[09:41] *NN* Prim Generator v2.02: Sclupted Map URL -> http://naonao.biz/cgibin/image.cgi?aHR0cDovL3NpbTIzMzcuYWduaS5saW5kZW5sYWIuY29tOjEyMDQ2L2NhcC8wNGIwZTZhMi01MzBlLWQ4YmEtNzYyZi02MmQwMjk0YTVjZjU=

In here, Prim Generator is telling us the texture repeats and offsets in this line:

[09:41] *NN* Prim Generator v2.02: Prim Size: <1.24889, 1.33330, 1.00000>  Texture: Repeats=<4, 32> Offset=<0.5, 0.5> or Repeats=<1, 8> Offset=<0.0, 0.5> or Repeats=<1, 16> Offset=<0.0, 0.5>

So, three suggestions to try with our sculpt prim:

Horizontal Repeats = 4
Vertical Repeats = 32
Horizontal Offset = 0.5
Vertical Offset = 0.5

Horizontal Repeats = 1
Vertical Repeats = 8
Horizontal Offset = 0.0
Vertical Offset = 0.5

Horizontal Repeats = 1
Vertical Repeats = 16
Horizontal Offset = 0.0
Vertical Offset = 0.5

Note: If you hadn't realized before, Prim Generator also tells you in that line the size of the prim that will be the sculpt prim using the generated sculpt map. Next to where it says "Prim Size", it tells you the size the prim should have:

[09:41] *NN* Prim Generator v2.02: Prim Size: <1.24889, 1.33330, 1.00000>  Texture: Repeats=<4, 32> Offset=<0.5, 0.5> or Repeats=<1, 8> Offset=<0.0, 0.5> or Repeats=<1, 16> Offset=<0.0, 0.5>

So in this case, it would be a sculpt prim with size X = 1.24889, Y = 1.3333, Z = 1.0.

Having a look again at how the generated shapes look, one of the few suggestions that may come in handy here is, if you use round shapes and boxes... Make Prim Generator to generate a sculpt with the round shapes on one side, and the boxed shapes on the other side.


The reason is that you can find a number of repeats that looks good with round shapes, but then that could look ugly in the boxes you could have in the same sculpt.

One more detail, and class is finished! I promise!

You sure have realized that the texture, for example, in boxes, looks "broken" in a couple of (opposed) faces. This is unavoidable in Prim Generator. Sculpt Crafter will texture them nicely if you use up to 42 of them.


Since rotating the box in your build will make the broken faces to rotate in the generated sculpt, Prim Generator shows you which the "broken" faces will be once you generate the sculpt in its native building blocks. It shows the broken faces like a "grid":


This is useful to know, because we could rotate and hide those faces when we're for example using Prim Generator to generate a fence or other kind of build where those broken faces could be hidden, so only the "pretty faces" are visible.


2013 Final Note: We could go over explaining how the textures are applied in this kind of sculpt prims, why those number of repeats always show, and how we could use that information to create textures that will give us more flexibility in the appearance we show for our sculpt prims. I explained how to do this in a class that made a lot of people's heads to spin (and a few that took that class, now sell it as if it had been their occurrence.)

Honestly, nowadays, with all the advantages that mesh presents with respect to texturing, I have my choice quite clear: if you need custom texturing that goes further from changing texture repeats, then don't go for sculpt prims: go for mesh. You'll save yourself a lot of unnecessary headaches.


And this is all for this class :-)

I wish that you come away with new knowledge.

Thank you all for coming.

-- Auryn Beorn