vex:AttributeToMaya - miyagiA/MyLearningNote GitHub Wiki

As a premise

need them ( v@P,v@Cd,v@N,v@Cd,f@Alpha )

First, When outputting FBX(.fbx)

Continuous Wrangle

Detail Attribute Wrangle

//---- uv to maya ------
s@maya_uv_mapped_uv = "uv";
s@maya_uv_name = "map1";
s@maya_uv_current = "map1";

//---- ** Cd=Vector Alpha=Float  not v@Cd !! ------
//---- vertex Alpha ------
//s@maya_colorset_mapped_Alpha = "Alpha";
//---- vertex Color ------
s@maya_colorset_mapped_Cd = "Cd";
s@maya_colorset_name = "colorSet1";
s@maya_colorset_current = "colorSet1";

Primitives Attribute Wrangle

//---- normal to maya edge ------
@maya_shading_group;

Verticse Attribute Wrangle

//---- normal to maya edge ------
i@maya_locked_normal = 1;

//---- soft edge ------
// ** to Maya softEdge... Normal Setting = [Vertices, 180, ByFaceArea]
//i@maya_hard_edge = 0;

When outputting alembic(.abc)

This format does not clamp vertex colors

  1. @Cd move to VertexAttribute from PointAttribute
  2. So use this... SOP attribpromote
  3. Set like this...Setting [ OriginalName=Cd,OriginalClass=Point,NewClass=vertex,PromotionMethod=Mode ]

※ Details are unclear, but this should be fine!

カラーを出したい場合頂点アトリビュートがCd[0]ではなくCd[r]とカラー認識されている必要がある。 この場合は、下のVexの様にカラー指定してから出力するか v@Cd のようなドフォルトでrgbとなっているアトリビュートに代入するのが良い。 rgba4チャンネルを合成したい場合などは、下のように自分でつくらないと上手くいかない場合もあるかも?

//---- point vec4 to color, In the case of name "rgba" ------
addpointattrib(0,"rgba",{1,1,1,1},"color");
vector4 pcolor=set([email protected],[email protected],[email protected],@Alpha);
setpointattrib(0,"rgba",@ptnum,pcolor);