I've tried some of the normal thief scripts with 3ds max 2018 but some don't work and others cause crashes. Has anybody got a script that works with 3ds max 2018 that i can use to transfer normals from a sphere to my tree branches ?
From a sphere? In that case, you don't need a mesh to transfer the normals from at all, just a center point position. Assuming the selected object is an editable mesh, something like this should do the trick (probably with a different centerPos value):
centerPos = $.center
for vert in $.vertices do setNormal $ vert.index (vert.pos - centerPos)
update $<br>
I found this one here a while ago, uses the working pivot instead of $.center - which I found quite smart - and works on Editable Poly instead (no modifier stacks unfortunately, though):
It works fine on simpler modifier stacks (albeit with script errors) yeah, but has been regularly crapping out on me when confronted with more "unorthodox" usecases. For instance, I'm playing around with the "Mesh Mixer" MCG included herein , which can combine several existing meshes in order to make them appear as a single mesh to Max - which makes more procedural stuff a bit easier - but all of the NormalThief scripts stumble over its Meshtype I guess (crashing my viewport in the process ) ..
@cptSwing Not that i'm taking offence, but i'm not a developper, and i've made this script 5 years ago, for a specific case. And true, it's barely protected against crashes.
Would you mind to share a simple scene with your mcg setup ? With the source object and the target object.
I've made a temporary ugly fix linked below, looks like it's working. Atleast it shouldnt crash the viewport
but i should retake that script entirely, or see if there are smarter solution than maxscript now (maxplus). I can't believe it's still not included. AD nonsense once more.
I guess you'd use meshmixer to make the leaves mesh from solo cards ? Because the trunk certainly shoudnt be included in the normals projection.
i feel ashamed to script when i see an algo by denisT, Polytools,Klvnk...
i'd use snapshot function. It creates a snapshot of the top level mesh, and preserve the highest level selection. I can perform operations on those without messing with original objects/stack.
By then i was only replicating normal thief behaviour, which finds the normal of the closest vert coz i didn't want people to get a different result.
But it would be more accurate to get the normal of the closest point on face.
So i basically rewrote it. The script project normals only on selected faces. Or all faces if none selected.
I use the closest whatever point normal on the source object, and not the closest vertex normal anymore, which gives as expected a much better result. It's fast and compatible with mesh and poly.
Yes edit normals is a massive pain.
I'll ran some more tests before releasing on scriptspot but i'm fairly happy, so posting a pic !
Would love to see same thing for Blender. Maybe as a paid addon on Blender market.
Blenders native Data Transfer modifier could do same but kind of less reliably with normals sometimes split and not exactly same direction as in source object.
It's one rare thing I had to switch back to Max sometimes
To my knowledge there weren't tool doing this properly in Max. Except VertexNormalToolkit but it's very new, and while it has good ideas, it feels lil clunky and it does stuff i'm not sure to like (like collapsing the stack).
I've updated the script to 1.1.1 with a small bug fix when source objects have transformations (which was in fact the cause of my earlier post bug)
One thing i didn't address tho, is that i don't split normals per vertex during projection. If you need several normals per vertex (for instance on my picture above, verts between the sphere surface and the cylinders surfaces) you have to use 2 different smoothing groups on your object. (Could be a modifier.)
If you use only 1 smoothing goup on base object, even with 2 projections on adjacent faces, you'll get only 1 normal per vert.
Hope i'm making sense...
I'll add normal split eventually, but atleast there is a workaround.
Would love to see same thing for Blender. Maybe as a paid addon on Blender market.
Blenders native Data Transfer modifier could do same but kind of less reliably with normals sometimes split and not exactly same direction as in source object.
It's one rare thing I had to switch back to Max sometimes
if it doesn't work well, you should really let the devs know! Ideally with some examples to prove your point.
Would love to see same thing for Blender. Maybe as a paid addon on Blender market.
Blenders native Data Transfer modifier could do same but kind of less reliably with normals sometimes split and not exactly same direction as in source object.
It's one rare thing I had to switch back to Max sometimes
if it doesn't work well, you should really let the devs know! Ideally with some examples to prove your point.
Sorry for the misinformation. Looks like it works just fine in current version of Blender. I couldn't recreate the issues I had before anymore.
Replies
I found this one here a while ago, uses the working pivot instead of $.center - which I found quite smart - and works on Editable Poly instead (no modifier stacks unfortunately, though):
https://mixescript.blogspot.com/2013/04/foliage-models-often-require-edited.html
http://wiki.polycount.com/wiki/VertexNormal#Noors_Normal_Thief_MAXScript
The script project normals only on selected faces. Or all faces if none selected.
I'll try to fix this over the week-end.