• Posts 8
  • Reputation 0
  • Member Since
  • Last Active
Email
All Posts Topics Started Likes
Point Cloud - Maya Python

When I import the point cloud into Maya, my C: memory fills up.
Is there a way to redirect the memory usage from C: to another drive like D:

Not sure if this is a Maya, Window or Soup code issue.

 

Any help is appreciated.

Regards,

 

0 0
Point Cloud - Maya Python
Make sure the path to your file uses    /   not   \ 
0 0
Point Cloud - Maya Python

Great, It's importing in 2016.

Thanks so much!

 

0 0
Point Cloud - Maya Python

I'm using Maya 2017, so perhaps that is the issue.
I tried using the script in Maya 2016, but receive and error message

"// Error: Line 3.1: Syntax error"

Might be something wrong l'm doing on my side.

Much thanks for all your help.

Regards,

 

0 0
Point Cloud - Maya Python

I've tried using Viewport 2.0 and Legacy Default Viewport with long load times.

Are there any setting changes I should try?

0 0
Point Cloud - Maya Python

Hi pschipkov,

Thanks so much, your script did the Job!
The point cloud looks just like the original scan.

I'm new to SOuP, so I'm not sure how to get the file to open within seconds as you described. The file took about 25 minutes for me to open.

Thanks So Much!

Regards,

0 0
Point Cloud - Maya Python

Hello pshipkov,

Attached is a .pts file. 
Hopefully it will help you find a way to import a dense point cloud in Maya.

 

https://www.dropbox.com/s/6phtch04lqw4a0v/6221%20-%20Tractor.pts?dl=0

 

Much Regards,

0 0
Point Cloud - Maya Python

Hello Everyone,

I am an artist who needs help with the following Python script.
Below is a Maya python script which imports point cloud files into Maya.

Image 1 shows how the point cloud looks when imported into Maya.
The point cloud is not dense enough.

Image 2 is how it needs to look with updated coding.

If anyone could help update the script so the point cloud is dense like image 2,
it would greatly appreciated.

 

Much Thanks
Vincent.

Code:

# Maya .PTS to Particles Script
import maya.cmds as cmd
import maya.mel as mel
import re
# set user params
filePath = "D:\\Files\\Misc_Projects\\Projects\\Tractor.pts"
# start from nth particle
start = 1
# set particle limit
limit = 100000
# subsample by a certain factor
factor = 0.001
posDataList = []
colorDataList = []
step = 1/factor
ptc = cmd.particle()[1]
try:
    cmd.addAttr(ptc, ln='rgbPP', dt='vectorArray')
    cmd.addAttr(ptc, ln='rgbPP0', dt='vectorArray')
    cmd.setAttr(ptc + '.isDynamic', 0)
    # the following is just to speed up visualization
    cmd.setAttr(ptc + '.particleRenderType',3)
except:
    print 'error encoutered while setting up'
# lazily read file
with open(filePath) as infile:
    count = 0
    for line in infile:
        count += 1
        if count < start: continue
        if count%step == 0:
            data = re.sub(' +',' ',line).split(' ')
            posData = (float(data[0]), float(data[1]), float(data[2]))
            colorData = (float(data[3])/255, float(data[4])/255, float(data[5])/255)
            posDataList.append(posData)
            colorDataList.append(colorData)
        if (count - start) * factor > limit: break
# cmd.emit( o=ptc, pos=posDataList, at=('rgbPP'), vv=colorDataList )
# the above should work, according to Maya's Documentation, but it doesn't (Maya crashes)
cmd.emit( o=ptc, pos=posDataList )
ptcs = cmd.particle( ptc, q=1, count=1)
#print ptcs
for (id) in xrange(ptcs):
    cmd.particle(ptc, e=1, at='rgbPP', vv=colorDataList[id], order=id)
cmd.saveInitialState(ptc)

code.jpg 

0 0
count post selected

Add a Website Forum to your website.