H15 Baking

   26536   75   8
User Avatar
Member
1 posts
Joined: Oct. 2015
Offline
In addition to what Mark has mentioned we could set up the ROP to output the lowres object using whatever format you like. When combined with the script this would let you do post-processing of your asset (publishing into asset tree, conversion to engine, etc.).
The 16th China International Lighting Fair (Autumn Fair) will be held from 22-26 October, 2015 at the Guzhen Convention and Exhibition Centre in Zhongshan City, Guangdong Province.
User Avatar
Member
1104 posts
Joined: Aug. 2008
Offline
@nathes2016, That sounds good. my “preferd” way would be if the ROP could output the lo-res objects as a FBX with the textures baked linked correctly so that when I drag that FBX into Unreal a material with the correct textures are automatically generated from the FBX.

Let me know if my explenation is bad.
/M

Personal Houdini test videos, http://vimeo.com/magnusl3d/ [vimeo.com]
User Avatar
Member
1104 posts
Joined: Aug. 2008
Offline
I downloaded 15.0.276 and noticed that the output UV-object is there and also flipping normal channels, loving it and testing it as write this.

But I am missing the image format output for the extracted image planes? TGA etc. Doing something wrong or it is just not in yet ?
/M

Personal Houdini test videos, http://vimeo.com/magnusl3d/ [vimeo.com]
User Avatar
Member
1104 posts
Joined: Aug. 2008
Offline
Besides the image format for the output planes which doesnt seem to be in yet, i tried using the filter.py provided, putting it beside the .hiplc file. But as evident of the attached screenshot it did nothing. Am I doing it wrong ?

Also another little thing having “.” (dots) in the file name seems to be a must to seperate $HIPNAME and $F but I can see game engines not liking this, would probably be better if you could have a “_” there instead.

oh..and well maybe this is not a issue if the -P filter.py works but the channel name came out inbetween $HIPNAME and $F for some reason, perhaps the python script will be able to solve that but it would be alot better if it came out

CrossA.1.diff_clr.rat instead of CroassA.diff_clr.1.rat so assets that belong togeather are listed besides each other.

And obviously in a perfect world it would be CrossA_1_Diffuse.tga

Attachments:
Filter.JPG (136.4 KB)

/M

Personal Houdini test videos, http://vimeo.com/magnusl3d/ [vimeo.com]
User Avatar
Member
1104 posts
Joined: Aug. 2008
Offline
ops..relized I maybe should put down a new Bake ROP instead of using the old one, and now the TGA shows up. sorry about that.

The other things with the naming and python script renaming is still not working with the new Bake ROP.
/M

Personal Houdini test videos, http://vimeo.com/magnusl3d/ [vimeo.com]
User Avatar
Member
1104 posts
Joined: Aug. 2008
Offline
Another thing I noticed now that I got the .TGAs to work is that it seems like they are all saved in linearspace, which works fine for the normalmap but it makes the diffuse all black inside Unreal, see attached image.

EDIT: there is a workaround for this, by putting a colorcorrection VOP in the shader for diffuse color and putting the gamma to 2.2 and then inside the Unreal shader untick “sRGB” and it will work. But better if it is sRGB from start.

Attachments:
Linear.JPG (89.6 KB)

/M

Personal Houdini test videos, http://vimeo.com/magnusl3d/ [vimeo.com]
User Avatar
Member
1104 posts
Joined: Aug. 2008
Offline
First “real” test inside Unreal, 40 crosses generated and baked by Houdini in around 3 hours.

Check out the video.

https://vimeo.com/143839478 [vimeo.com]
/M

Personal Houdini test videos, http://vimeo.com/magnusl3d/ [vimeo.com]
User Avatar
Staff
3455 posts
Joined: July 2005
Offline
nice!
we should make this Topic sticky - so much great information…
Michael Goldfarb | www.odforce.net
Training Lead
SideFX
www.sidefx.com
User Avatar
Member
1104 posts
Joined: Aug. 2008
Offline
@Arctor, thanks and sure

speaking of information, I learned today that Unreal only reads 4 channels from FBX, diffuse, specular color, normal(called bump) and emissve color.
Or atleast that is what i am told. so project “automate everything” might suffer a bit there.
/M

Personal Houdini test videos, http://vimeo.com/magnusl3d/ [vimeo.com]
User Avatar
Member
110 posts
Joined: May 2015
Offline
@MagnusL3D: Nice video! It is great to see procedural asset creation for assets like this. I can imagine processing an entire environment like this

I've tested the attached renaming script and it is working for me. Are you sure you're using the latest build? Are you specifying the script to Mantra? For example:

mantra -P filter.py test.ifd

I'll look at the naming format for the extracted image planes. We can certainly use ‘_’ instead of ‘.’. At the moment the “quick” image plane toggles use fixed naming (eg. ‘diff_clr’), but we could add a text field beside the toggle allowing you to specify a different channel name (eg. ‘Diffuse’).

The color space is selected based on the image format. 8-bit formats like TGA should be converted to sRGB. EXR/RAT are left as linear. I'm guessing this is the behavior you'd want for Unreal? Or does it accept linear images? I'll look into this to ensure sRGB is being used for TGA.
User Avatar
Member
110 posts
Joined: May 2015
Offline
@MagnusL3D: Just thinking about your automation project, if you do end up with a script that prepares the asset for Unreal would you mind sharing it? It would be a great addition for other folks treading the same path. Provided it is vetted, it may even be possible to include it as part of the Houdini distribution.
User Avatar
Member
1104 posts
Joined: Aug. 2008
Offline
@MDavies, yeah thats the “golden goal” to process entire environments like this, not modelling a single thing but getting z-brush quality hi-res baked to lo-res with Houdini magic

I just used the “mantra -P filter.py” inte driver, didnt touch any test.ifd, is that something I should do ?

Nice if the ‘_’ works. Did you also understand my request about moving things around so the image plane names end up last in the file instead of in the middle ? (but before the extension).

Well..im not sure exactly how Unreal does it..all I know it looked amazingly dark when importing .TGA's until i put down a colorcorrection node in the shader for the diffuse and amped the gamme up to 2.2 (which means if I do a preview render in Houdini I have to pull the gamma down in that window to 1). but even with that I am getting a dodgy result.
Inside Unreal you can specify if a texture is supposed to be treated as sRGB or Linear, but I am guessing that after the import when the textures already have been converted to DDS filers internaly.
But perhaps best if you or the game team test these things to ensure it is working correct, because i am always a bit lost in the whole sRGB / Linear talk anyway.

I dont mind sharing my script, but just for inormational purpose it will only be able to automate parts of what you generally want, due to limitations in the .OBJ file format and Unreal, and even FBX would not be enough since Unreal again is a limiting factor for the auto approach. I am currently myself for Unreal looking at if I can use HDA's in a creative way to solve my dream of automating everything.
But for our game engine here at work it would work more like I have trying todo with Unreal.
/M

Personal Houdini test videos, http://vimeo.com/magnusl3d/ [vimeo.com]
User Avatar
Member
110 posts
Joined: May 2015
Offline
@MagnusL3D: No, all you should need is ‘mantra -P filter.py’ in the ROP. I'll verify that this is working as expected.

I see: in your case you're using $F to signify the asset number. I'm not sure we'll be able to move the separator around like you mentioned as it is hard to agree on a naming format that will satisfy everyone. We could use a ‘_’ like so:

filename.plane.$F.ext
filename_plane.$F.ext

…though in your case you'd still need to rename, so I'm not sure this buys us anything. At least with the ‘.’ it is easy to split the filename on consistent tokens. There may be ‘_’ characters as part of the basename, which would complicate matters. If you're Ok with the renaming script I'd suggest we stick with what is there.

Are there any asset preparation utilities for Unreal, or are you typically loading the components (ie. mesh, textures) into an editor to build the final asset? Is there Python support for Unreal?
User Avatar
Member
1104 posts
Joined: Aug. 2008
Offline
@MDavies, I also tried to start Houdini in admin mode for the ‘mantra -P fitler.py’ but it's great if you verify because more often than not it is me doing it wrong

It would be a shame if you can not move the $F and have the image-plane names in the end because alot of game engines I have worked on automate things based on the object name, and if the textures then are not following the same name standard it will break. Obviously you could write a python script to rename the assets correctly but I prefer things to get out right in the first time to avoid extra steps. (this however do not hold true for Unreal since it just loads what u have assigned in the FBX or OBJ).

The preferd way: filename_$F_plane.ext

Can the renaming python script fix both the ‘.’ and the order that would be perfect ?

The “asset preperation” I am doing now is setting up either a .OBJ or .FBX as correct as possible. then inside unreal you just press “import” select either the .OBJ or .FBX and Unreal will automaticaly import the linked textures from those files and create a Unreal Material with those textures and apply it to the mesh asset inside Unreal.
But it is limited to Diffuse / Specular / Normal(bump) and Emissive, so one can not automate all channels that way and it is a Unreal limitation.

I am trying to juggle both Unreal and our way of working with iDtech here in my statements so it might be a bit confusing at times. Like why would I need a perfect name standard for Unreal since it is just reading linked textures from the .FBX/.OBJ and I dont, for Unreal but for iDtech and other engines do or might do.

I dont know if there is Python support in Unreal, since I just started using it to test this automatic concept at home
/M

Personal Houdini test videos, http://vimeo.com/magnusl3d/ [vimeo.com]
User Avatar
Member
1104 posts
Joined: Aug. 2008
Offline
btw, here is update using Houdini Engine instead of FBX inside Unreal..again running into the same problem with textures and channels. but atleast I didnt have to place all these manually

Attachments:
More.JPG (214.7 KB)

/M

Personal Houdini test videos, http://vimeo.com/magnusl3d/ [vimeo.com]
User Avatar
Member
1104 posts
Joined: Aug. 2008
Offline
@MDavies, Regarding the filter.py I did some tests and it seems I have to write
the following for the script to run at all:

mantra -P $HIP/filter.py

EDIT:
I did some further testing writing out different data to a seperate text file to see if I could figure something out, I also changed the naming output to the “default” setting instead of my $F setup.

Now I am no python master but after some fiddling around I put this code just before the “if len(tokens) == 3:”

myF.write(str(filename)+“ - Token Length:”+str(len(tokens))+“\n”)

Which resulted in this output:

CTEMP/H15/Bake_Test/name_test/CrossA.baketexture2.1001.rat - Token Length:4
CTEMP/H15/Bake_Test/name_test/CrossA.baketexture2.diff_clr.1001.tga - Token Length:5
CTEMP/H15/Bake_Test/name_test/CrossA.baketexture2.spec_clr.1001.tga - Token Length:5
CTEMP/H15/Bake_Test/name_test/CrossA.baketexture2.Nt.1001.tga - Token Length:5


I also inserted a myF.write inside the if statement and that never gets written out.

So could it be that it never enters the if statment since the len(tokens) never is equal to 3 ?
/M

Personal Houdini test videos, http://vimeo.com/magnusl3d/ [vimeo.com]
User Avatar
Member
110 posts
Joined: May 2015
Offline
@MagnusL3D: Yes, it may be necessary to append the $HIP directory to the path to the Python filter. I usually test within the $HIP directly, which finds the filter with ‘-P filter.py’.

Yes, if you've changed the output filename then you will need to adjust the renaming script. The attached will rename files from:

CTEMP/H15/Bake_Test/name_test/CrossA.baketexture2.diff_clr.1001.tga

…to:

CTEMP/H15/Bake_Test/name_test/CrossA_d.tga

It will ignore the base texture:

CTEMP/H15/Bake_Test/name_test/CrossA.baketexture2.1001.tga

Hopefully this works for you; please let us know if you have any other questions.

Attachments:
test_v0001.zip (568 bytes)

User Avatar
Member
1104 posts
Joined: Aug. 2008
Offline
@Mdavies: I changed back to the default naming because I thought the script would work with that, thinking of people just starting out.
Personally I think I have a grasp about it now enough to change it to what I need.

I have a long list at home of things lingering to make this workflow perfect, I could post them when I get home if u want a wall of text ?
/M

Personal Houdini test videos, http://vimeo.com/magnusl3d/ [vimeo.com]
User Avatar
Member
1104 posts
Joined: Aug. 2008
Offline
@MDavies, btw on a side note, the thickness how do I render that out in a regular render? because your image planes show up as extra imageplanes in a regular ROP but doesnt seem to work. Would be wonderful for making flipbook bloodsplashes etc if that thickness worked in regular renders.
/M

Personal Houdini test videos, http://vimeo.com/magnusl3d/ [vimeo.com]
User Avatar
Member
110 posts
Joined: May 2015
Offline
@MagnusL3D: Yes, please post any workflow tips that you're finding useful. It will help others who might be trying to do something similar.

In terms of using the Thickness plane in regular renders, this is not currently supported. You could build your own shader that output this plane, though. Let me know if you need any examples. The baking-specific planes do not show up under any ROP except Bake Texture.
  • Quick Links