Comments (6)
The Time Info node just returns the value of self.nodeTree.scene.frame_current_final
, so you can use that. Or are you talking about something different?
from animation_nodes.
nodeTree.scene.frame_current_final
Hi Omar:
According to your previous posts, I changed cython coding to generate below:
myfalloff = my_wiggle_falloff.WiggleFalloffNode.execute(my_wiggle_falloff.WiggleFalloffNode, 0, 100.0, 1.0, 0.5, 0.5, 2, 0.3)
myoffset = (0, 0, 1)
myoffsetvectornodecls = my_offset_vector.OffsetVectorNode()
myvectors = myoffsetvectornodecls.execute_List(vertexLocations, myfalloff, myoffset)
I just have no idea how to link self.nodeTree.scene.frame_current_final with evolution in myfalloff.
I tried to add animation but failed:
for i in range(50):
context.scene.frame_set(i)
frame = scene.frame_current_final
outmesh = bpy.data.meshes.new(name="Target")
myobj = bpy.data.objects.new("Target", outmesh)
bpy.context.collection.objects.link(myobj)
..get meshData and setMesh(outmesh, meshData, myobj)
And then in the loop, I generated 50 Target objects, but no animation.
Thank you for the help!
from animation_nodes.
evolution
is the third argument to the WiggleFalloffNode.execute
function, so passing the frame number instead of 100 in your example should be what you need. Though this seems rather hacky, that is, to execute the nodes manually, so not sure if it is worth doing it that way.
from animation_nodes.
context.scene.frame_set(i)
frame = scene.frame_current_final
Thanks Omar for the reply. No real use indeed just for testing Cython.
for i in range(50):
scene.frame_set(i)
frame = scene.frame_current_final
myfalloff = my_wiggle_falloff.WiggleFalloffNode.execute(my_wiggle_falloff.WiggleFalloffNode, 0, i, 1.0, 0.5, 0.5, 2, 0.3)
myoffset = (0, 0, 1)
myoffsetvectornodecls = my_offset_vector.OffsetVectorNode()
myvectors = myoffsetvectornodecls.execute_List(vertexLocations, myfalloff, myoffset)
try:
meshData = Mesh(myvectors, edgeIndices, polygonIndices, skipValidation = skipValidation)
if len(materialIndices) == len(polygonIndices) and materialIndices.getMinValue() >= 0:
meshData.insertBuiltInAttribute(Attribute("Material Indices", AttributeType.MATERIAL_INDEX, AttributeDomain.FACE, AttributeDataType.INT, materialIndices))
else:
print("Invalid material indices.")
except Exception as e:
print(str(e))
print(meshData)
outmesh = bpy.data.meshes.new(name="Target")
myobj = bpy.data.objects.new("Target", outmesh)
bpy.context.collection.objects.link(myobj)
meshDataType = "MESH_DATA"
if meshDataType == "MESH_DATA":
setMesh(outmesh, meshData, myobj)
elif meshDataType == "BMESH":
setBMesh(outmesh, bm)
elif meshDataType == "VERTICES":
setVertices(outmesh, meshData.vertices)
But I failed to generate animation but got 50 Target Objects instead.
In mesh_object_output.py.py, I noticed that animation is built by below, but no idea how to proceed?
if not isAnimated(mesh):
mesh['an_helper_property'] = 0
mesh.keyframe_insert(data_path = '["an_helper_property"]')
from animation_nodes.
To clarify, do you actually want an animated mesh? In that case, this will not work, and the creation of multiple meshes is expected. Animation Nodes is able to animate meshes because it executes on frame changes and adjusts the mesh directly instead of creating a new one.
from animation_nodes.
To clarify, do you actually want an animated mesh? In that case, this will not work, and the creation of multiple meshes is expected. Animation Nodes is able to animate meshes because it executes on frame changes and adjusts the mesh directly instead of creating a new one.
Got it! Thanks!
from animation_nodes.
Related Issues (20)
- Python version mismatch, Blender 4.1a HOT 2
- Windows compile error: LINK : fatal error LNK1181: cannot open input file 'FastNoiseSIMD_windows.lib' HOT 2
- Distribute Linear on Scene Change keeps triggering the Node Tree
- Mesh execution problem in Blender 4.0.2 HOT 2
- Proper socket is missing for a new input to Expression node HOT 3
- Animation Nodes for Python 3.10 ? HOT 2
- Build to python 3.10.12 HOT 1
- failed to enable the addon HOT 1
- Python Version Mismatch HOT 1
- mac blender 4.0.1 install failled HOT 1
- failed with exit code 1104 link.exe HOT 8
- Can someone create build with python 3.10.13?
- Real instances problem
- Python version mismatch HOT 1
- Mesh object output error HOT 5
- Can't install Animation Nodes in Blender 4.0.2 HOT 5
- Animation nodes do not update in viewport when linked with Geo Nodes HOT 1
- Upgrading Code HOT 4
- Ctrl+A Typing will cause instant Crash HOT 7
- Python version mismatch (Blender 4.1.1) HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from animation_nodes.