Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to change material of model in system plugin? #842

Open
gezp opened this issue May 31, 2021 · 1 comment
Open

How to change material of model in system plugin? #842

gezp opened this issue May 31, 2021 · 1 comment
Labels
help wanted We accept pull requests! rendering Involves Ignition Rendering

Comments

@gezp
Copy link

gezp commented May 31, 2021

I want to change color of model dynamically by using plugin. Then I modify component Material in component Visual by using SetComponentData() in PreUpdate() , but there is no effect.

SDF::Material material ;
ignition::math::Color color(1,0,0,1);
m.SetAmbient(color);
m.SetDiffuse(color);
m.SetSpecular(color);
_ecm.SetComponentData<components::Material>(visualEntity,m);

So, Does anyone know how to change material of model in system plugin? Thank you!

@chapulina
Copy link
Contributor

That functionality hasn't been implemented yet. The implementation would be similar to how we update lights, see #482 as a reference.

@chapulina chapulina added help wanted We accept pull requests! rendering Involves Ignition Rendering labels Jun 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted We accept pull requests! rendering Involves Ignition Rendering
Projects
None yet
Development

No branches or pull requests

2 participants