Jump to content

Cylinder and Materials


SpEcIeS
 Share

Recommended Posts

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

SpEcIeS

Link to comment
Share on other sites

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.

SpEcIeS

Link to comment
Share on other sites

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.

  • Upvote 1

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

  • 2 months later...

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

Windows 7 home - 32 bits

Intel Quad Q6600 - nVidia GTX 460 1GB - 2 GB RAM

Link to comment
Share on other sites

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.

Windows 7 home - 32 bits

Intel Quad Q6600 - nVidia GTX 460 1GB - 2 GB RAM

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...