Home › Forums › Graphics / Blender › Multiple Objects, Same Material, Different Textures??
- This topic has 21 replies, 4 voices, and was last updated 4 years, 6 months ago by Yuri Kovelenov.
-
AuthorPosts
-
2020-04-20 at 6:03 am #26087GLiFTeKCustomer
hi
I have many (hundreds) of objects with the same (exact) material setup, except ONE thing…they all have unique logos on them. (diff image file loaded in image texture node)can i load that one scene with that template setup many times.. (as many as needed for the current user session)…
then somehow designate and use puzzles to load a different image texture into each one?
somehow use variables to differentiate the repeated material?maybe if i load the template scene once then clone, then before the next clone is made, change the texture.. then go on.. without changing the texture for every instance of the material’s use?
gotta be a workaround…
thnx
Visit the GLIFTEK Verge3D Plugins Store!
GLIFTEK.com for Plugin Documentation & LIVE DEMOS!
LIKE The GLIFTEK Facebook Page for updates!
Join the Verge 3D Discord Server!
plz share Discord link & on your signature!2020-04-20 at 7:07 am #26104Mikhail LuzyaninStaffYes you can even load scenes with empty textures in the materials and them replace them multiple times and reuse them on different objects. To optimize this process you can use procedures, and load csv with list wich will containt links to the textures.
Co-founder and lead graphics specialist at Soft8Soft.
2020-04-20 at 8:00 am #26121GLiFTeKCustomerYes you can even load scenes with empty textures in the materials and them replace them multiple times and reuse them on different objects. To optimize this process you can use procedures, and load csv with list wich will containt links to the textures.
Ok cool..
So, to get this straight…
I can have ONE object in a scene that I append into my main scene…That one object, has ONE material…
I can load it in many times to make many copies of the SAME object..with the SAME material…
Then I can have a DIFFERENT TEXTURE loaded into EACH COPY of that ONE object with that ONE material?
Visit the GLIFTEK Verge3D Plugins Store!
GLIFTEK.com for Plugin Documentation & LIVE DEMOS!
LIKE The GLIFTEK Facebook Page for updates!
Join the Verge 3D Discord Server!
plz share Discord link & on your signature!2020-04-20 at 8:14 am #26127Mikhail LuzyaninStaffYes, because you will load them multiple times they will have different names like object.001, material.001 and etc, so you will need to deal with that carefully.
Co-founder and lead graphics specialist at Soft8Soft.
2020-04-20 at 8:20 am #26130GLiFTeKCustomerYes, because you will load them multiple times they will have different names like object.001, material.001 and etc, so you will need to deal with that carefully.
Ok great. Didn’t know it made new material name.
So will this take advantage of having ONE material, as in memory?
Or is each material copy am entirely new one,as if an entirely different material is used?
Is it actually re-using the same material?
That’s why I’m doing this.
(Just being extra sure)
Thanks.Visit the GLIFTEK Verge3D Plugins Store!
GLIFTEK.com for Plugin Documentation & LIVE DEMOS!
LIKE The GLIFTEK Facebook Page for updates!
Join the Verge 3D Discord Server!
plz share Discord link & on your signature!2020-04-20 at 8:28 am #26132Mikhail LuzyaninStaffOk great. Didn’t know it made new material name.
So will this take advantage of having ONE material, as in memory?
Or is each material copy am entirely new one,as if an entirely different material is used?If you will load it with Load Scene puzzle this will always create a new copy of the material because load puzzle didn’t know anything about already loaded material and this will create a hige amount of the material in the scene. Even if they would’s be unique you couldn’t change texture in one without influence on another copy. So if you need to have copy of one material with different textures in in you need to have multiple independent copies of this material which mean to have them all loaded in a memory as different materials.
Co-founder and lead graphics specialist at Soft8Soft.
2020-04-20 at 1:27 pm #26168GLiFTeKCustomerwill the same things you’re’ talking about happen with cloning an object instead of loading it?
Visit the GLIFTEK Verge3D Plugins Store!
GLIFTEK.com for Plugin Documentation & LIVE DEMOS!
LIKE The GLIFTEK Facebook Page for updates!
Join the Verge 3D Discord Server!
plz share Discord link & on your signature!2020-04-20 at 7:49 pm #26202GLiFTeKCustomeri’m finding that loading the same scene 5-6 times just has the object that comes in be written over.. no iterations ie: object.001 etc ..
that’s happening with CLONING.. but i don’t see any new objects come in when append the same scene multiple times in a loop…
is there any way to RENAME an object once it’s loaded?? like maybe while it’s loading in the “on progress” option in append scene?
then i could rename each one one with a 001 002 etc?
Visit the GLIFTEK Verge3D Plugins Store!
GLIFTEK.com for Plugin Documentation & LIVE DEMOS!
LIKE The GLIFTEK Facebook Page for updates!
Join the Verge 3D Discord Server!
plz share Discord link & on your signature!2020-04-21 at 7:25 am #26223Alexander KovelenovStaffHi,
for now you can rename your objects with JavaScript only. See this guide for more info.2020-04-21 at 11:41 pm #26310GLiFTeKCustomerHi, for now you can rename your objects with JavaScript only. See this guide for more info.
call me blind, but i cannot see where on that page it shows the JS code to rename an object.
I see in the dev manual how to give a variable the value of an object…
ie:var object1 = new v3d.Object3D();
is that what you’re meaning?
Thanks
Visit the GLIFTEK Verge3D Plugins Store!
GLIFTEK.com for Plugin Documentation & LIVE DEMOS!
LIKE The GLIFTEK Facebook Page for updates!
Join the Verge 3D Discord Server!
plz share Discord link & on your signature!2020-04-22 at 8:18 am #26335Yuri KovelenovStaff2020-04-22 at 10:20 am #26352GLiFTeKCustomertry this:
myObj.name = 'newName';
Perfecto!
Thnx!
Yuuuuurrr-great!Visit the GLIFTEK Verge3D Plugins Store!
GLIFTEK.com for Plugin Documentation & LIVE DEMOS!
LIKE The GLIFTEK Facebook Page for updates!
Join the Verge 3D Discord Server!
plz share Discord link & on your signature!2020-05-01 at 4:08 am #27031GLiFTeKCustomertry this:
myObj.name = 'newName';
now, that works for a string in the single quotes, however, for it to be used dynamically, i have:
app.ExternalInterface.changeObjectName = function(myObj, newName) { myObj.name = newName; console.log (myObj.name) };
with a JS call with myObj and newName as inputs from changing variables each time in a loop.
that should work, i feel.. however, i get this error:
“TypeError: can’t assign to property “name” on “blank_object_001″: not an object”(blank_object_00* are 6 objects that need renaming.)
I understand i’m feeding it a variable that points to an object, though I think the syntax has issue with delivering that.
EDIT:
tried:app.ExternalInterface.changeObjectName = function(myObj, newName) { var obj = app.scene.getObjectByName(myObj) obj.name = newName; console.log (obj.name) };
which i thought would seal the deal, but now get:
“TypeError: obj is undefined”
…but it IS…
hmmVisit the GLIFTEK Verge3D Plugins Store!
GLIFTEK.com for Plugin Documentation & LIVE DEMOS!
LIKE The GLIFTEK Facebook Page for updates!
Join the Verge 3D Discord Server!
plz share Discord link & on your signature!2020-05-01 at 6:10 am #27046Yuri KovelenovStaff2020-05-01 at 9:37 am #27052GLiFTeKCustomerobj is undefined
cause it’s myObj, not obj
k so a facsimile of that worked..
app.ExternalInterface.changeMyObjectName = function(obj,newName) { var myObj = app.scene.getObjectByName(obj) myObj.name = newName; console.log (myObj.name) };
but only after a previous process (texture replacement process) ..
NOT WITHIN it’s “when ready do” slot” (which i had it in)..Visit the GLIFTEK Verge3D Plugins Store!
GLIFTEK.com for Plugin Documentation & LIVE DEMOS!
LIKE The GLIFTEK Facebook Page for updates!
Join the Verge 3D Discord Server!
plz share Discord link & on your signature! -
AuthorPosts
- You must be logged in to reply to this topic.