CatherineKan Posted June 10, 2020 Share Posted June 10, 2020 Hello, I got two specific questions in simulation right now, as they were described in title. First, I want to use python node to program a few lines of statement that could add color points on the ramp of my color nodes, since I need to add 200 points in order to give my geometry layers of different colors. (I only know the syntax of how to set node's attribute values with Python, but I did not find out the syntax that can tell the node automatically add points) Also, as my first screenshot shows, I want to know how to set values to color vector, since color parameter's name is “rampcr#rampgr#rampbr#”, I don't know how to syntax that with values and expressions. The second question is about generating a bounding box in order to delete exactly half of my volume, but I want the effect operated in the end of my network, because I want the color be set well(i.e. color changes from shell to shell of my spherical volume), and then cut it half, make the cross section of my spherical volume be seen, so that the rings of different colors could be seen more obviously~ I used a delete node as the second screenshot shows, but it did not work, it seems all my volume was disappeared, the whole volume was ghosted in the scene so that you can see what I constructed. I don't know if I set something wrong or I should use another node to achieve my final effect? It is ok if you can only solve one of my questions, I would be grateful. Thanks a lot in advance! Quote Link to comment Share on other sites More sharing options...
esnaacho Posted June 11, 2020 Share Posted June 11, 2020 (edited) for slicing the volume, there is a node "Volume Slice" it should work fine. it just give you a plane :/ idk if that works for you, maybe if you convert that volume into vdb then use "vdb combine" to substract. and for the python code that you are looking for, i found this hope it helps. Good luck Edited June 11, 2020 by esnaacho 1 Quote Link to comment Share on other sites More sharing options...
CatherineKan Posted June 14, 2020 Author Share Posted June 14, 2020 I found the answer to my first question somewhere else, I will share here~ The color attribute in color node can be set with specific expression by using a statement like: parms[i+3].setExpression('point("../attribwrangle", $F, "waterCd{}", 0)'.format(j)) The whole script worked on my color node is attached as the screenshot~ Hope someone can take it as a reference in the future! 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.