Jump to content

Split an object by class attribute into separate geometry nodes in Python


DHartleRyan

Recommended Posts

Hello

 

I am new to Python. I have been avoiding it for sometime.

I have an object which is split into 100 tiles via connectivity and a class attribute which I would like to export into Unreal engine but as 100 separate static meshes. Therefore I would like to split the geometry into 100 different Geometry nodes in a subnetwork, appropriately named.

How would I go about achieving this using Python?

 

Thanks in advance

 

 

Link to comment
Share on other sites

20 hours ago, konstantin magnus said:

Hi Daniel,

maybe this thread could get you started:

 

Thanks Magnus, you're a wonderful fellow. This worked great, I seem to be doing the exact same project you did 3 years ago.

To anyone reading. To add a Python expression to your Geometry File Path, you need to set the node to Python instead of H script (top right hand corner) then KEYFRAME THE PARAMETER (alt left-click Geometry File input) then you can add your Python expression. I am new to Python so created the file path in VEX then promoted it to a detail attribute and used.

hou.pwd().node("../ReplaceWithNodeWithAttribute").geometry().attribValue("ReplaceWithDetailAttribute")

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...