Coder Social home page Coder Social logo

Comments (5)

GoogleCodeExporter avatar GoogleCodeExporter commented on August 18, 2024
The following line (1612 as of this writing) in cellblender_operators.py is no 
longer working:

mol_pos_mesh.vertices.foreach_set("normal", mol_orient)

However it is still possible to set the normals manually as in the following 
for loop:

for idx, vert in enumerate(mol_pos_mesh.vertices):
    setattr(vert, "normal", mathutils.Vector((mol_orient[idx*3], mol_orient[idx*3+1], mol_orient[idx*3+2])))

I have not timed this to see if it's any slower than the original method. This 
would be worth looking into.

Also, I posted a bug report to the Blender developers about this problem, and 
it's targeted to be investigated.

Original comment by [email protected] on 27 Feb 2013 at 7:49

from cellblender.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 18, 2024
On second thought, I suppose this would be a more sensible/clearer alternative 
than using setattr:

for idx, vert in enumerate(mol_pos_mesh.vertices):
    vert.normal = mathutils.Vector((mol_orient[idx*3], mol_orient[idx*3+1], mol_orient[idx*3+2]))

:)

Original comment by [email protected] on 27 Feb 2013 at 8:10

from cellblender.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 18, 2024
It's been reported that there is a fix in the Blender svn repo.  

Original comment by [email protected] on 28 Feb 2013 at 5:04

from cellblender.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 18, 2024
The workaround is definitely slower. With 100,000 molecules, it takes about 
0.004 seconds to set the normals with the original method and about 0.135 
seconds with the workaround.

Original comment by [email protected] on 28 Feb 2013 at 8:23

from cellblender.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 18, 2024
A fix was added for Blender 2.66a.

Original comment by [email protected] on 12 Mar 2013 at 4:15

  • Changed state: Fixed

from cellblender.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.