Crowds - Agent Unpack to fix Normals, and Repack/Assemble?

   3362   7   0
User Avatar
Member
10 posts
Joined: Aug. 2018
Offline
Hi all, the FBX export/import of my character seems to muck up the normals. Is there a way wrangle/unpack/etc to fix these and reassemble the agent?

I can dive into the imported FBX object and add a Normal node, but this could be an issue if changes are made to the FBX and it needs to be reimported. I'd have to do that every time to every FBX that's brought in, bleh!

If you think I'm missing something in the Maya FBX export that would fix the normals, please let me know!
User Avatar
Member
2536 posts
Joined: June 2008
Offline
Couldn't you use setprimitinstrinc on the normal?
http://www.sidefx.com/docs/houdini/vex/functions/setprimintrinsic.html [www.sidefx.com]

You could unpack the original, set the normal then set the intrinsic attribute from the derived new normal.
Using Houdini Indie 20.0
Windows 11 64GB Ryzen 16 core.
nVidia 3050RTX 8BG RAM.
User Avatar
Member
10 posts
Joined: Aug. 2018
Offline
Thank you, Enviob! I feel like this is the right idea.

I'm uncertain how to proceed in the wrangle since I can't find an intrinsic “normal” or “n” attribute.

What I have so far isn't breaking, but it isn't fixing the normals either.




int totalPrims = nprimitives(1);
int nPrim=0;
for nPrim<totalPrims{
//setprimintrinsic(int geohandle, string name, int prim_num, <type>value, string mode="set")
setprimintrinsic(0,"n",nPrim, "60", "set")
nPrim+=1;
}
Edited by Totheroo1 - Oct. 26, 2018 12:32:59

Attachments:
normalsWrangl1.PNG (66.5 KB)
badNormals1.PNG (91.5 KB)

User Avatar
Member
2536 posts
Joined: June 2008
Offline
I think you have the attribute named wrong, use capital “N”.

Try this in your primitive wrangle.
int success = 0;
int totalPrims = nprimitives(1);
for (int nPrim=0; nPrim++; nPrim<totalPrims){
    // Fetch normal from input 1.
    vector tempN = primattrib(1,"N",nPrim,success);
    if (success==1){
       // sucessful fetch of data, time to assign.
       setprimintrinsic(0,"N",nPrim, tempN, "set");
    }
}
Edited by Enivob - Oct. 29, 2018 09:46:19
Using Houdini Indie 20.0
Windows 11 64GB Ryzen 16 core.
nVidia 3050RTX 8BG RAM.
User Avatar
Member
24 posts
Joined: Nov. 2006
Offline
Hi, I'm having the same problem, but the
Try this in your primitive wrangle.
does not work on my agent.
Anything I can do?
Edited by scorpes - Nov. 22, 2019 08:30:44
User Avatar
Member
24 posts
Joined: Nov. 2006
Offline
I would like to add a rest position as well, with setprimintrinsic, I cannot get it to work, any help would be appreciated.
User Avatar
Member
14 posts
Joined: April 2019
Offline
Hello,

I have tried the above mentioned method without success.
Was anyone able to make it work or have found a different solution?

Thanks
User Avatar
Member
6 posts
Joined: Sept. 2017
Offline
also having this same issue with none of the above working, anyone ever get a fix?
  • Quick Links