Thursday, October 24, 2013

Creator Resource - Prim Generator

This tutorial is available at: Creator Resource - Prim Generator


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.


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 ->

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

No comments:

Post a Comment