Jump to content

Verification


Alienhead
 Share

Recommended Posts

I'm looking for verification that this is normal behavior and if so what steps are needed to get around it.  In code I'm loading several entitys(mdl) at a give time. Like so

            local ef =Model:Load("Materials/Particles/planeeffect/explo1/explo1.mdl")
            ef:SetScript("Materials/Particles/planeeffect/explo1/explo1.lua", true)
            ef:SetPosition(self.entity:GetPosition())

I understand theres more efficient way to do this but this is how I've broke it down for this example.
So I'm not using Instance or Copy as you can see, why is the same surface shared between 4 distinct entitys loaded separately using no instancing or copying. In the pic I have colored each of the entitys a different color to show my claim.   Each call to SetColor would change all 6 objects.  Is this the nature of the engine or is there a hidden step I need to take to have separate surfaces on these models since.   

Does AddRef() count come into play here? or is that just to prevent models from being deleted. 
 

test.png

I'm only happy when I'm coding, I'm only coding when I'm happy.

Link to comment
Share on other sites

Okay good to know, now If I wanted to cheat and have two seperate entity of this same kind - what is the engine pulling out of the cache? the surface or the mat ? or would I need to load  a different named mat or differently named mesh ? or both ?

I'm only happy when I'm coding, I'm only coding when I'm happy.

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...