Textures missing from animated trees

Started by rolland1013, February 20, 2024, 01:15:50 PM

Previous topic - Next topic

rolland1013

I've done this many times before with no issues, but now I can't get the textures to render after frame 1. This is the first time trying this with build 4.7.19. I didn't find anything in the documentation that addresses this. Has anyone run into this problem? Is there a workaround? As a test, I rendered an image sequence with a static tree, and it rendered fine. The tree asset is SpeedTree that is run through Maya to create the .obj geo files. An .mtl file is created for each geo file. I also change the incoming .obj file  name from SampleTree.0001.obj to SampleTree.%04d.obj

Kevin Kipper

#1
Hi rolland1013,

Out of curiosity, are the MTL files named the same as each object in the sequence, i.e. SampleTree.0001.mtl, SampleTree.0002.mtl, etc.?  Are the texture paths in each MTL file correct?  Also, if this is for a population, is Repopulate Every Frame enabled in the populator node?

rolland1013

Hi Kevin,

Yes, the MTL files are named the same as each object in the sequence: SampleTree.0001.mtl, SampleTree.002.mtl., etc. 
The MTL files are in the same directory as the geo files. Actually, that brings up a question, is there a place to specify the MTL files? If so, I'm unaware of it. 
This is a population, but Repopulate every frame is not enabled.

Kevin Kipper

I just ran a couple of tests in Terragen 4.7.19, first exporting an OBJ directly from Xfrog with an MTL file.  This is my base object and MTL file.  It has textures which are located on another network.

I copied the base file a few times, renaming each new object to myTree.0001.obj, myTree.0002.obj etc.  I did not duplicate the MTL file, there is only the one.

Individual object test
I loaded the base object into Terragen via Add Object > Populatable Object, and manually changed the Filename parameter under the File Read tab to include the number variable, for example, myTree.%04d.obj. 

I was able to advance the timeline and render the tree with textures.  I only received a warning when I advanced the timeline past the last object in the sequence and hadn't set the Sequence last parameter to the last object number.

Population test
I loaded the base object as a population.  Under the object reader node for the population, I manually changed the Filename parameter to include the number variable.

I got the same results, advancing the timeline and rendering frames.  The objects and textures were visible unless I advanced past the last object in the sequence and hadn't set the Sequence last parameter value.  In this case the trees didn't render at all.

I was also able to save, reload and render the Terragen project file without any issues.

Possibly try using just one MTL file for the whole sequence.

rolland1013

Okay, I tried one MTL file, but I'm still getting the same result. All textures are missing after frame 1. Is your single MTL file named like this: SampleTree.0001.mtl?

If you want to look at my file, I could send it to you, as well as 10 frames of the Speedtree asset sequence.

Kevin Kipper

No, the MTL file is the same name as the base object.  For example myTree.mtl

I'd be happy to look at the project file.   Feel free to send it to support@planetside.co.uk or send us a download link.

rolland1013

Using an MTL without the frame number is giving me a different issue. The textures on frame 1 now appear white, but the other frames are still black. I'm going to send you the files: .tgd, and the Speedtree geo and mtl sequence.

rolland1013

Kevin, 

I had the files sent over to you a little bit ago.

Dune

Won't it be possible to save the sequence as .tgo and use that instead?

rolland1013

I haven't done that before. Do you think it would fix the problem? If it does work, then great! But for more complex scenes, adding another step in an already complicated process sounds painful. 

My process for importing animated trees
1. Create asset in SpeedTree, then export out as an FBX
2. Bring into Maya. I do this with a custom script that fixes all the texture paths before exporting out an .obj sequence. (which can take hours if the asset is complex and/or is a long animation)
3. Import into TG

Kevin Kipper

It appears that the issue of the first item in the object seqeuence rendering properly and the remaining items in the object seqeunce rendering as black, has to do with material groups in each OBJ file.  The first object in the sequence includes the material group, but this information is missing from the other objects in the sequence.

This will definitely cause problems on a render farm.  The tree objects for frame 1 will render correctly no matter which render node is assigned that frame because their material groups have been specified in the OBJ file, but as the other frames are picked up by the render farm, which loads a different OBJ file in the object sequence, the material group information is not available to them and they render as black objects. 

30471_OBJ_MaterialGroups_Comparision.jpg

Dune

Might be worth a try to save as tgo, but I wouldn't know if it would solve the sequence issue. It's another step indeed, but maybe worth to try if obj stuff don't work properly.