NURBS2Sculpty for Primstar (beta)

Hi.
I have updated my NURBS2Sculpty converter for usage with primstar.
In the attachment you find the distribution. It is organised in its own folder (named jass). The jass-folder must be placed right besides primstar in the user scripts directory (see note below).
After installation you find the nurbs2sculpty script in blender under
Object -> Scripts -> nurbs2sculpty (1.5)
very short usage instruction:
- Create a standard NURBS (add -> mesh -> surface -> NURBS...)
- Sculpt your NURBS
- go to object-mode
- execute Object -> Scripts -> nurbs2sculpty (1.5)
Now you have a primstar compatible sculpt mesh and can proceed as with all other sculpt meshes created by primstar.
Current caveats:
- All sculpt-images created for NURBS are of size 64*64 with 32 bits depth
- The sculpt-map is always named "nurbs.nnn" by default where nnn is a number generated by blender.
- The resulting sculptmap will have no hints about where the seams are.
NOTE: Domino, i would appreciate if you take a look on the script. Please tell me if i should implement things differently and remind, that i am somewhat slow
Also if you decide to add the scripts to your distribution, it may be a good idea to keep the jass folder intact and separate ? I would not mind if you fully incorporate the scripts into jass, but having it like this might make it clearer where the borders are ? And on top of this people can decide to just install your primstar folder, or add the jass-folder when desired/needed ...
Any feedback is appreciated as always 
| Attachment | Size |
|---|---|
| nurbs2sculpty-1.5.zip | 13.8 KB |

The readme contains an
The readme contains an obsolete initial note, which slipped through during my edit.
Nurbs Changes
The latest git version of Primstar has any issues pep8 and pyflakes report cleaned up. This is one thing that will need doing with the nurbs scripts. Also I think the UV wrap should have Clean LODs so that the nurbs surface is more accurately baked. There may be a better way to do the unwrap as well. Knowing that we are dealing with a grid style mesh, we should be able to work out the UV just with a bit of math on the vertex counts.
There's a few pep8 naming convention issues too which the pep8 test script doesn't report.
Along with the required changes you've already mentioned, this is a significant amout of coding. I'm happy to take it from here or help you work through it. Let me know which path you want to take.
Certainly i want to make this
Certainly i want to make this one by myself as otherwise i could not any longer advertise the NURBS2Sculpty script as my own add on to primstar
. So again here are some questions in order to proceed:
Ooops...
I already started on a cleaner integration. There's a new branch in git called nurbs with it in.
I've fixed a few bugs - scaling, rotation, now works with oblongs. Works on selected objects rather than active only.
I've also found another problem, if you add a nurbs donut, then in edit mode add a nurbs surface, you end up with the nurbs equivalent of a joined mesh. The conversion works but all ends up on a single sculpt map. This will cause problems with sculptify, and as it would be a useful feature to have, we need to think how to support it properly.
You can install pyflakes and pep8 with easy_install
then just use them with
At least, that's how it goes on Linux. You might need to specific the full path and .py extension on Windows.
I'm going to look at doing the clean LODs step during sculptify as it might be useful to support it on obj imports too.
What do you mean by "I
What do you mean by "I already started on a cleaner integration" ? And what have oblongs, scaling and rotation to do with NURBS ? Maybe you can publish the git statement which i should use to take a look at the new nurbs branch ? Is the script still recognizable or have you allready reimplemented it ;-) ?
Cleaner integration
By cleaner integration, I mean bringing the code style into line with the rest of Primstar.
To get the branch the first time do
You should then be able to switch branches with
Object mode scaling and rotation were lost during the nurbs to sculptie conversion. Oblongs - well with the nurbs branch: Add a nurbs donut, set Resol U to 2 and Resol V to 16. Go to object mode and do Object - Scripts - Nurbs to Sculpt Mesh. Go into edit mode and take a look at the UV layout and image assigned to it. That's why oblong and nurbs do mix
If you want to see what I've changed, use gitk to examine the commits or git blame to check the author of each line.
aha!!! Ok, that looks good
aha!!!
Ok, that looks good
Let me see if i can add the seams display by myself...
nurbs.py
I've finished the integration of the object_sculptify.py script (it got renamed again). I've merged the nurbs conversion into sculptify so it's just a single call. nurbs.py still needs cleaning up for pep8 and I think that any improvements to the conversion will be in that script now. I've pushed the changes to the nurbs branch in git.
There is still a problem with joined nurbs, I was wrong about them unwrapping correctly, so that needs looking at. The uvcalc routine will need to be island aware for that. The standard UV Seams from Islands script has code you can use as a reference. I don't think it'll work without changes though. Joined nurbs would have edges at the seams aligned on the UV map, so a UV map based island detection would fail unless it allows for those cases.
Finding the islands and their edges is the same task you need to mark seams. So I'd get the island finder working first. Just ask if you get stuck.
nurbs.py renamed
It's now uv_tools.py to more accurately reflect what it does.
Sculptify Object
Sorry about this Gaia, but I saw how useful your code was and just ran with it for awhile. I've committed another change to the nurbs branch in git. This time I've moved eac_unwrap into the uv_tools script, and it now uses it as a fallback unwrapper if the active quads fails.
Once you've played with it a bit, you'll see why I made it work (even if only to give a very crude sculptie) with pretty much any mesh. Some (like Suzanne) it'll make a mess of, though still somewhat recognisable. But where it shines is when the model is made of a quad grid.
Add a Mesh - Empty Mesh. Go to front view in edit mode. Hold down ctrl and left click at one side of the center to draw a profile of the sculptie, say a vase. Use the spin tool set to 360 degrees and 16 points from the top view. Remove doubles on the mesh and add a subsurf modifier set to catmull. Set edge crease on bottom of vase to 1.0 if you want a flat base. Now comes the magic.
Go to object mode and do Object - Scripts - Sculptify Objects. Some objects won't automatically work out the sculpt map size, so check the sculptie UV map has an image and that it's the size you want. Once the map is correct you can bake as normal.
Amazing!!! if i understand
Amazing!!!
if i understand you correctly, now we can in principle say, that we could create sculpties from almost arbitrary meshes (when they are made out of quads) ? But that will boost up primstar to the top top top ...
)) Please let me make the first tutorial for that one!
So i am glad that i somehow i have "triggered your brain" ;-) As i would have never come to such a solution. I will check it out on monday. Before that i will be veryyyy busy with helping the machinimatrix team to survive the 48hour film contest which runs this weekend.
cheers, Gaia
Good luck!
Good luck in the contest!
It's best to stay grid shaped, though I was using Suzanne and the default cube in my tests. The further away from a grid you get, the worse the conversion will be. Any triangles in the mesh will force the unwrap to eac which is very limited in what it can do.
Oh and you just read the first tutorial
feature test: plane
Been doing some tests, it works great. Here's a little and quick example, from add > plane to sculpty terrain.
Started with a plane added Subdiv., Multi, modeled in Sculpt Mode > Object > Scripts > Sculptify Objects then New image 64x64, baked, done.
Also been playing with box modeling using the mirror modifier from cube to sculpty, the grid factor is something to keep into account while using this new feature as Domino mentioned, and I believe with some knowledge in UV manipulation the results are absolutely better. Oh forgotten, tried oblongs too, and it worked.
Great job, guys. I'm proud of you two.
feature test: curves
Been messing on the new feature, again, this time playing with curves, works brightly.
feature test: circle
This is my last test on this new feature, what can I say it's great... Obviously flexible, simple and yet so powerful.
I remember when Domino asked me if I was testing on it, my answer was: uhm no, I actually didn't, I'm not a NURBS fan at all to be honest, gladly I followed his advice and started to try it out. Even I found NURBS can be a lot of fun. But the feature now days goes further and that's what called my attention.
Coming up this time with a hollowed cylinder made of a default circle, yeah. For those willing to try it out here are the steps I walked through to get it done: add > circle (the default is ok) then do a Extrude, scale, align, after that add a Loop Cut in the middle, (use the .blend file I up-loaded as a reference). Last but not least (in Object Mode) Object > Scripts > Sculptify Objects. It's wise to go back to Edit Mode and check if everything looks ok, now you should be ready for the baking process. Ending with an oblong, cute and colorful, RGB map.
If you are a new Blender user willing to try it I encourage you to read and watch the video-tutorials mentioned in this thread it's a couple months old but the contained resources are a nice (and basic) start for those new users after the flavourly taste of knowledge.
After years reading and watching and listening people wondering and asking ways to reach good results I tell you, knowledge, yes, knowledge, without knowledge reaching good results is a dead end.
One of the of factors to focus on if you want to success, in any aspect of your life, is self-education-discipline.
Well... it was my last test on this new feature! Time to move on!
Redoing Sculptify
Nice examples
If anyone wants to see what part the Sculptify has done in these tests, you can delete the "sculptie" uv layer on the grey object then run Object - Scripts - Sculptify Objects on it. The green objects show the results of a bake and import of the sculptified object.
Thanks, Domino
Thanks, Domino, for the compliment and for coming up with the development of such an useful feature. Thanks to Gaia too for providing NURBS2Sculpty in the beginning, making this new feature possible.
Some information, I missed to mention while commenting the tests:
1) In the curves test I used Bezier Curves.
2) In my last test if you Set Smooth to the original mesh, the one with a FastShader like material, you will notice there's a glitch related to the Normals, however, it's not affecting the final result.
3) The reason these models might not look quite the same once in SL: blame the lossless bug, it's been talked here starting the conversation with that comment, read the comments that follows to get the information and possible workarounds.
That's all.
Post new comment