One of the characteristics of Python is to be able to be compiled in separate libraries that one can then use as any dynamic library with the advantage of a considerable acceleration of the execution of the code since there is no more interprétion line after line. Other advantage: the code is not readable any more. It is then possible to distribute its libraries without risk to see plundering the original algorithms created for the occasion. These libraries must be in the same repertory as the appealing software.
It is the case of the DLL Subsurf which one owes in Daniel Dunbar.
The principle of the subdivision of surface is rather close to S-mesh de Blender. One does not endeavour here to explain what occurs at the mathematical level in the division operation, and if additional information is necessary one will be able to find it in:
CATMULL, E, AND CLARK, J Recursively generated
B-spline surfaces one arbitrary topological
meshes. Computer-Aided Design 10 (Sept. 1978), 350-355.
The difference: the result is new a mesh
made up of facets whose nodes are calculated compared to the original form
of control. And especially, the form is much softer because the distribution
of the points is adapted to the angle which the faces between them form.
All that is rather complex and the objective of this tutorial is especially to help the users who would not have particular competence in programming.
The file of subsurf.dll contains
a file of example: demo.blend.
By opening it one notes that there is a form precalculated on the left of the screen:
and a script python on the line:
In fact, in script python, these two only lines have importance. Initially, because it is thanks to them that one defines the name of the mesh which must be used as forms of control which is, moreover, quite simply called: " Control " (attention, recall, the python makes the difference between breakages, therefore " control " is not " Control ).
It will be noticed that it is especially the name of the mesh which is significant, the name of the object is rather secondary. An analysis of the code makes it possible to see that only one object can be selected at the same time and that there is evacuation of all the other objects, one keeps only the first of the list.
It is noted that the dictionary " data_dict " passes two values: " flip " and " levels " which are arranged with the article " name " which contains the value " Control ". The command of passage corresponds to the command of arrangement, therefore " flip " is the first and " levels " the second. Nothing is worth the experimental method: that pass-you it if one changes the value of " flip ":
It is necessary to reactualize script by ALT-p and symmetry disparait:
Only value 0 changes something on the choice " flip ". On the other hand one can increase as much as one wants it the value " levels ". A test with 2,
always by reactualizing the execution of script by ALT-p allows to see that division is much finer:
Last note:: any modification of the mesh of control entraine a modifiction of the divided mesh.
Significant detail: the materials of the model of control passed to the divided model. But, insofar as there are more facets, plated textures perdrent their positioning.
With regard to the graphic interface suggested by The IceMan, it is necessary to provide a correct name to the button " Mesh Control "
Dans the file example which accompanies script it is not necessary especially to be mistaken in breakage in the letters.
On the other hand, the file is not related any more to the current frame as in the example of Daniel Dunbar. For having indicated the name, it will be necessary to click " Draw " to obtain the updating of the form.
Script goes perfectly with blender 1.8x,
but raises some difficulties with GameBlender 2.0x, especially because
of the buttons " toggle " which do not remain enclanchés. The parade:
press on the button and slip towards outside without slackening the pressure.
|To the top of the High page of page|
The questions concerning this page can
be put on: