johnroper100 / crowdmaster Goto Github PK
View Code? Open in Web Editor NEWCrowd Simulation for the Masses
Home Page: http://crowdmaster.org
License: GNU General Public License v3.0
Crowd Simulation for the Masses
Home Page: http://crowdmaster.org
License: GNU General Public License v3.0
Hello I was following your tutorial on setting up random color's I added a template random node from 2:29 from your tutorial at https://www.youtube.com/watch?v=K-mMQ8zfZHU and it doesnt have anywhere to type in rand_ like you have in your video. Is there another way to achieve the same random color effect? thanks.
Someone had noticed in other crowd systems that when the agent slows down to not creash into somebody or something, it's animation slows down as well. Any ideas as to if this is dooable?
Method to check brain graph (like the gen nodes). If not valid stop sim and highlight incorrect node. Check for loops in the graph. Loops in state machine allowed but not logic.
Current behavior (both Sim and Gen exhibit this behavior):
Expected behavior:
NOTE: On face value it looks like Gen and Sim noodles are saved when the even if no users are linked when no zero is displayed as the User count is not being reduced (note I believe this can lead to noodles disappearing unexpectedly... see next Issue). Most datablocks are purged when the session ends (I believe actions may be an exception). If the system is meant to be designed like this the do you need the Fake user option all all?
To reproduce 1 - 0 not appearing. Example is Gen but Sim acts the same way:
Step 1: Create a new Gen noodle. Unlink the noodle by press in the X button. Bring up the browse node tree list of datablock. The "0" is missing.
To reproduce 2 - Fake user not being added to displayed user count.
Step 1: Create a new Gen node. Press the F button. No change - compare with snapshot from a material with fake user added.
Current behavior: If you have a agent that is child object of a bone, when resetting the group if you have either the agent bone or the originating bone in Pose mode it will generate a python error. The group cannot be reset. Same error occurs if bone in Edit mode.
Expected behavior: Group is reset as if both bones are in Object mode.
Steps to repeat:
Step 1: Set up a noodle as in the image below. Armature and Mesh are not grouped or parented. Set up an empty as the agent generation target.
Step 3: Change originating armature into Pose mode
Step 4: Select group in tool panel (if not selected). Reset group from Tools panel. Python error will appear. Group, armature and mesh remain.
Step 5: Select the Agent armature bone and change to Pose mode.
Step 6: Select group in tool panel (if not selected). Reset group from Tools panel. Python error will appear. Group, armature and mesh remain.
To repeat for Edit mode same instruction, replace Pose mode with Edit mode.
Add distance factor as output for flocking.
startDistFac = (co_find - start).length / radius
When using LinkArmature node and generate agents, group objects are at expected places but proxies created for linked armatures are always at zero. There's no much information on it even in docs.
For example, Say, in LinkArmature node, following are input values
.....etc,.
Expected output is, Even proxies(cm_grpTest.XXX_proxy) should be at same position as groups (cm_grpTest.XXX)
In the Agent Generation node editor you can connect the output of more than one node to the input of another node (see image attached). Seems to break Blender convention of one input per socket and may lead to unexpected outcomes for users.
Suggested behavior is when an new input is connected to a socket with an existing input, the existing input is deleted and replaced with the new input (in line with the compositor).
Simulation node editor has not been tested for same behavior but suggest that it should also conform to a single input into a socket.
Any Ida's on how these could be integrated? All other crowd simulators have them.
So, currently the agent generation in https://github.com/johnroper100/CrowdMaster/blob/master/cm_agent_generation/generation.py works, but it gives each object in the group a different location. I tried to fix this by putting the location outside of the objects loop:
newLoc = (random.uniform(locationVector[0], scene.randomPositionMaxX), random.uniform(locationVector[1], scene.randomPositionMaxY), ground.location.z)
for o in group_objects:
but this still does not work.
IF you generate agents and then use Undo (Ctrl+Z) then it undoes the operation prior to Agent Generation. for the relevant view.
To repeat:
Step 1 - create a simple Generation noodle.
Step 2 - do some form of operation and view the history (F3 in 3D view). Example: Resize the cube
Step 3 - Generate Agents and view change history - Agent generation is not part of the History.
Step 4 - Undo and it will undo generation AND the previous operator resulting in the cube reverting to previous size.
I understand that you can regenerate the agent system by hitting Agent Gen again. However, it is natural for people to use Undo which may lead to unexpected results and unhappy users.
Current behavior: When one set of auto agents is generated it resets the previously auto generated agents meaning you can only have one set of auto generated agents at a time.
Expected behavior: Only the agents for the Generated group generated, no other groups are reset.
Note 1: Added manual agent group and had it selected in the View Group Details panel when generating second group. No change in behavior.
Note 2: you can workaround this issue by combining the nodes together into one.
Steps to repeat:
Step 1: Open sample file.
groups overwriting.zip
Step 2: Select Gen - Cube noodle for agent generation. Generate Agents. Cube will appear and Cube brain group will be listed in the View Group Details panel list.
Step 3: Select Gen - Sphere noodle for agent generation. Generate Agents. Cube agent previously generated will be deleted along with Cube brain group. Sphere will appear and Sphere brain group will be listed in the View Group Details panel list.
Step 4: Select Gen - Cube noodle for agent generation again. Generate Agents. Now Sphere agent previously generated will be deleted along with Sphere brain group. Cube will appear and Cube brain group will be listed in the View Group Details panel list.
Can reroute nodes have multiple inputs? If we implement our own reroute will it be used when pressing shift-click? Use to group dependencies.
Add option to Sound channel to return the relative velocity of emitter towards receiver (and compare results to predictive collision detection).
I noticed that CrowdMaster is missing the standard GPL 3 licensing block at the head of all of the script files. Would you like me to add these?
UI: For both the Gen and Sim context when changing between context Blender "forgets" which noodle that was last selected causing the user to have to reselect the noodle from the list to be able to edit.
Expected behavior: When moving between other contexts the last noodle being edited is displayed. e.g If you create a new material noodle then move to another node context then back it will still be displayed.
To repeat for Gen (for Sim just replace in step):
Step 1 - Create a new Gen noodle.
Step 2 - Change context to any other to any other (composite, texture, material or Sim)
Step 3 - Change context back to context to Gen - the noodle has disappeared
Even without random rotation the agents objects do not move into their random locations as they should.
The generation code can be found in https://github.com/johnroper100/CrowdMaster/blob/master/cm_agent_generation/generation.py
I just installed the CrowdMaster Addon but am having trouble with the Generate Node. The 'Generate Agents' button doesn't show.
I am using Blender 2.78 & CrowdMaster 1.2.1
To test if it was a mistake in my node setup, I have downloaded the sample files from the CM website, the 'Generate Agents' button does not show on the Generate Node either however.
Has anyone come across this issue before?
Current behavior: If you select a non-vertex object e.g. empty, armature, spline, text, etc... from the drop down list for guide mesh in the Mesh node, generating agents will throw a Python error.
Expected behavior: List of objects to select from is filtered so it only shows legitimate mesh objects. Is this is not possible then fails gracefully with a meaningful error message.
Steps to reproduce:
Step 1: Replace default cube with an Empty or other non-mesh object (text, armature, etc)
Step 2: Set up a noodle as per the image below.
Step 3: Select Empty and hit Agent Generation. Error will occur.
Crowdmaster 1.3.0 - develop
Last commit 59bca6f
Windows 10
Blender 2.78b
Represent values for each agent in the 3d view port.
When the CrowdMaster folder is dropped into the addons folder in Blender program files, the addon shows up in the user interface, but it gives an error when trying to enable it.
Behaviour: Agent Generation and Simulation node tree are saved, the file closed. Upon reopening both node trees are missing in the dropdown and have to be remade.
Anyone else experiencing this? Thx.
make combine node rotatable (rather than just rotating individual elements of combine. Or make offset work in local coordinates.
Output is
FAILED (errors=1)
Info: Total files 0 | Changed 0 | Failed 0
.Error: You must save your file first!
E..
======================================================================
ERROR: testStartStopSim (CrowdMaster.cm_tests.AddonRegisterTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/fabian/.config/blender/2.80/scripts/addons/CrowdMaster/cm_tests.py", line 40, in testStartStopSim
bpy.ops.scene.cm_start()
File "/home/fabian/Programme/blender-2.80-4a3348cfe04-linux-glibc219-x86_64/2.80/scripts/modules/bpy/ops.py", line 192, in __call__
ret = op_call(self.idname_py(), None, kw)
RuntimeError: Error: You must save your file first!
----------------------------------------------------------------------
Ran 4 tests in 0.067s
FAILED (errors=1)
Please see my folk and pull request for relevant updates.
Agents can now request specific positions in formations (by index number of the vertex in the guide mesh) but to make this useful each agent needs to request a different position. I think an option would be to have the generation script assign a vertex index to each agent as an agent variable (a dictionary called agvars stored in each agent object for things like this. At the end of each frame the resulting variables in agvars are moved to access to be used) based on where the script places the agent. The attached file demonstrates how it might be used. The input string would look something like: Formation.A.fixedDist(State.userObject.vars["targetID"]). I don't really understand how the generation script is working so I can't finish formation for the moment.
Assign tags in formation positioning nodes.
@TheDuckCow @Peter-Noble I am moving the talk about nodes for agent generation to here just to keep things neat.
To recreate:
Currently, there is a random rotation value. This does not seem to work for some reason and I have gone through multiple different revisions of code. You can see what I mean if you open the test scene and just press Run Sim. The random rotation and the actions should already be set up. @niewinny @TheDuckCow Could one of you take a look at this?
I recreated the mingle scene from Inaite with CrowdMaster nodes. I have not changed any of the node code and I kept all the values exactly the same, but when I ran the sim, each object got three keyframes right at the beginning of the animation the stopped. I will attach a file when I have a chance.
When generating agents, if you use a single object as the geometry input, defer geo works. If you use a group as the input, both the objects and the empties are created.
Background: Most datablocks will be not be saved if there are no users linked (see here: https://docs.blender.org/manual/en/dev/data_system/data_blocks.html).
Crowdmaster node tree datablocks with a User Count of 0 are not written on save and purged on exiting a Blender session effectively deleting them forever like most other data blocks. Note there is a previous issue raised that unlinking a datablock does not reduce the user count for that session only and so may still be saved (#29).
Issue: If you create multiple Sim and/or Gen datablocks they will all save because of issue #29 even if unlinked. When you close and reload the file only the Sim or Gen datablock(s) displayed will not have a User count of 0. Any node trees you load into the node editor will also be updated and not have a 0 next to their name in the nodetree browser list. Any unloaded node trees will have a 0 next to their name in the node tree browser list from the datablock and will not be saved and are purged on exit ๐ฅ ๐ฑ
Steps to recreate:
Step 1: Create two Sim node trees and two Gen node trees. In the node tree browser list they will not have 0 next to their name. Leave one of the node trees displayed (I have used Brain 2 in this example) and save file. Exit blender.
Step 2: Reopen blender file. In the node tree browser list the displayed node tree will not have 0 next to it's name. All the other Sim and Gen node trees will have 0 next to their name. Save file and exit Blender.
Step 3: Reopen file. Displayed node tree will remain - all other node trees will have been deleted
Step 4: Hope you have a backup!!! ๐ฐ
Hi, I am looking for a tool which would evacuate hundreds of agents from a multi-storey buildings. Is your tool capable of that?
As more developers join on, it would be nice to have somewhere to chat and pass around ideas. What would you think of a slack channel for CrowdMaster?
Current behavior: Add to Group node creates a Crowdmaster Group - but does not assign agents to the group (count is 0 after generation).
Expected behavior: Generated agents are assigned to Group.
Steps to reproduce:
Step 1 - create Gen node like the one in image. Press Generate Agents. Note the three positions indicated with a ห
have been tried and all resulted in no agents being assigned to a group.
Note: Have tried adding multiple objects and multiple templates in case a group had to have more than one object/template. Have also tried saving, exiting and reloading in case it is a refreshing issue. In both cases error still occurs.
Crowdmaster 1.2.1
Windows 10
Blender 2.78b
Current behavior: After generating a sim if you move the current frame to any frame other than frame 1 and save the file when you generate the sim again it returns the current frame 1 but the agents start from where they were on saved frame. This necessitates a "regen" of the agents to get them back to their starting position, which if generated randomly cannot be identical to what you had before...
Note 1: I am assuming this is not an undocumented "feature" allowing you to set the start point of your sim.
Note 2: Cannot test if this also occurs with frozen agent groups due to issue #31
Expected behavior: Agents always start from frame 1 in their original position.
Steps to reproduce
Step 2: run sim to at least frame 100. Does not seem to matter if you interrupt the sim part way through or let it run all the way to the end.
Step 3: Move to frame 100 and save file
Step 4: Regenerate Simulation - agents start in Frame 100 position.
Instead of calculating several times cache results.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.