Primstar is a set of scripts to make creating Second Life content in Blender fast and easy.
If you have any questions about the manual, please leave feedback in the forums. When the manual is completed, I will be deleting any comments on these pages that become outdated. Comments in the forums won't suffer the same fate.
The manual is currently a mix of 1.0.0 and 0.5.0 stuff so don't be surprised if what you read doesn't match what you see in Primstar. It will be fully up to date for when Primstar 1.0.0 is released. (make that mostly up to date - new physio exercises have put me behind on this, so manual isn't fully current yet).
Please note that Blender 2.50 to 2.56 do not work with Primstar. For Blender 2.57 and later you need Primstar 2.
The 1.0.0 stable release requires Blender 2.49a or Blender 2.49b and a full Python installation to match.
All Primstar releases including snapshots of the git repository for testing purposes and older releases are available in the release project page.
Please see the readme.txt in the download for latest install information
Blender 2.46 or later
Python - The version should match the one Blender uses.
Python tkInter - normally included with Python, but some Linux distributions have it as a separate package.
copy the .py files to your Blender scripts directory as listed below.
Linux: ~/.blender/scripts Mac: /Applications/blender/blender.app/Contents/MacOS/.blender/scripts/ Windows XP: c:\Program Files\Blender Foundation\Blender\.blender\scripts Windows Vista: C:\Users\USERNAME\AppData\Roaming\Blender Foundation\Blender\.blender\scripts
Note: The exact directory may change depending on options chosen during the Blender install and the Blender version, but should be something like the ones listed. Mac users may need to enable viewing all files to find the correct folder.
If you can't find your scripts directory, then create a new text in Blender and paste the following code into it:
import Blender
print Blender.Get('scriptsdir')
If you press alt-p ( File - Run Python Script ) then the correct directory to install the scripts will be printed on the console.
Run Blender and in the "File - Import" menu you should see a new option for 'Second Life Sculptie'
If the option is missing, select the scripts window and use "Scripts - Update Menus" to refresh the menus.
Primstar comes with it's own colour theme which is used for all the screenshots in this manual. You can enable the theme from Blender's Scripts Window by selecting Scripts - Themes - Primstar.
After installing Primstar, you will have quite a few new menu options in Blender. The use of these options will be covered in detail as we work through the manual. They are designed to make the workflow for sculpties in Blender easier and faster, while leaving Blender's power available for advanced techniques.
Here's a list of the options added to each Blender window type.
User Preference options
File - Import - Second Life Sculptie
File - Export - Second Life LSL
3D View options (object mode)
Object - Scripts - Reset Sculpt Mesh
Object - Scripts - Sculptify Objects
3D View options (edit mode)
Mesh - Scripts - Update from Sculptie
Unwrap (U key) - EAC from View
UV/Image Editor options
UVs - Scripts - Align to Sculpt Map
UVs - Scripts - Scale to Bounds
Scripts Window options
Understanding the sculpt map format is one of the most important things a sculptie maker can know. This knowledge makes choosing the basic sculpt type easier and also allows many advanced techniques to be used in the modelling process. It will also help you to understand what the Primstar scripts are doing to make things quicker for you.
Don't worry if you don't understand all of this the first time you read it. I'll be mentioning the concepts here in different contexts throughout the manual. Come back and read it again after finishing the manual and creating a few sculpties and it should be a lot easier to follow.
While sculpties can be made to appear in world as a number of pieces, in reality they are one continuous surface.

It is useful to think of the surface as a profile translated along a path. The profile and path can change across the surface, so it's not strictly accurate, but it will help to keep this idea in mind when modelling.
When adding or removing detail from the mesh, you'll get better results working on an entire profile or path than trying to extrude or cut single faces. You can even start from a single quad face and as long as you extrude the entire edge of the profile or path when adding detail, the final mesh will convert easily and accurately to a sculptie.
Loop cuts are the easiest way to add detail into the middle of the surface as this will add a full profile or path line in a single step.
It might seem odd if you've seen Sphere, Cylinder and Torus sculpt types, but all sculpties are really just a plane. The difference is in how the edges of the plane are handled. The following picture shows how the seam on a cylinder places the same profile in two places on the sculpt map.

It's like a square of paper wrapped around a tube so it's ends touch. Cut the seam and flatten out the paper and you are back to the planar surface.
The torus shapes also have a circular profile. When that is rotated around the circular path, the donut shape is formed. This also makes a seam on the path where it is closed together.

The Torus X shape has the path and profile reversed. This only becomes relevant if you intend breaking the path seam to turn the torus into a cylinder.
The sphere's profile is half a circle, so when that is rotated around the circular path, a sphere is formed. In Primstar, we use a cylinder style mesh for the sphere to allow the use of subdivision. The ends of the cylinder are scaled to 0 to form the poles of the sphere.
If you set any sculptie baked in Primstar to a Planar type in SL, it should look just the same as when set to it's proper type. It makes you wonder why we have the other types.
The texture pipeline in Second Life means that only power of two images are supported for sculpt maps. By this I mean that both U and V sizes of the sculpt map are one of these sizes: 8, 16, 32, 64, 128, 256 or 512. Current issues with lossload uploads mean that only width and height combinations that give 4096 or 8192 pixels are supported. These are all the currently supported ratio sizes in Second Life:
1:1 64 x 64
1:2 64 x 128
1:4 32 x 128
1:8 32 x 256
1:16 16 x 256
1:32 16 x 512
1:64 8 x 512
Obviously, you can switch the U and V sizes to use the opposite ratios. Primstar also supports smaller map sizes which limit the maximum number of faces, but these can't be used with Second Life until the lossless upload issues are resolved.
Second Life can display each sculptie at four different levels of detail (LOD). In Primstar, we refer to each of these levels with a number from 0 (lowest detail) to 3 (highest detail). Each LOD has a maximum number of faces that can be displayed:
LOD3: 1024
LOD2: 256
LOD1: 64
LOD0: 36
The distribution of those faces on the surface is directly related to the ratio of the sculpt map. So if we look at the 1:1 ratio at LOD3, we can work out that it is 32 x 32 faces, which gives the 1024 total faces.

If we were using a 2:1 ratio, then we get 46 x 22 faces for a total of 1012 faces. We can't use the exact 2:1 ratio of 46 x 23 faces as that's 1058 faces, more than is allowed at LOD3.

At the opposite end of the LOD range, sculpties have a minimum face count for the path and profile of 4 faces. This means that anything other than the 1:1 ratio map ends up as 4 x 9 faces at LOD0 to make the most of the 36 available faces. This generally means we ignore LOD0 during the modelling and work at LOD1 or higher.
If all this math has confused you, don't worry as Primstar will do the calculations for you. When you add a sculpt mesh, you can adjust the settings for the modelling mesh and see the sculpt map size that will be used, along with the face counts for each LOD level.

The sculpt map is a representation of the 3D surface as an image. This is achieved by converting the X, Y and Z co-ordinates of the mesh into the RGB components of the image. As the sculpt maps supported by Second Life use 1 byte per channel, this limits the mesh to 256 positions in each direction. This means you need to avoid aliasing problems with your modelling. Small faces are much more likely to suffer from aliasing issues as there are less angles available with fewer RGB steps.
A popular way to work on precision sculpties is to scale the object to 2.55 and offset by 1.275 on all 3 axis. This aligns the mesh with Blender's grid from 0.0 to 2.55, so you can model with snapping. Be careful though as the final mesh size should still be 2.55 x 2.55 x 2.55 for the bake to preserve the grid.
One of the ways Primstar provides information about the UV layout for a sculptie is through the Sculptie LOD map. This is a specially designed sculpt map that uses the Z height information (the blue channel) to display how many levels of detail use a particular pixel. The brighter the blue dot, the more LODs use that pixel.

You can get a display of the LOD map by selecting Image - Bake Sculptie LOD while the sculpt map is displayed.

From the Blender menus select Add - Mesh - Sculpt Mesh.

This will show the Primstar Add Sculpt Mesh dialog where you can set exactly what type of sculptie you want to create.

Let's take these options in groups.
![]()
The Shape settings control the basic shape of the mesh. The current shape is displayed in a text control, and there's a file selector icon which you can use to select an existing sculpt map image.

Clicking on the Shape display will popup a list of all the included sculpt mesh shapes.

The first group, above the separator, are mathematically generated. The options below the line are library sculpt maps. These are specially designed 512 x 512 sculpt maps that add variety to the starting shapes. Just click on the one you want, or outside of the popup menu to cancel.
You can add new library sculpt maps to the library folder in the primstar directory as png files. When baking them you should turn Finalise off as you want off vertex pixels to be a part of a continous surface to support odd face counts. You can create new folders in the library to add categories for the sculpt maps.

The Geometry settings control the grid layout of the basic mesh shape. Usually you will set these to the lowest lod that you want to model at. You can see the effect of changing the settings on the Map Info display. If you chose Torus X, Torus Z or a library shape then the radius option will also be enabled.
![]()
The Radius controls the size of the profile of the shape. With a torus, the higher this number the fatter the donut. On library shapes it only has an effect if the shape is based on a torus map. Then it affects the Z height of the shape.
If you set either of the face counts to a non-power of two number, then the clean LODs option will be enabled.

The Clean LODs option is also used as a warning flag when the modelling mesh doesn't match the final sculpties mesh. Most times, enabling Clean LODs will clear the warning. If it doesn't then there is usually another warning box suggesting something else to change.

Sometimes you will want to leave the warning and create the mesh anyway. This has an effect on how the shape is generated as the UV co-ordinates are used as the path and profile values.


If you don't use Clean LODs, you can manually align the UV to the LOD map after creation. Aligning manually to the brighter blue dots will help preserve LOD. You can automatically align to the nearest sculptie point by running UVs - Scripts - Align to Sculpt Map from the UV Image Editor.

The Map Info Display tells us the final size and face counts for the different LODs. The map size is displayed in bold at the top, this is the size of image the sculptie will bake to. So here we can see we are modelling at LOD1 with 8 X faces, 8 Y faces and 2 levels of subdivision.

You can change the Subdivision settings to affect the number of LOD levels above the basic geometry. Any change to the number of levels will update the Map Info Display. Using subdivision has an effect on the mesh shape. If you want the exact shape, set Levels to 0 and set the X Faces and Y Faces to the desired LOD3 face counts. You can bake the sculpt map and use Image - Import as Sculptie to get a multires version of the mesh.

Changing the level will adjust the maximum face counts. Here we've reduced the Levels to 1 and this gives a map size of 32 x 32 and LOD2 and LOD3 are the same. Normally you want this set high enough to get the final sculpt map size you desire.
You can change the type of Subdivision between Multires and Subsurf. This is really a personal preference that will affect the modelling workflow. I normally use subsurf and edge creases to do the initial stages of sculptie modelling. If you prefer working in Blender's sculpt mode, then multires may be a better option. Some people prefer to set levels to 0 and increase the geometry face counts to 32 x 32 to model just with the full LOD3 mesh. Experiment and find which technique suits your style the most.
Changing between Catmull and Simple will set the subdivision to smooth curves or straight lines. For edge crease modelling you'll want to set this to Catmull.
The library shapes tend to respond well to various different geometry and subdivision settings. You can experiment with the different shapes to get a feel for the possibilities.



Currently the Mesh Type is fixed as Quads. This means that each face in the sculpt mesh has 4 edges. The triangle option isn't currently under development but is planned for a future version of Primstar.

When you are happy with the settings, hit the Build button to create your sculpt mesh. Underneath the Build button are two options for saving the current settings. With Save ticked the current settings will be used the next you open the dialog. If you also tick Default the settings will be saved to disk and will be used even after restarting Blender.
Simply select 'Second Life Sculptie' from the "File - Import" menu and choose the sculptie map to import (hint: click filename with middle mouse button to open quickly).
You will be given an options dialog that will let you select the sculptured prim type and the scale (these match the sizes in Second Life®).
The mesh will be imported with 3 multires levels. You can switch between them on the editing panel.
These correspond to the 3 highest levels of detail in Second Life® so you can check how gracefully your sculptie degrades when viewed from a distance.
Placeholder for editing info
UVs - Scripts - Align to Sculpt Map will align the selected faces to every 2nd pixel on the image.
In the UV/Image Editor you can select "UVs - Scripts - Scale to Bounds" to make the UV layout from 0.0 to 1.0 on both U and V.
After baking your sculpt mesh. You can get a multires preview by going to Image - Import as Sculptie in the UV/Image Editor.
While editing a sculpt mesh, you can store an undo point by baking the sculpt map. You can then reset the sculpt mesh vertices to the baked position by going to edit mode, selecting the sculpt mesh you want to reset and using Object - Scripts - Reset Sculpt Mesh.
This is also useful when you have a number of primitives based on the same sculpt map. After baking the primary sculpt mesh, do Object - Scripts - Reset Sculpt Mesh on the others to update their display in Blender.

| Attachment | Size |
|---|---|
| reset_sculpt_mesh.png | 10.15 KB |
In Object select - "Object - Scripts - Sculptify Objects" to convert Blender objects to sculpt meshes. This feature does have limits and works best with curves, nurbs and meshes designed to be sculptified.
This is the fallback method for unwrapping when the mesh includes triangular faces. You can also use it from Blender's unwrap menu in edit mode by pressing the U key and selecting "EAC from View".
Sometimes, it can be useful to set a sculpt mesh from an existing sculpt map. You can do this in edit mode with the Mesh - Scripts - Update from Sculpie option. This will open a file dialog where you can select a sculpt map image file and this will be used to set the vertex positions of the mesh.

| Attachment | Size |
|---|---|
| update_from_sculptie.png | 9.13 KB |
When you have finished editing the mesh, you can create (or update) the sculptie map by selecting Render - Bake Second Life Sculpties from the menus.
You can then set the baking options for the sculptie. Usually the default settings are fine.
Fill Holes will bake over any holes in the UV map.
Normalise maximises the scale of the sculpties to give the finest mesh detail level.
Compressible was a feature request by Aminom Marvin. It basically removes the interpolation on none vertex pixels of the sculpt map.
Clicking OK will update the sculptie maps for all selected meshes. They will use the same scale, so if you want maximum detail only select one mesh before baking.
If you are doing animated sculpties then all objects should have the same centre and any required offset done in mesh edit mode. Select all stages of the animation to bake at the same time.
You can see and save the map images in the UV/Image Editor window.
After saving, the sculptie map is scaled to one Blender Unit (1m in Second Life®) in all three directions. If you prefer the sculptie to keep it's proportions at a sacrifice of some detail, then you can uncheck "Normalise" in the bake options. The console window will have the LSL script commands to recreate the sculpties in SL.
The baker uses the UV map so any object mapped to a full flat square will work. If you have some mesh parts missing, then selecting "Fill Holes" will surface over missing pieces for the sculptie map.
The finalise process can also be performed from the UV/Image Editor with the Image - Finalise Sculptie option.

This performs both the fill and the finalise steps of the sculptie bake.
Edge baked map
The fill does three passes, first on U, then V then a final pass on U.
On the first U pass, any gaps at the edge of the sculpt map are ignored. Only horizontal lines with baked pixels at each end are filled. Any completely blank lines are ignored.
The V pass then fills vertical lines, any gaps at the edge are filled by extending the baked pixels outwards. Any completely blank lines are ignored.
The final U pass fills and extends all lines to the edges.
Filled sculpt map
The finalise step optimises the sculpt map in an LOD protective way. This copies the values from the vertex pixels to adjacent pixels that aren't used by any LOD levels. This gives a map which is more compressable without affecting the stored vertex information.
Finalised sculpt map
When baking sculpt maps for the library, you'll want to disable Finalise and just use Fill in the bake. This is because there are no unused pixels in a library file as depending on the X, Y face counts and other add mesh options, the mesh may be generated from the inbetween pixels.
When baking multiple meshes to a single sculpt map, you should disable fill and finalise until the final object's bake. The baker uses the alpha channel of the sculpt map to store state information, and this needs maintaining during multiple bakes.
Simply select "Second Life LSL" from the "File - Export" menu and choose a directory to export to.
This will save the selected sculptie's map and texture plus a short LSL script to recreate the prim inworld.
In Second Life®, upload the .tga files from the directory. Create a new prim and edit the contents. Add the .tga files to the contents. Create a "New Script" in the contents and edit it.
In a text editor open the .LSL file, select all and copy.
Go back to Second Life® and select all the script then paste the script you copied from the text editor over it. Save the script and it will run and turn the prim into the sculptie you exported from Blender.
The following features are currently only available in the development release and / or the git repository:
The scripts are now officially called "Primstar"
You can now select whether to use multires or a subsurf modifier for LOD levels
The correct sculpt map size is automatically created as per VWR-9384
This adjusts the UV mapping for optimal LOD handling. Even odd face counts work!
Wrapped edges on sculpties are marked as seams
Can be created by:
Each linkset consists of a single LSL script plus sculpt maps and textures
This new option in the UV Image editor creates a UV mapping assistance grid. The brighter the blue dots, the more LODs use that pixel.
Sculpties are imported as per VWR-9384
Wrapped edges on sculpties are marked as seams
This maintains the sculpties center. It is useful for doors etc
This makes clearing of the sculptie map optional. It is useful for double sided planes
This renders a psuedo 3D model of the sculptie to the alpha channel
The RGB range for baking can be set independantly of the object scale
The sculptie UV layer can be assigned to multiple images.
More accurate sculpt maps
Image - Import as Sculptie. This new menu option imports baked maps without needing to save them first
The current development scripts are available from a git repository.
To setup a local copy go to the base directory where you want the scripts and run the following command:
git clone http://dominodesigns.info/git/primstar.git
If you have a clone of the old repository, just edit .git/config and change the url variable to http://dominodesigns.info/git/primstar.git
In future to get the latest scripts, go into the primstar directory and run the following command:
git pull
If you want your own branch to hack on just run:
git branch myNewBranchName
To switch to using your new branch run:
git checkout myNewBranchName
To revert to the official scripts run:
git checkout master
To merge updates from the main scripts to your scripts run:
git merge master
You may need to use rebase if you have edited scripts that have since been updated:
git rebase master myNewBranchName
The following features are at various stages of planning and initial coding:
Support for setting texture rotation, offset and scale on sculpties UVTex.
Support for other types of primitives
Support avatar mesh and skeleton import
Please help support development of the scripts and use the donate button.