Isotropix Forums

Is it possible to access scattered instances color data?

Clarisse Scripting related topics

Re: Is it possible to access scattered instances color data?

Unread postby jboissinot » Mon Nov 25, 2019 4:43 pm

Hi Nicolas,

I finally had the chance to take a look at your project setup. I basically got confused with the evaluate_texture_vertices() ModuleGeometry argument as a particle container will return me a ModuleParticle but this is the one you seem to be using in your code, so thank you for confirming this.

Getting the particle container points texture color seems to be working fine with this method then, now since I actually get the material of the scatterer override_material attribute, I would just need to get the instance color node of the material so that I guess I can use this for point clouds and point arrays as well?

That'd be my plan at least which might be better after all as I found out that getting the instance color values with evaluate_support_material() could be affected by a lighting if using a MaterialPhysicalDisneyPrincipled when you want to actually get the flat color value so using a MaterialMatte was better.
But with evaluate_texture_vertices() we'll get the texture color no matter material we use, so that's good too.

Thanks again for the info regarding this,
Jeremy
jboissinot
 
Posts: 79
Joined: Tue Jan 29, 2019 10:36 pm

Re: Is it possible to access scattered instances color data?

Unread postby nguiard » Tue Nov 26, 2019 11:27 am

Hi Jeremy,

jboissinot wrote:I finally had the chance to take a look at your project setup. I basically got confused with the evaluate_texture_vertices() ModuleGeometry argument as a particle container will return me a ModuleParticle but this is the one you seem to be using in your code, so thank you for confirming this.

Yes, ModuleParticle is deriving from ModuleGeometry so that's why you can use it here.

jboissinot wrote:Getting the particle container points texture color seems to be working fine with this method then, now since I actually get the material of the scatterer override_material attribute, I would just need to get the instance color node of the material so that I guess I can use this for point clouds and point arrays as well?

Yes, you can evaluate the texture on any kind of point cloud. However, you can only add properties to particle objects.

Cheers
Nicolas Guiard
Isotropix
Head of R&D
User avatar
nguiard
 
Posts: 397
Joined: Fri Jan 25, 2013 11:33 pm

Re: Is it possible to access scattered instances color data?

Unread postby jboissinot » Tue Nov 26, 2019 3:18 pm

Hi Nicolas,

I would have to get back on this later but that's good to know though and to have a plan for that actually.

Yes, the idea is to be able to evaluate any kind of point cloud while still baking the properties on a particle container indeed.

Thanks again for the help,
Jeremy
jboissinot
 
Posts: 79
Joined: Tue Jan 29, 2019 10:36 pm

Re: Is it possible to access scattered instances color data?

Unread postby sam » Tue Nov 26, 2019 3:48 pm

For reference, you can find the full module class inheritance in the documentation: https://www.clarissewiki.com/4.0/_modul ... topic.html
Sam Assadian
Isotropix
CEO/Founder
User avatar
sam
 
Posts: 1554
Joined: Fri Jan 25, 2013 11:33 pm

Re: Is it possible to access scattered instances color data?

Unread postby jboissinot » Fri Jun 19, 2020 10:57 pm

Hi,

I finally had the chance to get back on this and was able to get the color data of instances scattered with all types of point clouds with the evaluate_vertices_texture() method, so that's good. Then, I continued to explore this for non-scattered instances, specially combiners, and did manage to make it work for them too.

Even though everything is working fine, I wanted to clarify a few things regarding this.

In fact, as Nicolas mentioned "There's a point cloud hidden in combiners which is here for some particular cases like the instance color node", I assumed that I could get that hidden support geometry of a combiner with ModuleSceneObjectTree.get_support(), which does work actually. However, my understanding of it was that the combiner position would be driven by this hidden point cloud of one single point, while ModuleSceneObjectTree.get_support().get_geometry().get_point_cloud().get_point_count() returns 3 and not 1. The Alembic source geometry of the combiner contains 3 meshes, so I assumed the result 3 was referring to the number of geometries being used by the combiner. So, does this mean that a point is created for each geometry? Because I thought that only one point would be created to drive the combiner position.

Also, ModuleSceneObjectTree.has_instances() returns False, and obviously ModuleSceneObjectTree.get_instance_count() returns 0, while I would have expected this to return one instance as a combiner is supposed to represent one instance, it's my understanding of it at least.

Similarly, ModuleSceneObjectTree.get_object_count() returns 2, while the combiner has only one object, which is a group that filters the geometries of the Alembic source geometry. So same here, I'm a bit confused with this result.

Hoping that you could give some explanation,
Jeremy
jboissinot
 
Posts: 79
Joined: Tue Jan 29, 2019 10:36 pm

Re: Is it possible to access scattered instances color data?

Unread postby nguiard » Tue Jun 23, 2020 9:46 am

Hi Jeremy,

jboissinot wrote:So, does this mean that a point is created for each geometry?

Yes you have one point per geometry.

jboissinot wrote:Similarly, ModuleSceneObjectTree.get_object_count() returns 2, while the combiner has only one object, which is a group that filters the geometries of the Alembic source geometry. So same here, I'm a bit confused with this result.

This function returns the number of SceneObject, the group is resolved in order to feed the combiner, it is not included in this number.
However, I don't know why you have 2 here, you should have 3.

Cheers
Nicolas Guiard
Isotropix
Head of R&D
User avatar
nguiard
 
Posts: 397
Joined: Fri Jan 25, 2013 11:33 pm

Re: Is it possible to access scattered instances color data?

Unread postby jboissinot » Tue Jun 23, 2020 7:22 pm

Hi Nicolas,

Thanks for confirming about the point per geometry, and I'm only getting the vertex color of the first point index to get the instance color of a simple combiner as all points are likely to be using the same color data.

I'm actually getting weird results with ModuleSceneObjectTree.get_object_count() and even ModuleSceneObjectTree.get_support().get_geometry().get_point_cloud().get_point_count() that seems to be related to some kind of bug with the instance color in Clarisse for what I could notice during my tests, so I may investigate this a bit further and get back to you on this.

Thanks,
Jeremy
jboissinot
 
Posts: 79
Joined: Tue Jan 29, 2019 10:36 pm

Previous

Return to Scripting