浏览代码

Updated VAT ROP with inverse winding option + Check Normals

/feature-VertexAnimationTextures
Thomas ICHÉ 3 年前
当前提交
0d63eb43
共有 1 个文件被更改,包括 51 次插入17 次删除
  1. 68
      DCC-Tools~/Houdini/VAT-ROP.hda

68
DCC-Tools~/Houdini/VAT-ROP.hda


INDX INDEX_SECTION�a�Ƨhoudini.hdalibrary�a�ƧDriver/vat_output�>�a�Ƨ
vat_outputVertex Animation Texture*oplib:/Driver/vat_output?Driver/vat_output ROP_shellDrivera�ƧINDX DialogScripta�Ƨ CreateScript-a�ƧTypePropertiesOptions2.a�ƧHelp`a�Ƨ Tools.shelf`a�ƚInternalFileOptionsa0a�Ƨ Contents.gz��a�Ƨ PythonModulet � �ExtraFileOptions<Pua�Ƨ# Dialog script for vat_output automatically generated
INDX INDEX_SECTION�a�-�houdini.hdalibrary�a�-�Driver/vat_output�B3a�-�
vat_outputVertex Animation Texture*oplib:/Driver/vat_output?Driver/vat_output ROP_shellDrivera�-�INDX DialogScript�a�� CreateScript�-a�-�TypePropertiesOptions.a��HelpKa�� Tools.shelfKa�:InternalFileOptionsL0a�-� Contents.gz|�a�-� PythonModule^#J#JExtraFileOptions?�ua��# Dialog script for vat_output automatically generated
{
name vat_output

name "pointCount"
label "Point Count"
type integer
default { "4096" }
default { "16384" }
range { 0 10 }
range { 256 16384 }
parmtag { "script_callback_language" "python" }
}
parm {

parmtag { "oprelative" "." }
parmtag { "script_callback_language" "python" }
}
parm {
name "pram_reverseWinding"
label "Reverse Triangle Winding"
type toggle
default { "0" }
parmtag { "script_callback_language" "python" }
}
}
groupsimple {

drivertoolutils.genericTool(kwargs, '$HDA_NAME')]]></script>
</tool>
</shelfDocument>
 nodeconntype nodeparmtype���W_o�6װ�Y��=9UIQ���ۺb ��!K Mape �I���xE>ʾ��ԟ$��nq
T���ݑ��<��g���g��g>�������ij$�Q�6��V#2�K�����*���=|6(ĤȘ�҄�(�g��St��R6�n��f&-��x||��xp
ǽe8�K�zͅAA��R����pFdF�X��8��T
�S#��צ�O^��d���$��!X�� _�3�-r�T�L�յbG����֎�J �-[q�q�Ȣ\�ڍ��$���Ϙan�k��I�J*p�5��k~ .q�$�6�� [�����{�Ԇ J�~�9M�8&8�Y�ǣt>[��c�)�B�\3���7g�??{��UX�6�� �B@j5�Ԣ�I��!���X�t��O?ؘ?"�SU�.?����X5l�Q��}�ס��n�CU6�+d���o���o\i������� �i_�/t����k �z�n���'�o�k��t=!���`Jwz�|��CK���-���;p�?I���ayd�$t��}q�m�]i!<�9�^0H�r�Zd���+Z����+��}�>1�P;-�� ܭ5_�B����)��D�س�mB�i1� ��EN.�ct�v���=�d�����oC�ƠY叇���m�im��~QI���c�[��W7�
���2m\?fy<*�� .�����&����x�Ik��ХW���7�<m ��Cxb/g}����t�'�~{�f%��j�B[;�w]�Nz�@-ߣ��V
T4�M�=62���!������#P��� ۑ�D�# ����`W �j؉�����b�V��ӘƸB!�оH�Z�2!]�Ȭ����Mz�|�7,��j��zCDtXr�iԙq����_|DŽ�f�F���ƒ��J�y7�Jn���u{����>��q�Q奸���S0�/�U��������7d�7�I�dEp��/�����u�?|q���ϯΏ���jB7V�import numpy as np
 nodeconntype nodeparmtype���W_o�6װ�Y��=9UI��l��-�և,04��I�%T"5����$��;R���V��)P��wG������q�ڏy�>I���g���Di$I�ep��r���޴��AV�L���
)s*��~�+�#� ]S��n;�6Tg%S9+�����N�`k�v2�4�k�yn+T�+�I��,���4�#7��L �ٍ�r@S�t��E���@ ����fM[S���;����Y�H�����*eɼR�޳%�9��,�uYï���Z�ܒ�^��jj���̜ā���hWk�f7��M��C�^ц���޽u+~�aI���L2�I�$\D)�~V���R��2��G;]
�.K�P���W痿?;��K���� ��0����2��i
�,b��r��?~���.DTe�jmv�YS��蚡����c+#���5�)&M�x�p�^�V�1��6�֗G�Y0�#���sU��&²���pܓ&;��Z�Y��a�$��!�a�����[�ڎ���Y���݁!�x�����HU>��i;l������J�����B�kT�3 ���C�BE$=_��ls��s����bk[���p�֥���;s��I�2+�W��?/ȕw�n��ۇ8����.4]��.�`
���U�x�� ����d���*��d���#�6 �U�ʹᕷ�: ׏^]y���� �B�=�I�Ӄ��iҖ�����W�总�e�f�7�����0z;�������׼��XT�kcO�f(�Ao�4
�K�
f�y����C��^U�U�(�����Ȣ<ߓz��kcb�/��a4��UUs@΍���4�1�P��7�m-@���_D��l~j'=D��pJ=}L��!�,���4�̴�7�8,�gB(=e�wwR����R�y77Jv���w{򸇘>��i��**~?ӧ�`����Na|���G�z~E>��e�d�D�3퐣_����//�;�����ɉ�/��L��import numpy as np
import hou
import os.path

posData = np.empty((count*frames)*4, dtype=float)
nrmData = np.empty((count*frames)*4, dtype=float)
sop = node.parm("sop_output").evalAsNode()
if sop == None:
print ("No SOP Object Defined")
return
geo = sop.geometry()
if geo.findPointAttrib("N") == None:
print ("WARNING: No N (Nornal) attribute found at point level, will default to Up Normal")
node.setCachedUserData("mode",mode)
node.setCachedUserData("count",count)

def process(frame):
reverseWinding = node.parm("pram_reverseWinding").evalAsInt() == 1
reverseFrames = node.parm("parm_reverseFrames").evalAsInt() == 1
sop = node.parm("sop_output").evalAsNode()

return
hasNormal = geo.findPointAttrib("N") != None
if mode == 1:
ref_points = node.parm("parm_tpose").evalAsNode().geometry().points()

i = 0
for prim in geo.prims():
k = 0
for point in prim.points():
pts = prim.points()
if reverseWinding:
pts.reverse()
for point in pts:
if i >= count:
print ("Reached more than {} points at frame {}".format(count,frame))

elif mode == 1:
idx = point.number()
pos = point.position() - ref_points[idx].position()
nrm = point.attribValue("N")
if hasNormal:
nrm = point.attribValue("N")
else:
nrm = (0.0,1.0,0.0)
nrmData[stride+2] = nrm[2]
nrmData[stride+2] = nrm[2]
k = k+1
i = i+1

node.destroyCachedUserData("posData")
node.destroyCachedUserData("nrmData") PythonModule/Cursor �PythonModule/IsExprPythonModule/IsPythonPythonModule/IsScriptPythonModule/SourceViewerStateModule/CodeGenInput�{
node.destroyCachedUserData("nrmData") PythonModule/Cursor �)PythonModule/IsExprPythonModule/IsPythonPythonModule/IsScriptPythonModule/SourceViewerStateModule/CodeGenInput�{
"state_name":"",
"state_label":"",
"state_descr":"",

正在加载...
取消
保存