Home › Forums › Programming › Fadeout for objects
- This topic has 13 replies, 4 voices, and was last updated 4 years, 8 months ago by Yuri Kovelenov.
-
AuthorPosts
-
2020-02-20 at 10:07 am #23740muggaParticipant
Is it possible to fade out and object with puzzle/js function?
The only way I would know of at the moment is, exporting a variable for the used material on the object which controls the opacity/transparency.
2020-02-20 at 10:52 am #23748Yuri KovelenovStaff2020-02-20 at 3:23 pm #23776muggaParticipantOkay. Is there another maybe simpler possibility to do a fadeout?
On a pure programmatically way, instead of “re-exporting” the 3d file with proper setup material?2020-02-21 at 10:39 am #23805Yuri KovelenovStaffsure, you can use the animate param puzzle (or the underlying JavaScript) for that
https://www.soft8soft.com/docs/manual/en/puzzles/Animation.html#animate_param2020-02-21 at 2:59 pm #23820muggaParticipantBut how you do that? I havent seen anything like transparency. In order to change a value, I have to first set it in 3d.
Maybe to be more clear of what I would like to achieve. I would like to fadeout a group or an object with just using javascript. Just as simple as in jquery for example would be great:
$("#object").fadeOut();
2020-03-03 at 11:09 am #24189webCustomerI would also be interested in a simple way of fading out geometry/objects programmatically. Without setting up objects with proper material settings in 3d
2020-03-03 at 12:59 pm #24200Yuri KovelenovStaff2020-03-03 at 5:11 pm #24221webCustomerFor “object” I can just insert the name of the 3d object, correct?
When I’m doing it this way I just get javascript error “cannot set property ‘transparent’ of undefined”
2020-03-04 at 10:20 am #24260Yuri KovelenovStaff2020-03-06 at 9:19 am #24396webCustomerDoesnt work for me. Tried it on directly in the “prepareExternalInterface” with the code how you wrote:
var object = app.scene.getObjectByName("Testgeo"); object.material.transparent = true; object.material.opacity = 0.5;
And also tried it the way I would like to have it:
Custom functions in my “visuallogic.js”function fadeGeo(objectName){ objectName.material.transparent = true; objectName.material.opacity = 0.5; }
And execute it in my “normal app js” in “prepareExternalInterface”:
v3d.puzzles.procedures.fadeGeo("Testgeo");
2020-03-06 at 1:09 pm #24411Yuri KovelenovStaff2020-03-07 at 4:22 am #24446GLiFTeKCustomerhi Web.
I’ve been wrestling with this one for quite a long time.
I’ve come up with a number of workarounds.since there’s no “entire object opacity” .. (yet..grumble..)..
ahem…
one path is to make the entire object ONE MATERIAL.. and use RGB paint values to differentiate subsets of the material that act as different materials.like here…
actually sorry I’m afraid to post a link since the forum ritually erases my posts when i post links .
https://www.soft8soft.com/docs/manual/en/introduction/Optimizing-WebGL-performance.html#Vertex_Colors
…so look in the VERTEX COLORS section of the “Optimization Techniques” of the user manual. there’s a lot of power in that.
when done like that.. you can use one value node to determine the opacity of the entire object if it’s all one material.
i even went so far as to create an elaborate dynamic conditional if/then node network that takes RGB values.. converts them to RGBA values through a recommended formula then gives you freedom to use 25 or so decimal values of each channel (r/g/b/.. for different material nodes.. so it’s quite a range.I’ve been meaning to post that on github for people to use.. it’s been on the back burner while i get other things taken care of before needing it..
I’m actually delving back into it now so I’ll put it up soon.
ANOTHER WAY is.. one thing that myself and a few others have requested and are psyched that it’s here in v3d v3… is the OBJECT option in the Texture Coordinate node.
using spherical (radial) texture to parse transparency, you can fade an entire object with multiple materials.
i forgot how i did it.. and will have to dig it up ..doing that NOW actually…
because i need it now…
it’s using an empty that is linked to all the material’s transparency controlling values.. and when the empty is moved.. ALL the transparencies adjust at once..similar to what you see in Branden’s moving image in this link… (not hot linking cuz forum) …
I’ll keep you updated as i rummage through my old experiments (hope i named them easy to identify…) cuz this is a challenge I’ve been repeatedly coming back to as i have MANY objects that all need to fade all at once.
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-03-07 at 4:24 am #24448GLiFTeKCustomeryup/.. and i just wrote a huge post and it’s gone…
i cannot believe this. it was a page long.
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-03-09 at 9:31 am #24495Yuri KovelenovStaff -
AuthorPosts
- You must be logged in to reply to this topic.