Jump to content
Sign in to follow this  
Gabriel_Wolf

copy different pieces to different point issue

Recommended Posts

Hello,

Can you help me a little bit? I have an obj file about tetris pieces. I would like to copy randomly one piece to a random point.

What is wrong with my setup?

Thank you

1.jpg

2.jpg

Share this post


Link to post
Share on other sites

I can see a couple of things wrong with your setup. Not sure why you have a for each there that you aren't using that is not why isn't working but not needed. Also, your objects that you want to copy they all should be at {0,0,0}. You are using a deprecated technique.
I think it will be better if you post .hip

Check out MOPs

https://www.motionoperators.com/

This as well

https://www.toadstorm.com/blog/?p=493

Or have a look at, you are missing some fundamentals 

 

Share this post


Link to post
Share on other sites
Posted (edited)
6 hours ago, Gabriel_Wolf said:

Thank you. I will check the video. And I attached my hip file

tetris.hiplc

Hello,

you didn't attach Tetris.obj. This is an example how you can achieve what you want.

tetris_01.hipnc

Edited by vicvvsh

Share this post


Link to post
Share on other sites

First, thank you for your help. And I'm sorry but my hip file was a mess. And this time I attached the tetris obj. The main idea is to copy random pieces of the tetris obj to the points of the cube using the class attribute.  

tetris.hiplc

Tetris.obj

Share this post


Link to post
Share on other sites
29 minutes ago, Gabriel_Wolf said:

 The main idea is to copy random pieces of the tetris obj to the points of the cube using the class attribute. 

I've guessed that. What's wrong with my first example? In this new example file I just added transform sop to move pieces to the origin.

tetris_02.hipnc

Share this post


Link to post
Share on other sites

It is working. Thank you. Let me ask don't you want to mentoring a couple hours? I pay for it of course. Maybe we could make a skype session or something. 

It is a really good thing that you showed me how to do that. But my main goal is understand the workflow. And there are some things I don't really undestand in your setup. Mainly the VEX.  And my main issue is with the vex. For example I posted another question here where I asked how to add a custom velocity for only particles which are under age 1? And somebody wrote the same solution I've already knew. But I can't write it with vex.

Share this post


Link to post
Share on other sites
16 hours ago, Gabriel_Wolf said:

 Let me ask don't you want to mentoring a couple hours?

I think my level not enough to be a mentor. This forum is the golden mine of knowledge and you can get it for free just should search carefully.

16 hours ago, Gabriel_Wolf said:

It is a really good thing that you showed me how to do that. But my main goal is understand the workflow. And there are some things I don't really undestand in your setup. Mainly the VEX.  And my main issue is with the vex. For example I posted another question here where I asked how to add a custom velocity for only particles which are under age 1? And somebody wrote the same solution I've already knew. But I can't write it with vex.

Workflow of this example is pretty simple. We take points and set randomly attribute i@id,  whose value is fit from 0 to quantity of pieces in .obj file. This attribute say “blast2” node if i@class equal to i@id then delete all but not this one.  For-loop iterate by points, one point per iteration which number gives us node “meta” from detail attribute i@iteration with expression.

 detail("../meta", iteration, 0)

At each iteration “blast2” with expression

`@class=`point("../OUT_pts", detail("../meta", iteration, 0), "id", 0)`

takes a point, finds i@id value of the point with number of iteration, and deletes pieces with i@class not equal i@id. Copy to points sop in for-each loop copies that piece to the point which is iterating at this moment.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×