Jump to content
Sign in to follow this  
sagarasousuke

Speed-up of setObjectTexture

Recommended Posts

I want to load structure beforehand.

I want to speed up the change of the image.

How will it be good?

The present cord is such a feeling.

obj setObjectTexture[0, sample_bigsize1.paa]

obj setObjectTexture[0, sample_bigsize2.paa]

Share this post


Link to post
Share on other sites

If it is for an addon, creating really really small planes (0.0000001 x 0.0000001) somewhere burried in the model with the respective texture will make setObjectTexture react much faster as the texture is already loaded.

If it is for a mission (which i think it is and therefor would belong to Mission editing & scripting section), placing some objects at some place no one would ever see them and applying the texture to those objects beforehand would have the same effect.

Share this post


Link to post
Share on other sites

As Myke said:

*.cpp:

class EventHandlers
{
init="_buffer_addon1='my_addon1' createVehicle [0,0,0] ; _buffer_addon1 setObjectTexture[0, sample_bigsize1.paa] ; _buffer_addon1 hideObject true ; _buffer_addon1 enableSimulation false ; _buffer_addon2='my_addon2' createVehicle [0,0,0] ; _buffer_addon2 setObjectTexture[0, sample_bigsize2.paa] ; _buffer_addon2 hideObject true ; _buffer_addon2 enableSimulation false";
};

Or in the editor:

this setObjectTexture[0, sample_bigsize1.paa] ; this hideObject true ; this enableSimulation false

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×