Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Baking Prim through exports.

Immortal Crumb
Registered User
Join date: 12 Feb 2009
Posts: 5
08-05-2009 19:07
Hi,

I'd like to know if anyones come up with a way to export PRIMS from second life or the render data or some form of information to be opened up in 3DS/MAYA/XSI or any other program to bake the textures.

My method involved building an object, selecting different colors for each object, attaching one face of the building to my hud to snapshot, open up in photosohop to edit shadows on and such, then use texcalculator to get the offset values. But this is a very tedious and frustrating process that require some time. The whole purpose of this is to save prims but still get a realistic look on textures. It shouldn't be a compromise to have great detail but at the cost of using up all the prims on your land when all it takes is some creativity.

Please ask question if you need further explaining on what I'm talking about.
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
08-05-2009 19:16
I tend to go the other way around. I'll build a scene in Maya first, making sure to use geometry that I know will translate well to SL, and I'll bake out the textures. Then I simply rebuild the same scene in SL, apply all the textures, and adjust repeats & offsets accordingly.

I actually wouldn't want to port prims from SL to Maya, since it would make for incredible texture inefficiency. I don't want to bake 4 textures for a 40-meter wall, for example. I'd rather bake one texture on a 10x40 plane, and then divvy it up accordingly in-world.
_____________________
.

Land now available for rent in Indigo. Low rates. Quiet, low-lag mainland sim with good neighbors. IM me in-world if you're interested.
Immortal Crumb
Registered User
Join date: 12 Feb 2009
Posts: 5
08-05-2009 19:32
From: Chosen Few
Then I simply rebuild the same scene in SL, apply all the textures, and adjust repeats & offsets accordingly.



How do you adjust the repeats & offsets accordingly when you apply the textures? Is there any method or do you just tune the values until it looks "right".

Then I want to know about when you bake the textures then export the images. Is it one image per object or does maya make a image for each side of the object you bake?

By the way, where do I go to see some of the objects you've created with this method?
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
08-05-2009 21:49
From: Immortal Crumb
How do you adjust the repeats & offsets accordingly when you apply the textures? Is there any method or do you just tune the values until it looks "right".


Of course there's a method. It's simple math. :)

To stick with that 10x40M wall example, here's how to calculate the repeats:

1. For the repeats, each of the four 10x10M sections would get 1/4 of the texture in one dimension, and 100% of the texture in the other. So the repeats would be 0.25, and 1.

2. For the offsets, each section needs to be a multiple 0.25 in one direction, and just 1 in the other dimension. For the .25's, we know that the no object is in the exact center of the wall, so there can be no offset of zero in that dimension. The border between the two innermost sections is the center, which means, each section has to be offset by half of the repeat value, 0.125. The two outer sections then each need to add another 0.25, in order to align properly with the inner ones. So the values we end up with are -0.375, -0.125, 0.125, and 0.375.

Alternatively, you can use a script to automate the alignment process, such as TexFix or EasyTexture, as long as the surfaces are coplanar. For non-planar objects, it has to be done by hand.



From: Immortal Crumb
Then I want to know about when you bake the textures then export the images. Is it one image per object or does maya make a image for each side of the object you bake?


It depends on the build. For that wall example, I'd simply make one texture for the visible surface. Assuming there will be a floor underneath, a ceiling overhead, and three more walls enclosing the space, then four or five of the six sides of each cube won't be visible. There's no point in baking textures for those. I'll just create one plane in Maya for the interior surface, and if necessary, another for the exterior. That's it.

For a cube in which all six sides would be visible, I'll create a polygonal cube in Maya, and UV it so that all six sides end up in a reasonable configuration on the canvas. That's assuming I don't need a large texture on each side, of course. If I need six 512x512's or 1024x1024's (both of which would be exceedingly rare occurrences), then I would of course need to make more than one texture.

From: Immortal Crumb
By the way, where do I go to see some of the objects you've created with this method?


I'll save you a trip. Here are some screenshots.


Below is a post modern lecture hall I created for a client. Sorry, but I can't say who it is (NDA). It's actually part of a set, but I can't photograph the rest, since to do so would show parts of the build that the public isn't supposed to see. This was really the only angle I could safely get.

Note, the surface the building is sitting on is their creation, not mine. Also, unfortunately they deleted most of my interior shading. When the building was first made, there were really nice shadows on the floor and walls. The playfully repetitive angles of the wall sections, skylights, and window muntins were designed specifically for that purpose. But now, only the exterior shading remains intact. Oh well. There's still enough there to make it a pretty good example of the technique.




Next we have an homage to the honeymoon suite from Superman II. It felt appropriate, considering the name of the sim it's on, North Pole.



I'm actually not thrilled with how the floor came out on that one. But the client liked it, and I wasn't about to argue.



This torture chamber, also from the North Pole sim, was made by a friend/colleague I subcontracted to help me finish a few things I didn't have time to do. He did an outstanding job, I think, using the exact same technique we've been discussing.





More in the next post...
_____________________
.

Land now available for rent in Indigo. Low rates. Quiet, low-lag mainland sim with good neighbors. IM me in-world if you're interested.
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
08-05-2009 21:53
This is an outdoor amphitheater I've used and reused many times, for many different builds. This particular instance of it is on the AFCEA sim. The seats are sculpted, and the structure is regular prims.





And here's an oldie, but a goodie. I created this a few years back for a machinima piece, shown at CES by Les Moonves of CBS, and Phillip Rosedale of LL, during the CBS keynote address. The texturing was done entirely by hand in Photoshop, rather than automated in Maya, but the principles are exactly the same. Careful consideration was given to where all the various light sources are and how they interact with each other, what casts a shadow onto what, etc., in accordance with reference photos from the original, some plain old common sense, and a healthy degree of dramatic exaggeration.



If you're wondering, the reason I didn't use Maya for this was twofold. First, I only had 4 days to do the build, so I didn't really have time to build it twice. I also had zero room for error. I couldn't chance any rendering delays. Second, this was well before sculpties had even been thought of, let alone brought into existence, so using third party 3D apps in conjunction with SL was pretty much unheard of. It hadn't even occurred to most people yet to try. While it had occurred to me, I hadn't yet done much to develop my techniques.

It was 80 hours of work to faithfully replicate the entire bridge, including all 1100+ buttons, 70+ unique video screens, the full lighting scheme, etc., all in 4 days. Needless to say, my sleep schedule was screwed up for months after that. But hey, how often do you get to have your work shown by the presidents of CBS and LL, at the most important tech-related event of the year? I wasn't about to take any prisoners on that one.



That should be enough to give you a glimpse of what's possible. Remember, all that's important are the surfaces you can actually see. Don't worry about all the hidden faces. They're nothing but a waste of time.
_____________________
.

Land now available for rent in Indigo. Low rates. Quiet, low-lag mainland sim with good neighbors. IM me in-world if you're interested.
Terminus Serpente
Registered User
Join date: 6 Aug 2009
Posts: 6
08-06-2009 14:28
To answer your original question, there's Prim Composer http://liferain.com/downloads/primcomposer/ which allows your choice of transferring prim data and textures (that you own) to and from 3ds Max to Second Life or Open Sim.

Parts of Prim Composer are based off of an older Blender script which allowed one way transfers of prim data from Blender to Second Life. I can't remember the name of that script at the moment, but I believe it hasn't been updated in a while.
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
08-06-2009 16:02
It was prims.blender, one of Jeffrey Gomez's many ingenious creations. :) It's still available in the scripting forum.

I've heard great things about Prim Composer. I'm just not a Max user, so I can't speak intelligently on it myself.

If price is no object, the loose equivalent for Maya is called SLTK Pro. It costs around US$800, depending on the current Japanese exchange rate. It looks like it would be really handy, and could easily pay for itself in its first use, but I can't bring myself to spend that much with an overseas company I've never otherwise heard of, without knowing anything about their customer service track record. I'd love to give them the benefit of the doubt, but it's hard to take unnecessary risks in this economy. $800 is a lot more valuable to me these days than it was a couple years ago, I'm sorry to say.

I actually tried to hire someone to create a similar system per my own specifications, which I would then make available to the community for next to nothing until my costs were recovered, and then likely for free after that. But I couldn't find anyone who knew both LSL and MEL well enough. The offer's still on the table if there are any takers.
_____________________
.

Land now available for rent in Indigo. Low rates. Quiet, low-lag mainland sim with good neighbors. IM me in-world if you're interested.
Terminus Serpente
Registered User
Join date: 6 Aug 2009
Posts: 6
08-06-2009 17:27
Yes that was it. Thank you Chosen.

The Blender prim creation interface is a Python script that allows prim creation in Blender. Like I said, I don't think it's been updated in a bit, so the latest prim options, like slice, wouldn't be there. Also, when I used it there were issues with certain operations, like dimples or twists (can't remember which), coming into SL with the values inverted. I don't know if that ever got fixed. It was strictly one way too. That is, you could not bring prim information from SL into Blender to bake your textures. You either have to author it in Blender first, or recreate it by hand.

Prim Composer is free, but of course 3DS Max is not. I didn't mention that previously, but Chosen posting the cost of the Maya version reminded me I should perhaps mention this. And, like I said, and it acts both ways. That is, you can do a build using the SL interface, bring it into 3ds Max via Prim Composer, bake textures, and then upload back into SL, or even transfer it into an Open Sim server. It's pretty flexible in that regard. Naturally you need to have all the correct permissions in order to bring SL data into Max. The download consists of Max Macroscripts for Prim and Sculptie creation, and a standalone .exe that gets invoked via command line to upload or download your assets. There are also several example sculptie maps. The programmer, Shack Dougal, has made several video tutorials covering a wide variety of subjects, from basic setup all the way to installing Open Sim and mySQL so you can have a nice SL type sandbox right on your own computer!

Still, as Chosen has beautifully shown, none of these are strictly necessary for creating eye catching textures or baking in your 3D application. All that takes is some hard work, a little bit of number crunching, and a good eye for details.