Isotropix Forums

Bake support UV from a point cloud

Clarisse Scripting related topics

Bake support UV from a point cloud

Unread postby rim » Mon Mar 18, 2019 12:21 pm

Is there anyway to bake the UV coordinates from underlying geometry on a live pointcloud so I can still access and change the support colour textures?

I've had some success with baking the colour values themselves down to points but it would be helpful to have the UV coordinates still available so we can easily still change the support colour without re-baking.

I've had a look through the SDK documentation and can only see primitive_uv or support_primitive_uv being available for when creating a pointcloud and can't workout how to access on an existing pointcloud it as there's no .get for it?
rim
 
Posts: 10
Joined: Thu Jun 11, 2015 3:46 pm

Re: Bake support UV from a point cloud

Unread postby mdkai » Mon Mar 18, 2019 7:25 pm

Hmm
I'm not sure if you can transfer float data into the bake process for points, this would require to also work with udims ?

For now the best option is again Houdini and an attribute transfer
... but I'm also curious if clarisse could bake out data into points ...
mdkai
 
Posts: 259
Joined: Tue Oct 07, 2014 7:24 pm

Re: Bake support UV from a point cloud

Unread postby anemoff » Mon Mar 25, 2019 7:17 pm

Hi,

We'll see if this is feasible and keep you posted.

Cheers,
Anthony Nemoff
Isotropix
R&D Engineer
User avatar
anemoff
 
Posts: 137
Joined: Wed Jan 13, 2016 10:10 am

Re: Bake support UV from a point cloud

Unread postby rim » Tue Mar 26, 2019 11:00 am

Thank you - I'm currently baking each map we need into the point cloud themselves which is making them considerably heavier.
rim
 
Posts: 10
Joined: Thu Jun 11, 2015 3:46 pm

Re: Bake support UV from a point cloud

Unread postby anemoff » Wed Mar 27, 2019 2:29 pm

Hi again!

You can get the UVs of Point Cloud points like this:

python code

obj = ix.get_item("project://scene/point_cloud")
geometry_point_cloud = obj.get_module().get_geometry().get_point_cloud()

pt_count = geometry_point_cloud.get_point_count()
print 'point count = {}'.format(pt_count)
for pt_index in range(pt_count):
# get the point sample (GeometryPointSample)
pt_sample = ix.api.GeometryPointSample()
geometry_point_cloud.get_sample(pt_index, pt_sample)

# get the sample descriptor (GeometryPrimitiveSampleDescriptor)
sample_desc = pt_sample.primitive
pt_id = sample_desc.id
u = sample_desc.u
v = sample_desc.v
print 'pt {}: id = {}, uv = ({}, {})'.format(pt_index, pt_id, u, v,)

You can then bake the UV values in a Particle Container, in a property of type float and size 2.

For more details check the following links:
- GeometryPointSample: https://www.clarissewiki.com/4.0/sdk/st ... ample.html
- GeometryPrimitiveSampleDescriptor: https://www.clarissewiki.com/4.0/sdk/st ... ample.html

I hope this helps.
Anthony Nemoff
Isotropix
R&D Engineer
User avatar
anemoff
 
Posts: 137
Joined: Wed Jan 13, 2016 10:10 am

Re: Bake support UV from a point cloud

Unread postby rim » Wed Mar 27, 2019 6:45 pm

That's brilliant, thanks! I'll give it a go and let you know how I get on :)
rim
 
Posts: 10
Joined: Thu Jun 11, 2015 3:46 pm

Re: Bake support UV from a point cloud

Unread postby rim » Thu Apr 11, 2019 11:35 am

Sorry for the slow reply - finally manged to get around to some testing today, am I right in thinking what we've baked down is the parametric UV of the object?
rim
 
Posts: 10
Joined: Thu Jun 11, 2015 3:46 pm

Re: Bake support UV from a point cloud

Unread postby anemoff » Thu Apr 11, 2019 3:11 pm

Yes indeed, those are the parametric uv coordinates on the object.
Anthony Nemoff
Isotropix
R&D Engineer
User avatar
anemoff
 
Posts: 137
Joined: Wed Jan 13, 2016 10:10 am

Re: Bake support UV from a point cloud

Unread postby rim » Thu Apr 11, 2019 3:26 pm

Ah got it, sorry we needed the object UV coordinates along with UDIM's. I managed to make it work by using the point colour baking workflow in the sdk help with a blended u and v gradient, think I was just over-complicating what we needed.
rim
 
Posts: 10
Joined: Thu Jun 11, 2015 3:46 pm

Re: Bake support UV from a point cloud

Unread postby anemoff » Thu Apr 11, 2019 3:33 pm

Glad to know that you found a workaround.
Anthony Nemoff
Isotropix
R&D Engineer
User avatar
anemoff
 
Posts: 137
Joined: Wed Jan 13, 2016 10:10 am


Return to Scripting