SpEcIeS Posted March 20, 2016 Posted March 20, 2016 Created a script this morning to load a cylinder with an attached script, however the material does not seem to load for the cylinder, or a cone, shaped CSG. Spheres and boxes load without issue. Not really sure why the materials are not loading, but I am hoping someone could clear this up. function Script:Use(entity) local bottle = Model:Cylinder() local material = Material:Load("Materials/Developer/bluegrid.mat") bottle:SetMaterial(material) bottle:SetScale(0.15,0.65,0.15) bottle:SetPosition(-4.4,1.6,1.9) local shape = Shape:Cylinder() bottle:SetShape(shape) bottle:SetMass(1) bottle:SetScript("Scripts/Functions/PickupHealth.lua") end Quote SpEcIeS
Ma-Shell Posted March 20, 2016 Posted March 20, 2016 Not sure, but I would assume, the material gets overwritten by the SetShape-function. Have you tried putting the SetMaterial after that? Quote
SpEcIeS Posted March 20, 2016 Author Posted March 20, 2016 Yes, unfortunately it does not change anything. If you try out the code, but change "Model:Cylinder" to "Model:Box", or "Model:Sphere", the material loads as expected. If Cylinder, or Cone is applied to Load, the material does not get used. Quote SpEcIeS
macklebee Posted March 21, 2016 Posted March 21, 2016 Yes, appears to be a bug - like the UV's are not being set properly upon creation of the cylinder or cone when done via code. This has nothing to do with adding a physics shape.I would suggest you open a bug report with a simple main.lua script that shows the issue instead of an object script. 1 Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel
Wchris Posted June 7, 2016 Posted June 7, 2016 Can someone confirm this is solved please ? I cannot find a bug report. Thanks I have a similar problem in C++ with a box. Texture orangegrid.mat doesnt show. PS: I'm not using beta version Quote Windows 7 home - 32 bits Intel Quad Q6600 - nVidia GTX 460 1GB - 2 GB RAM
macklebee Posted June 7, 2016 Posted June 7, 2016 No, it is not resolved just yet: http://www.leadwerks.com/werkspace/topic/14362-cylinder-and-cones-not-loading-materials/#entry98429 Box and sphere in lua appear to work fine - cylinder and cone do not. Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel
Wchris Posted June 8, 2016 Posted June 8, 2016 Box and sphere in lua appear to work fine - cylinder and cone do not. Thanks for the info. In C++ I cannot bring it to work with a box too. Engine log says material texture loads ok, but for some reason does not apply to the model (and no error message). Trying to figure out if it could be my fault, but running out of ideas yet (Just doing Model->Model::Setmaterial(Material, false); Tryed with Entity::Setmaterial or without Model::, same result). EDIT: hummm ... in fact there is a bug report here http://www.leadwerks.com/werkspace/topic/14362-cylinder-and-cones-not-loading-materials/ I must still do something wrong, it doesn't make sense the bug is not exactly the same between lua and C++, since lua is propably using the c++ lib. Quote Windows 7 home - 32 bits Intel Quad Q6600 - nVidia GTX 460 1GB - 2 GB RAM
Josh Posted June 9, 2016 Posted June 9, 2016 Please provide a code example that demonstrates boxes not being created with texture coordinates. I don't think this happens. Quote My job is to make tools you love, with the features you want, and performance you can't live without.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.