Jump to content
jeff prince

VW imageprops texture export issue or something more nefarious?

Recommended Posts

I have some custom plants intermixed with stock VW plants(the ones in the rightmost rectangle)

917758660_ScreenShot2020-05-22at6_23_54PM.thumb.png.6a6913ef0508f5528614b75e7d0ec680.png

 

When I export them to TwinMotion using C4D, note how some of the object have a black background where it should be transparent.

433725761_ScreenShot2020-05-22at6_23_26PM.thumb.png.04ff8ef9c9e75cb68a6b09ac5f9f6f33.png

 

The image props were constructed by masking a photograph in Photoshop and/or Affinity Photo to create a texture and saved as PNG with a transparent background.  The imageprops were created in VW by using the aforementioned texture file with the options shown in these dialog boxes.

29488914_ScreenShot2020-05-22at6_35_39PM.thumb.png.91dec9ee95a6dfcca5a29cf34bb92adf.png

 

Everything behaves as expected in VW, but the black in place of alpha rears its head when VW is exporting the textures.

Note the image below.  On the left is how my plant with alpha appears outside of VW, as created by me.  The same plant as it appears as a texture exported from VW, either via extract image or C4D export.  The tree on the right is a default VW tree image prop exported via C4D.  

 

1455925893_ScreenShot2020-05-22at6_43_17PM.thumb.png.3d09d2e8348df14441a77549ad333ad7.png

 

I suspect something is slightly different with the alpha channel or image definition, I just can't figure out why the images I am creating are behaving this way.  I'm beyond frustrated by this mystery.  Any help is appreciated.

Share this post


Link to post
13 hours ago, jeff prince said:

When I export them to TwinMotion using C4D, note how some of the object have a black background where it should be transparent.

 

 

Interesting !

In my tests I have only seen NO transparency so far.

While in Enscape their transparency works out of the box.

So I thought Twinmotion would use other black/while mode

than Vectorworks.

 

Similar has been the case for C4D standard vs VRAY4C4D standard.

Share this post


Link to post

I might be wrong, but it could be that your Mask Source should be Transparent Color...

 

hth...

  • Like 1

Share this post


Link to post
2 hours ago, Frank Brault said:

I might be wrong, but it could be that your Mask Source should be Transparent Color...

 

hth...

Thanks for the idea.  I have been using png with no background and an alpha channel

Here is a test with using the transparent color method, same result 😞

This is driving me mad...

Everything works as expected in vw.  I attached my test file below.

968971355_ScreenShot2020-05-23at8_13_32PM.thumb.png.8e494a301571fdb68e3548dac7bc988e.png

 

Imported into Twin Motion via C4D.... The image props I made in VW have issues, the VW plant does not.

1722996297_ScreenShot2020-05-23at8_12_55PM.thumb.png.7add43541427b785cd4fc7353d208f27.png

transparency test.vwx

Share this post


Link to post

so I did yet another experiment...

I compared the textures exported by VW to C4D, looking at both the composite alpha and background alpha channels.

In the image I prepared with a transparent background, the composite and  background alpha channels both indicate the cutout for a plant.

When I look at the same image generated by VW upon C4D export, the same alpha channels appear totally white, thereby generating the black boxes seen.

In the example below, I opened up the exported image for its texture, added the mask back in, resaved the PNG, and then reloaded the TwinMotion scene.  Magically, that plant now works (the other two plants with the black boxes are using different textures even though they look identical.

I think this gives a little weight to my theory that VW is doing something strange when exporting the textures.

That, or my process for creating images is flawed.

So here is my workflow for creating plant images.

  • take a photo of a real plant with my camera.
  • start with a blank psd file with a transparent background
  • paste in the photo I took
  • remove the unwanted pixles by erasing them, revealing the transparent backgound
  • save the psd and export a png file with its built in alpha channel
  • create an image prop in vw using the png file I just saved, using the mask from Alpha option.
  • export the model to C4D
  • import the C4D file into TwinMotion

The textures VW exports does not look like my source png files used to create the imageprop.  Confusion reigns.

928644068_ScreenShot2020-05-23at8_56_44PM.thumb.png.c6da0279dcffd2d5673879ed867890d7.png

  • Like 1

Share this post


Link to post

Hello jeff prince:

Can you attach the C4D file (including Textures folder for the C4D) you are importing into Twinmotion?

 

  • Like 3

Share this post


Link to post

@Dave Donley

Hey Dave,

Here are the attachments you requested.  

 

The procedure I used to create that imageprop of the hesperaloe is as follows:

1. start new VW document

2. "Create Image Prop" command

3. use the file imageprop-source.png as the basis for the prop

4. use default settings to create the imageprop and select "Use Mask" option - create mask

5. create mask from "reuse image from another resource - this prop's color

6. Source for mask = alpha channel

7. prop created

 

I created an all new test with a brand new image prop made from scratch using the imageprop-source.png file attached.

The other images were generated by Vectorworks during export to C4D.  You will note the source file has alpha channel and a clear background while the images created for the same plant has a black background in the exported texture.  That seems to be where the problem is.  It is also noteworthy that the default Vectorworks plant did not create this black background for the texture file.

 

I have 100s of custom plant images with alpha channels created like this sample which I hope to make custom plant object from.

Additionally, I am building a library of around 30 3D modeled plants that use images like this for textures that I hope to use for a custom library.  While most of these work fine within the Vectorworks environment, exporting to C4D is where the trouble starts.  My goal is to identify how to solve this issue so I can have a productive workflow to TwinMotion using my native and custom Vectorworks plants.

 

Thanks for any insights on how to fix this, including flaws in my process or source images.

 

thanks,
Jeff

Prop Ligustrum vulgare 0.9 S RT Color.png

Hesperaloe parviflora-1 Prop Texture Transparency.png

Prop Ligustrum vulgare 0.9 S RT Transparency.png

Hesperaloe parviflora-1 Prop Texture Color.png

imageprop-source.png

Untitled 2.c4d Untitled 2.vwx

Share this post


Link to post

The plants look fine in C4D I am wondering about the conversion from C4D to Twinmotion.  Maybe Twinmotion doesn't import them from C4D properly.

 

Does it matter if the image is set to Glow or not?  By default they have Glow so they have consistent flat shading.

 

Share this post


Link to post

 

@Dave Donley

Thanks for looking into this.

The image prop I created automatically set Glow the same as the VW stock plant.

I also turned it off as a test, same result.  So Glow does not seem to be a factor.

 

I don't think it has to do with how Twinmotion imports the C4D based upon the test I did with my plants and a default Vectorworks plant.  In that example, the VW plant was fine in Twinmotion, but my plants are not.  Vectorworks seems to be changing my image file's alpha channel when exporting to C4D  format.  I'm fine with changing the way I make my plant images and textures, I just need to know the best practices before doing so.

 

Here is another example.  I purchased a textured 3D model of a plant in OBJ format.  It uses texture files, a base image and an alpha channel image.  When directly imported into Twinmotion, it looks fine.  When the same model is imported into VW with the same texture references, it too looks fine.  I hope to create a design in VW using this and many similar models.  However, when I export that same model from VW to C4D format and import it into Twinmotion, welcome back black boxes 😞  I think this further strengthens the argument that something is happening during the Vectorworks export process.

 

Here is the OBJ model loaded into Vectorworks, looks fine.  Note the use of alpha channels for the thorns and flowers

486207146_modeltoVW1.thumb.png.10f8755f618c2529240dd0b501cda277.png

 

 

Here is the same OBJ model directly imported into Twinmotion.  Note how the thorns look fine and are using the alpha channel correctly.

1996219698_modeldirecttoTM.thumb.png.3b40f508353ae55f70d907a0e5da18ab.png

 

And here is the OBJ imported into VW earlier and then exported to C4D format.  Note how the thorns and flowers now have black where they should be transparent.  The only thing I did was export it from VW....

1364075290_modeltoVWtoTM.thumb.png.3bd71e698f58b0681ebb5e49fd8bf6c2.png

Share this post


Link to post

What does this attached file look like imported into TM?

 

If the alpha image is being imported correctly it should not matter what the background colors are in the color image.  The color and alpha are separate images.  If the alpha pixels are black then you should see clear - the alpha of the color image shouldn't matter because it is only supposed to use the RGB not the A.  The A comes from the alpha channel image which I think looks correct (white plant black background pixels).

 

 

Plant with Alpha.zip

Share this post


Link to post

For this file I just used the alpha and color image files from VW exporting to C4D.  The color image and alpha image both have black background.

 

In your image above the two sides of the cube look dark.  (this is a C4D cube object)  Is there a control for "double-sided materials" in TM for the import?

 

If you want, I can look at a few example image props from your library to make sure they show correctly in C4D.

 

 

Screen Shot 2020-06-01 at 5.11.28 PM.pngScreen Shot 2020-06-01 at 5.11.25 PM.png

Share this post


Link to post
Posted (edited)

@Dave Donley 

Why does Vectorworks add a black background to an image that originally had a transparent background?

This seems to be the source of the issue.

 

Here is the source files I used for the imageprop.  Note, it has a transparent background and an alpha channel.

 

 

Hesperaloe parviflora.png

Edited by jeff prince

Share this post


Link to post

@Dave Donley

 

I'm at a total loss here.  It seems that VW export to C4D is doing something here.

In the example below, the plant with the black box is imported from VW->C4D export.  The two plants w/o the black box have been retextured in Twinmotion using my original png with transparency.  I don't know what goes into the programming of these tools, but it seems like it is a simple switch that is being flipped without my permission 🙂

Screen Shot 2020-06-01 at 4.31.47 PM.png

Share this post


Link to post

The problem remains unresolved and I hope to hear an explanation.

 

Until it is resolved, I developed a work around involving a bit of unnecessary labor that I hope is eliminated.

I have to go into the texture folder that Vectorworks creates during C4D export and manually look at each texture to figure out which ones VW decided to modify by adding a black background.  I then take a copy of my master texture image used to create the plants, rename it to match the VW exported texture name, and replace the VW generated texture with my master.  This automatically loads in Twinmotion and I can then get to work.  Sure would be nice to know why VW is doing this in order to eliminate this unnecessary step.

 

Here's a test of the 3D plants I have been working on with the texture replacement work around I just described.  It's effective, but takes unnecessary time that the computer should do automatically.  I'm really just trying to develop a successful workflow to add fairly realistic 3D representation of my plants into Vectorworks Plant Objects and fulfill the promises of landscape BIM.  For this to be effective, the assets need to survive export to other rendering engines and then survive inevitable updates to the VW model exported back to Twinmotion.

 

 

 

  • Like 2

Share this post


Link to post

@Dave Donley, I am not sure if it is related, but I had similar problems with VB Libraries. On some of the images there was some sort of special mapping that could only be fixed with the Gimp disabling "Save color values from transparent pixels" during export.

Perhaps it helps.

 

 

1098000737_ScreenShot2020-06-10at08_23_10.thumb.png.4a8b5092c033222d77d00f1ee6bde30b.png

Share this post


Link to post

I set this problem on the shelf hoping a solution would manifest itself, it has not.

I sure wish someone from Vectorworks could shed some light on this problem, even if it something broken with my workflow.

Share this post


Link to post

@Dave Donley have you discovered anything with this.  I was hoping to work on my plants in a week or so, but have been holding off due to this alpha channel issue.

Share this post


Link to post

I contacted Twinmotion tech support.  Twinmotion apparently does not support separate alpha maps.  The alpha channel needs to be part of the diffuse color map image.  This Twinmotion limitation would require a code change in Vectorworks to put the alpha pixels into the color map, just in case you take the textures to Twinmotion.  I will be looking for how to incorporate this info so that you have a nicer experience.  Until then the color image must have the alpha channel pixels in it, for Twinmotion to understand the mask.

 

 

  • Like 2

Share this post


Link to post

@Dave Donley Thank you for your reply and continued interest on this.

Forgive my ignorance, but I must not understand what you mean.

 

When I export to C4D, it creates two image files, one for Color and one for Transparency.

For VWX default plants:

The Color image of the plant and has an embedded alpha channel representing the background.  The Transparency image shows the background as black and the object as white.  It imports into Twin motion just fine and I doubt that Twin motion uses that Transparency file since the Color file has the alpha baked in.

 

For my image props created from edited photos:

I create an image with the same properties as the VWX Color image, the alpha looks identical.  However, when I export to C4D, VWX alters my Color image’s alpha channel, turning it black.

 

I’m struggling to know why this is because it makes no logical sense in my mind.  I’m just not seeing how my images are different than the VWX library’s plants.  This is why I’m going nuts, it has nothing to do with Twin Motion, it’s happening during VWX export.  Twin Motion does a great job importing the Color image with an embedded alpha.  The problem seems to revolve around either VWX export changing my alpha OR some flaw in the method I am using to make these images.  If it’s me, I just want to know how to make my images properly.  If it’s VWX, this could be a larger problem that few have noticed.

 

Thoughts?

 

Share this post


Link to post

The entire point of a separate alpha mask is that the alpha pixels values in the diffuse map should be completely irrelevant to the renderer.  The alpha mask and only the alpha mask should be required to get a masked texture in a rendering.  Twinmotion does not understand separate alpha masks.  Vectorworks assumes a renderer can understand separate alpha masks correctly.  Modifying the alpha channel in the diffuse color map would normally be irrelevant, but is not for Twinmotion.

 

I will look to see where we change the alpha channel of the diffuse maps.

 

  • Like 2

Share this post


Link to post

@Dave Donley is there a specification for how to make the image props VWX includes in the program?  Let say VWX decided to have a staff member or hire a company to make a library of plants, I imagine you guys would require the responsible party to produce the textures that meet a set of standards guaranteed to work with VWX.

 

Reason I ask...

 

I just opened the Color file VWX exported for a default VWX plant and pasted my texture into it using a photo editor.

I then saved this file to effectively replace the default VWX texture.  I then opened up the C4D export file in Twin Motion and it works fine, mapping my texture onto the VWX plant with transparency.  This leads me to believe that there is some magic formula I am not aware of for making textures and/or image props suitable for export.

 

Maybe the solution is a very simple setting that I can’t seem to be able to identify.

Share this post


Link to post

oops, forgot to include the images

VWX plant on left, my plant on right

1382340025_ScreenShot2020-06-18at1_44_23PM.thumb.png.73b5e70ee9046929d66f78e8b20d7b0f.png

 

Hacked VWX plant texture on left using the same source texture used on the plant on the right. (proportions are different of course)

1803405353_ScreenShot2020-06-18at1_42_33PM.thumb.png.27516265efb4fb18ca3a8f7f4c64f21f.png

  • Like 1

Share this post


Link to post

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

  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.


 

7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114

 

© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

×
×
  • Create New...