- User Since
- Aug 3 2016, 12:01 AM (101 w, 6 d)
Dec 9 2017
@Swarnadeep Mandal (doublegamer26) Very good, that's great. (Forewarning--I am also a new developer. This was the first task I submitted a revision for, and I have not been too active since then. Also note that I never received feedback on what I submitted. So again, my guess is little better than yours.) Here are my suggested steps, depending where you are starting from:
- Make sure you can build Blender from source. (https://wiki.blender.org/index.php/Dev:Doc/Building_Blender). Also make sure you can efficiently search through the massive code base for names of functions that are not explained well in Blender's documentation.
- To test your code as you write, I would recommend making a simpler scene, such as a sphere-surface and a stick-person. However, for you to replicate my video, I'll attach the blend file I made for it.This blend file includes a configuration for the Align-to-Normal settings in the Shrinkwrap constraint, though of course that setting will not even appear in your Blender until you change Blender's code and rebuild.
- Look up the files that are modified in my revision, and make the corresponding modifications. The constraint.c file contains the workings of the constraint algorithms. The "DNA" and "RNA" have to do with defining Blender's data model and serialization. The .py script in bl_ui creates the settings in the UI panel. (I realize my inline comments are a bit cryptic. Let me know if sending a copy of my geometric analysis would be helpful.)
- (Alternative to 3. which may or may not work) You could try to apply my revision using patch/diff, which are standard Unix utilities. (https://wiki.blender.org/index.php/Dev:Doc/Tools/Patches). If you go to D2154: Shrink-Wrap Constraint: Align to Normal (Option) -- iteration 1, then look on the right hand side of the page, there is a link to "Download Raw Diff"; the .diff file should be compatible with the patch/diff method. However, due to version differences (at the very least, line numbers will have likely changed), I can't say whether this will work.
- Now, finally, what needs to be done: Figure out how to get the vertex normal when the user has forced us into case MOD_SHRINKWRAP_NEAREST_VERTEX. Notice my comment /* XXX target mesh normal is not available from nearest when bvh tree made from verts. */ Finding out what a BVH tree is, and what kind of information is given by bvhtree_from_mesh_verts() or bvhtree_from_mesh_looptri(), was a tedious task. It involved probing the depths of Blender. Unfortunately I remember only what I made notes of; see below.
- Plan how to extend the function to optionally interpolate over surface/vertex normals. Forward thinking here may change how you solve the above problem. For example, you may want to extract information about neighboring vertices/faces for interpolation. Conversely, the locations of neighboring vertices may help you manually calculate the current vertex normal as well. If you can knock out two birds with one stone, that's great.
Dec 8 2017
@Swarnadeep Mandal (doublegamer26): I didn't author the task, so at best I can explain my interpretation of what Campbell wrote. Do you have a specific question I might be able to help with? Also can I assume you are good with 3D math, and that you have also looked at the revision I submitted in Aug 2016?
Oct 18 2017
Hi @Brian Leman (Bleman)! I recently made a video demo of what my revision accomplishes. I added a link to the video in my revision summary: (https://vimeo.com/234564499) (https://developer.blender.org/D2154)
I hope it's helpful to you as you work on it! Cheers~
Sep 14 2016
Here is what I did before I got busy with other things: I found relevant examples and documentation, and I created a workflow to modify and test the code for the operator. I added the property "Generate UVs" to the operator. I discovered that there must be some other way to access the UVs from Python, other than the first attempt made by @Chau (BlenderNavi).
Aug 23 2016
Well I am just learning too... Hopefully I can do something useful. :)
@Chau (BlenderNavi) good start, looks like. Does anyone mind if I pick this up and give it a go?
Aug 22 2016
Sorry to bother you with this, @Bastien Montagne (mont29), I just couldn't find out who is the right person to ask for review (IRC people were nice but unknowledgeable). I figure this is a better way than to scribble on IRC every few hours... :P
Aug 20 2016
Well I finally saw the news that Campbell is stepping away... best of luck to him in his future endeavors. I need to ask someone else to review my code! :)
Aug 17 2016
An animation to display the added functionality.
I am interested to know if this "definition of UP" is satisfactory to other devs/users, so please experiment with the file. :)
Aug 3 2016
Hi! Has anyone done work on this? I'm a beginning developer and I'd like to give this task a go. I have @Robert Fornof (amdbcg)'s question also: Does the modifier need to do anything besides remove doubles?