- Tue Dec 01, 2020 6:14 am
#400297
I'm writing a converter for curves from Houdini to Maxwell. The code below successfully generates a single linear hair curve that renders fine.
1: Am I calling the get methods correctly?
2. The Maxwell hair strand I made is linearly interpolated between the points. I think cubic bezier is supported but I'm not sure.
3: HAIR_GUIDES_COUNT[a,b,c,d]. I put 1 for 'a' and in the .mxs example Fernando gave me it read [39,26,0,0] and I calculated 6695 strands of hair. What are these values?
4. HAIR_GUIDES_POINT_COUNT[a,b,c,d] . I think 'a' is the number of points in each hair strand ? What are b c d?
Thanks for any guidance
Code: Select all
My questions are#generate a single strand of hair
from pymaxwell5 import *
#create an extension manager object
scene = Cmaxwell(mwcallback_cb)
mgr = CextensionManager.instance()
mgr.loadAllExtensions()
geoProceduralExtensionHair = mgr.createDefaultGeometryProceduralExtension('MaxwellHair')
extensionData = geoProceduralExtensionHair.getExtensionData()
extensionData.setByteArray('HAIR_GUIDES_COUNT',[1, 0, 0, 0])
extensionData.setByteArray('HAIR_GUIDES_POINT_COUNT',[4, 0, 0, 0])
extensionData.removeItem('HAIR_POINTS')
extensionData.createFloatArray('HAIR_POINTS',[0.0, 0.0, 0.0, 10.0, 100.0, 0.0, -10.0, 200.0, 0.0, 0.0, 300.0, 0.0])
extensionData.setDouble('Root Radius',2.0)
extensionData.setDouble('Tip Radius',2.0)
#create hair
hair = scene.createGeometryProceduralObject("hair",extensionData)
#inspect hair params
paramsHair = hair.getGeometryProceduralExtensionParams()[0]
print 'HAIR_GUIDES_COUNT',paramsHair.getByName('HAIR_GUIDES_COUNT')[0]
print 'HAIR_POINTS',paramsHair.getByName("HAIR_POINTS")[0]
scene.writeMXS('c:/users/Public/hair.mxs')
1: Am I calling the get methods correctly?
Code: Select all
paramsHair = hair.getGeometryProceduralExtensionParams() returns a tuple and MX paramListRef is in index[0]. The 2nd value in the tuple is True or False . I'm confused as to why I would ever need a tuple.CmaxwellObject_getGeometryProceduralExtensionParams(CmaxwellObject self) -> PyObject *
2. The Maxwell hair strand I made is linearly interpolated between the points. I think cubic bezier is supported but I'm not sure.
3: HAIR_GUIDES_COUNT[a,b,c,d]. I put 1 for 'a' and in the .mxs example Fernando gave me it read [39,26,0,0] and I calculated 6695 strands of hair. What are these values?
4. HAIR_GUIDES_POINT_COUNT[a,b,c,d] . I think 'a' is the number of points in each hair strand ? What are b c d?
Thanks for any guidance