evanrudefx Posted June 29, 2020 Share Posted June 29, 2020 Hello, How do I grab the position of a volume from another input in a volume vop? If I create a bind node and set it to P, it lets me get the position of the volume in input 1. How can I get the position from a volume in input 2 or 3? Thanks Quote Link to comment Share on other sites More sharing options...
anim Posted June 29, 2020 Share Posted June 29, 2020 Bind P gives you position of the current voxel you are iterating over, since you are iterating over voxels of the first input it's always first input, and you can sample any volume primitive of any input at that position if you want to get position of a particular voxel index from a primitive of current or other inputs, you can use volumeindextopos() function and feed either specific index you have in mind or if the voxel grids are the same dimensions just transformed differently you may want to feed the current index to get position of corresponding voxel in other input or volume primitive, up to you 1 Quote Link to comment Share on other sites More sharing options...
evanrudefx Posted June 29, 2020 Author Share Posted June 29, 2020 (edited) 15 minutes ago, anim said: Bind P gives you position of the current voxel you are iterating over, since you are iterating over voxels of the first input it's always first input, and you can sample any volume primitive of any input at that position if you want to get position of a particular voxel index from a primitive of current or other inputs, you can use volumeindextopos() function and feed either specific index you have in mind or if the voxel grids are the same dimensions just transformed differently you may want to feed the current index to get position of corresponding voxel in other input or volume primitive, up to you Thanks! how do I get the current index value? I had tried using the volume index to position, but I got stuck on what to feed into the indexpos. Thanks again. edit: I just found out its the ix iy iz value on the volumevopglobal Edited June 29, 2020 by ejr32123 Quote Link to comment Share on other sites More sharing options...
evanrudefx Posted June 29, 2020 Author Share Posted June 29, 2020 I still cant figure out how to sample the position of a volume from the second input : ( Quote Link to comment Share on other sites More sharing options...
flcc Posted June 29, 2020 Share Posted June 29, 2020 Check this. There's two examples in here. Be careful that there are two types of volumesamplefile nodes. volumesample and volumesamplevector. For position and color you obviously choose the vector one. volumesample.hipnc Quote Link to comment Share on other sites More sharing options...
evanrudefx Posted June 30, 2020 Author Share Posted June 30, 2020 Thanks, that doesnt seem to solve my problem of grabbing the position from another input of a vop. Also example levelset doesnt work because it starts by merging something that doesnt exist. Quote Link to comment Share on other sites More sharing options...
anim Posted June 30, 2020 Share Posted June 30, 2020 6 hours ago, ejr32123 said: edit: I just found out its the ix iy iz value on the volumevopglobal do you still have problem using volumeindextopos() to get the position of that index from specific input and primitive even after this discovery? you can either plug those 3 to Integer To Vector or use Volume Pos To Index to get the index vector and then use that to get position of a voxel of the same index in any volume prim/input using Volume Index To Pos VOP Quote Link to comment Share on other sites More sharing options...
evanrudefx Posted June 30, 2020 Author Share Posted June 30, 2020 (edited) @anim Yea, I am still having the problem. TBH I don't dont really know what the volume index is, and I dont know where to learn what it is. I tried checking the manual. The photo is how I tried setting it up. I don't understand why its not just like "import point attribute" where you choose input and the attribute to import. Edited June 30, 2020 by ejr32123 Quote Link to comment Share on other sites More sharing options...
flcc Posted June 30, 2020 Share Posted June 30, 2020 (edited) Here you get the idx of the current volume. May be like this. Edited June 30, 2020 by flcc Quote Link to comment Share on other sites More sharing options...
ziconic Posted June 30, 2020 Share Posted June 30, 2020 Maybe it would help if you described the problem you are trying to solve? TBH I'm not sure what you mean by grabbing the position of a volume on a different input. The Volume VOP iterates over the volumes in the first input by position, so there is only one position P of interest at any time. There are no other positions being generated for the other inputs. Now, if you have a specific position to look up in the volume in input 2 (e.g. the current P + some offset), you can use the Volume Sample node to read the second input's volume at some arbitrary position. Quote Link to comment Share on other sites More sharing options...
flcc Posted June 30, 2020 Share Posted June 30, 2020 That's a good point, actually, this setup just return P ! But why make it simple when you can make it complicated ? Quote Link to comment Share on other sites More sharing options...
evanrudefx Posted June 30, 2020 Author Share Posted June 30, 2020 (edited) 21 minutes ago, ziconic said: Maybe it would help if you described the problem you are trying to solve? TBH I'm not sure what you mean by grabbing the position of a volume on a different input. The Volume VOP iterates over the volumes in the first input by position, so there is only one position P of interest at any time. There are no other positions being generated for the other inputs. Now, if you have a specific position to look up in the volume in input 2 (e.g. the current P + some offset), you can use the Volume Sample node to read the second input's volume at some arbitrary position. I have a "rest" field going into the third input of my photo. I want the position of the static noise to be based on the position of the volume in the third input, not the position of input 1. ITs just like using import point attribute from another input and grabbing position, but trying to do it for a volume. Edited June 30, 2020 by ejr32123 Quote Link to comment Share on other sites More sharing options...
anim Posted June 30, 2020 Share Posted June 30, 2020 1 hour ago, ejr32123 said: I don't understand why its not just like "import point attribute" where you choose input and the attribute to import. it is exactly like that, import point attribute, you provide input and point index and it will import attribute (P for example) from that input/point the same way as providing input and voxel index can return position of that voxel using volumeindextopos() which you can use to sample value of that volume primitive that's providing you don't know the position you want to sample the volume at already, it's possible that you don't really want position based on index, but that's hard to tell from what you have said so far it's also not very common to have to do that, but as mentioned in the first response you may have the same dimension volume primitive just with different transform and you want to get the location of corresponding voxel, or your volumes may be misaligned a bit like when v@vel field is simmed face sampled and you want to get position and then values of exact voxels rather than the interpolated values at the position of voxels in first input, but if that is not similar to your situation it may be not what you are looking for 1 Quote Link to comment Share on other sites More sharing options...
anim Posted June 30, 2020 Share Posted June 30, 2020 (edited) 7 minutes ago, ejr32123 said: I have a "rest" field going into the third input of my photo. I want the position of the static noise to be based on the position of the volume in the third input, not the position of input 1. ITs just like using import point attribute from another input and grabbing position, but trying to do it for a volume. it's not exactly just like that, cause while point's hold the values and move themselves, voxels are static and values move from one to another so that's why you can't just import position from another input and hope that you get the right one but if you have evolving rest filed in your first input just bind that and use to sample the noise or if it's in the 3rd input you can use Volume Sample Vector VOP to sample 'rest' and use for your noise, still assuming your rest field is evolving and aligned with the sim or volumes you are applying noise to Edited June 30, 2020 by anim 2 Quote Link to comment Share on other sites More sharing options...
evanrudefx Posted June 30, 2020 Author Share Posted June 30, 2020 thanks, good information : ) Quote Link to comment Share on other sites More sharing options...
evanrudefx Posted June 30, 2020 Author Share Posted June 30, 2020 thanks everyone who helped, I was able to get something working. 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.