UNSOLVED Weighted Face Normal twisted

Hi Guys;
I'm trying to get the Weighted Face Normal for the following object:
object.PNG
When I compute and apply the normal I get the following:

object_normals.PNG
object_normals.PNG
I'm using the following python script and I'm running C4D R23.
Any idea what might cause the twisting?
Thank you.
Hanna Frangiyyeh

Hello @honeybadger,

Thank you for reaching out to us. It is a bit unclear to me what you are trying to do due to terminology barriers, missing code, and missing context.

  • When you talk about "weighted normals", I assume you mean Phong normals, i.e., normals which are interpolated over their adjacent geometry elements (and some limiting factors as an angle or dedicated Phong breaks).
  • You also talk about "faces" but actually show vertex normals in your last screen, which one are you interested in?
  • You also say that you "[...] compute and apply the normal [...]". We cannot help you if you do not tell us how you do that. I assume you are trying to write to a NormalTag? If your normals are then misaligned, your computations are then wrong.

You should post your code and clarify these points (if your code does not clarify them on its own). Please also note that we are asking for executable code, as it can otherwise be hard for us to give a meaningful answer.

In general, manually defined normals are also quite an unusual thing to do in Cinema 4D, as normals are ususally only defined implicitly over Tphong tags. You could create a phong tag on an object with BaseObjcect.MakeTag(c4d.Tphong) and then read out the normals generated by this tag with BaseObject.CreatePhongNormals (the method requires a Phong tag to be present on the object). These normals you could write then into the NormalTag.

Cheers,
Ferdinand

Hi Ferdinand,
Thank you for your reply, sorry I thought I included a link to the code. Here is the code link:
https://plugincafe.maxon.net/topic/10259/13749_setting-normals/5
Ok, I will take a look at the Tphong tags.
And I'm sure I will have more questions.
Thank you.
Hanna

Hi Ferdinand,
I just talked to the artist and he said that Phong normal do not translate to Unreal Engine.
Thank you.
Hanna

Hello @honeybadger,

I just talked to the artist and he said that Phong normal do not translate to Unreal Engine.

I am not quite sure what does constitute as "do not translate", but when you are determined doing it yourself, I would recommend using BaseObject.CreatePhongNormals to access the normals of a Phong tag and then write these into a NormalTag. Assuming, this is how you define your normals. When there are no Phong tags in your scene, I would recommend creating them to just be able to access the interpolated vertex normals generated by them.

You can also calculate and interpolate the vertex normals yourself, as done by the user in the linked thread, but unless there is the specific requirment to alter the generation some way, I do not see any need to do it.

The code provided in the linked thread works fine for me on a geometry similar to the one shown by you. There are however some other things which seem problematic with this code. It assumes all polygons to be triangles/coplanar, it ties the normal interpolation to the polygon area and angle in a really weird way, and it does not respect the Phong information which might already be in a scene (Phong angles and breaks). Which might have been intentional decisions for the user then, but strike me as not so good choices in the general case.

I must also point out that we cannot debug code for you, make code of other users work for you, nor write solutions for you. You must come up with a specific problem in a piece of code of your own, and we will then help you to solve that problem. Which could involve us writing a code example. Please refer to our Forum Guidelines for an overview of the support provided here.

Cheers,
Ferdinand

Hi Ferdinand,
First you can't finesse the Phong normal to the same level you can do with the vertex normal. Second, Unreal does not recognize the Phong tag settings.
Also, I forget to mention that script worked in C4D Ver 19.
I will try to got the Phong route and I'm sure I will have some question for you.
Thank you.
Hanna