Isotropix Forums

Is it possible to access scattered instances color data?

Clarisse Scripting related topics

Is it possible to access scattered instances color data?

Unread postby atnreg » Sat Jan 20, 2018 1:05 pm

Hi!

I know how to get the translation, rotation and scaling (matrix) from scatterer instances but is it possible to get other instance attributes as well?

For example if I have used texture to drive instance_color so that the objects get colored by texture. How can I get the color assigned to each instance? For example just print the color info for each instance.
I cannot find any way to get access to instance object data nor the instance_color data :o

Is it impossible in Python or am I doing something wrong? :)

Thank you!

Antti
Antti
AMD Ryzen Threadripper 2990wx (32c/64t),64GB RAM,NVIDIA GTX 1080ti,Win10
Clarisse 4.0SP7,Houdini,Blender2.83,Fusion360,Onyx,ZBrush,SubstPnt...
Started: Clarisse 2016/10 (Py 2017/01), Python 2016/11
No business, just fun :)
atnreg
 
Posts: 539
Joined: Mon Sep 19, 2016 4:20 pm
Location: Helsinki, Finland

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

Unread postby bvaldes » Mon Jan 22, 2018 12:26 pm

Hi,

Unfortunately, it's not possible. In fact, these data are not stored anywhere, so you can't have access to them.

Sorry for the inconvenience, Regards.
Benoit VALDES
Isotropix
Clarisse QA
User avatar
bvaldes
 
Posts: 384
Joined: Mon Sep 26, 2016 10:44 am

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

Unread postby atnreg » Mon Jan 22, 2018 12:32 pm

Ok, even Clarisse cannot do everything :D
But now I know it so I won't waste time on trying, thank you :)

Antti
Antti
AMD Ryzen Threadripper 2990wx (32c/64t),64GB RAM,NVIDIA GTX 1080ti,Win10
Clarisse 4.0SP7,Houdini,Blender2.83,Fusion360,Onyx,ZBrush,SubstPnt...
Started: Clarisse 2016/10 (Py 2017/01), Python 2016/11
No business, just fun :)
atnreg
 
Posts: 539
Joined: Mon Sep 19, 2016 4:20 pm
Location: Helsinki, Finland

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

Unread postby jboissinot » Tue May 28, 2019 10:35 pm

Hi,

I just wanted to follow up on this as I was wondering if there was any progress made regarding this or if this is still not possible?

This is actually something that we would be willing to get so that we can transfer this color data in a point property to other applications.

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

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

Unread postby sam » Tue May 28, 2019 11:09 pm

Hi Jeremy,

It's not possible (and never will it be) without baking the instance color node(s) into a point cloud.
If you are looking into how to bake a texture node in a point cloud please refer here: https://clarissewiki.com/4.0/sdk/baking_materials.html
Sam Assadian
Isotropix
CEO/Founder
User avatar
sam
 
Posts: 1533
Joined: Fri Jan 25, 2013 11:33 pm

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

Unread postby jboissinot » Wed May 29, 2019 12:07 am

Hi Sam,

Thanks for the info, the idea was actually to get the instance color value per point while baking a point cloud so there's definitely something that we can explore here.

I checked the wiki page you sent me and did some tests but was getting this error while running the example scripts so I just wanted to confirm if this is supposed to be working or I do something wrong:

Code: Select all
00:33:19    Traceback (most recent call last):
00:33:19      File "<string>", line 18, in <module>
00:33:19      File "/softwareLocal/clarisse/linux/clarisse-4.0_SP2/python/base.py", line 14991, in <lambda>
00:33:19        __getattr__ = lambda self, name: _swig_getattr(self, GMathVec3fArray, name)
00:33:19      File "/softwareLocal/clarisse/linux/clarisse-4.0_SP2/python/base.py", line 80, in _swig_getattr
00:33:19        raise AttributeError("'%s' object has no attribute '%s'" % (class_type.__name__, name))
00:33:19    AttributeError: 'GMathVec3fArray' object has no attribute 'get_data'
00:33:19   


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

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

Unread postby anemoff » Wed May 29, 2019 10:32 am

Hi Jeremy,

It's a bug, a regression introduced in 4.0 SP2. It works until 4.0 SP1.
All `get_data` methods from CoreArray and CoreVector are no longer available in Python.
Thanks for reporting it, we will look into it.
Anthony Nemoff
Isotropix
R&D Engineer
User avatar
anemoff
 
Posts: 307
Joined: Wed Jan 13, 2016 10:10 am

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

Unread postby anemoff » Wed May 29, 2019 5:01 pm

For reference, the bug ID is #9794.
Anthony Nemoff
Isotropix
R&D Engineer
User avatar
anemoff
 
Posts: 307
Joined: Wed Jan 13, 2016 10:10 am

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

Unread postby jboissinot » Wed May 29, 2019 7:03 pm

Hi Anthony,

Ok good to know, I tried and it does work fine in 4.0 SP1 indeed, so that's good and I'll definitely keep exploring this.

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

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

Unread postby jboissinot » Wed Jul 31, 2019 11:51 pm

Hi,

I've been exploring this lately and wanted to clarify a few things that I'm a bit confused with. Basically, I am able to get the color data of instances that are scattered from a point cloud while this doesn't seem to be working when using a particle container as geometry support of the scatterer.

In the wiki page https://clarissewiki.com/4.0/sdk/baking_materials.html it says that only items of class Geometry define point clouds.
Therefore, my understanding was that a GeometryParticleContainer object would be considered as a Geometry object from which I can get its point cloud with the geometry.get_point_cloud() method as a GeometryPointCloud object, which is also required for the ix.api.ShaderHelpers.evaluate_support_material() but doesn't work as expected.

In fact, I'm not getting any error when running a script that gets the color data of all instances but it simply returns 0 for all values while I do get the proper rgb values when setting the geometry support with a point cloud instead of a particle container.

I even tried exploring this with evaluate_support_texture() and evaluate_vertices_texture() but could not find a way to get the instances color values either.

As such, I was wondering if what I'm trying to achieve is actually possible? Or if I'm dealing with some kind of limitation or bug? If so, what solution or workaround would you suggest?

Sam said:
It's not possible (and never will it be) without baking the instance color node(s) into a point cloud.

But when you bake it actually creates a particle container, not a point cloud, even though I'm able to get the point cloud of a particle container like I mentioned above.

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

Next

Return to Scripting