Jump to content

Creating a custom string of text for ROP FBX Output File field


Recommended Posts

Hello and thank you for looking. I hope I can explain my question in a way that makes sense. 

I have a need to break meshes up into a series of fbx's. I'd like to find a way to store and pass the AssetName, the FilePath and the Piece that I'm exporting and automatically populate that into the Output File field of the ROP FBX node. 

I'm currently splitting the mesh using named primitive groups. Ideally the file path would get populated with something like "FilePath_AssetName_Piece.fbx" but I have no idea how to set that information, call it up and then populate it into the field. 

If anyone has any suggestions, that'd be amazing! 

Thank you. 

image.thumb.png.d403ae544730187c81170da5783e1e44.png

Link to comment
Share on other sites

Hi,

suppose you have geometry box with primitive group "box".

Create detail string attribute, call it 'dirpath' with value of your desired  directory's path to save - "$HIP/geo/"

Create detail string attribute, call it 'assetname' with value of your asset name - "box/"

Create detail string attribute, call it 'filename' and use expression as attribute value:

`primgrouplist(opinputpath(".", 0))`.fbx

In ROP FBX Output use expression in Output Path parameter:

`details(opinputpath(".", 0), "dirpath") + details(opinputpath(".", 0), "assetname") + details(opinputpath(".", 0), "filename")`

I hope it'll help you.

Edited by vicvvsh
  • Thanks 1
Link to comment
Share on other sites

Thank you very much, Victor. That's brilliant, and yet - I'm doing something wrong. I get an error: 
Error:       Unable to evaluate expression (Syntax error (/obj/named_exporter/rop_fbx1/sopoutput)).

It seems like the expression in the Output Path is throwing the error, but I don't see any obvious errors there. 

Thanks again! 

image.thumb.png.58ca0d57fe12daf19d3777a49170ecc9.png

Link to comment
Share on other sites

Expression is fine, I just checked that on my computer. Try to type expression by hand, I'm on linux machine and maybe some problems happened with font code while copy-pasting.
If you click MMB on Output File parameter name what do you see in the text field? This should be expression result as full path to file.

Edited by vicvvsh
  • Thanks 1
Link to comment
Share on other sites

Also, I did try hand typing it out. The color coding matched the copy and paste you gave me so it looks the same. I deleted the copied and pasted text, but the error remained. 

Thanks for your efforts to help on this. 
image.thumb.png.16808261e7162a974cb40dd694b18546.png

Link to comment
Share on other sites

It strange.
For debuging try to past part by part of full expression to check out how it reads each detail attribute. Use MMB on parameter name.

How does expression work in others rop nodes? Sometimes it helps to delete node, create a new one and surprisingly all issues are gone.

In attached file I'm using same expression in Output Geometry ROP and it works, FBX rop doesn't work in apprentice. How does it work on your side?

 

 

fbx_output_path.hipnc

Edited by vicvvsh
  • Thanks 1
Link to comment
Share on other sites

Hello Victor and thank you for your help again. 
I finally just ended up deleting the ROP FBX node and pasting the code into a new one, and it worked! Thanks for that suggestion. I did struggle when i first tried to implement this into a real situation because the asset name part wasn't working. I found that I had a typo. The Attribute create node is setting a name to assetname - but the code in the rop fbx output was looking for assetName. 

Anyway, this works now and you've been a big help. I don't mean to make this more complex - but I wonder if it's just as easy to get the name of the Null node before the final, filename, attribute create instead of having to dive into the att create to define it. The nice thing about doing it that way would be that you have a visual que if you've named something wrong in those last nodes - which I did, ha ha. 

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...