예제 #1
0
ValueNode::Handle
CanvasTreeStore::expandable_bone_parent(ValueNode::Handle node)
{
	if ((!getenv("SYNFIG_DISABLE_EXPANDABLE_BONE_PARENTS")) &&
		node->get_type() == ValueBase::TYPE_VALUENODE_BONE &&
		(node->get_name() == "constant" || node->get_name() == "animated"))
		if (ValueNode::Handle bone_node = (*node)(canvas_interface()->get_time()).get(ValueNode_Bone::Handle()))
			return bone_node;
	return node;
}
void
ValueNode_Random::randomize_seed()
{
	int i = get_link_index_from_name("seed");
	ValueNode::Handle link = get_link_vfunc(i);
	if(!link->is_exported() && link->get_name() == "constant")
	{
		int seed = time(NULL) + rand();
		if (seed < 0) seed = -seed;
		random.set_seed(seed);
		set_link(i, ValueNode_Const::create(seed));
	}
}