-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tagging Sverchok generated meshes + future of bmesh viewers #1
Comments
bm_from_pydata we use the bm.to_mesh(obj.data) works great.. I just realized that this may be just as simple: import bmesh
bm = bmesh.new()
bm.to_mesh(obj.data) # assign empty bm to Mesh
bm.free()
obj.data.from_pydata(verts, edges, faces) # fill using existing from_pydata function but it hasn't been tested yet.. smooth_all ideasman42 has encouraged me to write a bmesh operator (in C) to do this - no ETA on that. but this is not that bad.. def set_smooth(ob):
mesh = ob.data
smooth_states = [True] * len(mesh.polygons)
mesh.polygons.foreach_set('use_smooth', smooth_states)
mesh.update() groups or parented I find parenting quite a bit more useful than groups, and it should be perhaps a default behaviour so as never to overwhelm the outliner with 100's of real objects.. naming well I don't know ... this is hairy code that solved a problem, i'm not convinced there's a more elegant way. It's not crazy to have full control over the object names, maybe the Empty used to keep them together should get the basename and all meshes should be basename+.0000(index) |
In any case, the implementation of these nodes all share a lot in common and should be a baseclass , maybe called |
paranting. i made today that script to share objects over others. import bpy
from mathutils import Matrix, Vector
obj = bpy.context.selected_objects
o = bpy.context.active_object
locata = o.matrix_local.copy()
data = o.data
name = o.name
for o in obj:
if o.name != name:
ob = bpy.data.objects.new(name+'_duplicatio', data)
ob.matrix_local = locata
bpy.context.scene.objects.link(ob)
ob.parent = o |
the proposition is to put in |
My concern with using RNA properties is that the property gets added to all Objects in the scene, whereas a simple ID property is only added to the single object in question. With relative ease a collection of ID properties could work and hold the same kind of data as an RNA property. Which fields / data points would the RNA need to store? The up-side to using RNA would be that we could make CollectionProperties, the downside it seems is that they aren't dynamic and all member types /props of a collection must be defined in the This leads me to believe a truely adaptive method would be as a serialized |
the upside of serialized storage (dict, or json) would be convenient layout portability built in. parsing a collection property if you want to serialize a layout (like we do with the json exporter) is another point of pain. I don't mean to be negative, but I have these concerns about RNA. |
Id properties is a good compromise |
rna more global, sure you right, there is no strong need now to use rna, id is ok. |
I think the tricky logic of bmesh / curve / typography is solved to some extent in the existing viewers, especially bmeshviewer2 shows how to use id properties like:
Allowing a string means it could hold complex
json
and store parametric data about the object. or it could store just an ID reference to a sverchok-database which holds parameteric information about objectsThe text was updated successfully, but these errors were encountered: