Jump to content

Copying model + animations


jamesmintram
 Share

Recommended Posts

Hi Guys,

 

I need to copy a model to assign a different material to it. To do this I use Entity::Copy().

 

However, the copied entity does not seem to animate, I have queried the number of animations the copy has and this is reported correctly.

 

Is there anything in addition to Entity::Copy() that I need to do so that the animations work with the copy?

 

Regards,

Link to comment
Share on other sites

I still haven't managed to fix this.

 

My Code for creating a copy is as follows:

 

Model *fullComputer = Model::Load("Models/Borgs/combinedAnimations.mdl");
Model *fullHuman = (Model*)fullComputer->Copy();

 

fullHuman->CountAnimations(); returns the same as fullComputer->CountAnimations ();

 

However, fullHuman remains un-animated. Is this likely to be a bug?

 

Regards,

James

Link to comment
Share on other sites

I tried to use Copy on my testing project and you're right, no animations are played on it. Though I don't know if it's working as expected or not, but on the reference page it says "Copied entities are unique and will not be rendered in batches. Consequently, it is preferable to use Entity::Instance() when possible" so I tried to replace Copy with Instance and the animations worked again. What is strange now is that Instance method is displayed with strike format in the Entity reference page, which usually in the world should mean that a command is deprecated/obsolete and should be avoided.

?? FRANCESCO CROCETTI ??

http://skaredcreations.com

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