PBR Materials for Second Life: Introducing PBR Materials Texture Changer scripts for builders!!!!

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey everybody it's bandor and I'm here again to do another video on PBR materials so it's a very exciting thing PBR has finally been released uh onto the second life Grid it's on every Sim now uh but currently it only works in a few different viewers so it works in the released version of the second life viewer it also works in alchemy and it works in an alpha or maybe they're calling it a beta now I'm not sure release of Firestorm so it's not in the main release of Firestorm but you can pretty easily get to the Alpha version of it um there's a group you have to join I'll try and post that into uh in the comments so you just join that group and you can download the link from their notices uh to download the alpha or beta version that has it and I'm using the beta version right now that's what you see here on screen uh the Alpha version It's Alpha version yes it says up on the screen screen Alpha 64.7 point0 point1 72562 this is from November 25th I believe is when it came out so there may be a more current version available than that but that's the one I'm using right now uh and everything seems to work the normal stuff from Firestorm seems to work just like you would expect it to work the only one difference that I've noticed is when you edit something so you right click on it to edit it uh it doesn't just edit it there's two choices you either can edit the material directly or you can edit the object so if you want to edit the object to get this panel you have to click that extra interstitial button but that's the only thing I've really noticed that's oops as I slam into my microphone that's the only thing I've ever I've noticed so far that's really different so it works and behaves just like the regular Firestorm and I'm not having any issues but it does PBR so you can see in this view this uh cabinet and this bed I'm I'm working on a Murphy bed that bed actually it's going to fold up into the cabinet that part's not working right now I'm just working on doing some texturing for it and it's going to have these side cabinets that go with it so I'm I'm doing all of this directly in substance painter you could do it in blender or there's other programs as well that allow you to create materials and Export them as gltf which is the format that you need to export them for um to import them into second life that is the PBR physically based r rendering materials that is if you didn't have a PBR capable viewer like the current second life or the Alpha version of Firestorm or Alchemy and you were just in regular Firestorm or something else this would just look like plywood you wouldn't be able to see these textures but because I'm using the PBR capable version you can actually see it has a lot of detail it has a lot of Reflections it looks pretty gorgeous and then if you look at the the actual stuff on the bed over here it's even more incredible look at the reflectiveness of this the highly polished Reflections and everything that you see here um and this is done with PBR materials and it's so simple and so so easy to do and the output is amazing so um the one problem I ran into though was yeah okay so I can import these PBR materials and I can apply them to my furniture but when I sell a piece of furniture um I don't sell it with just one wood texture and one bedding texture I want to be able to sell it to my customers with a bunch of different wood options so you may have 10 or 10 or more different styles of wood to choose from I I want to do it with a bunch of different bedding options with different styles or different patterns different colors different color themes so that my customers have choices and they can make it work better with uh with their own home and some of those texture choices I leave uh blank so that the customers can then colorize it however they want to the problem with that is there's no PBR texture changer available in second life right now so on the old system I use a texture changer from a vendor that I bought that allows me to apply multiple different textures to the object export that data put it in a note card and then put the note cards into the furniture and then people when they click on it they get a menu of those choices and they can pick the different textures like they could pick oak or pine or walnut or cherry for the woods or they could pick black blue orange green or whatever for the different bedding options that would be provided for them and so that doesn't exist in Second Life now be for PBR materials so I created it I said okay I I went to a couple of vendors who make them asked and I didn't get responses and I really needed this right away so so I've gone ahead and created my own system for doing it so as you can see here um on this cabinet for example let's look at the cabinet if I click on the cabinet I get a menu that pops up and it says dump data that's that's the first part of this which we're not going to be talking about right now uh I'll show you that in a minute the the and that when I'm when I ship this to my customers it won't have that in it that'll be gone so you won't see that so you'll click basically and this menu will come up and it says select select from the menu U one of the materials and here you go these are the different wood materials that I have rad dendron white Maple Oak palisander black pink Darkness gold edged antique AO and black so let's pick one let's pick Maple and there you go you see the texture changed just like it would with a regular texture changer I'm going to remove that script so it doesn't keep popping up data dump okay so now when I click that won't pop up anymore okay so pick wood and then let's pick uh gold edged so you can see it's wood with some gold at the very edges it looks kind of cool like the edges are worn down let's pick a different one let's try antique let try black pink because I think that looks kind of cool black pink Tada great so I have that same script in in this piece too but let's go ahead and take it out for now data dump I don't need it and then let's put the uh let's do the texture changer on this so click it now I have two choices I have wood and bedding so let's pick wood let's do the same one black pink and of course nothing happens what if I do a maple that works didn't black pink work oh there it goes for some reason didn't work the first time but it worked this time interesting anyway so there it is let me try another one just to make sure wood gold edged wood go back to the black pink I call it black pink because it's black and pink and I didn't want to put and in there um so it's a black wood with pink edges and then let's change some of the bedding click it click bedding and we're going to do uh blue quilted there you go there's I have a light shining on this that's what this line right here is it's from this there's a invisible light over here shining down to you can see the light reflecting here so that's the blue quilted if I want to change it pick bedding and we'll go to Gold see it's pretty quick I might have a mistake in there do it again it looks like I have a mistake in one of my files that I need to change so when I get to that part of the menu the working on the menuing part I can show you we can fix it let's try a diff different one do silk okay this is the option I called Silk and the the names are arbitrary I make them up so you'll be able to make them up and be whatever you want okay so you can see it actually is changing the the textures it's not it's not textures anymore they're materials so it's actually changing the PBR material for this and so what is a PBR material on here if you edit your object and you go to the T texture tab you'll see under material you have option of textures you click on that drop down you'll see there's textures PBR metallic roughness and media textures is what they're Firestorm is choosing to call the old way in the second life viewer it doesn't say textures here it says blind Fong b l i n n- p h o n g which is the name given by the industry to that style of using the diffuse normal and specular textures to do materials the new way is called PBR which stands for physically based rendering materials so this is PBR metallic roughness that's the type of um materials that second life uses and so if I pick that you can see there's this it doesn't show an image now I'm hoping that at some point in the future it will actually show an image here um but it looks a lot like you would do today you just take U whatever you want the material to be here and you drop it in so uh I'm going to show you how to do that in a second so the first thing this is just showing is that I do have a texture changer that generates a menu so it gives us the different menu of in this case I have a menu for wood and I have a menu for bedding if I wanted to have a different menu that was just the pillows I could do that or just the sheets I could do that or if I wanted one that does everything all together and call it theme I could have that menu as well so whatever menus you want to have right now it only supports one level of menus so if you want to have submenus I haven't I don't haven't doing that today but that's something that I'm going to be working on the version today is just one level of menus but it does allow you to have multiple menus okay and then uh when you pick it it shows you the list of your different text options and those are from the note cards that we create um but I do something different with note cards so once you use the note card you you don't have to keep it and I'll show you about that in a minute so let's go let's pick uh White there you go so you can see the texture changer is actually working now let's uh talk about the other scripts so my system is going to consist of three scripts so one is the runtime script that you use to actually let the user pick and change the textures that's the one we've just been looking at there is one other script that I give you that allows you to generate the texture changer note cards from the materials that you have applied to your product so I'm going to um upload a new set of materials for the bed and then I'll show you how to how we're going to create the note cards for that so let's switch over to Adobe substance painter so this is substance painter this is the new material set that I've created for the bedding it's a it's going to go with that black pink Uh Wood I think so it's kind of a pinkish purple pattern here for the pillows the back two pillows the blanket the sheets um all have this kind of purple color which I based it's a linen cloth pattern but the color of it comes from sampling the colors here in this image so uh you can do that in substance painter and so I'll show you if I can get back to there it is so for example on pillow one which is this pillow in the back let's I want to look at pillow three pillow three is this pillow here in the front so if you scroll down in the information you see this color all I did was come here and it gives you this little popup and there's eye dropper so I used that ey dropper and then I just sampled this color and it changed it to that color and then I I did this thing called instantiate where you can instantiate across texture sets so I instantiated this across these other purple pieces and it applied the same material to all four pieces so I didn't have to go to each one and change it uh I also did that with my pillows as long as it has the information is the same you can instantiate it so if you use the same material the same colors the same tiling rotation whatever uh you can then instantiate it to other parts of your model and uh saves you some time so what's important here is how I how I named things so I have saved this substance painter file and I've called it Murphy bed final because this is this is the Murphy bed so I've called it Murphy bed final um in this case it's actually the bedding right it's not the whole Murphy bed so why don't I rename this I'm going to call this um Murphy bed bedding because it's just the bedding did it is it renaming it should rename it oh it's it's doing it it's a little slow okay I don't know what it doesn't look like saved it there it goes okay change the name up here that's what I was waiting for was to change the name here so now it's called Murphy bed- bedding that's the name of this substance Panner file then up here in your texture set list these are the names of the materials which correspond to the parts of the bed so I made sure when I named my materials in blender that I named them for the part of the bed that they're going to go on so I have in this model more things than just this bedding I actually have everything that's why I called it final I just had them turned off you can see the cabinets here the the cabinet for the bed is here and this extra cabinet which I don't use is there but this is the panel that will be here when it's closed so this is kind of the closed version this is the open version so I'm texturing them all at the same time but I don't actually use this cabinet I just use this panel um so yeah I don't like calling this a bding now that I think about it because it has everything in it so that's conf using so let's just go back to the other the other name which was Final let's just keep it like that but I could if I wanted to if I knew I was only going to be exporting parts of the model I could rename the save and then it'll carry over into my output that's that's one of the cool things about substance painter other than being slow I think it's slow because I got so much stuff going going on on my computer there we go all right um to reiterate that point this when I export my IM my materials for use in Second Life the name of that material is going to be based on a combination of things it's going to be based on this name that you give it here when you save your substance painter file and the the part that's being worked on or the actual material and so if you wanted to have your name be meaningful in Second Life say for example if I'm exporting everything then this name would make sense right but if I am only just going to be importing the bedding then I might want to do a save as beforehand and save it as the name I like the name I Ed where I called it bedding because that would be more meaningful in Second Life right but for now it's fine because it's not that bad I think I think we'll survive so this is what I'm exporting um but I don't care about these so we won't actually export the wood we're only going to export the bedding so you just go to file export texture and then you make sure that in your output template you select gltf PBR metallic roughness that's that's the outp put that we want it to be in the format we want it in to be in and then I don't need the bed base I don't need bed base closed I need bed cabinet I don't need cabinet and I don't need leg the only Parts I want are the blanket which in Second Life for some reason I called comforter but I should have probably called it blanket but there only one thing I did that way so it's not confusing if I renamed everything it would be it would be so so confusing I I wouldn't be able to figure it out so try to be consistent so I I have the names blanket mattress pillow one pillow two pillow three pillow four and sheets and that corresponds to blanket pillow one pillow two pillow three pillow four sheet and Mattress all right so I didn't actually export that so let's go ahead and Export it I will hit export it's going to do some work it's going to generate all the output and then it's going to dump them out and it dumps them out into a directory called export so now we go back to Second Life and now I'm going to import that you just go to build and since I'm want to import all of those materials that I just created at one time we're going to do a bulk import so go to build upload bulk and then in the drop down over here for all files we want to select gltf files and here we go these are the ones that are in here so I called this second life project I called it Murphy bed final not this is what I used to call it final I hope but now it's called final so the there's two different files that show up here um how do you know which one to open it's they have the same symbol they're both GL one is a gltf and the other one is a glb we don't use glb we only use gltf well looking at it here doesn't tell me which one's which the only way I know is by the size so if you look at this one you says the size is 240 kiloby or sorry 24 kilobytes and the size of this one is 85 megabytes that's the one we want to use it's always the bigger one you can see down here this one was 24 kilobytes and this one was 85.6 megabytes so this is the one I would have used but this is the one I want to use because it's the same name that I saved my substance painter file as and that's the one I want so that's my that's kind of like a zip file for materials that's what this gltf is it's kind of a zip file for materials so you click on that to open it and then it takes it a little bit think it's analyzing what's inside there and it's going to come up with a popup oh no it's actually importing all of them so it's just there's no popup if I was just doing one material it would come up with a popup and then in that drop down on that popup I would select which of the sub materials like the pillow one pillow two pillow three that I wanted to export it and I would be doing them one at a time um since I did bulk import it's importing them all so let's go ahead and see where it's putting them so puts them in your inventory in a new folder called materials and here they are Murphy bed final Murphy bed final Murphy bed final so that's the ones in they're still coming see but then in parentheses it puts the name of the material from substance painter which was in my my texture set list the the names that I had applied that's what's in parentheses here so the this naming structure is from substance painter and the first part is the name of the substance painter file that I saved it as and the parentheses is the texture set item or the material part in substance painter so that makes it very easy to figure out where these things go and what they apply to so if I come over to my bed right let's take a look at my bed and let's just apply these to it so it's not difficult to do literally drag and drop so I take Murphy bed final sheets and I drop it on the sheet part I take the one called pillow four and I put it on pillow number four pillow three I put it on pillow three pillow two I put it on pillow two pillow one I put it on pillow one mattress goes on the mattress part and blanket goes on the blanket part which in Second Life I actually called comforter right so that's all that's involved in texturing it isn't that easy so dropping that one thing thing on here it basically drops several different things into second life for us u in the old system that would be things like your diffused texture your normal for your bumpiness and a specular for shininess the new system uses some different things it uses base base material it does use a norm it uses uh roughness metallic roughness it uses emissive Maps it uses a few different Maps than the old system but you can see I didn't have to worry about that I didn't have to put each one on I just took this one thing and dropped it on the part and it applied all of them for me automatically and it looks really really good um so that's how you get the texture on to the furniture well and that that's the limit of what SL will do for us now this is where my texture changer comes in so I want to I provided a script and it's called PBR materials data dump version 1. is the version I'm on right now so you just edit this object go to contents and then just drag this PBR material data dump script into the object okay and then this is my I I have all of my owner messages routed to debug um if you don't do that they'll show up in nearby chat and I have them coming over here to a special debug window but for you they might show up in near in local chat or nearby chat so all you do is you click this and then it comes up with a menu that says dump data click dump data and then it outputs all of this information right here um you don't need to worry about this this is just uh I think this is debug information that I should probably turn off but uh and it won't it won't be on in the final version so you just get this dump out which has the time stamp and then it has um a bunch of rows of information well this is the material information for each of the parts of this piece of furniture so this piece of furniture has a part called the bed cabinet it has a part called the bed base it has this part over here which I'm calling B bed base closed and then it has the parts for the bed pillow one pillow two pillow three pillow four which I named P1 P2 P3 and four it has a mattress it has the sheet and instead of calling it blanket I called it comforter and you can see that here and then I precede each of those words with PBR semicolon so you can see PBR semicolon bed cabinet PBR semicolon mattress so it actually went through this part by part and dumped out this information for me now where did it get this information you have to put it into the object in the description field so if I do edit link and I click on the blanket down here and I look at the description it just says playing 18 you can make that be whatever you want but down here in the description field it says PBR semicolon comforter that is where this comes from in here and as far as my script is concerned this can be anything you want you can call this whatever you want I I suggest put PBR semicolon in front of it so that you know it's um it's a material it's it's for the material so um that's the format that I recommend but you don't have to follow that but so put PBR semicolon and then put some word that is Meaningful for the part so I should have said blanket I said comforter I could change it but I've already created all of the files for this and I've already saved all the data so I'm not going to change it I'm going to leave it at comfortable comforter but it just shows it doesn't matter what you put here the system doesn't care you can call it whatever it just has to be unique you can't use the same name well that's not true it doesn't have to be unique if the material is the same so for like for example the wood I only have one wood material and that one wood material includes all of the different parts that's the way I built the model I wanted to have it so that it was easy to maintain so um I put the UV maps for all of these different parts of this wood which are separate uh it's a link set but they're actually separate pieces I was going to make it one piece and I just never got around to doing it so each part of them it has its own separate material but I in in a blender you just name them the same so I call this material uh bed cabinet so I I name this bed cabinet and when I put a material here I use the same bed cabinet material I use the same bed cabinet material same bed cabinet material on all of the wood parts except for the bed base which I call bed base and this one over here which is the same thing as this but the closed version which is going to sit in this hole when the bed is in closed state so I call that bed base closed so my bed has three wooden Parts it has everything in the cabinet which I call bed cabinet it has the bed base down here in the open state which I just call bed base and then I have the bed base over here in the closed state which I call bed base closed so those are the three things and then I have P1 P2 P3 P4 sheet mattress and I called it comforter and so that's all you do is you just go through each of those and you apply that name into each one so for the ones that have the same material like all of the wood pieces in in this cabinet have the same material then I give it the same name so you can see this is called PBR bed cabinet and I gave this one the same description PBR bed cabinet PBR bed cabinet PBR bed cabinet and then there's a piece down here at the very bottom underneath everything it's PBR bed cabinet but for the two pieces of wood that are different it says PBR bed base this one says PBR bed base closed doesn't matter about uppercase lowercase it doesn't matter about anything except you cannot use uh comma and you I think that's it I think you just can't use a comma anything else I think is okay oh no you can't use a pipe symbol you can't use a vertical pipe and you can't use a comma so don't use either of those two characters and anything else is fine so whatever you want to call it should be okay um so that's the first step first step is you have to name all of the parts so go ahead and set up all of the names and if the part uses the same material give it the same name once you've done that you drop this PBR material data dump script into your object and again you just click it and hit data dump or or dump data and it dumps this information out and so then you just take all of this and we're going to copy that and paste into a note card well I have my note cards uh down here and I'm going to add a add a new one so in my Murphy bed I have a bunch of note cards down here that I'm working on so um so I'm going to add an I'm just going to copy one of the ones that I had so let's some find this is for the bed I had I have note cards down here for both the cabinet uh and the bed so let's find one that was for the bed and since I'm doing the bedding I'll take this one for the blue quilted I'll copy it and I'm going to paste it and then we'll talk about the structure of the name of the note card for these so these are your material note cards for the texture changer and this is going to store information about what materials we have applied the part name and all that and so I'm going to rename this one to um let's just call that that purple haze why not so we're going to call that bedding Purple Haze now the structure of the name that you use for the note card is is very specific so the first part of it you have to have PBR in uppercase PBR colon it looks for that on the note cards and if that's not there it won't do it so the note card must begin with capital P capital r uh B sorry capital P capital b capital r colon PB R colon after that it's kind of up to you the first parameter needs to be um something that uniquely identifies this from other parts that you're working on um and and you need this it does you can put whatever you want to here in this case I put bed because I the other one is called cabinet so I have a cabinet and a bed that I'm working on so I call this one bed um I was originally going to use this in the menu but I decided to not put it in the menu um and there's reasons why there's reasons why I made these choices it it it's more convenient for you to see this and know oh this note card is for the bed and that note card is for the cabinet if you didn't have this word word in the name of the note card and you were just looking at a bunch of note cards you wouldn't know which note card goes to which part so having the name in The N note card name makes it easier for you later on to figure out which um note card goes to which part now you could be as fancy here as you want you could call it Murphy bed bed something like that um or whatever I just call it bed and then I put a as I put an aster at the end of that because I was originally I thought it was going to be a menu but um it ends up not being a menu so the asri asteris is helpful if it's a menu so that when you when the menus are displayed it displays that Aster it shows that it's a it's a menu to the user so but you can put whatever you want in in here it doesn't really matter but they're separated by colons so there's four parameters and they're separated by colons so the first parameter is PBR uppercase and then a colon the second parameter is a is a name for the thing that contains the materials in this case it's the bed the other one is called cabinet you don't have to put in asteris at the end of that if you don't want to I did but it doesn't matter then a colon all right so we have PBR Oops why is it putting zeros in there is I hit the zero key screwing everything up all right so the first parameter is PBR R colon the next one I have is bed asterisk and then a colon okay the next two parameters are what Define your menu and the menu item or the actual name of the material theme that you're creating so the first one is the menu so I want this to be in the bedding menu so I call it bedding b e d d i n g and then I put an asterisk so that in the menu there's an asterisk so people see that they know it's a menu versus a menu item uh right now we can't we don't allow combining them in this version of the script you can't have menu items and a menu in the same menu just eventually I will but right now for this version It's You Can't and there's only one level of menu so you can't go another menu Colin another menu colon another menu colon you will eventually but right now right now I don't do that so right now it's only one level of menus so this is bedding asteron and then what do you want the menu item to be that's going to give you the user the choice to pick this texture so B what's the name of this texture set or this theme so I call it Purple Haze so again four parameters first one is PBR colon second one is a name for the the device or the thing or the object in this case it's bed first one is the menu so this is a bedding this means everything in here is the bedding versus the the wood and then the last one is what do you want people to pick from the menu to choose this set of textures which I'm calling it Purple Haze okay so that's the naming structure for that once you have it named open it and then since I copied it it's already got it's already got the old information in here I can delete that then come back to this output from the dump data or do it again if you want to and just copy everything it came out I'll probably put something like a a line above it and a line after that says delete you know copy everything after this line and before the next one I'll probably put something like that um but for me I didn't have it so copy that paste it into your note card and then you need to get rid of everything before the PBR so just delete everything from the P to the beginning of the line and do that for every line you have don't delete anything else and you don't need blank lines between each line oops three more three two one okay now when it generates this it's going link by link inside of that link set and so this link set had I think 16 16 parts to it the bed and so it created one line for each of each part of the link set if you have different textures on different faces on that part it would also generate one line for each face but on this model I'm using um all sides so I'm putting one one material on all of the faces of that there's really only one face so um it uses the all sides face and so it's only it puts one material on the whole part so it's only going to it's only going to generate one line but if if I had multiple faces I can do that with this and it will generate one line for each face and the syntax of this will we'll explain that to you in just a second um we'll reflect that okay now an interesting thing to note is well let's talk about the syntax of this first so let's just break one of these down and and I'll show you the syntax so um there the first parameter is this that is the description on the part so whatever you put in that part description that's what's going to show up here so you can call it whatever you want to call it and that's going to show up here it just needs to be meaningful to you I like to put PBR in front of it so that I know it's from uh hang on my TV kicked in and it's pretty loud I'm going to go turn that off so you don't have to listen to it sorry there's people in my house today and they're turning the TVs on I let them know that I'm doing a video but somehow TVs got turned on and then everybody leaves and the TVs are still on and it interferes and it's a problem because I did a video one day and I spent spent several hours working on a video and then I posted it and it got blocked because in the background there was like a movie on and it recognized the movie and I got a dcma strike against it so I don't want that to happen again anyway all right where were we oh yeah these syntax so the first parameter here and these parameters are separated by um the pipe symbol which is this vertical pipe symbol here um so the first parameter is whatever you put in the description on that part the second description is the face number um but if you're if you're using one texture for the whole part I.E what we call the all sides uh you put a zero zero means face number zero but all sides is actually it's a negative one so don't ask me it's a negative one but in the in the code but put a zero so um if you're if you're just using one material for the whole thing not the whole object but the whole face on that individually linked part um like I did you saw I just dragged one I dragged it on the pillow I dragged it on the other pillow I dragged it on the blanket I dragged I didn't go to like um the pillow and put three different textures on the pillow on three different parts of the pillow right I didn't do that um because you can have you know like something like six or eight faces on an object and you can have a different material on each of those faces so in my model I didn't make it that way uh I made it so that every in every part of the model has only one face so you use zero in that case and then a pipe and then the third parameter is the uuid or key of the material that is applied currently applied or not currently but when you ran the dump the material that you had applied at that point is what gets dumped out here so my material texture my material changer doesn't deal with anything other than the material that you apply so if you change the parameters like you you change how intense something is or you change the um any of the drop downs or dials or switches or whatever you you you did you manipulated it in some way in Second Life I don't capture any of that right now I will eventually but I just made this quick down and dirty so it just gets the material idea it's like which material did you put on here okay that's what we're going to change uh if you want something more complicated I'll have to spend more time on the script and build it but right now no one's asked for that and I don't need it uh because I never deal with those things when I make furniture I just take I do all my work in substance painter to get the the material to look the way I want and then I just drop it on the object um So eventually I may expand this to have more parameters but for right now it's just the material so again the four parameters three sorry three parameters the first parameter is the description of the linked part the second description is zero if you have one material for the whole linked part or the face number if you have multiple faces with separate materials and then the third is The UU ID of the actual material file that was applied now you don't need to know what the uu ID is you don't have to look it up the system generates it for you um it just has to be in your inventory not the object it doesn't have to be in the object it just has to be in your inventory and you have to like be the owner of it I think there might be a restriction that it has to be full perm but I'm not 100% sure on that one I haven't checked it um if you want to distribute these things maybe it does have to be full perm I I don't know we'll figure that out as as we go but um but that's what it is so this is the uuid of the texture or the material in my inventory now it generated this data for me but let's say I wanted to change it so yeah you know that's the wrong material I don't want that material in there I could then I could go back and reapply the material and then reapply the script and then click it and do dump data get this information copy it and put it back into the note card I could do all that or if I have the material and I know what the material is I can simply go to the material which is right here and in this case let's say I wanted to do the blanket right so if I wanted to put it I wanted to get update this with a different blanket material like I wanted to use this one all I got to do is come here in my inventory find the one I want right click it copy the uuid and then I can come up here and find the line for the blanket which in this case is comforter change this and then paste and I'm not going to do that but I will paste it right here so you can see it see there it is right there 871 32025 and that's the same number as this 87130 so so it is the right U ID but I didn't have to do that I could have constructed this note card completely manually right I could go into the note card and say okay I know what my parts are I have four parts and I know they're named this so I'm going to list them put the first one the second one the third one the fourth one I know they all use zero so put zero on all of them and then I I have the textures right here so here's the first one copy paste here's the second one copy paste here's the third one copy I could very quickly and easily manually generate these but this script saves you that time saves you the time of manually creating that's all it's really doing so again you put the PBR data load data dump what's it called PBR material data dump script you put that into your object you click the object it generates this output you copy the output into this note card delete everything before PBR and then save it okay then once you save it just edit your object go find the the note card that we just had which is down here it's called PBR bed bedding Purple Haze drop that into your object now because I have my second script or third script in this the third script I have also in here that script now runs and I'll tell you about that one now so we're done with the we're done with the data dump script so I can actually delete the data dump script but I'll wait and do that in a minute I'll go ahead and get rid of it I don't need it in there so I don't want it to run all right so uh I'm still not ready to run because I have I have created my note card I put my note card sorry created my note card and I put my note card in here and I have my runtime script which is the PBR material texture changes script but there's a piece that's missing and that is um I actually don't like note cards and I don't want to have to read note cards at runtime while I'm running I prefer that all this information gets stored in memory and recently Second Life created a thing called link set data so it's abbreviated LSD like the drug but it's not a drug but it does get you high um link set data is a persistent data store in an object that's a key value database inside of an object and it's persistent so I can um reset scripts on the object and the memory is the the data is still there I can restart the Sim I can log out I can log back in and the data will still be there so what I do is I have a script called the PBR material LSD loader and what this does is it reads all these note cards it builds my menus and it takes the data from the note cards about the materials and and sticks it in a database and so that script is in my in in my object and anytime there's a change to the inventory in here in this directory anytime there's a change that script will rerun and reload this data so while I'm working as a builder while I'm working on this furniture and I'm making changes to it and I'm applying new texture nothing happens but once I create that new note card and then I drop that new note card in here this script detects that I did that and will automatically upload the upload those changes to the database and it first thing it does is it wipes the database so it just deletes the entire database and then it reconstructs the database from the note cards that are in here so you don't want to delete your note cards until you're absolutely done and you don't have to delete the note cards ever you could leave the note cards in here and ship the product you can leave this LSD loader script in here and ship the product it won't interfere with anything it won't conflict with anything and anytime there are changes made to this it will reload them but for a finished product that you're ready to put out to Market you actually can run this script and once the scripts finishes it tells you it's over here running and then it loaded and it loaded up the material so once it's done with that you can delete the the material LSD loader script and you can delete all of these note cards from the object maybe you don't want to put them out there where people can see them maybe you just want to uh keep them on your development version but you don't want them in production you don't want want them going out to your customers so you can delete them because the runtime script doesn't use them it never looks at these note cards it actually looks at the data that's in the LSD database um but you cannot run this script if you haven't loaded the data because I didn't make it so that it I don't want this texture changer script reading the note cards that's slow it's just not it's just not efficient so so you have to actually do this at least once you have to load the data and then you can get rid of these if you want to and I probably will when I'm ready to ship this to a customer I'll probably delete all these and the only thing that'll be in here is this texture changer script um but for now it's really convenient because I can make changes I can go in here and edit this I can make a change to a different material say I put the wrong one in there like I have that's a good example remember we saw one that was wrong which one was it blue quilted let's let's do that now so here you go Blue quilted let's go to bedding blue quilted and I think pillow okay it wasn't blue quilted anybody remember which one it was gold yep P1 on gold didn't change right so okay let's go ah here and we're going to edit this and let's go down to beding gold and here we go P1 for beding gold and then I'm going to go down to my materials bedding gold right here and I'm going to find pillow one there's pillow one I'm going to copy it and then I just come in here and I go to pillow one and paste it and I hope it's not e651 E7 it is weird why H this might be this might be the wrong file so I may have a different problem because I just pasted it and it came out the same says could not find render material I don't I don't know if that's a bug or not okay don't know why what's going on with that one I may have to troubleshoot this more but let's because I know that error comes if it can't find the note card or if the note card's empty but note card is there so let's try let's go to purple heads that works and then let's do it again try gold yeah for some reason there's something wrong with this that doesn't work so I'm going okay how do I fix that well I go back to here and then for P1 which is pillow one just turn the gold on and then go export export textures then I can turn off everything it doesn't matter cuz I can turn off everything just do the pillow one export then go back to Second Life build upload material this time instead of doing bulk I'm just going to do the one it's still in the same file name Murphy bed final then it's going to try to open that and then I do save since I only had the one material in there there's only one so it should come out into my materials folder there this one that's the one I just uploaded so I'm going to cut that from here I'm going to go back down into here and I'm going to paste it in here then now we'll get rid of this one now I will copy its uu ID and I'll go in here to beding gold and overwrite that with this [Music] new come it has the same it has the same that's impossible it cannot have the same I can't have the same uu ID it's a different item I deleted the one that was in here right so that would be in my trash it's not there okay let's go back to my materials let's try it again I'm going to upload it and I'm going to rename it because I don't know what it it's doing build upload material from here I'm going to do save as and I'm going to call it test H one and then let's see what happens it has to have a different EU ID because it's it's a different part why has it got the same U that's impossible see that one has a different one that has a different ID that has a different U ID why does this have the same U ID it has the same uu ID as apart from all right so this is not a problem with my scripts this is not a problem with anything this is a weird problem with SL right now something is going on where it's generating multiple objects these are completely different objects I'll I'll upload it again build upload material this one we'll do save as and we'll call it test pillow 2 so now it's a different object so there's two separate objects and they have the same uu ID that's not possible that's just weird okay well anyway so let's not worry about that problem for now I can't solve world hunger though I don't know why that is just that's mindboggling I'm going to spend some time trying to figure that out but that's mindboggling um needless to say that's not going to work if it has the same uu ID and I bet you that what is that is that the same as the blue [Music] one I'm not going to close this just minimize it well no it's a purple one in there now I don't think that's a valid uid and that's why it's it's giving me this error because it can't find it's looking for the material with that uu ID and it can't find that uu ID huh how that is mindboggling it's not everything in my brain says this is not possible okay but it did so anyway uh if I figure that out I'll let you know why it's doing that but until I can figure that out um this gold material isn't working right what happens if I apply that directly let me try doing that yeah it's gold oh dumb dumb well for one thing that's not pillow one that's pillow one so I just put that pillow material on here so I don't want pillow one anyway I want pillow well why do it got the [Music] same oh well partially is I'm an I'm being an idiot I want that I don't want to change that pillow one because that's pillow one gold okay so pillow one is right that's what I want that is the gold pillow so it saved me what I want is pillow three right so let me go back to here maybe that's what oh that's what's going on okay it's doing exactly what it's supposed to do I'm exporting pillow one I didn't export pillow three I okay duh all right so this is not pillow one that I want gold it's pillow three that I want gold so pillow three needs to be gold there we go now if I export instead of pillow one let's export the right pillow okay now let me go in here and build upload material and we will save it and it should come up and say pillow three this time okay I'm going to go ahead and drop it on the pillow just to test it make sure it's right it is correct that is the right texture then let's go ahead and copy it uid and let's edit it into that note card pillow three please don't be 0204 then I really will freak out huh it's not 0204 but it's 204 I wonder if that why would it be the same but anyway not going to worry about that but maybe there was a leading Zero by mistake okay save it let's try to run it oh it's it takes a couple seconds when you make any changes at all when you have the um when you have my script in there the U LSD loader script whenever you have a that script in your furniture and you make a change like that and save something it reruns it and until you get this message you you it's not going to work doesn't break anything it's just not going to it's not going to do what you think until it finishes loading so it finished loading so now I can run it let's go to bedding we'll pick a different bedding now let's go back pick [Music] gold and still doesn't work and it gives this message okay there's some kind of problem here with this I don't know what the problem is I have no idea what the problem is with that but I will try and figure it out because that material something about material for that pillow is not right and I have no idea why only for this one texture set yeah I don't know anyway so that's what it is that's how it works sort of except for this one problem um I'm probably not going to release this until I have this problem fixed but anyway I want to go ahead and get this video up and out so people can look at it anyway that's the way the texture Chang is working right now so you can change textures you can oh I have I'm gonna turn debug off I think I have debug on no I don't oh I I was in a hurry yesterday when I wrote my debug script and I forgot to put if debug that so debug was on no matter what all right so now debug is off let me check the other one to make sure this one actually does check it okay bding blue quilted okay just don't choose my gold material and everything else works so you can see it's changing the textures so again to reiterate my material changer is going to come with three scripts the first script um is used to dump out the data for the materials that you have on the object so that you can create a note card the second script takes the information from the name of the note card and the contents of the note card generates the menus and stores the data in a persistent database inside of the object from which point you can then remove those scripts and remove the note cards and you don't need them anymore and then the third script is the runtime script that reads the data from the database and will change the give the menu to the user and then change the textures based on what they pick from the menus so it's working pretty well it's working it's working well enough for me to get my job done and then I can make changes to it I don't know why this one isn't working I'll try and figure that out and if I do I'll either post an update or I will put a note in the video comments but I'm going to go ahead and post this video so that you guys can can check this out if you want copies of these scripts let me know I can work with you on that I will be putting them out once they're once they're ready I will be putting them up on sale and cheaply we'll be two versions there'll be a version for individual users to use for their personal use and then there will be uh a version for Builders it won't be full perm because uh I won't they won't be modified you won't be able to read the scripts but you'll be able to use them I'm also gonna I'm also going to be adding apis to allow you to do some interesting things with the scripts for example um I'm going to have a state on this bed open and closed and when the bed is um open it's going to look like this but when the bed is closed I actually want I want this to be physically located here right I'm going to move it and then what'll happen is when it's um in the open State this will be hidden and when it's in the closed State it'll be shown and these will be hidden and um they're using textures so I need to make sure that I don't show you the textures for the wrong part at the wrong time so I'm going to have a script that will say okay if this flag is set don't show these textures which the base script doesn't have that today but I I'll be adding that so you'll be able to do stuff like that um I'm also going to have an API to do things so you can do stuff like I want to have so this this cabinet and this cabinet have the same wood textures right it would be nice if I don't have to go to both of them and change them because if uh I could have a master and a slave so I'll I'll be setting it up so that you can put uh you can put this into the slave mode and then whenever you make a change here it will hear that change and it will change to the corresponding wood so whenever this calls Wood Oak it's going to say on a certain channel it's going to say Wood Oak this thing will be listening and we'll see that aha I was told to change the Wood Oak and it will adjust so that will be part of it too it's not part of it right now but it will be part of it so there'll be some things like that coming with it too that will be good for Builders to be able to take advantage of but that's going to be in the more advanced version which will be down the road so the basic version just because nobody has one out there and you can't if you're a builder you can't put stuff out there if you can't make changes to your textures so I'm putting this out I'll I'll probably put it out today with the caveat that there might be something wrong with it because I don't know why that one's not working and if anybody can tell me why it's not working please do anyway uh that's it for this video I will talk to you guys later uh with more stuff coming so
Info
Channel: Bandor Tyrell
Views: 1,250
Rating: undefined out of 5
Keywords: pbr, materials, second life, adobe, substance, painter, building
Id: -8lvbPSwHFk
Channel Id: undefined
Length: 68min 10sec (4090 seconds)
Published: Sun Dec 10 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.