Azuril Posted February 21, 2018 Share Posted February 21, 2018 Hello, I am relatively new to houdini - I have used it years prior for some things but now I have just acquired an indie license for development of my unreal game. At the moment I am making a building facade system that will place premade modular pieces depending on a few variables. I was hoping that perhaps some guru's could peruse this little plan i have drawn up for how i envision it to work. at the moment I am trying to workout step 4 by using bounding boxes made from the original geo to select the new resampled walls and place them into sections. I want to bound them and in the groupSOP name the sections per iteration of the foreach node they are inside. finding the correct syntax for this has been a problem so any help would be greatly appreciated. Ill be keeping this thread alive over the course of my findings. Cheers Az BuildingGenerator.hiplc 1 Quote Link to comment Share on other sites More sharing options...
Azuril Posted February 21, 2018 Author Share Posted February 21, 2018 Ok, so looks like the trusty facet with cusp polygons enabled gives me the sections! *so simple* Now I am trying to do step 7 - randomly picking pairs and triplets of faces and grouping them, leaving the stragglers as 1x pieces.. any ideas let me know. Quote Link to comment Share on other sites More sharing options...
Atom Posted February 21, 2018 Share Posted February 21, 2018 (edited) Here is a possible solution for step-7. Using custom code in detail mode of a wrangle. Here a random number is generated 0-2. Then each primitive is skipped for that amount of primitives and then added to a related group. After processing three groups are available. typeOne, typeTwo, and typeThree. Then you can proceed to step-8 processing. ap_BuildingGenerator_STEP-7.hiplc Edited February 21, 2018 by Atom 1 Quote Link to comment Share on other sites More sharing options...
Azuril Posted February 21, 2018 Author Share Posted February 21, 2018 Thats fantastic thanks @Atom! Im using it now, but am trying to change it so that sections of 1 will show up more often. It seems extremely rare. maybe its just the nature of the algorithm that you get 1's bunched together because they skip past the prims that have already been allocated? On the note of this, how do I go about then detatching the primatives by group? I can easily enough make all new groups using a partition.. but ideally I would want to break off the edges seperately (done using a group by edge angle, step 6 ) then copying that group back to the sectioned prims (step 4) so then i am left with the correct sections, but an attribute on the edge boundaries. Now I am looking to separate all of the different parts by edge and type (1/2/3 width) Quote Link to comment Share on other sites More sharing options...
Atom Posted February 21, 2018 Share Posted February 21, 2018 (edited) I did notice that section 1 were not generated that often. I guess it is because there is no need to implement the counting step if you have one section. Just add it directly to the group and reset for the next possible section count. int panel_count = 0; int panel_match = -1; float rnd_seed = ch("rnd_seed"); vector rnd_Cd = set(0,0,0); for(int i=0; i<nprimitives(0); i++) { if (panel_match==-1) { // Time to randomly pick a new count to match for the next set of primitives. panel_match = int(fit01(rand(rnd_seed+i),0,2)); rnd_Cd = set(rand(rnd_seed+i+801),rand(rnd_seed+i-311), rand(rnd_seed+i+512)); setprimattrib(0,"Cd",i,rnd_Cd,"set"); panel_count = 0; if (panel_match==0) { setprimgroup(0, "group_typeOne", i, 1, "set"); panel_match=-1; } } else { // We are in the middle of a count, time to increment. panel_count += 1; if (panel_count > panel_match) { // We have matched our count, reset so we can pick a new count on next loop. panel_match = -1; } setprimattrib(0,"Cd",i,rnd_Cd,"set"); } if (panel_match==0) setprimgroup(0, "group_typeOne", i, 1, "set"); if (panel_match==1) setprimgroup(0, "group_typeTwo", i, 1, "set"); if (panel_match==2) setprimgroup(0, "group_typeThree", i, 1, "set"); } Edited February 21, 2018 by Atom Quote Link to comment Share on other sites More sharing options...
Azuril Posted February 22, 2018 Author Share Posted February 22, 2018 (edited) OK! step 8. I have a way to extract the lowest point and make a new one to be used as the copy stamp position for switching out modular pieces - almost there! The last 4-5 hours or so Ive been banging my head around trying to sort out how to sort these points so they are ALWAYS the lowest in the bottom left corner (when looking from the front) The way in which I would like to do this, and have been searching around an answer for - is to use the sort by vector, and have the vector at 1,1,0 assuming the normal is 0,0,1 How one goes about this though is a complete mystery to me. perhaps packing the pieces, rotating them to 0,0,1 - doing the sort then unpacking and returning the original rotation could be an option? How would one go about this? Otherwise if there is a more elegant solution I would love to know... Thanks BuildingGenerator.hiplc Edited February 22, 2018 by Azuril added hip Quote Link to comment Share on other sites More sharing options...
chabis Posted March 28, 2018 Share Posted March 28, 2018 hi, all that is very interesting. that's funny because i'm working on something very similar. i've not choose exactly the same way, but the idea is the same . now, i'm at time to create switch to replace ramdomly (or choosen by user) each part. Quote Link to comment Share on other sites More sharing options...
Fenolis Posted May 5, 2018 Share Posted May 5, 2018 Point Sort > By Attribute > uv? Quote Link to comment Share on other sites More sharing options...
chabis Posted May 5, 2018 Share Posted May 5, 2018 some news: i have ended my first try: @fenolis... what is your question ? Quote Link to comment Share on other sites More sharing options...
Fenolis Posted May 5, 2018 Share Posted May 5, 2018 (edited) Ah. I was replying to a comment >2 months old regarding the point sorting order. I thought perhaps sorting by uvs would cause the smallest number to always be in the same position. Edit: Cool model, by the way. Missing proper normals on the windows but I like the style! Edited May 5, 2018 by Fenolis Quote Link to comment Share on other sites More sharing options...
chabis Posted May 5, 2018 Share Posted May 5, 2018 ok ! (probably a good idea to sort by UV) Quote Link to comment Share on other sites More sharing options...
domsewell Posted October 9, 2019 Share Posted October 9, 2019 @chabis im super intrigued on how you handled swapping out a particular modular piece that could be chosen by the user? I'd appreciate any information you could share on it Quote Link to comment Share on other sites More sharing options...
chabis Posted October 9, 2019 Share Posted October 9, 2019 @domsewell you can have some lists of choice in the UI of your asset. you can construct this list by looking in a directory in python and offer the choice to the user to use a geometry or an other. and more, you can dynamically change the UI to offer to the user, some choice for each part you want. Quote Link to comment Share on other sites More sharing options...
domsewell Posted October 9, 2019 Share Posted October 9, 2019 @chabis Hi thank you for your reply, Although i do understand the concept that youre describing here im still totally lost in the woods in terms of implementing it. Is there any possibility you could provide an example of this method or perhaps a tutorial to start from? Thanks again i appreciate it. Quote Link to comment Share on other sites More sharing options...
chabis Posted October 9, 2019 Share Posted October 9, 2019 @domsewell sorry, but i have no time to do a tutorial like this. it's a complex process mixing a lot of vex and a few part of python . it take more than three months to have a complete system (include load/save building's modification for all the stuff ) not finish at this time (a long way is in front of me) but the "base" is here. "it's not easy , but that's why we like that" 3 Quote Link to comment Share on other sites More sharing options...
Drughi Posted October 10, 2019 Share Posted October 10, 2019 (edited) Congratulations! Looks really good and clean. How do you place the windows and doors etc? How do you cut away whats behind the window? I see there is a double Edge where the windows are. Are those small Polys where you hide the ngon from cliping away the space for the Windows? Edited October 10, 2019 by Drughi Quote Link to comment Share on other sites More sharing options...
chabis Posted October 10, 2019 Share Posted October 10, 2019 thanks, at this time, door, windows etc.. are pre modeling (.obj) for some of them and for others (the simpliest) are builded directly in houdini. the rest is builded directly. so the user could call his own collection of obj (door, windows,etc) regardless of the style he want for each element to include (door, window...) there a specific size and a hollow in the wall, as deep than you can open the window for example 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.