graphic:modeling

Differences

This shows you the differences between two versions of the page.


Previous revision
graphic:modeling [2022/11/03 07:30] (current) – [Image Picture to Model] ying
Line 1: Line 1:
 +===== modeling guideline =====
  
 +  * Model stage from start to finish
 +    - block version: simple model for quick dimession and visual clue
 +    - element version: detail model following modeling guide
 +    - procedural version: detail model rig with feature appearance control and variation control
 +    - script version: script model for script generation models
 +
 +  * time frame for each version
 +    * block version: simple models with projection textures
 +      * use for matchmove, background drops
 +    * element version: detail model with changable modeling guides, uv mapped
 +      * use for camera front use, and interaction
 +    * procedural version: for handful layout use, providing ctrl of variation, based on element verison
 +    * script version: normally only after production finish and made in free time period
 +      * made up with : element library and procedural script and build script
 +
 +===== hard surface modeling=====
 +
 +  * model minimum detail for basic usage
 +  * blocking: 
 +    * curve
 +    * shape
 +    * shader
 +    * basic faces -> volumn
 +  * zbrush boolean and dynamesh (fix initial block topo)
 +    * zbrush import, sub tool, append > Polymesh 3d 
 +      * (Document > ZAppLink - cust to remember cam view)
 +    * dynamesh
 +      * (Tool > Geometry > DynaMesh : start with 128 as resolution, it decide the vtx dense of generated mesh)
 +    * sculpt and deform (s key = size, masking: Tool > masking - inverse+blur)
 +      * hPolish brush (for hard surface, it smooth but keep overall hard surface transitions)
 +      * TrimDynamic (it is like hPolish, but edge is a bit smooth)
 +      * TrimAdaptive (it use start point surface normal, and push the normal continuous and extending surface trend )
 +      * Move (like soft selection move in maya)
 +      * DamStandard (cut into deep)
 +      * Layer (like adding a new layer of clay, alt = remove a layer of clay from model)
 +      * --
 +      * Tool > Deformation > Inflate
 +    * decimation (reduced density for no-detail area, keep detailed area poly count)
 +      * ZPlugin > Decimation Mater
 +      * pre-process current, and choose 20%
 +      * export with (no Grp)
 +    * retopo with quad draw
 +      * make zbrush obj as live mesh
 +      * ctrl+shift+q: quad draw point on live mesh, +shift click inside 4 point to create face
 +      * +ctrl to insert edge loop
 +      * make edge loops
 +
 +cmds for modeling related <code python>
 +import maya.cmds as cmds
 +
 +# toggle display of border edge (border edge), and change border width (4 is good)
 +cmds.ToggleBorderEdges()
 +cmds.ChangeEdgeWidth()
 +</code>
 +
 +  * 3rd party modeling tool
 +    * https://www.highend3d.com/maya/script/cometrename-for-maya
 +    * https://www.playcreative.io/blog/automatic-hard-edge-script-in-maya
 +    * https://www.undoz.com/blog/2014/6/16/hardsoft-edges-to-edge-creasing-maya-mel.html
 +    * https://fansub.gumroad.com/
 +    * https://www.moddb.com/downloads/maya-mel-texel-density-td-script
 +    * https://www.highend3d.com/maya/script/persptoortho-for-maya
 +    * http://sortadone.blogspot.com/p/zbrush-focal-angle-tutorial.html
 +====== Image Picture to Model ======
 +
 +**Method 1 - Plane with Square Image then Knife Cut**
 +  * use square version of image as texture for a PolyPlane, then use knife tool to cut out like real life.
 +  * then extrude each part
 +
 +**Method 2 - auto version of method 1**
 +  * ref: (Quickly Convert an Image into a 3D Model) https://www.youtube.com/watch?v=j_LNqKb3zzY
 +  * select square PolyPlane, then Modify menu > Convert > Texture to Geometry
 +  * choose the square image, and Apply, then it will generate single Plane geo with cutting edge along auto traced color patch.
 +    * I think if you use illustrator image trace feature to pre-tune the color patch, you may have better output control
 +  * and each color patch is linked to a color material, use material linking for selecting each color patch for futher edit
 +  * compared to method 1: you may need to manually retop those inner edges.
 +
 +====== AI curve to Logo Model ======
 +
 +**Cleanup AI Curves**
 +  * Make sure ai curves are clean and simple ai file version instead with all those AI style and effects, best with just lines. One way to check is copy the AI curves and paste them in Photoshop as Path. then Export selected path to AI file from Photoshop File > Export path as ai file.
 +
 +**3D curves requirements**
 +  * all curves should be closed curves before into 3D app, unless you just a path
 +
 +  * Maya > Surface > Bevel Plus: https://www.youtube.com/watch?v=KQiojNyIF2I
 +    * workflow practice: 
 +      * https://www.youtube.com/watch?v=sCaYf4Ce2w0
 +      * https://www.youtube.com/watch?v=x7sHK1_hCuY
 +
 +<code javascript>
 +bevelPlus -ch 1 -js 1 -tol 0.01 -ns 4 -cap 4 -width 0.1 -depth 0.1 -ed 0.5 -bevelInside 0 -outerStyle 2 -innerStyle 2 -polygon 1 -no 1 -polyOutMethod 2 -polyOutExtrusionType 3 -polyOutExtrusionSamples 2 -polyOutCurveType 3 -polyOutCurveSamples 6 -polyOutUseChordHeightRatio 0 `ls -sl`;
 +</code>
 +
 +{{graphic:modeling:model_bevel.png|}} \\ {{graphic:modeling:model_bevel_tor.png|}}
 +
 +**Steps - version 001**
 +
 +  - Prepare and Clean AI
 +    * for one block of text with intersection area, Type > convert to outline first, then use pathfinder panel to convert into a clean cutout line, instead of all the shape lines. 
 +    * then export as EPS format for cleaner file format (illlustrator 3 eps)
 +  - Import AI logo
 +    * (optional) scale up 100x times, to avoid small bevel value error \\ {{graphic:modeling:ai_logo_step01_scale100_for_nosmallbevelerror.png|}}
 +  - Surface > Bevel Plus (**Important note: Please do each Bevel operation seperately for each independent geometry, means each output mesh should have all its face connected as a shell; also make sure select the Outline curve first then select inner hole curves; Also Curve direction has a impact on whether it convex inside or outside**)
 +    * keep bevel inside outside (but sometimes, bevel inside cause more problem than bevel outside, so in AI, make sure the trace image eat inside a bit with threshold if you use trace image to get the cutout line)
 +    * bevel: width 0.1 depth .3 extrusion 0.5; (most important factor is width, try it to get it right)
 +      * if you can turn bevel inside in channelbox, tune down width value until no "flying polygon face" issue
 +    * output Polygon: along extrusion section 1; along curve span 3; (so it won't be too high res for later smooth operation) 
 +      * or if you prefer sharp bevel without smooth operation, then try extrusion section 2; along curve span 6; or higher for a straight sharp out-of-box result
 +    * {{graphic:modeling:ai_logo_step02_bevelplusinside_wd_0.6_5_20_secspan_1_3.png|}}
 +  - Select the front and back Cap Face, then triangle the face to make it not a n-gon face
 +    * (optional) then quad the face \\ {{graphic:modeling:ai_logo_step03_triag_quad_caps.png|}}
 +  - (optional) Smooth the whole geo (may results worse result)
 +    * update 2016.718. actually I would avoid smooth at this stage as it mess up the topology too much, I will leave it same resolution with just trianglize \\ {{graphic:modeling:ai_logo_step04_smooth.png|}}
 +  - if you like smooth bevel edge, then export the part as obj
 +    * use Zbrush to ZRemesher it for re-topo and smooth out bad faces
 +    * ZRemesher setting: same count, adaptive 100 (means use more than polycount to get shape better), curve 50 (if you have used retopo brush to draw the guide lines, follow user line or by self more); 
 +    * divide with smooth, then flat brush and smooth brush to fix it bit
 +    * re do ZRemesher with half resolution and if needed, reduce to a polycount amount
 +    * ref: http://docs.pixologic.com/reference-guide/tool/polymesh/geometry/zremesher/ \\ {{graphic:modeling:ai_logo_step05_zbrush_zmesh.png|}} \\ {{graphic:modeling:ai_logo_step05_zbrush_zremesher.png|}} \\ {{graphic:modeling:ai_logo_step06_zbrush_zremesher_reduce_20per.png|}}
 +  - Then bring the Obj back to Maya to cleanup and smooth
 +
 +**Steps - version 002 (Maya and AI only workflow)**
 +
 +  * Before start, understand the problem and limitation of Maya Bevel plus,
 +    - bevel inside barely works, since Maya has hard time to push vertex inside without crashing vertex into each other, more a vertex level problem, thus we should solve the problem at higher level = means in Curve level
 +    - Since in order to keep the AI logo shape exact size or more like exact size of overall silhouette shape, and also we can't rely on Maya bevel inside operation, thus we have to outset  our curve inwards first in Illustrator, then bevel them outside to grow back to its original shape size
 +    - Please check image below, the lower one is the logo shape to create, and black color is solid and white color means holes; the higher one is the lower with path offset inward 5pt. \\ 
 +{{graphic:modeling:ai_logo_v001_step01_pathoffset.png|}}
 +  * Now Time to Go Maya, import EPS curve
 +    * like method 001, but this time, we select all the offset-inward-curves instead of original curves, and do the same bevel plus outside operation like before, and use bevel width to bring it shape size to original
 +      - note: make sure the inward do NOT intersect, you may need to fix some extreme dense cv points area by remove some cv to ease the tension in that area for polygon creation.
 +      - note: if some inner curves Don't convex out but convex in, then select those problem inner curves, and shift-right mouse menu > reverse curve, that will fix it
 +      - note: to increase the resolution of outline curvature polygon counter, just boost up the curve span to 20 \\ {{graphic:modeling:ai_logo_v001_step04_resolution.png?500|}}
 +      - here is the compare of method 002 (inner offset + bevel outside) vs method 001 (just bevel outside); clearly, the method 002 white color output polygon is better in matching original green profile curves while still got good edge loops in the bevel \\ {{graphic:modeling:ai_logo_v001_step02_comparewithmethod001.png?461|}} \\ {{graphic:modeling:ai_logo_v001_step02_bevelwithinnercurves.png?500|}}
 +    * compare to traditional method, inner-outer polygon-edge bridge with fill hole operation, the method 2 still outperform in both bevel area topology and editing speed \\ {{graphic:modeling:ai_logo_v001_step03_comparewithpolygonmethod.png?475|}}
 +    * Last, ready to trianglize the cap faces and send to other render or just directly render in Maya
 +
 +====== CAD NURBS to Polygon Workflow  ======
 +
 +  * Maya Standard Fit convertion vs Genral Fit convertion (General Fit is better) \\ {{graphic:modeling:modeling_cad_001_standfit_vs_generalfitbetter.png?600|}} \\ {{graphic:modeling:modeling_cad_002_standfit_vs_generalfitbetter.jpg?600|}}
 +  * Maya Standard Fit convertion vs Genral Fit convertion vs Count Fit convertion at 200 \\ {{graphic:modeling:modeling_cad_003_standfit_vs_generalfitbetter_vs_count200.png?600|}} \\ {{graphic:modeling:modeling_cad_004_standfit_vs_generalfitbetter_vs_count200.jpg?600|}}
 +
 +====== Polygon to Wire Model ======
 +
 +**Wire Model** (inspired by: https://vimeo.com/entagma/videos)
 +  * Geo > Particle > Spine through particle > Paint Effect > Geo 
 +
 +{{:graphic:modeling:code_wiremodel_v001_screenshot.jpg?450|}} {{:graphic:modeling:code_wiremodel_v002_screenshot.png?450|}}
 +
 +Code : <code python>
 +# a code to connect all the particle by a linear spline curve
 +import maya.cmds as cmds
 +from operator import itemgetter
 +import math
 +
 +#  step 01: create particle system on the character to generate random points on surface for connections
 +particleSys = "particle1"
 +cnt = cmds.particle(particleSys, q=1,ct=1)
 +pos = []
 +for i in range(cnt):
 +    pos.append( tuple(cmds.particle( particleSys, q=1,at="position", id=i)) )
 +
 +# result method A, single curve along all the points
 +cmds.curve(n="myCurve",d=1, p=pos)
 +# then you can use paint effect to make it into a easy animatable polygon
 +# then convert paint effect into polygon
 +
 +# result method B, seg all the nearby 10 points, 
 +#(actually I should have checked the max distance allow, so no fly line from top to bottom for last few lines
 +myGrp = cmds.group(n='myGrp',em=1) # a group to hold all the seg curve for cleaner outliner
 +
 +# loop through each point, and connect to the left rest points
 +for i in range(cnt-1):
 +    connect = 10 # how many connections per point
 +    curPoint = pos[i]
 +    otherList = pos[(i+1):]
 +    # get all the distance from current point to left rest points
 +    tmpDisList = [ distance(curPoint, otherPoint) for otherPoint in otherList ]
 +    result = enumerate(tmpDisList)
 +    resultSort =  sorted(result , key=itemgetter(1)) # get smallest distances
 +    for j in range(connect):
 +        endPointId = i + 1 + resultSort[j][0]
 +        endPointPos = pos[endPointId]
 +        # if u want check max distance allowed for drawing, eg. 5 unit
 +        #if resultSort[j][1] < 5: 
 +        tmpC = cmds.curve(n=("curveSeg_"+str(i)+"_"+str(endPointId)), d=1,p=[pos[i], endPointPos])
 +        cmds.parent(tmpC, myGrp)
 +
 +def distance(a,b):
 +    return math.sqrt(math.pow((a[0]-b[0]),2) + math.pow((a[1]-b[1]),2) + math.pow((a[2]-b[2]),2))
 +
 +################ brush
 +# for the brush of so many seg, better test for one curve first, and tweak brush global size
 +# after ready, select all the curve that you like to brush, then connect curves to the strock object
 +curveList = cmds.ls(sl=1) 
 +for i in range(len(curveList)): 
 +    cmds.connectAttr(curveList[i]+".worldSpace[0]", "stroke1.pathCurve["+str(i)+"].curve", f=1)
 +    
 +# then convert paint effects to polygon, done
 +</code>
 +====== To Study ======
 +
 +  * football modeling: https://vimeo.com/13186699
 +===== UV unfolding tool =====
 +
 +  * UV size unify tool: 
 +    * http://www.creativecrash.com/maya/downloads/scripts-plugins/texturing/c/checker-size-tool
 +
 +  * a uv scale unify tool for Max
 +    * http://www.ldaustinart.com/paul/index.php?cat=scripts&type=max
 +
 +===== Modeling guidelines =====
 +
 +  * Cease vs Edge Loop: http://www.youtube.com/watch?feature=player_detailpage&v=xFZazwvYc5o#t=1672
 +
 +
 +===== Procedural modeling =====
 +
 +  * DNA of nature build
 +
 +  * algorithm based modeling:
 +    * http://www.ted.com/talks/michael_hansmeyer_building_unimaginable_shapes.html
 +    * http://michael-hansmeyer.com/projects/projects.html?screenSize=1&color=1
 +
 +
 +  * pipe modeling script:
 +    * http://www.youtube.com/watch?feature=player_embedded&v=4Sh1x4JHRsg
 +
 +
 +===== Texture to Logo Model =====
 +
 +  * Modify > Convert > Texture to Geometry
 +    * https://youtu.be/WxlLUDZQS6E
 +
 +====== Modeling and Texture workflow ======
 +{{graphic:model_texture.jpg?600}}
 +===== speed modeling and quick painting in maya =====
 +
 +3D Painting in Maya
 +  * modeling as you know
 +  * quick uv out and assign a material
 +  * Texturing menu > 3D Paint Tool (check box) > File textures tab: 
 +    * select a channel, then click Assign Texture button with model selected
 +    * continue to paint till finish
 +    * the texture file is saved at ./3dPaintTextures/3Dpaint1/file1.iff
 +    * click Save Textures button in the tab when finished (you need to save scene first)
 +  * In order to paint texture on the color map
 +    * click on the Brush tab: Paint effects: Edit template brush
 +    * Paint Effects brush setting
 +      * Texturing tab (texture type: file; map method: tube 2d with brush size or full view with uv)
 +      * to save: Paint Effects menu > Save brush preset to shelf
 +
 +manual brush preset code
 +<code mel>
 +ResetTemplateBrush;
 +rename (getDefaultBrush()) myBrush;
 +setAttr myBrush.globalScale 5;
 +setAttr myBrush.mapColor 1;
 +setAttr myBrush.textureType 4;
 +setAttr myBrush.mapMethod 2;
 +setAttr myBrush.repeatU 1;
 +setAttr myBrush.repeatV 1;
 +setAttr -type "string" myBrush.imageName "images/grass.jpg";
 +</code>
 +
 +
 +Sculpting with displacement map
 +  * paint displacement map with 3D painting tool
 +  * convert to polygon by Modify menu > Convert > Displacement to polygons
 +  * mesh menu > reduce and cleanup maybe needed
 +
 +Scultp with Sculpt geometry tool
 +  * select the mode
 +  * Mesh menu > Sculpt Geometry Tool
 +
 +reference:
 +[[http://download.autodesk.com/us/maya/2010help/index.html?url=Open_water_effects_Convert_wave_displacement_to_polygons.htm,topicNumber=d0e433674|maya doc]]
 +[[http://www.spafi.org/index.php?option=com_content&task=view&id=487&Itemid=25|map based terrain creation]]
 +
 +===== Soft corner =====
 +
 +Method
 +  * crease : render time subdiv based softcorner method, depends on render support
 +  * edge loop + smooth : traditional way of doing that
 +  * [[http://www.youtube.com/watch?v=lEnsEGlFsBQ|round corner]] : mentalray specific render time solution
 +
 +{{graphic:modeling:modeling_edge_loop_and_round_corner_and_crease.jpg?600|}}
 +
 +===== reference and LOD =====
 +
 +  * to do
 +
 +===== Shape to Shape modeling =====
 +
 +  * square to circle \\ {{graphic:modeling:modeling_square_to_circle.png?450|}}
 +  * circle to square \\ {{graphic:modeling:modeling_circle_to_square.png?450|}}