Home › Forums › Programming › Generate New Materials
- This topic has 18 replies, 2 voices, and was last updated 1 year, 4 months ago by kdv.
-
AuthorPosts
-
2023-08-10 at 10:22 am #65926David DuperronCustomer
Hi again,
I would like to apply different basic wireframe materials (only the color would change) to copies of a base object (a simple circle), that are create on the fly by puzzles, according to a list.
Basically I have{{object_01, #123456}, {object_02, #456789}}
and I would like to create a circle with the name “object_01” and assign a nem wireframe material with the color “#123456”, same for “object_02”, etc…
Can I do this with puzzles, or some javascrip script that would run inside puzzles?
Thanks for the help!David
2023-08-10 at 10:32 am #65927kdvParticipantPuzzles and JS coding. Fast and expensive.
If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.
2023-08-10 at 11:01 am #65929David DuperronCustomerHi!
Thank you again, that is quite simple indeed… However, ideally I would like to have only the outer circle line (i.e. draw only a circle, not have the center vertex and the radiuses lines…).
I imagine that the “clone object” puzzle will have the cloned object share the same material and I won’t be able to affect a single material per object.
Do you see a way to clone a base circle (without the radiuses) and still be able to control it’s own material?Cheers
David
2023-08-10 at 11:02 am #65930kdvParticipantideally I would like to have only the outer circle line
impossible. any geometry is always triangulated. n-gons are not allowed in THREE.js, triangles only.
Or you can use a texture of a circle…
Puzzles and JS coding. Fast and expensive.
If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.
2023-08-10 at 11:46 am #65936David DuperronCustomer2023-08-10 at 11:51 am #65939kdvParticipantLine rendering uses “MeshLineMaterial”. You can’t access its properties in Puzzles.
Puzzles and JS coding. Fast and expensive.
If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.
2023-08-10 at 12:01 pm #65942David DuperronCustomerI’m pretty shure there is a solution to get what I need.
Perhaps using helpers like the “polar grid helper” on GlifTek’s helpers plugin, which I alos bought, but I am facing another issue with this one, as I cannot find how to control the added helper (move/snap to another object…) once added, and GlifTek is not providing any answer yet…
I manage to create exactly what I need (a single circle, with a color as defined in my list), but the helper sticks to the world’s origin, and I can see no mean to move it… :(- This reply was modified 1 year, 4 months ago by David Duperron.
2023-08-10 at 12:13 pm #65944kdvParticipantThe solution is as simple as two fingers…
I cannot find how to control the added helper (move/snap to another object…)
They have no names. That’s why they are not visible in puzzles.
Puzzles and JS coding. Fast and expensive.
If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.
2023-08-10 at 12:32 pm #65947David DuperronCustomerOk, but this will not work with a pure “line” object, like my circle which does not have any face, and is rendered uniquely when the “line rendering” option is ticked, am I right?
2023-08-10 at 12:35 pm #65948kdvParticipantWhy not?
https://v3d.net/mraPuzzles and JS coding. Fast and expensive.
If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.
2023-08-10 at 12:54 pm #65950David DuperronCustomerbut how do you set-up the original circle object in Blender? no material assigned? No “line rendering” option ticked? If I do so, I don’t see anything in the scene once duplicated…
Sorry for these questions if they seem dumb…2023-08-10 at 1:02 pm #65952kdvParticipantJust exported the circle with the “Line rendering” option enabled. Nothing unusual.
Puzzles and JS coding. Fast and expensive.
If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.
2023-08-10 at 2:00 pm #65960David DuperronCustomerI can’t make your puzzles work! :(
first I don’t have your “rename object” puzzle, and I always get an error message
Uncaught ReferenceError: clonedObject is not defined
Here is my Puzzle configuration for a very simple scene where I have a Circle exported with line rendering option as you mention.
I’m lost… again…2023-08-10 at 2:10 pm #65961David DuperronCustomercorrection:
I HAVE this puzzle, as I bought your plugin package and it’s included in it… So now the puzzles work and the object is copied, BUT, the material is cloned and both circles now have the same color (the one which is defined in the exec script puzzle)…
2023-08-10 at 2:12 pm #65962David DuperronCustomerCorrection #2
I also have your “clone object” that I was not using, and which solves this issue! No precise idea of what is done differently, but well… it’s working!
You’re great, thanks again… -
AuthorPosts
- You must be logged in to reply to this topic.